diff --git a/assets/AIChatPage-CzCeFujm.js b/assets/AIChatPage-CzCeFujm.js deleted file mode 100644 index 47889f1a4478141c177c5c867a6cf285989e0203..0000000000000000000000000000000000000000 --- a/assets/AIChatPage-CzCeFujm.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/apiService-axx1LHMk.js","assets/index-D4nJsLyx.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-BML5nJHm.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css"])))=>i.map(i=>d[i]); -import{y as B,_ as F,e as N,m as k}from"./index-D4nJsLyx.js";import{r,j as e}from"./vendor-react-Dexh7fmo.js";import{B as $}from"./button-BpeUVhBo.js";import{I as S}from"./input-DBkKXOmF.js";import z from"./ChatMarkdown-B34PtYCE.js";import{P as O}from"./plus-BxxucBR0.js";import{S as H}from"./search-Do6u3pFt.js";import{T as Y}from"./trash-2-BoXE_mye.js";import{S as D}from"./send-NQY-QTkN.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-markdown-C5ikSDMA.js";const ie=()=>{const{sessions:C,activeSessionId:a,isLoading:l,loadingSessionId:I,setActiveSessionId:i,createNewSession:u,sendMessage:A,deleteSession:L,getActiveSession:T}=B(),[d,_]=r.useState(""),[o,f]=r.useState(""),[b,y]=r.useState(!1),c=r.useRef(null),x=r.useRef(!0),m=r.useRef(!1),n=T(),h=n?.messages||[],M=h.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),g=l&&a===I&&!M,j=(t="auto")=>{const s=c.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},P=()=>{const t=c.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},E=()=>{x.current=P()};r.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./apiService-axx1LHMk.js");return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),r.useEffect(()=>{if(!x.current)return;const t=window.requestAnimationFrame(()=>j("auto"));return()=>window.cancelAnimationFrame(t)},[h,g]),r.useEffect(()=>{x.current=!0,j("auto")},[a]);const v=async()=>{if(!(!o.trim()||l||b||m.current)){m.current=!0,y(!0);try{let t=a;t||(t=u(),i(t));const s=o.trim();f(""),await A(t,s)}finally{m.current=!1,y(!1)}}},w=()=>{const t=u();i(t)},R=(t,s)=>{s.stopPropagation(),L(t)},p=C.filter(t=>t.title.toLowerCase().includes(d.toLowerCase())||t.preview.toLowerCase().includes(d.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex gap-4 px-4 sm:px-6 xl:px-10 py-6",children:[e.jsxs("div",{className:"w-80 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-2xl flex items-center justify-center",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-10 h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),e.jsxs("button",{onClick:w,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-4 py-3 rounded-xl text-sm font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-2",children:[e.jsx(O,{size:18}),"New Chat"]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(H,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(S,{type:"text",placeholder:"Search conversations...",value:d,onChange:t=>_(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[p.length," Conversations"]})}),e.jsx(N,{children:p.map(t=>e.jsxs(k.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>i(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${a===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${a===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>R(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Y,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${a===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),p.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-16 h-16 object-contain mx-auto mb-2 opacity-60 drop-shadow-sm grayscale contrast-50"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),e.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628]",children:n?.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:n?.date})]}),e.jsx("div",{className:"flex items-center gap-2",children:n?.topics.map((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref:c,onScroll:E,className:"flex-1 overflow-y-auto overscroll-contain p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(N,{children:h.map(t=>e.jsx(k.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(z,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:t.timestamp})]})},t.id))}),g&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(S,{type:"text",value:o,onChange:t=>f(t.target.value),onKeyPress:t=>t.key==="Enter"&&v(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx($,{onClick:v,disabled:!o.trim()||l||b,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(D,{size:18})})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-r from-sky-100 to-cyan-100 rounded-3xl flex items-center justify-center mb-6",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),e.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),e.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),e.jsx("p",{className:"text-[#5a6578] mb-6 max-w-md",children:"Your personal AI math tutor is here to help! Start a new conversation or select one from the sidebar."}),e.jsx("button",{onClick:w,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{ie as default}; diff --git a/assets/AdminDashboard-BmyikugA.js b/assets/AdminDashboard-BmyikugA.js deleted file mode 100644 index 2f3dbb9293dac31ea8ee510f4b1c348204caf6e3..0000000000000000000000000000000000000000 --- a/assets/AdminDashboard-BmyikugA.js +++ /dev/null @@ -1,63 +0,0 @@ -import{j as e,r as x}from"./vendor-react-Dexh7fmo.js";import Qe from"./Sidebar-xBQ3Qnyw.js";import Ne from"./ConfirmModal-DGrnpObD.js";import{B as E}from"./button-BpeUVhBo.js";import{I as R}from"./input-DBkKXOmF.js";import{R as Je,C as Ke,a as Ze,T as Ye,D as et,P as tt,O as st,b as at,I as lt,F as rt}from"./vendor-radix-BRdei-zg.js";import{c as G}from"./utils-BQQgILNW.js";import{X as nt}from"./x-BONnp2RF.js";import{S as V,a as H,b as W,c as X,d as A}from"./select-Co4o1EaI.js";import{f as $,e as z,q as ne,o as ie,l as Pe,w as it,u as Le,a as J,d as ce,m as we,c as Re}from"./vendor-firebase-firestore-BML5nJHm.js";import{c as B,d as M,u as Se,t as T,m as L,T as be,Z as Ie,D as ct,f as dt,h as ot,F as xt}from"./index-D4nJsLyx.js";import{R as ke,F as mt,V as ht,I as ae,D as ee}from"./video-CS-NQBfT.js";import{P as Ee}from"./plus-BxxucBR0.js";import{L as F}from"./loader-circle-J8Mwbkkw.js";import{C as ut}from"./circle-check-big-0Gzyt_f3.js";import{P as Te}from"./pen-line-Vok2l3fc.js";import{T as je}from"./trash-2-BoXE_mye.js";import{S as Ae}from"./search-Do6u3pFt.js";import{U as de}from"./users-HMf2sdE3.js";import{B as O}from"./book-open-BH50GByv.js";import{C as pt}from"./circle-help-BmjHdT5a.js";import{C as ve}from"./calendar-BJ8oE6yW.js";import{C as le}from"./circle-alert-CBefjicJ.js";import{S as Z}from"./shield-L33jkK5w.js";import{E as gt}from"./eye-DXdRafOv.js";import{S as ft}from"./LogoutActionButton-FS5OGZjL.js";import{B as bt}from"./bell-CbSbac2W.js";import{G as jt}from"./globe-BMa4SWkV.js";import{S as vt}from"./save-Og8yP5Yb.js";import{G as Ce}from"./graduation-cap-Df8fGPxp.js";import{T as $e}from"./target-D7SVtf3g.js";import{C as yt}from"./clock-DUJO-a50.js";import{A as re}from"./award-oJTbc9W5.js";import{B as Nt}from"./brain-CPvGdgWE.js";import{F as wt,T as St}from"./trending-down-CqEkjFA9.js";import{D as kt}from"./download-PWUf0XJa.js";import{C as ye}from"./chart-column-D5mAWcRx.js";import{a as At}from"./chevron-up-Bfmq3Clw.js";import{M as Ct}from"./minus-oFhmD2--.js";import{T as Dt}from"./trending-up-D-vj8Gbq.js";import"./chevron-right-COMox1Xb.js";import"./message-square-DSAS4TVL.js";import"./swords-8_KH18p7.js";import"./trophy-C2nVcZnb.js";import"./shirt-BMZy0pq4.js";import"./log-out-BqGKt-tT.js";import"./clsx-B-dksMZM.js";import"./check-BACdUlFL.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tt=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Me=B("activity",Tt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],zt=B("ban",Mt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pt=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],Lt=B("book-marked",Pt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rt=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],It=B("chart-pie",Rt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],$t=B("grid-3x3",Et);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ut=[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7.382a1 1 0 0 1 .553-.894L6 10",key:"1xqip1"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 7.106-3.553a2 2 0 0 1 1.788 0L20 6",key:"9d2mlk"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]],Ft=B("school",Ut);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bt=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ot=B("server",Bt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gt=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],_t=B("square-pen",Gt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qt=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],Vt=B("type",qt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ht=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],Wt=B("user-check",Ht);function Ue({...t}){return e.jsx(Je,{"data-slot":"dialog",...t})}function Xt({...t}){return e.jsx(tt,{"data-slot":"dialog-portal",...t})}function Qt({className:t,...a}){return e.jsx(st,{"data-slot":"dialog-overlay",className:G("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",t),...a})}function Fe({className:t,children:a,...i}){return e.jsxs(Xt,{"data-slot":"dialog-portal",children:[e.jsx(Qt,{}),e.jsxs(Ke,{"data-slot":"dialog-content",className:G("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...i,children:[a,e.jsxs(Ze,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(nt,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Be({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:G("flex flex-col gap-2 text-center sm:text-left",t),...a})}function Oe({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:G("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function Ge({className:t,...a}){return e.jsx(Ye,{"data-slot":"dialog-title",className:G("text-lg leading-none font-semibold",t),...a})}function _e({className:t,...a}){return e.jsx(et,{"data-slot":"dialog-description",className:G("text-muted-foreground text-sm",t),...a})}function Jt(t){return t?t.charAt(0).toUpperCase()+t.slice(1):"Student"}function Kt(t){if(t.role==="student"){const a=t.grade||"",i=t.section||"";return[a,i].filter(Boolean).join(" - ")||"Student"}return t.role==="teacher"?t.department||"Mathematics":t.role==="admin"?t.department||"System":""}function Zt(t){if(!t||!t.toDate)return"Never";const a=t.toDate(),s=new Date().getTime()-a.getTime(),c=Math.floor(s/6e4);if(c<1)return"Just now";if(c<60)return`${c} minute${c!==1?"s":""} ago`;const d=Math.floor(c/60);if(d<24)return`${d} hour${d!==1?"s":""} ago`;const p=Math.floor(d/24);return p<7?`${p} day${p!==1?"s":""} ago`:a.toLocaleDateString()}function qe(t){if(!t||!t.toDate)return new Date().toISOString().replace("T"," ").slice(0,19);const a=t.toDate();return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")} ${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function Yt(){return qe({toDate:()=>new Date})}async function es(){try{const t=ne(z(M,"users"),ie("createdAt","desc"));return(await $(t)).docs.map(i=>{const s=i.data();return{id:i.id,name:s.name||"Unknown",email:s.email||"",role:Jt(s.role),status:s.status||"Active",department:Kt(s),grade:s.grade||"",section:s.section||"",classSection:[s.grade||"",s.section||""].filter(Boolean).join(" - "),lrn:s.lrn||"",photo:s.photo||s.photoURL||"",lastLogin:Zt(s.lastLogin)}})}catch(t){return console.error("[adminService] getAllUsers error:",t),[]}}async function ze(t,a){const i=ce(M,"users",t),s={updatedAt:J()};if(a.name!==void 0&&(s.name=a.name),a.email!==void 0&&(s.email=a.email),a.status!==void 0&&(s.status=a.status),a.role!==void 0&&(s.role=a.role.toLowerCase()),a.department!==void 0&&(s.department=a.department,a.role?.toLowerCase()==="student"&&(s.grade=a.department)),a.grade!==void 0&&(s.grade=a.grade),a.section!==void 0&&(s.section=a.section),a.lrn!==void 0&&(s.lrn=a.lrn),s.grade||s.section){const c=s.grade||"",d=s.section||"";s.classSectionId=[c,d].filter(Boolean).join("_").replace(/\s+/g,"_").toLowerCase()}await Le(i,s)}async function ts(t){await Re(ce(M,"users",t))}async function ss(t,a,i,s,c){const d=i.toLowerCase(),p={email:t,name:a,role:d,status:"Active",department:s,photo:`https://ui-avatars.com/api/?name=${encodeURIComponent(a)}&background=0d9488&color=fff`,createdAt:J(),updatedAt:J()};if(d==="student"){const f=c?.grade||s||"Grade 11",o=c?.section||"Section A";Object.assign(p,{lrn:c?.lrn||`${Date.now()}`.slice(-12).padStart(12,"0"),grade:f,section:o,classSectionId:[f,o].join("_").replace(/\s+/g,"_").toLowerCase(),level:1,currentXP:0,totalXP:0,streak:0,atRiskSubjects:[],hasTakenDiagnostic:!1})}else d==="teacher"?Object.assign(p,{teacherId:`TCH-${Date.now()}`,subject:"Mathematics",yearsOfExperience:"0",qualification:"",students:[]}):d==="admin"&&Object.assign(p,{adminId:`ADM-${Date.now()}`,position:"Administrator"});return(await we(z(M,"users"),p)).id}async function Ve(){try{const t=ne(z(M,"auditLogs"),ie("timestampRaw","desc"),Pe(100));return(await $(t)).docs.map(i=>{const s=i.data();return{id:i.id,severity:s.severity||"Info",timestamp:s.timestamp||qe(s.timestampRaw),user:s.user||{name:"System",role:"Admin",avatar:null},action:s.action||"",category:s.category||"System",details:s.details||""}})}catch(t){return console.error("[adminService] getAuditLogs error:",t),[]}}async function Q(t,a,i,s,c){await we(z(M,"auditLogs"),{severity:i,timestamp:Yt(),timestampRaw:J(),user:c,action:t,category:a,details:s})}async function as(){try{const t=ne(z(M,"modules"),ie("createdAt","desc"));return(await $(t)).docs.map(i=>{const s=i.data(),c=s.createdAt;return{id:i.id,title:s.title||"",subject:s.subject||"",type:s.type||"Video",difficulty:s.difficulty||"Beginner",status:s.status||"Draft",assigned:s.assigned||0,created:s.created||(c?.toDate?.()?.toLocaleDateString()??"")}})}catch(t){return console.error("[adminService] getModules error:",t),[]}}async function ls(t){return(await we(z(M,"modules"),{...t,createdAt:J(),updatedAt:J()})).id}async function rs(t,a){await Le(ce(M,"modules",t),{...a,updatedAt:J()})}async function ns(t){await Re(ce(M,"modules",t))}async function is(){try{const t=await $(z(M,"users"));let a=0,i=0,s=0;t.docs.forEach(j=>{const f=j.data();f.role==="student"&&(a++,f.overallRisk==="High"&&s++),f.role==="teacher"&&f.status!=="Inactive"&&i++});let c=0;try{c=(await $(z(M,"classrooms"))).size}catch{}let d=0;try{d=(await $(z(M,"xpActivities"))).size}catch{}let p=0;try{const j=await $(z(M,"progress")),f=[];j.docs.forEach(o=>{const u=o.data();typeof u.averageScore=="number"&&f.push(u.averageScore)}),p=f.length>0?Math.round(f.reduce((o,u)=>o+u,0)/f.length):0}catch{}return{totalStudents:a,activeTeachers:i,totalClasses:c,atRiskStudents:s,avgPerformance:p,aiPredictions:d}}catch(t){return console.error("[adminService] getDashboardStats error:",t),{totalStudents:0,activeTeachers:0,totalClasses:0,atRiskStudents:0,avgPerformance:0,aiPredictions:0}}}async function cs(t=3){try{const a=ne(z(M,"users"),it("role","==","student"),ie("level","desc"),Pe(t));return(await $(a)).docs.map(s=>{const c=s.data(),d=c.level||1,p=c.currentXP||0,j=Math.min(100,d*8+Math.round(p/100));return{id:s.id,name:c.name||"Student",avatar:c.photo||c.photoURL||`https://ui-avatars.com/api/?name=${encodeURIComponent(c.name||"S")}&background=0d9488&color=fff`,class:c.grade||"Math",performance:j,level:d}})}catch(a){return console.error("[adminService] getTopPerformers error:",a),[]}}async function ds(){try{const t=await $(z(M,"users"));let a=0,i=0,s=0,c=0,d=0;t.docs.forEach(f=>{const o=f.data();o.role==="student"&&(a++,o.overallRisk==="High"&&s++,o.streak>0&&d++,c+=o.totalXP||0),o.role==="teacher"&&i++});let p=0;try{p=(await $(z(M,"achievements"))).size}catch{}let j=0;try{j=(await $(z(M,"chatSessions"))).size}catch{}return{totalActiveUsers:a+i,totalStudents:a,totalTeachers:i,atRiskStudents:s,achievementsUnlocked:p,totalXPEarned:c,activeStreaks:d,aiTutorSessions:j}}catch(t){return console.error("[adminService] getAnalyticsSummary error:",t),{totalActiveUsers:0,totalStudents:0,totalTeachers:0,atRiskStudents:0,achievementsUnlocked:0,totalXPEarned:0,activeStreaks:0,aiTutorSessions:0}}}const os=()=>{const{userProfile:t}=Se(),[a,i]=x.useState([]),[s,c]=x.useState(!0),[d,p]=x.useState(!1),[j,f]=x.useState(!1),[o,u]=x.useState(""),[C,b]=x.useState("All Types"),[S,g]=x.useState("All Status"),[v,y]=x.useState(!1),[I,N]=x.useState(!1),[h,r]=x.useState(null),[w,D]=x.useState(null),[m,k]=x.useState({title:"",subject:"",type:"Video",difficulty:"Beginner",status:"Draft",assigned:0,created:new Date().toLocaleDateString()}),U=x.useCallback(async()=>{c(!0);try{const n=await as();i(n)}catch{T.error("Failed to load modules")}finally{c(!1)}},[]);x.useEffect(()=>{U()},[U]);const _=()=>{D(null),k({title:"",subject:"",type:"Video",difficulty:"Beginner",status:"Draft",assigned:0,created:new Date().toLocaleDateString()}),y(!0)},oe=n=>{D(n),k({title:n.title,subject:n.subject,type:n.type,difficulty:n.difficulty,status:n.status,assigned:n.assigned,created:n.created}),y(!0)},xe=async()=>{if(!m.title.trim()||!m.subject.trim()){T.error("Title and subject are required");return}p(!0);try{w?(await rs(w.id,m),await Q("Module Updated","Content","Info",`Updated module: "${m.title}"`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),T.success("Module updated")):(await ls(m),await Q("Module Created","Content","Info",`Created new module: "${m.title}" (${m.subject})`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),T.success("Module created")),await U(),y(!1)}catch{T.error("Failed to save module")}finally{p(!1)}},me=n=>{r(n),N(!0)},he=async()=>{if(!(!h||j)){f(!0);try{await ns(h.id),await Q("Module Deleted","Content","Warning",`Deleted module: "${h.title}"`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),T.success("Module deleted"),i(n=>n.filter(ge=>ge.id!==h.id)),N(!1),r(null)}catch{T.error("Failed to delete module")}finally{f(!1)}}},ue=a.length,te=a.filter(n=>n.status==="Published").length,pe=a.filter(n=>n.status==="Draft").length,l=a.filter(n=>n.status==="Archived").length,P=n=>{switch(n){case"Published":return"bg-green-100 text-green-700 border-green-200";case"Draft":return"bg-rose-100 text-rose-700 border-rose-200";case"Archived":return"bg-[#edf1f7] text-[#0a1628] border-[#dde3eb]";default:return"bg-[#edf1f7] text-[#0a1628]"}},K=n=>{switch(n){case"Beginner":return"bg-sky-50 text-sky-700";case"Intermediate":return"bg-sky-50 text-sky-700";case"Advanced":return"bg-sky-50 text-sky-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},q=n=>{switch(n){case"Video":return e.jsx(ht,{size:16,className:"text-sky-600"});case"Quiz":return e.jsx(pt,{size:16,className:"text-teal-600"});default:return e.jsx(mt,{size:16,className:"text-[#5a6578]"})}},He=n=>{switch(n){case"Video":return"bg-sky-100 text-sky-700";case"Quiz":return"bg-teal-100 text-teal-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},De=a.filter(n=>{const ge=n.title.toLowerCase().includes(o.toLowerCase())||n.subject.toLowerCase().includes(o.toLowerCase()),We=C==="All Types"||n.type===C,Xe=S==="All Status"||n.status===S;return ge&&We&&Xe});return e.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Content Management"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Manage learning modules, templates, and educational content"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(E,{variant:"outline",className:"gap-2 border-[#dde3eb] hover:bg-[#edf1f7]",onClick:U,children:[e.jsx(ke,{size:16}),"Refresh"]}),e.jsxs(E,{className:"gap-2 bg-sky-600 hover:bg-sky-700 text-white",onClick:_,children:[e.jsx(Ee,{size:16}),"Create Module"]})]}),s?e.jsx("div",{className:"flex items-center justify-center h-24",children:e.jsx(F,{size:24,className:"animate-spin text-sky-500"})}):null,e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[e.jsx("p",{className:"text-xs font-bold text-[#5a6578] mb-1",children:"Total Modules"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:ue})]}),e.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(ut,{size:14,className:"text-green-500"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Published"})]}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:te})]})}),e.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Te,{size:14,className:"text-rose-500"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Drafts"})]}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:pe})]})}),e.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(je,{size:14,className:"text-slate-500"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Archived"})]}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:l})]})})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ae,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx(R,{type:"text",placeholder:"Search modules by title or topic...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:o,onChange:n=>u(n.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:C,onChange:n=>b(n.target.value),children:[e.jsx("option",{children:"All Types"}),e.jsx("option",{children:"Video"}),e.jsx("option",{children:"Quiz"}),e.jsx("option",{children:"Document"})]}),e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:S,onChange:n=>g(n.target.value),children:[e.jsx("option",{children:"All Status"}),e.jsx("option",{children:"Published"}),e.jsx("option",{children:"Draft"}),e.jsx("option",{children:"Archived"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:[e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[e.jsx("th",{className:"p-4 w-10",children:e.jsx("input",{type:"checkbox",className:"rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Module"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Difficulty"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Assigned"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Created"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:De.map(n=>e.jsxs("tr",{className:"hover:bg-[#edf1f7] transition-colors group",children:[e.jsx("td",{className:"p-4",children:e.jsx("input",{type:"checkbox",className:"rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${n.type==="Video"?"bg-sky-100 text-sky-600":n.type==="Quiz"?"bg-teal-100 text-teal-600":"bg-[#edf1f7] text-[#5a6578]"}`,children:q(n.type)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:n.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:n.subject})]})]})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${He(n.type)}`,children:n.type})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${K(n.difficulty)}`,children:n.difficulty})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-bold border ${P(n.status)}`,children:n.status})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-1 text-[#5a6578] text-sm",children:[e.jsx(de,{size:14}),e.jsx("span",{children:n.assigned})]})}),e.jsx("td",{className:"p-4 text-sm text-[#5a6578]",children:n.created}),e.jsx("td",{className:"p-4 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:()=>oe(n),className:"p-2 hover:bg-[#dde3eb] rounded-lg text-[#5a6578] hover:text-sky-600 transition-colors",children:e.jsx(Te,{size:16})}),e.jsx("button",{onClick:()=>me(n),className:"p-2 hover:bg-red-50 rounded-lg text-[#5a6578] hover:text-red-600 transition-colors",children:e.jsx(je,{size:16})})]})})]},n.id))})]}),De.length===0&&!s&&e.jsxs("div",{className:"p-12 text-center text-[#5a6578]",children:[e.jsx(O,{size:48,className:"mx-auto mb-4 text-slate-500"}),e.jsx("p",{className:"font-medium",children:"No modules found"}),e.jsx("p",{className:"text-sm",children:a.length===0?"Create your first module to get started":"Try adjusting your search or filters"})]})]}),e.jsx(Ue,{open:v,onOpenChange:y,children:e.jsxs(Fe,{className:"sm:max-w-[480px]",children:[e.jsxs(Be,{children:[e.jsx(Ge,{children:w?"Edit Module":"Create New Module"}),e.jsx(_e,{children:w?"Update module details below.":"Fill in the details to create a new learning module."})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Title"}),e.jsx(R,{value:m.title,onChange:n=>k({...m,title:n.target.value}),placeholder:"Module title",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Subject"}),e.jsx(R,{value:m.subject,onChange:n=>k({...m,subject:n.target.value}),placeholder:"e.g. Algebra, Calculus",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Type"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(V,{value:m.type,onValueChange:n=>k({...m,type:n}),children:[e.jsx(H,{children:e.jsx(W,{})}),e.jsxs(X,{children:[e.jsx(A,{value:"Video",children:"Video"}),e.jsx(A,{value:"Quiz",children:"Quiz"}),e.jsx(A,{value:"Document",children:"Document"})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Difficulty"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(V,{value:m.difficulty,onValueChange:n=>k({...m,difficulty:n}),children:[e.jsx(H,{children:e.jsx(W,{})}),e.jsxs(X,{children:[e.jsx(A,{value:"Beginner",children:"Beginner"}),e.jsx(A,{value:"Intermediate",children:"Intermediate"}),e.jsx(A,{value:"Advanced",children:"Advanced"}),e.jsx(A,{value:"N/A",children:"N/A"})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Status"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(V,{value:m.status,onValueChange:n=>k({...m,status:n}),children:[e.jsx(H,{children:e.jsx(W,{})}),e.jsxs(X,{children:[e.jsx(A,{value:"Draft",children:"Draft"}),e.jsx(A,{value:"Published",children:"Published"}),e.jsx(A,{value:"Archived",children:"Archived"})]})]})})]})]}),e.jsxs(Oe,{children:[e.jsx(E,{variant:"outline",onClick:()=>y(!1),disabled:d,children:"Cancel"}),e.jsxs(E,{onClick:xe,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:d,children:[d?e.jsx(F,{size:16,className:"animate-spin mr-2"}):null,w?"Save Changes":"Create Module"]})]})]})}),e.jsx(Ne,{isOpen:I,onClose:()=>{j||(N(!1),r(null))},onConfirm:he,title:"Delete Module?",message:h?`Delete "${h.title}"? This cannot be undone.`:"Delete this module? This cannot be undone.",confirmText:j?"Deleting...":"Delete",cancelText:"Cancel",type:"danger",icon:"delete"})]})},xs=()=>{const[t,a]=x.useState([]),[i,s]=x.useState(!0),[c,d]=x.useState(""),[p,j]=x.useState("All Categories"),[f,o]=x.useState("All Severity"),[u,C]=x.useState("All Roles"),b=x.useCallback(async()=>{s(!0);try{const r=await Ve();a(r)}catch{T.error("Failed to load audit logs")}finally{s(!1)}},[]);x.useEffect(()=>{b()},[b]);const S=t.filter(r=>r.severity==="Info").length,g=t.filter(r=>r.severity==="Warning").length,v=t.filter(r=>r.severity==="Error"||r.severity==="Critical").length,y=r=>{switch(r){case"Info":return e.jsx(ae,{size:16,className:"text-sky-600"});case"Warning":return e.jsx(be,{size:16,className:"text-rose-600"});case"Error":return e.jsx(le,{size:16,className:"text-red-600"});case"Critical":return e.jsx(le,{size:16,className:"text-red-600"});default:return e.jsx(ae,{size:16,className:"text-[#5a6578]"})}},I=r=>{switch(r){case"Info":return"bg-sky-100 text-sky-700 border-sky-200";case"Warning":return"bg-rose-100 text-rose-700 border-rose-200";case"Error":return"bg-red-100 text-red-700 border-red-200";case"Critical":return"bg-red-100 text-red-700 border-red-200 ring-2 ring-red-500";default:return"bg-[#edf1f7] text-[#0a1628] border-[#dde3eb]"}},N=r=>{switch(r){case"Auth":return"bg-sky-100 text-sky-700";case"Data":return"bg-rose-100 text-rose-700";case"User":return"bg-sky-100 text-sky-700";case"System":return"bg-[#edf1f7] text-[#0a1628]";case"Content":return"bg-green-100 text-green-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},h=t.filter(r=>{const w=r.action.toLowerCase().includes(c.toLowerCase())||r.details.toLowerCase().includes(c.toLowerCase())||r.user.name.toLowerCase().includes(c.toLowerCase()),D=p==="All Categories"||r.category===p,m=f==="All Severity"||r.severity===f,k=u==="All Roles"||r.user.role===u;return w&&D&&m&&k});return e.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Audit Log"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"System activity monitoring and security events"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"bg-white px-3 py-2 rounded-xl border border-[#dde3eb] flex items-center gap-2 text-[#5a6578] text-sm font-medium",children:[e.jsx(ve,{size:16}),e.jsx("span",{children:"Last 100 events"})]}),e.jsxs(E,{variant:"outline",className:"gap-2 border-[#dde3eb] hover:bg-[#edf1f7]",onClick:b,children:[e.jsx(ke,{size:16}),"Refresh"]})]}),i?e.jsx("div",{className:"flex items-center justify-center h-24",children:e.jsx(F,{size:24,className:"animate-spin text-sky-500"})}):null,e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[e.jsx("p",{className:"text-xs font-bold text-[#5a6578] mb-1",children:"Total Events"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:t.length})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-sky-200 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(ae,{size:14,className:"text-sky-600"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Info"})]}),e.jsx("p",{className:"text-2xl font-bold text-sky-600",children:S})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-rose-200 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(be,{size:14,className:"text-rose-600"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Warnings"})]}),e.jsx("p",{className:"text-2xl font-bold text-rose-600",children:g})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-red-200 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(le,{size:14,className:"text-red-600"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Errors"})]}),e.jsx("p",{className:"text-2xl font-bold text-red-600",children:v})]})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ae,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx(R,{type:"text",placeholder:"Search by user, action, or details...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:c,onChange:r=>d(r.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:p,onChange:r=>j(r.target.value),children:[e.jsx("option",{children:"All Categories"}),e.jsx("option",{children:"Auth"}),e.jsx("option",{children:"Data"}),e.jsx("option",{children:"User"}),e.jsx("option",{children:"System"}),e.jsx("option",{children:"Content"})]}),e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:f,onChange:r=>o(r.target.value),children:[e.jsx("option",{children:"All Severity"}),e.jsx("option",{children:"Info"}),e.jsx("option",{children:"Warning"}),e.jsx("option",{children:"Error"}),e.jsx("option",{children:"Critical"})]}),e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:u,onChange:r=>C(r.target.value),children:[e.jsx("option",{children:"All Roles"}),e.jsx("option",{children:"Admin"}),e.jsx("option",{children:"Teacher"}),e.jsx("option",{children:"Student"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:[e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Severity"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Timestamp"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"User"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Action"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Category"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Details"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider text-right",children:"View"})]})}),e.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:h.map(r=>e.jsxs("tr",{className:"hover:bg-[#edf1f7] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold border ${I(r.severity)}`,children:[y(r.severity),r.severity]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2 text-[#5a6578] text-sm",children:[e.jsx("div",{className:"p-1 bg-[#edf1f7] rounded",children:e.jsx(ve,{size:12})}),r.timestamp]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[r.user.avatar?e.jsx("img",{src:r.user.avatar,alt:r.user.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 bg-sky-100 rounded-full flex items-center justify-center",children:e.jsx(Z,{size:16,className:"text-sky-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:r.user.name}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:r.user.role})]})]})}),e.jsx("td",{className:"p-4",children:e.jsx("p",{className:"font-medium text-[#0a1628] text-sm",children:r.action})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${N(r.category)}`,children:r.category})}),e.jsx("td",{className:"p-4 text-sm text-[#5a6578] max-w-xs truncate",title:r.details,children:r.details}),e.jsx("td",{className:"p-4 text-right",children:e.jsx("button",{className:"p-2 hover:bg-[#dde3eb] rounded-lg text-slate-500 hover:text-sky-600 transition-colors",children:e.jsx(gt,{size:16})})})]},r.id))})]}),h.length===0&&!i&&e.jsxs("div",{className:"p-12 text-center text-[#5a6578]",children:[e.jsx(Z,{size:48,className:"mx-auto mb-4 text-slate-500"}),e.jsx("p",{className:"font-medium",children:"No logs found"}),e.jsx("p",{className:"text-sm",children:t.length===0?"Audit events will appear here as actions are performed":"Try adjusting your search or filters"})]})]})]})},ms=()=>JSON.parse(JSON.stringify(ct)),hs=()=>{const{userProfile:t}=Se(),[a,i]=x.useState("General"),[s,c]=x.useState(ms()),[d,p]=x.useState(!1),[j,f]=x.useState(!1),o=[{id:"General",label:"General",icon:ft},{id:"Security",label:"Security",icon:Z},{id:"AI Features",label:"AI Features",icon:Ie},{id:"Academic",label:"Academic",icon:O},{id:"Notifications",label:"Notifications",icon:bt},{id:"Backup & Data",label:"Backup & Data",icon:ee}];x.useEffect(()=>{(async()=>{if(t?.uid){p(!0);try{const S=await dt(t.uid);c(S)}catch(S){console.error("Failed loading admin settings:",S),T.error("Failed to load admin settings")}finally{p(!1)}}})()},[t?.uid]);const u=b=>{c(S=>({...S,adminPanel:{...S.adminPanel,...b}}))},C=async()=>{if(t?.uid){f(!0);try{const b=await ot(t.uid,s);c(b),T.success("Admin settings updated")}catch(b){console.error("Failed saving admin settings:",b),T.error("Failed to save admin settings")}finally{f(!1)}}};return e.jsx(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsx("div",{className:"col-span-12 md:col-span-3",children:e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-[#dde3eb] overflow-hidden",children:e.jsx("nav",{className:"flex flex-col py-2",children:o.map(b=>{const S=b.icon,g=a===b.id;return e.jsxs("button",{onClick:()=>i(b.id),className:`flex items-center gap-3 px-4 py-3 text-sm font-medium transition-all relative ${g?"text-sky-600 bg-sky-50/50":"text-[#5a6578] hover:bg-[#edf1f7] hover:text-[#0a1628]"}`,children:[g&&e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-sky-600 rounded-r-full"}),e.jsx(S,{size:18,className:g?"text-sky-600":"text-slate-500"}),b.label]},b.id)})})})}),e.jsx("div",{className:"col-span-12 md:col-span-9",children:e.jsx(L.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-6",children:e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-[#dde3eb] p-6",children:d?e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Loading settings..."}):e.jsxs(e.Fragment,{children:[a==="General"&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Site Name"}),e.jsx(R,{value:s.adminPanel.siteName,onChange:b=>u({siteName:b.target.value}),className:"bg-white"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Site Description"}),e.jsx("textarea",{className:"w-full min-h-[80px] px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm focus:outline-none focus:ring-2 focus:ring-sky-500/20 placeholder:text-slate-500 resize-none",value:s.adminPanel.siteDescription,onChange:b=>u({siteDescription:b.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Default Language"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:s.adminPanel.defaultLanguage,onChange:b=>u({defaultLanguage:b.target.value}),className:"w-full px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{children:"English"}),e.jsx("option",{children:"Spanish"}),e.jsx("option",{children:"French"}),e.jsx("option",{children:"German"})]}),e.jsx(jt,{size:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{className:"mt-6 p-4 bg-red-50 border border-red-100 rounded-xl flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg text-red-600 shadow-sm border border-red-100",children:e.jsx(Ot,{size:18})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-red-900",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-red-700 mt-0.5",children:"Temporarily disable access for non-admins"})]})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:s.adminPanel.maintenanceMode,onChange:()=>u({maintenanceMode:!s.adminPanel.maintenanceMode})}),e.jsx("div",{className:"w-11 h-6 bg-[#dde3eb] peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-red-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-[#dde3eb] after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-red-600"})]})]})]}),a==="Security"&&e.jsxs("div",{className:"space-y-5",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]",children:"Enforce Strong Passwords"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Require stronger passwords for all users"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.enforceStrongPasswords,onChange:()=>u({enforceStrongPasswords:!s.adminPanel.enforceStrongPasswords})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Session Timeout (minutes)"}),e.jsx(R,{type:"number",value:s.adminPanel.sessionTimeoutMinutes,onChange:b=>u({sessionTimeoutMinutes:Number(b.target.value||0)}),className:"max-w-xs"})]})]}),a==="AI Features"&&e.jsxs("div",{className:"space-y-5",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]",children:"AI Tutor"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Enable AI tutoring experience"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.aiTutorEnabled,onChange:()=>u({aiTutorEnabled:!s.adminPanel.aiTutorEnabled})})]}),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]",children:"Auto Recommendations"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Enable AI-generated recommendations"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.aiAutoRecommendations,onChange:()=>u({aiAutoRecommendations:!s.adminPanel.aiAutoRecommendations})})]}),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]",children:"Risk Alerts"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Send proactive risk alerts for at-risk learners"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.aiRiskAlertsEnabled,onChange:()=>u({aiRiskAlertsEnabled:!s.adminPanel.aiRiskAlertsEnabled})})]})]}),a==="Academic"&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Grading Scale"}),e.jsxs("div",{className:"relative max-w-xs",children:[e.jsxs("select",{value:s.adminPanel.gradingScale,onChange:b=>u({gradingScale:b.target.value}),className:"w-full px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{value:"percentage",children:"Percentage"}),e.jsx("option",{value:"gpa",children:"GPA"})]}),e.jsx(Vt,{size:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Passing Grade"}),e.jsx(R,{type:"number",value:s.adminPanel.passingGrade,onChange:b=>u({passingGrade:Number(b.target.value||0)}),className:"max-w-xs"})]})]}),a==="Notifications"&&e.jsxs("div",{className:"space-y-5",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]",children:"Parent Summary Emails"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Weekly summaries for guardians"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.parentSummaryEmails,onChange:()=>u({parentSummaryEmails:!s.adminPanel.parentSummaryEmails})})]}),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]",children:"Teacher Digest Emails"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Daily teacher performance digest"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.teacherDigestEmails,onChange:()=>u({teacherDigestEmails:!s.adminPanel.teacherDigestEmails})})]}),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]",children:"Weekly Platform Report"}),e.jsx("p",{className:"text-xs text-slate-500",children:"System report for administrators"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.weeklyPlatformReport,onChange:()=>u({weeklyPlatformReport:!s.adminPanel.weeklyPlatformReport})})]})]}),a==="Backup & Data"&&e.jsxs("div",{className:"space-y-5",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]",children:"Automatic Backups"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Create scheduled backups of platform data"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.autoBackupEnabled,onChange:()=>u({autoBackupEnabled:!s.adminPanel.autoBackupEnabled})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Backup Frequency"}),e.jsxs("select",{value:s.adminPanel.backupFrequency,onChange:b=>u({backupFrequency:b.target.value}),className:"w-full max-w-xs px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]})]}),e.jsx("div",{className:"mt-8 pt-6 border-t border-[#dde3eb] flex justify-end",children:e.jsxs(E,{className:"bg-sky-600 hover:bg-sky-700 text-white gap-2",onClick:C,disabled:j,children:[e.jsx(vt,{size:16}),j?"Saving...":"Save Changes"]})})]})})})})]})})};function us({className:t,...a}){return e.jsx(at,{"data-slot":"avatar",className:G("relative flex size-10 shrink-0 overflow-hidden rounded-full",t),...a})}function ps({className:t,...a}){return e.jsx(lt,{"data-slot":"avatar-image",className:G("aspect-square size-full",t),...a})}function gs({className:t,...a}){return e.jsx(rt,{"data-slot":"avatar-fallback",className:G("bg-muted flex size-full items-center justify-center rounded-full",t),...a})}const fs=()=>{const{userProfile:t}=Se(),[a,i]=x.useState([]),[s,c]=x.useState(!0),[d,p]=x.useState(!1),[j,f]=x.useState(!1),[o,u]=x.useState(""),[C,b]=x.useState("All Roles"),[S,g]=x.useState("All Status"),[v,y]=x.useState(!1),[I,N]=x.useState(!1),[h,r]=x.useState(null),[w,D]=x.useState(null),[m,k]=x.useState({name:"",email:"",role:"Student",status:"Active",department:"",grade:"Grade 11",section:"Section A",lrn:""}),U=x.useCallback(async()=>{c(!0);try{const l=await es();i(l)}catch{T.error("Failed to load users")}finally{c(!1)}},[]);x.useEffect(()=>{U()},[U]);const _=()=>{D(null),k({name:"",email:"",role:"Student",status:"Active",department:"",grade:"Grade 11",section:"Section A",lrn:""}),y(!0)},oe=l=>{D(l),k({name:l.name,email:l.email,role:l.role,status:l.status,department:l.department,grade:l.grade||"Grade 11",section:l.section||"Section A",lrn:l.lrn||""}),y(!0)},xe=async()=>{if(!m.name.trim()||!m.email.trim()){T.error("Name and email are required");return}p(!0);try{w?(await ze(w.id,m),await Q("User Updated","User","Info",`Updated user: ${m.name} (${m.email})`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),T.success("User updated successfully")):(await ss(m.email,m.name,m.role,m.role==="Student"?m.grade:m.department,m.role==="Student"?{grade:m.grade,section:m.section,lrn:m.lrn}:void 0),await Q("Created New User","User","Info",`Created new ${m.role.toLowerCase()} account: ${m.name} (${m.email})`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),T.success("User created successfully")),await U(),y(!1)}catch(l){T.error(l instanceof Error?l.message:"Failed to save user")}finally{p(!1)}},me=(l,P)=>{r({id:l,name:P}),N(!0)},he=async()=>{if(!(!h||j)){f(!0);try{await ts(h.id),await Q("User Deleted","User","Warning",`Deleted user account: ${h.name}`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),T.success("User deleted"),i(l=>l.filter(P=>P.id!==h.id)),N(!1),r(null)}catch{T.error("Failed to delete user")}finally{f(!1)}}},ue=async l=>{const P=l.status==="Active"?"Inactive":"Active";try{await ze(l.id,{status:P}),await Q("User Status Changed","User","Warning",`${P==="Active"?"Activated":"Deactivated"} user: ${l.email}`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),T.success(`User ${P==="Active"?"activated":"deactivated"}`),i(K=>K.map(q=>q.id===l.id?{...q,status:P}:q))}catch{T.error("Failed to update user status")}},te=a.filter(l=>{const P=l.name.toLowerCase().includes(o.toLowerCase())||l.email.toLowerCase().includes(o.toLowerCase()),K=C==="All Roles"||l.role===C,q=S==="All Status"||l.status===S;return P&&K&&q}),pe=[{label:"Total Users",value:a.length,color:"text-[#0a1628]"},{label:"Active",value:a.filter(l=>l.status==="Active").length,color:"text-green-600"},{label:"Admins",value:a.filter(l=>l.role==="Admin").length,color:"text-sky-600"},{label:"Teachers",value:a.filter(l=>l.role==="Teacher").length,color:"text-sky-600"},{label:"Students",value:a.filter(l=>l.role==="Student").length,color:"text-emerald-600"}];return e.jsxs("div",{className:"space-y-6",children:[s?e.jsx("div",{className:"flex items-center justify-center h-32",children:e.jsx(F,{size:28,className:"animate-spin text-sky-500"})}):null,e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:pe.map((l,P)=>e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[e.jsx("h3",{className:`text-2xl font-bold ${l.color}`,children:l.value}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:l.label})]},P))}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ae,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx(R,{placeholder:"Search users by name or email...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:o,onChange:l=>u(l.target.value)})]}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-between gap-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(V,{value:C,onValueChange:b,children:[e.jsx(H,{className:"w-[140px] bg-[#edf1f7] border-[#dde3eb]",children:e.jsx(W,{placeholder:"All Roles"})}),e.jsxs(X,{children:[e.jsx(A,{value:"All Roles",children:"All Roles"}),e.jsx(A,{value:"Admin",children:"Admin"}),e.jsx(A,{value:"Teacher",children:"Teacher"}),e.jsx(A,{value:"Student",children:"Student"})]})]}),e.jsxs(V,{value:S,onValueChange:g,children:[e.jsx(H,{className:"w-[140px] bg-[#edf1f7] border-[#dde3eb]",children:e.jsx(W,{placeholder:"All Status"})}),e.jsxs(X,{children:[e.jsx(A,{value:"All Status",children:"All Status"}),e.jsx(A,{value:"Active",children:"Active"}),e.jsx(A,{value:"Inactive",children:"Inactive"})]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(E,{variant:"outline",className:"gap-2 border-[#dde3eb] text-[#5a6578]",onClick:U,children:[e.jsx(ke,{size:16}),"Refresh"]}),e.jsxs(E,{className:"gap-2 bg-sky-500 hover:bg-sky-600 text-white",onClick:_,children:[e.jsx(Ee,{size:16}),"Add User"]})]})]})]}),e.jsx("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm text-left",children:[e.jsx("thead",{className:"text-xs text-[#5a6578] uppercase bg-[#edf1f7] border-b border-[#dde3eb]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 font-semibold",children:"User"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Role"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Status"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Class/Department"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Last Login"}),e.jsx("th",{className:"px-6 py-4 font-semibold text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:te.length>0?te.map(l=>e.jsxs("tr",{className:"hover:bg-[#edf1f7]/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(us,{children:[e.jsx(ps,{src:l.photo}),e.jsx(gs,{children:l.name.charAt(0)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[#0a1628]",children:l.name}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:l.email})]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[l.role==="Admin"&&e.jsx(Z,{size:14,className:"text-sky-600"}),l.role==="Teacher"&&e.jsx(Ce,{size:14,className:"text-sky-600"}),l.role==="Student"&&e.jsx(Ft,{size:14,className:"text-emerald-600"}),e.jsx("span",{className:` - font-medium text-xs px-2 py-0.5 rounded-full - ${l.role==="Admin"?"bg-sky-100 text-sky-700":""} - ${l.role==="Teacher"?"bg-sky-100 text-sky-700":""} - ${l.role==="Student"?"bg-emerald-100 text-emerald-700":""} - `,children:l.role})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("span",{className:` - inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border - ${l.status==="Active"?"bg-green-50 text-green-700 border-green-200":"bg-[#edf1f7] text-[#5a6578] border-[#dde3eb]"} - `,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l.status==="Active"?"bg-green-500":"bg-[#a8a5b3]"}`}),l.status]})}),e.jsx("td",{className:"px-6 py-4 text-[#5a6578]",children:l.role==="Student"&&l.classSection||l.department}),e.jsx("td",{className:"px-6 py-4 text-[#5a6578]",children:l.lastLogin}),e.jsx("td",{className:"px-6 py-4 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>oe(l),className:"p-1.5 text-slate-500 hover:text-sky-600 hover:bg-sky-50 rounded-lg transition-colors",children:e.jsx(_t,{size:16})}),e.jsx("button",{onClick:()=>ue(l),className:`p-1.5 rounded-lg transition-colors ${l.status==="Active"?"text-slate-500 hover:text-orange-600 hover:bg-orange-50":"text-orange-500 hover:text-green-600 hover:bg-green-50"}`,title:l.status==="Active"?"Deactivate User":"Activate User",children:l.status==="Active"?e.jsx(zt,{size:16}):e.jsx(Wt,{size:16})}),e.jsx("button",{onClick:()=>me(l.id,l.name),className:"p-1.5 text-slate-500 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:e.jsx(je,{size:16})})]})})]},l.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-6 py-12 text-center text-[#5a6578]",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"p-3 bg-[#edf1f7] rounded-full",children:e.jsx(de,{size:24,className:"text-slate-500"})}),e.jsx("p",{children:"No users found matching your filters"})]})})})})]})})}),e.jsx(Ue,{open:v,onOpenChange:y,children:e.jsxs(Fe,{className:"sm:max-w-[425px]",children:[e.jsxs(Be,{children:[e.jsx(Ge,{children:w?"Edit User Access":"Add New User"}),e.jsx(_e,{children:w?"Update user details and manage access permissions.":"Create a new user account and assign roles."})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"name",className:"text-right text-sm font-medium text-[#0a1628]",children:"Name"}),e.jsx(R,{id:"name",value:m.name,onChange:l=>k({...m,name:l.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"email",className:"text-right text-sm font-medium text-[#0a1628]",children:"Email"}),e.jsx(R,{id:"email",type:"email",value:m.email,onChange:l=>k({...m,email:l.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"role",className:"text-right text-sm font-medium text-[#0a1628]",children:"Role"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(V,{value:m.role,onValueChange:l=>k({...m,role:l}),children:[e.jsx(H,{children:e.jsx(W,{placeholder:"Select role"})}),e.jsxs(X,{children:[e.jsx(A,{value:"Student",children:"Student"}),e.jsx(A,{value:"Teacher",children:"Teacher"}),e.jsx(A,{value:"Admin",children:"Admin"})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"status",className:"text-right text-sm font-medium text-[#0a1628]",children:"Status"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(V,{value:m.status,onValueChange:l=>k({...m,status:l}),children:[e.jsx(H,{children:e.jsx(W,{placeholder:"Select status"})}),e.jsxs(X,{children:[e.jsx(A,{value:"Active",children:"Active"}),e.jsx(A,{value:"Inactive",children:"Inactive"})]})]})})]}),m.role==="Student"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"lrn",className:"text-right text-sm font-medium text-[#0a1628]",children:"LRN"}),e.jsx(R,{id:"lrn",value:m.lrn,onChange:l=>k({...m,lrn:l.target.value}),placeholder:"12-digit learner reference",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"grade",className:"text-right text-sm font-medium text-[#0a1628]",children:"Grade"}),e.jsx(R,{id:"grade",value:m.grade,onChange:l=>k({...m,grade:l.target.value}),placeholder:"e.g. Grade 11",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"section",className:"text-right text-sm font-medium text-[#0a1628]",children:"Section"}),e.jsx(R,{id:"section",value:m.section,onChange:l=>k({...m,section:l.target.value}),placeholder:"e.g. STEM A",className:"col-span-3"})]})]}):e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"department",className:"text-right text-sm font-medium text-[#0a1628]",children:"Department"}),e.jsx(R,{id:"department",value:m.department,onChange:l=>k({...m,department:l.target.value}),placeholder:"e.g. Mathematics",className:"col-span-3"})]})]}),e.jsxs(Oe,{children:[e.jsx(E,{variant:"outline",onClick:()=>y(!1),disabled:d,children:"Cancel"}),e.jsxs(E,{onClick:xe,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:d,children:[d?e.jsx(F,{size:16,className:"animate-spin mr-2"}):null,w?"Save Changes":"Create User"]})]})]})}),e.jsx(Ne,{isOpen:I,onClose:()=>{j||(N(!1),r(null))},onConfirm:he,title:"Delete User?",message:h?`Delete user "${h.name}"? This cannot be undone.`:"Delete this user? This cannot be undone.",confirmText:j?"Deleting...":"Delete",cancelText:"Cancel",type:"danger",icon:"delete"})]})},Y=({icon:t,title:a,subtitle:i})=>e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-10 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-[#edf1f7] flex items-center justify-center",children:t}),e.jsx("p",{className:"text-sm font-semibold text-[#5a6578]",children:a}),i&&e.jsx("p",{className:"text-xs text-[#a0aec0] max-w-xs",children:i})]}),bs=()=>{const[t,a]=x.useState("30d"),[i,s]=x.useState(null),[c,d]=x.useState(!0);x.useEffect(()=>{ds().then(s).catch(console.error).finally(()=>d(!1))},[]);const p={"7d":"Last 7 Days","30d":"Last 30 Days","90d":"Last 90 Days","12m":"Last 12 Months"},j=[{label:"Total Active Users",value:c?null:(i?.totalActiveUsers??0).toLocaleString(),icon:de,color:"from-sky-500 to-blue-600"},{label:"Avg. Completion Rate",value:null,icon:$e,color:"from-teal-500 to-emerald-600"},{label:"Avg. Session Duration",value:null,icon:yt,color:"from-violet-500 to-purple-600"},{label:"At-Risk Students",value:c?null:(i?.atRiskStudents??0).toString(),icon:Me,color:"from-rose-500 to-orange-600"}],f=[{label:"Achievements Unlocked",icon:re,color:"text-rose-600",bg:"bg-rose-50",value:c?null:(i?.achievementsUnlocked??0).toLocaleString()},{label:"XP Earned (Platform)",icon:Ie,color:"text-violet-600",bg:"bg-violet-50",value:c?null:(i?.totalXPEarned??0)>=1e6?`${((i?.totalXPEarned??0)/1e6).toFixed(1)}M`:(i?.totalXPEarned??0)>=1e3?`${Math.round((i?.totalXPEarned??0)/1e3)}K`:(i?.totalXPEarned??0).toLocaleString()},{label:"Active Streaks",icon:xt,color:"text-orange-600",bg:"bg-orange-50",value:c?null:(i?.activeStreaks??0).toLocaleString()},{label:"AI Tutor Sessions",icon:Nt,color:"text-sky-600",bg:"bg-sky-50",value:c?null:(i?.aiTutorSessions??0).toLocaleString()}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(L.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-2 bg-white rounded-xl p-1 shadow-sm border border-[#dde3eb]",children:Object.entries(p).map(([o,u])=>e.jsx("button",{onClick:()=>a(o),className:`px-4 py-2 rounded-lg text-sm font-semibold transition-all ${t===o?"bg-sky-600 text-white shadow-sm":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:u},o))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(E,{variant:"outline",disabled:!0,className:"px-4 py-2 gap-2 rounded-xl border-[#dde3eb] font-semibold text-sm opacity-50 cursor-not-allowed",children:[e.jsx(wt,{size:16}),"Filters"]}),e.jsxs(E,{variant:"outline",disabled:!0,className:"px-4 py-2 gap-2 rounded-xl border-[#dde3eb] font-semibold text-sm opacity-50 cursor-not-allowed",children:[e.jsx(kt,{size:16}),"Export"]})]})]}),!c&&!i?.totalActiveUsers&&e.jsxs(L.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35},className:"flex items-center gap-3 bg-rose-50 border border-rose-200 rounded-2xl px-5 py-4",children:[e.jsx(ee,{size:18,className:"text-rose-600 shrink-0"}),e.jsxs("p",{className:"text-sm text-rose-800",children:[e.jsx("span",{className:"font-semibold",children:"Limited analytics data."})," ","KPI cards will populate automatically as students, quizzes, and sessions accumulate in the platform. Chart visualisations require time-series data."]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:j.map((o,u)=>{const C=o.icon;return e.jsxs(L.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.35,delay:u*.06},className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("div",{className:`w-11 h-11 rounded-xl bg-gradient-to-br ${o.color} flex items-center justify-center shadow-sm`,children:e.jsx(C,{size:20,className:"text-white"})}),e.jsx("div",{className:"w-[120px] h-8 rounded bg-[#f0f3f8]"})]}),c?e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(F,{size:16,className:"animate-spin text-[#a0aec0]"}),e.jsx("div",{className:"w-14 h-6 bg-[#edf1f7] rounded-lg animate-pulse"})]}):o.value!==null?e.jsx("p",{className:"text-2xl font-bold text-[#0a1628] mb-2",children:o.value}):e.jsx("div",{className:"w-16 h-7 bg-[#edf1f7] rounded-lg mb-2"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-[#5a6578] font-medium",children:o.label}),e.jsx("span",{className:"text-xs text-[#a0aec0] font-medium",children:o.value===null?"—":p[t]})]})]},o.label)})}),e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs(L.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:"col-span-8 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Performance Trends"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Average scores — students vs. teacher targets"})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-sky-300"}),e.jsx("span",{className:"text-[#a0aec0] font-medium",children:"Students"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-violet-300"}),e.jsx("span",{className:"text-[#a0aec0] font-medium",children:"Teacher Targets"})]})]})]}),e.jsx(Y,{icon:e.jsx(ye,{size:24,className:"text-[#c2cad8]"}),title:"No performance data yet",subtitle:"Import student and class records to generate trend charts."})]}),e.jsxs(L.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.2},className:"col-span-4 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-violet-100 rounded-xl flex items-center justify-center",children:e.jsx(It,{size:20,className:"text-violet-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Grade Distribution"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"All students, current term"})]})]}),e.jsx(Y,{icon:e.jsx(ee,{size:24,className:"text-[#c2cad8]"}),title:"No grade data",subtitle:"Import quiz and assessment results to see grade breakdowns."})]})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs(L.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.25},className:"col-span-7 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center",children:e.jsx(O,{size:20,className:"text-sky-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Subject Engagement"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Enrollment, completion, and average scores"})]})]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-[#dde3eb]",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#f7f9fc]",children:[e.jsx("th",{className:"text-left text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Subject"}),e.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Enrolled"}),e.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Completion"}),e.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Avg. Score"}),e.jsx("th",{className:"text-left text-xs font-semibold text-[#5a6578] px-4 py-3 w-36",children:"Progress"})]})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-4 py-10",children:e.jsx(Y,{icon:e.jsx(ee,{size:22,className:"text-[#c2cad8]"}),title:"No subject data available",subtitle:"Import class enrollment records to view subject engagement."})})})})]})})]}),e.jsxs(L.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.3},className:"col-span-5 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-orange-100 rounded-xl flex items-center justify-center",children:e.jsx(ve,{size:20,className:"text-orange-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Weekly Activity"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Sessions per day of week"})]})]}),e.jsx(Y,{icon:e.jsx(Me,{size:24,className:"text-[#c2cad8]"}),title:"No session activity yet",subtitle:"Student logins and session data will appear here after data is imported."})]})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs(L.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.35},className:"col-span-5 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-rose-100 rounded-xl flex items-center justify-center",children:e.jsx(re,{size:20,className:"text-rose-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Gamification Overview"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Engagement & motivation metrics"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:f.map(o=>{const u=o.icon;return e.jsxs("div",{className:`${o.bg} border border-[#dde3eb] rounded-xl p-4`,children:[e.jsx(u,{size:20,className:o.color}),c?e.jsx("div",{className:"w-12 h-5 bg-white/60 rounded mt-2 mb-1 animate-pulse"}):o.value!==null?e.jsx("p",{className:"text-lg font-bold text-[#0a1628] mt-2 mb-1",children:o.value}):e.jsx("div",{className:"w-12 h-5 bg-white/60 rounded mt-2 mb-1"}),e.jsx("p",{className:"text-xs text-[#5a6578] font-medium",children:o.label}),!c&&o.value===null&&e.jsx("p",{className:"text-[10px] text-[#a0aec0] mt-1",children:"No data yet"})]},o.label)})})]}),e.jsxs(L.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.4},className:"col-span-7 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-teal-100 rounded-xl flex items-center justify-center",children:e.jsx(Ce,{size:20,className:"text-teal-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Top Performing Classes"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Ranked by average score this term"})]})]}),e.jsx(Y,{icon:e.jsx(ee,{size:24,className:"text-[#c2cad8]"}),title:"No class data yet",subtitle:"Import class and student records to see top performers ranked here."})]})]})]})},se=[{id:"gen-math",name:"Gen Math",shortName:"GM",color:"#3B82F6"},{id:"stats-prob",name:"Stats & Prob",shortName:"SP",color:"#0ea5e9"},{id:"pre-calc",name:"Pre-Calc",shortName:"PC",color:"#F97316"},{id:"basic-calc",name:"Basic Calc",shortName:"BC",color:"#EF4444"}],fe={"gen-math":[{name:"Functions & Relations",unit:"Functions"},{name:"Rational Functions",unit:"Functions"},{name:"Exponential Functions",unit:"Functions"},{name:"Logarithmic Functions",unit:"Functions"},{name:"Simple Interest",unit:"Business Math"},{name:"Compound Interest",unit:"Business Math"},{name:"Annuities",unit:"Business Math"},{name:"Propositions",unit:"Logic"},{name:"Truth Tables",unit:"Logic"}],"stats-prob":[{name:"Random Variables",unit:"Random Variables"},{name:"Probability Distributions",unit:"Random Variables"},{name:"Normal Distribution",unit:"Normal Dist"},{name:"Z-scores",unit:"Normal Dist"},{name:"Sampling Distributions",unit:"Sampling"},{name:"Central Limit Theorem",unit:"Sampling"},{name:"Confidence Intervals",unit:"Estimation"},{name:"Hypothesis Testing",unit:"Testing"},{name:"Correlation",unit:"Regression"}],"pre-calc":[{name:"Parabola",unit:"Conics"},{name:"Ellipse",unit:"Conics"},{name:"Hyperbola",unit:"Conics"},{name:"Arithmetic Seq",unit:"Series"},{name:"Geometric Seq",unit:"Series"},{name:"Math Induction",unit:"Series"},{name:"Trig Functions",unit:"Trigonometry"},{name:"Trig Identities",unit:"Trigonometry"},{name:"Polar Coords",unit:"Trigonometry"}],"basic-calc":[{name:"Limits",unit:"Limits"},{name:"Continuity",unit:"Limits"},{name:"Definition of Deriv.",unit:"Derivatives"},{name:"Diff. Rules",unit:"Derivatives"},{name:"Chain Rule",unit:"Derivatives"},{name:"Related Rates",unit:"Derivatives"},{name:"Optimization",unit:"Derivatives"},{name:"Antiderivatives",unit:"Integration"},{name:"Definite Integrals",unit:"Integration"}]};function js(t){return t>=85?"bg-emerald-500":t>=70?"bg-emerald-300":t>=55?"bg-rose-300":t>=40?"bg-orange-400":t>=20?"bg-red-400":"bg-red-600"}function vs(t){return t>=70||t>=40,"text-white"}const ys=({title:t="Platform-Wide Subject Mastery"})=>{const[a,i]=x.useState(null),[s,c]=x.useState("all"),[d,p]=x.useState([]),[j,f]=x.useState(!0);x.useEffect(()=>{(async()=>{f(!0);try{const v=await $(z(M,"progress")),y={};v.forEach(N=>{const r=N.data().subjects||{};for(const[w,D]of Object.entries(r)){const m=fe[w]||[],k=D?.progress??0;for(const U of m){const _=`${w}::${U.name}`;y[_]||(y[_]={totalMastery:0,count:0}),y[_].totalMastery+=k,y[_].count+=1}}});const I=[];for(const N of se){const h=fe[N.id]||[];for(const r of h){const w=`${N.id}::${r.name}`,D=y[w];I.push({subject:N.id,topic:r.name,mastery:D&&D.count>0?Math.round(D.totalMastery/D.count):0,students:D?.count??0})}}p(I)}catch(v){console.error("[MasteryHeatmap] Error fetching progress data:",v)}finally{f(!1)}})()},[]);const o=s==="all"?se:se.filter(g=>g.id===s),u=d.filter(g=>g.students>0),C=u.length>0?Math.round(u.reduce((g,v)=>g+v.mastery,0)/u.length):0,b=u.length>0?u.reduce((g,v)=>v.mastery0?u.reduce((g,v)=>v.mastery>g.mastery?v:g,u[0]):null;return j?e.jsx("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb] flex items-center justify-center min-h-[200px]",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(F,{size:28,className:"text-sky-500 animate-spin"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Loading mastery data..."})]})}):e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",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-sky-500 rounded-xl flex items-center justify-center",children:e.jsx($t,{size:20,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578]",children:["Aggregated mastery levels across all classes • ",d.filter(g=>g.students>0).length," tracked combinations"]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:s,onChange:g=>c(g.target.value),className:"appearance-none bg-[#edf1f7] border border-[#dde3eb] rounded-lg px-3 py-1.5 pr-8 text-xs font-semibold text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{value:"all",children:"All Subjects"}),se.map(g=>e.jsx("option",{value:g.id,children:g.name},g.id))]}),e.jsx(At,{size:12,className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-5",children:[e.jsxs("div",{className:"bg-[#edf1f7] rounded-xl p-3 flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${C>=70?"bg-emerald-100":"bg-rose-100"}`,children:e.jsx(Ct,{size:16,className:C>=70?"text-emerald-600":"text-rose-600"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-lg font-bold text-[#0a1628]",children:[C,"%"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider",children:"Platform Average"})]})]}),e.jsxs("div",{className:"bg-red-50 rounded-xl p-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-red-100 rounded-lg flex items-center justify-center",children:e.jsx(St,{size:16,className:"text-red-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628] truncate",children:b?.topic}),e.jsxs("p",{className:"text-[10px] text-red-600 font-semibold",children:[b?.mastery,"% — Lowest"]})]})]}),e.jsxs("div",{className:"bg-emerald-50 rounded-xl p-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-emerald-100 rounded-lg flex items-center justify-center",children:e.jsx(Dt,{size:16,className:"text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628] truncate",children:S?.topic}),e.jsxs("p",{className:"text-[10px] text-emerald-600 font-semibold",children:[S?.mastery,"% — Highest"]})]})]})]}),e.jsx("div",{className:"overflow-x-auto",children:o.map(g=>{const v=fe[g.id]||[],y=d.filter(N=>N.subject===g.id),I=y.length>0?Math.round(y.reduce((N,h)=>N+h.mastery,0)/y.length):0;return e.jsxs("div",{className:"mb-5 last:mb-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:g.color}}),e.jsx("span",{className:"text-xs font-bold text-[#0a1628]",children:g.name}),e.jsxs("span",{className:"text-[10px] text-slate-500 ml-1",children:["Avg: ",I,"%"]})]}),e.jsxs("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${v.length}, minmax(0, 1fr))`},children:[v.map((N,h)=>e.jsx("div",{className:"text-center",children:e.jsx("p",{className:"text-[9px] text-slate-500 truncate px-0.5 mb-1",title:N.name,children:N.name})},`label-${h}`)),v.map((N,h)=>{const r=y.find(m=>m.topic===N.name),w=r?.mastery||0,D=a?.topic===N.name&&a?.subject===g.id;return e.jsxs(L.div,{onMouseEnter:()=>r&&i(r),onMouseLeave:()=>i(null),whileHover:{scale:1.05},className:`relative h-10 rounded-lg flex items-center justify-center cursor-pointer transition-all ${js(w)} ${D?"ring-2 ring-white shadow-lg z-10":""}`,children:[e.jsxs("span",{className:`text-xs font-bold ${vs(w)}`,children:[w,"%"]}),D&&r&&e.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 bg-slate-800 text-white rounded-lg px-3 py-2 text-xs whitespace-nowrap z-20 shadow-xl pointer-events-none",children:[e.jsx("p",{className:"font-bold mb-0.5",children:r.topic}),e.jsxs("p",{children:["Mastery: ",e.jsxs("strong",{children:[r.mastery,"%"]})]}),e.jsxs("p",{children:["Students: ",e.jsx("strong",{children:r.students})]}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-full w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[6px] border-t-slate-800"})]})]},`cell-${h}`)})]})]},g.id)})}),e.jsxs("div",{className:"flex items-center justify-center gap-4 mt-5 pt-4 border-t border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#5a6578]",children:[e.jsx(ae,{size:10}),e.jsx("span",{children:"Color scale:"})]}),[{label:"0-19%",color:"bg-red-600"},{label:"20-39%",color:"bg-red-400"},{label:"40-54%",color:"bg-orange-400"},{label:"55-69%",color:"bg-rose-300"},{label:"70-84%",color:"bg-emerald-300"},{label:"85-100%",color:"bg-emerald-500"}].map((g,v)=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:`w-3 h-3 rounded-sm ${g.color}`}),e.jsx("span",{className:"text-[10px] text-[#5a6578]",children:g.label})]},v))]})]})},Ns=[{id:"gen-math",title:"General Mathematics",icon:O,bg:"bg-[#9956DE]",tags:["Algebra","Fractions","Integers"],level:1,progress:25,isAtRisk:!0},{id:"pre-calc",title:"Pre-Calculus",icon:O,bg:"bg-[#1FA7E1]",tags:["Functions","Limits","Graphs"],level:2,progress:15,isAtRisk:!0},{id:"stats-prob",title:"Statistics & Probability",icon:O,bg:"bg-[#FFB356]",tags:["Probability","Mean/Median"],level:2,progress:40,isAtRisk:!1},{id:"basic-calc",title:"Basic Calculus",icon:O,bg:"bg-[#FB96BB]",tags:["Derivatives","Integrals"],level:3,progress:50,isAtRisk:!1},{id:"adv-math",title:"Advanced Algebra",icon:O,bg:"bg-[#7274ED]",tags:["Math","Logic"],level:4,progress:10,isAtRisk:!0}].slice(0,5),ws=()=>{const t=x.useRef(null),[a,i]=x.useState(0),s=()=>{if(!t.current)return;const{scrollLeft:d,scrollWidth:p,clientWidth:j}=t.current,f=d/(p-j),o=3;let u=Math.round(f*(o-1));u<0&&(u=0),u>=o&&(u=o-1),i(u)},c=d=>{if(!t.current)return;const{scrollWidth:p,clientWidth:j}=t.current,o=(p-j)/2*d;t.current.scrollTo({left:o,behavior:"smooth"}),i(d)};return e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb] mb-6",children:[e.jsx("div",{className:"flex items-center justify-between mb-5",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-1",children:"Priority Attention Modules"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Highly recommended to be reviewed (lowest performance)."})]})}),e.jsx("div",{className:"relative",children:e.jsx("div",{ref:t,onScroll:s,className:"flex overflow-x-auto snap-x snap-mandatory gap-5 pb-6 hide-scrollbar",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:Ns.map(d=>{const p=d.icon;return e.jsxs("div",{className:`snap-center shrink-0 w-[280px] sm:w-[300px] ${d.bg} rounded-[2rem] p-5 min-h-[290px] relative overflow-hidden transition-all duration-300 flex flex-col group shadow-sm`,children:[e.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-32 h-32 bg-white opacity-10 rounded-full"}),e.jsx("div",{className:"absolute bottom-4 right-12 w-20 h-20 bg-white opacity-10 rounded-full"}),e.jsxs("div",{className:"flex justify-between items-start mb-4 relative z-10",children:[e.jsx("div",{className:"w-12 h-12 rounded-[1rem] bg-white/20 flex flex-shrink-0 items-center justify-center text-white backdrop-blur-sm",children:e.jsx(p,{size:24,className:"opacity-90"})}),e.jsxs("div",{className:"px-4 py-1.5 rounded-full bg-white/20 text-white/90 text-sm font-bold backdrop-blur-sm",children:["Lv ",d.level]})]}),e.jsxs("div",{className:"relative z-10 flex-1",children:[e.jsx("h3",{className:"text-2xl font-display font-black text-white leading-[1.1] mb-3 drop-shadow-sm pr-4 line-clamp-2",children:d.title}),e.jsx("div",{className:"flex flex-wrap gap-2 pb-4",children:d.tags.map(j=>e.jsx("span",{className:"px-3 py-1 rounded-full bg-white/20 text-white text-[13px] font-bold shadow-sm backdrop-blur-sm",children:j},j))})]}),e.jsxs("div",{className:"relative z-10 mt-auto pt-4 flex flex-col gap-2.5",children:[e.jsxs("div",{className:"flex justify-between text-white/90 text-[13px] font-bold",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx("span",{children:"Avg Mastery"})}),e.jsxs("span",{children:[d.progress,"%"]})]}),e.jsx("div",{className:"w-full h-2 rounded-full bg-white/30 overflow-hidden shadow-inner mt-1",children:e.jsx("div",{className:"h-full bg-white rounded-full",style:{width:`${d.progress}%`}})}),d.isAtRisk&&e.jsxs("div",{className:"absolute -top-12 right-0 bg-red-500 text-white px-3 py-1 rounded-full text-[11px] font-bold flex items-center gap-1 shadow-lg animate-pulse",children:[e.jsx(be,{size:12})," At Risk"]})]})]},d.id)})})}),e.jsx("div",{className:"flex justify-center items-center gap-2 mt-2",children:[0,1,2].map(d=>e.jsx("button",{onClick:()=>c(d),className:`w-2.5 h-2.5 rounded-full transition-all duration-300 ${a===d?"bg-sky-600 w-6":"bg-sky-200 hover:bg-sky-300"}`,"aria-label":`Go to slide ${d+1}`},d))}),e.jsx("style",{children:` - .hide-scrollbar::-webkit-scrollbar { - display: none; - } - `})]})},Na=({onLogout:t,onOpenProfile:a,onOpenSettings:i})=>{const[s,c]=x.useState("Overview"),[d,p]=x.useState(!1),[j,f]=x.useState(!1),[o,u]=x.useState(null),[C,b]=x.useState([]),[S,g]=x.useState([]),[v,y]=x.useState(!0);x.useEffect(()=>{if(s!=="Overview")return;let h=!1;return y(!0),Promise.all([is(),Ve(),cs(3)]).then(([r,w,D])=>{h||(u(r),b(w.slice(0,4)),g(D))}).catch(console.error).finally(()=>{h||y(!1)}),()=>{h=!0}},[s]);const I=[{label:"Total Students",value:v?"...":(o?.totalStudents??0).toLocaleString(),icon:de,color:"bg-sky-100",iconColor:"text-sky-600"},{label:"Active Teachers",value:v?"...":(o?.activeTeachers??0).toString(),icon:Ce,color:"bg-teal-100",iconColor:"text-teal-600"},{label:"Total Classes",value:v?"...":(o?.totalClasses??0).toString(),icon:O,color:"bg-sky-100",iconColor:"text-sky-600"},{label:"At-Risk Students",value:v?"...":(o?.atRiskStudents??0).toString(),icon:le,color:"bg-red-100",iconColor:"text-red-600"},{label:"Avg Performance",value:v?"...":`${o?.avgPerformance??0}%`,icon:ye,color:"bg-orange-100",iconColor:"text-orange-600"},{label:"AI Interactions",value:v?"...":(o?.aiPredictions??0).toLocaleString(),icon:$e,color:"bg-sky-100",iconColor:"text-sky-600"}],N=h=>h==="Error"||h==="Critical"?{text:"text-red-600",bg:"bg-red-50"}:h==="Warning"?{text:"text-rose-600",bg:"bg-rose-50"}:{text:"text-sky-600",bg:"bg-sky-50"};return e.jsxs("div",{className:"flex h-screen w-full bg-[#edf1f7] overflow-hidden",children:[e.jsx(Qe,{activeTab:s,setActiveTab:c,userRole:"admin",onOpenSettings:i,onLogout:()=>p(!0),sidebarCollapsed:j,setSidebarCollapsed:f}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("header",{className:"bg-white/80 backdrop-blur-md border-b border-[#dde3eb] px-6 py-3 flex items-center justify-between sticky top-0 z-30",children:[e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-display font-bold text-[#0a1628] leading-tight",children:[s==="Overview"&&"Admin Dashboard",s==="Content"&&"Content",s==="Audit Log"&&"Audit Log",s==="User Management"&&"User Management",s==="Analytics"&&"Analytics",s==="Settings"&&"Settings"]}),e.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:[s==="Overview"&&"System Overview & Management",s==="Content"&&"Manage platform content",s==="Audit Log"&&"Monitor system activity",s==="User Management"&&"Manage all user accounts",s==="Analytics"&&"Detailed performance metrics",s==="Settings"&&"Configure platform settings"]})]})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{onClick:a,className:"flex items-center gap-2.5 w-[152px] h-11 shrink-0 bg-[#edf1f7] p-1.5 pr-3 rounded-lg cursor-pointer hover:bg-[#dde3eb] transition-all group",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-sky-600 to-indigo-600 rounded-lg flex items-center justify-center",children:e.jsx(Z,{size:16,className:"text-white"})}),e.jsx("div",{className:"min-w-0 flex-1 text-left",children:e.jsx("p",{className:"text-sm font-semibold text-[#0a1628] leading-none group-hover:text-sky-600 transition-colors truncate",children:"Admin"})})]})})]}),e.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[s==="Overview"&&e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs("div",{className:"col-span-8 space-y-6",children:[e.jsx("div",{className:"grid grid-cols-3 gap-4",children:I.map((h,r)=>{const w=h.icon;return e.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb] hover:shadow-md transition-all",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsx("div",{className:`w-12 h-12 ${h.color} rounded-xl flex items-center justify-center`,children:e.jsx(w,{size:24,className:h.iconColor})})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628] mb-1",children:v?e.jsx(F,{size:20,className:"animate-spin text-slate-400"}):h.value}),e.jsx("p",{className:"text-sm text-[#5a6578] font-medium",children:h.label})]},r)})}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsx("div",{className:"flex items-center justify-between mb-6",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-1",children:"System Performance Overview"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Last 30 days"})]})}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[e.jsx(ye,{size:32,className:"text-[#dde3eb]"}),e.jsx("p",{className:"text-sm font-medium text-[#5a6578]",children:"No performance data yet"}),e.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Import class records to populate analytics."})]})]}),e.jsx(ws,{}),e.jsx(ys,{}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-5",children:"Recent System Activity"}),v?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(F,{className:"animate-spin text-sky-500"})}):C.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[e.jsx(Lt,{size:28,className:"text-[#dde3eb]"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"No audit events yet"})]}):e.jsx("div",{className:"space-y-3",children:C.map(h=>{const r=N(h.severity);return e.jsxs("div",{className:`${r.bg} border border-[#dde3eb] rounded-2xl p-4 flex items-start gap-4`,children:[e.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(Z,{size:18,className:r.text})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628] mb-0.5",children:h.action}),e.jsx("p",{className:"text-xs text-[#5a6578] truncate",children:h.details}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:[h.timestamp," · ",h.user.name]})]})]},h.id)})})]})]}),e.jsxs("div",{className:"col-span-4 space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-600 to-sky-600 rounded-3xl p-6 text-white shadow-lg",children:[e.jsx("h2",{className:"text-lg font-bold mb-4",children:"Quick Actions"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"Add New Teacher"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Create teacher account"})]}),e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"Add New Student"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Register new student"})]}),e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"System Settings"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Configure platform"})]}),e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"Generate Report"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Export analytics"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsx("div",{className:"w-10 h-10 bg-rose-100 rounded-xl flex items-center justify-center",children:e.jsx(re,{size:20,className:"text-rose-600"})}),e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Top Performers"})]}),v?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(F,{className:"animate-spin text-sky-500"})}):S.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[e.jsx(re,{size:28,className:"text-[#dde3eb]"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"No student data yet"}),e.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Students will appear here as they progress."})]}):e.jsx("div",{className:"space-y-3",children:S.map((h,r)=>e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:h.avatar,alt:h.name,className:"w-12 h-12 rounded-xl object-cover"}),e.jsx("span",{className:"absolute -top-1 -right-1 w-6 h-6 bg-rose-500 text-white text-xs font-bold rounded-full flex items-center justify-center",children:r+1})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:h.name}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:h.class})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-white rounded-xl p-2",children:[e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-1",children:"Performance"}),e.jsxs("p",{className:"text-lg font-bold text-teal-600",children:[h.performance,"%"]})]}),e.jsxs("div",{className:"bg-white rounded-xl p-2",children:[e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-1",children:"Level"}),e.jsx("p",{className:"text-lg font-bold text-sky-600",children:h.level})]})]})]},h.id))})]}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-5",children:"AI Model Status"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-[#5a6578]",children:"Prediction Accuracy"}),e.jsx("span",{className:"text-sm font-bold text-[#5a6578]",children:"No data"})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#dde3eb] rounded-full",style:{width:"0%"}})}),e.jsxs("div",{className:"flex items-center justify-between mt-4",children:[e.jsx("span",{className:"text-sm text-[#5a6578]",children:"Model Performance"}),e.jsx("span",{className:"text-sm font-bold text-[#5a6578]",children:"Untrained"})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#dde3eb] rounded-full",style:{width:"0%"}})}),e.jsx("div",{className:"mt-4 p-3 bg-sky-50 border border-sky-200 rounded-xl",children:e.jsxs("p",{className:"text-xs text-sky-800",children:[e.jsx("strong",{children:"Status:"})," Import student data to enable AI predictions."]})})]})]})]})]}),s==="Content"&&e.jsx(os,{}),s==="Audit Log"&&e.jsx(xs,{}),s==="User Management"&&e.jsx(fs,{}),s==="Analytics"&&e.jsx(bs,{}),s==="Settings"&&e.jsx(hs,{})]})]}),e.jsx(Ne,{isOpen:d,onClose:()=>p(!1),onConfirm:t,title:"Logout Confirmation",message:"Are you sure you want to log out? This will end your current session.",confirmText:"Logout",cancelText:"Cancel"})]})};export{Na as default}; diff --git a/assets/AvatarShop-BirEYu2M.js b/assets/AvatarShop-BirEYu2M.js deleted file mode 100644 index 65250a3fee21cffd599dd918e83723e7f2a3800e..0000000000000000000000000000000000000000 --- a/assets/AvatarShop-BirEYu2M.js +++ /dev/null @@ -1,16 +0,0 @@ -import{r as n,j as e}from"./vendor-react-Dexh7fmo.js";import{c as F,L as O,d as V,e as $}from"./vendor-radix-BRdei-zg.js";import{c as k,u as B,i as C,m as d,e as K,J as Y,t as l,K as Z,L as W}from"./index-D4nJsLyx.js";import{T as D,a as G,b as H}from"./tooltip-BV3U-RJu.js";import{C as J}from"./CompositeAvatar-DMpjm5UY.js";import{M}from"./avatarData-BW_TX0b4.js";import{S as E}from"./sparkles-CXUFmaBJ.js";import{L as U}from"./lock-_59co5m5.js";import{S as Q}from"./save-Og8yP5Yb.js";import{S as ee}from"./shirt-BMZy0pq4.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./utils-BQQgILNW.js";import"./clsx-B-dksMZM.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const te=[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]],se=k("footprints",te);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ae=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],re=k("scissors",ae);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oe=[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]],N=k("shopping-bag",oe),Ne=({onSaveProfile:P,onNavigateToModules:T})=>{const{userProfile:r,refreshProfile:u}=B(),[x,S]=n.useState({top:r?.avatarLayers?.top||"top_pink",bottom:r?.avatarLayers?.bottom||"",shoes:r?.avatarLayers?.shoes||"",accessory:r?.avatarLayers?.accessory||""}),[h,f]=n.useState(!1),[b,g]=n.useState([]),[_,w]=n.useState(0),[m,p]=n.useState(null),[c,v]=n.useState(null),z=["Wow!","Cute!","I love it!","Perfect!","So cool!","Awesome!"],y=["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!"];n.useEffect(()=>{if(r&&r.role==="student"){const t=r;g(t.ownedAvatarItems||[]),w(t.currentXP||0)}},[r]),n.useEffect(()=>{if(!c){const t=setInterval(()=>{Math.random()>.6&&v(y[Math.floor(Math.random()*y.length)])},4e3);return()=>clearInterval(t)}},[c,y]),n.useEffect(()=>{if(c){const t=setTimeout(()=>{v(null)},3500);return()=>clearTimeout(t)}},[c]);const A=(t,o)=>{const s=M.find(a=>a.id===o);if(s&&s.price&&s.price>0&&!b.includes(o)){l.error("This item is locked. Purchase it first!");return}S(a=>({...a,[t]:a[t]===o?"":o})),v(z[Math.floor(Math.random()*z.length)])},L=async(t,o,s)=>{if(t.stopPropagation(),!r?.uid){l.error("You must be logged in to purchase items");return}if(b.includes(o)){l.info("You already own this item");return}p(o);try{const a=await Z(r.uid,o,s);a.success?(l.success(a.message||"Item purchased!"),g(j=>[...j,o]),a.currentXP!==void 0&&w(a.currentXP),await u()):l.error(a.message||"Failed to purchase item")}catch(a){console.error("Purchase error:",a),l.error("Error purchasing item")}finally{p(null)}},X=async()=>{if(r?.uid&&m!=="resetting"){p("resetting");try{const t=await Y(r.uid);t.success?(g([]),S({top:"top_pink",bottom:"",shoes:"",accessory:""}),w(t.newXP),l.success(`Purchases reset and XP updated to ${t.newXP}! (Test Mode)`),await u()):l.error("Failed to reset purchases")}catch(t){console.error("Reset error:",t),l.error("Error resetting purchases")}finally{p(null)}}},q=async()=>{if(r?.uid){f(!0);try{await W(r.uid,{avatarLayers:x}),P&&P(x),l.success("Avatar saved successfully"),await u(),f(!1)}catch(t){console.error(t),f(!1)}}},I=[{id:"top",label:"Tops",icon:e.jsx(ee,{size:16})},{id:"bottom",label:"Bottoms",icon:e.jsx(re,{size:16,className:"rotate-90"})},{id:"shoes",label:"Shoes",icon:e.jsx(se,{size:16})},{id:"accessory",label:"Accessories",icon:e.jsx(C,{size:16})}];return e.jsx("div",{className:"h-full w-full flex items-center justify-center p-4 sm:p-6 lg:p-8 overflow-hidden",children:e.jsxs("div",{className:"relative w-full max-w-[1200px] h-[85vh] min-h-[600px] max-h-[850px] rounded-[2rem] p-8 lg:p-12 bg-gradient-to-br from-white via-sky-50/30 to-white border border-slate-200/80 shadow-[0_8px_30px_rgb(0,0,0,0.04)] flex flex-col xl:flex-row gap-12",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/30 to-transparent"}),e.jsx("div",{className:"absolute -top-40 -right-40 w-96 h-96 bg-blue-100/40 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute -bottom-40 -left-40 w-96 h-96 bg-purple-100/30 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"flex flex-col h-full relative z-10 w-full xl:w-7/12 mx-auto xl:mx-0",children:[e.jsxs("div",{className:"mb-8 flex flex-col sm:flex-row items-start justify-between gap-6 shrink-0",children:[e.jsxs("div",{className:"pr-4",children:[e.jsxs("h1",{className:"text-4xl md:text-5xl font-display font-black text-[#0a1628] tracking-tight flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"whitespace-nowrap",children:"Avatar Studio"})," ",e.jsx(E,{className:"text-blue-500 fill-blue-500",size:32})]}),e.jsx("p",{className:"text-slate-500 font-medium text-lg mt-2",children:"Design your perfect learning companion."})]}),e.jsxs("div",{className:"flex items-center gap-4 sm:ml-auto",children:[e.jsx("button",{onClick:X,disabled:m==="resetting",className:"hidden sm:flex self-stretch items-center bg-slate-100 hover:bg-red-50 text-slate-500 hover:text-red-500 px-3 py-2 rounded-2xl font-bold text-xs transition-colors border border-slate-200",children:"Reset (Test)"}),e.jsxs("div",{className:"bg-gradient-to-br from-amber-400 to-orange-500 rounded-2xl px-4 py-3 shadow-lg flex items-center gap-2 h-fit",children:[e.jsx(N,{className:"text-white",size:20}),e.jsxs(D,{children:[e.jsx(G,{asChild:!0,children:e.jsxs("button",{onClick:T,className:"cursor-pointer hover:opacity-90 transition-opacity active:scale-95",children:[e.jsx("p",{className:"text-white text-xs font-bold uppercase tracking-wider",children:"XP Balance"}),e.jsx("p",{className:"text-white text-2xl font-black",children:_})]})}),e.jsx(H,{side:"bottom",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]})]})]}),e.jsxs(F,{defaultValue:"top",className:"flex flex-col flex-1 min-h-0",children:[e.jsx(O,{className:"flex flex-nowrap shrink-0 justify-start space-x-2 sm:space-x-4 mb-4 sm:mb-8 bg-white shadow-sm p-1.5 rounded-full border border-slate-100 w-fit overflow-x-auto max-w-full scrollbar-hide",children:I.map(t=>e.jsxs(V,{value:t.id,className:"flex items-center gap-2 px-6 py-2.5 rounded-full font-bold text-sm 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:I.map(t=>{const o=M.filter(s=>s.category===t.id);return e.jsx($,{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(C,{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 lg:grid-cols-3 gap-8",children:o.map(s=>{const a=x[t.id]===s.id,j=b.includes(s.id),i=!!(s.price&&s.price>0&&!j);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("button",{onClick:()=>!i&&A(t.id,s.id),disabled:i,className:`relative w-full aspect-square rounded-[1.5rem] border-[3px] transition-all flex flex-col items-center justify-center group ${a&&!i?"bg-white border-blue-500 shadow-md scale-[1.02] z-10":i?"bg-slate-50 border-slate-200 opacity-50 cursor-not-allowed":"bg-white border-slate-100 hover:border-sky-300 hover:shadow-lg hover:scale-[1.02] hover:z-10"}`,children:[a&&!i&&e.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 px-2 py-1 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(E,{size:9,className:"fill-white"})]}),i&&e.jsx("div",{className:"absolute inset-0 bg-black/20 z-20 flex items-center justify-center rounded-[1.3rem]",children:e.jsx(U,{className:"text-white",size:24})}),e.jsx("img",{src:s.thumbnail,alt:s.name,className:`w-4/5 h-4/5 object-contain transition-transform ${!i&&"group-hover:scale-110"}`,style:{filter:i?"grayscale(70%)":"none"}})]}),e.jsx("p",{className:"text-xs font-bold text-slate-700 text-center line-clamp-2",children:s.name}),i&&e.jsx(d.button,{initial:{opacity:0},animate:{opacity:1},onClick:R=>L(R,s.id,s.price||0),disabled:m===s.id,className:"w-full py-1.5 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white text-[10px] font-bold flex items-center justify-center gap-1.5 rounded-lg shadow-md transition-all disabled:opacity-70",children:m===s.id?e.jsx(d.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-6 relative z-10 w-full xl:w-[450px] shrink-0 xl:self-center",children:[e.jsxs("div",{className:"bg-[#0f1422] rounded-[3rem] overflow-hidden relative shadow-[0_20px_50px_rgba(15,20,34,0.3)] h-[400px] xl:h-[480px] w-full flex items-center justify-center mx-auto border-8 border-slate-800",children:[e.jsx("div",{className:"absolute top-[-10%] left-0 right-0 h-[110%] pointer-events-none mix-blend-screen opacity-70",style:{background:"linear-gradient(to bottom, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 60%, transparent 100%)",clipPath:"polygon(15% 0, 85% 0, 65% 100%, 35% 100%)"}}),e.jsx("div",{className:"absolute bottom-12 left-1/2 -translate-x-1/2 w-[220px] h-[25px] bg-sky-500/20 blur-xl rounded-full"}),e.jsxs(d.div,{animate:{y:[-8,8,-8]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},className:"relative w-full h-[80%] z-10 flex justify-center items-center",children:[e.jsx(J,{layers:x,className:"w-full h-full absolute inset-0 z-20"}),e.jsx(K,{children:c&&e.jsxs(d.div,{initial:{opacity:0,y:-10,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.8},transition:{duration:.3},className:"absolute -top-24 left-1/2 -translate-x-1/2 z-30 bg-white text-slate-800 px-4 py-2 rounded-full shadow-lg border-2 border-sky-300 whitespace-nowrap font-bold text-sm max-w-xs text-center",children:[c,e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-white"})]})})]})]}),e.jsxs("button",{onClick:q,disabled:h,className:"w-full max-w-[450px] mx-auto h-[64px] bg-blue-600 hover:bg-blue-500 text-white rounded-2xl font-bold text-lg flex items-center justify-center gap-3 transition-colors shadow-md disabled:opacity-70 disabled:cursor-not-allowed active:scale-[0.98]",children:[h?e.jsx(d.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},children:e.jsx(Q,{size:24,className:"opacity-50"})}):null,h?"Saving...":"Save Profile Avatar"]})]})]})})};export{Ne as default}; diff --git a/assets/ChatMarkdown-B34PtYCE.js b/assets/ChatMarkdown-B34PtYCE.js deleted file mode 100644 index d0813776b0c7354d78b327d96ac0878f3ddb8d19..0000000000000000000000000000000000000000 --- a/assets/ChatMarkdown-B34PtYCE.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-C5ikSDMA.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-markdown-CBmFCdgC.css"])))=>i.map(i=>d[i]); -import{Q as i,_ as c}from"./index-D4nJsLyx.js";import{r as m,j as r}from"./vendor-react-Dexh7fmo.js";import{M as h,r as x,a as y}from"./vendor-markdown-C5ikSDMA.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-C5ikSDMA.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),v=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=i(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:s})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:s}),code:e=>{const{inline:s,className:n,children:o,...d}=e;return r.jsx("code",{className:`${s?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${n||""}`,...d,children:o})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{v as default}; diff --git a/assets/CompetencyRadarChart-BfcP7xrw.js b/assets/CompetencyRadarChart-BfcP7xrw.js deleted file mode 100644 index 14cfcacf0be07fe6773438db6aecd55fffe51e24..0000000000000000000000000000000000000000 --- a/assets/CompetencyRadarChart-BfcP7xrw.js +++ /dev/null @@ -1,2 +0,0 @@ -import{c as u,g as he,r as A,j as p}from"./vendor-react-Dexh7fmo.js";import{u as it,p as at,m as ot}from"./index-D4nJsLyx.js";import{g as st,s as ke}from"./subjects-DDBtpdiA.js";import{B as ct}from"./brain-CPvGdgWE.js";import{S as lt}from"./sparkles-CXUFmaBJ.js";import{f as b,x as w,y as qe,z as ut,A as We,D as ft,b as B,T as Ke,L as S,E as Ve,d as Ge,e as pt,F as He,H as dt,I as X,J as mt,K as yt,G as ht,M as we,N as vt,O as _e,r as gt,P as bt,R as xt,v as Pt}from"./generateCategoricalChart-CiUYzAvW.js";import{c as N}from"./clsx-B-dksMZM.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./trending-up-D-vj8Gbq.js";import"./chart-column-D5mAWcRx.js";var Ot=["points","className","baseLinePoints","connectNulls"];function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function kt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ae(t){return Et(t)||At(t)||_t(t)||wt()}function wt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _t(t,e){if(t){if(typeof t=="string")return pe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(t,e)}}function At(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Et(t){if(Array.isArray(t))return pe(t)}function pe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){Ee(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),Ee(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},V=function(e,n){var r=St(e);n&&(r=[r.reduce(function(a,o){return[].concat(Ae(a),Ae(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,s,c){return"".concat(o).concat(c===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Nt=function(e,n,r){var i=V(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(V(n.reverse(),r).slice(1))},Ze=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=jt(e,Ot);if(!n||!n.length)return null;var s=N("recharts-polygon",r);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",d=Nt(n,i,a);return u.createElement("g",{className:s},u.createElement("path",F({},b(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",stroke:"none",d})),c?u.createElement("path",F({},b(o,!0),{fill:"none",d:V(n,a)})):null,c?u.createElement("path",F({},b(o,!0),{fill:"none",d:V(i,a)})):null)}var f=V(n,a);return u.createElement("path",F({},b(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))},Tt=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function H(t){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(t)}function $t(t,e){if(t==null)return{};var n=Rt(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Yt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Jt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Le(t,e){for(var n=0;nMe?o=i==="outer"?"start":"end":a<-Me?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,s=r.axisLine,c=r.axisLineType,d=L(L({},b(this.props,!1)),{},{fill:"none"},b(s,!1));if(c==="circle")return u.createElement(He,D({className:"recharts-polar-angle-axis-line"},d,{cx:i,cy:a,r:o}));var f=this.props.ticks,m=f.map(function(l){return w(i,a,o,l.coordinate)});return u.createElement(Ze,D({className:"recharts-polar-angle-axis-line"},d,{points:m}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,c=i.tickFormatter,d=i.stroke,f=b(this.props,!1),m=b(o,!1),l=L(L({},f),{},{fill:"none"},b(s,!1)),v=a.map(function(y,h){var g=r.getTickLineCoord(y),O=r.getTickTextAnchor(y),j=L(L(L({textAnchor:O},f),{},{stroke:"none",fill:d},m),{},{index:h,payload:y,x:g.x2,y:g.y2});return u.createElement(S,D({className:N("recharts-polar-angle-axis-tick",Ve(o)),key:"tick-".concat(y.coordinate)},Ge(r.props,y,h)),s&&u.createElement("line",D({className:"recharts-polar-angle-axis-tick-line"},l,g)),o&&e.renderTickItem(o,j,c?c(y.value,h):y.value))});return u.createElement(S,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:u.createElement(S,{className:N("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return u.isValidElement(r)?o=u.cloneElement(r,i):B(r)?o=r(i):o=u.createElement(Ke,D({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(A.PureComponent);ie(Y,"displayName","PolarAngleAxis");ie(Y,"axisType","angleAxis");ie(Y,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var ue,Ce;function pr(){if(Ce)return ue;Ce=1;function t(e){return e&&e.length?e[0]:void 0}return ue=t,ue}var fe,Be;function dr(){return Be||(Be=1,fe=pr()),fe}var mr=dr();const yr=he(mr);var hr=["key"];function W(t){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(t)}function vr(t,e){if(t==null)return{};var n=gr(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gr(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function te(){return te=Object.assign?Object.assign.bind():function(t){for(var e=1;e=2&&(c=!0),d.push(P(P({},w(o,s,j,g)),{},{name:y,value:h,cx:o,cy:s,radius:j,angle:g,payload:l}))});var m=[];return c&&d.forEach(function(l){if(Array.isArray(l.value)){var v=yr(l.value),y=_e(v)?void 0:e.scale(v);m.push(P(P({},l),{},{radius:y},w(o,s,y,l.angle)))}else m.push(l)}),{points:d,isRange:c,baseLinePoints:m}});var _r=gt({chartName:"RadarChart",GraphicalChild:J,axisComponents:[{axisType:"angleAxis",AxisComp:Y},{axisType:"radiusAxis",AxisComp:U}],formatAxisMap:bt,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const zr=()=>{const{userProfile:t}=it(),[e,n]=A.useState([]),[r,i]=A.useState([]),[a,o]=A.useState("N/A"),[s,c]=A.useState(!0),[d,f]=A.useState(!1),m=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];return A.useEffect(()=>{if(!t?.uid){c(!1);return}const l=t.role==="student"?t.grade:null,y=st(l)[0]??"gen-math",h=ke.find(x=>x.id===y)?.modules||[],g=new Map;ke.forEach(x=>{x.modules.forEach($=>g.set($.id,x.id))});const O=h.map((x,$)=>({id:x.id,name:x.title.length>15?x.title.substring(0,15).trim()+"...":x.title,color:m[$%m.length]}));i(O);const j=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}],ae=x=>{let $=-1,ve="N/A";const ge=j.map(_=>{const K={metric:_.label,fullMark:100};return h.forEach(k=>{const I=g.get(k.id),M=I?x?.subjects?.[I]?.modulesProgress?.[k.id]:null,be=M?.progress||0,rt=x?.lessons??{},xe=k.lessons.length?k.lessons.reduce((Oe,je)=>{const se=rt?.[je.id]?.progressPercent;if(typeof se=="number"&&Number.isFinite(se))return Oe+Math.max(0,Math.min(100,se));const nt=!!M?.lessonsCompleted?.includes?.(je.id);return Oe+(nt?100:0)},0)/k.lessons.length:0,Pe=k.quizzes.length?(M?.quizzesCompleted?.length||0)/k.quizzes.length*100:0;let C=0;_.key==="progress"?C=be:_.key==="concept"?C=xe:_.key==="application"?C=Pe:_.key==="engagement"?C=Math.min(100,(xe+Pe*2)/1.5):_.key==="consistency"&&(C=Math.min(100,40+be*.6)),K[k.id]=C||0}),K});h.forEach(_=>{let K=0;ge.forEach(I=>{const M=I[_.id];K+=typeof M=="number"?M:0});const k=K/j.length;k>$&&($=k,ve=O.find(I=>I.id===_.id)?.name||"N/A")}),o(ve),n(ge),c(!1)};c(!0);const oe=at(t.uid,x=>{ae(x)});return()=>oe()},[t?.uid]),p.jsxs(ot.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white/80 backdrop-blur-xl border border-white/50 shadow-[0_8px_30px_rgb(0,0,0,0.04)] rounded-[2rem] p-6 lg:p-8 isolate group",onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[p.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-violet-400/5 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),p.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-rose-400/5 rounded-full blur-3xl translate-y-1/3 -translate-x-1/3"}),p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 relative z-10 gap-4",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"p-2 bg-violet-100 text-violet-600 rounded-xl",children:p.jsx(ct,{size:20,className:"stroke-[2.5]"})}),p.jsx("h3",{className:"text-xl font-display font-extrabold text-[#0a1628] tracking-tight",children:"Competency Matrix"})]}),p.jsx("p",{className:"text-sm text-[#5a6578] font-body ml-12",children:"Your realtime performance across modules"})]}),p.jsxs("div",{className:"flex items-center gap-3 bg-slate-50 border border-slate-100 px-4 py-2 rounded-2xl ml-12 sm:ml-0",children:[p.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white shadow-sm border border-slate-100",children:p.jsx(lt,{size:14,className:"text-amber-500"})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Top Module"}),p.jsx("p",{className:"text-sm font-bold text-slate-700",children:a})]})]})]}),p.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?p.jsx("div",{className:"w-full h-full flex items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx("div",{className:"w-8 h-8 border-4 border-violet-200 border-t-violet-500 rounded-full animate-spin"}),p.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):p.jsx(xt,{width:"100%",height:"100%",children:p.jsxs(_r,{cx:"50%",cy:"50%",outerRadius:d?"75%":"70%",data:e,children:[p.jsx(Ue,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),p.jsx(Y,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600,fontFamily:"Inter, sans-serif"}}),p.jsx(U,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),r.map(l=>p.jsx(J,{name:l.name,dataKey:l.id,stroke:l.color,strokeWidth:2,fill:l.color,fillOpacity:.35,dot:{r:3,fill:"#fff",stroke:l.color,strokeWidth:2},activeDot:{r:5,fill:l.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},l.id)),p.jsx(Pt,{cursor:!1,content:({active:l,payload:v})=>l&&v&&v.length?p.jsxs("div",{className:"bg-white/95 backdrop-blur shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] border border-slate-100 rounded-xl p-4",children:[p.jsx("p",{className:"font-display font-bold text-slate-800 text-sm mb-3",children:v[0].payload.metric}),p.jsx("div",{className:"flex flex-col gap-2",children:v.map(y=>p.jsxs("div",{className:"flex items-center justify-between gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:y.stroke}}),p.jsx("span",{className:"text-xs font-bold text-slate-600 uppercase tracking-wide truncate max-w-[120px]",title:String(y.name),children:String(y.name)})]}),p.jsxs("span",{className:"text-sm font-black",style:{color:y.stroke},children:[Math.round(y.value),"%"]})]},y.name))})]}):null})]})})}),!s&&r.length>0&&p.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 md:gap-5 mt-[5px] z-10 relative",children:r.map(l=>p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:l.color}}),p.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-widest",children:l.name.length>15?l.name.substring(0,12)+"...":l.name})]},l.id))})]})};export{zr as CompetencyRadarChart}; diff --git a/assets/CompositeAvatar-DMpjm5UY.js b/assets/CompositeAvatar-DMpjm5UY.js deleted file mode 100644 index 39f5b62b2d3a1484e3c708ddf5d8f37df98e2fd4..0000000000000000000000000000000000000000 --- a/assets/CompositeAvatar-DMpjm5UY.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./vendor-react-Dexh7fmo.js";import{g as e}from"./avatarData-BW_TX0b4.js";import{m as s}from"./index-D4nJsLyx.js";const g=({layers:a,className:o="w-10 h-10 bg-slate-200 rounded-full",fallbackSrc:m})=>{const n=e(a?.top),i=e(a?.bottom),l=e(a?.shoes),r=e(a?.accessory),c=t.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"base body",className:"absolute inset-0 w-full h-full object-contain z-10"}),u=t.jsxs(s.div,{className:"absolute inset-0 w-full h-full z-50 pointer-events-none",animate:{rotate:[-2,2,-2],y:[0,-3,0]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},style:{originY:.7,originX:.5},children:[t.jsx(s.img,{src:"/avatar/left_horn.png",alt:"left horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[-4,4,-4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx(s.img,{src:"/avatar/right_horn.png",alt:"right horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[4,-4,4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"head base",className:"absolute inset-0 w-full h-full object-contain z-10"}),t.jsx(s.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:"absolute inset-0 w-full h-full object-contain z-10",style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),r&&t.jsx("img",{src:r,alt:"accessory",className:"absolute inset-0 w-full h-full object-contain z-20"})]});return!a||!a.top&&!a.bottom&&!a.shoes&&!a.accessory?t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,u]}):t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,i&&t.jsx("img",{src:i,alt:"bottom",className:"absolute inset-0 w-full h-full object-contain z-20"}),l&&t.jsx("img",{src:l,alt:"shoes",className:"absolute inset-0 w-full h-full object-contain z-30"}),n&&t.jsx("img",{src:n,alt:"top",className:"absolute inset-0 w-full h-full object-contain z-40"}),u]})};export{g as C}; diff --git a/assets/ConfirmModal-DGrnpObD.js b/assets/ConfirmModal-DGrnpObD.js deleted file mode 100644 index cbe43dc9967c0b5f5c3d733ce397d74a2e4ddb96..0000000000000000000000000000000000000000 --- a/assets/ConfirmModal-DGrnpObD.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./vendor-react-Dexh7fmo.js";import{B as i}from"./button-BpeUVhBo.js";import{e as f,m as r,T as h}from"./index-D4nJsLyx.js";import{X as y}from"./x-BONnp2RF.js";import{T as j}from"./trash-2-BoXE_mye.js";import{L as w}from"./log-out-BqGKt-tT.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:m="warning",icon:x="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(x){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(j,{size:32});case"warning":default:return e.jsx(h,{size:32})}},o=(()=>{switch(m){case"danger":return{iconBg:"bg-red-100",iconColor:"text-red-600",buttonBg:"bg-red-600 hover:bg-red-700",buttonText:"text-white"};case"warning":return{iconBg:"bg-rose-100",iconColor:"text-rose-600",buttonBg:"bg-rose-600 hover:bg-rose-700",buttonText:"text-white"};case"info":default:return{iconBg:"bg-sky-100",iconColor:"text-sky-600",buttonBg:"bg-sky-600 hover:bg-sky-700",buttonText:"text-white"}}})(),p=async()=>{try{await n(),t()}catch{}};return e.jsx(f,{children:s&&e.jsx(e.Fragment,{children:e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${g} flex items-center justify-center p-4`,children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:u=>u.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[e.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-xl transition-colors z-10",children:e.jsx(y,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(r.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${o.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${o.iconColor}`,children:b()}),e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:a}),e.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:l}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:d}),e.jsx(i,{onClick:p,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{O as default}; diff --git a/assets/DashboardAvatar-CHVNq8nF.js b/assets/DashboardAvatar-CHVNq8nF.js deleted file mode 100644 index a42e9e65d4ee284b80f952638d6bab725354a4c9..0000000000000000000000000000000000000000 --- a/assets/DashboardAvatar-CHVNq8nF.js +++ /dev/null @@ -1 +0,0 @@ -import{j as a}from"./vendor-react-Dexh7fmo.js";import{g as e}from"./avatarData-BW_TX0b4.js";import{m as r}from"./index-D4nJsLyx.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const x=({className:l="w-full h-full",layers:s})=>{const t="absolute inset-0 w-full h-full object-contain object-bottom",o=e(s?.top),i=e(s?.bottom),n=e(s?.shoes),c=e(s?.accessory);return a.jsxs("div",{className:`relative flex items-end justify-center ${l}`,children:[a.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"Avatar Body",className:`${t} z-10`}),i&&a.jsx("img",{src:i,alt:"Pants",className:`${t} z-[12]`}),n&&a.jsx("img",{src:n,alt:"Shoes",className:`${t} z-[11]`}),o&&a.jsx("img",{src:o,alt:"Uniform",className:`${t} z-[13]`}),a.jsxs(r.div,{className:"absolute inset-0 w-full h-full z-30",style:{originY:"80%"},animate:{rotate:[-2,2,-2]},transition:{duration:4,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"Avatar Head",className:`${t} z-[1]`}),a.jsx(r.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:`${t} z-[2]`,style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),a.jsxs(r.div,{className:`${t} z-[3]`,style:{originY:"bottom"},animate:{rotate:[1,-1,1]},transition:{duration:3.5,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/left_horn.png",alt:"Left Horn",className:t}),a.jsx("img",{src:"/avatar/right_horn.png",alt:"Right Horn",className:t})]}),c&&a.jsx("img",{src:c,alt:"Accessory",className:`${t} z-[4]`})]})]})};export{x as DashboardAvatar,x as default}; diff --git a/assets/DashboardAvatar-CK5sUmxI.js b/assets/DashboardAvatar-CK5sUmxI.js new file mode 100644 index 0000000000000000000000000000000000000000..3f3ad8f30212a25c1ebed36a4a346bf4e4fcb8d6 --- /dev/null +++ b/assets/DashboardAvatar-CK5sUmxI.js @@ -0,0 +1 @@ +import{j as a}from"./vendor-react-CCIuKUIB.js";import{g as e,m as r}from"./index-B36njGvu.js";import"./vendor-firebase-auth-DUGvAaJx.js";import"./vendor-firebase-core-BireMWc7.js";import"./vendor-firebase-firestore-C0C-blIn.js";import"./vendor-firebase-storage-CnCozLgy.js";import"./vendor-firebase-analytics-FE_tmzXh.js";import"./vendor-radix-DkXsqQ-A.js";import"./vendor-markdown-CDZ6ydrN.js";const h=({className:l="w-full h-full",layers:s})=>{const t="absolute inset-0 w-full h-full object-contain object-bottom",i=e(s?.top),o=e(s?.bottom),n=e(s?.shoes),c=e(s?.accessory);return a.jsxs("div",{className:`relative flex items-end justify-center ${l}`,children:[a.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"Avatar Body",className:`${t} z-10`}),o&&a.jsx("img",{src:o,alt:"Pants",className:`${t} z-[12]`}),n&&a.jsx("img",{src:n,alt:"Shoes",className:`${t} z-[11]`}),i&&a.jsx("img",{src:i,alt:"Uniform",className:`${t} z-[13]`}),a.jsxs(r.div,{className:"absolute inset-0 w-full h-full z-30",style:{originY:"80%"},animate:{rotate:[-2,2,-2]},transition:{duration:4,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"Avatar Head",className:`${t} z-[1]`}),a.jsx(r.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:`${t} z-[2]`,style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),a.jsxs(r.div,{className:`${t} z-[3]`,style:{originY:"bottom"},animate:{rotate:[1,-1,1]},transition:{duration:3.5,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/left_horn.png",alt:"Left Horn",className:t}),a.jsx("img",{src:"/avatar/right_horn.png",alt:"Right Horn",className:t})]}),c&&a.jsx("img",{src:c,alt:"Accessory",className:`${t} z-[4]`})]})]})};export{h as DashboardAvatar,h as default}; diff --git a/assets/DiagnosticAssessmentModal-C541tkg_.js b/assets/DiagnosticAssessmentModal-C541tkg_.js deleted file mode 100644 index 7a6dbfcb158368967f8c5a70922302b65bde60c2..0000000000000000000000000000000000000000 --- a/assets/DiagnosticAssessmentModal-C541tkg_.js +++ /dev/null @@ -1 +0,0 @@ -import{r as m,c as z,j as e}from"./vendor-react-Dexh7fmo.js";import{B as E}from"./button-BpeUVhBo.js";import{M as ye}from"./MathAnswerInput-DNG5LFL4.js";import be from"./ScientificCalculator-wlhyNBDf.js";import{triggerDiagnosticCompleted as ge}from"./automationService-DNyauqGd.js";import{m as g,C as T,e as O,T as Q}from"./index-D4nJsLyx.js";import{B as J}from"./brain-CPvGdgWE.js";import{X as Z}from"./x-BONnp2RF.js";import{C as ee}from"./circle-check-big-0Gzyt_f3.js";import{C as ve}from"./chevron-right-COMox1Xb.js";import{C as we}from"./chart-column-D5mAWcRx.js";import{T as je}from"./trending-up-D-vj8Gbq.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./apiService-axx1LHMk.js";import"./chevron-up-Bfmq3Clw.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const H="iar-v2-deped-g11-core-g12-candidate-shortform",ae=[{id:"iar-fn-01",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"basic",competencyCode:"M11GM-Ia-2",competencyDescription:"Evaluates a function and solves basic linear expressions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Solve for x: 3x - 4 = 17",options:["5","6","7","8"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-fn-02",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"standard",competencyCode:"M11GM-Ib-5",competencyDescription:"Finds the domain of a rational function.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"What is the domain of f(x) = 5 / (x - 2)?",options:["All real numbers","x > 2","x ≠ 2","x < 2"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-fn-03",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Ie-f-1",competencyDescription:"Solves exponential equations in real-life growth contexts.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"A quantity doubles every hour. If it starts at 3, what is the value after 4 hours?",acceptableNumericAnswers:[48],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-04",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"challenge",competencyCode:"M11GM-Ii-4",competencyDescription:"Determines intercepts and asymptotic behavior of logarithmic functions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement is true for f(x) = log(x - 1)?",options:["Domain is all real numbers.","Vertical asymptote is x = 1.","x-intercept is always 0.","Range is x > 1."],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-c1",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Id-2",competencyDescription:"Determines the inverse of a one-to-one function.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"If f(x) = 2x + 3, what is f⁻¹(11)?",acceptableNumericAnswers:[4],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-bm-01",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"basic",competencyCode:"M11GM-IIa-b-1",competencyDescription:"Computes simple interest and maturity value.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Find the simple interest on PHP 8,000 at 5% annual rate for 2 years.",acceptableNumericAnswers:[800],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-02",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIa-2",competencyDescription:"Distinguishes simple and compound interest contexts.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement correctly describes compound interest?",options:["Interest is based only on original principal.","Interest is computed once at maturity.","Interest is computed on principal plus accumulated interest.","Interest is always lower than simple interest."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-03",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Computes annuity future value in basic settings.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A student saves PHP 1,000 monthly for 6 months with no interest. What is the accumulated amount?",options:["PHP 5,000","PHP 6,000","PHP 7,000","PHP 12,000"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-bm-04",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"challenge",competencyCode:"M11GM-IIf-3",competencyDescription:"Solves business and consumer loan scenarios.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A borrower receives PHP 20,000 and repays PHP 22,400 after 1 year. What is the annual simple interest rate?",options:["8%","10%","12%","14%"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-bm-c1",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Finds future value and present value of annuities.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Without interest, what is the present value of a 12-month annuity paying PHP 500 each month?",acceptableNumericAnswers:[6e3],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-01",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"basic",competencyCode:"M11GM-IIg-1",competencyDescription:"Identifies and negates propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'If p is "All triangles have three sides," what is not p?',options:["Some triangles have three sides.","No triangle has three sides.","At least one triangle does not have three sides.","All triangles are polygons."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-lg-02",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIh-1",competencyDescription:"Determines truth values of compound propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"When p is true and q is false, what is the truth value of p -> q?",options:["True","False","Cannot be determined","Both true and false"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-03",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIi-1",competencyDescription:"Identifies common reasoning fallacies in short arguments.",answerType:"shortAnswerText",depedBasis:"depedPattern",prompt:'A post says, "Everyone in my class passed because we used this lucky pen." Type the best label for this weak reasoning.',acceptableTextAnswers:["false cause","false causation","post hoc","hasty generalization"],isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-lg-04",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"challenge",competencyCode:"M11GM-IIi-2",competencyDescription:"Determines the validity of categorical syllogisms.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"All squares are rectangles. All rectangles are quadrilaterals. Therefore all squares are quadrilaterals. This argument is:",options:["Valid","Invalid","A fallacy of composition","A contradiction"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-lg-c1",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIj-1",competencyDescription:"Illustrates methods of proof and disproof.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'To prove "if n is even then n² is even," which method is commonly used?',options:["Direct proof","Proof by contradiction only","Survey method","Graph sketch only"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40}];function Ne(s){return s>=75?"Mastered":s>=40?"NeedsReview":"HighRisk"}function Ce(){return ae.filter(s=>s.depedBasis==="depedPattern"&&!!s.competencyCode)}function ke(s=ae){const n=s.reduce((p,h)=>p+h.estimatedSeconds,0);return Math.round(n/60*10)/10}const te={Functions:"Functions and Graphs",BusinessMath:"Business and Financial Mathematics",Logic:"Logic and Reasoning"},Me={atRiskSubjectIds:[],questionSetVersion:H},x=Ce(),se=s=>s.trim().toLowerCase().replace(/\s+/g," "),re=(s,n)=>{if(!s.scorable)return!1;if(s.answerType==="MCQ")return typeof n=="number"&&n===s.correctOptionIndex;if(s.answerType==="shortAnswerNumeric"){if(typeof n!="string")return!1;const p=Number(n);if(Number.isNaN(p))return!1;const h=s.numericTolerance??0;return(s.acceptableNumericAnswers||[]).some(B=>Math.abs(p-B)<=h)}if(s.answerType==="shortAnswerText"){if(typeof n!="string")return!1;const p=se(n);return(s.acceptableTextAnswers||[]).some(h=>se(h)===p)}return!1},Ae=s=>s==="Mastered"?"text-teal-600 bg-teal-50":s==="NeedsReview"?"text-amber-700 bg-amber-50":"text-red-600 bg-red-50",Ie=s=>s==="NeedsReview"?"Needs Review":s==="HighRisk"?"High Risk":"Mastered",et=({isOpen:s,onClose:n,onComplete:p,lrn:h,gradeLevel:B="Grade 11",workflowMode:ie="iar_only",assessmentType:N="initial_assessment"})=>{const[v,L]=m.useState("intro"),[y,W]=m.useState(0),[ne,_]=m.useState([]),[C,I]=m.useState(""),[w,j]=m.useState(!1),[oe,b]=m.useState(!1),[a,q]=m.useState(null),[u,$]=m.useState(null),[k,V]=m.useState([]),[Se,U]=m.useState(!1);z.useEffect(()=>{s&&(L("intro"),W(0),_([]),I(""),j(!1),b(!1),q(null),$(null),V([]))},[s]),z.useEffect(()=>{if(!s||v!=="test"){b(!1);return}if(y>0||w){b(!1);return}b(!0);const t=window.setTimeout(()=>{b(!1)},2800);return()=>window.clearTimeout(t)},[s,v,y,w]);const ce=()=>{p({status:"skipped",...Me}),n()},R=()=>{n()};z.useEffect(()=>{if(!s)return;const t=i=>{i.key==="Escape"&&R()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[s]);const le=()=>{L("test")},de=t=>{_(t),I(""),j(!1),y{W(i=>i+1)},300):pe(t)},K=t=>{const i=[...ne];i[y]=t,de(i)},G=()=>{C.trim()&&K(C.trim())},pe=async t=>{const i=[],S={Functions:{correct:0,total:0},BusinessMath:{correct:0,total:0},Logic:{correct:0,total:0}},fe={Functions:[],BusinessMath:[],Logic:[]},P={};x.forEach((r,c)=>{const l=t[c];if(r.answerType==="confidenceLikert"&&typeof l=="number"&&fe[r.topicArea].push(l+1),!r.scorable)return;const d=re(r,l);S[r.topicArea].total+=1,d&&(S[r.topicArea].correct+=1),P[r.topicArea]||(P[r.topicArea]=[]),P[r.topicArea].push({correct:d,questionId:r.id,difficulty:r.difficulty,gradeLevelTag:r.gradeLevel,quarter:r.quarter,answerType:r.answerType})});const o=Object.keys(S).reduce((r,c)=>{const{correct:l,total:d}=S[c],M=d>0?Math.round(l/d*100):0,A=Ne(M);return A!=="Mastered"&&i.push(c),r[c]={correct:l,total:d,scorePercent:M,classification:A},r},{}),D=x.filter(r=>r.scorable&&r.gradeLevel==="G12Candidate"),xe=D.reduce((r,c)=>{const l=x.findIndex(d=>d.id===c.id);return r+(re(c,t[l])?1:0)},0),F=D.length>0?xe/D.length:1,he={readyForFiniteMath:Object.values(o).filter(r=>r.classification==="Mastered").length/3>=.67&&o.Functions.classification!=="HighRisk"&&o.BusinessMath.classification!=="HighRisk"&&F>=.5,readyForAdvancedStats:o.Logic.classification==="Mastered"&&F>=.67,readyForCalcIntro:o.Functions.classification==="Mastered"&&F>=.67,needsStrongerFunctions:o.Functions.classification!=="Mastered",needsStrongerBusinessMath:o.BusinessMath.classification!=="Mastered"};if(Object.keys(o).sort((r,c)=>{const l=o[r],d=o[c],M=X=>X==="HighRisk"?0:X==="NeedsReview"?1:2,A=M(l.classification)-M(d.classification);return A!==0?A:l.scorePercent-d.scorePercent}),V(i),q(o),$(he),L("results"),h){U(!0);try{const r=Object.keys(o).map(c=>({subject:c,score:o[c].scorePercent}));await ge(h,r,B,P,ie,N),console.log("[OK] Automation: diagnostic pipeline completed")}catch(r){console.error("[WARN] Automation: diagnostic pipeline failed:",r)}finally{U(!1)}}},me=()=>{if(!a||!u){p({status:"completed",atRiskSubjectIds:k,questionSetVersion:H}),n();return}p({status:"completed",atRiskSubjectIds:k,topicScores:{Functions:a.Functions.scorePercent,BusinessMath:a.BusinessMath.scorePercent,Logic:a.Logic.scorePercent},topicClassifications:{Functions:a.Functions.classification,BusinessMath:a.BusinessMath.classification,Logic:a.Logic.classification},priorityTopics:Object.keys(a).sort((t,i)=>a[t].scorePercent-a[i].scorePercent),g12ReadinessIndicators:u,questionSetVersion:H}),n()},f=x[y],Y=Math.round(y/x.length*100),ue=ke(x);return s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:()=>{R()},children:[e.jsxs(g.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"bg-white rounded-3xl shadow-2xl max-w-2xl w-full flex flex-col max-h-[90vh] pointer-events-auto overflow-hidden relative z-[51]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"px-8 py-6 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center text-sky-600",children:e.jsx(J,{size:24})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Deep Diagnostic":"Initial Assessment"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 relative",children:[e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>{j(!w),b(!1)},className:`relative w-10 h-10 rounded-xl flex items-center justify-center transition-all duration-200 border-2 ${w?"bg-sky-100 border-sky-300 text-sky-700 shadow-sm":"bg-white border-[#dde3eb] text-slate-500 hover:text-sky-600 hover:border-sky-200 hover:bg-sky-50"}`,title:"Toggle Calculator",children:e.jsx(T,{size:20})}),e.jsx(O,{children:s&&v==="test"&&oe&&!w&&e.jsxs(g.div,{initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},className:"absolute right-0 top-full mt-3 w-[260px] bg-[#0a1628] text-white border border-[#2a3648] rounded-2xl p-4 shadow-2xl z-50 pointer-events-none",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-sky-500/20 flex items-center justify-center flex-shrink-0",children:e.jsx(T,{size:16,className:"text-sky-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-sm mb-1",children:"Calculator Available"}),e.jsx("p",{className:"text-xs text-slate-300 leading-relaxed",children:"You can freely use the scientific calculator at any time during this quiz."})]})]}),e.jsx("div",{className:"absolute -top-2 right-4 w-4 h-4 bg-[#0a1628] border-l border-t border-[#2a3648] rotate-45 rounded-tl-sm"})]})})]}),e.jsx("button",{onClick:()=>{R()},className:"w-10 h-10 rounded-xl flex items-center justify-center text-slate-500 border-2 border-transparent hover:text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] transition-all",title:"Close assessment",children:e.jsx(Z,{size:20})})]})]}),e.jsx("div",{className:"p-8 overflow-y-auto",children:e.jsxs(O,{mode:"wait",children:[v==="intro"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-32 h-32 bg-sky-50 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(T,{size:64,className:"text-sky-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Let's close the gaps":"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[#5a6578] max-w-md mx-auto leading-relaxed",children:N==="followup_diagnostic"?"You have pending weak-area checks from your initial assessment. Complete this deep diagnostic to unlock regular modules and practice.":`To personalize your learning path, complete a DepEd competency-based SHS diagnostic (${x.length} items, around ${ue} minutes).`}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-lg mx-auto text-left",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(ee,{size:16,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(Q,{size:16,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Spot areas that need more attention early."})]})]}),e.jsxs("div",{className:"pt-4 space-y-3",children:[e.jsx(E,{onClick:le,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-8 py-6 rounded-xl text-lg font-bold shadow-lg shadow-sky-200 w-full max-w-xs mx-auto",children:N==="followup_diagnostic"?"Start Deep Diagnostic":"Start Assessment"}),e.jsx("button",{onClick:()=>{ce()},className:"block mx-auto text-sm text-slate-500 hover:text-[#5a6578] transition-colors font-medium",children:"Skip for now →"})]})]},"intro"),v==="test"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm font-bold text-[#5a6578] mb-2",children:[e.jsxs("span",{children:["Question ",y+1," of ",x.length]}),e.jsxs("span",{children:[Y,"% Completed"]})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden mb-8",children:e.jsx(g.div,{className:"h-full bg-sky-600 rounded-full",initial:{width:0},animate:{width:`${Y}%`}})}),e.jsxs("div",{className:"bg-[#edf1f7] p-6 rounded-2xl border border-[#dde3eb] mb-6",children:[e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500 mb-2",children:[te[f.topicArea]," • ",f.difficulty]}),e.jsx("h3",{className:"text-xl font-bold text-[#0a1628] leading-relaxed",children:f.prompt})]}),(f.answerType==="MCQ"||f.answerType==="confidenceLikert")&&e.jsx("div",{className:"grid grid-cols-1 gap-3",children:(f.options||[]).map((t,i)=>e.jsxs("button",{onClick:()=>K(i),className:"w-full text-left p-4 rounded-xl border-2 border-[#dde3eb] hover:border-indigo-600 hover:bg-sky-50 transition-all font-medium text-[#0a1628] group flex items-center justify-between",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-8 h-8 rounded-lg bg-white border border-[#dde3eb] flex items-center justify-center text-sm font-bold text-[#5a6578] group-hover:border-sky-300 group-hover:text-sky-600",children:String.fromCharCode(65+i)}),t]}),e.jsx(ve,{size:18,className:"opacity-0 group-hover:opacity-100 text-sky-600 transition-opacity"})]},i))}),(f.answerType==="shortAnswerNumeric"||f.answerType==="shortAnswerText")&&e.jsxs("div",{className:"space-y-3",children:[f.answerType==="shortAnswerNumeric"?e.jsx(e.Fragment,{children:e.jsx(ye,{value:C,onChange:I,placeholder:"Type numeric answer",onSubmit:G,onCalculatorOpen:()=>{j(!0),b(!1)}})}):e.jsx("input",{id:"diagnostic-short-answer",name:"diagnostic-short-answer","aria-label":"Short answer response",value:C,onChange:t=>I(t.target.value),onKeyDown:t=>{t.key==="Enter"&&G()},className:"w-full p-4 rounded-xl border-2 border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-200 focus:border-sky-500",placeholder:"Type short answer"}),e.jsx(E,{onClick:G,disabled:!C.trim(),className:"w-full bg-sky-600 hover:bg-sky-700 text-white py-3 rounded-xl font-bold",children:"Submit Answer"})]})]},"test"),v==="results"&&e.jsxs(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-24 h-24 bg-teal-100 rounded-full flex items-center justify-center mx-auto mb-4 animate-bounce",children:e.jsx(ee,{size:48,className:"text-teal-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:"Assessment Completed!"}),e.jsx("p",{className:"text-[#5a6578]",children:"We computed topic-level placement from your IAR responses."}),e.jsxs("div",{className:"bg-[#edf1f7] rounded-2xl p-6 border border-[#dde3eb] text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(we,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Topic Analysis"})]}),e.jsx("div",{className:"space-y-3",children:a&&Object.keys(a).map(t=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-[#0a1628]",children:te[t]}),e.jsxs("p",{className:"text-xs text-slate-500",children:[a[t].correct,"/",a[t].total," correct • ",a[t].scorePercent,"%"]})]}),e.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-lg flex items-center gap-1 ${Ae(a[t].classification)}`,children:[a[t].classification==="Mastered"?e.jsx(je,{size:12}):e.jsx(Q,{size:12}),Ie(a[t].classification)]})]},t))})]}),u&&e.jsxs("div",{className:"bg-sky-50 rounded-2xl p-6 border border-sky-100 text-left space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(J,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Grade 12 Readiness Signals"})]}),e.jsx("p",{className:"text-xs text-slate-600",children:"These indicators come from challenge and candidate items only."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 text-xs",children:[e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForFiniteMath?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Finite Math: ",u.readyForFiniteMath?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForAdvancedStats?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Advanced Stats: ",u.readyForAdvancedStats?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForCalcIntro?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Calculus Intro: ",u.readyForCalcIntro?"Ready":"Build More"]})]})]}),k.length>0&&e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-rose-50 border border-rose-100 rounded-xl text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-rose-100 border border-rose-200 flex items-center justify-center text-rose-600 shadow-inner shrink-0",children:e.jsx(Q,{size:18,strokeWidth:2.3})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-display font-black text-[20px] tracking-tight text-rose-800 leading-none mb-1",children:"Attention Needed"}),e.jsxs("p",{className:"text-rose-700 text-xs mt-1",children:["We flagged ",k.length," topic area",k.length>1?"s":""," for review. In IAR + Diagnostic mode, focused deep diagnostics may launch before full unlock."]})]})]}),e.jsx("div",{className:"pt-4",children:e.jsx(E,{onClick:me,className:"bg-sky-600 hover:bg-sky-700 text-white px-8 py-4 rounded-xl text-lg font-bold w-full",children:"Go to Dashboard"})})]},"results")]})})]}),e.jsx(O,{children:w&&e.jsxs(g.div,{drag:!0,dragMomentum:!1,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{type:"spring",damping:25,stiffness:200},style:{position:"absolute",top:"50%",left:"calc(50% + 390px)",y:"-50%"},className:"w-[420px] max-w-[calc(100vw-24px)] bg-white rounded-3xl shadow-2xl border border-slate-200 flex flex-col pointer-events-auto overflow-hidden z-[60]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0 cursor-move",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-sky-100 flex items-center justify-center text-sky-600",children:e.jsx(T,{size:18})}),e.jsx("h3",{className:"font-bold text-[#0a1628] select-none",children:"Scientific Calc"})]}),e.jsx("button",{onClick:t=>{t.stopPropagation(),j(!1)},className:"w-8 h-8 flex items-center justify-center text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-lg transition-colors cursor-pointer",title:"Close Calculator",children:e.jsx(Z,{size:16})})]}),e.jsx("div",{className:"p-4 bg-[#f7f9fc]",children:e.jsx(be,{isOpen:!0,onClose:()=>j(!1),inline:!0})})]})})]}):null};export{et as default}; diff --git a/assets/FloatingAITutor-DkH3KrR1.js b/assets/FloatingAITutor-DkH3KrR1.js deleted file mode 100644 index 2534d358b93fc3ed0a47f0afec3ec55968829452..0000000000000000000000000000000000000000 --- a/assets/FloatingAITutor-DkH3KrR1.js +++ /dev/null @@ -1,7 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-B34PtYCE.js","assets/index-D4nJsLyx.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-BML5nJHm.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css","assets/vendor-markdown-C5ikSDMA.js","assets/vendor-markdown-CBmFCdgC.css","assets/apiService-axx1LHMk.js"])))=>i.map(i=>d[i]); -import{c as S,y as A,_ as w,m as p,I as M}from"./index-D4nJsLyx.js";import{r as a,j as e}from"./vendor-react-Dexh7fmo.js";import{M as f}from"./minus-oFhmD2--.js";import{X as b}from"./x-BONnp2RF.js";import{S as C}from"./send-NQY-QTkN.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const L=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],E=S("maximize-2",L),O=a.lazy(()=>w(()=>import("./ChatMarkdown-B34PtYCE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),X=({constraintsRef:T,onFullScreen:y})=>{const{activeSessionId:n,setActiveSessionId:g,createNewSession:j,getActiveSession:v,sendMessage:N,isLoading:o}=A(),[s,r]=a.useState(!1),[l,c]=a.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[i,d]=a.useState(""),u=a.useRef(null);a.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",l?"1":"0")},[l]),a.useEffect(()=>{s&&w(async()=>{const{warmupBackend:t}=await import("./apiService-axx1LHMk.js");return{warmupBackend:t}},__vite__mapDeps([11,1,2,3,4,5,6,7,8])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),a.useEffect(()=>{if(s&&!n){const t={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},z=j(t);g(z)}},[s]);const m=v()?.messages||[],k=()=>{u.current?.scrollIntoView({behavior:"smooth"})};a.useEffect(()=>{k()},[m]);const x=async()=>{if(!i.trim()||!n||o)return;const t=i.trim();d(""),await N(n,t)},I=()=>{y()},h=()=>{r(!1),c(!0)},_=()=>{c(!1)};return e.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[e.jsxs("div",{className:`pointer-events-auto mb-4 w-80 bg-[#f7f9fc] rounded-3xl shadow-2xl border border-[#dde3eb] flex flex-col overflow-hidden transition-all duration-300 origin-bottom-right select-none ${s?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{maxHeight:s?"32rem":"0"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:I,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(E,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:h,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(f,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>r(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(b,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[m.map(t=>e.jsx("div",{className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${t.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}):e.jsx(a.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(O,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:t.timestamp})]})},t.id)),o&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),e.jsx("div",{ref:u})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:"ai-tutor-input",name:"ai-tutor-input","aria-label":"Ask AI tutor a question",type:"text",value:i,onChange:t=>d(t.target.value),onKeyPress:t=>t.key==="Enter"&&x(),placeholder:"Ask me anything...",className:"flex-1 px-4 py-2.5 rounded-xl border border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-500 text-sm bg-[#f7f9fc]"}),e.jsx("button",{type:"button","aria-label":"Send message",onClick:x,className:"p-2.5 bg-sky-600 hover:bg-sky-700 text-white rounded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!i.trim()||o,children:e.jsx(C,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:l?e.jsx(p.button,{type:"button",onClick:_,whileHover:{scale:1.08},whileTap:{scale:.95},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",children:e.jsx(M,{size:14})}):e.jsxs("div",{className:"relative group",children:[!s&&e.jsxs("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 px-4 py-2 bg-slate-800 text-white text-sm rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap shadow-xl z-50",children:["Hello! I'm L.O.L.I., how may I help you?",e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!s&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:h,className:"absolute -top-2 -left-2 z-10 h-6 w-6 rounded-full bg-white text-slate-700 border border-slate-200 shadow-md hover:bg-slate-100 transition-colors flex items-center justify-center",children:e.jsx(f,{size:12})}),e.jsx(p.button,{type:"button",onClick:()=>r(!s),whileHover:{scale:1.1},whileTap:{scale:.9},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":s?"Close AI tutor chat":"Open AI tutor chat",children:s?e.jsx(b,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{X as default}; diff --git a/assets/GradesPage-m1qiGDtC.js b/assets/GradesPage-m1qiGDtC.js deleted file mode 100644 index a74d5a28ca91164972fa62b5b82efaa799902ef6..0000000000000000000000000000000000000000 --- a/assets/GradesPage-m1qiGDtC.js +++ /dev/null @@ -1,2 +0,0 @@ -import{r as n,j as e}from"./vendor-react-Dexh7fmo.js";import{B as S}from"./button-BpeUVhBo.js";import{u as $,m as H,g as W}from"./index-D4nJsLyx.js";import{g as V,S as k}from"./subjects-DDBtpdiA.js";import{A as T}from"./award-oJTbc9W5.js";import{T as A}from"./trending-up-D-vj8Gbq.js";import{T as C}from"./target-D7SVtf3g.js";import{C as P}from"./calendar-BJ8oE6yW.js";import{D as _}from"./download-PWUf0XJa.js";import{T as J,F as K}from"./trending-down-CqEkjFA9.js";import{C as X}from"./chevron-right-COMox1Xb.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./chart-column-D5mAWcRx.js";const je=()=>{const{currentUser:p,userProfile:Q}=$(),[o,u]=n.useState("all"),[f,D]=n.useState("all"),[Y,j]=n.useState(!0),[i,R]=n.useState(null),E=Q?.grade,g=V(E),y=new Set(g);n.useEffect(()=>{(async()=>{if(p){j(!0);try{const s=await W(p.uid);R(s)}catch(s){console.error("Error loading grades:",s)}finally{j(!1)}}})()},[p]);const N=i?.quizAttempts||[],M=i?.totalQuizzesCompleted||0,h=i?.averageScore||0,U=h>0?Math.min(h/25,4).toFixed(2):"0.00",F={"gen-math":"blue","stats-prob":"cyan","pre-calc":"teal","basic-calc":"orange"},b=k.reduce((t,s)=>(t[s.id]={label:s.name,color:F[s.id]||"slate"},t),{}),c=k.filter(t=>y.has(t.id)).map(t=>t.name),v=Object.entries(i?.subjects||{}).filter(([t])=>y.has(t)).map(([t,s])=>{const a=b[t]||{label:t,color:"slate"},d=N.filter(l=>l.quizId?.startsWith(t)),m=d.length>0?Math.round(d.reduce((l,r)=>l+r.score,0)/d.length):Math.round(s.progress);return{subject:a.label,average:m,quizzes:d.length||s.completedModules,color:a.color,trend:"up"}}),G=g.map(t=>{const s=b[t]||{label:t,color:"slate"};return{subject:s.label,average:0,quizzes:0,color:s.color,trend:"up"}}),I=v.length>0?v:G,w=N.sort((t,s)=>new Date(s.completedAt).getTime()-new Date(t.completedAt).getTime()).slice(0,10).map((t,s)=>({id:s+1,title:t.quizId?.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())||`Quiz ${s+1}`,subject:Object.entries(b).find(([a])=>t.quizId?.startsWith(a))?.[1]?.label||"General",score:t.score,total:100,date:t.completedAt instanceof Date?t.completedAt.toISOString().split("T")[0]:new Date(t.completedAt).toISOString().split("T")[0],type:t.quizId?.includes("practice")?"practice":"module",status:t.score>=60?"passed":"failed"})).filter(t=>c.includes(t.subject)),x={gpa:parseFloat(U),totalQuizzes:M,averageScore:h,trendValue:0},z=w.filter(t=>{if(!c.includes(t.subject))return!1;const s=o==="all"||t.subject===o,a=f==="all"||t.type===f;return s&&a});n.useEffect(()=>{o!=="all"&&(c.includes(o)||u("all"))},[c,o]);const O=()=>{const t=["Quiz","Subject","Type","Score","Date","Status"],s=w.map(r=>[r.title,r.subject,r.type,`${r.score}%`,r.date,r.status]),a=[t,...s].map(r=>r.join(",")).join(` -`),d=new Blob([a],{type:"text/csv;charset=utf-8;"}),m=URL.createObjectURL(d),l=document.createElement("a");l.href=m,l.download=`mathpulse-grades-${new Date().toISOString().split("T")[0]}.csv`,l.click(),URL.revokeObjectURL(m)},L=t=>t>=90?"text-emerald-600 bg-emerald-50":t>=80?"text-sky-600 bg-sky-50":t>=70?"text-rose-600 bg-rose-50":"text-red-600 bg-red-50",B=t=>t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F";return e.jsxs("div",{className:"space-y-6 px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[e.jsxs("div",{className:"bg-gradient-to-br from-white via-sky-50/30 to-white rounded-2xl p-7 card-elevated-lg relative overflow-hidden border border-slate-200/80",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/40 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-sky-100/40 rounded-full -translate-y-1/2 translate-x-1/2"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(T,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Overall GPA"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:x.gpa}),e.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[e.jsx(A,{size:14,className:"text-emerald-500"}),e.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["+",x.trendValue,"% this month"]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(C,{size:18,className:"text-sky-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Average Score"})]}),e.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[x.averageScore,"%"]}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Across all subjects"})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(P,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Total Quizzes"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:x.totalQuizzes}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Completed"})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(T,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Grade Rank"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:"Top 15%"}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"In your class"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(C,{size:20,strokeWidth:2.5})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Subject Performance"})]}),e.jsxs(S,{variant:"outline",size:"sm",className:"rounded-lg font-body border-[#dde3eb] text-[#5a6578]",onClick:O,children:[e.jsx(_,{size:16,className:"mr-2"}),"Export Report"]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:I.map(t=>e.jsxs(H.div,{whileHover:{scale:1.02},className:"bg-white rounded-xl p-5 border border-[#dde3eb] card-elevated cursor-pointer",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-display font-bold text-[#0a1628] mb-1",children:t.subject}),e.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:[t.quizzes," quizzes completed"]})]}),e.jsx("div",{className:`w-14 h-14 rounded-lg bg-${t.color}-50 flex items-center justify-center`,children:e.jsx("span",{className:`text-xl font-display font-bold text-${t.color}-600`,children:B(t.average)})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[t.average,"%"]}),e.jsx("p",{className:"text-xs text-[#5a6578] font-body mt-1",children:"Average"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[t.trend==="up"?e.jsx(A,{size:18,className:"text-green-500"}):e.jsx(J,{size:18,className:"text-red-500"}),e.jsx(X,{size:16,className:"text-[#d1cec6]"})]})]})]},t.subject))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(P,{size:20,strokeWidth:2.5})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Quiz History"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:o,onChange:t=>u(t.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[e.jsx("option",{value:"all",children:"All Subjects"}),c.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:f,onChange:t=>D(t.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"practice",children:"Practice"}),e.jsx("option",{value:"module",children:"Module"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] card-elevated overflow-hidden",children:[e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-[#f7f9fc] border-b border-[#dde3eb]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Quiz"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Subject"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Score"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Date"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Action"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{className:"border-b border-[#edf1f7] hover:bg-[#f7f9fc] transition-colors",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsx("p",{className:"font-body font-semibold text-[#0a1628] text-sm",children:t.title})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:t.subject})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"px-2.5 py-1 bg-[#edf1f7] text-[#5a6578] text-xs font-body font-semibold rounded-md capitalize",children:t.type})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:`px-2.5 py-1 rounded-md text-sm font-body font-semibold ${L(t.score)}`,children:[t.score,"%"]}),e.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["(",t.score,"/",t.total,")"]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:t.date})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx(S,{variant:"outline",size:"sm",className:"rounded-lg",children:"Review"})})]},t.id))})]}),z.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(K,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] font-body",children:"No quizzes found with current filters"}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-1",children:"Try adjusting your filters"})]})]})]})]})};export{je as default}; diff --git a/assets/HeroBanner-BdiQHNd9.js b/assets/HeroBanner-BdiQHNd9.js deleted file mode 100644 index c76b110bb90db08cee8cc522e2b85fc7c493e430..0000000000000000000000000000000000000000 --- a/assets/HeroBanner-BdiQHNd9.js +++ /dev/null @@ -1,7 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CHVNq8nF.js","assets/vendor-react-Dexh7fmo.js","assets/avatarData-BW_TX0b4.js","assets/index-D4nJsLyx.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-BML5nJHm.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css"])))=>i.map(i=>d[i]); -import{c as x,m as t,Z as c,A as p,_ as b}from"./index-D4nJsLyx.js";import{j as e,r}from"./vendor-react-Dexh7fmo.js";import{B as h}from"./brain-CPvGdgWE.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const g=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],u=x("hand",g),v=r.lazy(()=>b(()=>import("./DashboardAvatar-CHVNq8nF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),A=({userName:a="Student",userLevel:o=1,avatarLayers:l,onContinueLearning:n,showAssessmentTooltip:i,onOpenAssessment:d})=>{const m=()=>{const s=new Date().getHours();return s<12?"Good Morning":s<18?"Good Afternoon":"Good Evening"};return e.jsxs(t.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"relative w-full mt-0 rounded-[2rem] p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/50 to-white border border-slate-200/80 card-elevated-lg",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/50 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-sky-100/40 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-64 h-64 bg-rose-100/30 rounded-full blur-3xl translate-y-1/2 -translate-x-1/4"}),e.jsx("div",{className:"absolute inset-0 bg-dot-pattern opacity-40"})]}),e.jsx("div",{className:"relative z-10 flex min-h-[140px] lg:min-h-[160px] items-center justify-between gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 min-w-0 pr-40 lg:pr-[280px] py-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-sky-100 border border-sky-200",children:e.jsxs("span",{className:"text-xs md:text-sm font-body font-bold text-sky-700",children:["Level ",o]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(c,{size:14,className:"inline -mt-0.5 text-rose-500 mr-1"}),e.jsx("span",{className:"text-xs md:text-sm font-body font-bold text-rose-700",children:"Active"})]})]}),e.jsxs("h1",{className:"text-xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[m(),", ",a,"! ",e.jsx(u,{size:20,className:"inline -mt-1 ml-1"})]}),e.jsx("p",{className:"text-slate-500 mb-1 text-xs md:text-sm font-body font-bold",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-[11px] md:text-xs text-slate-400 font-body mb-4",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(t.button,{onClick:n,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-2 rounded-xl font-body font-bold text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex items-center gap-2 group",children:["Continue Learning",e.jsx(p,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(t.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:d,className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-amber-300 relative transition-all group-hover:bg-amber-50 group-hover:border-amber-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-amber-500",children:e.jsx(h,{size:16})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-amber-900 leading-tight",children:["Don't forget to take the",e.jsx("br",{}),"Initial Assessment!"]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-amber-300 border-b-amber-300 rotate-45 group-hover:bg-amber-50 group-hover:border-r-amber-400 group-hover:border-b-amber-400 transition-colors"})]})}),e.jsx("div",{className:"hidden md:block absolute right-0 lg:right-10 bottom-0 w-[150px] lg:w-[270px] pointer-events-none z-20",style:{clipPath:"inset(-100% -50% 0 -50%)"},children:e.jsx("div",{className:"relative w-full aspect-[4/5] translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(v,{layers:l,className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{A as default}; diff --git a/assets/LeaderboardPage-jsrBZaI7.js b/assets/LeaderboardPage-jsrBZaI7.js deleted file mode 100644 index 3077418948242ccf7b8f5a7997f1fd31705e203f..0000000000000000000000000000000000000000 --- a/assets/LeaderboardPage-jsrBZaI7.js +++ /dev/null @@ -1,8 +0,0 @@ -import{r as o,j as e}from"./vendor-react-Dexh7fmo.js";import{c as O,z as R,e as W,m as d,F as B,i as X,u as $,B as H}from"./index-D4nJsLyx.js";import{X as U}from"./x-BONnp2RF.js";import{B as y}from"./book-open-BH50GByv.js";import{T as A}from"./target-D7SVtf3g.js";import{A as k}from"./award-oJTbc9W5.js";import{C as q}from"./clock-DUJO-a50.js";import{T as v}from"./trophy-C2nVcZnb.js";import{T as P}from"./trending-up-D-vj8Gbq.js";import{L as M}from"./loader-circle-J8Mwbkkw.js";import{S as G}from"./star-dumQ9BVG.js";import{U as L}from"./user-CaTzqgOL.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q=O("badge-check",K),V=({student:s,onClose:w})=>{const[n,N]=o.useState([]),[h,p]=o.useState(!1);if(o.useEffect(()=>{s?.uid&&(p(!0),R(s.uid).then(N).catch(c=>console.error("Failed to load achievements:",c)).finally(()=>p(!1)))},[s?.uid]),!s)return null;const x={trophy:e.jsx(v,{size:24,className:"text-rose-500"}),flame:e.jsx(B,{size:24,className:"text-orange-500"}),star:e.jsx(G,{size:24,className:"text-rose-400"}),"book-open":e.jsx(y,{size:24,className:"text-sky-600"}),"badge-check":e.jsx(Q,{size:24,className:"text-emerald-600"}),crown:e.jsx(X,{size:24,className:"text-rose-500"}),target:e.jsx(A,{size:24,className:"text-rose-500"})};return e.jsx(W,{children:e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(d.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:w,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(d.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[90vh] overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-8 text-white relative overflow-hidden",children:[e.jsx("div",{className:"accent-line absolute top-0 left-0 right-0"}),e.jsx("button",{onClick:w,className:"absolute top-4 right-4 p-2 hover:bg-slate-100 rounded-xl transition-colors z-10",children:e.jsx(U,{size:20})}),e.jsx("div",{className:"relative z-10",children:e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-24 h-24 bg-white/10 backdrop-blur-sm rounded-2xl flex items-center justify-center text-6xl border border-slate-300",children:s.avatar}),s.isOnline&&e.jsx("div",{className:"absolute -bottom-2 -right-2 w-6 h-6 bg-green-500 rounded-full border-4 border-white"})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-3xl font-display font-bold mb-2",children:s.name}),e.jsx("p",{className:"text-slate-500 mb-4",children:s.section}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[e.jsx("p",{className:"text-xs text-slate-500",children:"Level"}),e.jsx("p",{className:"text-xl font-bold",children:s.level})]}),e.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[e.jsx("p",{className:"text-xs text-slate-500",children:"Total XP"}),e.jsx("p",{className:"text-xl font-bold",children:s.totalXP})]}),e.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[e.jsx("p",{className:"text-xs text-slate-500",children:"Streak"}),e.jsxs("p",{className:"text-xl font-bold flex items-center gap-1",children:[e.jsx(B,{size:16,className:"text-orange-300"}),s.currentStreak]})]})]})]})]})}),e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-sky-500/5 rounded-full -translate-y-1/2 translate-x-1/2"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-rose-500/5 rounded-full translate-y-1/2 -translate-x-1/2"})]}),e.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-320px)]",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Performance Stats"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(y,{size:24,className:"text-sky-600 mx-auto mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:s.stats.quizzesCompleted}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Quizzes"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(A,{size:24,className:"text-emerald-600 mx-auto mb-2"}),e.jsxs("p",{className:"text-2xl font-bold text-[#0a1628]",children:[s.stats.averageScore,"%"]}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Avg Score"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(k,{size:24,className:"text-rose-600 mx-auto mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:s.stats.modulesCompleted}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Modules"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(q,{size:24,className:"text-rose-600 mx-auto mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:s.stats.studyHours}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Hours"})]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Rankings"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4",children:[e.jsx(v,{size:20,className:"text-rose-600 mb-2"}),e.jsxs("p",{className:"text-2xl font-bold text-rose-900",children:["#",s.rank.global]}),e.jsx("p",{className:"text-xs text-rose-700 mt-1 font-body",children:"School"})]}),e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-4",children:[e.jsx(v,{size:20,className:"text-sky-600 mb-2"}),e.jsxs("p",{className:"text-2xl font-bold text-sky-900",children:["#",s.rank.section]}),e.jsx("p",{className:"text-xs text-sky-700 mt-1 font-body",children:"Section"})]}),e.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4",children:[e.jsx(v,{size:20,className:"text-rose-600 mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-rose-900",children:s.rank.change>0?e.jsxs("span",{className:"flex items-center gap-1 text-emerald-600",children:[e.jsx(P,{size:20}),"+",s.rank.change]}):s.rank.change<0?e.jsxs("span",{className:"flex items-center gap-1 text-red-600",children:[e.jsx(P,{size:20,className:"rotate-180"}),s.rank.change]}):"0"}),e.jsx("p",{className:"text-xs text-rose-700 mt-1 font-body",children:"This Week"})]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Achievements"}),h?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(M,{size:24,className:"text-sky-500 animate-spin"})}):n.length>0?e.jsx("div",{className:"grid grid-cols-3 gap-3",children:n.map(c=>e.jsxs("div",{className:"rounded-xl p-4 text-center transition-all bg-white border-2 border-sky-200",children:[e.jsx("div",{className:"text-3xl mb-2",children:x[c.icon]||e.jsx(k,{size:24,className:"text-slate-500 mx-auto"})}),e.jsx("p",{className:"font-bold text-xs text-[#0a1628] mb-1 font-body",children:c.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:c.description})]},c.id))}):e.jsxs("div",{className:"flex flex-col items-center py-8 gap-2",children:[e.jsx(k,{size:32,className:"text-[#d1cec6]"}),e.jsx("p",{className:"text-sm text-[#5a6578] font-body",children:"No achievements unlocked yet"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Recent Activity"}),e.jsxs("div",{className:"flex flex-col items-center py-8 gap-2",children:[e.jsx(y,{size:32,className:"text-[#d1cec6]"}),e.jsx("p",{className:"text-sm text-[#5a6578] font-body",children:"Activity history coming soon"})]})]})]})]})]})})},fe=({currentUserPhoto:s,onBack:w})=>{const{currentUser:n,userProfile:N}=$(),h=N,[p]=o.useState("section"),[x,c]=o.useState("weekly"),[T,z]=o.useState(null),[I,_]=o.useState(!0),[E,Y]=o.useState([]),b=[h?.grade,h?.section].filter(Boolean).join(" - "),f=["","","","","","","",""];o.useEffect(()=>{(async()=>{if(n){_(!0);try{const a={daily:"week",weekly:"week",all:"all"},l=x==="daily"?"week":x==="all"?"all":"week",g=(await H(n.uid,!1,l,20)).map((r,C)=>({id:r.userId,uid:r.userId,name:r.name,avatar:r.userId===n.uid?s||r.photo||f[C%f.length]:r.photo||f[C%f.length],level:r.level,totalXP:r.xp,currentStreak:0,section:b||"Grade 11 - STEM A",rank:{global:r.rank,section:r.rank,change:0},stats:{quizzesCompleted:0,averageScore:0,modulesCompleted:0,studyHours:0},isOnline:!1,isYou:r.userId===n.uid}));Y(g)}catch(a){console.error("Error loading leaderboard:",a)}finally{_(!1)}}})()},[n,b,x,s]);const m=(()=>{let t=E;if(p==="section"){const l=b||"";l&&(t=t.filter(j=>j.section===l))}const a=t.sort((l,j)=>{const g=p==="section"?"section":"global";return(l.rank[g]||999)-(j.rank[g]||999)});for(;a.length>0&&a.length<3;){const l=a.length+1;a.push({id:`mock-${l}`,uid:`mock-${l}`,name:`Student ${l}`,avatar:"",level:1,totalXP:0,currentStreak:0,section:b||"",rank:{global:l,section:l,change:0},stats:{quizzesCompleted:0,averageScore:0,modulesCompleted:0,studyHours:0},isOnline:!1,isYou:!1})}return a})(),S=m.find(t=>t.isYou)?.rank.section||4,D=Math.max(10,Math.min(99,100-S/Math.max(1,m.length)*100)),i=m.length>=3?m.slice(0,3):[],F=m.length>=3?m.slice(3):[],u=(t,a)=>t?t.startsWith("http")||t.startsWith("data:")?e.jsx("img",{src:t,alt:"Avatar",className:"w-full h-full object-cover rounded-full"}):e.jsx(L,{size:a,className:"text-slate-400 opacity-70"}):e.jsx(L,{size:a,className:"text-slate-400 opacity-70"});return I?e.jsx("div",{className:"flex justify-center items-center h-[500px]",children:e.jsx(M,{className:"w-8 h-8 animate-spin text-purple-600"})}):e.jsxs("div",{className:"w-full min-h-screen relative flex flex-col items-center font-body text-white",children:[e.jsxs("div",{className:"absolute inset-x-[-20px] top-0 bottom-[-50px] z-[-1] pointer-events-none overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,#9333ea_0%,#c084fc_40%,transparent_80%)]"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[250vw] md:w-[200vw] h-[150vh] opacity-75 pointer-events-none",style:{WebkitMaskImage:"radial-gradient(circle at 50% 100%, black 10%, transparent 60%)"},children:e.jsx(d.div,{className:"absolute bottom-0 left-1/2 w-[300vw] h-[300vw] md:w-[200vw] md:h-[200vw]",style:{x:"-50%",originX:.5,originY:1,background:`repeating-conic-gradient(from 0deg at 50% 100%, - rgba(255,255,255,0.7) 0deg, rgba(255,255,255,0.7) 6deg, - transparent 6deg, transparent 12deg)`},animate:{rotate:360},transition:{duration:160,repeat:1/0,ease:"linear"}})}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[150vw] h-[100vh] bg-[radial-gradient(ellipse_at_50%_100%,#7e22ce_10%,transparent_60%)] mix-blend-overlay"})]}),e.jsx("div",{className:"absolute inset-0 bg-math-pattern opacity-[0.03] mix-blend-overlay pointer-events-none z-[-1]",style:{WebkitMaskImage:"linear-gradient(to bottom, transparent, black 15%)"}}),e.jsxs("div",{className:"relative z-10 w-full px-4 sm:px-8 py-4 md:py-6 flex flex-col items-center",children:[e.jsx("div",{className:"w-full flex justify-center items-center mb-4 mt-2",children:e.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold tracking-wide text-slate-800 drop-shadow-sm",children:"Leaderboard"})}),e.jsx("div",{className:"bg-slate-800/5 backdrop-blur-md rounded-full p-1 flex gap-1 mb-3 shadow-[inset_0_2px_4px_rgba(0,0,0,0.05)] border border-slate-800/10 w-full max-w-[340px]",children:["daily","weekly","all"].map(t=>e.jsx("button",{onClick:()=>c(t),className:`flex-1 py-1.5 rounded-full text-[13px] md:text-sm font-semibold transition-all capitalize inline-flex justify-center items-center ${x===t?"bg-white text-purple-700 shadow-md border border-white/50 backdrop-blur-lg":"text-slate-600 hover:text-purple-700 hover:bg-white/50"}`,children:t==="all"?"All Time":t},t))}),e.jsxs(d.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"w-full max-w-[420px] mb-4 bg-[#FFB356] p-2.5 md:p-3 rounded-full shadow-lg flex items-center gap-3 relative overflow-hidden ring-1 ring-white/20",children:[e.jsx("div",{className:"absolute inset-0 bg-noise opacity-[0.15] mix-blend-overlay pointer-events-none"}),e.jsx("div",{className:"bg-white/25 backdrop-blur-md px-4 py-2 min-w-[60px] rounded-full flex flex-col items-center justify-center shadow-sm z-10 border border-white/20",children:e.jsxs("span",{className:"text-xl md:text-2xl font-display font-bold text-white leading-none",children:["#",S]})}),e.jsx("div",{className:"z-10 flex-1 pr-2 md:pr-4",children:e.jsxs("p",{className:"font-medium text-white/90 text-sm md:text-[15px] leading-snug text-center",children:["You are doing better than ",e.jsxs("span",{className:"font-black text-white drop-shadow-sm",children:[Math.round(D),"%"]})," of other players!"]})})]}),e.jsxs("div",{className:"w-full max-w-[800px] flex items-end justify-center gap-2 md:gap-4 h-[280px] md:h-[310px] relative z-20 mt-8 md:mt-12 mx-auto px-2 sm:px-4 group perspective-1000",children:[e.jsxs(d.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.15,type:"spring",stiffness:90},className:"flex flex-col items-center relative z-10 w-[28%] sm:w-[30%] max-w-[145px] mx-1 md:mr-2",children:[e.jsxs("div",{className:"flex flex-col items-center mb-2 md:mb-4 relative z-40 w-full",children:[e.jsx("div",{className:"w-14 h-14 md:w-[72px] md:h-[72px] rounded-full border-[3px] border-[#FF8B8B] bg-[#111827] flex items-center justify-center shadow-[0_0_18px_rgba(255,139,139,0.6)] overflow-hidden",children:u(i[1]?.avatar,26)}),e.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-xs md:text-sm drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:i[1]?.name||"---"})]}),e.jsxs("div",{className:"w-[90%] relative mt-2",children:[e.jsx("div",{className:"w-full h-10 md:h-14 absolute -bottom-5 md:-bottom-7 bg-[#D96C6A] rounded-[50%] shadow-[0_15px_25px_rgba(0,0,0,0.4)] z-0"}),e.jsx("div",{className:"w-full h-[100px] md:h-[130px] bg-[#D96C6A] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:e.jsx("span",{className:"absolute inset-x-0 top-3 flex items-center justify-center text-[60px] md:text-[80px] font-black text-white/10 drop-shadow",children:"2"})}),e.jsx("div",{className:"w-full h-10 md:h-14 absolute -top-5 md:-top-7 bg-[#FF8B8B] rounded-[50%] z-20 shadow-[0_4px_8px_rgba(0,0,0,0.3)] flex flex-col items-center justify-center",children:e.jsxs("div",{className:"text-black/25 font-black text-[18px] md:text-[26px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[i[1]?.totalXP||0," XP"]})})]})]}),e.jsxs(d.div,{initial:{opacity:0,y:60},animate:{opacity:1,y:0},transition:{delay:.05,type:"spring",stiffness:100},className:"flex flex-col items-center relative z-30 w-[35%] sm:w-[38%] max-w-[190px]",children:[e.jsxs("div",{className:"flex flex-col items-center mb-3 md:mb-5 relative z-40 w-full",children:[e.jsx(d.div,{animate:{y:[0,-6,0]},transition:{repeat:1/0,duration:2.2,ease:"easeInOut"},className:"mb-[-10px] z-30",children:e.jsx(X,{size:30,className:"text-yellow-300 fill-yellow-300 drop-shadow-[0_0_12px_rgba(250,204,21,0.9)] md:w-9 md:h-9"})}),e.jsx("div",{className:"w-16 h-16 md:w-[86px] md:h-[86px] rounded-full border-[4px] border-[#fde68a] bg-[#111827] flex items-center justify-center shadow-[0_0_24px_rgba(250,204,21,0.6)] overflow-hidden",children:u(i[0]?.avatar,34)}),e.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-sm md:text-base drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:i[0]?.name||"---"})]}),e.jsxs("div",{className:"w-[95%] relative mt-2",children:[e.jsx("div",{className:"w-full h-12 md:h-16 absolute -bottom-6 md:-bottom-8 bg-[#6F2BAF] rounded-[50%] shadow-[0_20px_30px_rgba(0,0,0,0.5)] z-0"}),e.jsx("div",{className:"w-full h-[140px] md:h-[180px] bg-[#6F2BAF] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:e.jsx("span",{className:"absolute inset-x-0 top-4 flex items-center justify-center text-[80px] md:text-[110px] font-black text-white/10 drop-shadow",children:"1"})}),e.jsx("div",{className:"w-full h-12 md:h-16 absolute -top-6 md:-top-8 bg-[#9956DE] rounded-[50%] z-20 shadow-[0_5px_12px_rgba(0,0,0,0.4)] flex flex-col items-center justify-center",children:e.jsxs("div",{className:"text-black/25 font-black text-[22px] md:text-[32px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[i[0]?.totalXP||0," XP"]})})]})]}),e.jsxs(d.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.25,type:"spring",stiffness:90},className:"flex flex-col items-center relative z-10 w-[28%] sm:w-[30%] max-w-[145px] mx-1 md:ml-2",children:[e.jsxs("div",{className:"flex flex-col items-center mb-2 md:mb-4 relative z-40 w-full",children:[e.jsx("div",{className:"w-14 h-14 md:w-[72px] md:h-[72px] rounded-full border-[3px] border-[#FFB356] bg-[#111827] flex items-center justify-center shadow-[0_0_18px_rgba(255,179,86,0.6)] overflow-hidden",children:u(i[2]?.avatar,26)}),e.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-xs md:text-sm drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:i[2]?.name||"---"})]}),e.jsxs("div",{className:"w-[90%] relative mt-2",children:[e.jsx("div",{className:"w-full h-10 md:h-14 absolute -bottom-5 md:-bottom-7 bg-[#DE7949] rounded-[50%] shadow-[0_15px_25px_rgba(0,0,0,0.4)] z-0"}),e.jsx("div",{className:"w-full h-[75px] md:h-[100px] bg-[#DE7949] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:e.jsx("span",{className:"absolute inset-x-0 top-1 flex items-center justify-center text-[50px] md:text-[70px] font-black text-white/10 drop-shadow",children:"3"})}),e.jsx("div",{className:"w-full h-10 md:h-14 absolute -top-5 md:-top-7 bg-[#FFB356] rounded-[50%] z-20 shadow-[0_4px_8px_rgba(0,0,0,0.3)] flex flex-col items-center justify-center",children:e.jsxs("div",{className:"text-black/25 font-black text-[16px] md:text-[22px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[i[2]?.totalXP||0," XP"]})})]})]})]})]}),e.jsxs("div",{className:"w-full flex-grow relative z-20 pt-6 pb-32 px-4 sm:px-10 flex flex-col items-center mt-[-20px] md:mt-[-40px] bg-white transition-all duration-300 hover:-translate-y-2 rounded-t-[2.5rem] shadow-[0_-15px_50px_rgba(0,0,0,0.2)] hover:shadow-[0_-20px_60px_rgba(0,0,0,0.3)] border-t border-slate-100 min-h-[50vh]",children:[e.jsx("div",{className:"absolute top-[50%] bottom-[-500px] left-0 right-0 bg-white z-[-1]"}),e.jsx("div",{className:"w-12 h-1.5 bg-slate-300/80 rounded-full mb-6 mt-[-10px]"}),e.jsxs("div",{className:"w-full max-w-4xl space-y-3.5",children:[F.map((t,a)=>{const l=t.rank.global||a+4;return e.jsxs(d.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:a*.05+.3},onClick:()=>z(t),className:`flex items-center gap-4 p-3.5 md:p-4 rounded-3xl cursor-pointer bg-white border transition-all duration-300 ${t.isYou?"border-[#8B5CF6]/40 shadow-xl shadow-[#8B5CF6]/20 ring-2 ring-[#8B5CF6]/10":"border-slate-100 shadow-[0_12px_25px_rgba(0,0,0,0.08)] hover:shadow-[0_16px_30px_rgba(0,0,0,0.12)]"}`,children:[e.jsx("div",{className:"w-9 h-9 md:w-11 md:h-11 rounded-full border-2 border-slate-100 bg-white flex items-center justify-center font-display font-bold text-slate-500 shadow-sm text-sm",children:l}),e.jsx("div",{className:"w-11 h-11 md:w-14 md:h-14 bg-slate-100 rounded-full flex items-center justify-center text-xl overflow-hidden shadow-sm relative border-[3px] border-[#F1F5F9]",children:u(t.avatar,24)}),e.jsxs("div",{className:"flex-1 flex justify-between items-center pr-2",children:[e.jsx("div",{children:e.jsxs("h4",{className:"font-display font-bold text-[#1E293B] text-[15px] md:text-lg flex items-center gap-2 tracking-wide",children:[t.name,t.isYou&&e.jsx("span",{className:"text-[9px] uppercase tracking-wider bg-[#8B5CF6] text-white px-1.5 py-0.5 rounded font-bold",children:"You"})]})}),e.jsx("div",{children:e.jsxs("p",{className:"text-[13px] md:text-[15px] font-bold text-slate-500 text-right",children:[t.totalXP," ",e.jsx("span",{className:"text-[10px] text-slate-400 font-normal uppercase",children:"XP"})]})})]})]},t.id)}),F.length===0&&e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-slate-400 font-medium",children:"No other participants found in this view."})})]})]}),e.jsx(V,{student:T,onClose:()=>z(null)})]})};export{fe as default}; diff --git a/assets/LearningPath-B_MkUEk2.js b/assets/LearningPath-B_MkUEk2.js deleted file mode 100644 index 69f2a8a9438a78bb2debc83da5b60be35c97b876..0000000000000000000000000000000000000000 --- a/assets/LearningPath-B_MkUEk2.js +++ /dev/null @@ -1 +0,0 @@ -import{r as p,c as h,j as t}from"./vendor-react-Dexh7fmo.js";import{u as S,n as k,o as v,g as w,A as C}from"./index-D4nJsLyx.js";import{g as L,s as M}from"./subjects-DDBtpdiA.js";import{M as A}from"./ModuleFolderCard-CoKTURyN.js";import{B as E}from"./book-open-BH50GByv.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./trending-up-D-vj8Gbq.js";import"./chart-column-D5mAWcRx.js";import"./clock-DUJO-a50.js";const H=({onNavigateToModules:c,atRiskSubjects:g=[],priorityTopics:d=[]})=>{const{userProfile:i}=S(),[x,f]=p.useState(null),b=i?.grade,j=L(b),m=M.filter(e=>j.includes(e.id)),l=m.find(e=>e.id==="gen-math")??m[0],a=h.useMemo(()=>{const e=d.length>0?d:g.map(s=>k(s)).filter(s=>s!==null),r=new Set;return e.filter(s=>r.has(s)?!1:(r.add(s),!0))},[d,g]),P=h.useMemo(()=>{const e=l?.modules??[];if(a.length===0)return e;const r=new Map(a.map((s,n)=>[v[s],n]));return[...e].sort((s,n)=>{const o=r.get(s.id)??Number.POSITIVE_INFINITY,N=r.get(n.id)??Number.POSITIVE_INFINITY;return o-N})},[l?.modules,a]);p.useEffect(()=>{i?.uid&&w(i.uid).then(f).catch(console.error)},[i?.uid]);const u=P.slice(0,4).map(e=>{const n=x?.subjects?.[l.id]?.modulesProgress?.[e.id]?.lessonsCompleted?.length||0,o=e.lessons.length>0?Math.round(n/e.lessons.length*100):0;return{...e,progress:o,status:o===100?"Completed":o>0?"In Progress":"Not Started"}}),I=u.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between items-center mb-6 px-1",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:t.jsx(E,{size:20,strokeWidth:2.5})}),t.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:I})]}),t.jsxs("button",{onClick:()=>c?.(),className:"text-primary font-bold text-sm flex items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-4 py-2 rounded-xl hover:bg-primary/20",children:["View All ",t.jsx(C,{size:16})]})]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:u.map((e,r)=>t.jsx(A,{module:e,index:r,onClick:()=>c?.(e.id),isAtRisk:a.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0},e.id))})]})};export{H as default}; diff --git a/assets/LoginPage-mXOi2OPh.js b/assets/LoginPage-mXOi2OPh.js deleted file mode 100644 index 2b58aec32be1e93eae15fcbd28d99e7233b83a1c..0000000000000000000000000000000000000000 --- a/assets/LoginPage-mXOi2OPh.js +++ /dev/null @@ -1 +0,0 @@ -import{r,j as e}from"./vendor-react-Dexh7fmo.js";import{B as Q}from"./button-BpeUVhBo.js";import{I as N}from"./input-DBkKXOmF.js";import{m as s,A as I,s as C,a as K,b as z}from"./index-D4nJsLyx.js";import{S as X}from"./sparkles-CXUFmaBJ.js";import{B as Z}from"./brain-CPvGdgWE.js";import{T as ee}from"./trending-up-D-vj8Gbq.js";import{A as te}from"./award-oJTbc9W5.js";import{U as B}from"./users-HMf2sdE3.js";import{G}from"./graduation-cap-Df8fGPxp.js";import{B as D}from"./book-open-BH50GByv.js";import{M as se}from"./mail-D7el5vSX.js";import{L}from"./lock-_59co5m5.js";import{E as ae}from"./eye-off-BYAdNgqy.js";import{E as re}from"./eye-DXdRafOv.js";import{S as le}from"./shield-check-B_yHzqcC.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const ie="/assets/shader-bg-DA7bEbBA.mp4",R=(h,d)=>{const l=h instanceof Error?h.message:d;return l.includes("auth/invalid-credential")||l.includes("auth/wrong-password")||l.includes("auth/user-not-found")?"Invalid email or password. Please check your credentials and try again.":l.includes("auth/email-already-in-use")?"This email is already registered. Please sign in instead.":l.includes("auth/weak-password")?"Password is too weak. It should be at least 6 characters.":l.includes("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.":l.includes("auth/network-request-failed")?"Network error. Please check your internet connection and try again.":l.includes("Firebase:")||l.includes("auth/")?d:l},Ie=()=>{const h=["Grade 11","Grade 12"],d={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"],"Grade 12":["STEM A","STEM B","ABM A","HUMSS A"]},l={teacher:["Mathematics","Science","English","Technology","Humanities"]},[b,w]=r.useState(""),[f,k]=r.useState(""),[g,q]=r.useState(!1),[i,S]=r.useState(!1),[v,U]=r.useState(""),[o,A]=r.useState("student"),[m,$]=r.useState("Grade 11"),[y,P]=r.useState(d["Grade 11"][0]),[u,E]=r.useState("Mathematics"),[M,c]=r.useState(!1),[T,n]=r.useState(null),[O,H]=r.useState(!1),j=r.useRef(null);r.useEffect(()=>{j.current&&j.current.play().catch(()=>{})},[]),r.useEffect(()=>{o==="teacher"&&!l.teacher.includes(u)&&E(l.teacher[0])},[u,o]),r.useEffect(()=>{const t=d[m]||[];t.length>0&&!t.includes(y)&&P(t[0])},[m,y]);const Y=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:G,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:D,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:le,color:"rose"}],_=async(t,a,x)=>{n(null),c(!0),w(t),k(a),A(x),S(!1);try{C(x),await z(t,a)}catch(p){n(R(p,"Demo sign-in failed")),c(!1)}},F=async t=>{t.preventDefault(),n(null),c(!0);try{if(i){if(!v.trim()){n("Please enter your name"),c(!1);return}if(o==="student"&&!m){n("Please select a grade level"),c(!1);return}if(o!=="student"&&!u){n("Please select a department"),c(!1);return}if(o==="admin"){n("Admin account creation is restricted. Please contact an existing administrator."),c(!1);return}C(o),await K(b,f,v,o,o==="student"?{grade:m,section:y}:{department:u})}else await z(b,f)}catch(a){n(R(a,"Authentication failed")),c(!1)}},W=["∫","π","∑","Δ","∞","φ","√","λ","θ","∂"];return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative",style:{background:"linear-gradient(135deg, #f0f9ff 0%, #f8fafc 30%, #fff1f2 60%, #f0f9ff 100%)"},children:[e.jsx("video",{ref:j,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,onCanPlay:()=>H(!0),className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-1000 ${O?"opacity-40":"opacity-0"}`,src:ie}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 50%, rgba(240,249,255,0.4) 0%, rgba(248,250,252,0.65) 50%, rgba(255,241,242,0.5) 80%, rgba(248,250,252,0.85) 100%)"}}),e.jsx("div",{className:"absolute top-[-20%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[120px] pointer-events-none",style:{background:"radial-gradient(circle, rgba(14,165,233,0.12) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute bottom-[-20%] right-[-10%] w-[50%] h-[50%] rounded-full blur-[120px] pointer-events-none",style:{background:"radial-gradient(circle, rgba(244,63,94,0.08) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03]",style:{backgroundImage:"radial-gradient(circle, rgba(15,23,42,0.4) 1px, transparent 1px)",backgroundSize:"24px 24px"}}),W.map((t,a)=>e.jsx(s.span,{className:"absolute text-sky-700/[0.08] font-display select-none pointer-events-none",style:{fontSize:`${20+Math.random()*40}px`,left:`${5+a*9.5}%`,top:`${10+a*8}%`},animate:{y:[0,-30,0],opacity:[.04,.1,.04],rotate:[0,10,0]},transition:{duration:8+a*2,repeat:1/0,ease:"easeInOut",delay:a*.5},children:t},a)),e.jsx("div",{className:"absolute top-0 left-1/4 w-px h-full bg-gradient-to-b from-transparent via-sky-400/15 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-1/3 w-px h-full bg-gradient-to-b from-transparent via-rose-300/10 to-transparent"}),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(s.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col justify-center space-y-8",children:[e.jsxs(s.div,{className:"flex items-center gap-2.5",children:[e.jsx(s.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI Logo",className:"w-16 h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-display font-extrabold tracking-tight text-slate-900",children:["MathPulse",e.jsx("span",{className:"text-sky-500",children:"AI"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(X,{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(s.div,{className:"space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),e.jsx("p",{className:"text-base text-slate-500 leading-relaxed max-w-md font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{icon:Z,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:ee,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:te,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const x=t.icon,p={sky:"border-sky-200/60 hover:border-sky-300",rose:"border-rose-200/60 hover:border-rose-300",emerald:"border-emerald-200/60 hover:border-emerald-300"},V={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},J={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(s.div,{className:`bg-white/80 backdrop-blur-xl border ${p[t.color]} rounded-xl p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+a*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-9 h-9 rounded-lg ${J[t.color]} flex items-center justify-center mb-3`,children:e.jsx(x,{size:18,className:V[t.color]})}),e.jsx("h3",{className:"text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-xs text-slate-400 font-body",children:t.desc})]},a)})})]}),e.jsx(s.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-2xl p-7 w-full max-w-md relative overflow-hidden shadow-2xl shadow-slate-900/[0.08]",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-sky-500/50 to-transparent"}),e.jsx("div",{className:"absolute -top-20 left-1/2 -translate-x-1/2 w-72 h-36 bg-sky-400/10 rounded-full blur-3xl pointer-events-none"}),e.jsxs("div",{className:"text-center mb-6 relative",children:[e.jsx(s.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:i?"Create Account":"Welcome Back"}),e.jsx(s.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:i?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:F,className:"space-y-4 mb-5 relative",children:[T&&e.jsx(s.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:T}),i&&e.jsxs(s.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(B,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(N,{type:"text",placeholder:"Your Name",value:v,onChange:t=>U(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})]})]}),i&&e.jsxs(s.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(t=>{const a=o===t.role;return e.jsx("button",{type:"button",onClick:()=>A(t.role),className:`rounded-lg border px-3 py-2 text-xs font-body font-semibold transition-all ${a?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:t.label},t.role)})})]}),i&&o==="student"&&e.jsxs(s.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Grade Level"}),e.jsxs("div",{className:"relative",children:[e.jsx(G,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:m,onChange:t=>$(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:h.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),i&&o==="student"&&e.jsxs(s.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(B,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:y,onChange:t=>P(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(d[m]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),i&&o!=="student"&&e.jsxs(s.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Department"}),e.jsxs("div",{className:"relative",children:[e.jsx(D,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:u,onChange:t=>E(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:l.teacher.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs(s.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(se,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(N,{type:"email",placeholder:"your.email@school.edu",value:b,onChange:t=>w(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(s.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(L,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(N,{type:g?"text":"password",placeholder:"••••••••",value:f,onChange:t=>k(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:6}),e.jsx(s.button,{type:"button",onClick:()=>q(!g),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:g?e.jsx(ae,{size:16}):e.jsx(re,{size:16})})]})]}),e.jsx(s.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(Q,{type:"submit",disabled:M,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-500 hover:to-cyan-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-sky-600/25 hover:shadow-sky-500/35 hover:scale-[1.01] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(s.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:[M?"Please wait...":i?"Create Account":"Sign In",e.jsx(I,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{S(!i),n(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:i?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!i&&e.jsxs(s.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:Y.map(t=>{const a=t.icon,x={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},p={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(s.button,{type:"button",onClick:()=>_(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 ${x[t.color]}`,children:e.jsx(a,{size:15,className:p[t.color]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[t.label," Account"]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:t.email})]}),e.jsx(I,{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(s.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(L,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{Ie as default}; diff --git a/assets/LogoutActionButton-FS5OGZjL.js b/assets/LogoutActionButton-FS5OGZjL.js deleted file mode 100644 index 34d41af11f1231017428cac9b4b882c240227f7a..0000000000000000000000000000000000000000 --- a/assets/LogoutActionButton-FS5OGZjL.js +++ /dev/null @@ -1,16 +0,0 @@ -import{c as a,m as s}from"./index-D4nJsLyx.js";import{j as e}from"./vendor-react-Dexh7fmo.js";import{c as n}from"./utils-BQQgILNW.js";import{L as i}from"./log-out-BqGKt-tT.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const l=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],m=a("chevron-left",l);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],f=a("layout-dashboard",c);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const h=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],p=a("settings",h),g=({onClick:o,collapsed:t=!1,className:r})=>e.jsxs(s.button,{type:"button",whileTap:{scale:.98},whileHover:{x:2},onClick:o,title:t?"Log Out":void 0,className:n("w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-bold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap",t&&"justify-center",r),children:[e.jsx(i,{size:18,strokeWidth:1.5,className:"flex-shrink-0"}),!t&&e.jsx("span",{className:"font-body text-xs",children:"Log Out"})]});export{m as C,f as L,p as S,g as a}; diff --git a/assets/MathAnswerInput-DNG5LFL4.js b/assets/MathAnswerInput-DNG5LFL4.js deleted file mode 100644 index 88aa003571bd7ad72bd88125e0adb355fe6b9efd..0000000000000000000000000000000000000000 --- a/assets/MathAnswerInput-DNG5LFL4.js +++ /dev/null @@ -1 +0,0 @@ -import{r as c,c as y,j as e}from"./vendor-react-Dexh7fmo.js";import{C as P}from"./index-D4nJsLyx.js";const N={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"};function S(i){let t=i;return t=t.replace(/sin⁻¹/g,"sin-1"),t=t.replace(/cos⁻¹/g,"cos-1"),t=t.replace(/tan⁻¹/g,"tan-1"),t=t.replace(/⁻¹/g,"-1"),t=t.replace(/²/g,"2"),t=t.replace(/³/g,"3"),t=t.replace(/[⁰¹⁴⁵⁶⁷⁸⁹]/g,d=>`${{"⁰":"0","¹":"1","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9"}[d]??d}`),t=t.replace(/√/g,"√"),t=t.replace(/π/g,"π"),t=t.replace(/<(?!\/?(?:sup|sub)\b)[^>]*>/gi,""),t}const R=({value:i,onChange:t,placeholder:d,onCalculatorOpen:h,onSubmit:f})=>{const[b,g]=c.useState(!1),[m,j]=c.useState(null),[w,v]=c.useState({top:0,left:0}),p=c.useRef(null),x=c.useRef(!1),s=c.useCallback(n=>{const o=p.current;if(!o){t(i+n);return}const l=o.selectionStart??i.length,u=o.selectionEnd??i.length,D=i.slice(0,l)+n+i.slice(u);t(D),setTimeout(()=>{o.setSelectionRange(l+n.length,l+n.length),o.focus()},0)},[i,t]),C=c.useCallback(n=>{const o=n.key;if(o==="Enter"){n.preventDefault(),f?.();return}if(o==="^"){x.current=!0,n.preventDefault();return}if(x.current){if(o==="-"){s("⁻"),n.preventDefault();return}if(/^[0-9]$/.test(o)&&N[o]){s(N[o]),x.current=!1,n.preventDefault();return}x.current=!1}if(o==="Tab"&&m!==null){s(m),j(null),n.preventDefault();return}setTimeout(()=>{const l=p.current?.value??i;if(l.endsWith("pi"))t(l.slice(0,-2)+"π"),j(null);else if(l.endsWith("sqrt"))t(l.slice(0,-4)+"√");else if(l.endsWith("sin-1")||l.endsWith("sin^-1")){const u=l.endsWith("sin^-1")?6:5;t(l.slice(0,-u)+"sin⁻¹")}else if(l.endsWith("cos-1")||l.endsWith("cos^-1")){const u=l.endsWith("cos^-1")?6:5;t(l.slice(0,-u)+"cos⁻¹")}else if(l.endsWith("tan-1")||l.endsWith("tan^-1")){const u=l.endsWith("tan^-1")?6:5;t(l.slice(0,-u)+"tan⁻¹")}},0)},[i,t,m,s,f]),a=c.useCallback(()=>{if(p.current){const n=p.current.getBoundingClientRect();v({top:Math.max(20,n.bottom-280),left:Math.max(10,n.left-240)})}},[]),E=c.useCallback(()=>{a(),g(!0)},[a]);y.useEffect(()=>{const n=setTimeout(()=>{a(),g(!0)},50);return()=>clearTimeout(n)},[a]),y.useEffect(()=>{if(b)return window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[b,a]);const T=c.useCallback(()=>{},[]),k=S(i),W=k!==i&&i.length>0,r="bg-slate-100 hover:bg-slate-200 text-[#0a1628] text-sm px-2 py-1 rounded-lg transition-colors";return e.jsxs("div",{className:"relative",children:[b&&e.jsxs("div",{className:"fixed z-[60] bg-white border border-slate-200 rounded-xl shadow-xl px-3 py-3 flex flex-col gap-3 w-[220px] pointer-events-auto",style:{top:w.top,left:w.left},onMouseDown:n=>n.preventDefault(),children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Powers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Square",onClick:()=>s("²"),children:"x²"}),e.jsx("button",{type:"button",className:r,title:"Cube",onClick:()=>s("³"),children:"x³"}),e.jsx("button",{type:"button",className:r,title:"Power",onClick:()=>s("^"),children:"xⁿ"}),e.jsx("button",{type:"button",className:r,title:"Inverse",onClick:()=>s("⁻¹"),children:"x⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Square root",onClick:()=>s("√("),children:"√"}),e.jsx("button",{type:"button",className:r,title:"Cube root",onClick:()=>s("∛("),children:"∛"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Inverse Trig"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Inverse sine",onClick:()=>s("sin⁻¹("),children:"sin⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Inverse cosine",onClick:()=>s("cos⁻¹("),children:"cos⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Inverse tangent",onClick:()=>s("tan⁻¹("),children:"tan⁻¹"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Symbols"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Pi",onClick:()=>s("π"),children:"π"}),e.jsx("button",{type:"button",className:r,title:"Euler's number",onClick:()=>s("e"),children:"e"}),e.jsx("button",{type:"button",className:r,title:"Infinity",onClick:()=>s("∞"),children:"∞"}),e.jsx("button",{type:"button",className:r,title:"Plus-minus",onClick:()=>s("±"),children:"±"}),e.jsx("button",{type:"button",className:r,title:"Approximately",onClick:()=>s("≈"),children:"≈"}),e.jsx("button",{type:"button",className:r,title:"Degree",onClick:()=>s("°"),children:"°"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Other"}),e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx("button",{type:"button",className:r,title:"Fraction",onClick:()=>s("(/)"),children:"a/b"}),e.jsx("div",{className:"ml-auto",children:e.jsxs("button",{type:"button",className:"bg-sky-600 hover:bg-rose-500 text-white text-xs px-3 py-1 rounded-lg flex items-center gap-1",onClick:()=>h?.(),children:[e.jsx(P,{size:12}),"Use Calc"]})})]})]})]}),e.jsx("input",{ref:p,id:"math-answer-input",name:"math-answer-input","aria-label":"Math answer input",type:"text",value:i,onChange:n=>t(n.target.value),onKeyDown:C,onFocus:E,onBlur:T,placeholder:d||"Type your answer... use ^ for powers e.g. x^2 for x²",className:"w-full bg-white border border-slate-200 focus:border-sky-500 rounded-xl px-4 py-3 text-[#0a1628] font-mono text-base outline-none transition-colors"}),W&&e.jsx("div",{className:"text-rose-300 text-sm font-mono mt-1",dangerouslySetInnerHTML:{__html:k}})]})};export{R as M}; diff --git a/assets/ModuleFolderCard-CoKTURyN.js b/assets/ModuleFolderCard-CoKTURyN.js deleted file mode 100644 index 9d604dc59784e6f4c36b495e197442513080e5f0..0000000000000000000000000000000000000000 --- a/assets/ModuleFolderCard-CoKTURyN.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./vendor-react-Dexh7fmo.js";import{m as d,T as n}from"./index-D4nJsLyx.js";import{B as x}from"./book-open-BH50GByv.js";import{C as h}from"./clock-DUJO-a50.js";const r=[{bg:"bg-[#9956DE]",tab:"bg-[#8248c2]",shadow:"shadow-[#9956DE]/30"},{bg:"bg-[#1FA7E1]",tab:"bg-[#198abf]",shadow:"shadow-[#1FA7E1]/30"},{bg:"bg-[#FFB356]",tab:"bg-[#e09841]",shadow:"shadow-[#FFB356]/30"},{bg:"bg-[#FB96BB]",tab:"bg-[#de7b9f]",shadow:"shadow-[#FB96BB]/30"}],g=({module:s,index:l,onClick:o,isAtRisk:i,badgeLabel:t})=>{const a=r[l%r.length];return e.jsxs(d.button,{whileHover:{y:-8},onClick:o,className:"relative text-left rounded-[1.4rem] overflow-visible min-h-[290px] bg-transparent group w-full",children:[e.jsx("div",{className:`absolute top-0 left-4 h-7 w-32 rounded-t-xl shadow-sm transition-colors duration-300 ${a.tab}`}),e.jsxs("div",{className:`relative mt-6 rounded-[1.4rem] p-6 transition-all duration-300 overflow-hidden flex flex-col h-[calc(100%-24px)] ${a.bg} shadow-[0_18px_30px_-20px_rgba(0,0,0,0.45)] group-hover:shadow-[0_24px_40px_-15px_rgba(0,0,0,0.5)]`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 mix-blend-overlay bg-white/40"}),e.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-48 h-48 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute bottom-4 right-12 w-32 h-32 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110 delay-75"}),e.jsxs("div",{className:"relative z-10 flex-1 flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsx("span",{className:"px-3 py-1.5 rounded-full bg-white/20 text-white text-[10px] font-black uppercase tracking-wider backdrop-blur-sm shadow-sm border border-white/10",children:"General Mathematics"}),(t||s.status==="Locked")&&e.jsx("span",{className:"px-2.5 py-1 rounded-full bg-black/30 text-white/90 text-[10px] font-black uppercase tracking-wider backdrop-blur-sm",children:t||"Locked"})]}),e.jsx("h3",{className:"text-2xl md:text-[22px] font-display font-black text-white leading-[1.1] mb-2 drop-shadow-sm pr-4 line-clamp-2",children:s.title}),e.jsx("p",{className:"text-white/85 text-sm line-clamp-2 mb-6 font-medium leading-relaxed pr-2",children:s.subtitle||s.description||"Master this module to unlock the next level of your mathematical journey."}),e.jsxs("div",{className:"mt-auto",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(x,{size:14,className:"opacity-90"})," ",s.totalLessons||s.lessons?.length||0," lessons"]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(h,{size:14,className:"opacity-90"})," ",s.totalQuizzes||s.quizzes?.length||0," quizzes"]})]}),e.jsxs("div",{className:"flex justify-between text-white font-bold text-[13px] mb-1.5 drop-shadow-sm",children:[e.jsx("span",{children:"Progress"}),e.jsxs("span",{children:[s.progress>0?s.progress:0,"%"]})]}),e.jsx("div",{className:"w-full h-2.5 rounded-full bg-black/20 overflow-hidden shadow-inner flex-shrink-0",children:e.jsx("div",{className:"h-full bg-white rounded-full transition-all duration-1000 ease-out",style:{width:`${s.progress>0?s.progress:0}%`}})})]}),i&&e.jsxs("div",{className:"absolute -top-3 -right-2 bg-rose-500 text-white px-3 py-1.5 rounded-full text-[11px] font-black uppercase tracking-wider flex items-center gap-1.5 shadow-lg border border-rose-400 animate-pulse",children:[e.jsx(n,{size:12,strokeWidth:3})," Review"]})]})]})]})};export{g as M}; diff --git a/assets/ModulesPage-y4YivjOd.js b/assets/ModulesPage-y4YivjOd.js deleted file mode 100644 index b03c165668355c98bde239aba72ded6898bd9374..0000000000000000000000000000000000000000 --- a/assets/ModulesPage-y4YivjOd.js +++ /dev/null @@ -1,112 +0,0 @@ -import{r as l,j as e}from"./vendor-react-Dexh7fmo.js";import{M as we}from"./ModuleFolderCard-CoKTURyN.js";import{B as X}from"./button-BpeUVhBo.js";import{I as Oe}from"./input-DBkKXOmF.js";import{c as F,m as p,Z as Ae,F as ae,e as Y,A as Ce,C as pe,u as Se,p as Ze,q as He,r as ze,v as Xe,w as Ue,g as Ye,n as Ke,o as Je,T as et,x as tt}from"./index-D4nJsLyx.js";import{T as H}from"./trophy-C2nVcZnb.js";import{S as je}from"./sparkles-CXUFmaBJ.js";import{T as Z}from"./target-D7SVtf3g.js";import{A as re}from"./award-oJTbc9W5.js";import{S as Te}from"./star-dumQ9BVG.js";import{C as me}from"./check-BACdUlFL.js";import{X as G}from"./x-BONnp2RF.js";import{C as st}from"./circle-help-BmjHdT5a.js";import{a as Me,s as ie,g as at}from"./subjects-DDBtpdiA.js";import{T as he}from"./trending-up-D-vj8Gbq.js";import{B as U}from"./book-open-BH50GByv.js";import{L as Pe,c as it,a as nt}from"./quizService-CI5e0QMr.js";import{C as se}from"./circle-check-big-0Gzyt_f3.js";import{L as ve}from"./lock-_59co5m5.js";import{C as ne}from"./clock-DUJO-a50.js";import Ie from"./confetti.module-C94ZD2ww.js";import{triggerQuizSubmitted as rt}from"./automationService-DNyauqGd.js";import ot from"./ScientificCalculator-wlhyNBDf.js";import{M as lt}from"./MathAnswerInput-DNG5LFL4.js";import Le from"./SupplementalBanner-dklPrubU.js";import{P as ct}from"./pen-line-Vok2l3fc.js";import{C as dt}from"./chevron-right-COMox1Xb.js";import{S as xt}from"./search-Do6u3pFt.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./chart-column-D5mAWcRx.js";import"./apiService-axx1LHMk.js";import"./chevron-up-Bfmq3Clw.js";import"./brain-CPvGdgWE.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ne=F("arrow-left",mt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pt=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],ht=F("binary",pt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ut=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],ft=F("bookmark",ut);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bt=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],qe=F("box",bt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gt=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Ee=F("braces",gt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wt=F("circle-check",yt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Be=F("circle-x",jt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fe=F("circle",vt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nt=[["circle",{cx:"12",cy:"6",r:"1",key:"1bh7o1"}],["line",{x1:"5",x2:"19",y1:"12",y2:"12",key:"13b5wn"}],["circle",{cx:"12",cy:"18",r:"1",key:"lqb9t5"}]],ge=F("divide",Nt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kt=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],At=F("flag",kt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ct=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],St=F("hash",Ct);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tt=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],ke=F("pen-tool",Tt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zt=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],$e=F("percent",zt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mt=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Re=F("play",Mt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pt=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],It=F("ruler",Pt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lt=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M14 15H9v-5",key:"pi4jk9"}],["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M21 3 9 15",key:"15kdhq"}]],qt=F("scaling",Lt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],ye=F("square-function",Et);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],_e=F("square",Bt);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ft=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],We=F("triangle",Ft),Qe=()=>{const t=["#4F46E5","#EC4899","#f43f5e","#10B981","#0ea5e9"],i=Array.from({length:50},(x,r)=>({id:r,left:Math.random()*100,animationDelay:Math.random()*.5,backgroundColor:t[Math.floor(Math.random()*t.length)],rotation:Math.random()*360}));return e.jsx("div",{className:"fixed inset-0 pointer-events-none z-[100] overflow-hidden",children:i.map(x=>e.jsx(p.div,{initial:{y:-20,x:`${x.left}vw`,opacity:1,rotate:0},animate:{y:"100vh",rotate:x.rotation,opacity:0},transition:{duration:2+Math.random()*2,delay:x.animationDelay,ease:"easeIn"},style:{position:"absolute",width:"10px",height:"10px",backgroundColor:x.backgroundColor},className:"rounded-sm"},x.id))})},$t=({streak:t})=>t<3?null:e.jsx(p.div,{initial:{scale:0,y:50},animate:{scale:1,y:0},exit:{scale:0,opacity:0},className:"fixed top-24 left-1/2 -translate-x-1/2 z-[70] pointer-events-none",children:e.jsxs("div",{className:"bg-gradient-to-r from-orange-500 to-red-500 text-white px-6 py-3 rounded-2xl shadow-2xl flex items-center gap-3",children:[e.jsx(ae,{size:24,className:"animate-pulse"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-lg font-black",children:[t,"x STREAK!"]}),e.jsxs("p",{className:"text-xs font-bold opacity-90",children:["+",t*5," Bonus XP"]})]})]})}),_t=({lesson:t,questions:i,onComplete:x,onBack:r})=>{const[n,m]=l.useState(0),[c,S]=l.useState(null),[L,v]=l.useState(""),[N,I]=l.useState(!1),[A,j]=l.useState(!1),[$,P]=l.useState(0),[E,k]=l.useState(0),[o,q]=l.useState(0),[h,B]=l.useState(!1),[u,a]=l.useState([]),[f,b]=l.useState(!1),[y,M]=l.useState(!1),[_,D]=l.useState([]),[oe]=l.useState(Date.now()),[K,fe]=l.useState(0),C=i[n],O=t.title,W=t.type,T=s=>{const d={correct:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",incorrect:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",complete:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",streak:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="};try{const g=new Audio(d[s]);g.volume=.3,g.play().catch(()=>{})}catch{}};l.useEffect(()=>{C?.type==="multiple-choice"&&C.options&&a([...C.options].sort(()=>Math.random()-.5))},[n,C]),l.useEffect(()=>{const s=d=>{d.key==="Enter"&&(!N&&R()?le():N&&ce())};return window.addEventListener("keypress",s),()=>window.removeEventListener("keypress",s)},[N,c,L]);const R=()=>C.type==="fill-in-blank"?L.trim().length>0:c!==null,le=()=>{if(!R())return;let s=!1,d="";if(C.type==="fill-in-blank"){d=L.trim().toLowerCase();const g=C.correctAnswer.toLowerCase().trim();s=d===g||d.replace(/\s+/g,"")===g.replace(/\s+/g,"")}else{if(!c)return;d=c,s=d===C.correctAnswer}if(j(s),I(!0),D([..._,s]),s){P(z=>z+1);const g=E+1;if(k(g),q(Math.max(o,g)),g>=3){const z=g*5;fe(V=>V+z),b(!0),T("streak"),setTimeout(()=>b(!1),2e3)}else T("correct")}else k(0),T("incorrect")},ce=()=>{nM(!1),3e3)),m(s=>s+1),I(!1),S(null),v(""),j(!1)):de()},de=()=>{B(!0),M(!0),T("complete"),setTimeout(()=>M(!1),5e3)},Q=W==="quiz"?{gradient:"bg-gradient-to-br from-indigo-600 via-sky-600 to-indigo-800",text:"text-sky-900",bgLight:"bg-sky-50",border:"border-sky-200"}:{gradient:"bg-gradient-to-br from-teal-500 via-emerald-500 to-teal-700",text:"text-teal-900",bgLight:"bg-teal-50",border:"border-teal-200"},J=(()=>{const s=O.toLowerCase();return s.includes("geometry")||s.includes("shape")?[We,Fe,_e,qe,It,qt]:s.includes("algebra")||s.includes("equation")?[G,ge,Ee,ye,pe,$e]:s.includes("calculus")||s.includes("derivative")||s.includes("integral")?[Me,ye,he,pe,ge,Ee]:s.includes("statistics")||s.includes("probability")?[Z,he,qe,Fe,We,_e]:[pe,Me,ge,$e,ye,ht]})(),w=J[0];if(h){const s=Math.round($/i.length*100),d=W==="quiz"?100:50,g=Math.round($/i.length*100),z=d+g+K,V=Math.floor((Date.now()-oe)/1e3),Ve=Math.floor(V/60),Ge=V%60;return e.jsxs(e.Fragment,{children:[y&&e.jsx(Qe,{}),e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-md p-4 animate-in fade-in duration-500",children:e.jsxs(p.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",duration:.5},className:"bg-white rounded-[32px] w-full max-w-lg p-6 text-center shadow-2xl relative overflow-hidden",children:[e.jsx("div",{className:`absolute top-0 left-0 w-full h-24 ${Q.gradient} opacity-10 rounded-b-[50%]`}),e.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none opacity-[0.03]",children:J.map((xe,ee)=>e.jsx(xe,{className:"absolute text-[#0a1628]",size:30+ee%3*15,style:{top:`${Math.random()*100}%`,left:`${Math.random()*100}%`,transform:`rotate(${Math.random()*360}deg)`}},ee))}),e.jsxs("div",{className:"relative mb-4 flex justify-center",children:[e.jsx(p.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",delay:.2},className:"w-20 h-20 bg-gradient-to-br from-rose-400 to-orange-500 rounded-full flex items-center justify-center text-white shadow-2xl shadow-rose-200",children:e.jsx(H,{size:40,fill:"currentColor"})}),e.jsx(p.div,{animate:{scale:[1,1.2,1],rotate:[0,180,360]},transition:{duration:2,repeat:1/0},className:"absolute top-0 right-1/3 text-xl",children:e.jsx(je,{size:20,className:"text-rose-400"})}),e.jsx(p.div,{animate:{scale:[1,1.2,1],rotate:[0,-180,-360]},transition:{duration:2,repeat:1/0,delay:.5},className:"absolute bottom-0 left-1/3 text-xl",children:e.jsx(je,{size:20,className:"text-rose-400"})})]}),e.jsx(p.h2,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3},className:"text-3xl font-bold text-[#0a1628] mb-2",children:s>=90?"Perfect!":s>=80?"Excellent Job!":s>=70?"Great Work!":s>=60?"Good Effort!":"Keep Practicing!"}),e.jsxs(p.p,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.4},className:"text-[#5a6578] mb-6 font-medium",children:["You answered ",$," out of ",i.length," questions correctly"]}),e.jsxs(p.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.5},className:"grid grid-cols-2 gap-3 mb-5",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50 to-indigo-100 rounded-2xl p-4 border-2 border-sky-200",children:[e.jsx("div",{className:"flex items-center justify-center mb-1",children:e.jsx(Z,{className:"text-sky-600",size:20})}),e.jsx("p",{className:"text-[10px] text-sky-600 font-bold uppercase mb-1 tracking-wider",children:"Accuracy"}),e.jsxs("p",{className:"text-3xl font-black text-sky-700",children:[s,"%"]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-orange-50 to-orange-100 rounded-2xl p-4 border-2 border-orange-200",children:[e.jsx("div",{className:"flex items-center justify-center mb-1",children:e.jsx(Ae,{className:"text-orange-600",size:20})}),e.jsx("p",{className:"text-[10px] text-orange-600 font-bold uppercase mb-1 tracking-wider",children:"Total XP"}),e.jsxs("p",{className:"text-3xl font-black text-orange-600",children:["+",z]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-teal-50 to-teal-100 rounded-2xl p-4 border-2 border-teal-200",children:[e.jsx("div",{className:"flex items-center justify-center mb-1",children:e.jsx(ae,{className:"text-teal-600",size:20})}),e.jsx("p",{className:"text-[10px] text-teal-600 font-bold uppercase mb-1 tracking-wider",children:"Best Streak"}),e.jsxs("p",{className:"text-3xl font-black text-teal-700",children:[o,"x"]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-sky-100 rounded-2xl p-4 border-2 border-sky-200",children:[e.jsx("div",{className:"flex items-center justify-center mb-1",children:e.jsx(re,{className:"text-sky-600",size:20})}),e.jsx("p",{className:"text-[10px] text-sky-600 font-bold uppercase mb-1 tracking-wider",children:"Time"}),e.jsxs("p",{className:"text-3xl font-black text-sky-700",children:[Ve,":",Ge.toString().padStart(2,"0")]})]})]}),e.jsxs(p.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.6},className:"bg-[#edf1f7] rounded-2xl p-4 mb-5 text-left",children:[e.jsxs("h3",{className:"font-bold text-[#0a1628] mb-2 flex items-center gap-2 text-sm",children:[e.jsx(Te,{className:"text-rose-500",size:16}),"XP Breakdown"]}),e.jsxs("div",{className:"space-y-1.5 text-sm",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-[#5a6578] text-xs",children:["Base XP (",W,")"]}),e.jsxs("span",{className:"font-bold text-[#0a1628] text-sm",children:["+",d]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-[#5a6578] text-xs",children:["Score Bonus (",s,"%)"]}),e.jsxs("span",{className:"font-bold text-[#0a1628] text-sm",children:["+",g]})]}),K>0&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-[#5a6578] text-xs",children:"Streak Bonuses"}),e.jsxs("span",{className:"font-bold text-orange-600 text-sm",children:["+",K]})]}),e.jsxs("div",{className:"border-t-2 border-[#dde3eb] pt-1.5 flex justify-between items-center",children:[e.jsx("span",{className:"text-[#0a1628] font-bold text-xs",children:"Total XP Earned"}),e.jsxs("span",{className:"font-black text-orange-600",children:["+",z]})]})]})]}),e.jsx(p.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.7},className:"flex items-center justify-center gap-1.5 mb-6",children:_.map((xe,ee)=>e.jsx(p.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.7+ee*.05},className:`w-7 h-7 rounded-lg flex items-center justify-center ${xe?"bg-teal-500":"bg-red-400"}`,children:xe?e.jsx(me,{className:"text-white",size:14}):e.jsx(G,{className:"text-white",size:14})},ee))}),e.jsx(p.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.8},children:e.jsx(X,{onClick:()=>x(s,z),className:`w-full py-5 rounded-2xl font-bold ${Q.gradient} text-white hover:opacity-90 shadow-xl hover:shadow-2xl transition-all hover:scale-[1.02] active:scale-[0.98]`,children:"Continue Learning"})})]})})]})}return e.jsxs(e.Fragment,{children:[y&&e.jsx(Qe,{}),e.jsx(Y,{children:f&&e.jsx($t,{streak:E})}),e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[#edf1f7] overflow-hidden font-sans",children:[e.jsxs("div",{className:`absolute top-0 left-0 right-0 h-[45vh] ${Q.gradient} rounded-b-[60px] md:rounded-b-[80px] shadow-2xl z-0 overflow-hidden`,children:[e.jsx("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white opacity-5 rounded-full -translate-x-1/2 -translate-y-1/2 blur-2xl"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-80 h-80 bg-white opacity-10 rounded-full translate-x-1/3 translate-y-1/3 blur-3xl"}),e.jsx("div",{className:"absolute top-1/4 right-1/4 w-32 h-32 bg-white opacity-5 rounded-full blur-xl"}),e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[J.map((s,d)=>e.jsx("div",{className:"absolute text-white/10 animate-pulse",style:{top:`${10+d*15}%`,left:`${10+d*25%80}%`,animationDuration:`${3+d}s`,transform:`rotate(${d*45}deg) scale(${1+d%3*.2})`},children:e.jsx(s,{size:48+d%2*32})},d)),e.jsx("div",{className:"absolute -bottom-10 -left-10 text-white/5 rotate-12",children:e.jsx(w,{size:200})})]})]}),e.jsxs("header",{className:"relative z-[60] h-20 flex items-center justify-between px-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx("button",{onClick:r,className:"w-10 h-10 rounded-xl bg-white/20 backdrop-blur-md flex items-center justify-center text-white hover:bg-white/30 transition-all border border-slate-300 hover:scale-110 active:scale-95",children:e.jsx(G,{size:20})}),e.jsxs("div",{className:"text-white",children:[e.jsx("h1",{className:"font-bold text-lg leading-tight",children:O}),e.jsxs("div",{className:"flex items-center gap-2 opacity-80 text-xs font-medium uppercase tracking-wide",children:[e.jsx("span",{children:W}),e.jsx("span",{className:"w-1 h-1 bg-white rounded-full"}),e.jsxs("span",{children:["Question ",n+1,"/",i.length]})]})]})]}),e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs(p.div,{animate:E>=3?{scale:[1,1.1,1]}:{},transition:{duration:.5,repeat:E>=3?1/0:0},className:"flex items-center gap-2 bg-black/20 backdrop-blur-md px-3 py-1.5 rounded-full border border-slate-300",children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white shadow-sm ${E>=3?"bg-gradient-to-r from-orange-500 to-red-500":"bg-orange-500"}`,children:e.jsx(ae,{size:14,fill:"currentColor"})}),e.jsx("span",{className:"text-sm font-bold text-white",children:E})]})})]}),e.jsxs("main",{className:"relative z-10 flex-1 flex flex-col items-center justify-start px-4 sm:px-6 xl:px-10 pb-8 pt-4 md:pt-8 overflow-y-auto",children:[e.jsxs("div",{className:"w-full max-w-md mb-8 px-2",children:[e.jsxs("div",{className:"flex justify-between text-[10px] font-bold text-white/80 mb-2 uppercase tracking-wider",children:[e.jsx("span",{children:"Progress"}),e.jsxs("span",{children:[Math.round(n/i.length*100),"%"]})]}),e.jsx("div",{className:"h-2 w-full bg-black/20 rounded-full overflow-hidden backdrop-blur-sm",children:e.jsx(p.div,{initial:{width:0},animate:{width:`${n/i.length*100}%`},transition:{duration:.5,ease:"easeOut"},className:"h-full bg-white rounded-full shadow-[0_0_10px_rgba(255,255,255,0.5)]"})})]}),n===Math.floor(i.length/2)&&n>0&&e.jsxs(p.div,{initial:{scale:0,y:20},animate:{scale:1,y:0},className:"mb-4 bg-white/20 backdrop-blur-md text-white px-6 py-3 rounded-2xl font-bold shadow-lg",children:[e.jsx(Z,{size:20,className:"inline mr-2 text-white"}),"Halfway there! Keep it up!"]}),e.jsx(Y,{mode:"wait",children:e.jsxs(p.div,{initial:{opacity:0,x:100},animate:{opacity:1,x:0},exit:{opacity:0,x:-100},transition:{type:"spring",stiffness:300,damping:30},className:"w-full max-w-3xl",children:[e.jsxs("div",{className:"bg-white rounded-[40px] shadow-[0_20px_60px_-15px_rgba(0,0,0,0.2)] overflow-hidden border border-[#dde3eb] min-h-[450px] flex flex-col relative",children:[e.jsxs("div",{className:"p-8 md:p-12 flex-1 flex flex-col items-center justify-center text-center",children:[e.jsx("span",{className:`inline-block px-4 py-1.5 ${Q.bgLight} ${Q.text} rounded-full text-[11px] font-black mb-8 uppercase tracking-widest border ${Q.border}`,children:C.type==="multiple-choice"?"Multiple Choice":C.type==="true-false"?"True or False":"Fill in the Blank"}),e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-[#0a1628] leading-snug max-w-2xl",children:C.question})]}),e.jsxs("div",{className:"p-6 md:p-10 bg-[#edf1f7]/80 backdrop-blur-sm border-t border-[#dde3eb]",children:[(C.type==="multiple-choice"||C.type==="true-false")&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(C.type==="true-false"?["True","False"]:u).map((s,d)=>{let g="hover:border-[#dde3eb] hover:shadow-lg bg-white border-[#dde3eb] text-[#5a6578] shadow-sm";return N?s===C.correctAnswer?g="bg-teal-50 border-teal-500 text-teal-700 shadow-teal-100 ring-2 ring-teal-200":s===c?g="bg-red-50 border-red-500 text-red-700 shadow-red-100 ring-2 ring-red-200":g="bg-[#edf1f7] border-[#dde3eb] text-slate-500 opacity-60 scale-[0.98]":c===s&&(g=`${Q.bgLight} ${Q.border} ${Q.text} ring-2 ring-indigo-100 shadow-md scale-[1.02] z-10`),e.jsxs(p.button,{disabled:N,onClick:()=>S(s),whileHover:N?{}:{scale:1.02},whileTap:N?{}:{scale:.98},className:` - relative p-6 rounded-2xl border-2 font-bold text-lg transition-all duration-200 text-left flex items-center justify-between group - ${g} - `,children:[e.jsx("span",{className:"relative z-10",children:s}),N&&s===C.correctAnswer&&e.jsx(p.div,{initial:{scale:0},animate:{scale:1},className:"bg-teal-100 p-1 rounded-full",children:e.jsx(me,{size:18,className:"text-teal-600"})}),N&&s===c&&s!==C.correctAnswer&&e.jsx(p.div,{initial:{scale:0},animate:{scale:1},className:"bg-red-100 p-1 rounded-full",children:e.jsx(G,{size:18,className:"text-red-600"})}),!N&&e.jsx("div",{className:`w-6 h-6 rounded-full border-2 border-[#dde3eb] group-hover:border-[#dde3eb] transition-colors ${c===s?`bg-current border-current ${Q.text}`:""}`})]},d)})}),N&&e.jsxs(p.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"space-y-3 mt-6",children:[!A&&c&&c!==C.correctAnswer&&e.jsx("div",{className:"bg-red-50 border-2 border-red-200 rounded-2xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx(G,{size:18,className:"text-red-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-red-700 mb-1",children:"Not quite"}),e.jsx("p",{className:"text-red-800 text-sm leading-relaxed",children:C.optionExplanations?.[c]||`${c} is not the correct answer. Review the concept and try again.`})]})]})}),e.jsx("div",{className:"bg-teal-50 border-2 border-teal-200 rounded-2xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx(me,{size:18,className:"text-teal-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-teal-700 mb-1",children:A?"That's right!":"Right answer"}),e.jsx("p",{className:"text-teal-800 text-sm leading-relaxed",children:C.explanation||C.optionExplanations?.[C.correctAnswer]||`${C.correctAnswer} is the correct answer.`})]})]})})]})]}),C.type==="fill-in-blank"&&e.jsxs("div",{className:"max-w-md mx-auto",children:[e.jsxs("div",{className:"relative group",children:[e.jsx(Oe,{disabled:N,value:L,onChange:s=>v(s.target.value),placeholder:"Type your answer here...",className:` - py-8 px-6 text-xl rounded-2xl border-2 font-bold transition-all text-center placeholder:font-medium placeholder:text-slate-500 - ${N?A?"bg-teal-50 border-teal-500 text-teal-800":"bg-red-50 border-red-500 text-red-800":"bg-white border-[#dde3eb] focus:border-indigo-500 focus:ring-4 focus:ring-indigo-100 shadow-sm"} - `}),N&&e.jsx(p.div,{initial:{scale:0},animate:{scale:1},className:"absolute right-4 top-1/2 -translate-y-1/2",children:A?e.jsx("div",{className:"bg-teal-100 p-1.5 rounded-full",children:e.jsx(me,{className:"text-teal-600",size:20})}):e.jsx("div",{className:"bg-red-100 p-1.5 rounded-full",children:e.jsx(G,{className:"text-red-600",size:20})})})]}),N&&!A&&e.jsxs(p.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mt-4 text-center",children:[e.jsx("p",{className:"text-slate-500 text-xs font-bold uppercase tracking-wider mb-1",children:"Correct answer"}),e.jsx("p",{className:"text-teal-600 font-black text-xl",children:C.correctAnswer})]})]})]}),e.jsxs("div",{className:"p-6 border-t border-[#dde3eb] bg-white flex items-center justify-between",children:[e.jsxs(X,{variant:"ghost",size:"sm",className:"text-slate-500 hover:text-[#5a6578] hover:bg-[#edf1f7] rounded-xl",children:[e.jsx(At,{size:16,className:"mr-2"})," Report"]}),N?e.jsxs(X,{onClick:ce,className:`px-10 py-7 rounded-2xl font-bold text-base shadow-xl transition-all flex items-center gap-2 hover:-translate-y-1 ${A?"bg-teal-500 hover:bg-teal-600 text-white shadow-teal-200":"bg-sky-600 hover:bg-sky-700 text-white shadow-sm"}`,children:[n({title:t,sections:[{type:"text",heading:"Introduction",content:`Welcome to this lesson on ${t}. In this lesson, you'll learn the fundamental concepts and practical applications that will build your mathematical foundation.`},{type:"key-point",heading:"Key Concepts",content:"Understanding the core principles is essential for mastering this topic. Pay close attention to the definitions and properties we'll explore."},{type:"video",heading:"Video Lesson",content:"Watch this explanation to understand the concepts visually.",videoUrl:"https://www.youtube.com/embed/dQw4w9WgXcQ"},{type:"example",heading:"Worked Examples",content:"Let's work through some examples to see these concepts in action.",examples:[{problem:"Example Problem 1: Apply the concept to solve this problem.",solution:`Step 1: Identify what we know. -Step 2: Apply the formula or method. -Step 3: Simplify and solve. -Answer: The solution demonstrates how to approach similar problems.`},{problem:"Example Problem 2: A more complex application.",solution:`Step 1: Break down the problem. -Step 2: Use what we learned. -Step 3: Verify our answer. -Answer: This shows the method works for various cases.`}]},{type:"text",heading:"Important Notes",content:`Remember these key points as you practice: -• Always check your work -• Look for patterns -• Practice makes perfect -• Don't hesitate to review if needed`},{type:"practice",heading:"Try It Yourself",content:"Now it's your turn! Try applying what you've learned. You can practice with the exercises at the end of this module."},{type:"text",heading:"Summary",content:`Great job! You've completed the lesson on ${t}. Make sure you understand the key concepts before moving on. Feel free to review this lesson anytime.`}]}),Qt=({lesson:t,onBack:i,onComplete:x,onProgressUpdate:r})=>{const[n,m]=l.useState(0),[c,S]=l.useState(!1),[L,v]=l.useState(0),[N,I]=l.useState(!1);l.useEffect(()=>{m(0),I(!1),S(!1),v(0)},[t.id,t.title]);const A=Wt(t.title),j=A.sections.length;l.useEffect(()=>{const h=(n+1)/j*100;v(h),r?.(h)},[n,j,r]);const $=()=>{nh+1):I(!0)},P=()=>{n>0&&m(h=>h-1)},E=h=>{x(void 0,void 0,h)},k=A.sections[n],q=k&&{text:"📝",example:"📎",video:"🎬","key-point":"💡",practice:"✍️"}[k.type]||"📘";return e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[radial-gradient(circle_at_top_left,#f8fbff_0%,#eef4ff_40%,#f8f4ff_100%)] overflow-hidden",children:[e.jsx("header",{className:"flex-none bg-white/90 backdrop-blur-md border-b border-[#dde3eb] px-6 sm:px-10 lg:px-16 py-4 shadow-sm relative z-40",children:e.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:i,className:"w-10 h-10 rounded-xl bg-[#edf1f7] hover:bg-[#dde3eb] flex items-center justify-center text-[#5a6578] transition-all hover:scale-110",children:e.jsx(Ne,{size:20})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-[#5a6578] font-medium mb-1 uppercase tracking-wider",children:[e.jsx(U,{size:14}),e.jsx("span",{children:"Notebook Lesson"})]}),e.jsx("h1",{className:"font-bold text-lg text-[#0a1628]",children:A.title})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"text-right mr-3",children:[e.jsx("p",{className:"text-xs text-[#5a6578] font-medium",children:"Progress"}),e.jsxs("p",{className:"text-sm font-bold text-[#0a1628]",children:[Math.round(L),"%"]})]}),e.jsx("div",{className:"w-32 h-2 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx(p.div,{className:"h-full bg-gradient-to-r from-teal-500 to-emerald-500 rounded-full",initial:{width:0},animate:{width:`${L}%`},transition:{duration:.3}})})]})]})}),e.jsx("main",{className:"flex-1 overflow-y-auto px-6 sm:px-10 lg:px-16 py-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx(Y,{mode:"wait",children:e.jsxs(p.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{duration:.3},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-[#5a6578] font-medium mb-2",children:e.jsxs("span",{children:["Section ",n+1," of ",j]})}),k.heading&&e.jsxs("h2",{className:"text-3xl font-black text-[#0a1628] mb-4 tracking-tight flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl","aria-hidden":"true",children:q}),e.jsx("span",{children:k.heading})]})]}),e.jsxs("div",{className:"relative bg-white rounded-3xl p-8 shadow-lg border border-[#dde3eb] min-h-[500px] overflow-hidden",children:[e.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/70 pointer-events-none"}),e.jsx("div",{className:"absolute left-[56px] top-0 bottom-0 w-px bg-rose-100/60 pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-60",style:{backgroundImage:"repeating-linear-gradient(transparent, transparent 37px, #e9eef8 37px, #e9eef8 38px)"}}),e.jsxs("div",{className:"relative z-10 pl-8 md:pl-12",children:[k.type==="text"&&e.jsx("div",{className:"prose prose-slate max-w-none",children:e.jsx("p",{className:"text-lg text-[#0a1628] leading-relaxed whitespace-pre-line",children:k.content})}),k.type==="key-point"&&e.jsx("div",{className:"bg-gradient-to-br from-rose-50 to-orange-50 rounded-2xl p-6 border-2 border-rose-200",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-rose-500 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(Pe,{size:24,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-rose-900 mb-2 text-lg",children:"Important!"}),e.jsx("p",{className:"text-rose-800 leading-relaxed",children:k.content})]})]})}),k.type==="video"&&e.jsxs("div",{children:[e.jsx("div",{className:"bg-slate-900 rounded-2xl overflow-hidden mb-4 aspect-video flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-white/10 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(Re,{size:32,className:"text-white ml-1"})}),e.jsx("p",{className:"text-white/70 text-sm",children:"Video content would be embedded here"}),e.jsx("p",{className:"text-white/50 text-xs mt-2",children:"In production, this would show actual video lessons"})]})}),e.jsx("p",{className:"text-[#5a6578]",children:k.content})]}),k.type==="example"&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[#0a1628] mb-6",children:k.content}),e.jsx("div",{className:"space-y-4",children:k.examples?.map((h,B)=>e.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 rounded-2xl p-6 border-2 border-sky-200",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-sky-500 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(pe,{size:18,className:"text-white"})}),e.jsx("div",{className:"flex-1",children:e.jsx("h4",{className:"font-bold text-sky-900 mb-2",children:h.problem})})]}),e.jsxs("div",{className:"ml-11 bg-white/60 rounded-xl p-4 border border-sky-100",children:[e.jsx("p",{className:"text-sm font-bold text-sky-700 mb-2",children:"Solution:"}),e.jsx("p",{className:"text-[#0a1628] whitespace-pre-line text-sm leading-relaxed",children:h.solution})]})]},B))})]}),k.type==="practice"&&e.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 rounded-2xl p-8 border-2 border-sky-200 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-sky-500 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(se,{size:32,className:"text-white"})}),e.jsx("h3",{className:"text-2xl font-bold text-sky-900 mb-3",children:k.heading}),e.jsx("p",{className:"text-sky-800 text-lg mb-6",children:k.content}),e.jsx("div",{className:"bg-white/60 rounded-xl p-4 inline-block",children:e.jsxs("p",{className:"text-sm text-sky-700",children:[e.jsx(Pe,{size:14,className:"inline mr-1 -mt-0.5"}),e.jsx("strong",{children:"Tip:"})," Complete the practice quizzes after this lesson to reinforce your learning!"]})})]})]})]})]},n)}),e.jsx("div",{className:"flex items-center justify-center gap-2 mt-8 mb-4",children:A.sections.map((h,B)=>e.jsx("button",{onClick:()=>m(B),className:`h-2 rounded-full transition-all ${B===n?"w-8 bg-teal-500":BE(!0),className:"w-full py-3.5 rounded-xl font-bold text-[15px] bg-gradient-to-r from-teal-500 to-emerald-500 text-white hover:shadow-lg hover:shadow-teal-500/25 hover:-translate-y-0.5 transition-all outline-none",children:"Continue to Next Lesson"}),e.jsx("button",{onClick:()=>E(!1),className:"w-full py-3.5 rounded-xl font-bold text-[15px] bg-slate-100 text-slate-600 hover:bg-slate-200 hover:text-slate-700 transition-all outline-none",children:"Back to Modules"})]})]})})]})},te={"gm-1":[{id:1,type:"multiple-choice",question:"Which statement best describes a function?",options:["Each input has exactly one output","Each output has exactly one input","Inputs and outputs must be equal","A function is always linear"],correctAnswer:"Each input has exactly one output",explanation:"A relation is a function when every input is paired with only one output value.",optionExplanations:{"Each input has exactly one output":"Correct. This is the defining condition of a function.","Each output has exactly one input":"Not required. Different inputs can share the same output.","Inputs and outputs must be equal":"Functions can map inputs to different values.","A function is always linear":"Many functions are nonlinear."}},{id:2,type:"multiple-choice",question:"If f(x) = 2x + 3, what is f(4)?",options:["8","11","10","5"],correctAnswer:"11",explanation:"Substitute x = 4. f(4) = 2(4) + 3 = 11.",optionExplanations:{8:"This is 2x only. Add 3 as well.",11:"Correct. 2(4)+3 = 11.",10:"Check substitution carefully.",5:"This would come from a different expression."}},{id:3,type:"fill-in-blank",question:"For f(x) = x^2, the range is y ___ 0 (answer with >= or >).",correctAnswer:">=",explanation:"Squares are never negative, and 0 is included when x = 0."},{id:4,type:"multiple-choice",question:"If f(x) = x - 5 and g(x) = x^2, what is (g o f)(x)?",options:["x^2 - 5","(x - 5)^2","x^2 + 5","2x - 5"],correctAnswer:"(x - 5)^2",explanation:"Compose by substituting f(x) into g. g(f(x)) = g(x-5) = (x-5)^2.",optionExplanations:{"x^2 - 5":"This is not the result of composition.","(x - 5)^2":"Correct. Substitute x-5 into g(x)=x^2.","x^2 + 5":"Incorrect sign and operation.","2x - 5":"This is linear, but g(x) is quadratic."}},{id:5,type:"true-false",question:"A one-to-one function always has an inverse that is also a function.",correctAnswer:"True",explanation:"One-to-one functions pass the horizontal line test, which guarantees an inverse function.",optionExplanations:{True:"Correct. One-to-one is the key condition for inverses to be functions.",False:"If a function is one-to-one, its inverse relation is a function."}},{id:6,type:"multiple-choice",question:"Which parent graph has a horizontal asymptote at y = 0?",options:["y = log(x)","y = x^2","y = 2^x","y = x + 1"],correctAnswer:"y = 2^x",explanation:"Basic exponential functions approach y = 0 but never reach it.",optionExplanations:{"y = log(x)":"Logarithmic functions have a vertical asymptote at x = 0.","y = x^2":"Parabolas have no horizontal asymptote.","y = 2^x":"Correct. Exponential graphs approach y = 0.","y = x + 1":"Linear functions do not have asymptotes."}}],"gm-2":[{id:1,type:"multiple-choice",question:"What is the simple interest on Php 8,000 at 6% per year for 2 years?",options:["Php 480","Php 960","Php 1,200","Php 1,600"],correctAnswer:"Php 960",explanation:"Simple interest I = Prt = 8000(0.06)(2) = 960.",optionExplanations:{"Php 480":"That is one year of interest only.","Php 960":"Correct. Multiply principal, rate, and time.","Php 1,200":"Check the rate and time values.","Php 1,600":"This overstates the computed interest."}},{id:2,type:"multiple-choice",question:"Which formula gives compound amount after t periods?",options:["A = P(1 + rt)","A = P(1 + r)^t","A = P - rt","A = Prt"],correctAnswer:"A = P(1 + r)^t",explanation:"Compound growth multiplies by (1 + r) each period.",optionExplanations:{"A = P(1 + rt)":"This is the simple interest amount form.","A = P(1 + r)^t":"Correct. This is the standard compound amount formula.","A = P - rt":"This is not an amount model.","A = Prt":"This computes simple interest, not total compound amount."}},{id:3,type:"fill-in-blank",question:"If the future value is 12,000 and discount rate is 20%, present value is ___",correctAnswer:"10000",explanation:"Present value PV = FV/(1+r) = 12000/1.2 = 10000."},{id:4,type:"true-false",question:"A general annuity has payment interval different from the compounding interval.",correctAnswer:"True",explanation:"That mismatch between payment and conversion periods defines a general annuity.",optionExplanations:{True:"Correct. Different intervals make it a general annuity.",False:"Matching intervals correspond to a simple annuity."}},{id:5,type:"multiple-choice",question:"In an amortization schedule, each regular payment is split into:",options:["Tax and insurance","Principal and interest","Deposit and withdrawal","Discount and markup"],correctAnswer:"Principal and interest",explanation:"Loan payments reduce outstanding principal and cover interest charges.",optionExplanations:{"Tax and insurance":"These may appear in housing payments, but are not the core loan split.","Principal and interest":"Correct. This is the fundamental breakdown.","Deposit and withdrawal":"These terms describe bank account activity, not amortization.","Discount and markup":"These are pricing terms, not amortization terms."}},{id:6,type:"multiple-choice",question:"Which statement is true about a stock market index?",options:["It guarantees profit","It tracks performance of a selected group of stocks","It sets loan interest rates","It replaces bond yields"],correctAnswer:"It tracks performance of a selected group of stocks",explanation:"An index is a benchmark that summarizes how a basket of stocks performs.",optionExplanations:{"It guarantees profit":"No index can guarantee returns.","It tracks performance of a selected group of stocks":"Correct. That is the purpose of an index.","It sets loan interest rates":"Loan rates are set by lenders and market conditions, not indexes directly.","It replaces bond yields":"Bond yields and stock indexes measure different markets."}}],"gm-3":[{id:1,type:"multiple-choice",question:"Which of the following is a proposition?",options:["Open the door.","x + 5 = 12","Manila is in the Philippines.","How are you?"],correctAnswer:"Manila is in the Philippines.",explanation:"A proposition is a declarative statement that is either true or false.",optionExplanations:{"Open the door.":"This is a command, not a proposition.","x + 5 = 12":"Without a value for x, this is an open sentence.","Manila is in the Philippines.":"Correct. This statement has a definite truth value.","How are you?":"This is a question, not a proposition."}},{id:2,type:"true-false",question:"If p is true and q is false, then p AND q is false.",correctAnswer:"True",explanation:"A conjunction p AND q is true only when both p and q are true.",optionExplanations:{True:"Correct. One false part makes the conjunction false.",False:"Conjunction requires both components to be true."}},{id:3,type:"multiple-choice",question:'What is the negation of the statement: "All students passed"?',options:["No student passed","At least one student did not pass","Some students passed","All students did not pass"],correctAnswer:"At least one student did not pass",explanation:'Negating "all" gives "there exists at least one" that does not satisfy the statement.',optionExplanations:{"No student passed":"This is stronger than the logical negation.","At least one student did not pass":"Correct. This is the precise negation.","Some students passed":"This can still be true with the original statement.","All students did not pass":'This is not equivalent to the negation of "all passed".'}},{id:4,type:"fill-in-blank",question:'In logic, "if p then q" is written as p ___ q',correctAnswer:"->",explanation:"The conditional symbol is arrow, often typed as ->."},{id:5,type:"multiple-choice",question:"Which argument form is valid?",options:["If p then q; q; therefore p","If p then q; p; therefore q","p OR q; p; therefore not q","If p then q; not p; therefore not q"],correctAnswer:"If p then q; p; therefore q",explanation:"This is modus ponens, a valid argument form.",optionExplanations:{"If p then q; q; therefore p":"This is affirming the consequent, invalid.","If p then q; p; therefore q":"Correct. This is modus ponens.","p OR q; p; therefore not q":"From inclusive OR, not q does not follow.","If p then q; not p; therefore not q":"This is denying the antecedent, invalid."}},{id:6,type:"multiple-choice",question:"A tautology is a proposition that is:",options:["Always true","Always false","True only when p is true","Undefined"],correctAnswer:"Always true",explanation:"A tautology evaluates to true for all possible truth assignments.",optionExplanations:{"Always true":"Correct. This is the definition of tautology.","Always false":"That describes a contradiction.","True only when p is true":"That depends on p and is not always true.",Undefined:"Tautologies are fully defined and always true."}}],"gm-4":[{id:1,type:"multiple-choice",question:"Solve for x: 2x + 4 = 10",options:["x = 3","x = 2","x = 6","x = 4"],correctAnswer:"x = 3",explanation:"Subtract 4: 2x = 6. Divide by 2: x = 3.",optionExplanations:{"x = 3":"Correct! 2(3)+4 = 10.","x = 2":"2(2)+4 = 8, not 10.","x = 6":"You may have forgotten to divide by 2.","x = 4":"2(4)+4 = 12, not 10."}},{id:2,type:"fill-in-blank",question:"Simplify: 3(x + 2) = ___",correctAnswer:"3x + 6",explanation:"Distribute: 3·x + 3·2 = 3x + 6."},{id:3,type:"true-false",question:"The expression 5x − 3x simplifies to 2x.",correctAnswer:"True",explanation:"Combine like terms: 5x − 3x = 2x.",optionExplanations:{True:"Correct! Subtracting coefficients: 5−3 = 2.",False:"5x and 3x are like terms and can be combined."}},{id:4,type:"multiple-choice",question:"What is the slope-intercept form of a linear equation?",options:["ax + by = c","y = mx + b","x = my + b","y = mx − b"],correctAnswer:"y = mx + b",explanation:"Slope-intercept form is y = mx + b, where m is slope and b is y-intercept.",optionExplanations:{"ax + by = c":"This is standard form.","y = mx + b":"Correct! m = slope, b = y-intercept.","x = my + b":"x and y are reversed.","y = mx − b":"The intercept should be + b."}},{id:5,type:"multiple-choice",question:"If f(x) = 3x + 2, what is f(4)?",options:["10","12","14","16"],correctAnswer:"14",explanation:"f(4) = 3(4) + 2 = 12 + 2 = 14.",optionExplanations:{10:"Check: 3(4)+2 = 14, not 10.",12:"You forgot to add 2. 3(4) = 12, then +2 = 14.",14:"Correct! 3(4)+2 = 14.",16:"Check your multiplication: 3×4 = 12, not 14."}}],"gm-5":[{id:1,type:"multiple-choice",question:"What is the sum of interior angles in a triangle?",options:["90°","180°","270°","360°"],correctAnswer:"180°",explanation:"The sum of interior angles in any triangle is always 180°.",optionExplanations:{"90°":"That is a right angle, not the sum of all angles.","180°":"Correct! All triangle angles sum to 180°.","270°":"This is the sum for a different shape.","360°":"This is the sum for a quadrilateral."}},{id:2,type:"fill-in-blank",question:"The area of a rectangle with length 8 and width 5 is ___",correctAnswer:"40",explanation:"Area = length × width = 8 × 5 = 40."},{id:3,type:"true-false",question:"A square is a special type of rectangle.",correctAnswer:"True",explanation:"A square has four right angles and opposite sides equal, meeting all rectangle criteria.",optionExplanations:{True:"Correct! A square is a rectangle with all sides equal.",False:"A square satisfies all properties of a rectangle."}},{id:4,type:"multiple-choice",question:"What is the circumference of a circle with radius 7? (Use π ≈ 22/7)",options:["22","44","154","14"],correctAnswer:"44",explanation:"C = 2πr = 2 × 22/7 × 7 = 44.",optionExplanations:{22:"This is πr, not 2πr.",44:"Correct! 2 × 22/7 × 7 = 44.",154:"This is the area (πr²), not circumference.",14:"This is the diameter (2r)."}},{id:5,type:"multiple-choice",question:"How many sides does a hexagon have?",options:["5","6","7","8"],correctAnswer:"6",explanation:'A hexagon has 6 sides. The prefix "hex" means 6.',optionExplanations:{5:"That is a pentagon.",6:"Correct! Hexagon = 6 sides.",7:"That is a heptagon.",8:"That is an octagon."}}],"gm-6":[{id:1,type:"multiple-choice",question:"If A = {1,2,3} and B = {2,3,4}, what is A ∩ B?",options:["{1,2,3,4}","{2,3}","{1,4}","{1}"],correctAnswer:"{2,3}",explanation:"A ∩ B (intersection) contains elements common to both: {2,3}.",optionExplanations:{"{1,2,3,4}":"That is A ∪ B (union).","{2,3}":"Correct! The intersection has shared elements.","{1,4}":"These elements are only in one set each.","{1}":"1 is only in A, not in both."}},{id:2,type:"true-false",question:"The empty set is a subset of every set.",correctAnswer:"True",explanation:"By definition, the empty set ∅ is a subset of every set.",optionExplanations:{True:"Correct! ∅ ⊆ A for any set A.",False:"The empty set is indeed a subset of every set by definition."}},{id:3,type:"fill-in-blank",question:"If A = {a, b, c}, the number of elements |A| = ___",correctAnswer:"3",explanation:"The cardinality |A| counts the elements: a, b, c → 3."},{id:4,type:"multiple-choice",question:"What does A ∪ B represent?",options:["Elements in both A and B","Elements in A or B or both","Elements in A but not B","Elements not in A"],correctAnswer:"Elements in A or B or both",explanation:"Union (∪) combines all elements from both sets.",optionExplanations:{"Elements in both A and B":"That describes intersection (∩).","Elements in A or B or both":"Correct! Union includes all elements.","Elements in A but not B":"That describes set difference A−B.","Elements not in A":"That describes the complement of A."}},{id:5,type:"multiple-choice",question:'Which logical connective represents "and"?',options:["∨","∧","¬","→"],correctAnswer:"∧",explanation:"∧ is the logical AND connective.",optionExplanations:{"∨":"∨ means OR.","∧":"Correct! ∧ means AND.","¬":"¬ means NOT.","→":"→ means IMPLIES."}}],"pc-1":[{id:1,type:"multiple-choice",question:"If f(x) = x² + 1, what is f(3)?",options:["7","9","10","12"],correctAnswer:"10",explanation:"f(3) = 3² + 1 = 9 + 1 = 10.",optionExplanations:{7:"Check: 3²+1 = 10.",9:"You forgot to add 1.",10:"Correct! 9+1 = 10.",12:"Check your calculation."}},{id:2,type:"true-false",question:"Every function is a relation, but not every relation is a function.",correctAnswer:"True",explanation:"A function is a special relation where each input has exactly one output.",optionExplanations:{True:"Correct! Functions are a subset of relations.",False:"Functions require unique outputs for each input, making them a special type of relation."}},{id:3,type:"fill-in-blank",question:"The domain of f(x) = 1/x excludes x = ___",correctAnswer:"0",explanation:"Division by zero is undefined, so x = 0 is excluded."},{id:4,type:"multiple-choice",question:"What is the range of f(x) = x²?",options:["All real numbers","x ≥ 0","y ≥ 0","y > 0"],correctAnswer:"y ≥ 0",explanation:"x² is always non-negative, so the range is y ≥ 0.",optionExplanations:{"All real numbers":"x² can never be negative.","x ≥ 0":"This describes the domain restriction, not the range.","y ≥ 0":"Correct! Squares are always ≥ 0.","y > 0":"f(0) = 0, so y = 0 is included."}},{id:5,type:"multiple-choice",question:"If f(x) = 2x and g(x) = x+3, what is (f∘g)(x)?",options:["2x+3","2x+6","2(x+3)","Both B and C"],correctAnswer:"Both B and C",explanation:"f(g(x)) = f(x+3) = 2(x+3) = 2x+6. Both B and C are equivalent.",optionExplanations:{"2x+3":"This adds 3 after multiplying. The correct order is f(g(x)) = 2(x+3).","2x+6":"Correct form! 2(x+3) = 2x+6.","2(x+3)":"Correct form! This equals 2x+6.","Both B and C":"Correct! 2(x+3) and 2x+6 are equivalent."}}],bc:[{id:1,type:"multiple-choice",question:"What is the derivative of x²?",options:["2x","x","2","x²"],correctAnswer:"2x",explanation:"Using the power rule d/dx[xⁿ] = nxⁿ⁻¹: derivative of x² is 2x.",optionExplanations:{"2x":"Correct! Power rule: 2x²⁻¹ = 2x.",x:"This would be the derivative of x²/2.",2:"The derivative of x² varies with x.","x²":"This is the original function."}},{id:2,type:"true-false",question:"The limit of a function always exists at every point.",correctAnswer:"False",explanation:"Limits don't always exist, e.g. lim(x→0) 1/x does not exist.",optionExplanations:{True:"Limits can fail at discontinuities or asymptotes.",False:"Correct! Limits do not always exist."}},{id:3,type:"fill-in-blank",question:"The integral of 2x is ___",correctAnswer:"x²",explanation:"∫2x dx = x² + C."},{id:4,type:"multiple-choice",question:"What is the derivative of sin(x)?",options:["cos(x)","-cos(x)","sin(x)","-sin(x)"],correctAnswer:"cos(x)",explanation:"d/dx[sin(x)] = cos(x).",optionExplanations:{"cos(x)":"Correct!","-cos(x)":"The derivative of sin is positive cos.","sin(x)":"sin is the original, not the derivative.","-sin(x)":"This is the derivative of cos(x)."}},{id:5,type:"multiple-choice",question:"What does the derivative represent geometrically?",options:["Area under the curve","Slope of the tangent line","Y-intercept","Maximum value"],correctAnswer:"Slope of the tangent line",explanation:"The derivative at a point gives the slope of the tangent line at that point.",optionExplanations:{"Area under the curve":"That is the integral.","Slope of the tangent line":"Correct!","Y-intercept":"The y-intercept is f(0).","Maximum value":"Derivatives help find max/min but don't directly give them."}}],sp:[{id:1,type:"multiple-choice",question:"What is the mean of {2, 4, 6, 8, 10}?",options:["4","5","6","8"],correctAnswer:"6",explanation:"Mean = (2+4+6+8+10)/5 = 30/5 = 6.",optionExplanations:{4:"Sum is 30, not 20.",5:"There are 5 numbers but the mean is sum/count = 30/5 = 6.",6:"Correct! 30/5 = 6.",8:"Check the sum: 2+4+6+8+10 = 30."}},{id:2,type:"fill-in-blank",question:"The probability of getting heads on a fair coin flip is ___",correctAnswer:"0.5",explanation:"A fair coin has equal probability: 1/2 = 0.5."},{id:3,type:"true-false",question:"The median of a dataset is always equal to the mean.",correctAnswer:"False",explanation:"Median and mean are equal only in symmetric distributions.",optionExplanations:{True:"They are equal only in perfectly symmetric distributions.",False:"Correct! Skewed data has different mean and median."}},{id:4,type:"multiple-choice",question:"What is the mode of {3, 5, 5, 7, 9}?",options:["3","5","7","9"],correctAnswer:"5",explanation:"Mode is the most frequent value. 5 appears twice.",optionExplanations:{3:"3 appears once.",5:"Correct! 5 appears most frequently (twice).",7:"7 appears once.",9:"9 appears once."}},{id:5,type:"multiple-choice",question:"If P(A) = 0.3, what is P(not A)?",options:["0.3","0.5","0.7","1.0"],correctAnswer:"0.7",explanation:"P(not A) = 1 − P(A) = 1 − 0.3 = 0.7.",optionExplanations:{"0.3":"That is P(A), not its complement.","0.5":"Complements only equal 0.5 when P(A) = 0.5.","0.7":"Correct! 1 − 0.3 = 0.7.","1.0":"1.0 means certain, but A doesn't always not happen."}}]},Dt=(t,i)=>{const x=t.split("-");let r="";if(x.length>=3?r=`${x[0]}-${x[1]}`:x.length===2&&(r=t),te[r])return te[r];const n=x[0],c={gm:"gm-4",pc:"pc-1",bc:"bc",sp:"sp"}[n];return c&&te[c]?te[c]:te["gm-4"]},Rt=({module:t,onBack:i,onEarnXP:x})=>{const[r,n]=l.useState(null),{userProfile:m}=Se(),[c,S]=l.useState(null),L=l.useMemo(()=>{const a=Number(t.id.split("-").pop());return Number.isFinite(a)&&a>0?a:1},[t.id]),v=l.useMemo(()=>ie.find(f=>f.modules.some(b=>b.id===t.id))?.id??null,[t.id]),N=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"],I=l.useMemo(()=>{const f=(v?ie.find(y=>y.id===v):null)?.modules?.findIndex(y=>y.id===t.id)??0,b=f>=0?f:0;return N[b%N.length]},[t.id,v]);l.useEffect(()=>{if(m?.uid)return Ze(m.uid,S)},[m?.uid]);const A=l.useMemo(()=>v?c?.subjects?.[v]?.modulesProgress?.[t.id]??null:null,[t.id,v,c?.subjects]),j=l.useMemo(()=>{const a=A?.lessonsCompleted??[];return new Set(a)},[A?.lessonsCompleted]),$=l.useMemo(()=>{const a=A?.quizzesCompleted??[];return new Set(a)},[A?.quizzesCompleted]),P=A?.lessonsCompleted?.length??t.lessons.filter(a=>a.completed).length,E=A?.quizzesCompleted?.length??t.quizzes.filter(a=>a.completed).length,k=A?.progress??t.progress,o=t.lessons.length+t.quizzes.length,q=P+E;t.lessons.length&&P/t.lessons.length*100,t.quizzes.length&&E/t.quizzes.length*100;const h=(a,f)=>{const b=c?.lessons?.[a]?.progressPercent;return typeof b=="number"&&Number.isFinite(b)?Math.max(0,Math.min(100,b)):f?100:0},B=l.useMemo(()=>{if(!o)return 0;const a=t.lessons.reduce((b,y)=>{const M=j.has(y.id)||y.completed;return b+h(y.id,M)},0),f=E*100;return Math.round((a+f)/o)},[j,E,t.lessons,t.quizzes.length,o,c?.lessons]),u=k>0?k:B;if(r){if(r.type==="lesson")return e.jsx(Qt,{lesson:r.lesson,onBack:()=>n(null),onProgressUpdate:a=>{m?.uid&&Xe(m.uid,r.lesson.id,a),S(f=>{if(!f)return f;const b=r.lesson.id,y=f.lessons?.[b]?.progressPercent,M=typeof y=="number"&&Number.isFinite(y)?y:0,_=Math.max(M,Math.max(0,Math.min(100,a)));return{...f,lessons:{...f.lessons||{},[b]:{...f.lessons?.[b]||{},lessonId:b,progressPercent:_}},updatedAt:new Date}})},onComplete:(a,f,b)=>{const y=Math.max(f||50,50);if(console.log("[LessonComplete] XP Award:",y,"for",r.lesson.title),x?.(y,`Completed "${r.lesson.title}"`),m?.uid&&v&&(async()=>{try{await He(m.uid,v,t.id,r.lesson.id,0,y),await ze(m.uid,v,t.id,t.lessons.length,t.quizzes.length)}catch(M){console.error("[LessonComplete] Failed to persist progress:",M)}})(),b){const M=t.lessons.findIndex(_=>_.id===r.lesson.id);M!==-1&&M0?n({type:"quiz",quiz:t.quizzes[0]}):n(null)}else n(null)}});{const a=Dt(r.quiz.id);return e.jsx(_t,{lesson:{id:parseInt(r.quiz.id.split("-").pop()||"1"),title:r.quiz.title,duration:r.quiz.duration,type:"quiz",completed:r.quiz.completed,locked:r.quiz.locked},questions:a,onBack:()=>n(null),onComplete:(f,b)=>{console.log("[QuizComplete] Score:",f,"totalXP from calculator:",b);const y=b&&b>0?b:Math.max(100,Math.round(f*1.5));console.log("[QuizComplete] Awarding XP:",y),x?.(y,`Scored ${f}% on "${r.quiz.title}"`),m?.uid&&v&&(async()=>{try{await Ue(m.uid,v,t.id,r.quiz.id,f,[],0),await ze(m.uid,v,t.id,t.lessons.length,t.quizzes.length)}catch(M){console.error("[QuizComplete] Failed to persist progress:",M)}})(),n(null)}})}}return e.jsxs("div",{className:"h-full flex flex-col px-4 sm:px-6 xl:px-10 py-6 sm:py-8 lg:overflow-hidden relative",children:[e.jsx("div",{className:"sticky top-0 sm:top-4 z-50 mb-6 xl:mb-8 w-full sm:w-max",children:e.jsxs("button",{onClick:i,className:"flex items-center gap-2 px-4 py-2.5 rounded-full bg-white/80 backdrop-blur-xl border border-slate-200/60 text-slate-600 hover:text-indigo-600 font-bold text-sm tracking-wide transition-all hover:-translate-x-1 shadow-sm hover:shadow-md",children:[e.jsx(Ne,{size:18}),"Back"]})}),e.jsxs(p.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:`relative mb-6 lg:mb-8 rounded-[2rem] ${t.accentColor} shadow-[0_20px_40px_-15px_rgba(0,0,0,0.3)] shrink-0 overflow-hidden`,children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 pointer-events-none z-0"}),e.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 39px, #ffffff 39px, #ffffff 40px), repeating-linear-gradient(90deg, transparent, transparent 39px, #ffffff 39px, #ffffff 40px)"}}),e.jsx("div",{className:"absolute top-0 right-0 w-[400px] h-[400px] bg-sky-500/20 blur-[100px] rounded-full pointer-events-none"}),e.jsxs("div",{className:"relative p-5 sm:p-7 md:p-10 flex flex-col md:flex-row md:items-center justify-between gap-6 md:gap-8",children:[e.jsxs("div",{className:"flex-1 text-white",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-4 md:mb-5",children:[e.jsxs("div",{className:"px-3 py-1 bg-white/10 backdrop-blur-md rounded-full text-[11px] font-black uppercase tracking-widest text-[#f8fafc] border border-white/20 shadow-sm flex items-center gap-1.5",children:[e.jsx(ft,{size:14})," Chapter ",t.id.split("-").pop()||"1"]}),e.jsxs("div",{className:"px-3 py-1 bg-white/10 backdrop-blur-md rounded-full text-[11px] font-black uppercase tracking-widest text-emerald-400 border border-emerald-400/30",children:["Lv ",L]})]}),e.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-display font-black text-white mb-3 md:mb-4 tracking-[-0.02em] leading-tight",children:t.title}),e.jsx("p",{className:"text-slate-300 text-sm md:text-[15px] max-w-2xl font-medium leading-relaxed mb-6 md:mb-8",children:t.description}),e.jsxs("div",{className:"bg-black/20 backdrop-blur-md rounded-2xl p-4 md:p-5 border border-white/10 max-w-xl",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(re,{size:20,className:"text-emerald-400"}),e.jsx("span",{className:"text-[12px] md:text-[13px] font-black text-white uppercase tracking-wider",children:"Module Mastery"})]}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-[12px] md:text-[13px] font-bold text-slate-400 mb-0.5",children:[q,"/",o," steps"]}),e.jsxs("span",{className:"text-xl md:text-2xl font-black text-white shrink-0 leading-none",children:[Math.round(u),"%"]})]})]}),e.jsx("div",{className:"h-3 bg-black/40 rounded-full overflow-hidden shadow-inner ring-1 ring-white/10 p-0.5",children:e.jsx(p.div,{initial:{width:0},animate:{width:`${u}%`},transition:{duration:1.5,ease:"easeOut",delay:.2},className:`h-full rounded-full relative ${u===100?"bg-gradient-to-r from-emerald-400 to-teal-300":t.accentColor}`,children:e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=')] opacity-30 mix-blend-overlay"})})})]})]}),e.jsxs("div",{className:"hidden lg:flex w-48 h-48 bg-white/5 rounded-[2rem] border border-white/10 backdrop-blur-md items-center justify-center transform rotate-[-3deg] shadow-2xl relative group hover:rotate-0 transition-all duration-500 shrink-0",children:[e.jsx("div",{className:`absolute inset-0 opacity-40 rounded-[2rem] ${t.progress===100?"bg-gradient-to-br from-emerald-400 to-teal-600":t.accentColor}`}),u===100?e.jsx(H,{size:80,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}):e.jsx(U,{size:80,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}),e.jsx(p.div,{animate:{y:[-5,5,-5],rotate:[-10,10,-10]},transition:{duration:4,repeat:1/0},className:"absolute top-6 left-6 text-emerald-300 z-20",children:e.jsx(Te,{size:20,fill:"currentColor"})}),e.jsx(p.div,{animate:{y:[5,-5,5],rotate:[10,-10,10]},transition:{duration:3.5,repeat:1/0},className:"absolute bottom-8 right-6 text-sky-300 z-20",children:e.jsx(St,{size:24})})]})]})]}),e.jsxs("div",{className:"flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-8 lg:min-h-0 pb-6 lg:pb-0",children:[e.jsxs("div",{className:"relative flex flex-col bg-[#FAFAFA] rounded-[2rem] border border-slate-200 shadow-sm overflow-hidden lg:h-full",children:[e.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/60 pointer-events-none z-0"}),e.jsx("div",{className:"absolute left-[54px] top-0 bottom-0 w-px bg-rose-100/40 pointer-events-none z-0"}),e.jsxs("div",{className:"px-4 sm:px-6 md:px-8 py-5 md:py-6 border-b border-slate-200/60 bg-white/80 backdrop-blur-sm relative z-10 flex items-center justify-between sticky top-0 shrink-0",children:[e.jsxs("h2",{className:"font-display font-black text-xl md:text-2xl text-slate-800 flex items-center gap-3",children:[e.jsx(U,{size:24,className:"text-sky-500"}),"Study Notes"]}),e.jsx("div",{className:"flex flex-col items-end gap-2",children:e.jsxs("div",{className:"text-xs md:text-sm font-bold bg-sky-100 text-sky-600 px-3 py-1 rounded-full shadow-sm border border-sky-200/50",children:[P,"/",t.lessons.length]})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 md:px-8 py-5 md:py-6 space-y-4 scrollbar-hide relative z-10",style:{backgroundImage:"repeating-linear-gradient(transparent, transparent 31px, #f1f5f9 31px, #f1f5f9 32px)",backgroundAttachment:"local",lineHeight:"32px"},children:[t.lessons.map((a,f)=>{const b=j.has(a.id)||a.completed,y=h(a.id,b);return e.jsxs(p.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:f*.05},onClick:()=>!a.locked&&n({lesson:a,type:"lesson"}),className:`relative bg-transparent rounded-[1.2rem] overflow-visible group transition-all duration-300 ${a.locked?"opacity-60 saturate-50 cursor-not-allowed":(a.completed,"cursor-pointer")}`,children:[e.jsx("div",{className:"absolute top-0 left-4 h-6 w-24 rounded-t-xl bg-[#d8e9ff] border border-[#b7d3ff] border-b-0 shadow-sm"}),e.jsxs("div",{className:`mt-5 rounded-[1.2rem] border p-3 md:p-4 relative overflow-hidden shadow-sm transition-all duration-300 ${a.locked?"border-slate-200 bg-slate-100":b?"border-teal-200 bg-white hover:shadow-md":"border-sky-200 bg-white hover:shadow-md"}`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-2.5 bg-slate-100 rounded-t-[1.2rem]"}),e.jsx(p.div,{className:"absolute top-0 left-0 h-2.5 rounded-t-[1.2rem]",initial:!1,animate:{width:`${y}%`},transition:{duration:.45,ease:"easeOut"},style:{background:`linear-gradient(90deg, ${I}66, ${I})`}}),e.jsxs("div",{className:"flex items-center justify-between relative z-10 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[e.jsx("div",{className:`w-9 h-9 md:w-10 md:h-10 rounded-[10px] flex items-center justify-center shrink-0 shadow-sm ${a.locked?"bg-slate-100 text-slate-400":b?"bg-teal-50 text-teal-600":"bg-sky-50 text-sky-600"}`,children:a.locked?e.jsx(ve,{size:16}):b?e.jsx(wt,{size:16}):e.jsx(Re,{size:16,className:"ml-1"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"text-[10px] md:text-[11px] font-black uppercase tracking-wider text-slate-400 mb-0.5",children:["Lesson ",f+1]}),e.jsx("h3",{className:`font-bold text-[14px] md:text-[15px] leading-tight transition-colors ${a.locked?"text-slate-600":"text-[#0a1628] group-hover:text-sky-600"}`,children:a.title})]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0 ml-3 md:ml-4",children:[y>0&&y<100&&e.jsxs("div",{className:"hidden sm:flex items-center justify-center px-2 py-1 rounded-md text-[11px] font-black",style:{backgroundColor:`${I}1A`,color:I,border:`1px solid ${I}33`},title:"Lesson progress",children:[Math.round(y),"%"]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-slate-400 text-[11px] md:text-xs font-bold bg-slate-50 px-2 py-1 rounded-md",children:[e.jsx(ne,{size:12}),e.jsx("span",{children:a.duration})]})]})]})]})]},a.id)}),e.jsx("div",{className:"h-4 pointer-events-none"})]})]}),e.jsxs("div",{className:"relative flex flex-col bg-white rounded-[2rem] border border-slate-200 shadow-sm overflow-hidden lg:h-full",children:[e.jsx("div",{className:"h-5 bg-slate-200/50 border-b border-slate-200 w-full flex items-center justify-center pointer-events-none sticky top-0 z-20",children:e.jsx("div",{className:"w-16 h-1.5 bg-slate-300 rounded-full"})}),e.jsxs("div",{className:"px-4 sm:px-6 md:px-8 py-4 md:py-5 border-b-2 border-dashed border-slate-200 bg-white relative z-10 flex items-center justify-between sticky top-5 shrink-0",children:[e.jsxs("h2",{className:"font-display font-black text-xl md:text-2xl text-slate-800 flex items-center gap-3",children:[e.jsx(ke,{size:24,className:"text-rose-500"}),"Assessments"]}),e.jsx("div",{className:"flex flex-col items-end gap-2",children:e.jsxs("div",{className:"text-xs md:text-sm font-bold bg-rose-100 text-rose-600 px-3 py-1 rounded-full shadow-sm border border-rose-200/50",children:[E,"/",t.quizzes.length]})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 md:px-8 py-5 md:py-6 space-y-4 md:space-y-5 scrollbar-hide relative z-10",style:{backgroundImage:"radial-gradient(#CBD5E1 1px, transparent 1px)",backgroundSize:"24px 24px",backgroundPosition:"-12px -12px"},children:[t.quizzes.map((a,f)=>{const b=a.locked,y=a.type==="final",M=a.type==="module",_=t.lessons[Math.min(f,Math.max(t.lessons.length-1,0))],D=$.has(a.id)||a.completed;return e.jsx(p.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:(t.lessons.length+f)*.05},onClick:()=>!b&&n({quiz:a,type:"quiz"}),className:`bg-white/90 backdrop-blur-sm rounded-2xl p-4 md:p-5 border-2 relative select-none transition-all duration-300 ${b?"border-slate-200 opacity-60 saturate-50 cursor-not-allowed":D?"border-teal-200 shadow-sm hover:border-teal-300 hover:shadow-md cursor-pointer":y?"border-indigo-200 shadow-sm hover:border-indigo-300 hover:shadow-md cursor-pointer":"border-orange-200 shadow-sm hover:border-orange-300 hover:shadow-md cursor-pointer"} group`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3 md:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[e.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-xl flex items-center justify-center shrink-0 shadow-sm transform group-hover:rotate-3 transition-transform ${b?"bg-slate-100 text-slate-400":D?"bg-teal-500 text-white":y?"bg-indigo-500 text-white":"bg-orange-500 text-white"}`,children:b?e.jsx(ve,{size:18}):D?e.jsx(H,{size:18}):e.jsx(ke,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsx("span",{className:`px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider ${y?"bg-indigo-100 text-indigo-700":M?"bg-orange-100 text-orange-700":"bg-sky-100 text-sky-700"}`,children:y?"Final Exam":M?"Module Task":"Quiz"}),!!_&&e.jsxs("span",{className:"px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider bg-violet-100 text-violet-700",children:["For: ",_.title]}),!b&&!a.completed&&e.jsx("span",{className:"w-1.5 h-1.5 md:w-2 md:h-2 rounded-full bg-rose-500 animate-pulse"})]}),e.jsx("h3",{className:`font-bold text-[14px] md:text-[16px] leading-tight mb-1 md:mb-1.5 transition-colors ${b?"text-slate-600":"text-[#0a1628]"}`,children:a.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-3 text-[11px] md:text-[12px] font-bold text-slate-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(U,{size:12})," ",a.questions," Qs"]}),e.jsx("span",{className:"hidden sm:inline",children:"•"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ne,{size:12})," ",a.duration]})]})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[a.score!==void 0&&D&&e.jsx("div",{className:"text-right",children:e.jsxs("div",{className:"text-xl md:text-2xl font-black text-teal-600 leading-none",children:[a.score,"%"]})}),!b&&e.jsx("div",{className:`px-3 py-1.5 md:px-4 md:py-2 rounded-xl text-[11px] md:text-[12px] font-black uppercase tracking-wider shadow-sm transition-all ${a.completed?"bg-white border border-slate-200 text-slate-600 group-hover:bg-slate-50":"bg-slate-900 text-white group-hover:bg-slate-600"}`,children:a.completed?"Review":"Start"})]})]})},a.id)}),e.jsx("div",{className:"h-4 pointer-events-none"})]})]})]})]})},Vt=({onStartQuiz:t,searchQuery:i="",allowedSubjectIds:x})=>{const{userProfile:r}=Se(),[n,m]=l.useState("all"),[c,S]=l.useState("all"),[L,v]=l.useState(null),N=l.useMemo(()=>!x||x.length===0?ie:ie.filter(o=>x.includes(o.id)),[x]);l.useEffect(()=>{r?.uid&&Ye(r.uid).then(v).catch(console.error)},[r?.uid]),l.useEffect(()=>{if(c==="all")return;N.some(q=>q.title===c)||S("all")},[N,c]);const I=L?.totalQuizzesCompleted||0,A=r?.totalXP||0,j=L?.averageScore?Math.round(L.averageScore):0,$=new Set(L?.quizAttempts?.map(o=>o.quizId)||[]),P={};if(L?.quizAttempts)for(const o of L.quizAttempts)(!P[o.quizId]||o.score>P[o.quizId])&&(P[o.quizId]=o.score);const k=N.flatMap(o=>o.modules.flatMap(q=>q.quizzes.map(h=>({id:h.id,title:h.title,subject:o.title,difficulty:h.type==="module"?"Medium":"Easy",questions:h.questions,duration:h.duration,xpReward:h.questions*5,type:h.type==="module"?"challenge":"practice",completed:$.has(h.id),bestScore:P[h.id],locked:h.locked})))).filter(o=>{const q=n==="all"||o.type===n,h=c==="all"||o.subject===c,B=!i||o.title.toLowerCase().includes(i.toLowerCase())||o.subject.toLowerCase().includes(i.toLowerCase());return q&&h&&B});return e.jsxs("div",{className:"h-full flex flex-col px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#0a1628] mb-2",children:"Practice Center"}),e.jsx("p",{className:"text-[#5a6578]",children:"Sharpen your skills with quizzes, challenges, and mastery tests"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[e.jsxs(p.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-sky-700 to-sky-500 rounded-2xl p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(re,{size:24})}),e.jsx("span",{className:"text-3xl font-bold",children:I})]}),e.jsx("p",{className:"text-sm font-medium text-sky-100",children:"Quizzes Completed"})]}),e.jsxs(p.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-rose-500 to-rose-600 rounded-2xl p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(Ae,{size:24})}),e.jsx("span",{className:"text-3xl font-bold",children:A.toLocaleString()})]}),e.jsx("p",{className:"text-sm font-medium text-cyan-100",children:"Total XP Earned"})]}),e.jsxs(p.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-indigo-600 to-indigo-700 rounded-2xl p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(Z,{size:24})}),e.jsxs("span",{className:"text-3xl font-bold",children:[j,"%"]})]}),e.jsx("p",{className:"text-sm font-medium text-sky-100",children:"Average Score"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-white rounded-xl p-1 shadow-sm",children:[e.jsx("button",{onClick:()=>m("all"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${n==="all"?"bg-sky-600 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"All"}),e.jsx("button",{onClick:()=>m("practice"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${n==="practice"?"bg-sky-500 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"Practice"}),e.jsx("button",{onClick:()=>m("challenge"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${n==="challenge"?"bg-orange-500 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"Challenge"}),e.jsx("button",{onClick:()=>m("mastery"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${n==="mastery"?"bg-sky-500 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"Mastery"})]}),e.jsxs("select",{value:c,onChange:o=>S(o.target.value),className:"px-4 py-2.5 bg-white border-2 border-[#dde3eb] rounded-xl text-sm font-bold text-[#0a1628] focus:border-indigo-600 focus:outline-none",children:[e.jsx("option",{value:"all",children:"All Subjects"}),N.map(o=>e.jsx("option",{value:o.title,children:o.title},o.id))]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto pr-2 pb-4 scrollbar-hide rounded-[2rem] border border-slate-200 shadow-inner relative",style:{backgroundImage:"radial-gradient(#CBD5E1 1px, transparent 1px)",backgroundSize:"24px 24px",backgroundPosition:"-12px -12px",backgroundColor:"#FAFAFA"},children:[e.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/60 pointer-events-none z-0"}),e.jsx("div",{className:"absolute left-[54px] top-0 bottom-0 w-px bg-rose-100/40 pointer-events-none z-0"}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-5 p-4 md:p-6 relative z-10",children:k.map((o,q)=>{const h=o.locked,B=o.difficulty==="Hard",u=o.type==="challenge";return e.jsx(p.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:q*.05},onClick:()=>!h&&t?.(o),className:`bg-white/90 backdrop-blur-sm rounded-2xl p-4 md:p-5 border-2 relative select-none transition-all duration-300 ${h?"border-slate-200 opacity-60 saturate-50 cursor-not-allowed":o.completed?"border-teal-200 shadow-sm hover:border-teal-300 hover:shadow-md cursor-pointer":B?"border-indigo-200 shadow-sm hover:border-indigo-300 hover:shadow-md cursor-pointer":"border-orange-200 shadow-sm hover:border-orange-300 hover:shadow-md cursor-pointer"} group`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3 md:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[e.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-xl flex items-center justify-center shrink-0 shadow-sm transform group-hover:rotate-3 transition-transform ${h?"bg-slate-100 text-slate-400":o.completed?"bg-teal-500 text-white":B?"bg-indigo-500 text-white":"bg-orange-500 text-white"}`,children:h?e.jsx(ve,{size:18}):o.completed?e.jsx(H,{size:18}):e.jsx(ke,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsxs("span",{className:`px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider ${B?"bg-indigo-100 text-indigo-700":u?"bg-orange-100 text-orange-700":"bg-sky-100 text-sky-700"}`,children:[o.type," • ",o.difficulty]}),!h&&!o.completed&&e.jsx("span",{className:"w-1.5 h-1.5 md:w-2 md:h-2 rounded-full bg-rose-500 animate-pulse"})]}),e.jsx("h3",{className:`font-bold text-[14px] md:text-[16px] leading-tight mb-1 md:mb-1.5 transition-colors ${h?"text-slate-600":"text-[#0a1628]"}`,children:o.title}),e.jsx("p",{className:"text-[11px] md:text-[12px] text-slate-500 mb-1.5 line-clamp-1",children:o.subject}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-3 text-[11px] md:text-[12px] font-bold text-slate-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(U,{size:12})," ",o.questions," Qs"]}),e.jsx("span",{className:"hidden sm:inline",children:"•"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ne,{size:12})," ",o.duration]}),e.jsx("span",{className:"hidden sm:inline",children:"•"}),e.jsxs("span",{className:"flex items-center gap-1 text-rose-500",children:[e.jsx(H,{size:12})," +",o.xpReward," XP"]})]})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[o.bestScore!==void 0&&e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:`text-xl md:text-2xl font-black leading-none ${o.bestScore>=80?"text-teal-600":"text-orange-500"}`,children:[o.bestScore,"%"]}),e.jsx("div",{className:"text-[9px] uppercase tracking-wide text-slate-400 font-bold mt-1",children:"Best Score"})]}),!h&&e.jsx("div",{className:`px-3 py-1.5 md:px-4 md:py-2 rounded-xl text-[11px] md:text-[12px] font-black uppercase tracking-wider shadow-sm transition-all ${o.completed?"bg-white border border-slate-200 text-slate-600 group-hover:bg-slate-50":"bg-slate-900 text-white group-hover:bg-slate-600"}`,children:o.completed?"Review":"Start"})]})]})},o.id)})}),k.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-slate-500 relative z-10",children:[e.jsx(Z,{size:48,className:"mb-3"}),e.jsx("p",{className:"font-medium",children:"No quizzes found"}),e.jsx("p",{className:"text-sm",children:"Try adjusting your filters or search query"})]})]})]})};function Gt(t){if(t.questionType==="multiple_choice"&&t.options&&t.options.length>0){const i=t.options.findIndex(x=>x.trim().toLowerCase()===t.correctAnswer.trim().toLowerCase());return{id:t.id,question:t.question,options:t.options,correctAnswer:i>=0?i:0,correctAnswerText:t.correctAnswer,explanation:t.explanation,questionType:t.questionType,points:t.points,difficulty:t.difficulty,topic:t.topic,bloomLevel:t.bloomLevel}}return{id:t.id,question:t.question,options:[],correctAnswer:-1,correctAnswerText:t.correctAnswer,explanation:t.explanation,questionType:t.questionType,points:t.points,difficulty:t.difficulty,topic:t.topic,bloomLevel:t.bloomLevel}}function De(t){return t.replace(/²/g,"^2").replace(/³/g,"^3").replace(/⁻¹/g,"^-1").replace(/⁰/g,"^0").replace(/¹/g,"^1").replace(/⁴/g,"^4").replace(/⁵/g,"^5").replace(/⁶/g,"^6").replace(/⁷/g,"^7").replace(/⁸/g,"^8").replace(/⁹/g,"^9").replace(/π/g,"pi").replace(/√/g,"sqrt").replace(/×/g,"*").replace(/÷/g,"/").replace(/\s+/g,"").toLowerCase().trim()}function Ot(t,i,x){const r=n=>n.trim().toLowerCase().replace(/\s+/g," ");switch(x){case"identification":return r(t)===r(i);case"enumeration":{const n=t.split(",").map(c=>r(c)).filter(Boolean).sort(),m=i.split(",").map(c=>r(c)).filter(Boolean).sort();return JSON.stringify(n)===JSON.stringify(m)}case"word_problem":case"equation_based":{const n=De(t),m=De(i);if(n===m)return!0;const c=parseFloat(t.replace(/[^\d.\-]/g,"")),S=parseFloat(i.replace(/[^\d.\-]/g,""));return!isNaN(c)&&!isNaN(S)?Math.abs(c-S)<=.01:r(t)===r(i)}default:return r(t)===r(i)}}function Zt(t){switch(t){case"identification":return"Type your answer below";case"enumeration":return"List your answers separated by commas";case"word_problem":return"Show your work and type the final answer";case"equation_based":return"Solve the equation and type the result";default:return"Select the correct answer"}}const Ht=({quiz:t,onClose:i,onComplete:x,studentId:r,atRiskSubjects:n=[]})=>{const[m,c]=l.useState(0),[S,L]=l.useState(null),[v,N]=l.useState(""),[I,A]=l.useState(!1),[j,$]=l.useState(!1),[P,E]=l.useState(0),[k,o]=l.useState(0),[q,h]=l.useState(1),[B,u]=l.useState([]),[a,f]=l.useState([]),[b,y]=l.useState(Date.now()),[M,_]=l.useState(!1),[D,oe]=l.useState(0),[K,fe]=l.useState(0),[C,O]=l.useState(!1),[W]=l.useState(()=>t.loadedQuestions&&t.loadedQuestions.length>0?t.loadedQuestions.map(Gt):Array.from({length:t.questions},(w,s)=>({id:`q${s+1}`,question:Xt(t.subject,s),options:Ut(t.subject,s),correctAnswer:Yt(t.subject,s),explanation:Kt(t.subject,s,t.difficulty)}))),T=W[m];l.useEffect(()=>{const w=parseInt(t.duration);oe(w*60);const s=setInterval(()=>{oe(d=>d<=1?(clearInterval(s),le(),0):d-1)},1e3);return()=>clearInterval(s)},[]);const R=w=>{const s=new(window.AudioContext||window.webkitAudioContext),d=s.createOscillator(),g=s.createGain();switch(d.connect(g),g.connect(s.destination),w){case"correct":d.frequency.value=800,g.gain.setValueAtTime(.3,s.currentTime),g.gain.exponentialRampToValueAtTime(.01,s.currentTime+.3),d.start(s.currentTime),d.stop(s.currentTime+.3);break;case"incorrect":d.frequency.value=200,g.gain.setValueAtTime(.3,s.currentTime),g.gain.exponentialRampToValueAtTime(.01,s.currentTime+.2),d.start(s.currentTime),d.stop(s.currentTime+.2);break;case"combo":d.frequency.value=1200,g.gain.setValueAtTime(.2,s.currentTime),g.gain.exponentialRampToValueAtTime(.01,s.currentTime+.4),d.start(s.currentTime),d.stop(s.currentTime+.4);break;case"complete":d.frequency.value=600,g.gain.setValueAtTime(.3,s.currentTime),g.gain.exponentialRampToValueAtTime(.01,s.currentTime+.5),d.start(s.currentTime),d.stop(s.currentTime+.5);break}},le=()=>{_(!0),be()},ce=w=>{j||L(w)},de=()=>{const w=T.questionType!=null&&T.questionType!=="multiple_choice";if(w){if(!v.trim())return}else if(S===null)return;const s=w?Ot(v,T.correctAnswerText||"",T.questionType||""):S===T.correctAnswer,d=[...B];d[m]=w?s?1:0:S,u(d),A(s);const g=Math.round((Date.now()-b)/1e3);if(f(z=>[...z,{questionId:T.id,answer:w?v:String(S),correct:s,timeSpent:g}]),s){R("correct"),E(P+1);const z=k+1;o(z),z>=5?(h(3),R("combo"),Ie({particleCount:50,spread:60,origin:{y:.6}})):z>=3?(h(2),R("combo")):h(1)}else R("incorrect"),o(0),h(1);$(!0)},Q=()=>{m{const w=Math.round(P/W.length*100);let s=t.xpReward;w>=90?s=Math.round(s*1.5):w>=80&&(s=Math.round(s*1.25));const d=parseInt(t.duration)*60;D>d*.5&&(s=Math.round(s*1.2)),fe(s);const g=d-D;r&&rt({lrn:r,quizId:t.id,subject:t.subject,score:w,totalQuestions:W.length,correctAnswers:P,timeSpentSeconds:g}).catch(z=>console.error("[WARN] Automation: quiz pipeline failed:",z)),t.source==="ai_generated"&&r&&it(r,t.id,t.generatedQuizId,t.subject,t.source,w,s,g,a,W.map(z=>({topic:z.topic||t.subject,difficulty:z.difficulty||"medium",bloomLevel:z.bloomLevel||"understand"}))).catch(z=>console.error("[WARN] Quiz result save failed:",z)),R("complete"),Ie({particleCount:100,spread:70,origin:{y:.6}}),setTimeout(()=>{x(w,s)},3e3)},J=w=>{const s=Math.floor(w/60),d=w%60;return`${s}:${d.toString().padStart(2,"0")}`};if(M){const w=Math.round(P/W.length*100),s=w>=70;return e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-6",children:e.jsxs(p.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-3xl shadow-2xl max-w-2xl w-full p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(p.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 ${s?"bg-gradient-to-br from-teal-500 to-emerald-500":"bg-gradient-to-br from-orange-500 to-red-500"}`,children:s?e.jsx(H,{size:48,className:"text-white"}):e.jsx(Z,{size:48,className:"text-white"})}),e.jsx("h2",{className:"text-3xl font-bold font-display text-[#0a1628] mb-2",children:s?"Great Job!":"Keep Practicing!"}),e.jsx("p",{className:"text-[#5a6578]",children:t.title})]}),e.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 rounded-2xl p-6 mb-6",children:[e.jsxs("div",{className:"text-center mb-4",children:[e.jsxs("div",{className:"text-6xl font-bold text-sky-600 mb-2",children:[w,"%"]}),e.jsx("p",{className:"text-[#5a6578]",children:"Final Score"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-xl p-4 text-center",children:[e.jsx(se,{size:24,className:"mx-auto mb-2 text-teal-600"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:P}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Correct"})]}),e.jsxs("div",{className:"bg-white rounded-xl p-4 text-center",children:[e.jsx(Be,{size:24,className:"mx-auto mb-2 text-red-500"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:W.length-P}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Incorrect"})]}),e.jsxs("div",{className:"bg-white rounded-xl p-4 text-center",children:[e.jsx(Ae,{size:24,className:"mx-auto mb-2 text-rose-500"}),e.jsxs("p",{className:"text-2xl font-bold text-[#0a1628]",children:["+",K]}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"XP Earned"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-6",children:[w>=90&&e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-3 flex items-center gap-3",children:[e.jsx(Te,{size:20,className:"text-sky-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-sm text-[#0a1628]",children:"Perfect Score!"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"+50% Bonus XP"})]})]}),D>parseInt(t.duration)*30&&e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-3 flex items-center gap-3",children:[e.jsx(ne,{size:20,className:"text-sky-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-sm text-[#0a1628]",children:"Speed Demon"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"+20% Bonus XP"})]})]}),k>=5&&e.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-xl p-3 flex items-center gap-3",children:[e.jsx(ae,{size:20,className:"text-orange-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-sm text-[#0a1628]",children:"Hot Streak!"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"3x Combo Achieved"})]})]})]}),e.jsx(Le,{variant:"results",quizSubject:t.subject,quizScore:w,atRiskSubjects:n}),e.jsx("button",{onClick:i,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white font-bold py-4 rounded-xl transition-all mt-4",children:"Continue"})]})})}return e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-6",children:e.jsxs(p.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-3xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-6 text-white",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:t.title}),e.jsx("p",{className:"text-cyan-100 text-sm",children:t.subject})]}),e.jsx("button",{onClick:i,className:"w-10 h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",children:e.jsx(G,{size:20})})]}),e.jsx("div",{className:"flex items-center gap-2 mb-3",children:e.jsxs("button",{onClick:()=>O(w=>!w),className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-sm font-semibold transition-all ${C?"bg-sky-400/30 text-white ring-1 ring-sky-300/50":"bg-white/20 hover:bg-white/30 text-cyan-100"}`,title:"Toggle Scientific Calculator",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),e.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"}),e.jsx("line",{x1:"16",x2:"16",y1:"14",y2:"18"}),e.jsx("path",{d:"M16 10h.01"}),e.jsx("path",{d:"M12 10h.01"}),e.jsx("path",{d:"M8 10h.01"}),e.jsx("path",{d:"M12 14h.01"}),e.jsx("path",{d:"M8 14h.01"}),e.jsx("path",{d:"M12 18h.01"}),e.jsx("path",{d:"M8 18h.01"})]}),"Calc"]})}),e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Question ",m+1," of ",W.length]}),e.jsxs("div",{className:"flex items-center gap-4",children:[k>0&&e.jsxs("div",{className:"flex items-center gap-1 bg-orange-500/30 px-3 py-1 rounded-full",children:[e.jsx(ae,{size:16}),e.jsxs("span",{className:"text-sm font-bold",children:[k," Streak"]}),q>1&&e.jsxs("span",{className:"text-xs ml-1",children:["x",q]})]}),e.jsxs("div",{className:"flex items-center gap-1 bg-white/20 px-3 py-1 rounded-full",children:[e.jsx(ne,{size:16}),e.jsx("span",{className:"text-sm font-bold",children:J(D)})]})]})]}),e.jsx("div",{className:"h-2 bg-white/20 rounded-full overflow-hidden",children:e.jsx(p.div,{initial:{width:0},animate:{width:`${(m+1)/W.length*100}%`},className:"h-full bg-white rounded-full"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("div",{className:"bg-white/20 px-3 py-1 rounded-full",children:e.jsxs("span",{className:"text-sm font-bold",children:["Score: ",P,"/",W.length]})})}),e.jsxs("div",{className:"flex items-center gap-2 bg-rose-500/30 px-3 py-1 rounded-full",children:[e.jsx(H,{size:16}),e.jsxs("span",{className:"text-sm font-bold",children:["+",t.xpReward," XP"]})]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-8 relative",children:[e.jsx(Y,{children:C&&e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-6 overflow-hidden",children:e.jsxs("div",{className:"bg-[#edf1f7] rounded-2xl p-4 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] flex items-center gap-1.5",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),e.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"})]}),"Scientific Calculator"]}),e.jsx("button",{onClick:()=>O(!1),className:"text-slate-500 hover:text-[#5a6578] transition-colors",children:e.jsx(G,{size:14})})]}),e.jsx(ot,{isOpen:!0,onClose:()=>O(!1),inline:!0})]})})}),m===0&&e.jsx(Le,{variant:"compact",quizSubject:t.subject,atRiskSubjects:n}),e.jsx(Y,{mode:"wait",children:e.jsxs(p.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-xl font-bold text-[#0a1628] mb-2",children:T.question}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:Zt(T.questionType)})]}),T.questionType&&T.questionType!=="multiple_choice"?e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-3 top-3.5",children:e.jsx(ct,{size:16,className:"text-slate-500"})}),T.questionType==="enumeration"?e.jsx("textarea",{value:v,onChange:w=>N(w.target.value),disabled:j,placeholder:"Type each answer separated by commas…",rows:4,className:`w-full pl-10 pr-4 py-3 rounded-xl border-2 text-sm outline-none transition-all resize-none ${j?I?"bg-teal-50 border-teal-400":"bg-red-50 border-red-400":"border-[#dde3eb] focus:border-sky-500 bg-white"}`}):T.questionType==="equation_based"||T.questionType==="word_problem"?e.jsx(lt,{value:v,onChange:N,placeholder:T.questionType==="equation_based"?"Enter the numerical result…":"Enter your answer…",onCalculatorOpen:()=>O(!0)}):e.jsx("input",{type:"text",value:v,onChange:w=>N(w.target.value),disabled:j,onKeyDown:w=>{w.key==="Enter"&&!j&&de()},placeholder:"Type your answer…",className:`w-full pl-10 pr-4 py-3.5 rounded-xl border-2 text-sm outline-none transition-all ${j?I?"bg-teal-50 border-teal-400":"bg-red-50 border-red-400":"border-[#dde3eb] focus:border-sky-500 bg-white"}`})]}),j&&!I&&e.jsxs("p",{className:"mt-2 text-sm font-semibold text-teal-700",children:["Correct answer: ",T.correctAnswerText]})]}):e.jsx("div",{className:"space-y-3 mb-6",children:T.options.map((w,s)=>{const d=S===s,g=s===T.correctAnswer,z=j;let V="bg-[#edf1f7] hover:bg-[#dde3eb] border-[#dde3eb]";return z?g?V="bg-teal-50 border-teal-500":d&&!g&&(V="bg-red-50 border-red-500"):d&&(V="bg-sky-50 border-sky-500"),e.jsx(p.button,{whileHover:j?{}:{scale:1.01},whileTap:j?{}:{scale:.99},onClick:()=>ce(s),disabled:j,className:`w-full text-left p-4 rounded-xl border-2 transition-all ${V} ${j?"cursor-default":"cursor-pointer"}`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center font-bold ${z&&g?"bg-teal-500 text-white":z&&d&&!g?"bg-red-500 text-white":d?"bg-sky-500 text-white":"bg-white text-[#0a1628]"}`,children:String.fromCharCode(65+s)}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:w}),z&&g&&e.jsx(se,{size:20,className:"ml-auto text-teal-600"}),z&&d&&!g&&e.jsx(Be,{size:20,className:"ml-auto text-red-600"})]})},s)})}),j&&e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`p-4 rounded-xl border-2 ${I?"bg-teal-50 border-teal-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 ${I?"bg-teal-500":"bg-sky-500"}`,children:e.jsx(re,{size:18,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-[#0a1628] mb-1",children:I?"Correct!":"Not quite"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:T.explanation})]})]})})]},m)})]}),e.jsx("div",{className:"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:j?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(he,{size:16}),"Keep going! You're doing great"]}):e.jsx("span",{children:"Select an answer to continue"})}),j?e.jsxs("button",{onClick:Q,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white font-bold px-8 py-3 rounded-xl flex items-center gap-2 transition-all",children:[m -3"],["9","5","7","3"],["1","2","3","1/3"],["12","27","64","81"]],"General Mathematics":[["2x² - 5x - 12","2x² + 5x - 12","2x² - 8x + 12","2x² - 5x + 12"],["36","32","28","24"],["x = 5","x = 4","x = 6","x = 7"],["120","24","60","720"],["3/4","1/2","2/3","4/5"],["90","80","100","72"],["2/3","3/4","4/6","6/9"],["12","6","8","4"],["0.375","0.38","0.35","0.325"],["$32","$28","$30","$36"],["11/12","3/7","5/6","2/3"],["$12","$10","$15","$8"],["3/4","2/3","4/5","9/12"],["1/8","1/4","1/5","1/6"],["150","135","120","160"]],"Statistics and Probability":[["1/6","1/3","1/2","2/3"],["9.4","8.5","10.2","7.8"],["8","9","7","10"],["5/8","3/8","1/2","2/5"],["20","15","25","30"],["5","3","7","8"],["Spread of data from the mean","The highest value","The average","The middle value"],["0.15","0.8","0.35","0.2"],["8.5","7","10","9"],["6","3","9","12"]],"Basic Calculus":[["6x","3x","9x²","6x²"],["4","2","0","undefined"],["x² + C","2x² + C","x²/2 + C","2x + C"],["15x² - 2","15x² - 2x","5x² - 2","15x - 2"],["cos(x)","-cos(x)","tan(x)","-sin(x)"],["eˣ + 3","eˣ + 3x","xeˣ + 3","eˣ"],["sin(x) + C","-sin(x) + C","tan(x) + C","-cos(x) + C"],["1/x","x","ln(x)","-1/x²"],["0","1","∞","undefined"],["4x³ - 4x","4x³ - 2x","x³ - 4x","4x⁴ - 4x²"]]},r=ue(t),n=x[r]||x["General Mathematics"];return n[i%n.length]}function Yt(t,i){const x={"Pre-Calculus":[0,1,0,0,1,0,0,0,2,3],"General Mathematics":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Statistics and Probability":[0,0,0,0,0,0,0,0,0,0],"Basic Calculus":[0,0,0,0,0,0,0,0,0,0]},r=ue(t),n=x[r]||x["General Mathematics"];return n[i%n.length]}function Kt(t,i,x){const r={"Pre-Calculus":["The expression under the square root must be non-negative: x - 2 ≥ 0, so x ≥ 2.","Since 2⁴ = 16, we get x = 4.","The period of sin(kx) is 2π/k. Here k = 2, so period = 2π/2 = π.","To find the inverse: y = 3x + 5 → x = 3y + 5 → y = (x - 5)/3.","Since 2⁵ = 32, log₂(32) = 5.","(x² - 9)/(x - 3) = (x+3)(x-3)/(x-3) = x + 3 (for x ≠ 3).","The absolute value |x| ≥ 0 for all x, so |x| - 3 ≥ -3. The range is y ≥ -3.","g(2) = 4, then f(4) = 2(4) + 1 = 9.","The amplitude of y = Acos(x) is |A|. Here A = 3, so amplitude = 3.","log₃(x) = 4 means 3⁴ = x, so x = 81."],"General Mathematics":["(2x + 3)(x - 4) = 2x² - 8x + 3x - 12 = 2x² - 5x - 12","15% of 240 = 0.15 × 240 = 36","3x + 7 = 22 → 3x = 15 → x = 5","5! = 5 × 4 × 3 × 2 × 1 = 120","0.75 = 75/100 = 3/4 after simplifying by dividing both by 25","25% of 360 = 0.25 × 360 = 90","12/18 = (12÷6)/(18÷6) = 2/3","Factors of 24: {1,2,3,4,6,8,12,24}. Factors of 36: {1,2,3,4,6,9,12,18,36}. GCD = 12","3 ÷ 8 = 0.375","20% off $40 = $40 × 0.80 = $32","2/3 + 1/4 = 8/12 + 3/12 = 11/12","15% of $80 = 0.15 × 80 = $12","45/60 = (45÷15)/(60÷15) = 3/4","0.125 = 125/1000 = 1/8","30% × N = 45 → N = 45/0.30 = 150"],"Statistics and Probability":["A fair die has 6 outcomes, each equally likely. P(6) = 1/6.","Mean = (4 + 7 + 9 + 12 + 15) / 5 = 47/5 = 9.4","Sorted: 2, 5, 8, 11, 14. The middle value is 8.","P(red) = 5/(5+3) = 5/8","Range = max - min = 30 - 10 = 20","The value 5 appears 3 times, more than any other value. Mode = 5.","Standard deviation measures how spread out data points are from the mean.","For independent events: P(A and B) = P(A) × P(B) = 0.3 × 0.5 = 0.15","For even-count dataset {4,7,10,13}: median = (7+10)/2 = 8.5","3 books can be arranged in 3! = 3 × 2 × 1 = 6 ways."],"Basic Calculus":["Using the power rule: d/dx[3x²] = 3 × 2x = 6x","Factor: (x²-4)/(x-2) = (x+2)(x-2)/(x-2) = x+2. As x→2: 2+2 = 4","∫ 2x dx = 2 × x²/2 + C = x² + C","f'(x) = 5 × 3x² - 2 = 15x² - 2","The derivative of sin(x) is cos(x). This is a fundamental trigonometric derivative.","d/dx[eˣ + 3x] = eˣ + 3. The derivative of eˣ is eˣ and of 3x is 3.","∫ cos(x) dx = sin(x) + C. Integration is the reverse of differentiation.","The derivative of ln(x) is 1/x. This is a fundamental logarithmic derivative.","As x → ∞, 1/x approaches 0. The function gets infinitely close to zero.","f'(x) = 4x³ - 4x using the power rule on each term."]},n=ue(t),m=r[n]||r["General Mathematics"];return m[i%m.length]}const Qs=({onEarnXP:t,atRiskSubjects:i=[],priorityTopics:x=[],initialModuleId:r=null})=>{const{userProfile:n}=Se(),[m,c]=l.useState("modules"),S=n?.grade,L=at(S),v=ie.filter(u=>L.includes(u.id)),N=r&&v.flatMap(u=>u.modules).find(u=>u.id===r)||null,[I,A]=l.useState(N),[j,$]=l.useState(null),[P,E]=l.useState("");l.useEffect(()=>{if(r){const u=v.flatMap(a=>a.modules).find(a=>a.id===r);u&&A(u)}},[r]);const k=v.find(u=>u.id==="gen-math")??v[0]??null,o=l.useMemo(()=>{const u=x.length>0?x:i.map(f=>Ke(f)).filter(f=>f!==null),a=new Set;return u.filter(f=>a.has(f)?!1:(a.add(f),!0))},[x,i]),q=l.useMemo(()=>{const u=k?.modules??[];if(o.length===0)return u;const a=new Map(o.map((f,b)=>[Je[f],b]));return[...u].sort((f,b)=>{const y=a.get(f.id)??Number.POSITIVE_INFINITY,M=a.get(b.id)??Number.POSITIVE_INFINITY;return y-M})},[k?.modules,o]),h=l.useMemo(()=>{const u=P.trim().toLowerCase();return u?q.filter(a=>{const f=a.title.toLowerCase().includes(u),b=a.description.toLowerCase().includes(u),y=a.lessons.some(_=>_.title.toLowerCase().includes(u)),M=a.quizzes.some(_=>_.title.toLowerCase().includes(u));return f||b||y||M}):q},[q,P]),B=(u,a)=>{t&&t(a,`Quiz Completed! +${a} XP`),$(null)};return j?e.jsx(Ht,{quiz:j,onClose:()=>$(null),onComplete:B,studentId:n?.uid}):I?e.jsx(Rt,{module:I,onBack:()=>A(null),onEarnXP:t}):e.jsxs("div",{className:"h-full flex flex-col px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center mb-8 gap-6",children:[e.jsxs("div",{className:"flex-1 max-w-3xl",children:[e.jsx("h1",{className:"text-[36px] md:text-[44px] font-display font-black text-[#202124] tracking-tight leading-[1.1] mb-4",children:"Explore Modules"}),e.jsxs("p",{className:"text-[#3c4043] text-[16px] md:text-[17px] leading-[1.7] md:pr-10",children:["Welcome to your personalized learning hub for ",e.jsx("span",{className:"font-bold text-indigo-700",children:"General Mathematics"}),". These modules are organized directly under the subject so you can jump straight into lessons and assessments without extra steps. MathPulse AI adapts challenge level and quiz support as you progress, helping you master each module with focus and momentum."]})]}),e.jsx("div",{className:"hidden md:flex flex-shrink-0 items-center justify-end w-[350px]",children:e.jsxs("svg",{viewBox:"0 0 300 180",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-auto drop-shadow-sm",children:[e.jsx("circle",{cx:"210",cy:"90",r:"45",fill:"#202124"}),e.jsx("path",{d:"M165 90 C165 65.1472 185.147 45 210 45 C234.853 45 255 65.1472 255 90 C255 114.853 234.853 135 210 135 C185.147 135 165 114.853 165 90 Z",fill:"#202124"}),e.jsx("path",{d:"M150 140 C140 120 160 80 200 70 C240 60 260 80 270 120 C275 140 260 180 210 180 C160 180 155 160 150 140 Z",fill:"#202124"}),e.jsx("path",{d:"M210 125 C195 125 185 110 185 95 C185 80 200 72 215 72 C230 72 245 80 245 95 C245 115 225 125 210 125 Z",fill:"#e8eaed"}),e.jsx("circle",{cx:"202",cy:"92",r:"2",fill:"#202124"}),e.jsx("circle",{cx:"225",cy:"92",r:"2",fill:"#202124"}),e.jsx("path",{d:"M210 105 Q 215 110 220 105",stroke:"#202124",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"}),e.jsx("path",{d:"M198 86 Q 202 84 206 86",stroke:"#202124",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"}),e.jsx("path",{d:"M220 86 Q 225 84 230 86",stroke:"#202124",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"}),e.jsx("circle",{cx:"180",cy:"100",r:"6",stroke:"#202124",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"248",cy:"100",r:"6",stroke:"#202124",strokeWidth:"2",fill:"none"}),e.jsx("path",{d:"M175 180 L 180 135 C185 125 235 125 240 135 L 245 180 Z",fill:"#f8f9fa"}),e.jsx("path",{d:"M175 180 L 180 135 C185 125 235 125 240 135 L 245 180 Z",stroke:"#202124",strokeWidth:"2",fill:"none"}),e.jsx("path",{d:"M170 178 L 220 178 L 230 130 L 180 130 Z",fill:"white",stroke:"#202124",strokeWidth:"2",strokeLinejoin:"round"}),e.jsx("path",{d:"M160 178 L 250 178",stroke:"#202124",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M195 130 C195 130 190 155 180 170",stroke:"#202124",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),e.jsx("circle",{cx:"120",cy:"50",r:"14",fill:"white",stroke:"#202124",strokeWidth:"1.5"}),e.jsx("path",{d:"M112 50 L 128 50 M 120 42 L 120 58 M 115 45 L 125 55 M 115 55 L 125 45",stroke:"#202124",strokeWidth:"1"}),e.jsx("rect",{x:"135",cy:"55",width:"16",height:"12",rx:"2",fill:"white",stroke:"#202124",strokeWidth:"1.5",y:"45"}),e.jsx("path",{d:"M140 50 h6 M140 53 h4",stroke:"#202124",strokeWidth:"1",strokeLinecap:"round"}),e.jsx("circle",{cx:"50",cy:"110",r:"4",fill:"#202124"}),e.jsx("circle",{cx:"80",cy:"70",r:"3",fill:"#1FA7E1"}),e.jsx("circle",{cx:"30",cy:"80",r:"3",fill:"#1FA7E1"}),e.jsx("circle",{cx:"85",cy:"140",r:"3",fill:"#1FA7E1"}),e.jsx("circle",{cx:"100",cy:"100",r:"3",fill:"#1FA7E1"}),e.jsx("circle",{cx:"20",cy:"130",r:"3",fill:"#1FA7E1"}),e.jsx("path",{d:"M50 110 L80 70 M50 110 L30 80 M50 110 L85 140 M50 110 L100 100 M50 110 L20 130",stroke:"#1FA7E1",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.6"}),e.jsx("path",{d:"M100 35 L 105 25 L 110 35 L 100 35 Z",fill:"white",stroke:"#202124",strokeWidth:"1.5",strokeLinejoin:"round"}),e.jsx("path",{d:"M40 40 L 45 40 L 42.5 35 Z",fill:"#202124"})]})})]}),e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute left-6 top-1/2 -translate-y-1/2 text-[#5f6368]",children:e.jsx(xt,{size:22,strokeWidth:2.5})}),e.jsx("input",{id:"modules-search",name:"modules-search","aria-label":"Search modules",type:"text",value:P,onChange:u=>E(u.target.value),placeholder:"Search modules, lessons, or assessments...",className:"w-full pl-16 pr-6 py-4 rounded-full border border-[#dadce0] bg-white text-[#202124] text-[15px] font-medium focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all shadow-sm"})]}),e.jsx("div",{className:"flex items-center bg-slate-100/80 p-1.5 rounded-full border border-slate-200/60 shadow-inner gap-1 w-max overflow-x-auto max-w-full no-scrollbar",children:[{id:"modules",label:"Modules",icon:U,color:"text-[#1FA7E1]"},{id:"recommended",label:"Recommended",icon:he,color:"text-[#75D06A]"},{id:"practice",label:"Practice",icon:Z,color:"text-[#FFB356]"}].map(u=>{const a=m===u.id;return e.jsxs("button",{onClick:()=>c(u.id),className:`relative flex items-center gap-2.5 px-6 py-3 rounded-full text-[15px] font-bold transition-all duration-300 flex-shrink-0 ${a?"shadow-sm":"text-slate-500 hover:text-slate-700 hover:bg-slate-200/50"}`,children:[a&&e.jsx(p.div,{layoutId:"modulesTabBackground",className:"absolute inset-0 bg-white rounded-full shadow-[0_2px_15px_-3px_rgba(0,0,0,0.1)] border border-slate-100",transition:{type:"spring",bounce:.2,duration:.6}}),e.jsxs("span",{className:`relative z-10 flex items-center gap-2 ${a?u.color:""}`,children:[e.jsx(u.icon,{size:18,strokeWidth:a?2.5:2}),u.label]})]},u.id)})}),o.length>0&&e.jsxs("div",{className:"mt-6 rounded-2xl border border-amber-300 bg-amber-50 px-5 py-4 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"inline-flex items-center gap-2 text-sm font-black text-amber-900",children:[e.jsx(et,{size:15}),"Assessment Focus Areas"]}),e.jsx("p",{className:"mt-1 text-sm text-amber-900/80",children:"Modules are currently prioritized by your latest diagnostic needs."})]}),e.jsxs("button",{type:"button",onClick:()=>c("recommended"),className:"inline-flex items-center gap-1.5 rounded-xl bg-amber-600 px-3 py-2 text-xs font-bold text-white transition-colors hover:bg-amber-700",children:["View Recommended",e.jsx(Ce,{size:14})]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:o.map((u,a)=>e.jsxs("span",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-amber-900 shadow-sm",children:[a+1,". ",tt[u]]},u))})]})]}),e.jsx(Y,{mode:"wait",children:e.jsx(p.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},className:"flex-1 overflow-y-auto",children:m==="practice"?e.jsx(Vt,{onStartQuiz:$,searchQuery:P,allowedSubjectIds:L}):m==="modules"?e.jsx(Jt,{modules:h,onSelectModule:A,isAtRisk:o.length>0}):e.jsx(es,{modules:h,fullPool:q,onSelectModule:A,isAtRisk:o.length>0})},m)})]})},Jt=({modules:t,onSelectModule:i,isAtRisk:x=!1})=>e.jsx("div",{className:"h-full overflow-y-auto pr-2 pb-8 scrollbar-hide space-y-8",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(nt,{size:20,strokeWidth:2.5})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"General Mathematics Modules"})]}),t.length===0?e.jsxs("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center",children:[e.jsx("p",{className:"text-slate-700 font-semibold",children:"No matching modules found."}),e.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"If modules are not yet available for your selected view, this area will unlock after assessment sync and content rollout."})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:t.map((r,n)=>e.jsx(we,{module:r,index:n,onClick:()=>i(r),isAtRisk:x},r.id))})]})}),es=({modules:t,fullPool:i,onSelectModule:x,isAtRisk:r=!1})=>{const n=t.filter(c=>c.progress>0&&c.progress<100),m=(t.length>0?t:i).filter(c=>c.progress===0).slice(0,6);return e.jsxs("div",{className:"h-full overflow-y-auto pr-2 pb-8 space-y-10 scrollbar-hide",children:[n.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-[#FF8B8B]/10 flex items-center justify-center text-[20px] shadow-inner",children:"🔥"}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Continue This Module"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:n.slice(0,4).map((c,S)=>e.jsx(we,{module:c,index:S,onClick:()=>x(c),isAtRisk:r,badgeLabel:"In Progress"},c.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-[#75D06A]/10 flex items-center justify-center text-[20px] shadow-inner",children:e.jsx(je,{size:19,className:"text-[#75D06A]"})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Suggested Next"})]}),m.length===0?e.jsx("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center text-slate-500 font-medium",children:"You are all caught up. Practice more quizzes to unlock additional recommendations."}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:m.map((c,S)=>e.jsx(we,{module:c,index:S,onClick:()=>x(c),isAtRisk:r,badgeLabel:"Start"},c.id))})]})]})};export{Qs as default}; diff --git a/assets/NotificationCenter-DGhehaGL.js b/assets/NotificationCenter-DGhehaGL.js deleted file mode 100644 index 6e27a21a9aab60404e6970203b39529872e6c37a..0000000000000000000000000000000000000000 --- a/assets/NotificationCenter-DGhehaGL.js +++ /dev/null @@ -1,6 +0,0 @@ -import{r as m,j as e}from"./vendor-react-Dexh7fmo.js";import{c as w,u as A,m as o,e as C,j as M,k as z,l as E}from"./index-D4nJsLyx.js";import{B as h}from"./bell-CbSbac2W.js";import{X as R}from"./x-BONnp2RF.js";import{B as T}from"./book-open-BH50GByv.js";import{M as $}from"./message-square-DSAS4TVL.js";import{C as B}from"./circle-alert-CBefjicJ.js";import{T as H}from"./trophy-C2nVcZnb.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const I=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],S=w("check-check",I),Y=({userRole:q="student"})=>{const{currentUser:l}=A(),[u,x]=m.useState(!1),[r,f]=m.useState([]),[D,p]=m.useState(!1);m.useEffect(()=>{(async()=>{if(l){p(!0);try{const N=(await M(l.uid,20)).map(s=>{let n="info";s.type==="achievement"?n="achievement":s.type==="risk_alert"||s.type==="reminder"?n="alert":s.type==="message"?n="message":n="info";const k=s.createdAt instanceof Date?s.createdAt:new Date(s.createdAt),v=Date.now()-k.getTime(),i=Math.floor(v/6e4);let d;return i<1?d="Just now":i<60?d=`${i} min ago`:i<1440?d=`${Math.floor(i/60)} hours ago`:d=`${Math.floor(i/1440)} days ago`,{id:s.id,type:n,title:s.title,message:s.message,time:d,read:s.read}});f(N)}catch(a){console.error("Error loading notifications:",a)}finally{p(!1)}}})()},[l]);const c=r.filter(t=>!t.read).length,b=()=>{f(r.map(t=>({...t,read:!0}))),l&&z(l.uid).catch(t=>console.error("Error marking all as read:",t))},g=t=>{f(r.map(a=>a.id===t?{...a,read:!0}:a)),E(t).catch(a=>console.error("Error marking as read:",a))},y=t=>{switch(t){case"achievement":return H;case"alert":return B;case"message":return $;case"info":return T;default:return h}},j=t=>{switch(t){case"achievement":return"bg-rose-500/10 text-rose-600";case"alert":return"bg-red-500/10 text-red-600";case"message":return"bg-sky-500/10 text-sky-600";case"info":return"bg-emerald-500/10 text-emerald-600";default:return"bg-[#edf1f7] text-[#5a6578]"}};return e.jsxs("div",{className:"relative",children:[e.jsxs(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>x(!u),className:"relative p-3 bg-[#edf1f7] rounded-xl text-[#5a6578] hover:bg-[#dde3eb] transition-colors",children:[e.jsx(h,{size:20}),c>0&&e.jsx(o.span,{initial:{scale:0},animate:{scale:1},className:"absolute -top-1 -right-1 w-5 h-5 bg-sky-600 text-white text-xs font-bold rounded-full flex items-center justify-center",children:c})]}),e.jsx(C,{children:u&&e.jsxs("div",{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>x(!1)}),e.jsxs(o.div,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.2},className:"absolute right-0 top-full mt-2 w-96 bg-[#f7f9fc] rounded-xl shadow-2xl border border-[#dde3eb] z-50 overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-gradient-to-r from-sky-600 to-sky-500",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-white",children:"Notifications"}),e.jsx("p",{className:"text-xs text-sky-100 mt-0.5",children:c>0?`${c} unread`:"All caught up!"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c>0&&e.jsx(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:b,className:"text-xs text-sky-400 hover:text-sky-300 font-bold",children:e.jsx(S,{size:18})}),e.jsx(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>x(!1),className:"text-slate-500 hover:text-sky-700",children:e.jsx(R,{size:18})})]})]}),e.jsx("div",{className:"max-h-96 overflow-y-auto",children:r.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(h,{size:48,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] text-sm font-body",children:"No notifications yet"})]}):e.jsx("div",{children:r.map(t=>{const a=y(t.type);return e.jsx(o.div,{whileHover:{backgroundColor:"rgba(241, 245, 249, 0.5)"},onClick:()=>g(t.id),className:`p-4 border-b border-[#dde3eb] cursor-pointer transition-colors ${t.read?"":"bg-sky-50/40"}`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j(t.type)}`,children:e.jsx(a,{size:18})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] line-clamp-1 font-body",children:t.title}),!t.read&&e.jsx("span",{className:"w-2 h-2 bg-sky-600 rounded-full flex-shrink-0 mt-1.5"})]}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2 line-clamp-2 font-body",children:t.message}),e.jsx("p",{className:"text-xs text-slate-500",children:t.time})]})]})},t.id)})})}),r.length>0&&e.jsx("div",{className:"p-3 border-t border-[#dde3eb] text-center bg-[#edf1f7]",children:e.jsx("button",{className:"text-xs text-sky-600 hover:text-sky-700 font-bold font-body",children:"View All Notifications"})})]})]},"notification-panel")})]})};export{Y as default}; diff --git a/assets/ProfileModal-D3hk8uuj.js b/assets/ProfileModal-D3hk8uuj.js deleted file mode 100644 index 8c27ebfcb97a3072da20ccf4102bd4040ec65bc8..0000000000000000000000000000000000000000 --- a/assets/ProfileModal-D3hk8uuj.js +++ /dev/null @@ -1,16 +0,0 @@ -import{r,j as e}from"./vendor-react-Dexh7fmo.js";import{B as c}from"./button-BpeUVhBo.js";import{I as l}from"./input-DBkKXOmF.js";import{c as u,e as P,m as k,B as A,N as B}from"./index-D4nJsLyx.js";import{C as R}from"./CompositeAvatar-DMpjm5UY.js";import{X as D}from"./x-BONnp2RF.js";import{U as f}from"./users-HMf2sdE3.js";import{M as F}from"./mail-D7el5vSX.js";import{A as b}from"./award-oJTbc9W5.js";import{B as w}from"./book-open-BH50GByv.js";import{C as U}from"./calendar-BJ8oE6yW.js";import{G as _}from"./globe-BMa4SWkV.js";import{S as T}from"./save-Og8yP5Yb.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./avatarData-BW_TX0b4.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]],$=u("building",q);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],X=u("camera",G);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],H=u("phone",Y),fe=({isOpen:o,onClose:i,profileData:p,onSave:z})=>{const[s,t]=r.useState(p),[d,x]=r.useState(!1),[C,g]=r.useState(!1),[m,y]=r.useState([]),[v,j]=r.useState(0);r.useEffect(()=>{if(!o)return;const a=n=>{n.key==="Escape"&&i()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o,i]),r.useEffect(()=>{if(!o||s.role!=="student"||!s.uid)return;const a=s.uid;(async()=>{g(!0);try{const[h,S]=await Promise.all([A(void 0,!1,"all",5),B(a)]);y(h),j(S)}catch(h){console.error("Failed to load leaderboard for profile modal:",h),y([]),j(0)}finally{g(!1)}})()},[o,s.role,s.uid]);const L=()=>{const a=["https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?w=200&h=200&fit=crop"],n=a[Math.floor(Math.random()*a.length)];t({...s,photo:n})},E=()=>{z(s),x(!1)},M=()=>{t(p),x(!1)},I=a=>{switch(a){case"student":return"bg-sky-100 text-sky-700 border-sky-200";case"teacher":return"bg-rose-100 text-rose-700 border-rose-200";case"admin":return"bg-rose-100 text-rose-700 border-rose-200";default:return"bg-zinc-100 text-zinc-700 border-zinc-200"}},N=m.find(a=>a.userId===s.uid);return e.jsx(P,{children:o&&e.jsxs(e.Fragment,{children:[e.jsx(k.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i,className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50"}),e.jsx(k.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},className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:a=>a.stopPropagation(),children:e.jsxs("div",{className:"bg-[#f7f9fc] rounded-2xl shadow-2xl w-full max-w-3xl max-h-[90vh] overflow-hidden border border-[#dde3eb]",children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-6 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-white/30 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full -mr-24 -mt-24"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-36 h-36 bg-white/5 rounded-full -ml-18 -mb-18"}),e.jsxs("div",{className:"relative z-10 flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-white mb-1",children:"Profile Settings"}),e.jsx("p",{className:"text-zinc-400 text-sm font-body",children:"Manage your account information"})]}),e.jsx("button",{onClick:i,className:"text-zinc-500 hover:text-sky-700 hover:bg-slate-100 p-2 rounded-lg transition-all",children:e.jsx(D,{size:20})})]})]}),e.jsxs("div",{className:"overflow-y-auto max-h-[calc(90vh-200px)] p-6 scrollbar-thin scrollbar-thumb-[#d1cec6] scrollbar-track-[#edf1f7]",children:[e.jsxs("div",{className:"flex flex-col items-center mb-8",children:[e.jsxs("div",{className:"relative group",children:[e.jsx(R,{layers:s.avatarLayers,className:"w-28 h-28 rounded-xl bg-[#0B1021] shadow-lg border-2 border-[#dde3eb] ring-4 ring-sky-100",fallbackSrc:s.photo}),d&&e.jsx("button",{onClick:L,className:"absolute inset-0 bg-black/60 rounded-xl flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-50",children:e.jsxs("div",{className:"text-center text-white",children:[e.jsx(X,{size:32,className:"mx-auto mb-1"}),e.jsx("span",{className:"text-xs font-bold",children:"Change Photo"})]})})]}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:s.name}),e.jsx("span",{className:`inline-block mt-2 px-3 py-1 rounded-full text-xs font-body font-semibold border ${I(s.role)}`,children:s.role.charAt(0).toUpperCase()+s.role.slice(1)})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-sky-600 rounded-full"}),"Basic Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(f,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.name,onChange:a=>t({...s,name:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(F,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{type:"email",value:s.email,onChange:a=>t({...s,email:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Phone Number"}),e.jsxs("div",{className:"relative",children:[e.jsx(H,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.phone,onChange:a=>t({...s,phone:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:s.role==="student"?"School":s.role==="teacher"?"Department":"Office Location"}),e.jsxs("div",{className:"relative",children:[e.jsx($,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.school||s.department||s.office||"",onChange:a=>{s.role==="student"?t({...s,school:a.target.value}):s.role==="teacher"?t({...s,department:a.target.value}):t({...s,office:a.target.value})},disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),s.role==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-teal-600 rounded-full"}),"Academic Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Learner's Reference Number (LRN)"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.lrn||"",onChange:a=>t({...s,lrn:a.target.value}),disabled:!d,className:"pl-10 bg-[#edf1f7] border-[#dde3eb] rounded-xl disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Grade Level"}),e.jsxs("div",{className:"relative",children:[e.jsx(w,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.grade||"",onChange:a=>t({...s,grade:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(f,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.section||"",onChange:a=>t({...s,section:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-rose-600 rounded-full"}),"Leaderboard Overview"]}),C?e.jsx("div",{className:"rounded-lg border border-[#dde3eb] bg-white p-4 text-sm font-body text-[#5a6578]",children:"Loading leaderboard data..."}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"rounded-lg border border-rose-200 bg-rose-50 p-3",children:[e.jsx("p",{className:"text-xs font-body font-semibold text-rose-700 uppercase tracking-wider",children:"Your Rank"}),e.jsx("p",{className:"text-2xl font-display font-bold text-rose-800 mt-1",children:v>0?`#${v}`:"Unranked"})]}),e.jsxs("div",{className:"rounded-lg border border-sky-200 bg-sky-50 p-3",children:[e.jsx("p",{className:"text-xs font-body font-semibold text-sky-700 uppercase tracking-wider",children:"Total XP"}),e.jsx("p",{className:"text-2xl font-display font-bold text-sky-800 mt-1",children:N?.xp??0})]}),e.jsxs("div",{className:"rounded-lg border border-emerald-200 bg-emerald-50 p-3",children:[e.jsx("p",{className:"text-xs font-body font-semibold text-emerald-700 uppercase tracking-wider",children:"Level"}),e.jsx("p",{className:"text-2xl font-display font-bold text-emerald-800 mt-1",children:N?.level??"-"})]})]}),e.jsxs("div",{className:"rounded-lg border border-[#dde3eb] bg-white overflow-hidden",children:[e.jsx("div",{className:"px-4 py-2 border-b border-[#dde3eb] bg-[#f7f9fc]",children:e.jsx("p",{className:"text-xs font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Top Students"})}),e.jsx("div",{className:"divide-y divide-[#edf1f7]",children:m.length>0?m.map(a=>e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-[#edf1f7] text-[#0a1628] text-xs font-display font-bold flex items-center justify-center",children:a.rank}),e.jsxs("p",{className:"text-sm font-body font-semibold text-[#0a1628] truncate",children:[a.name,a.userId===s.uid?" (You)":""]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-sm font-body font-semibold text-[#0a1628]",children:[a.xp," XP"]}),e.jsxs("p",{className:"text-xs font-body text-[#5a6578]",children:["Lv ",a.level]})]})]},a.userId)):e.jsx("div",{className:"px-4 py-6 text-center text-sm font-body text-[#5a6578]",children:"No leaderboard data available yet."})})]})]})]})]}),s.role==="teacher"&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-rose-500 rounded-full"}),"Teaching Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Teacher ID"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.teacherId||"",onChange:a=>t({...s,teacherId:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Subject/Specialization"}),e.jsxs("div",{className:"relative",children:[e.jsx(w,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.subject||"",onChange:a=>t({...s,subject:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Years of Experience"}),e.jsxs("div",{className:"relative",children:[e.jsx(U,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.yearsOfExperience||"",onChange:a=>t({...s,yearsOfExperience:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Qualification"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.qualification||"",onChange:a=>t({...s,qualification:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),s.role==="admin"&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-rose-600 rounded-full"}),"Administrative Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Admin ID"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.adminId||"",onChange:a=>t({...s,adminId:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Position/Title"}),e.jsxs("div",{className:"relative",children:[e.jsx(f,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.position||"",onChange:a=>t({...s,position:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Access Level/Permissions"}),e.jsxs("div",{className:"relative",children:[e.jsx(_,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.permissions||"",onChange:a=>t({...s,permissions:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]})]})]}),e.jsx("div",{className:"border-t border-[#dde3eb] p-5 bg-[#edf1f7]",children:e.jsx("div",{className:"flex gap-3 justify-end",children:d?e.jsxs(e.Fragment,{children:[e.jsx(c,{onClick:M,variant:"outline",className:"px-5 py-2 rounded-lg border-[#d1cec6] hover:bg-white font-body font-medium text-[#5a6578]",children:"Cancel"}),e.jsxs(c,{onClick:E,className:"px-5 py-2 rounded-lg bg-sky-600 hover:bg-sky-700 text-white font-body font-semibold flex items-center gap-2",children:[e.jsx(T,{size:16}),"Save Changes"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{onClick:i,variant:"outline",className:"px-5 py-2 rounded-lg border-[#d1cec6] hover:bg-white font-body font-medium text-[#5a6578]",children:"Close"}),e.jsx(c,{onClick:()=>x(!0),className:"px-5 py-2 rounded-lg bg-sky-600 hover:bg-sky-700 text-white font-body font-semibold",children:"Edit Profile"})]})})})]})})]})})};export{fe as default}; diff --git a/assets/QuizBattlePage-BbGkD7O9.js b/assets/QuizBattlePage-BbGkD7O9.js deleted file mode 100644 index f5289b3ba2e8512453a3fa998d0bbde91ff630e1..0000000000000000000000000000000000000000 --- a/assets/QuizBattlePage-BbGkD7O9.js +++ /dev/null @@ -1,21 +0,0 @@ -import{c as Ee,d as Qe,E as ke,G as Pe,H as B,u as Jt,_ as Yt,m as re,I as ht,i as Kt}from"./index-D4nJsLyx.js";import{j as e,r as l}from"./vendor-react-Dexh7fmo.js";import{g as Zt,s as Xt}from"./subjects-DDBtpdiA.js";import{d as ea,b as ta,w as gt,o as Rt,l as Ye,f as Ke,q as Ze,e as Xe}from"./vendor-firebase-firestore-BML5nJHm.js";import{Y as R,Z as Mt,$ as At,a0 as be,a1 as aa}from"./vendor-firebase-core-DQ-pMjxd.js";import{B as I}from"./button-BpeUVhBo.js";import{c as h}from"./utils-BQQgILNW.js";import{c as sa,L as ra,d as oa,e as na,f as da,g as ia,h as ca}from"./vendor-radix-BRdei-zg.js";import{S as ce,a as le,b as ue,c as me,d as P}from"./select-Co4o1EaI.js";import{I as la}from"./input-DBkKXOmF.js";import{S as Me}from"./switch-eyvBOdtY.js";import{S as X,C as yt}from"./skeleton-BUmMbOVs.js";import{S as jt}from"./swords-8_KH18p7.js";import{U as Ae}from"./users-HMf2sdE3.js";import{C as He}from"./chevron-right-COMox1Xb.js";import{T as ua}from"./target-D7SVtf3g.js";import{C as wt}from"./check-BACdUlFL.js";import{L as Ge}from"./loader-circle-J8Mwbkkw.js";import{T as ma}from"./trophy-C2nVcZnb.js";import{S as xa}from"./sparkles-CXUFmaBJ.js";import{S as fa}from"./shield-check-B_yHzqcC.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./trending-up-D-vj8Gbq.js";import"./chart-column-D5mAWcRx.js";import"./clsx-B-dksMZM.js";import"./chevron-up-Bfmq3Clw.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ba=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]],pa=Ee("clock-3",ba);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ha=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ga=Ee("history",ha);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ya=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],kt=Ee("volume-2",ya);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ja=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],vt=Ee("volume-x",ja),wa=15e3,ka="mathpulse.quizBattle.local",Nt="".toLowerCase()==="true",_e=typeof window<"u",qe=()=>_e&&!1,tt=()=>{const a=Pe.currentUser?.uid;return a||"local-student"},Tt=a=>`${ka}.${a}`,ve=a=>{const s={stats:pe(a),history:[],queueStatus:"idle"};if(!_e)return s;try{const r=window.localStorage.getItem(Tt(a));if(!r)return s;const c=JSON.parse(r),i=Array.isArray(c.history)?c.history.map(g=>et(g.matchId||"local-match",g)):[];return{stats:c.stats?{...pe(a),...c.stats,userId:a,updatedAt:ze(c.stats.updatedAt)}:pe(a),history:i,queueStatus:c.queueStatus==="queued"||c.queueStatus==="matched"?c.queueStatus:"idle"}}catch(r){return console.error("Error reading local Quiz Battle fallback store:",r),s}},Qt=(a,s)=>{if(_e)try{window.localStorage.setItem(Tt(a),JSON.stringify(s))}catch(r){console.error("Error writing local Quiz Battle fallback store:",r)}},qt=a=>{const s=a||{},r=typeof s.code=="string"?s.code:"";return r?r.startsWith("functions/")?r.replace("functions/",""):r:""},H=a=>{if(!qe())return!1;const s=qt(a);if(["internal","not-found","unavailable","deadline-exceeded"].includes(s))return!0;const r=a||{},c=(typeof r.message=="string"?r.message:a instanceof Error?a.message:"").toLowerCase();return c?c.includes("cors policy")||c.includes("no access-control-allow-origin")||c.includes("failed to fetch")||c.includes("network error")||c.includes("err_failed"):!1},Te=(a,s)=>Math.floor(Math.random()*(s-a+1))+a,va=(a,s)=>{const r=Math.max(3,a),c=s==="easy"?0:s==="medium"?1:s==="hard"?2:1,i=Te(Math.max(0,r-3-c),r),d=Te(Math.max(0,r-4+c),r),g=Math.min(r,Math.max(0,i)),C=Math.min(r,Math.max(0,d)),y=Math.max(0,Math.min(100,g/r*100+Te(-8,6))),S=Te(1800,6200);return{scoreFor:g,scoreAgainst:C,accuracy:y,averageResponseMs:S}},Na=a=>{const s=tt(),r=ve(s),c=`local-bot-${Date.now()}-${Math.random().toString(16).slice(2,8)}`,i=va(a.rounds,a.botDifficulty),d=i.scoreFor>i.scoreAgainst?"win":i.scoreFor0?S/y*100:0,averageAccuracy:y>0?(r.stats.averageAccuracy*r.stats.matchesPlayed+i.accuracy)/y:i.accuracy,averageResponseMs:y>0?Math.round((r.stats.averageResponseMs*r.stats.matchesPlayed+i.averageResponseMs)/y):i.averageResponseMs,currentStreak:b,bestStreak:A,favoriteTopicId:a.topicId,leaderboardScore:r.stats.leaderboardScore+C.xpEarned,updatedAt:g};return Qt(s,{stats:j,history:[C,...r.history].slice(0,50),queueStatus:"idle"}),{success:!0,matchId:c,status:"ready",botDifficulty:a.botDifficulty}},zt=a=>{const s=tt(),r=ve(s);Qt(s,{...r,queueStatus:a})},Sa=()=>Math.random().toString(36).slice(2,8).toUpperCase(),at=a=>{const s=tt();return{roomId:`local-room-${Date.now()}`,roomCode:a||Sa(),ownerStudentId:s,participantIds:[s],participantCount:1,status:"waiting",subjectId:"gen-math",topicId:"functions",difficulty:"medium",rounds:5,timePerQuestionSec:30,isOwner:!0}},Et=()=>_e&&!!Pe.currentUser?.uid&&!!ke,Pt=(a,s,r)=>`quizBattlePresence/${a}/${s}/${r}`,Ca=async(a,s)=>{if(!Et()||!s.trim()||!ke)return;const r=Pe.currentUser?.uid;if(!r)return;const c=Mt(ke,Pt(a,s,r));try{await At(c,{studentId:r,scope:a,resourceId:s,online:!0,heartbeatAt:be(),updatedAt:be()}),await aa(c).update({online:!1,updatedAt:be(),disconnectedAt:be()})}catch(i){console.warn("Realtime presence connect failed:",i)}},Ia=async(a,s)=>{if(!Et()||!s.trim()||!ke)return;const r=Pe.currentUser?.uid;if(!r)return;const c=Mt(ke,Pt(a,s,r));try{await At(c,{studentId:r,scope:a,resourceId:s,online:!1,updatedAt:be(),disconnectedAt:be()})}catch(i){console.warn("Realtime presence disconnect failed:",i)}},Q=(a,s)=>{const r=`Unable to continue while ${a}. Please try again.`;if(s instanceof Error&&s.message.startsWith("Timed out while"))return s.message;const c=s||{},i=qt(s),d=typeof c.message=="string"?c.message.trim():"";return i==="unauthenticated"?"Your session has expired. Sign in again before starting a battle.":i==="permission-denied"?"Only student accounts can access Quiz Battle matchmaking.":i==="invalid-argument"?d||"Battle setup is invalid. Review the selected options and try again.":i==="already-exists"?d||"This room is already full. Try another room code.":i==="failed-precondition"?d||"Battle state changed. Please refresh and continue.":i==="unavailable"||i==="internal"||i==="not-found"||i==="deadline-exceeded"?/question generation temporarily unavailable/i.test(d)?d:"Quiz Battle service is temporarily unavailable. Please retry in a moment.":r},M=async(a,s,r=wa)=>{let c;try{return await Promise.race([s,new Promise((i,d)=>{c=setTimeout(()=>{d(new Error(`Timed out while ${a}. Please try again.`))},r)})])}finally{c&&clearTimeout(c)}},ze=a=>{if(!a)return new Date;if(a instanceof Date)return a;if(typeof a=="string"){const s=Date.parse(a);return Number.isNaN(s)?new Date:new Date(s)}if(typeof a=="number")return new Date(a);if(typeof a=="object"){const s=a;if(typeof s.toDate=="function")return s.toDate();if(typeof s.seconds=="number")return new Date(s.seconds*1e3)}return new Date},Ba=()=>({mode:"online",subjectId:"gen-math",topicId:"",difficulty:"medium",rounds:5,timePerQuestionSec:30,queueType:"public_matchmaking",botDifficulty:"medium",adaptiveBot:!1}),Ra=a=>{const s=[];return a.subjectId.trim()||s.push({field:"subjectId",message:"Choose a category before starting."}),a.topicId.trim()||s.push({field:"topicId",message:"Choose a strand or topic before starting."}),(a.rounds<3||a.rounds>20)&&s.push({field:"rounds",message:"Questions must be between 3 and 20."}),(a.timePerQuestionSec<10||a.timePerQuestionSec>180)&&s.push({field:"timePerQuestionSec",message:"Timer must be between 10s and 180s."}),a.mode==="bot"&&a.queueType!=="public_matchmaking"&&s.push({field:"queueType",message:"Bot battles use instant start and do not support private room mode."}),s},pe=a=>({userId:a,matchesPlayed:0,wins:0,losses:0,draws:0,winRate:0,averageAccuracy:0,averageResponseMs:0,bestStreak:0,currentStreak:0,favoriteTopicId:void 0,leaderboardScore:0,updatedAt:new Date}),Ma=async a=>{try{const s=ea(Qe,"studentBattleStats",a),r=await ta(s),c=qe()?ve(a).stats:null;if(!r.exists())return c&&c.matchesPlayed>0?c:pe(a);const i=r.data(),d={...pe(a),...i,userId:a,updatedAt:ze(i.updatedAt)};return c&&c.matchesPlayed>d.matchesPlayed?c:d}catch(s){if(console.error("Error loading battle stats:",s),qe()){const r=ve(a).stats;if(r.matchesPlayed>0)return r}return pe(a)}},et=(a,s)=>({matchId:s.matchId||a,mode:s.mode||"online",status:s.status||"completed",subjectId:s.subjectId||"gen-math",topicId:s.topicId||"unknown-topic",difficulty:s.difficulty||"medium",rounds:s.rounds||0,timePerQuestionSec:s.timePerQuestionSec||0,scoreFor:s.scoreFor||0,scoreAgainst:s.scoreAgainst||0,outcome:s.outcome||"draw",accuracy:s.accuracy||0,averageResponseMs:s.averageResponseMs||0,bestStreak:s.bestStreak||0,xpEarned:s.xpEarned||0,opponentName:s.opponentName||"Unknown opponent",opponentType:s.opponentType||"student",createdAt:ze(s.createdAt),endedAt:ze(s.endedAt)}),Aa=async(a,s={})=>{const r=s.limitCount||25,c=qe()?ve(a).history:[],i=g=>g.filter(y=>!(s.mode&&s.mode!=="all"&&y.mode!==s.mode||s.subjectId&&y.subjectId!==s.subjectId||s.startDate&&y.endedAts.endDate)).sort((y,S)=>S.endedAt.getTime()-y.endedAt.getTime()).slice(0,r),d=g=>{if(c.length===0)return i(g);const C=new Map;return[...c,...g].forEach(y=>{C.set(y.matchId,y)}),i(Array.from(C.values()))};try{const g=[gt("studentId","==",a),Rt("endedAt","desc"),Ye(r)],y=(await Ke(Ze(Xe(Qe,"quizBattleHistory"),...g))).docs.map(S=>et(S.id,S.data()));return d(y)}catch(g){try{const y=(await Ke(Ze(Xe(Qe,"quizBattleHistory"),gt("studentId","==",a),Ye(r)))).docs.map(S=>et(S.id,S.data())).sort((S,he)=>he.endedAt.getTime()-S.endedAt.getTime());return d(y)}catch(C){return console.error("Error loading battle history:",g,C),i(c)}}},Ta=async a=>{const s=R(B,"quizBattleJoinQueue");try{return(await M("joining Quiz Battle matchmaking queue",s({setup:a}))).data}catch(r){if(H(r))return zt("queued"),{success:!0,status:"queued",queueEntryId:`local-queue-${Date.now()}`};throw new Error(Q("joining Quiz Battle matchmaking queue",r))}},Qa=async()=>{const a=R(B,"quizBattleLeaveQueue");try{return(await M("leaving Quiz Battle matchmaking queue",a({}))).data}catch(s){if(H(s))return zt("idle"),{success:!0,status:"idle"};throw new Error(Q("leaving Quiz Battle matchmaking queue",s))}},qa=async a=>{const s=R(B,"quizBattleCreatePrivateRoom");try{return(await M("creating Quiz Battle private room",s({setup:a}))).data}catch(r){if(H(r))return{success:!0,room:at()};throw new Error(Q("creating Quiz Battle private room",r))}},za=async a=>{const s=R(B,"quizBattleJoinPrivateRoom");try{return(await M("joining Quiz Battle private room",s({roomCode:a}),2e4)).data}catch(r){if(H(r))return{success:!0,room:at(a.trim().toUpperCase()||void 0)};throw new Error(Q("joining Quiz Battle private room",r))}},Ea=async a=>{const s=R(B,"quizBattleGetPrivateRoomState");try{return(await M("loading Quiz Battle private room state",s(a),2e4)).data}catch(r){if(H(r))return{success:!0,room:at(a.roomCode?.trim().toUpperCase()||void 0)};throw new Error(Q("loading Quiz Battle private room state",r))}},Pa=async(a={})=>{const s=R(B,"quizBattleLeavePrivateRoom");try{return(await M("leaving Quiz Battle private room",s(a),2e4)).data}catch(r){if(H(r))return{success:!0,status:"idle"};throw new Error(Q("leaving Quiz Battle private room",r))}},St=async()=>{const a=R(B,"quizBattleResumeSession");try{return(await M("resuming Quiz Battle session",a({}),2e4)).data}catch(s){if(H(s))return{success:!0,sessionType:"idle"};throw new Error(Q("resuming Quiz Battle session",s))}},_a=async(a,s)=>{if(!s.trim())return;const r=R(B,"quizBattleHeartbeat");await Ca(a,s);try{await M("sending Quiz Battle heartbeat",r({scope:a,resourceId:s}),12e3)}catch(c){if(!H(c))throw new Error(Q("sending Quiz Battle heartbeat",c))}},Da=async a=>{const s=R(B,"quizBattleCreateBotMatch");try{return(await M("starting Quiz Battle bot match",s({setup:a}))).data}catch(r){if(H(r))return Na(a);throw new Error(Q("starting Quiz Battle bot match",r))}},La=async a=>{const s=R(B,"quizBattleGetGenerationAudit");return(await M("verifying Quiz Battle generation metadata",s({matchId:a}),2e4)).data},W=async a=>{const s=R(B,"quizBattleStartMatch");try{const c=(await M("starting Quiz Battle match",s({matchId:a}),2e4)).data.match;if(c.mode==="online")try{const i=await La(a);if(console.info("[QUIZ_BATTLE_GENERATION_AUDIT]",i),Nt&&!i.isAiSource)throw new Error(`Quiz Battle generation audit failed: expected AI source, got "${i.questionSetSource||"unknown"}".`)}catch(i){if(i instanceof Error&&i.message.startsWith("Quiz Battle generation audit failed"))throw i;if(console.warn("Quiz Battle generation audit unavailable:",i),Nt)throw new Error("Unable to verify Quiz Battle generation metadata. Please retry in a moment.")}return c}catch(r){throw new Error(Q("starting Quiz Battle match",r))}},Je=async a=>{const s=R(B,"quizBattleGetMatchState");try{return(await M("loading Quiz Battle match state",s({matchId:a}),2e4)).data.match}catch(r){throw new Error(Q("loading Quiz Battle match state",r))}},$a=async a=>{const s=R(B,"quizBattleSubmitAnswer");try{return(await M("submitting Quiz Battle answer",s({...a,idempotencyKey:a.idempotencyKey||`client-${Date.now()}-${Math.random().toString(16).slice(2,8)}`}),2e4)).data}catch(r){throw new Error(Q("submitting Quiz Battle answer",r))}},Fa=async a=>{const s=R(B,"quizBattleRequestRematch");try{return(await M("creating Quiz Battle rematch",s({matchId:a}),2e4)).data}catch(r){throw new Error(Q("creating Quiz Battle rematch",r))}},Oa=async(a=20)=>{try{const s=Ze(Xe(Qe,"studentBattleLeaderboard"),Rt("leaderboardScore","desc"),Ye(a));return(await Ke(s)).docs.map((c,i)=>{const d=c.data();return{userId:d.userId||c.id,displayName:d.displayName||"Student",photo:d.photo,rank:d.rank||i+1,leaderboardScore:d.leaderboardScore||0,winRate:d.winRate||0,bestStreak:d.bestStreak||0}})}catch(s){return console.error("Error loading Quiz Battle leaderboard:",s),[]}};function _({className:a,...s}){return e.jsx("div",{"data-slot":"card",className:h("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",a),...s})}function F({className:a,...s}){return e.jsx("div",{"data-slot":"card-header",className:h("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...s})}function O({className:a,...s}){return e.jsx("h4",{"data-slot":"card-title",className:h("leading-none",a),...s})}function V({className:a,...s}){return e.jsx("p",{"data-slot":"card-description",className:h("text-muted-foreground",a),...s})}function ee({className:a,...s}){return e.jsx("div",{"data-slot":"card-content",className:h("px-6 [&:last-child]:pb-6",a),...s})}function Ua({className:a,...s}){return e.jsx(sa,{"data-slot":"tabs",className:h("flex flex-col gap-2",a),...s})}function Wa({className:a,...s}){return e.jsx(ra,{"data-slot":"tabs-list",className:h("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",a),...s})}function xe({className:a,...s}){return e.jsx(oa,{"data-slot":"tabs-trigger",className:h("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),...s})}function fe({className:a,...s}){return e.jsx(na,{"data-slot":"tabs-content",className:h("flex-1 outline-none",a),...s})}function Va({...a}){return e.jsx(da,{"data-slot":"collapsible",...a})}function Ha({...a}){return e.jsx(ia,{"data-slot":"collapsible-trigger",...a})}function Ga({...a}){return e.jsx(ca,{"data-slot":"collapsible-content",...a})}const D="border border-border bg-card text-card-foreground shadow-sm dark:border-[#2b3140] dark:bg-[#181d27] dark:text-[#f5f7fb] dark:shadow-[0_12px_24px_rgba(0,0,0,0.22)]",Ct=a=>a<=0?"--":`${(a/1e3).toFixed(2)}s`,It=a=>a==="win"?"Win":a==="loss"?"Loss":"Draw",Ja=(a,s,r)=>Math.max(s,Math.min(r,a)),Ya=a=>{const s=Math.floor(a/60),r=a%60;return`${s}:${String(r).padStart(2,"0")}`},Ka=a=>{const s=a.trim().split(/\s+/).filter(Boolean).slice(0,2);return s.length===0?"ST":s.map(r=>r[0]?.toUpperCase()||"").join("")},Bt=(a,s)=>a?a.eventType==="round_started"?`Round ${a.roundNumber} started.`:a.eventType==="answer_locked"?a.lockedByStudentId&&s&&a.lockedByStudentId===s?`Round ${a.roundNumber}: your answer is locked.`:`Round ${a.roundNumber}: opponent answer locked.`:a.eventType==="round_result"?`Round ${a.roundNumber} resolved.`:"Match completed.":null,Cs=()=>{const{userProfile:a,userRole:s}=Jt(),r=a,[c,i]=l.useState("hub"),[d,g]=l.useState(Ba),[C,y]=l.useState([]),[S,he]=l.useState(!1),[z,b]=l.useState({status:"idle"}),[A,j]=l.useState(!1),[m,w]=l.useState(null),[De,ge]=l.useState(""),[Ne,st]=l.useState(null),[rt,oe]=l.useState(0),[G,ot]=l.useState(()=>typeof window>"u"?!0:window.localStorage.getItem("quiz_battle_sound_enabled")!=="0"),[_t,v]=l.useState("connected"),[ne,Dt]=l.useState("all"),[nt,Le]=l.useState(!0),[J,$e]=l.useState(null),[Fe,Oe]=l.useState([]),[Lt,dt]=l.useState(!1),[it,$t]=l.useState([]),[Se,Ft]=l.useState("alias"),[Ue,Ot]=l.useState(!1),[o,k]=l.useState(null),[Ce,L]=l.useState(null),[Y,ye]=l.useState(!1),[E,je]=l.useState(0),[U,$]=l.useState(!1),[Ie,te]=l.useState(null),ct=l.useRef(""),We=l.useRef(null),de=l.useRef(null),K=l.useRef(0),lt=l.useRef(""),we=l.useRef(0),Z=l.useMemo(()=>{const t=Zt(r?.grade);return Xt.filter(n=>t.includes(n.id))},[r?.grade]),Ut=l.useMemo(()=>(Z.find(n=>n.id===d.subjectId)?.modules||[]).map(n=>({value:n.id,label:n.title})),[Z,d.subjectId]),ae=l.useCallback(t=>{if(!G||typeof window>"u")return;const n=window.AudioContext||window.webkitAudioContext;if(n)try{const f=new n,u=f.createOscillator(),p=f.createGain(),x={tick:{frequency:740,duration:.06,type:"triangle",volume:.035},lock:{frequency:520,duration:.08,type:"square",volume:.04},result:{frequency:660,duration:.1,type:"sine",volume:.045},win:{frequency:920,duration:.18,type:"triangle",volume:.05},loss:{frequency:240,duration:.16,type:"sawtooth",volume:.045}}[t],N=f.currentTime;u.type=x.type,u.frequency.setValueAtTime(x.frequency,N),p.gain.setValueAtTime(1e-4,N),p.gain.exponentialRampToValueAtTime(x.volume,N+.015),p.gain.exponentialRampToValueAtTime(1e-4,N+x.duration),u.connect(p),p.connect(f.destination),u.start(N),u.stop(N+x.duration+.02),window.setTimeout(()=>{f.close()},Math.ceil((x.duration+.06)*1e3))}catch(f){console.debug("Battle tone playback skipped:",f)}},[G]),ut=l.useCallback(async t=>{if(!(!t||typeof window>"u"))try{await window.navigator.clipboard.writeText(t),st(t),window.setTimeout(()=>{st(n=>n===t?null:n)},1600)}catch{b({status:"error",message:"Unable to copy room code automatically. Please copy it manually."})}},[]),ie=l.useCallback(async()=>{if(!r?.uid)return null;const[t,n]=await Promise.all([Ma(r.uid),Aa(r.uid,{mode:ne,limitCount:8})]);return{stats:t,history:n}},[ne,r?.uid]);l.useEffect(()=>{if(Z.length===0)return;const n=Z.some(p=>p.id===d.subjectId)?d.subjectId:Z[0].id,f=Z.find(p=>p.id===n),u=f?.modules?.[0]?.id||"";g(p=>{const T=f?.modules?.some(x=>x.id===p.topicId)?p.topicId:u;return p.subjectId===n&&p.topicId===T?p:{...p,subjectId:n,topicId:T}})},[Z,d.subjectId]),l.useEffect(()=>{if(!r?.uid){$e(null),Oe([]),Le(!1);return}let t=!0;return Le(!0),(async()=>{const f=await ie();t&&(f&&($e(f.stats),Oe(f.history)),Le(!1))})(),()=>{t=!1}},[ie,r?.uid]);const Be=l.useMemo(()=>ne==="all"?Fe:Fe.filter(t=>t.mode===ne),[Fe,ne]),mt=l.useMemo(()=>it.map((t,n)=>{const f=t.rank||n+1,u=t.userId===r?.uid,p=`Student-${t.userId.slice(-4).toUpperCase()}`,T=Se==="full"?t.displayName:Se==="initials"?Ka(t.displayName):p,x=Math.floor(t.leaderboardScore/25)*25,N=Ue||u?`${t.leaderboardScore} pts`:`${x}-${x+24} pts`;return{...t,rank:f,isSelf:u,displayName:T,scoreLabel:N}}),[it,Se,Ue,r?.uid]);l.useEffect(()=>{if(c!=="leaderboard")return;let t=!0;return dt(!0),(async()=>{const f=await Oa(20);t&&($t(f),dt(!1))})(),()=>{t=!1}},[c]);const Re=l.useCallback(async()=>{if(r?.uid)try{const t=await St();if(t.sessionType==="match"&&t.match){let n=t.match;if(t.match.mode==="bot"&&t.match.status==="ready")try{n=await W(t.match.matchId),we.current=0}catch(f){const u=f;j(!1),w(null),k(null),i("setup"),v(typeof window<"u"&&window.navigator.onLine?"connected":"disconnected"),b({status:"error",message:u?.message||"Unable to resume bot battle. Please start a new match."});return}j(!1),w(t.room||null),k(n),i("battle"),v("connected");return}if(t.sessionType==="room"&&t.room){j(!1),w(t.room),k(n=>n?.mode==="bot"?n:null),v("connected");return}if(t.sessionType==="queue"){j(!0),w(null),k(n=>n?.mode==="bot"?n:null),v("connected");return}j(!1),w(null),k(n=>n?.mode==="bot"?n:null),v("connected")}catch(t){console.warn("Quiz Battle session resume failed:",t),v("reconnecting")}},[r?.uid]);l.useEffect(()=>{r?.uid&&Re()},[r?.uid,Re]),l.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("quiz_battle_sound_enabled",G?"1":"0")},[G]),l.useEffect(()=>{if(!(A||m&&(m.status==="waiting"||m.status==="ready"))){oe(0);return}const t=window.setInterval(()=>{oe(n=>n+1)},1e3);return()=>{window.clearInterval(t)}},[A,m?.status,m?.roomId]),l.useEffect(()=>{if(typeof window>"u")return;v(window.navigator.onLine?"connected":"disconnected");const t=()=>{v("reconnecting"),Re()},n=()=>{v("disconnected")};return window.addEventListener("online",t),window.addEventListener("offline",n),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}},[Re]),l.useEffect(()=>{const t=o?.mode==="online"&&(o.status==="ready"||o.status==="in_progress"),n=o?.mode==="bot"&&o.status==="ready",f=!!(m&&(m.status==="waiting"||m.status==="ready"));if(n||(we.current=0),!A&&!f&&!t&&!n)return;let u=!1;const p=async()=>{try{if(o?.mode==="bot"&&o.status==="ready"){const x=await W(o.matchId);if(u)return;k(x),v("connected"),we.current=0,x.status==="in_progress"&&b({status:"queued",message:"Practice bot match started."});return}if(o?.mode==="online"){if(o.status==="ready"){const N=await W(o.matchId);if(u)return;k(N),v("connected"),N.status==="in_progress"&&b({status:"queued",message:"Match started. Round timer is live."});return}const x=await Je(o.matchId);if(u)return;k(x),x.status==="completed"&&(j(!1),w(null)),v("connected");return}if(m?.roomId){const x=await Ea({roomId:m.roomId});if(u)return;if(w(x.room),x.match){const N=await W(x.match.matchId);if(u)return;k(N),w(x.room),j(!1),i("battle"),v("connected"),b({status:"queued",message:N.status==="ready"?"Opponent connected. Waiting for synchronized start...":"Private room match started."})}return}if(A){const x=await St();if(u)return;if(x.sessionType==="match"&&x.match){const N=await W(x.match.matchId);if(u)return;k(N),w(x.room||null),j(!1),i("battle"),v("connected"),b({status:"queued",message:"Opponent found. Preparing synchronized start..."});return}if(x.sessionType==="room"&&x.room){j(!1),w(x.room),v("connected");return}v("connected")}}catch(x){if(!u){if(console.warn("Quiz Battle sync poll failed:",x),o?.mode==="bot"&&o.status==="ready"&&(we.current+=1,we.current>=3)){const N=x;j(!1),w(null),k(null),i("setup"),b({status:"error",message:N?.message||"Unable to start bot battle. Please try again."}),v("disconnected");return}v("reconnecting")}}};p();const T=window.setInterval(()=>{p()},3e3);return()=>{u=!0,window.clearInterval(T)}},[o?.matchId,o?.mode,o?.status,m?.roomId,m?.status,A]);const se=l.useMemo(()=>o?.mode==="online"&&(o.status==="ready"||o.status==="in_progress")?{scope:"match",resourceId:o.matchId}:m&&(m.status==="waiting"||m.status==="ready")?{scope:"room",resourceId:m.roomId}:A&&r?.uid?{scope:"queue",resourceId:r.uid}:null,[o,m,A,r?.uid]);l.useEffect(()=>{if(!se)return;let t=!1;const n=async()=>{try{await _a(se.scope,se.resourceId),t||v("connected")}catch(u){t||(console.warn("Quiz Battle heartbeat failed:",u),v("reconnecting"))}};n();const f=window.setInterval(()=>{n()},8e3);return()=>{t=!0,window.clearInterval(f),Ia(se.scope,se.resourceId)}},[se?.scope,se?.resourceId]),l.useEffect(()=>{if(!o||o.status!=="in_progress"){$(!1),de.current=null,K.current=0;return}de.current=null,K.current=0;const t=o.roundDeadlineAtMs?Math.max(0,Math.ceil((o.roundDeadlineAtMs-Date.now())/1e3)):o.timePerQuestionSec;je(t),L(null),$(!1)},[o?.matchId,o?.status,o?.currentRound,o?.timePerQuestionSec]),l.useEffect(()=>{const t=o?.lifecycle;if(!t?.eventType)return;const n=`${t.eventType}:${t.sequence}`;ct.current!==n&&(ct.current=n,t.eventType==="answer_locked"?ae("lock"):t.eventType==="round_result"&&ae("result"))},[o?.lifecycle?.eventType,o?.lifecycle?.sequence,ae]),l.useEffect(()=>{!o||o.status!=="completed"||lt.current!==o.matchId&&(lt.current=o.matchId,ae(o.outcome==="loss"?"loss":"win"),o.outcome==="win"&&Yt(()=>import("./confetti.module-C94ZD2ww.js"),[]).then(t=>{t.default({particleCount:110,spread:78,origin:{y:.62},ticks:160})}).catch(()=>{}))},[o?.matchId,o?.status,o?.outcome,ae]),l.useEffect(()=>{if(!o||o.status!=="in_progress"||U||Y){We.current=null;return}E<=3&&E>0&&We.current!==E&&(We.current=E,ae("tick"))},[o?.status,E,U,Y,ae]);const Ve=l.useCallback(async t=>{if(!o||o.status!=="in_progress"||U)return;ye(!0);const n=window.setTimeout(()=>{ye(!1),b({status:"error",message:"Submission took too long. Syncing latest match state now..."}),Je(o.matchId).then(f=>{k(f),f.status==="completed"&&(j(!1),w(null))}).catch(()=>{})},12e3);try{const f=o.roundDeadlineAtMs?Ja(o.timePerQuestionSec*1e3-Math.max(0,o.roundDeadlineAtMs-Date.now()),0,o.timePerQuestionSec*1e3):Math.max(0,(o.timePerQuestionSec-E)*1e3),u=await $a({matchId:o.matchId,roundNumber:o.currentRound,selectedOptionIndex:t,responseMs:f});de.current=null,K.current=0,k(u.match),te(u.roundResult),L(null),u.match.mode==="online"&&u.match.status==="in_progress"&&!u.roundResult&&($(!0),b({status:"queued",message:"Answer locked. Waiting for opponent to finish the round..."})),u.match.status==="completed"&&(j(!1),w(null),ie(),b({status:"queued",message:u.completion?`Match finished (${u.completion.outcome.toUpperCase()}) +${u.completion.xpEarned} XP`:"Match finished. Results saved."}))}catch(f){const p=f?.message||"Unable to submit answer right now. Please try again.";if(t===null||p.includes("Round timer elapsed")||p.includes("Expected round")||p.includes("Match is not currently active"))try{const x=await Je(o.matchId),N=x.currentRound!==o.currentRound;if(k(x),L(null),$(!1),N||x.status==="completed"?(de.current=null,K.current=0):t===null&&(K.current=Date.now()+3e3),x.status==="completed"){j(!1),w(null),ie(),b({status:"queued",message:"Match finished. Results synchronized."});return}b({status:"queued",message:"Round timed out. Synced to the latest battle state."});return}catch{}t===null&&(K.current=Date.now()+3e3),b({status:"error",message:p})}finally{window.clearTimeout(n),ye(!1)}},[o,ie,U,E]);l.useEffect(()=>{if(!o||o.status!=="in_progress"||Y||U)return;const t=o.roundDeadlineAtMs?Math.max(0,Math.ceil((o.roundDeadlineAtMs-Date.now())/1e3)):E;if(o.roundDeadlineAtMs&&t!==E&&je(t),Ce===null?t<=1:t<=0){if(de.current===o.currentRound&&Date.now(){o.roundDeadlineAtMs?je(Math.max(0,Math.ceil((o.roundDeadlineAtMs-Date.now())/1e3))):je(u=>Math.max(0,u-1))},1e3);return()=>{window.clearTimeout(f)}},[o,Y,U,E,Ce,Ve]);const Wt=l.useCallback(async()=>{if(!(!o||o.mode!=="bot")){ye(!0),b({status:"validating"});try{const t=await Fa(o.matchId),n=await W(t.matchId);k(n),w(null),j(!1),te(null),L(null),$(!1),i("battle"),b({status:"queued",message:`Rematch ready (${t.botDifficulty}). Good luck!`})}catch(t){b({status:"error",message:t?.message||"Unable to start rematch right now."})}finally{ye(!1)}}},[o]);if(s!=="student")return e.jsx("div",{className:"px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:e.jsx(_,{className:h(D,"max-w-2xl"),children:e.jsxs(F,{children:[e.jsx(O,{children:"Quiz Battle is student-only"}),e.jsx(V,{className:"text-muted-foreground dark:text-[#aab3c7]",children:"Your account role does not have access to this module."})]})})});const xt=t=>{y([]),b({status:"idle"}),j(!1),w(null),ge(""),k(null),te(null),L(null),$(!1),g(n=>({...n,mode:t,queueType:t==="online"?n.queueType:"public_matchmaking"})),oe(0),i("setup")},ft=t=>{y([]),b({status:"idle"}),j(!1),w(null),ge(""),k(null),te(null),L(null),$(!1),oe(0),g(n=>({...n,mode:t,queueType:t==="online"?n.queueType:"public_matchmaking"}))},bt=async()=>{b({status:"validating"});try{m?.roomId?await Pa({roomId:m.roomId}):await Qa(),j(!1),w(null),k(t=>!t||t.mode!=="online"?t:t.status==="ready"||t.status==="cancelled"?null:t),ge(""),oe(0),b({status:"queued",message:m?.roomId?"Private room cancelled.":"Left matchmaking queue."})}catch(t){b({status:"error",message:t?.message||"Unable to cancel this online session right now. Please try again."})}},Vt=async()=>{b({status:"validating"});const t=Ra(d);if(t.length>0){y(t),b({status:"error",message:"Fix the highlighted setup fields before starting."});return}y([]);try{if(d.mode==="online"){if(d.queueType==="private_room"){const p=De.trim().toUpperCase(),T=p?await za(p):await qa(d);if(j(!1),w(T.room),ge(""),T.match){const x=await W(T.match.matchId);k(x),te(null),L(null),$(!1),i("battle"),b({status:"queued",message:x.status==="ready"?`Room ${T.room.roomCode} linked. Waiting for synchronized start...`:"Private room match started."});return}k(null),b({status:"queued",message:p?"Joined private room. Waiting for opponent...":"Private room created. Share code:"});return}const u=await Ta(d);if(u.status==="matched"&&u.matchId){const p=await W(u.matchId);j(!1),w(null),k(p),te(null),L(null),$(!1),i("battle"),b({status:"queued",message:"Opponent found. Preparing synchronized start..."});return}j(!0),w(null),k(null),oe(0),b({status:"queued",message:"Joined matchmaking queue. Waiting for an opponent..."});return}const n=await Da(d),f=await W(n.matchId);j(!1),w(null),k(f),te(null),L(null),$(!1),je(f.timePerQuestionSec),i("battle"),b({status:"queued",message:`Bot match ${n.matchId.slice(0,8)} live (${n.botDifficulty}).`}),ie().then(u=>{u&&($e(u.stats),Oe(u.history))})}catch(n){j(!1),b({status:"error",message:n?.message||"Unable to start battle. Please try again."})}},q=t=>C.find(n=>n.field===t)?.message,Ht=J?.winRate??0,pt=!!(d.mode==="online"&&m&&(m.status==="waiting"||m.status==="ready")&&(!o||o.status!=="completed")),Gt=!!(A||m&&(m.status==="waiting"||m.status==="ready")&&(!o||o.status==="ready"||o.status==="cancelled"));return e.jsx("div",{className:"h-full flex flex-col px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:e.jsxs(re.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.24,ease:[.22,1,.36,1]},className:"space-y-6",children:[e.jsxs(_,{className:h(D,"relative overflow-hidden rounded-[20px]"),children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-br from-primary/8 via-primary/4 to-transparent dark:bg-[radial-gradient(circle_at_15%_15%,rgba(140,125,255,0.28),transparent_45%),radial-gradient(circle_at_85%_20%,rgba(121,79,255,0.17),transparent_40%)]"}),e.jsxs(F,{className:"relative z-10 pb-4",children:[e.jsxs(O,{className:"flex items-center gap-2 text-2xl font-black tracking-tight text-foreground dark:text-[#f5f7fb]",children:[e.jsx(jt,{className:"h-5 w-5 text-primary dark:text-[#9e8fff]"}),"Quiz Battle"]}),e.jsx(V,{className:"text-muted-foreground dark:text-[#c4cce0]",children:"Timed student duels with synchronized rounds, instant feedback, and progression rewards."}),e.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground dark:text-[#9ea8c2]",children:["Connection: ",_t]})]}),e.jsxs(ee,{className:"relative z-10 grid grid-cols-2 md:grid-cols-4 gap-3 pb-6",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-muted/50 p-3 dark:border-[#30374a] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#9da7bf]",children:"Win Rate"}),e.jsxs("p",{className:"tabular-nums text-lg font-bold text-foreground dark:text-[#f5f7fb]",children:[Ht.toFixed(1),"%"]})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-muted/50 p-3 dark:border-[#30374a] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#9da7bf]",children:"Matches"}),e.jsx("p",{className:"tabular-nums text-lg font-bold text-foreground dark:text-[#f5f7fb]",children:J?.matchesPlayed||0})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-muted/50 p-3 dark:border-[#30374a] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#9da7bf]",children:"Best Streak"}),e.jsx("p",{className:"tabular-nums text-lg font-bold text-foreground dark:text-[#f5f7fb]",children:J?.bestStreak||0})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-muted/50 p-3 dark:border-[#30374a] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#9da7bf]",children:"Avg Response"}),e.jsx("p",{className:"tabular-nums text-lg font-bold text-foreground dark:text-[#f5f7fb]",children:Ct(J?.averageResponseMs||0)})]})]})]}),e.jsxs(Ua,{value:c,onValueChange:t=>i(t),children:[e.jsxs(Wa,{className:"w-full md:w-auto rounded-2xl p-1.5",children:[e.jsx(xe,{value:"hub",className:"rounded-xl",children:"Hub"}),e.jsx(xe,{value:"setup",className:"rounded-xl",children:"Setup"}),e.jsx(xe,{value:"battle",className:"rounded-xl",children:"Battle"}),e.jsx(xe,{value:"history",className:"rounded-xl",children:"History"}),e.jsx(xe,{value:"stats",className:"rounded-xl",children:"My Stats"}),e.jsx(xe,{value:"leaderboard",className:"rounded-xl",children:"Leaderboard"})]}),e.jsx(fe,{value:"hub",className:"mt-5",children:e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("button",{type:"button",onClick:()=>xt("online"),className:"text-left rounded-[18px] border border-border bg-card p-5 transition-colors hover:border-primary/60 hover:bg-accent/40 dark:border-[#333a4e] dark:bg-[#171d2a] dark:hover:border-[#8c7dff] dark:hover:bg-[#202736]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-foreground dark:text-[#f5f7fb] font-semibold",children:[e.jsx(Ae,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"1v1 Online"]}),e.jsx(He,{className:"h-4 w-4 text-muted-foreground dark:text-[#a2abc2]"})]}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground dark:text-[#b3bdd5]",children:"Queue or room-code match with another student."})]}),e.jsxs("button",{type:"button",onClick:()=>xt("bot"),className:"text-left rounded-[18px] border border-border bg-card p-5 transition-colors hover:border-primary/60 hover:bg-accent/40 dark:border-[#333a4e] dark:bg-[#171d2a] dark:hover:border-[#8c7dff] dark:hover:bg-[#202736]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-foreground dark:text-[#f5f7fb] font-semibold",children:[e.jsx(ht,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"1v1 vs Bot"]}),e.jsx(He,{className:"h-4 w-4 text-muted-foreground dark:text-[#a2abc2]"})]}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground dark:text-[#b3bdd5]",children:"Instant solo duel with selectable bot difficulty."})]})]}),e.jsxs(_,{className:h(D,"rounded-[18px]"),children:[e.jsx(F,{children:e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(ga,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"})," Recent Matches"]})}),e.jsx(ee,{className:"space-y-2",children:nt?e.jsxs("div",{className:"space-y-2",children:[e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"}),e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"}),e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"})]}):Be.length===0?e.jsx("p",{className:"text-sm text-muted-foreground dark:text-[#a8b2c9]",children:"No battle history yet. Start your first duel."}):Be.slice(0,5).map(t=>e.jsxs("div",{className:"rounded-xl border border-border bg-muted/40 px-3 py-2 flex items-center justify-between dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground dark:text-[#f5f7fb]",children:["vs ",t.opponentName]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#95a0bb]",children:[t.subjectId," · ",t.difficulty]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"tabular-nums text-sm font-semibold text-foreground dark:text-[#f5f7fb]",children:[t.scoreFor," - ",t.scoreAgainst]}),e.jsx("p",{className:h("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",t.outcome==="win"?"bg-emerald-100 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300":t.outcome==="loss"?"bg-rose-100 text-rose-800 dark:bg-rose-500/15 dark:text-rose-300":"bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300"),children:It(t.outcome)})]})]},t.matchId))})]})]},"hub")}),e.jsx(fe,{value:"setup",className:"mt-5",children:e.jsx(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:e.jsxs(_,{className:h(D,"rounded-[18px]"),children:[e.jsxs(F,{children:[e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(ua,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"})," Battle Setup"]}),e.jsx(V,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Configure a student-safe match and start quickly."})]}),e.jsxs(ee,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Mode"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(I,{type:"button",variant:d.mode==="online"?"default":"outline",onClick:()=>ft("online"),className:"h-10 rounded-xl",children:"1v1 Online"}),e.jsx(I,{type:"button",variant:d.mode==="bot"?"default":"outline",onClick:()=>ft("bot"),className:"h-10 rounded-xl",children:"1v1 vs Bot"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Category"}),e.jsxs(ce,{value:d.subjectId,onValueChange:t=>g(n=>({...n,subjectId:t})),children:[e.jsx(le,{className:h("rounded-xl",q("subjectId")&&"border-rose-400"),children:e.jsx(ue,{placeholder:"Select category"})}),e.jsx(me,{children:Z.map(t=>e.jsx(P,{value:t.id,children:t.title},t.id))})]}),q("subjectId")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300",children:q("subjectId")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Strand / Topic Group"}),e.jsxs(ce,{value:d.topicId,onValueChange:t=>g(n=>({...n,topicId:t})),children:[e.jsx(le,{className:h("rounded-xl",q("topicId")&&"border-rose-400"),children:e.jsx(ue,{placeholder:"Select topic group"})}),e.jsx(me,{children:Ut.map(t=>e.jsx(P,{value:t.value,children:t.label},t.value))})]}),q("topicId")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300",children:q("topicId")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Difficulty"}),e.jsxs(ce,{value:d.mode==="bot"?d.botDifficulty:d.difficulty,onValueChange:t=>g(n=>n.mode==="bot"?{...n,botDifficulty:t}:{...n,difficulty:t}),children:[e.jsx(le,{className:"rounded-xl",children:e.jsx(ue,{})}),e.jsxs(me,{children:[e.jsx(P,{value:"easy",children:"Easy"}),e.jsx(P,{value:"medium",children:"Medium"}),e.jsx(P,{value:"hard",children:"Hard"}),d.mode==="bot"&&e.jsx(P,{value:"adaptive",children:"Adaptive"})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Number of Questions"}),e.jsxs(ce,{value:String(d.rounds),onValueChange:t=>g(n=>({...n,rounds:Number(t)})),children:[e.jsx(le,{className:h("rounded-xl",q("rounds")&&"border-rose-400"),children:e.jsx(ue,{})}),e.jsx(me,{children:[3,5,7,10,12,15].map(t=>e.jsx(P,{value:String(t),children:t},t))})]}),q("rounds")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300",children:q("rounds")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Time per Question"}),e.jsxs(ce,{value:String(d.timePerQuestionSec),onValueChange:t=>g(n=>({...n,timePerQuestionSec:Number(t)})),children:[e.jsx(le,{className:h("rounded-xl",q("timePerQuestionSec")&&"border-rose-400"),children:e.jsx(ue,{})}),e.jsx(me,{children:[15,20,30,45,60,90].map(t=>e.jsxs(P,{value:String(t),children:[t," sec"]},t))})]}),q("timePerQuestionSec")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300",children:q("timePerQuestionSec")})]})]}),e.jsxs(Va,{open:S,onOpenChange:he,children:[e.jsx(Ha,{asChild:!0,children:e.jsxs(I,{type:"button",variant:"outline",className:"w-full justify-between rounded-xl",children:["Advanced settings",e.jsx(He,{className:h("h-4 w-4 transition-transform",S&&"rotate-90")})]})}),e.jsxs(Ga,{className:"mt-3 rounded-xl border border-border bg-muted/40 p-3 space-y-3 dark:border-[#2e364a] dark:bg-[#11151d]",children:[d.mode==="online"?e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Online Match Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{value:"public_matchmaking",label:"Public Queue"},{value:"private_room",label:"Private Room"}].map(t=>e.jsx(I,{type:"button",variant:d.queueType===t.value?"default":"outline",className:"rounded-xl h-9",onClick:()=>g(n=>({...n,queueType:t.value})),children:t.label},t.value))}),d.queueType==="private_room"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs font-semibold text-foreground dark:text-[#c7cfe3]",children:"Room Code (optional)"}),e.jsx(la,{value:De,onChange:t=>ge(t.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6)),placeholder:"Leave blank to create a room",className:"rounded-xl uppercase tracking-[0.15em]",maxLength:6}),e.jsx("div",{className:"rounded-xl border border-amber-300 bg-amber-50 px-3 py-2.5 text-[13px] font-semibold text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200",children:"Enter a room code to join an existing battle, or leave it blank to create a new room and share your code."})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"flex items-center justify-between rounded-xl border border-border bg-card p-3 dark:border-[#2f3547] dark:bg-[#171d2a]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:"Adaptive Bot"}),e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#a9b3ca]",children:"Tune response timing and accuracy to your recent trend."})]}),e.jsx(Me,{checked:d.adaptiveBot,onCheckedChange:t=>g(n=>({...n,adaptiveBot:t,botDifficulty:t?"adaptive":n.botDifficulty==="adaptive"?"medium":n.botDifficulty}))})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-xl border border-border bg-card p-3 dark:border-[#2f3547] dark:bg-[#171d2a]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[G?e.jsx(kt,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}):e.jsx(vt,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:"Battle Sounds"}),e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#a9b3ca]",children:"Play audio cues for countdowns and results."})]})]}),e.jsx(Me,{checked:G,onCheckedChange:ot})]})]}),d.mode==="online"&&e.jsxs("label",{className:"flex items-center justify-between rounded-xl border border-border bg-card p-3 dark:border-[#2f3547] dark:bg-[#171d2a]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[G?e.jsx(kt,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}):e.jsx(vt,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:"Battle Sounds"}),e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#a9b3ca]",children:"Play audio cues for countdowns and results."})]})]}),e.jsx(Me,{checked:G,onCheckedChange:ot})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:items-center sm:justify-between",children:[e.jsxs("div",{"aria-live":"polite",className:"min-h-[24px] text-sm text-muted-foreground dark:text-[#b6bfd5]",children:[z.status==="queued"&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[z.message,d.mode==="online"&&d.queueType==="private_room"&&m?.roomCode&&e.jsxs(I,{type:"button",variant:"outline",className:h("h-7 rounded-full border-amber-300/70 bg-amber-100/80 px-3 text-[11px] font-black uppercase tracking-[0.16em] text-amber-900 hover:bg-amber-200 dark:border-amber-500/50 dark:bg-amber-500/15 dark:text-amber-200 dark:hover:bg-amber-500/25",Ne===m.roomCode?"border-emerald-400/80 bg-emerald-100 text-emerald-900 dark:border-emerald-400/70 dark:bg-emerald-500/20 dark:text-emerald-200":null),onClick:()=>void ut(m.roomCode),"aria-label":`Copy room code ${m.roomCode}`,children:[Ne===m.roomCode?e.jsx(wt,{className:"h-3.5 w-3.5"}):e.jsx(yt,{className:"h-3.5 w-3.5"}),m.roomCode]}),(A||pt)&&rt>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary dark:bg-[#8c7dff]/20 dark:text-[#c7c0ff]",children:["Waiting ",Ya(rt)]})]}),z.status==="error"&&e.jsx("span",{className:"text-destructive dark:text-rose-300",children:z.message}),z.status==="validating"&&e.jsxs("span",{className:"inline-flex items-center gap-2 text-foreground dark:text-[#d5dcf0]",children:[e.jsx(Ge,{className:"h-4 w-4 animate-spin"})," Validating setup..."]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Gt&&e.jsx(I,{type:"button",variant:"outline",onClick:bt,disabled:z.status==="validating",className:"rounded-xl",children:m?"Cancel room":"Leave queue"}),e.jsx(I,{type:"button",onClick:Vt,disabled:z.status==="validating"||A||pt,className:"rounded-xl",children:z.status==="validating"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4 animate-spin"})," Starting..."]}):d.mode==="online"&&d.queueType==="private_room"?De.trim()?"Join room":"Create room":"Start battle"})]})]})]})]})},"setup")}),e.jsx(fe,{value:"battle",className:"mt-5",children:e.jsx(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:o?e.jsxs(_,{className:h(D,"rounded-[18px]"),children:[e.jsxs(F,{children:[e.jsxs(O,{className:"text-base flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2",children:[o.mode==="bot"?e.jsx(ht,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}):e.jsx(Ae,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"vs ",o.opponentName]}),e.jsxs("span",{className:"text-sm font-bold tabular-nums",children:[o.scoreFor," - ",o.scoreAgainst]})]}),e.jsx(V,{className:"text-muted-foreground dark:text-[#b2bad0]",children:o.status==="completed"?`Completed in ${o.totalRounds} rounds.`:o.status==="ready"?o.mode==="online"?"Waiting for both players to confirm and start together.":"Finalizing practice bot session start.":`Round ${o.currentRound} of ${o.totalRounds}`}),Bt(o.lifecycle,r?.uid)&&e.jsx("p",{className:"text-xs font-medium text-muted-foreground dark:text-[#9aa4be]",children:Bt(o.lifecycle,r?.uid)})]}),e.jsxs(ee,{className:"space-y-4",children:[o.status==="ready"&&e.jsx("div",{className:"rounded-xl border border-border bg-muted/30 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:o.mode==="online"?"Waiting for both players to lock in start...":"Starting practice bot round..."})}),o.status==="in_progress"&&o.currentQuestion&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl border border-border bg-muted/40 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Time left: ",e.jsxs("span",{className:"font-semibold tabular-nums",children:[E,"s"]})]}),e.jsx("p",{className:"mt-2 text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:o.currentQuestion.prompt})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:o.currentQuestion.choices.map((t,n)=>e.jsxs(I,{type:"button",variant:Ce===n?"default":"outline",onClick:()=>L(n),disabled:Y||U,className:"h-auto min-h-11 rounded-xl justify-start text-left whitespace-normal",children:[e.jsxs("span",{className:"mr-2 font-semibold",children:[String.fromCharCode(65+n),"."]}),t]},`${o.currentQuestion?.questionId}-${n}`))}),e.jsx("div",{className:"flex justify-end",children:e.jsx(I,{type:"button",onClick:()=>void Ve(Ce),disabled:Y||U,className:"rounded-xl",children:Y?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4 animate-spin"})," Submitting..."]}):U?"Waiting for opponent...":"Lock Answer"})})]}),Ie&&e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:["Last round: ",Ie.studentCorrect?"Correct":"Incorrect"," · ",o.mode==="bot"?"Bot":"Opponent"," ",Ie.botCorrect?"Correct":"Incorrect"]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Correct option: ",String.fromCharCode(65+Ie.correctOptionIndex)]})]}),o.status==="completed"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:h("rounded-2xl border p-4",o.outcome==="win"?"border-emerald-300 bg-emerald-50 dark:border-emerald-400/40 dark:bg-emerald-900/20":o.outcome==="loss"?"border-rose-300 bg-rose-50 dark:border-rose-400/40 dark:bg-rose-900/20":"border-amber-300 bg-amber-50 dark:border-amber-400/40 dark:bg-amber-900/20"),children:[e.jsx("p",{className:"text-lg font-black tracking-wide text-foreground dark:text-[#ecf0fb]",children:o.outcome==="win"?"Victory!":o.outcome==="loss"?"Match Complete":"Draw Match"}),e.jsxs("p",{className:"mt-1 text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:["Final Score: ",o.scoreFor," - ",o.scoreAgainst]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["XP Earned: +",o.xpEarned||0]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(I,{type:"button",variant:"outline",onClick:()=>{w(null),j(!1),i("setup")},className:"rounded-xl",children:"Start New Match"}),o.mode==="bot"&&e.jsx(I,{type:"button",onClick:()=>void Wt(),disabled:Y,className:"rounded-xl",children:"Rematch"})]})]})]})]}):m?e.jsxs(_,{className:h(D,"rounded-[18px]"),children:[e.jsxs(F,{children:[e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(Ae,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"Private Room Lobby"]}),e.jsxs(V,{className:"text-muted-foreground dark:text-[#b2bad0]",children:["Room ",m.roomCode," · ",m.participantCount,"/2 students connected."]})]}),e.jsx(ee,{className:"space-y-3",children:e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:m.status==="ready"?"Opponent connected. Syncing start...":"Waiting for another student to join this room."}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Share room code ",m.roomCode," with your classmate."]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-end gap-2",children:[(m.status==="waiting"||m.status==="ready")&&e.jsx(I,{type:"button",variant:"outline",className:"h-8 rounded-lg",onClick:bt,disabled:z.status==="validating",children:"Cancel room"}),e.jsxs(I,{type:"button",variant:"outline",className:"h-8 rounded-lg",onClick:()=>void ut(m.roomCode),children:[Ne===m.roomCode?e.jsx(wt,{className:"h-4 w-4"}):e.jsx(yt,{className:"h-4 w-4"}),Ne===m.roomCode?"Copied":"Copy code"]})]})]})})]}):A?e.jsx(_,{className:h(D,"rounded-[18px]"),children:e.jsxs(F,{children:[e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(Ae,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"Public Matchmaking"]}),e.jsx(V,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Searching for a student with the same setup..."})]})}):e.jsx(_,{className:h(D,"rounded-[18px]"),children:e.jsxs(F,{children:[e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(jt,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"No active battle"]}),e.jsx(V,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Start from Setup to create a bot match, private room, or public queue session."})]})})},"battle")}),e.jsx(fe,{value:"history",className:"mt-5",children:e.jsx(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:e.jsxs(_,{className:h(D,"rounded-[18px]"),children:[e.jsxs(F,{children:[e.jsx(O,{className:"text-base",children:"Match History"}),e.jsx(V,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Your recent student battles only."})]}),e.jsxs(ee,{className:"space-y-3",children:[e.jsx("div",{className:"flex gap-2",children:[{value:"all",label:"All"},{value:"online",label:"Online"},{value:"bot",label:"Bot"}].map(t=>e.jsx(I,{type:"button",variant:ne===t.value?"default":"outline",onClick:()=>Dt(t.value),className:"rounded-xl h-8 px-3",children:t.label},t.value))}),nt?e.jsxs("div",{className:"space-y-2",children:[e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"}),e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"})]}):Be.length===0?e.jsx("p",{className:"text-sm text-muted-foreground dark:text-[#a8b2c9]",children:"No matches in this filter yet."}):Be.map(t=>e.jsxs("div",{className:"rounded-xl border border-border bg-muted/40 px-3 py-2 flex items-center justify-between gap-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground dark:text-[#f5f7fb]",children:["vs ",t.opponentName]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#95a0bb] tabular-nums",children:[t.scoreFor,"-",t.scoreAgainst," · ",t.accuracy.toFixed(0),"% · +",t.xpEarned," XP"]})]}),e.jsx("span",{className:h("text-xs font-semibold rounded-full px-2.5 py-1 border",t.outcome==="win"?"text-emerald-700 border-emerald-200 bg-emerald-50 dark:text-emerald-300 dark:border-emerald-300/40 dark:bg-emerald-900/20":t.outcome==="loss"?"text-rose-700 border-rose-200 bg-rose-50 dark:text-rose-300 dark:border-rose-300/40 dark:bg-rose-900/20":"text-amber-700 border-amber-200 bg-amber-50 dark:text-amber-300 dark:border-amber-300/40 dark:bg-amber-900/20"),children:It(t.outcome)})]},t.matchId))]})]})},"history")}),e.jsx(fe,{value:"stats",className:"mt-5",children:e.jsx(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:[{label:"Wins",value:J?.wins??0,icon:ma},{label:"Current streak",value:J?.currentStreak??0,icon:xa},{label:"Avg accuracy",value:`${(J?.averageAccuracy||0).toFixed(1)}%`,icon:fa},{label:"Avg response",value:Ct(J?.averageResponseMs||0),icon:pa}].map(t=>e.jsx(_,{className:h(D,"rounded-[18px]"),children:e.jsxs(ee,{className:"pt-6",children:[e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#9da7bf]",children:t.label}),e.jsx("p",{className:"mt-1 tabular-nums text-2xl font-black text-foreground dark:text-[#f5f7fb]",children:t.value}),e.jsx(t.icon,{className:"mt-3 h-4 w-4 text-primary dark:text-[#9e8fff]"})]})},t.label))},"stats")}),e.jsx(fe,{value:"leaderboard",className:"mt-5",children:e.jsx(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},children:e.jsxs(_,{className:h(D,"rounded-[18px]"),children:[e.jsxs(F,{children:[e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(Kt,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"})," Student Leaderboard"]}),e.jsx(V,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Student-only ranking using trusted backend aggregates."})]}),e.jsx(ee,{children:Lt?e.jsxs("div",{className:"space-y-2",children:[e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"}),e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"}),e.jsx(X,{className:"h-12 w-full rounded-xl bg-muted dark:bg-[#2a3143]"})]}):mt.length===0?e.jsx("p",{className:"text-sm text-muted-foreground dark:text-[#a9b3ca]",children:"No leaderboard entries yet. Finish a battle to place on the board."}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-2",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-2.5 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground dark:text-[#98a2bc]",children:"Name display"}),e.jsxs(ce,{value:Se,onValueChange:t=>Ft(t),children:[e.jsx(le,{className:"mt-1 h-8 rounded-lg",children:e.jsx(ue,{})}),e.jsxs(me,{children:[e.jsx(P,{value:"alias",children:"Alias"}),e.jsx(P,{value:"initials",children:"Initials"}),e.jsx(P,{value:"full",children:"Full name"})]})]})]}),e.jsxs("label",{className:"rounded-xl border border-border bg-muted/30 p-2.5 flex items-center justify-between gap-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground dark:text-[#98a2bc]",children:"Score detail"}),e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#98a2bc]",children:"Show exact score values"})]}),e.jsx(Me,{checked:Ue,onCheckedChange:Ot})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground dark:text-[#95a0bb]",children:"Privacy mode keeps classmate identities and scores obfuscated by default while preserving your own exact rank and score."}),mt.map(t=>e.jsxs("div",{className:h("rounded-xl border bg-muted/30 px-3 py-2 flex items-center justify-between dark:bg-[#11151d]",t.isSelf?"border-primary/60 dark:border-[#8d7fff]":"border-border dark:border-[#2f3547]"),children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground dark:text-[#f5f7fb]",children:["#",t.rank," ",t.displayName,t.isSelf?" (You)":""]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#95a0bb]",children:["Win rate ",t.winRate.toFixed(1),"% · Best streak ",t.bestStreak]})]}),e.jsx("p",{className:"tabular-nums text-sm font-semibold text-foreground dark:text-[#f5f7fb]",children:t.scoreLabel})]},t.userId))]})})]})},"leaderboard")})]})]})})};export{Cs as default}; diff --git a/assets/RewardsModal-HRePzoUo.js b/assets/RewardsModal-HRePzoUo.js deleted file mode 100644 index 0512fba5f4c988890e0600a5cc5f63f6e1b4efbb..0000000000000000000000000000000000000000 --- a/assets/RewardsModal-HRePzoUo.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./vendor-react-Dexh7fmo.js";import{X as h}from"./x-BONnp2RF.js";import{i as o,F as d,Z as f}from"./index-D4nJsLyx.js";import{S as n}from"./star-dumQ9BVG.js";import{T as g}from"./trophy-C2nVcZnb.js";import{T as j}from"./target-D7SVtf3g.js";import{B as u}from"./book-open-BH50GByv.js";import{A as N}from"./award-oJTbc9W5.js";import{C as v}from"./calendar-BJ8oE6yW.js";import{U as w}from"./users-HMf2sdE3.js";import{T as y}from"./trending-up-D-vj8Gbq.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const R=({isOpen:c,onClose:r,userLevel:t,currentXP:i,xpToNextLevel:a,totalXP:x,streak:m})=>{if(!c)return null;const b=[{id:"1",icon:n,title:"First Steps",description:"Complete your first video lesson",unlocked:!0,color:"text-[#9956DE]",bgColor:"bg-[#FB96BB]/20"},{id:"2",icon:g,title:"Quiz Master",description:"Score 100% on any quiz",unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"3",icon:d,title:"Week Warrior",description:"Maintain a 7-day login streak",progress:2,total:7,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"4",icon:j,title:"Practice Makes Perfect",description:"Complete 10 practice sets",progress:2,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"5",icon:u,title:"Knowledge Seeker",description:"Watch 20 video lessons",unlocked:!0,color:"text-[#1FA7E1]",bgColor:"bg-[#6ED1CF]/20"},{id:"6",icon:f,title:"Speed Learner",description:"Complete 5 lessons in one day",unlocked:!0,color:"text-[#FFB356]",bgColor:"bg-[#FFB356]/20"},{id:"7",icon:o,title:"Crown Achiever",description:"Reach Level 10",progress:4,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"8",icon:N,title:"XP Hunter",description:"Earn 1000 XP",unlocked:!0,color:"text-[#7274ED]",bgColor:"bg-[#7274ED]/15"},{id:"9",icon:v,title:"Dedicated Learner",description:"Maintain a 14-day streak",progress:2,total:14,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"10",icon:w,title:"Monthly Champion",description:"Maintain a 30-day streak",progress:2,total:30,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"}],p=[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily login streak",xp:25}];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[85vh] overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-6 text-white relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_14%_12%,rgba(251,150,187,0.35),transparent_42%),radial-gradient(circle_at_80%_80%,rgba(117,208,106,0.25),transparent_38%)]"}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsx("p",{className:"text-white/90 text-sm font-body",children:"Track your learning progress and unlock badges"})]}),e.jsx("button",{onClick:r,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(h,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(o,{size:18,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-2xl font-bold",children:t})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(n,{size:18,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-2xl font-bold",children:x.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(d,{size:18,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Day Streak"})]}),e.jsxs("p",{className:"text-2xl font-bold",children:[m," days"]})]})]}),e.jsxs("div",{className:"mt-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",t]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",t+1]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex justify-between items-center mb-1",children:e.jsxs("span",{className:"text-xs text-white/90",children:[i," / ",a," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500",style:{width:`${i/a*100}%`}})})]})]})]}),e.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(85vh-280px)]",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:b.map(s=>{const l=s.icon;return e.jsx("div",{className:`${s.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${s.unlocked?"shadow-md":"opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-12 h-12 ${s.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(l,{size:24,className:s.color})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:`text-sm font-bold ${s.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:s.title}),s.unlocked&&e.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),e.jsx("p",{className:`text-xs ${s.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:s.description}),s.progress!==void 0&&s.total!==void 0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),e.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[s.progress," / ",s.total]})]}),e.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all",style:{width:`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(y,{size:16,className:"text-white"})}),e.jsx("h3",{className:"text-base font-display font-bold text-[#0a1628]",children:"How to Earn XP"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:p.map((s,l)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),e.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[s.activity,":"]}),e.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",s.xp," XP"]})]},l))})]})]})]})]})};export{R as default}; diff --git a/assets/RightSidebar-Dfek3lmU.js b/assets/RightSidebar-Dfek3lmU.js deleted file mode 100644 index 53f5b2d83dec70c6b6728fa64abb8d40ddc7a2dc..0000000000000000000000000000000000000000 --- a/assets/RightSidebar-Dfek3lmU.js +++ /dev/null @@ -1 +0,0 @@ -import{r as m,j as e}from"./vendor-react-Dexh7fmo.js";import{e as g,m as r,Z as f,F as p,i as x}from"./index-D4nJsLyx.js";import{C as v}from"./circle-check-big-0Gzyt_f3.js";import{T as j,a as w,b as N}from"./tooltip-BV3U-RJu.js";import{T as y}from"./trophy-C2nVcZnb.js";import{C as h}from"./chevron-right-COMox1Xb.js";import{S as C}from"./star-dumQ9BVG.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-BRdei-zg.js";import"./utils-BQQgILNW.js";import"./clsx-B-dksMZM.js";const b=[{id:1,title:"Daily challenge",subtitle:"Do your plan before 09:00 AM",bgColor:"bg-[#6ED1CF]",orbColor:"bg-[#50B8B6]",avatars:["https://i.pravatar.cc/150?img=1","https://i.pravatar.cc/150?img=5","https://i.pravatar.cc/150?img=8"],extraCount:4,icon:e.jsx(f,{size:24,fill:"currentColor",className:"text-white"})},{id:2,title:"Weekend Warrior",subtitle:"Complete 3 modules this weekend",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",avatars:["https://i.pravatar.cc/150?img=12","https://i.pravatar.cc/150?img=32"],extraCount:12,icon:e.jsx(p,{size:24,fill:"currentColor",className:"text-white"})},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",avatars:["https://i.pravatar.cc/150?img=44","https://i.pravatar.cc/150?img=55","https://i.pravatar.cc/150?img=68"],extraCount:8,icon:e.jsx(v,{size:24,className:"text-white"})}],_=(o=[])=>{const n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=new Date,l=i.getDay(),a=[];for(let t=0;t<7;t++){const s=new Date(i);s.setDate(i.getDate()-l+t);const c=t===l,d=`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}-${String(s.getDate()).padStart(2,"0")}`,u=o.includes(d);a.push({dayName:n[t],dateNumber:s.getDate(),isToday:c,hasDot:u})}return a},k=({streakHistory:o=[]})=>{const[n,i]=m.useState(0),l=_(o);m.useEffect(()=>{const t=setInterval(()=>{i(s=>(s+1)%b.length)},5e3);return()=>clearInterval(t)},[]);const a=b[n];return e.jsxs("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:[e.jsx("div",{className:"relative h-[170px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(g,{mode:"wait",children:e.jsxs(r.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${a.bgColor} p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${a.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 bottom-4 w-[52px] h-[52px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-45 group-hover:scale-110 transition-transform duration-700 flex items-center justify-center",children:a.icon}),e.jsxs("div",{className:"relative z-10 w-3/4",children:[e.jsx("h3",{className:"font-display font-bold text-[22px] text-white mb-1",children:a.title}),e.jsx("p",{className:"text-[13px] font-medium text-white/80 leading-snug",children:a.subtitle})]}),e.jsxs("div",{className:"flex items-center -space-x-2.5 relative z-10 mt-auto",children:[a.avatars.map((t,s)=>e.jsx("img",{src:t,alt:"User",className:"w-[34px] h-[34px] rounded-full border-2 border-transparent object-cover relative z-[3] z-[2] z-[1]",style:{borderColor:a.bgColor.replace("bg-[","").replace("]","")}},s)),e.jsxs("div",{className:"w-[34px] h-[34px] rounded-full border-2 text-[12px] font-bold flex items-center justify-center text-white relative z-0",style:{backgroundColor:"rgba(0,0,0,0.2)",borderColor:a.bgColor.replace("bg-[","").replace("]","")},children:["+",a.extraCount]})]})]},a.id)})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display text-[15px] font-bold text-[#141b2d] mb-4 px-1",children:"Your streak"}),e.jsx("div",{className:"flex justify-between items-center gap-1.5 px-0.5",children:l.map((t,s)=>e.jsxs("div",{className:`flex flex-col items-center pt-2 pb-3 w-[46px] h-[72px] rounded-[24px] border ${t.isToday?"bg-[#12192b] text-white border-transparent shadow-[0_8px_16px_rgba(18,25,43,0.3)] transform -translate-y-1":"bg-white text-slate-400 border-slate-200/80 hover:border-slate-300"} transition-all duration-200 cursor-pointer`,children:[e.jsx("div",{className:"h-1.5 flex items-center justify-center mb-1.5",children:t.hasDot?e.jsx("div",{className:`w-[5px] h-[5px] rounded-full ${t.isToday?"bg-white":"bg-slate-300"}`}):e.jsx("div",{className:`text-[10px] ${t.isToday?"text-white/50":"text-slate-200"} font-bold`,children:"+"})}),e.jsx("span",{className:`text-[11px] font-bold mb-1 ${t.isToday?"text-slate-300":"text-slate-400/80"}`,children:t.dayName}),e.jsx("span",{className:`text-[15px] font-bold leading-none ${t.isToday?"text-white":"text-[#334155]"}`,children:t.dateNumber})]},s))})]})]})},X=({onOpenRewards:o,onOpenLeaderboard:n,onNavigateToModules:i,userLevel:l,currentXP:a,xpToNextLevel:t,streak:s,streakHistory:c=[]})=>{const d=a/t*100;return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:o,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-9 h-9 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(y,{size:16,className:"text-white"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-white tracking-wide",children:"Rewards & Achievements"})]}),e.jsx(h,{size:16,className:"text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white",children:[e.jsx(x,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",l]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(j,{children:[e.jsx(w,{asChild:!0,children:e.jsxs("button",{onClick:i,className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white cursor-pointer hover:bg-white/20 transition-colors active:scale-95",children:[e.jsx(C,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold",children:[a," XP"]})]})}),e.jsx(N,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white",children:[e.jsx(p,{size:12,className:"text-[#FF8B8B]"}),e.jsxs("span",{className:"font-bold",children:[s,"d"]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",l+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(d),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(r.div,{initial:{width:0},animate:{width:`${d}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(k,{streakHistory:c})}),e.jsxs(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:n,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(x,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(h,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsxs("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:[e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.5},className:"relative mb-2",children:[e.jsx("img",{src:"https://i.pravatar.cc/150?img=33",alt:"You",className:"w-10 h-10 rounded-full border-[3px] border-sky-400 z-10 relative object-cover shadow-sm bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-sky-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"2"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"54px"},transition:{delay:.4,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-slate-200 to-slate-100 rounded-t-xl rounded-b-md border-t-2 border-slate-50 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]",children:[e.jsx("span",{className:"text-slate-400 font-black text-2xl opacity-40 translate-y-1",children:"2"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"You"}),e.jsx("span",{className:"block text-[10px] text-sky-600 font-bold",children:"2.1k XP"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-20 -mx-2",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.7},className:"relative mb-2",children:[e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(x,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("img",{src:"https://i.pravatar.cc/150?img=68",alt:"Alex",className:"w-[52px] h-[52px] rounded-full border-[3px] border-amber-400 z-10 relative object-cover shadow-md bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-amber-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"1"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"74px"},transition:{delay:.6,duration:.5,ease:"easeOut"},className:"w-[78px] bg-gradient-to-b from-amber-100 to-amber-50 rounded-t-xl rounded-b-md border-t-2 border-amber-50 flex items-center justify-center relative shadow-[inset_0_-4px_8px_rgba(251,191,36,0.1),0_6px_8px_rgba(0,0,0,0.05)]",children:[e.jsx("span",{className:"text-amber-400 font-black text-3xl opacity-50 translate-y-1",children:"1"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/80 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[13px] font-black text-[#0a1628]",children:"Alex M."}),e.jsx("span",{className:"block text-[11px] text-amber-600 font-bold",children:"2.4k XP"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.6},className:"relative mb-2",children:[e.jsx("img",{src:"https://i.pravatar.cc/150?img=47",alt:"Sarah",className:"w-10 h-10 rounded-full border-[3px] border-orange-400 z-10 relative object-cover shadow-sm bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-orange-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"3"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"38px"},transition:{delay:.5,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-orange-50 to-slate-50 rounded-t-xl rounded-b-md border-t-2 border-orange-100 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(249,115,22,0.05),0_4px_6px_rgba(0,0,0,0.02)]",children:[e.jsx("span",{className:"text-orange-400/60 font-black text-2xl opacity-60 translate-y-1",children:"3"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"Sarah K."}),e.jsx("span",{className:"block text-[10px] text-orange-600 font-bold",children:"1.9k XP"})]})]})]})]})]})};export{X as default}; diff --git a/assets/ScientificCalculator-wlhyNBDf.js b/assets/ScientificCalculator-wlhyNBDf.js deleted file mode 100644 index 5b39bbb3483e34a6c24a8cce8c0c75712e740563..0000000000000000000000000000000000000000 --- a/assets/ScientificCalculator-wlhyNBDf.js +++ /dev/null @@ -1,30 +0,0 @@ -import{r as c,j as e}from"./vendor-react-Dexh7fmo.js";import{apiService as de}from"./apiService-axx1LHMk.js";import{c as Z,e as U,m as ue}from"./index-D4nJsLyx.js";import{C as fe,a as pe}from"./chevron-up-Bfmq3Clw.js";import{X as be}from"./x-BONnp2RF.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xe=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],me=Z("grip-horizontal",xe);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ge=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],ve=Z("keyboard",ge);function ye(a){const f=[];let n=0;for(;n0){const x=b[b.length-1],y=x===")"||x==="π"||x==="e"||x==="Ans"||/^\d/.test(x),N=u==="("||u==="π"||u==="e"||u==="Ans"||p.has(u)||/^\d/.test(u);y&&N&&b.push("×")}b.push(u)}for(const l of b)if(/^-?[\d.]+([eE][+-]?\d+)?$/.test(l))n.push(l);else if(l==="π")n.push(String(Math.PI));else if(l==="e"&&!p.has(l))n.push(String(Math.E));else if(l==="Ans")n.push("__ANS__");else if(p.has(l))s.push(l);else if(l==="(")s.push(l);else if(l===")"){for(;s.length&&s[s.length-1]!=="(";)n.push(s.pop());s.pop(),s.length&&p.has(s[s.length-1])&&n.push(s.pop())}else if(l in d){const u=d[l];for(;s.length&&s[s.length-1]!=="("&&s[s.length-1]in d&&(d[s[s.length-1]]>u||d[s[s.length-1]]===u&&!g.has(l));)n.push(s.pop());s.push(l)}for(;s.length;)n.push(s.pop());return n}function we(a){if(a<0||!Number.isInteger(a))return NaN;if(a>170)return 1/0;let f=1;for(let n=2;n<=a;n++)f*=n;return f}function Ne(a){return a*Math.PI/180}function ke(a){return a*180/Math.PI}function Ae(a,f,n){const s=[],d=f==="DEG"?Ne:p=>p,g=f==="DEG"?ke:p=>p;for(const p of a){if(p==="__ANS__"){s.push(n);continue}const b=parseFloat(p);if(!isNaN(b)&&/^-?[\d.]+([eE][+-]?\d+)?$/.test(p)){s.push(b);continue}if(["+","-","×","÷","*","/","^","%"].includes(p)){const u=s.pop(),x=s.pop();switch(p){case"+":s.push(x+u);break;case"-":s.push(x-u);break;case"×":case"*":s.push(x*u);break;case"÷":case"/":if(u===0){s.push(NaN);break}s.push(x/u);break;case"^":s.push(Math.pow(x,u));break;case"%":s.push(x*u/100);break}continue}const l=s.pop();switch(p){case"sin":s.push(Math.sin(d(l)));break;case"cos":s.push(Math.cos(d(l)));break;case"tan":{const u=d(l);if(Math.abs(Math.cos(u))<1e-15){s.push(NaN);break}s.push(Math.tan(u));break}case"asin":if(l<-1||l>1){s.push(NaN);break}s.push(g(Math.asin(l)));break;case"acos":if(l<-1||l>1){s.push(NaN);break}s.push(g(Math.acos(l)));break;case"atan":s.push(g(Math.atan(l)));break;case"sinh":s.push(Math.sinh(l));break;case"cosh":s.push(Math.cosh(l));break;case"tanh":s.push(Math.tanh(l));break;case"log":s.push(l<=0?NaN:Math.log10(l));break;case"ln":s.push(l<=0?NaN:Math.log(l));break;case"sqrt":s.push(l<0?NaN:Math.sqrt(l));break;case"cbrt":s.push(Math.cbrt(l));break;case"abs":s.push(Math.abs(l));break;case"factorial":s.push(we(l));break;case"tenPow":s.push(Math.pow(10,l));break;case"ePow":s.push(Math.exp(l));break;case"neg":s.push(-l);break;case"nroot":{const u=s.pop();s.push(Math.pow(u,1/l));break}default:s.push(NaN)}}return s.length===1?s[0]:NaN}function Ee(a){let f=0;for(const n of a)n==="("?f++:n===")"&&f--;return a+")".repeat(Math.max(0,f))}function Se(a){if(!isFinite(a))return isNaN(a)?"Math Error":a>0?"∞":"-∞";if(Number.isInteger(a)&&Math.abs(a)<1e15)return a.toString();if(Math.abs(a)>=1e10||Math.abs(a)<1e-10&&a!==0)return a.toExponential(6);const f=a.toPrecision(10);return parseFloat(f).toString()}function De(a,f,n){try{const s=Ee(a),d=ye(s);if(d.length===0)return"0";const g=je(d,f),p=Ae(g,f,n);return Se(p)}catch{return"Error"}}const Re=({isOpen:a,onClose:f,inline:n=!1})=>{const[s,d]=c.useState(""),[g,p]=c.useState("0"),[b,l]=c.useState(""),[u,x]=c.useState("DEG"),[y,N]=c.useState(!1),[R,T]=c.useState(!1),[k,J]=c.useState(0),[M,Q]=c.useState([]),[O,A]=c.useState(!1),[P,H]=c.useState(!1),[j,E]=c.useState(null),[w,ee]=c.useState(()=>{try{return localStorage.getItem("mathpulse_calc_minimized")==="true"}catch{return!1}}),[V,q]=c.useState(!1),[te,se]=c.useState(!1),C=c.useRef(null),z=c.useRef(null),X=c.useRef(!1),[S,I]=c.useState({x:0,y:0});c.useEffect(()=>{a&&I({x:Math.round((window.innerWidth-380)/2),y:Math.max(20,Math.round((window.innerHeight-600)/2))})},[a]),c.useEffect(()=>{try{localStorage.setItem("mathpulse_calc_minimized",String(w))}catch{}},[w]),c.useEffect(()=>{C.current&&(C.current.scrollLeft=C.current.scrollWidth)},[s]),c.useEffect(()=>{const r=o=>{z.current&&!z.current.contains(o.target)&&q(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]),c.useEffect(()=>{if(!a)return;const r=o=>{if(!V)return;const t=o.key;if(o.altKey){if(o.preventDefault(),o.shiftKey){if(t==="S"||t==="s"){h("asin");return}if(t==="C"||t==="c"){h("acos");return}if(t==="T"||t==="t"){h("atan");return}}if(t==="s"||t==="S"){h("sin");return}if(t==="c"||t==="C"){h("cos");return}if(t==="t"||t==="T"){h("tan");return}if(t==="l"||t==="L"){h("log");return}if(t==="n"||t==="N"){h("ln");return}if(t==="r"||t==="R"){h("sqrt");return}if(t==="p"||t==="P"){i("π");return}if(t==="e"||t==="E"){i("e");return}if(t==="2"){i("²");return}if(t==="3"){i("³");return}if(t==="^"||t==="6"){i("^");return}if(t==="a"||t==="A"){i("Ans");return}if(t==="d"||t==="D"){W();return}return}o.stopPropagation(),/^[0-9.]$/.test(t)?(i(t),o.preventDefault()):t==="+"?(i("+"),o.preventDefault()):t==="-"?(i("-"),o.preventDefault()):t==="*"?(i("×"),o.preventDefault()):t==="/"?(i("÷"),o.preventDefault()):t==="%"?(i("%"),o.preventDefault()):t==="("?(i("("),o.preventDefault()):t===")"?(i(")"),o.preventDefault()):t==="^"?(i("^"),o.preventDefault()):t==="Enter"||t==="="?(G(),o.preventDefault()):t==="Backspace"?(_(),o.preventDefault()):(t==="Escape"||t==="Delete")&&(B(),o.preventDefault())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[a,V,s,k,u]);const i=c.useCallback(r=>{A(!1),E(null),d(o=>o+r)},[]),h=c.useCallback(r=>{A(!1),E(null),d(o=>o+r+"("),N(!1)},[]),_=c.useCallback(()=>{d(r=>r.slice(0,-1)),A(!1)},[]),B=c.useCallback(()=>{d(""),p("0"),l(""),A(!1),E(null)},[]),G=c.useCallback(()=>{if(!s.trim())return;const r=De(s,u,k),o=r==="Error"||r==="Math Error";if(A(o),p(r),!o){const t=parseFloat(r);isNaN(t)||J(t),Q(m=>[...m.slice(-19),{expression:s,result:r}]),l(s+" =")}d("")},[s,u,k]),W=c.useCallback(()=>{x(r=>r==="DEG"?"RAD":"DEG")},[]),ae=c.useCallback(()=>{N(r=>!r),T(!1)},[]),ne=c.useCallback(()=>{T(r=>!r),N(!1)},[]),le=c.useCallback(()=>{i("Ans")},[i]),Y=c.useCallback(()=>{i("×10^")},[i]),ie=c.useCallback(async()=>{const r=s.trim()||(M.length>0?M[M.length-1].expression:"");if(r){H(!0);try{const o=r.replace(/×/g,"*").replace(/÷/g,"/").replace(/π/g,"pi").replace(/Ans/g,String(k)).replace(/(\d)\(/g,"$1*(").replace(/\)(\d)/g,")*$1"),t=await de.evaluateExpression(o);E(t)}catch{E({expression:r,result:"Verification unavailable",steps:["Backend unavailable — using client-side result"],simplified:null,latex:null})}finally{H(!1)}}},[s,M,k]),re=[[{label:"SHIFT",action:ae,variant:"shift"},{label:"ALPHA",action:ne,variant:"shift"},{label:u,action:W,variant:"mode"},{label:"◀",action:()=>{_()},variant:"mode"},{label:"▶",action:()=>{i(" ")},variant:"mode"}],[{label:"x²",shiftLabel:"√",action:()=>i("^2"),shiftAction:()=>h("sqrt"),variant:"func"},{label:"x³",shiftLabel:"³√",action:()=>i("^3"),shiftAction:()=>h("cbrt"),variant:"func"},{label:"xʸ",shiftLabel:"ʸ√x",action:()=>i("^"),shiftAction:()=>h("nroot"),variant:"func"},{label:"log",shiftLabel:"10ˣ",action:()=>h("log"),shiftAction:()=>h("tenPow"),variant:"func"},{label:"ln",shiftLabel:"eˣ",action:()=>h("ln"),shiftAction:()=>h("ePow"),variant:"func"}],[{label:"√",shiftLabel:"x²",action:()=>h("sqrt"),shiftAction:()=>i("^2"),variant:"func"},{label:"³√",shiftLabel:"x³",action:()=>h("cbrt"),shiftAction:()=>i("^3"),variant:"func"},{label:"ʸ√x",shiftLabel:"xʸ",action:()=>h("nroot"),shiftAction:()=>i("^"),variant:"func"},{label:"sin",shiftLabel:"sin⁻¹",action:()=>h("sin"),shiftAction:()=>h("asin"),variant:"func"},{label:"cos",shiftLabel:"cos⁻¹",action:()=>h("cos"),shiftAction:()=>h("acos"),variant:"func"}],[{label:"tan",shiftLabel:"tan⁻¹",action:()=>h("tan"),shiftAction:()=>h("atan"),variant:"func"},{label:"sin⁻¹",shiftLabel:"sinh",action:()=>h("asin"),shiftAction:()=>h("sinh"),variant:"func"},{label:"cos⁻¹",shiftLabel:"cosh",action:()=>h("acos"),shiftAction:()=>h("cosh"),variant:"func"},{label:"tan⁻¹",shiftLabel:"tanh",action:()=>h("atan"),shiftAction:()=>h("tanh"),variant:"func"},{label:"π",action:()=>i("π"),variant:"func"}],[{label:"(",action:()=>i("("),variant:"func"},{label:")",action:()=>i(")"),variant:"func"},{label:"e",action:()=>i("e"),variant:"func"},{label:"EXP",action:Y,variant:"func"},{label:"%",action:()=>i("%"),variant:"func"}],[{label:"7",action:()=>i("7"),variant:"number"},{label:"8",action:()=>i("8"),variant:"number"},{label:"9",action:()=>i("9"),variant:"number"},{label:"DEL",action:_,variant:"del"},{label:"AC",action:B,variant:"del"}],[{label:"4",action:()=>i("4"),variant:"number"},{label:"5",action:()=>i("5"),variant:"number"},{label:"6",action:()=>i("6"),variant:"number"},{label:"×",action:()=>i("×"),variant:"op"},{label:"÷",action:()=>i("÷"),variant:"op"}],[{label:"1",action:()=>i("1"),variant:"number"},{label:"2",action:()=>i("2"),variant:"number"},{label:"3",action:()=>i("3"),variant:"number"},{label:"+",action:()=>i("+"),variant:"op"},{label:"−",action:()=>i("-"),variant:"op"}],[{label:"0",action:()=>i("0"),variant:"number"},{label:".",action:()=>i("."),variant:"number"},{label:"×10ˣ",action:Y,variant:"func"},{label:"Ans",action:le,variant:"op"},{label:"=",action:G,variant:"equals"}]],oe=(r,o)=>{const t="flex items-center justify-center rounded-2xl font-bold transition-all duration-150 active:scale-95 select-none cursor-pointer touch-manipulation relative overflow-hidden",m="min-h-[56px] text-[16px]",v="min-h-[56px] text-[14px]";switch(r){case"number":return`${t} ${m} bg-white hover:bg-[#edf1f7] text-[#0a1628] border border-[#dde3eb] shadow-sm`;case"op":return`${t} ${m} bg-[#edf1f7] hover:bg-[#dde3eb] text-[#7274ED] border border-[#dde3eb] shadow-sm font-bold`;case"func":return`${t} ${v} bg-[#9956DE] hover:bg-[#8A4DCA] text-white shadow-md shadow-[#9956DE]/20`;case"del":return`${t} ${m} ${o==="AC"?"bg-[#FF8B8B] hover:bg-[#FF7373]":"bg-[#FB96BB] hover:bg-[#FA7DA9]"} text-[#8A1A1A] shadow-md shadow-red-900/10 font-bold border-none`;case"equals":return`${t} ${m} bg-[#1FA7E1] hover:bg-[#1C96CB] text-white shadow-lg shadow-[#1FA7E1]/30 font-bold text-lg`;case"shift":return`${t} ${v} bg-white hover:bg-[#edf1f7] text-[#9956DE] border border-[#dde3eb] shadow-sm font-bold uppercase tracking-wider text-[11px]`;case"mode":return`${t} ${v} bg-white hover:bg-[#edf1f7] text-[#1FA7E1] border border-[#dde3eb] shadow-sm font-bold`;default:return`${t} ${m} bg-slate-100 text-[#0a1628] border border-slate-200`}},ce=c.useCallback(r=>{r.preventDefault(),X.current=!0;const o=r.clientX,t=r.clientY,m=S.x,v=S.y,L=D=>{const $=m+(D.clientX-o),he=v+(D.clientY-t);I({x:$,y:he})},F=D=>{X.current=!1;const $={x:m+(D.clientX-o),y:v+(D.clientY-t)};I($);try{localStorage.setItem("mathpulse_calc_position",JSON.stringify($))}catch{}document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",F)};document.addEventListener("mousemove",L),document.addEventListener("mouseup",F)},[S]);if(!a)return null;const K=e.jsxs("div",{className:"flex flex-col w-full select-none",children:[e.jsxs("div",{className:"bg-white rounded-t-2xl p-4 border border-slate-200 border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:` - text-[10px] font-bold px-2 py-0.5 rounded-full - ${u==="DEG"?"bg-rose-500/20 text-rose-400 border border-sky-500/30":"bg-rose-500/20 text-rose-400 border border-rose-500/30"} - `,children:u}),y&&e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-[#6ED1CF]/30 text-[#1FA7E1] border border-[#1FA7E1]/40 animate-pulse",children:"SHIFT"}),R&&e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-sky-500/20 text-sky-400 border border-indigo-500/30",children:"ALPHA"}),P&&e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-sky-500/20 text-sky-400 border border-sky-500/30 animate-pulse",children:"Verifying…"})]}),e.jsx("div",{ref:C,className:"text-right text-slate-500 text-[14px] font-mono h-6 overflow-x-auto overflow-y-hidden whitespace-nowrap scrollbar-hide",children:b||" "}),e.jsx("div",{className:` - text-right font-mono font-bold text-[32px] leading-tight h-10 overflow-hidden whitespace-nowrap - ${O?"text-red-400":"text-[#0a1628]"} - `,children:s||g}),e.jsx(U,{children:j&&e.jsxs(ue.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-2 pt-2 border-t border-slate-300",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-sky-400"}),e.jsx("span",{className:"text-[10px] text-rose-400 font-semibold uppercase tracking-wider",children:"SymPy Verified"})]}),e.jsx("p",{className:"text-xs text-slate-500 font-mono",children:j.result}),j.latex&&e.jsxs("p",{className:"text-[10px] text-[#5a6578] font-mono mt-0.5",children:["LaTeX: ",j.latex]}),j.steps.length>1&&e.jsx("div",{className:"mt-1 space-y-0.5",children:j.steps.slice(1).map((r,o)=>e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:r},o))})]})})]}),e.jsxs("button",{onClick:ie,disabled:P,className:` - w-full py-1.5 bg-slate-50 border-x border-slate-200 - text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:bg-slate-100 - transition-colors disabled:opacity-50 disabled:cursor-not-allowed - flex items-center justify-center gap-1.5 - `,children:[e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),P?"Verifying with SymPy…":"Verify with SymPy"]}),e.jsx("div",{className:"bg-white rounded-b-2xl p-4 border border-slate-200 border-t-0 space-y-1.5",children:re.map((r,o)=>e.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:r.map((t,m)=>{const v=y&&t.shiftAction,L=v&&t.shiftLabel||t.label,F=v?t.shiftAction:t.action;return e.jsxs("button",{onClick:F,className:` - ${oe(t.variant,t.label)} - ${t.variant==="shift"&&t.label==="SHIFT"&&y?"!bg-[#6ED1CF]/35 !text-[#1FA7E1] ring-2 ring-[#1FA7E1]/35 border-[#1FA7E1]/30":""} - ${t.variant==="shift"&&t.label==="ALPHA"&&R?"!bg-[#7274ED] !text-white ring-2 ring-[#9956DE]/50":""} - ${t.colSpan?`col-span-${t.colSpan}`:""} - ${v&&t.variant==="func"?"!bg-gradient-to-br !from-[#6ED1CF] !to-[#1FA7E1] hover:!from-[#8FE4DA] hover:!to-[#49BDEB] !text-white shadow-md shadow-[#1FA7E1]/20":""} - ${t.variant==="op"&&!["DEL","AC"].includes(t.label)?"bg-gradient-to-br from-[#FFB356] to-[#FF8B8B] !text-white font-bold shadow-md":""} - relative - `,title:t.shiftLabel?`SHIFT: ${t.shiftLabel}`:void 0,children:[t.shiftLabel&&!y&&e.jsx("span",{className:"absolute top-1 right-1 text-[10px] leading-none bg-white/95 text-[#9956DE] font-black px-1.5 py-0.5 rounded-md shadow-sm",children:t.shiftLabel}),e.jsx("span",{className:v?"text-[#EAFBFF]":"",children:L})]},m)})},o))}),te&&e.jsx("div",{className:"bg-slate-50 border-t border-slate-200 text-xs text-slate-500 p-3 rounded-b-2xl",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+S"}),e.jsx("span",{children:"sin("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+S"}),e.jsx("span",{children:"sin⁻¹("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+C"}),e.jsx("span",{children:"cos("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+C"}),e.jsx("span",{children:"cos⁻¹("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+T"}),e.jsx("span",{children:"tan("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+T"}),e.jsx("span",{children:"tan⁻¹("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+L"}),e.jsx("span",{children:"log("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+N"}),e.jsx("span",{children:"ln("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+R"}),e.jsx("span",{children:"√("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+P"}),e.jsx("span",{children:"π"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+E"}),e.jsx("span",{children:"e"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+2"}),e.jsx("span",{children:"²"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+3"}),e.jsx("span",{children:"³"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+^"}),e.jsx("span",{children:"^"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+A"}),e.jsx("span",{children:"Ans"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+D"}),e.jsx("span",{children:"DEG/RAD"})]})]})})]});return n?K:e.jsx(U,{children:a&&e.jsxs("div",{ref:z,className:"fixed z-50",style:{top:S.y,left:S.x,width:380},onClick:()=>q(!0),children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 rounded-t-2xl px-4 py-2.5 flex items-center justify-between",style:{cursor:"move"},onMouseDown:ce,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(me,{size:14,className:"text-white/50"}),e.jsx("h3",{className:"text-white font-bold text-sm",children:"Scientific Calculator"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>se(r=>!r),className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",title:"Keyboard shortcuts",children:e.jsx(ve,{size:14,className:"text-white"})}),e.jsx("button",{onClick:()=>ee(!w),className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",children:w?e.jsx(fe,{size:14,className:"text-white"}):e.jsx(pe,{size:14,className:"text-white"})}),e.jsx("button",{onClick:f,className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",children:e.jsx(be,{size:14,className:"text-white"})})]})]}),!w&&K,w&&e.jsx("div",{className:"bg-slate-50 rounded-b-2xl p-3 border border-slate-200 border-t-0",children:e.jsx("p",{className:"text-right text-[#0a1628] font-mono font-bold text-lg",children:g})})]})})};export{Re as default}; diff --git a/assets/SearchBar-ldiC0sUv.js b/assets/SearchBar-ldiC0sUv.js deleted file mode 100644 index fda0282ec5aa66fb5365f4c2d8063b013770cde4..0000000000000000000000000000000000000000 --- a/assets/SearchBar-ldiC0sUv.js +++ /dev/null @@ -1 +0,0 @@ -import{r as o,j as e}from"./vendor-react-Dexh7fmo.js";import{S as m}from"./search-Do6u3pFt.js";import{m as n,e as C}from"./index-D4nJsLyx.js";import{X as k}from"./x-BONnp2RF.js";import{C as S}from"./clock-DUJO-a50.js";import{B as a}from"./book-open-BH50GByv.js";import{T as c}from"./trending-up-D-vj8Gbq.js";import{U as d}from"./users-HMf2sdE3.js";import{G}from"./graduation-cap-Df8fGPxp.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const K=({placeholder:b="Search anything...",userRole:p="student",onSelect:y})=>{const[i,l]=o.useState(""),[g,r]=o.useState(!1),[x,f]=o.useState([]),u=o.useRef(null),v=()=>p==="student"?[{id:"1",type:"module",title:"General Mathematics",subtitle:"Grade 11 • Functions & Business Math",icon:a},{id:"2",type:"module",title:"Statistics & Probability",subtitle:"Grade 11 • Distributions & Testing",icon:a},{id:"3",type:"module",title:"Pre-Calculus",subtitle:"Grade 12 • Analytic Geometry & Trig",icon:a},{id:"4",type:"module",title:"Basic Calculus",subtitle:"Grade 12 • Limits & Derivatives",icon:a},{id:"5",type:"page",title:"AI Chat",subtitle:"Get help from AI tutor",icon:c},{id:"6",type:"page",title:"My Progress",subtitle:"View your achievements",icon:c}]:p==="teacher"?[{id:"1",type:"student",title:"Alex Johnson",subtitle:"Grade 11 • Level 12",icon:d},{id:"2",type:"student",title:"Sarah Williams",subtitle:"Grade 12 • Level 11",icon:d},{id:"3",type:"module",title:"Gen Math Quiz 5",subtitle:"12 submissions",icon:a},{id:"4",type:"page",title:"Analytics",subtitle:"Class performance overview",icon:c},{id:"5",type:"page",title:"Create Assignment",subtitle:"New homework or quiz",icon:a}]:[{id:"1",type:"teacher",title:"Prof. Anderson",subtitle:"48 students • Math Dept",icon:G},{id:"2",type:"student",title:"Alex Johnson",subtitle:"Top Performer • Level 12",icon:d},{id:"3",type:"page",title:"System Settings",subtitle:"Platform configuration",icon:c},{id:"4",type:"page",title:"Reports",subtitle:"Export analytics",icon:a},{id:"5",type:"page",title:"User Management",subtitle:"Manage accounts",icon:d}],w=["Functions and Relations","Normal Distribution","AI Chat"];o.useEffect(()=>{if(i.trim()){const s=v().filter(h=>h.title.toLowerCase().includes(i.toLowerCase())||h.subtitle?.toLowerCase().includes(i.toLowerCase()));f(s)}else f([])},[i]);const j=t=>{l(""),r(!1),y?.(t)},N=()=>{l(""),u.current?.focus()};return o.useEffect(()=>{const t=s=>{s.ctrlKey&&s.key.toLowerCase()==="k"&&(s.preventDefault(),u.current?.focus(),r(!0))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),e.jsxs("div",{className:"relative w-full max-w-xl",children:[e.jsxs("div",{className:"relative",children:[e.jsx(m,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx("input",{ref:u,id:"global-search",name:"global-search","aria-label":"Search anything",type:"text",value:i,onChange:t=>l(t.target.value),onFocus:()=>r(!0),placeholder:b,className:"w-full pl-11 pr-24 py-2.5 bg-white border border-[#dde3eb] rounded-lg text-[#0a1628] placeholder-[#a8a5b3] font-body text-sm focus:bg-white focus:border-sky-400 focus:ring-2 focus:ring-sky-400/15 focus:outline-none transition-all"}),e.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[i&&e.jsx(n.button,{initial:{scale:0},animate:{scale:1},exit:{scale:0},whileHover:{scale:1.1},whileTap:{scale:.9},onClick:N,className:"p-1.5 text-slate-500 hover:text-[#5a6578] hover:bg-[#edf1f7] rounded-md transition-colors",children:e.jsx(k,{size:14})}),e.jsx("kbd",{className:"hidden sm:inline-flex px-2 py-0.5 text-[10px] font-body font-semibold text-slate-500 bg-[#edf1f7] border border-[#dde3eb] rounded-md",children:"Ctrl+K"})]})]}),e.jsx(C,{children:g&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),e.jsx(n.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute top-full left-0 right-0 mt-2 bg-white rounded-xl shadow-lg border border-[#dde3eb] z-50 overflow-hidden max-h-96 overflow-y-auto",children:i.trim()?x.length>0?e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Results"}),x.map(t=>{const s=t.icon||m;return e.jsxs(n.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>j(t),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[e.jsx("div",{className:"w-9 h-9 bg-sky-500/10 rounded-lg flex items-center justify-center text-sky-600 flex-shrink-0",children:e.jsx(s,{size:16})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-sm font-body font-semibold text-[#0a1628] truncate",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-xs font-body text-[#5a6578] truncate",children:t.subtitle})]})]},t.id)})]}):e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(m,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] font-body text-sm",children:"No results found"}),e.jsx("p",{className:"text-slate-500 font-body text-xs mt-1",children:"Try a different search term"})]}):e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Recent Searches"}),w.map((t,s)=>e.jsxs(n.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>l(t),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[e.jsx(S,{size:16,className:"text-slate-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-body text-[#0a1628]",children:t})]},s))]})})]})})]})};export{K as default}; diff --git a/assets/SettingsModal-C-nK3nbS.js b/assets/SettingsModal-C-nK3nbS.js deleted file mode 100644 index b281e0945968bc3498c3385821691bceca49d05b..0000000000000000000000000000000000000000 --- a/assets/SettingsModal-C-nK3nbS.js +++ /dev/null @@ -1,11 +0,0 @@ -import{r as i,j as e}from"./vendor-react-Dexh7fmo.js";import{c as ee,e as be,m as S,D as ue,t as c}from"./index-D4nJsLyx.js";import{B as x}from"./button-BpeUVhBo.js";import{I as l}from"./input-DBkKXOmF.js";import{S as m}from"./switch-eyvBOdtY.js";import W from"./ConfirmModal-DGrnpObD.js";import{U as fe}from"./user-CaTzqgOL.js";import{B as pe}from"./bell-CbSbac2W.js";import{S as ye}from"./shield-L33jkK5w.js";import{G as je}from"./globe-BMa4SWkV.js";import{D as Y}from"./download-PWUf0XJa.js";import{X as Z}from"./x-BONnp2RF.js";import{L as ge}from"./lock-_59co5m5.js";import{C as Ne}from"./clock-DUJO-a50.js";import{T as ve}from"./trash-2-BoXE_mye.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-BRdei-zg.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./log-out-BqGKt-tT.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const we=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],ke=ee("palette",we);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ce=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Se=ee("smartphone",Ce),F=()=>JSON.parse(JSON.stringify(ue)),We=({isOpen:u,onClose:g,profileData:o,onSave:I,settingsData:v,onSaveSettings:L,onApplySettingsPreview:N,onUpdatePassword:E,onExportData:H,onClearCache:O,onDeleteAccount:z,onResetData:w})=>{const[h,te]=i.useState("account"),[a,d]=i.useState({}),[n,U]=i.useState(F()),[P,G]=i.useState(!1),[p,_]=i.useState(!1),[A,Q]=i.useState(!1),[R,V]=i.useState(!1),[y,X]=i.useState(!1),[se,k]=i.useState(!1),[ae,C]=i.useState(!1),[ne,j]=i.useState(!1),[b,B]=i.useState(!1),[J,f]=i.useState(""),T=i.useRef(!1),M=i.useRef(F());i.useEffect(()=>{if(!u){T.current=!1;return}if(T.current)return;T.current=!0;const t=v?JSON.parse(JSON.stringify(v)):F();M.current=t,d({uid:o?.uid,name:o?.name||"",email:o?.email||"",phone:o?.phone||"",photo:o?.photo||"",avatarLayers:o?.avatarLayers,role:o?.role,lrn:o?.lrn||"",grade:o?.grade||"",section:o?.section||"",school:o?.school||"",department:o?.department||"",subject:o?.subject||"",yearsOfExperience:o?.yearsOfExperience||"",qualification:o?.qualification||"",position:o?.position||""}),U(t)},[u,o,v]),i.useEffect(()=>{u&&N?.(n)},[u,n,N]),i.useEffect(()=>{if(!u)return;const t=s=>{s.key==="Escape"&&(N?.(M.current),g())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[u,g,N,v]);const $=i.useMemo(()=>[{id:"account",label:"Account",icon:fe},{id:"notifications",label:"Notifications",icon:pe},{id:"appearance",label:"Appearance",icon:ke},{id:"privacy",label:"Privacy & Security",icon:ye},{id:"learning",label:"Learning",icon:je},{id:"data",label:"Data & Storage",icon:Y}],[]),r=t=>{U(s=>t(s))},re=async()=>{G(!0);try{I&&await I(a),L&&await L(n),g()}catch(t){console.error("Error saving settings:",t),c.error(t instanceof Error?t.message:"Failed to save settings")}finally{G(!1)}},q=()=>{k(!1),C(!1),j(!1),f(""),N?.(M.current),g()},ie=()=>{!w||p||k(!0)},le=async()=>{if(!(!w||p)){k(!1),_(!0);try{await w(),c.success("Testing data reset completed")}catch(t){console.error("Error resetting testing data:",t),c.error(t instanceof Error?t.message:"Failed to reset testing data")}finally{_(!1)}}},oe=async()=>{if(!E){c.info("Password update is not available in this environment.");return}f(""),j(!0)},K=async()=>{if(!E||b)return;const t=J.trim();if(!t){c.error("Password is required.");return}if(t.length<8){c.error("Password must be at least 8 characters long.");return}B(!0);try{await E(t),c.success("Password updated successfully."),j(!1),f("")}catch(s){console.error("Error updating password:",s),c.error(s instanceof Error?s.message:"Failed to update password")}finally{B(!1)}},ce=()=>{c.info("Two-factor authentication setup is not enabled for this project yet.")},de=async()=>{if(!H||A){c.info("Data export is not available right now.");return}Q(!0);try{await H()}catch(t){console.error("Error exporting data:",t),c.error(t instanceof Error?t.message:"Failed to export data")}finally{Q(!1)}},xe=async()=>{if(!O||R){c.info("Cache clearing is not available right now.");return}V(!0);try{await O()}catch(t){console.error("Error clearing cache:",t),c.error(t instanceof Error?t.message:"Failed to clear cache")}finally{V(!1)}},me=()=>{if(!z||y){c.info("Account deletion is not available right now.");return}C(!0)},he=async()=>{if(!(!z||y)){C(!1),X(!0);try{await z(),g()}catch(t){console.error("Error deleting account:",t),c.error(t instanceof Error?t.message:"Failed to delete account")}finally{X(!1)}}};return u?e.jsx(be,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:q,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(S.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-4xl max-h-[85vh] overflow-hidden flex",children:[e.jsxs("div",{className:"w-64 bg-slate-50 border-r border-slate-200 p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:$.map(t=>{const s=t.icon;return e.jsxs("button",{onClick:()=>te(t.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${h===t.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(s,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:t.label})]},t.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:$.find(t=>t.id===h)?.label}),e.jsx("button",{onClick:q,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Z,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[h==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(l,{type:"text",value:a.name||"",onChange:t=>d(s=>({...s,name:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsx(l,{type:"email",value:a.email||"",onChange:t=>d(s=>({...s,email:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(l,{type:"tel",value:a.phone||"",onChange:t=>d(s=>({...s,phone:t.target.value})),className:"max-w-md"})]}),a.role==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Learner's Reference Number (LRN)"}),e.jsx(l,{type:"text",value:a.lrn||"",onChange:t=>d(s=>({...s,lrn:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(l,{type:"text",value:a.grade||"",onChange:t=>d(s=>({...s,grade:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(l,{type:"text",value:a.section||"",onChange:t=>d(s=>({...s,section:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(l,{type:"text",value:a.school||"",onChange:t=>d(s=>({...s,school:t.target.value})),className:"max-w-md"})]})]}),a.role==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(l,{type:"text",value:a.department||"",onChange:t=>d(s=>({...s,department:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(l,{type:"text",value:a.subject||"",onChange:t=>d(s=>({...s,subject:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(l,{type:"text",value:a.yearsOfExperience||"",onChange:t=>d(s=>({...s,yearsOfExperience:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Qualification"}),e.jsx(l,{type:"text",value:a.qualification||"",onChange:t=>d(s=>({...s,qualification:t.target.value})),className:"max-w-md"})]})]}),a.role==="admin"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(l,{type:"text",value:a.position||"",onChange:t=>d(s=>({...s,position:t.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(l,{type:"text",value:a.department||"",onChange:t=>d(s=>({...s,department:t.target.value})),className:"max-w-md"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Role"}),e.jsx(l,{type:"text",value:a.role||"",className:"max-w-md bg-slate-100",disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(x,{variant:"outline",className:"rounded-xl",onClick:oe,children:[e.jsx(ge,{size:16,className:"mr-2"}),"Update Password"]})]}),e.jsx("div",{className:"pt-4 border-t border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Two-Factor Authentication"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Add an extra layer of security"})]}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ce,children:"Enable"})]})})]}),h==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Email Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Receive updates via email"})]}),e.jsx(m,{checked:n.notifications.emailNotifications,onCheckedChange:t=>r(s=>({...s,notifications:{...s.notifications,emailNotifications:t}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(m,{checked:n.notifications.pushNotifications,onCheckedChange:t=>r(s=>({...s,notifications:{...s.notifications,pushNotifications:t}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(m,{checked:n.notifications.soundEnabled,onCheckedChange:t=>r(s=>({...s,notifications:{...s.notifications,soundEnabled:t}}))})]}),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(t=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:n.notifications.notificationTypes[t.key],onChange:s=>r(D=>({...D,notifications:{...D.notifications,notificationTypes:{...D.notifications.notificationTypes,[t.key]:s.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:t.label})]},t.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(Ne,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{type:"time",value:n.notifications.quietHours.start,onChange:t=>r(s=>({...s,notifications:{...s.notifications,quietHours:{...s.notifications.quietHours,start:t.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(l,{type:"time",value:n.notifications.quietHours.end,onChange:t=>r(s=>({...s,notifications:{...s.notifications,quietHours:{...s.notifications.quietHours,end:t.target.value}}})),className:"w-32"})]}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"No notifications during this time"})]})]}),h==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Smart invert colors like extension dark mode"})]}),e.jsx(m,{checked:n.appearance.darkMode,onCheckedChange:t=>r(s=>({...s,appearance:{...s.appearance,darkMode:t}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:n.appearance.fontSize,onChange:t=>r(s=>({...s,appearance:{...s.appearance,fontSize:Number(t.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(m,{checked:n.appearance.compactView,onCheckedChange:t=>r(s=>({...s,appearance:{...s.appearance,compactView:t}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(m,{checked:n.appearance.reduceAnimations,onCheckedChange:t=>r(s=>({...s,appearance:{...s.appearance,reduceAnimations:t}}))})]})]}),h==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:n.privacy.profileVisibility,onChange:t=>r(s=>({...s,privacy:{...s.privacy,profileVisibility:t.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(m,{checked:n.privacy.showActivityStatus,onCheckedChange:t=>r(s=>({...s,privacy:{...s.privacy,showActivityStatus:t}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(m,{checked:n.privacy.dataSharing,onCheckedChange:t=>r(s=>({...s,privacy:{...s.privacy,dataSharing:t}}))})]})]}),h==="learning"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(l,{type:"number",value:n.learning.dailyXpGoal,onChange:t=>r(s=>({...s,learning:{...s.learning,dailyXpGoal:Number(t.target.value||0)}})),className:"max-w-xs"}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Set your daily learning target"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:n.learning.preferredStudyTime,onChange:t=>r(s=>({...s,learning:{...s.learning,preferredStudyTime:t.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12AM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(m,{checked:n.learning.autoPlayLessons,onCheckedChange:t=>r(s=>({...s,learning:{...s.learning,autoPlayLessons:t}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(m,{checked:n.learning.showHints,onCheckedChange:t=>r(s=>({...s,learning:{...s.learning,showHints:t}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:n.learning.quizDifficultyPreference,onChange:t=>r(s=>({...s,learning:{...s.learning,quizDifficultyPreference:t.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(Se,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(l,{type:"time",value:n.learning.studyReminderTime,onChange:t=>r(s=>({...s,learning:{...s.learning,studyReminderTime:t.target.value}})),className:"w-32"}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Daily reminder to study"})]})]}),h==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:de,disabled:A,children:[e.jsx(Y,{size:16,className:"mr-2"}),A?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:xe,disabled:R,children:R?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[(a.role||"student")==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",a.role==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts for retesting.",a.role==="admin"&&"Reset admin testing artifacts like personal audit/content update records for QA loops."]}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!w||p,onClick:ie,children:p?"Resetting...":"Reset Testing Data"})]}),a.role==="admin"?e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(x,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:me,disabled:y,children:[e.jsx(ve,{size:16,className:"mr-2"}),y?"Deleting...":"Delete Account"]})]}):e.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-emerald-900 mb-1 font-body",children:"Protected Account Controls"}),e.jsx("p",{className:"text-xs text-emerald-700",children:"Account deletion is restricted to administrator accounts."})]})]})]}),e.jsxs("div",{className:"p-6 border-t border-[#dde3eb] bg-[#edf1f7] flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"outline",onClick:q,className:"rounded-lg border-[#dde3eb]",disabled:P,children:"Cancel"}),e.jsx(x,{onClick:re,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white",disabled:P,children:P?"Saving...":"Save Changes"})]})]})]})]})]}),ne?e.jsx(S.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:()=>{b||(j(!1),f(""))},children:e.jsxs(S.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:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsx("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:"Update Password"}),e.jsx("button",{onClick:()=>{b||(j(!1),f(""))},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close password update dialog",children:e.jsx(Z,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter a new password with at least 8 characters."}),e.jsx(l,{type:"password",value:J,onChange:t=>f(t.target.value),placeholder:"New password",autoFocus:!0,onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),K())},disabled:b}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(x,{variant:"outline",onClick:()=>{b||(j(!1),f(""))},disabled:b,children:"Cancel"}),e.jsx(x,{onClick:K,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:b,children:b?"Updating...":"Update Password"})]})]})]})}):null,e.jsx(W,{isOpen:se,onClose:()=>{p||k(!1)},onConfirm:le,title:"Reset Testing Data?",message:`Reset ${a.role||"student"} testing data? This action is for QA/demo use and cannot be undone.`,confirmText:p?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(W,{isOpen:ae,onClose:()=>{y||C(!1)},onConfirm:he,title:"Delete Account?",message:"Delete account permanently? This action cannot be undone.",confirmText:y?"Deleting...":"Delete Account",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{We as default}; diff --git a/assets/Sidebar-xBQ3Qnyw.js b/assets/Sidebar-xBQ3Qnyw.js deleted file mode 100644 index 88df7a397c3e44dd476df30fac82c459c9e29c8f..0000000000000000000000000000000000000000 --- a/assets/Sidebar-xBQ3Qnyw.js +++ /dev/null @@ -1 +0,0 @@ -import{r as S,j as e}from"./vendor-react-Dexh7fmo.js";import{C as k,S as C,a as L,L as d}from"./LogoutActionButton-FS5OGZjL.js";import{c as M}from"./utils-BQQgILNW.js";import{m as o}from"./index-D4nJsLyx.js";import{X as A}from"./x-BONnp2RF.js";import{C as z}from"./chevron-right-COMox1Xb.js";import{U as f}from"./users-HMf2sdE3.js";import{B as c}from"./book-open-BH50GByv.js";import{C as u}from"./chart-column-D5mAWcRx.js";import{S as B}from"./shield-L33jkK5w.js";import{M as I}from"./message-square-DSAS4TVL.js";import{G as E}from"./graduation-cap-Df8fGPxp.js";import{S as H}from"./swords-8_KH18p7.js";import{T}from"./trophy-C2nVcZnb.js";import{S as $}from"./shirt-BMZy0pq4.js";import"./log-out-BqGKt-tT.js";import"./clsx-B-dksMZM.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const oe=({activeTab:i,setActiveTab:g,userRole:m="student",onOpenSettings:j,onLogout:b,sidebarCollapsed:a=!1,setSidebarCollapsed:p,mode:v="desktop",onRequestClose:x})=>{const[l,h]=S.useState(!1),r=v==="mobile",s=!r&&a&&!l,y=!r,w=m==="admin"?[{label:"Management",items:[{icon:d,label:"Overview"},{icon:f,label:"User Management"},{icon:c,label:"Content"}]},{label:"Insights",items:[{icon:u,label:"Analytics"},{icon:B,label:"Audit Log"}]}]:m==="teacher"?[{label:"Teaching",items:[{icon:d,label:"Dashboard"},{icon:f,label:"My Students"},{icon:c,label:"Classes"}]},{label:"Insights",items:[{icon:u,label:"Analytics"}]}]:[{label:"Learn",items:[{icon:d,label:"Dashboard"},{icon:c,label:"Modules"},{icon:I,label:"AI Chat"}]},{label:"Progress",items:[{icon:E,label:"Grades",displayLabel:"Assessment"},{icon:H,label:"Quiz Battle",displayLabel:"Quiz Battle"},{icon:T,label:"Leaderboard",displayLabel:"Leadership Board"}]},{label:"Customization",items:[{icon:$,label:"Avatar Studio",displayLabel:"Avatar Studio"}]}];return e.jsxs(o.aside,{initial:!1,animate:r?{width:280}:{width:a&&!l?80:280},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>y&&a&&h(!0),onMouseLeave:()=>h(!1),className:M("h-full bg-[#f7f9fc] border border-[#dde3eb] shadow-sm flex flex-col",r?"rounded-2xl p-4":"rounded-3xl p-5"),children:[e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:`mb-8 flex items-center ${s?"justify-center":"justify-between"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI",className:"w-12 h-12 object-contain drop-shadow-md flex-shrink-0"}),(!s||l)&&e.jsx("div",{children:e.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),r&&x&&e.jsx("button",{onClick:x,className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:e.jsx(A,{size:20})}),!r&&p&&(!a||l)&&e.jsx(o.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>p(!a),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":a?"Expand sidebar":"Collapse sidebar",title:a?"Expand sidebar":"Collapse sidebar",children:a?e.jsx(z,{size:20}):e.jsx(k,{size:20})})]}),e.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto space-y-5 pr-1",children:w.map((n,N)=>e.jsxs("div",{children:[s?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):n.label&&e.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:n.label}),e.jsx("div",{className:"space-y-1",children:n.items.map(t=>e.jsxs(o.button,{whileHover:{x:2},whileTap:{scale:.98},onClick:()=>g(t.label),className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${s?"justify-center":""} ${i===t.label?"bg-sky-50 border-sky-200 shadow-sm text-sky-700":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[e.jsx(t.icon,{size:18,strokeWidth:i===t.label?2.5:2,className:"flex-shrink-0"}),(!s||l)&&e.jsx("span",{className:"font-body font-bold text-xs",children:t.displayLabel||t.label}),i===t.label&&(!s||l)&&e.jsx(o.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-sky-500",transition:{type:"spring",duration:.4}})]},t.label))})]},N))})]}),e.jsxs("div",{className:"mt-4 space-y-2 border-t border-[#dde3eb] pt-4",children:[e.jsxs(o.button,{whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-bold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap ${s?"justify-center":""}`,onClick:j,title:s?"Settings":"",children:[e.jsx(C,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!s||l)&&e.jsx("span",{className:"font-body text-xs",children:"Settings"})]}),b&&e.jsx("div",{className:"text-[#5a6578]",children:e.jsx(L,{onClick:b,collapsed:s})})]})]})};export{oe as default}; diff --git a/assets/SupplementalBanner-dklPrubU.js b/assets/SupplementalBanner-dklPrubU.js deleted file mode 100644 index da9117894469ba312bc9abe82c06f6659574928b..0000000000000000000000000000000000000000 --- a/assets/SupplementalBanner-dklPrubU.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,r as y}from"./vendor-react-Dexh7fmo.js";import{e as j,m as p,T as h}from"./index-D4nJsLyx.js";import{X as v}from"./x-BONnp2RF.js";import{S as w}from"./sparkles-CXUFmaBJ.js";import{C as f}from"./chevron-right-COMox1Xb.js";import{B as g}from"./book-open-BH50GByv.js";import{T as m}from"./trending-up-D-vj8Gbq.js";import{B as x}from"./brain-CPvGdgWE.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(g,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(x,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(x,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(x,{size:14})}]};function u(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=y.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(j,{children:!l&&e.jsx(p.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-10,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"relative bg-gradient-to-r from-sky-600 via-sky-500 to-sky-600 rounded-2xl p-5 text-white shadow-lg shadow-sky-500/20",children:[e.jsx("button",{onClick:r,className:"absolute top-3 right-3 w-7 h-7 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center transition-colors",children:e.jsx(v,{size:14})}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(w,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),e.jsx("p",{className:"text-sky-100 text-sm mb-3",children:"Based on your diagnostic assessment, we've identified topics that could use extra practice. Strengthening these areas will improve your overall performance."}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:i.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-semibold",children:[e.jsx(h,{size:12}),N(t)]},t))}),e.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 bg-white text-sky-600 font-bold text-sm px-4 py-2 rounded-xl hover:bg-sky-50 transition-colors",children:["Review Topics",e.jsx(f,{size:16})]})]})]})]})})})},C=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?u(i):null;if(!s.some(r=>{const t=u(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area — ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},z=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?u(i):null,r=n.some(c=>{const d=u(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(g,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["— ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Open Practice Center",e.jsx(f,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(C,{...i});case"results":return e.jsx(z,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default}; diff --git a/assets/TeacherDashboard-D8avlB5m.js b/assets/TeacherDashboard-D8avlB5m.js deleted file mode 100644 index 86d9ed188cff36ba02bf0d98a78fd9e7f084d9de..0000000000000000000000000000000000000000 --- a/assets/TeacherDashboard-D8avlB5m.js +++ /dev/null @@ -1,39 +0,0 @@ -import{r as d,j as e,c as fe}from"./vendor-react-Dexh7fmo.js";import{B as Me}from"./button-BpeUVhBo.js";import{I as bt}from"./input-DBkKXOmF.js";import Er from"./ConfirmModal-DGrnpObD.js";import{C as Et,L as Rr,S as _r,a as Br}from"./LogoutActionButton-FS5OGZjL.js";import{c as wt,d as Te,e as et,m as ie,Z as qa,u as Wt,t as U,C as Dr,T as At,g as Fr,M as Gr}from"./index-D4nJsLyx.js";import{e as nt,q as Ve,l as Qr,w as Ye,f as He,o as Ur,j as qr,s as tt,d as Be,u as Ke,b as ut,a as Oe}from"./vendor-firebase-firestore-BML5nJHm.js";import{apiService as he,ApiError as As}from"./apiService-axx1LHMk.js";import{G as Va}from"./graduation-cap-Df8fGPxp.js";import{X as Mt}from"./x-BONnp2RF.js";import{B as Ya}from"./brain-CPvGdgWE.js";import{B as Kt}from"./book-open-BH50GByv.js";import{s as ua,f as Vr,L as Yr,d as Wr,a as Kr,p as Hr,b as Jr}from"./quizService-CI5e0QMr.js";import{L as Qe}from"./loader-circle-J8Mwbkkw.js";import{E as ds}from"./eye-DXdRafOv.js";import{S as zt}from"./send-NQY-QTkN.js";import{T as Xr}from"./trash-2-BoXE_mye.js";import{C as ws}from"./circle-alert-CBefjicJ.js";import{M as xa}from"./minus-oFhmD2--.js";import{P as ha}from"./plus-BxxucBR0.js";import{C as Dt}from"./check-BACdUlFL.js";import{F as $s,I as Ft,R as Zr,D as en,V as tn}from"./video-CS-NQBfT.js";import{C as vt}from"./chart-column-D5mAWcRx.js";import{C as sn,S as z}from"./skeleton-BUmMbOVs.js";import{D as Ps}from"./download-PWUf0XJa.js";import{S as an}from"./sparkles-CXUFmaBJ.js";import{S as Wa}from"./save-Og8yP5Yb.js";import{T as Os}from"./trending-up-D-vj8Gbq.js";import{U as Gt}from"./users-HMf2sdE3.js";import{S as Ht}from"./search-Do6u3pFt.js";import{C as Qt,a as st}from"./chevron-up-Bfmq3Clw.js";import{S as fa,g as rn,G as nn}from"./subjects-DDBtpdiA.js";import{C as Ka}from"./circle-check-big-0Gzyt_f3.js";import{E as on}from"./eye-off-BYAdNgqy.js";import{U as pa}from"./user-CaTzqgOL.js";import{C as Jt}from"./chevron-right-COMox1Xb.js";import{A as ln}from"./award-oJTbc9W5.js";import Ha from"./ChatMarkdown-B34PtYCE.js";import{T as cn}from"./target-D7SVtf3g.js";import{B as ga}from"./bell-CbSbac2W.js";import{C as ba}from"./calendar-BJ8oE6yW.js";import{C as dn}from"./clock-DUJO-a50.js";import{g as mn,i as _e,G as un,a as ms,m as xn,b as at,T as hn,s as us,f as mt,c as va,L as ya,d as fn,e as pn,u as Es,h as Rs,j as gn,k as bn,l as vn,w as ja,n as Ja,o as Xt,p as yn,q as jn,r as Nn,B as ks,t as wn,R as Na,v as wa,C as kn}from"./generateCategoricalChart-CiUYzAvW.js";import{c as xt}from"./clsx-B-dksMZM.js";import{P as Xa}from"./pen-line-Vok2l3fc.js";import"./vendor-radix-BRdei-zg.js";import"./utils-BQQgILNW.js";import"./log-out-BqGKt-tT.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-markdown-C5ikSDMA.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sn=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],Cn=wt("chart-no-axes-column",Sn);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const In=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],Za=wt("clipboard-check",In);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tn=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ln=wt("external-link",Tn);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zn=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Mn=wt("file-spreadsheet",zn);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const An=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],ka=wt("library",An);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $n=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],xs=wt("wand-sparkles",$n);function Pn(t){return Array.isArray(t)?{x:t[0],y:t[1],w:t[2],h:t[3],r:t[4],c:t[5]||void 0}:t}const Sa=new Set(["p","h1","h2","h3","h4","h5","h6","li","td","th"]);function On(t,s="component",r){const a=t.getBoundingClientRect(),i=[],n=r?.leafTags?new Set([...Sa,...r.leafTags]):Sa,l=r?.captureRoundedBorders??!0,c=r?.excludeTags?new Set(r.excludeTags):null,m=r?.excludeSelectors??null;function f(h){const j=getComputedStyle(h);if(j.display==="none"||j.visibility==="hidden"||j.opacity==="0")return;const x=h.tagName.toLowerCase();if(c?.has(x)||m?.some(F=>h.matches(F)))return;const p=[...h.children].filter(F=>{const le=getComputedStyle(F);return le.display!=="none"&&le.visibility!=="hidden"&&le.opacity!=="0"}),I=x==="img"||x==="svg"||x==="video"||x==="canvas",C=x==="input"||x==="button"||x==="textarea"||x==="select",P=p.length===0||I||C||n.has(x),A=j.backgroundColor,Q=A!=="rgba(0, 0, 0, 0)"&&A!=="transparent",N=j.backgroundImage!=="none",O=parseFloat(j.borderTopWidth)||0,v=l&&O>0&&j.borderTopColor!=="rgba(0, 0, 0, 0)"&&j.borderTopColor!=="transparent",$=(parseFloat(j.borderTopLeftRadius)||0)>0,R=Q||N||v&&$,Z=x==="tr"||x==="td"||x==="th"||x==="thead"||x==="tbody"||x==="table";if(P){const F=h.getBoundingClientRect();if(F.width<1||F.height<1)return;const le=I&&F.width>0&&F.height>0&&Math.abs(F.width-F.height)<4,oe=Z?0:le?"50%":Ca(j,h)??8,ae=a.width;i.push({x:ae>0?+((F.left-a.left)/ae*100).toFixed(4):0,y:Math.round(F.top-a.top),w:ae>0?+(F.width/ae*100).toFixed(4):0,h:Math.round(F.height),r:oe});return}if(R){const F=h.getBoundingClientRect();if(F.width>=1&&F.height>=1){const le=Z?0:Ca(j,h)??8,oe=a.width;i.push({x:oe>0?+((F.left-a.left)/oe*100).toFixed(4):0,y:Math.round(F.top-a.top),w:oe>0?+(F.width/oe*100).toFixed(4):0,h:Math.round(F.height),r:le,c:!0})}}for(const F of p)f(F)}for(const h of t.children)f(h);return{name:s,viewportWidth:Math.round(a.width),width:Math.round(a.width),height:Math.round(a.height),bones:i}}function Ca(t,s){const r=parseFloat(t.borderTopLeftRadius)||0,a=parseFloat(t.borderTopRightRadius)||0,i=parseFloat(t.borderBottomRightRadius)||0,n=parseFloat(t.borderBottomLeftRadius)||0;if(r===0&&a===0&&i===0&&n===0)return;const l=s?(()=>{const f=s.getBoundingClientRect();return f.width>0&&f.height>0&&Math.abs(f.width-f.height)<4})():!1;return t.borderRadius==="50%"?"50%":Math.max(r,a,i,n)>9998?l?"50%":9999:r===a&&a===i&&i===n?r!==8?r:void 0:`${r}px ${a}px ${i}px ${n}px`}const En=new Map;function Rn(t){return En.get(t)}function _n(){typeof window<"u"&&window.__BONEYARD_BUILD&&(window.__BONEYARD_SNAPSHOT=On)}function Bn(){return typeof window<"u"&&window.__BONEYARD_BUILD===!0}function Dn(t,s){if(!("breakpoints"in t))return t;const r=Object.keys(t.breakpoints).map(Number).sort((i,n)=>i-n);if(r.length===0)return null;const a=[...r].reverse().find(i=>s>=i)??r[0];return t.breakpoints[a]??null}function hs(t,s){const r=t.match(/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+))?\s*\)/);if(r){const[,a,i,n,l="1"]=r,c=Math.min(1,parseFloat(l)+s*.5);return`rgba(${a},${i},${n},${c.toFixed(3)})`}if(t.startsWith("#")&&t.length>=7){const a=parseInt(t.slice(1,3),16),i=parseInt(t.slice(3,5),16),n=parseInt(t.slice(5,7),16);if(!isNaN(a)&&!isNaN(i)&&!isNaN(n)){const l=Math.round(a+(255-a)*s),c=Math.round(i+(255-i)*s),m=Math.round(n+(255-n)*s);return`#${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}${m.toString(16).padStart(2,"0")}`}}return t}_n();let fs={};function pt({loading:t,children:s,name:r,initialBones:a,color:i,darkColor:n,animate:l,className:c,fallback:m,fixture:f,snapshotConfig:h}){const j=d.useRef(null),[x,p]=d.useState(0),[I,C]=d.useState(0),[P,A]=d.useState(!1);d.useEffect(()=>{if(typeof window>"u")return;const D=()=>{window.matchMedia("(prefers-color-scheme: dark)");const M=document.documentElement.classList.contains("dark")||!!j.current?.closest(".dark");A(M)};D();const te=window.matchMedia("(prefers-color-scheme: dark)"),J=()=>D();te.addEventListener("change",J);const g=new MutationObserver(D);return g.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{te.removeEventListener("change",J),g.disconnect()}},[]);const Q=i??fs.color??"rgba(0,0,0,0.08)",N=n??fs.darkColor??"rgba(255,255,255,0.06)",O=P?N:Q,v=l??fs.animate??"pulse",$=v===!0?"pulse":v===!1?"solid":v;d.useEffect(()=>{const D=j.current;if(!D)return;const te=new ResizeObserver(g=>{const M=g[0]?.contentRect;p(Math.round(M?.width??0)),M&&M.height>0&&C(Math.round(M.height))});te.observe(D);const J=D.getBoundingClientRect();return p(Math.round(J.width)),J.height>0&&C(Math.round(J.height)),()=>te.disconnect()},[]);const R={};if(r&&(R["data-boneyard"]=r,h&&(R["data-boneyard-config"]=JSON.stringify(h))),Bn())return e.jsx("div",{ref:j,className:c,style:{position:"relative"},...R,children:e.jsx("div",{children:f??s})});const[Z,F]=d.useState(!1);d.useEffect(()=>{F(!0)},[]);const le=a??(r?Rn(r):void 0),oe=Z&&typeof window<"u"?window.innerWidth:0,ae=x>0?x:oe,ce=le&&ae>0?Dn(le,ae):null,pe=t&&ce,be=t&&!ce,xe=I>0?I:ce?.height??0,S=ce?.height??0,_=xe>0&&S>0?xe/S:1;return e.jsxs("div",{ref:j,className:c,style:{position:"relative"},...R,children:[e.jsx("div",{"data-boneyard-content":"true",style:pe?{visibility:"hidden"}:void 0,children:be?m:s}),pe&&e.jsx("div",{"data-boneyard-overlay":"true",style:{position:"absolute",inset:0,overflow:"hidden"},children:e.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[ce.bones.map((D,te)=>{const J=Pn(D),g=J.c?hs(O,P?.03:.45):O,M=hs(O,P?.04:.3),B={position:"absolute",left:`${J.x}%`,top:J.y*_,width:`${J.w}%`,height:J.h*_,borderRadius:typeof J.r=="string"?J.r:`${J.r}px`,backgroundColor:g};return $==="pulse"?B.animation="boneyard-pulse 1.8s ease-in-out infinite":$==="shimmer"&&(B.background=`linear-gradient(90deg, ${g} 30%, ${M} 50%, ${g} 70%)`,B.backgroundSize="200% 100%",B.animation="boneyard-shimmer 2.4s linear infinite"),e.jsx("div",{"data-boneyard-bone":"true",style:B},te)}),$==="pulse"&&e.jsx("style",{children:`@keyframes boneyard-pulse{0%,100%{background-color:${O}}50%{background-color:${hs(O,P?.04:.3)}}}`}),$==="shimmer"&&e.jsx("style",{children:"@keyframes boneyard-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}"})]})})]})}function er(t,s,r){if(s<1)return[];if(s===1&&r===void 0)return t;for(var a=[],i=0;it*i)return!1;var n=r();return t*(s-t*n/2-a)>=0&&t*(s+t*n/2-i)<=0}function Qn(t,s){return er(t,s+1)}function Un(t,s,r,a,i){for(var n=(a||[]).slice(),l=s.start,c=s.end,m=0,f=1,h=l,j=function(){var I=a?.[m];if(I===void 0)return{v:er(a,f)};var C=m,P,A=function(){return P===void 0&&(P=r(I,C)),P},Q=I.coordinate,N=m===0||Ut(t,Q,A,h,c);N||(m=0,h=l,f+=1),N&&(h=Q+t*(A()/2+i),m+=f)},x;f<=n.length;)if(x=j(),x)return x.v;return[]}function $t(t){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},$t(t)}function Ia(t,s){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);s&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function Le(t){for(var s=1;s0?p.coordinate-P*t:p.coordinate})}else n[x]=p=Le(Le({},p),{},{tickCoord:p.coordinate});var A=Ut(t,p.tickCoord,C,c,m);A&&(m=p.tickCoord-t*(C()/2+i),n[x]=Le(Le({},p),{},{isShow:!0}))},h=l-1;h>=0;h--)f(h);return n}function Kn(t,s,r,a,i,n){var l=(a||[]).slice(),c=l.length,m=s.start,f=s.end;if(n){var h=a[c-1],j=r(h,c-1),x=t*(h.coordinate+t*j/2-f);l[c-1]=h=Le(Le({},h),{},{tickCoord:x>0?h.coordinate-x*t:h.coordinate});var p=Ut(t,h.tickCoord,function(){return j},m,f);p&&(f=h.tickCoord-t*(j/2+i),l[c-1]=Le(Le({},h),{},{isShow:!0}))}for(var I=n?c-1:c,C=function(Q){var N=l[Q],O,v=function(){return O===void 0&&(O=r(N,Q)),O};if(Q===0){var $=t*(N.coordinate-t*v()/2-m);l[Q]=N=Le(Le({},N),{},{tickCoord:$<0?N.coordinate-$*t:N.coordinate})}else l[Q]=N=Le(Le({},N),{},{tickCoord:N.coordinate});var R=Ut(t,N.tickCoord,v,m,f);R&&(m=N.tickCoord+t*(v()/2+i),l[Q]=Le(Le({},N),{},{isShow:!0}))},P=0;P=2?xn(i[1].coordinate-i[0].coordinate):1,A=Gn(n,P,p);return m==="equidistantPreserveStart"?Un(P,A,C,i,l):(m==="preserveStart"||m==="preserveStartEnd"?x=Kn(P,A,C,i,l,m==="preserveStartEnd"):x=Wn(P,A,C,i,l),x.filter(function(Q){return Q.isShow}))}var Hn=["viewBox"],Jn=["viewBox"],Xn=["ticks"];function yt(t){"@babel/helpers - typeof";return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},yt(t)}function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(r[a]=t[a])}return r}function Zn(t,s){if(t==null)return{};var r={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(s.indexOf(a)>=0)continue;r[a]=t[a]}return r}function eo(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}function La(t,s){for(var r=0;r0?m(this.props):m(p)),l<=0||c<=0||!I||!I.length?null:fe.createElement(ya,{className:xt("recharts-cartesian-axis",f),ref:function(P){a.layerReference=P}},n&&this.renderAxisLine(),this.renderTicks(I,this.state.fontSize,this.state.letterSpacing),pn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(a,i,n){var l,c=xt(i.className,"recharts-cartesian-axis-tick-value");return fe.isValidElement(a)?l=fe.cloneElement(a,Se(Se({},i),{},{className:c})):at(a)?l=a(Se(Se({},i),{},{className:c})):l=fe.createElement(hn,ht({},i,{className:"recharts-cartesian-axis-tick-value"}),n),l}}])})(d.Component);Bs(kt,"displayName","CartesianAxis");Bs(kt,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var io=["x1","y1","x2","y2","key"],lo=["offset"];function rt(t){"@babel/helpers - typeof";return rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},rt(t)}function za(t,s){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);s&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function ze(t){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(r[a]=t[a])}return r}function xo(t,s){if(t==null)return{};var r={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(s.indexOf(a)>=0)continue;r[a]=t[a]}return r}var ho=function(s){var r=s.fill;if(!r||r==="none")return null;var a=s.fillOpacity,i=s.x,n=s.y,l=s.width,c=s.height,m=s.ry;return fe.createElement("rect",{x:i,y:n,ry:m,width:l,height:c,stroke:"none",fill:r,fillOpacity:a,className:"recharts-cartesian-grid-bg"})};function ar(t,s){var r;if(fe.isValidElement(t))r=fe.cloneElement(t,s);else if(at(t))r=t(s);else{var a=s.x1,i=s.y1,n=s.x2,l=s.y2,c=s.key,m=Ma(s,io),f=mt(m,!1);f.offset;var h=Ma(f,lo);r=fe.createElement("line",Ze({},h,{x1:a,y1:i,x2:n,y2:l,fill:"none",key:c}))}return r}function fo(t){var s=t.x,r=t.width,a=t.horizontal,i=a===void 0?!0:a,n=t.horizontalPoints;if(!i||!n||!n.length)return null;var l=n.map(function(c,m){var f=ze(ze({},t),{},{x1:s,y1:c,x2:s+r,y2:c,key:"line-".concat(m),index:m});return ar(i,f)});return fe.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function po(t){var s=t.y,r=t.height,a=t.vertical,i=a===void 0?!0:a,n=t.verticalPoints;if(!i||!n||!n.length)return null;var l=n.map(function(c,m){var f=ze(ze({},t),{},{x1:c,y1:s,x2:c,y2:s+r,key:"line-".concat(m),index:m});return ar(i,f)});return fe.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function go(t){var s=t.horizontalFill,r=t.fillOpacity,a=t.x,i=t.y,n=t.width,l=t.height,c=t.horizontalPoints,m=t.horizontal,f=m===void 0?!0:m;if(!f||!s||!s.length)return null;var h=c.map(function(x){return Math.round(x+i-i)}).sort(function(x,p){return x-p});i!==h[0]&&h.unshift(0);var j=h.map(function(x,p){var I=!h[p+1],C=I?i+l-x:h[p+1]-x;if(C<=0)return null;var P=p%s.length;return fe.createElement("rect",{key:"react-".concat(p),y:x,x:a,height:C,width:n,stroke:"none",fill:s[P],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return fe.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},j)}function bo(t){var s=t.vertical,r=s===void 0?!0:s,a=t.verticalFill,i=t.fillOpacity,n=t.x,l=t.y,c=t.width,m=t.height,f=t.verticalPoints;if(!r||!a||!a.length)return null;var h=f.map(function(x){return Math.round(x+n-n)}).sort(function(x,p){return x-p});n!==h[0]&&h.unshift(0);var j=h.map(function(x,p){var I=!h[p+1],C=I?n+c-x:h[p+1]-x;if(C<=0)return null;var P=p%a.length;return fe.createElement("rect",{key:"react-".concat(p),x,y:l,width:C,height:m,stroke:"none",fill:a[P],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return fe.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},j)}var vo=function(s,r){var a=s.xAxis,i=s.width,n=s.height,l=s.offset;return Ja(_s(ze(ze(ze({},kt.defaultProps),a),{},{ticks:Xt(a,!0),viewBox:{x:0,y:0,width:i,height:n}})),l.left,l.left+l.width,r)},yo=function(s,r){var a=s.yAxis,i=s.width,n=s.height,l=s.offset;return Ja(_s(ze(ze(ze({},kt.defaultProps),a),{},{ticks:Xt(a,!0),viewBox:{x:0,y:0,width:i,height:n}})),l.top,l.top+l.height,r)},ct={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Cs(t){var s,r,a,i,n,l,c=Es(),m=Rs(),f=gn(),h=ze(ze({},t),{},{stroke:(s=t.stroke)!==null&&s!==void 0?s:ct.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:ct.fill,horizontal:(a=t.horizontal)!==null&&a!==void 0?a:ct.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:ct.horizontalFill,vertical:(n=t.vertical)!==null&&n!==void 0?n:ct.vertical,verticalFill:(l=t.verticalFill)!==null&&l!==void 0?l:ct.verticalFill,x:_e(t.x)?t.x:f.left,y:_e(t.y)?t.y:f.top,width:_e(t.width)?t.width:f.width,height:_e(t.height)?t.height:f.height}),j=h.x,x=h.y,p=h.width,I=h.height,C=h.syncWithTicks,P=h.horizontalValues,A=h.verticalValues,Q=bn(),N=vn();if(!_e(p)||p<=0||!_e(I)||I<=0||!_e(j)||j!==+j||!_e(x)||x!==+x)return null;var O=h.verticalCoordinatesGenerator||vo,v=h.horizontalCoordinatesGenerator||yo,$=h.horizontalPoints,R=h.verticalPoints;if((!$||!$.length)&&at(v)){var Z=P&&P.length,F=v({yAxis:N?ze(ze({},N),{},{ticks:Z?P:N.ticks}):void 0,width:c,height:m,offset:f},Z?!0:C);ja(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(rt(F),"]")),Array.isArray(F)&&($=F)}if((!R||!R.length)&&at(O)){var le=A&&A.length,oe=O({xAxis:Q?ze(ze({},Q),{},{ticks:le?A:Q.ticks}):void 0,width:c,height:m,offset:f},le?!0:C);ja(Array.isArray(oe),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(rt(oe),"]")),Array.isArray(oe)&&(R=oe)}return fe.createElement("g",{className:"recharts-cartesian-grid"},fe.createElement(ho,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),fe.createElement(fo,Ze({},h,{offset:f,horizontalPoints:$,xAxis:Q,yAxis:N})),fe.createElement(po,Ze({},h,{offset:f,verticalPoints:R,xAxis:Q,yAxis:N})),fe.createElement(go,Ze({},h,{horizontalPoints:$})),fe.createElement(bo,Ze({},h,{verticalPoints:R})))}Cs.displayName="CartesianGrid";function jt(t){"@babel/helpers - typeof";return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},jt(t)}function jo(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}function No(t,s){for(var r=0;r({id:m.id,...m.data()})).sort((m,f)=>String(m.name||"").localeCompare(String(f.name||"")))}catch{}const a=(await mr(t)).map(n=>n.id);if(a.length===0)return[];const i=new Map;for(let n=0;n{i.set(f.id,{id:f.id,...f.data()})})}return Array.from(i.values()).sort((n,l)=>String(n.name||"").localeCompare(String(l.name||"")))}async function Bo(t,s,r){const a=Be(Te,"managedStudents",t);await Ke(a,{riskLevel:s,...r!==void 0?{riskConfidence:r}:{},updatedAt:Oe()})}async function dr(t,s,r){const a=De(s,r),i=Be(Te,"managedStudents",t);await Ke(i,{grade:s,section:r,classSectionId:a,updatedAt:Oe()})}function De(t,s){return[t,s].filter(Boolean).join("_").replace(/\s+/g,"_").toLowerCase()}function Ms(t){const s=Object.entries(t).filter(([,r])=>r!==void 0);return Object.fromEntries(s)}function ot(t){const s=(t||"").trim();if(!s)return null;const r=s.match(/(\d{1,2})/);return r?`Grade ${r[1]}`:/^grade\s+/i.test(s)?s.replace(/\s+/g," ").trim().replace(/^grade/i,"Grade"):s}function St(t){const r=ot(t)?.match(/(\d{1,2})/),a=r?Number.parseInt(r[1],10):Number.NaN;return Number.isFinite(a)?a>=11?"Senior High School":"Junior High School":null}function Ct(t,s){const r=`${t||""} ${s||""}`.toUpperCase();if(!r.trim())return null;const a=["STEM","ABM","HUMSS","GAS","TVL","ICT"];for(const i of a)if(new RegExp(`\\b${i}\\b`).test(r))return i;return null}function Fe(t){const s=(t||"").trim();if(!s)return{grade:"Grade 11",section:"Section A"};const[r="Grade 11",a="Section A"]=s.split(" - ").map(i=>i.trim());return{grade:r||"Grade 11",section:a||"Section A"}}function Ie(t){const s=t.metadata||{},r=t.className||s.className,a=Fe(r),i=(t.grade||s.grade||a.grade||"").trim()||null,n=(t.section||s.section||a.section||"").trim()||null,l=(t.classSectionId||s.classSectionId||"").trim()||(i&&n?De(i,n):"")||null,c=(r||"").trim()||(i&&n?`${i} - ${n}`:"")||null,m=ot(t.gradeLevel||s.gradeLevel||i),f=(t.classification||s.classification||"").trim()||St(m)||null,h=(t.strand||s.strand||"").trim()||Ct(c,n)||null;return{classSectionId:l,className:c,grade:i,section:n,gradeLevel:m,classification:f,strand:h,schoolYear:(t.schoolYear||s.schoolYear||"").trim()||null,ownerTeacherId:(t.ownerTeacherId||s.ownerTeacherId||"").trim()||null,ownerTeacherName:(t.ownerTeacherName||s.ownerTeacherName||"").trim()||null,adviserTeacherId:(t.adviserTeacherId||s.adviserTeacherId||"").trim()||null,adviserTeacherName:(t.adviserTeacherName||s.adviserTeacherName||"").trim()||null,managerId:(t.managerId||s.managerId||"").trim()||null,managerName:(t.managerName||s.managerName||"").trim()||null}}function Do(t){const s=(t.className||"").trim(),[r="",a=""]=s.split(" - "),i=(t.grade||r||"").trim()||null,n=(t.section||a||"").trim()||null,l=(t.classSectionId||"").trim()||(i&&n?De(i,n):"")||null,c=s||(i&&n?`${i} - ${n}`:null),m=ot(t.gradeLevel||i),f=(t.classification||"").trim()||St(m),h=(t.strand||"").trim()||Ct(c,n);return{classSectionId:l,className:c,grade:i,section:n,gradeLevel:m,classification:f,strand:h,schoolYear:(t.schoolYear||"").trim()||null,ownerTeacherId:(t.ownerTeacherId||"").trim()||null,ownerTeacherName:(t.ownerTeacherName||"").trim()||null,adviserTeacherId:(t.adviserTeacherId||"").trim()||null,adviserTeacherName:(t.adviserTeacherName||"").trim()||null,managerId:(t.managerId||"").trim()||null,managerName:(t.managerName||"").trim()||null}}async function mr(t){const s=nt(Te,"classrooms"),r=new Map,a=Ve(s,Ye("teacherId","==",t));(await He(a)).docs.forEach(c=>{r.set(c.id,{id:c.id,...c.data()})});const n=Ve(s,Ye("managerId","==",t));return(await He(n)).docs.forEach(c=>{r.set(c.id,{id:c.id,...c.data()})}),Array.from(r.values()).sort((c,m)=>String(c.name||"").localeCompare(String(m.name||"")))}async function ur(t){const s=t.classSectionId||De(t.grade,t.section),r=Be(Te,"classSectionOwnership",s),a=await ut(r),i=a.exists()?a.data().studentUids||[]:[],n=Array.from(new Set([...t.studentUids||[],...i])),l=Ms(t);return a.exists()?await Ke(r,{...l,classSectionId:s,studentUids:n,updatedAt:Oe()}):await tt(r,{...l,classSectionId:s,studentUids:n,createdAt:Oe(),updatedAt:Oe()}),s}async function Fo(t){const s=(t.classSectionId||"").trim()||De(t.grade,t.section),r=(t.className||"").trim()||`${t.grade} - ${t.section}`,a=Do({classSectionId:s,className:r,grade:t.grade,section:t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName,adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName,classification:t.classification,strand:t.strand,gradeLevel:t.gradeLevel});await ur({classSectionId:s,className:r,grade:a.grade||t.grade,gradeLevel:a.gradeLevel||t.gradeLevel||t.grade,classification:a.classification||t.classification,strand:a.strand||t.strand,section:a.section||t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName,studentUids:[]});const i=nt(Te,"classrooms"),n=Ve(i,Ye("classSectionId","==",s)),l=await He(n);if(l.empty){const c=Ms({name:r,teacherId:t.ownerTeacherId,grade:a.grade,gradeLevel:a.gradeLevel,classification:a.classification,strand:a.strand,section:a.section,classSectionId:s,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName||"",adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName||"",managerId:t.managerId,managerName:t.managerName||"",classMetadata:a,schedule:"Mon-Fri",studentCount:0,avgScore:0,atRiskCount:0,createdAt:Oe(),updatedAt:Oe()});await tt(Be(Te,"classrooms",s),c,{merge:!0})}else for(const c of l.docs){const m=Ms({name:r,grade:a.grade,gradeLevel:a.gradeLevel,classification:a.classification,strand:a.strand,section:a.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName||"",adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName||"",managerId:t.managerId,managerName:t.managerName||"",classMetadata:a,updatedAt:Oe()});await Ke(c.ref,m)}return s}async function xr(t,s,r,a,i,n){const l=De(s,r);await ur({classSectionId:l,grade:s,section:r,schoolYear:i,ownerTeacherId:a,ownerTeacherName:n,studentUids:[t]}),await tt(Be(Te,"users",t),{grade:s,section:r,classSectionId:l,adviserTeacherId:a,adviserTeacherName:n||"",updatedAt:Oe()},{merge:!0})}async function Go(t){const s=nt(Te,"classSectionOwnership"),r=new Map,a=Ve(s,Ye("ownerTeacherId","==",t));(await He(a)).docs.forEach(c=>{r.set(c.id,{id:c.id,...c.data()})});const n=Ve(s,Ye("managerId","==",t));return(await He(n)).docs.forEach(c=>{r.set(c.id,{id:c.id,...c.data()})}),Array.from(r.values()).sort((c,m)=>String(c.classSectionId||"").localeCompare(String(m.classSectionId||"")))}async function Qo(t="",s=25){const r=nt(Te,"users"),a=Math.max(1,Math.min(100,s)),i=Ve(r,Ye("role","==","teacher"),Qr(a*4)),n=await He(i),l=t.trim().toLowerCase();return n.docs.map(m=>{const f=m.data(),h=String(f.name||"").trim(),j=String(f.email||"").trim();return{uid:m.id,name:h||"Teacher",email:j,photo:String(f.photo||f.photoURL||"").trim()||void 0}}).filter(m=>l?m.name.toLowerCase().includes(l)||m.email.toLowerCase().includes(l):!0).sort((m,f)=>m.name.localeCompare(f.name)).slice(0,a)}function Uo(t,s,r=20){if(t.length===0)return s([]),()=>{};const a=nt(Te,"activities"),i=Ve(a,Ye("classroomId","in",t),Ur("timestamp","desc"));return qr(i,n=>{const l=n.docs.slice(0,r).map(c=>({id:c.id,...c.data()}));s(l)})}async function qo(t,s,r){const a=Be(nt(Te,"generatedLessonPlans"));return await tt(a,{...t,teacherId:s,teacherName:r?.teacherName||null,studentId:r?.studentId||null,studentName:r?.studentName||null,status:"draft",createdAt:Oe(),updatedAt:Oe()}),a.id}async function Vo(t){const s=Be(Te,"generatedLessonPlans",t),r=await ut(s);if(!r.exists())throw new Error("Lesson draft not found. Save draft before publishing.");if(!r.data().publishReady)throw new Error("Lesson is not publish-ready. Resolve source legitimacy and validation issues first.");await Ke(s,{status:"published",publishedAt:Oe(),updatedAt:Oe()})}const Yo=[{level:"Remember",icon:Ya,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Recall facts, formulas, definitions, and basic procedures.",mathExample:"State the quadratic formula.",mapsTo:"Identification, Enumeration",defaultWeight:"Included by default"},{level:"Understand",icon:Kt,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Explain concepts, interpret graphs, classify mathematical objects.",mathExample:"Explain why the discriminant determines the number of roots.",mapsTo:"Multiple Choice, Identification",defaultWeight:"Included by default"},{level:"Apply",icon:qa,bgColor:"bg-green-500/20",borderColor:"border-green-500/40",textColor:"text-green-400",description:"Use formulas and procedures to solve routine problems.",mathExample:"Solve: 2x² + 5x - 3 = 0 using the quadratic formula.",mapsTo:"Equation-Based, Word Problem",defaultWeight:"Included by default"},{level:"Analyze",icon:Cn,bgColor:"bg-orange-500/20",borderColor:"border-orange-500/40",textColor:"text-orange-400",description:"Break down problems, compare solution methods, identify patterns.",mathExample:"Given f(x) = x³ - 3x, find and classify all critical points.",mapsTo:"Word Problem, Equation-Based",defaultWeight:"Included by default"}],Wo=({isOpen:t,onClose:s})=>t?e.jsx(et,{children:t&&e.jsx(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[70] flex items-center justify-center p-4",onClick:s,children:e.jsxs(ie.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-white border border-slate-200 rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col overflow-hidden",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 px-6 py-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",children:e.jsx(Va,{size:22,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-white",children:"Bloom's Taxonomy in MathPulse AI"}),e.jsx("p",{className:"text-cyan-200 text-xs",children:"Understanding cognitive levels in assessments"})]})]}),e.jsx("button",{onClick:s,className:"w-8 h-8 bg-white/20 hover:bg-white/30 rounded-lg flex items-center justify-center transition-colors",children:e.jsx(Mt,{size:16,className:"text-white"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"What is Bloom's Taxonomy?"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Bloom's Taxonomy is an educational framework developed by Benjamin Bloom in 1956 and revised in 2001. It classifies learning objectives into six cognitive levels, from basic recall of facts up to complex evaluation and creation. MathPulse AI uses the first four levels most relevant to Senior High School mathematics."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"Why MathPulse AI Uses It"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Using Bloom's Taxonomy ensures that assessments do not only test memorization. A well-balanced math quiz should challenge students at multiple cognitive levels: remembering formulas, understanding concepts, applying procedures, and analyzing relationships. This mirrors the DepEd K-12 competency framework which requires higher-order thinking skills (HOTS) alongside foundational knowledge."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-3",children:"Level-by-Level Breakdown"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Yo.map(r=>{const a=r.icon;return e.jsxs("div",{className:`${r.bgColor} border ${r.borderColor} rounded-xl p-4 space-y-2`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a,{size:18,className:r.textColor}),e.jsx("span",{className:`font-bold text-sm ${r.textColor}`,children:r.level})]}),e.jsx("p",{className:"text-xs text-slate-500",children:r.description}),e.jsxs("div",{className:"bg-black/20 rounded-lg p-2",children:[e.jsx("p",{className:"text-[10px] font-semibold text-slate-500 uppercase tracking-wide mb-0.5",children:"Math Example"}),e.jsx("p",{className:"text-xs text-[#dde3eb] italic",children:r.mathExample})]}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsxs("span",{className:"text-slate-500",children:["Maps to: ",e.jsx("span",{className:"text-slate-500 font-medium",children:r.mapsTo})]}),e.jsx("span",{className:"text-green-400 font-medium",children:r.defaultWeight})]})]},r.level)})})]}),e.jsx("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4",children:e.jsxs("p",{className:"text-xs text-slate-500 leading-relaxed",children:[e.jsx("span",{className:"font-semibold text-slate-600",children:"Note:"})," ","All four levels are selected by default to produce a balanced, HOTS-aligned assessment. Deselecting a level will remove questions of that cognitive depth from the generated quiz."]})})]}),e.jsxs("div",{className:"border-t border-slate-200 px-6 py-3 flex items-center justify-between flex-shrink-0 bg-slate-50",children:[e.jsxs("a",{href:"https://cft.vanderbilt.edu/guides-sub-pages/blooms-taxonomy/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-rose-400 hover:text-rose-300 font-medium transition-colors",children:[e.jsx(Ln,{size:12}),"Learn More"]}),e.jsx("button",{onClick:s,className:"px-5 py-2 bg-sky-600 hover:bg-rose-500 text-white text-sm font-bold rounded-xl transition-colors",children:"Got it"})]})]})})}):null,Ko={draft:"bg-[#edf1f7] text-[#5a6578]",published:"bg-green-100 text-green-700",assigned:"bg-sky-100 text-sky-700",completed:"bg-rose-100 text-rose-700"},gs={identification:{label:"Identification",icon:e.jsx($s,{size:16}),description:"Define or identify concepts"},enumeration:{label:"Enumeration",icon:e.jsx(Kr,{size:16}),description:"List steps or properties"},multiple_choice:{label:"Multiple Choice",icon:e.jsx(Dt,{size:16}),description:"Choose from 4 options"},word_problem:{label:"Word Problem",icon:e.jsx(Kt,{size:16}),description:"Real-world scenarios"},equation_based:{label:"Equation-Based",icon:e.jsx(Dr,{size:16}),description:"Solve equations"}},$a={remember:{label:"Remember",color:"bg-sky-100 text-sky-700 border-sky-300",description:"Recall facts & formulas"},understand:{label:"Understand",color:"bg-emerald-100 text-emerald-700 border-emerald-300",description:"Explain concepts"},apply:{label:"Apply",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Use in new contexts"},analyze:{label:"Analyze",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Examine & compare"}},Ho=["Grade 11","Grade 12"],bs=t=>{const s=(t||"").trim().toLowerCase();return s==="grade 12"||s==="12"||s.includes("12")?"Grade 12":"Grade 11"},Jo={"Grade 11":{"General Mathematics - Patterns, Relations, and Functions":["Patterns and Real-Life Relationships","Functions as Mathematical Models","Function Notation and Evaluation","Domain and Range of Functions","Operations on Functions","Composite Functions","Inverse Functions","Graphs of Rational Functions","Graphs of Exponential Functions","Graphs of Logarithmic Functions"],"General Mathematics - Financial Mathematics":["Simple and Compound Interest","Simple and General Annuities","Present and Future Value","Loans, Amortization, and Sinking Funds","Stocks, Bonds, and Market Indices","Business Decision-Making with Mathematical Models"],"General Mathematics - Logic and Mathematical Reasoning":["Propositions and Logical Connectives","Truth Values and Truth Tables","Logical Equivalence and Implication","Quantifiers and Negation","Validity of Arguments"]},"Grade 12":{"Pre-Calculus - Analytic Geometry":["Conic Sections - Parabola","Conic Sections - Ellipse","Conic Sections - Hyperbola","Conic Sections - Circle","Systems of Nonlinear Equations"],"Pre-Calculus - Series and Induction":["Sequences and Series","Arithmetic Sequences","Geometric Sequences","Mathematical Induction","Binomial Theorem"],"Pre-Calculus - Trigonometry":["Angles and Unit Circle","Trigonometric Functions","Trigonometric Identities","Sum and Difference Formulas","Inverse Trigonometric Functions","Polar Coordinates"],"Basic Calculus - Limits":["Limits of Functions","Limit Theorems","One-Sided Limits","Infinite Limits and Limits at Infinity","Continuity of Functions"],"Basic Calculus - Derivatives":["Definition of the Derivative","Differentiation Rules","Chain Rule","Implicit Differentiation","Higher-Order Derivatives","Related Rates","Extrema and the First Derivative Test","Concavity and the Second Derivative Test","Optimization Problems"],"Basic Calculus - Integration":["Antiderivatives and Indefinite Integrals","Definite Integrals and the FTC","Integration by Substitution","Area Under a Curve"]}},Xo={"Grade 11":["General Mathematics - "],"Grade 12":["Pre-Calculus - ","Basic Calculus - "]},Pa=(t,s)=>{const r=Xo[s];return Object.fromEntries(Object.entries(t).filter(([a])=>r.some(i=>a.startsWith(i))))},Lt=30,dt=12,vs="mathpulse:quiz-maker:active-task",ys={easy:"text-green-600",medium:"text-rose-600",hard:"text-red-600"},Zo=({onBack:t,gradeLevel:s,selectedClassId:r,selectedClassName:a})=>{const{currentUser:i,loading:n}=Wt(),l=d.useMemo(()=>he.getImportGroundedRolloutFlags(),[]),[c,m]=d.useState("create"),[f,h]=d.useState("configure"),[j,x]=d.useState(bs(s)),[p,I]=d.useState(10),[C,P]=d.useState([]),[A,Q]=d.useState([]),[N,O]=d.useState(["multiple_choice","word_problem","identification"]),[v,$]=d.useState(["remember","understand","apply","analyze"]),[R,Z]=d.useState(!1),[F,le]=d.useState({easy:30,medium:50,hard:20}),[oe,ae]=d.useState({}),[ce,pe]=d.useState(!1),[be,xe]=d.useState([]),[S,_]=d.useState(!1),[D,te]=d.useState(""),[J,g]=d.useState(!1),[M,B]=d.useState(!1),[ee,V]=d.useState(null),[ye,k]=d.useState(0),[T,ne]=d.useState("queued"),[y,W]=d.useState("Waiting to start generation..."),[G,de]=d.useState(null),[me,re]=d.useState(null),[Ae,w]=d.useState(""),[E,ue]=d.useState(!1),K=d.useRef(!1),[Ne,se]=d.useState("topics"),[$e,je]=d.useState(null),[X,Ee]=d.useState(!1),[Ge,it]=d.useState("all"),[Je,L]=d.useState("all"),[q,we]=d.useState(!1),[Y,ke]=d.useState(null),[Pe,Fs]=d.useState(!1),[pr,It]=d.useState(!1),[es,Gs]=d.useState(!1),[Qs,gr]=d.useState([]),[br,Us]=d.useState(!1),[ts,qs]=d.useState(""),[Xe,Vs]=d.useState(null),[Ys,Tt]=d.useState([]),[vr,Ws]=d.useState(!1),[ss,yr]=d.useState("all"),[jr,Ks]=d.useState(null),[Hs,Rt]=d.useState(null),Js=d.useCallback(async()=>{pe(!0);const o=bs(j);try{const u=await he.getQuizTopics(o);u.topics&&ae(Pa(u.topics,o))}catch{ae(Pa(Jo[o],o))}finally{pe(!1)}},[j]),Xs=d.useCallback(async()=>{if(!l.quizEnabled){xe([]),te("Import-grounded quiz generation is disabled by rollout flag; using curriculum defaults."),_(!1);return}_(!0),te("");try{const o=await he.getCourseMaterialTopics({classSectionId:r,limit:20}),u=(o.topics||[]).filter(b=>b.title?.trim());xe(u),o.warnings&&o.warnings.length>0&&te(o.warnings.join(" "))}catch{xe([]),te("Imported topics are currently unavailable; quiz generation will use curriculum defaults.")}finally{_(!1)}},[r,l.quizEnabled]);d.useEffect(()=>{Js(),P([]),Q([])},[Js]),d.useEffect(()=>{Xs()},[Xs]);const as=d.useMemo(()=>{const o=Array.from(new Set(be.map(u=>u.title.trim()).filter(Boolean)));return o.length===0?oe:{"Imported Course Materials":o,...oe}},[oe,be]);d.useEffect(()=>{it("all"),L("all")},[G]);const Zs=d.useMemo(()=>{if(!G)return[];const o=G.questions.map(b=>b.provenance?.sourceFile?.trim()).filter(b=>!!b),u=(G.metadata.topicProvenance||[]).map(b=>b.sourceFile?.trim()).filter(b=>!!b);return Array.from(new Set([...o,...u])).sort((b,H)=>b.localeCompare(H))},[G]),ea=d.useMemo(()=>{if(!G)return[];const o=G.questions.map(b=>b.provenance?.materialId?.trim()).filter(b=>!!b),u=(G.metadata.topicProvenance||[]).map(b=>b.materialId?.trim()).filter(b=>!!b);return Array.from(new Set([...o,...u])).sort((b,H)=>b.localeCompare(H))},[G]),rs=d.useMemo(()=>G?G.questions.filter(o=>{const u=Ge==="all"||(o.provenance?.sourceFile||"").trim()===Ge,b=Je==="all"||(o.provenance?.materialId||"").trim()===Je;return u&&b}):[],[G,Ge,Je]),ta=(o,u)=>{const b={...F},H=Math.max(0,Math.min(100,b[o]+u)),ge=H-b[o];b[o]=H;const ve=Object.keys(b).filter(Re=>Re!==o),qe=ve.reduce((Re,lt)=>Re+b[lt],0);if(qe>0)for(const Re of ve)b[Re]=Math.max(0,Math.round(b[Re]-ge*b[Re]/qe));const da=Object.values(b).reduce((Re,lt)=>Re+lt,0);if(da!==100){const Re=ve.reduce((lt,ma)=>b[lt]>=b[ma]?lt:ma);b[Re]+=100-da}le(b)},Nr=o=>{P(u=>u.includes(o)?u.filter(b=>b!==o):[...u,o]),Q(u=>u.filter(b=>b!==o))},wr=o=>{Q(u=>u.includes(o)?u.filter(b=>b!==o):[...u,o]),P(u=>u.filter(b=>b!==o))},kr=o=>{O(u=>u.includes(o)?u.length>1?u.filter(b=>b!==o):u:[...u,o])},Sr=o=>{$(u=>u.includes(o)?u.length>1?u.filter(b=>b!==o):u:[...u,o])},sa=()=>{let o=C.length>0?C.filter(b=>!A.includes(b)):Object.values(as).flat().filter(b=>!A.includes(b)).slice(0,3);o.length>dt&&(o=o.slice(0,dt));const u=Math.min(p,Lt);return{topics:o,gradeLevel:j,numQuestions:u,questionTypes:N,includeGraphs:R,difficultyDistribution:F,bloomLevels:v,excludeTopics:A,classSectionId:r,className:a,preferImportedTopics:l.quizEnabled}},Cr=d.useCallback((o,u)=>{const b={taskId:o,request:u,createdAt:new Date().toISOString(),ownerUid:i?.uid};try{sessionStorage.setItem(vs,JSON.stringify(b))}catch{}},[i]),Ue=d.useCallback(()=>{try{sessionStorage.removeItem(vs)}catch{}},[]),ns=d.useCallback(o=>{const u=Math.max(0,Math.min(100,Math.round(typeof o.progressPercent=="number"?o.progressPercent:o.status==="queued"?10:o.status==="running"?65:o.status==="completed"?100:o.status==="cancelling"?95:100)));k(b=>{let H=Math.max(b,u);if(o.status==="running"&&u<=b){const ge=String(o.progressStage||"").toLowerCase(),ve=ge.includes("assembling")||ge.includes("final")?97:ge.includes("generating")?89:95;H=Math.min(ve,b+1)}return H}),ne(o.progressStage||o.status),W(o.progressMessage||(o.status==="queued"?"Task queued for generation.":o.status==="running"?"Generating quiz in the background...":o.status==="completed"?"Generation complete.":o.status==="cancelling"?"Cancelling generation...":"Generation finished with an error."))},[]);d.useEffect(()=>{if(n||K.current)return;if(K.current=!0,!i){Ue();return}let o=!1;const u=sessionStorage.getItem(vs);if(!u)return;let b=null;try{b=JSON.parse(u)}catch{Ue();return}if(!b?.taskId){Ue();return}if(b.ownerUid&&b.ownerUid!==i.uid){Ue();return}return g(!0),V(b.taskId),w(""),he.waitForTaskResult(b.taskId,{timeoutMs:24e4,pollIntervalMs:1500,onProgress:ns}).then(async H=>{if(o)return;const ge=H.result;if(!ge||typeof ge!="object")throw new Error("Quiz generation completed without a valid result payload.");const ve=ge;de(ve),h("results"),k(100),ne("completed"),W("Generation complete."),V(null),Ue();try{await oa(ve,b.request),U.success("Quiz auto-saved to your library as draft.")}catch(qe){U.error(qe instanceof Error?qe.message:"Quiz generated but failed to save to library")}}).catch(H=>{if(!o){if(H instanceof As&&(H.status===401||H.status===403)){K.current=!1,g(!1);return}w(H instanceof Error?H.message:"Failed to resume quiz generation"),V(null),Ue()}}).finally(()=>{o||g(!1)}),()=>{o=!0}},[ns,n,Ue,i]);const os=()=>{if(J){window.confirm("Quiz generation is in progress. Are you sure you want to leave?")&&(h("configure"),de(null),w(""),t());return}h("configure"),de(null),w(""),t()},Ir=async()=>{w(""),B(!0),re(null);try{const o=await he.previewQuiz(sa());re(o),h("preview")}catch(o){w(o instanceof Error?o.message:"Preview generation failed")}finally{B(!1)}},aa=async()=>{w(""),g(!0),Rt(null),k(8),ne("queued"),W("Submitting quiz generation task..."),de(null);const o=sa();try{const u=await he.generateQuiz(o,{onTaskCreated:b=>{V(b),Cr(b,o),k(H=>Math.max(H,12)),ne("queued"),W("Task queued. Generation is running in the background.")},onProgress:b=>{ns(b),b.taskId&&b.taskId!==ee&&V(b.taskId)}});de(u),h("results"),k(100),ne("completed"),W("Generation complete."),V(null),Ue();try{await oa(u,o),U.success("Quiz auto-saved to your library as draft.")}catch(b){U.error(b instanceof Error?b.message:"Quiz generated but failed to save to library")}he.reportImportGroundedFeedback({flow:"quiz",status:"success",classSectionId:o.classSectionId,className:o.className,metadata:{totalQuestions:u.metadata.totalQuestions,usedImportedTopics:!!u.metadata.usedImportedTopics,importedTopicCount:u.metadata.importedTopicCount??0,importGroundingEnabled:l.quizEnabled}})}catch(u){w(u instanceof Error?u.message:"Quiz generation failed"),k(100),ne("failed"),W("Generation failed."),V(null),Ue(),he.reportImportGroundedFeedback({flow:"quiz",status:"failed",classSectionId:o.classSectionId,className:o.className,metadata:{error:u instanceof Error?u.message:"Quiz generation failed",importGroundingEnabled:l.quizEnabled}})}finally{g(!1)}},Tr=()=>{if(!G)return;const o=G.questions.map((u,b)=>{let H=`${b+1}. [${u.difficulty.toUpperCase()}] [${u.bloomLevel}] (${u.points} pts) -`;return H+=` ${u.question} -`,u.options&&(H+=u.options.map(ge=>` ${ge}`).join(` -`)+` -`),H+=` Answer: ${u.correctAnswer} -`,H+=` Explanation: ${u.explanation} -`,H}).join(` -`);navigator.clipboard.writeText(o),ue(!0),setTimeout(()=>ue(!1),2e3)},Lr=()=>{if(!G)return;const o=new Blob([JSON.stringify(G,null,2)],{type:"application/json"}),u=URL.createObjectURL(o),b=document.createElement("a");b.href=u,b.download=`quiz_${j.replace(/\s/g,"_")}_${Date.now()}.json`,b.click(),URL.revokeObjectURL(u)},_t=C.length>0||Object.values(as).flat().length>0,ra=(o,u)=>{const b=u?.gradeLevel||j,H=u?.topics||C,ge=o.questions.map((ve,qe)=>({id:`q_${Date.now()}_${qe}`,questionType:ve.questionType||"identification",question:ve.question,...ve.options?{options:ve.options}:{},correctAnswer:ve.correctAnswer,bloomLevel:ve.bloomLevel||"understand",difficulty:ve.difficulty||"medium",topic:ve.topic,subject:b,points:ve.points,explanation:ve.explanation}));return{title:`${b} Quiz – ${H.length>0?H.slice(0,2).join(", "):"Mixed Topics"}`,gradeLevel:b,questions:ge,totalPoints:o.totalPoints,metadata:{topicsCovered:Object.keys(o.metadata.topicsCovered),difficultyBreakdown:{easy:o.metadata.difficultyBreakdown.easy??0,medium:o.metadata.difficultyBreakdown.medium??0,hard:o.metadata.difficultyBreakdown.hard??0},bloomDistribution:o.metadata.bloomTaxonomyDistribution,questionTypeBreakdown:o.metadata.questionTypeBreakdown,supplementalPurpose:o.metadata.supplementalPurpose,recommendedTeacherActions:o.metadata.recommendedTeacherActions??[],generatedAt:new Date().toISOString(),generatedBy:"teacher_generated"},status:"draft",source:"teacher_generated"}},na=d.useCallback(o=>{Tt(u=>[o,...u.filter(b=>b.id!==o.id)])},[]);async function oa(o,u){if(!i)return null;const b=ra(o,u),H=await ua(b,i.uid,Y?{documentId:Y}:void 0);return ke(H),na({id:H,...b,teacherId:i.uid}),H}const zr=async()=>{if(!G){U.error("No quiz to save. Generate a quiz first.");return}if(!i){U.error("You must be signed in to save quizzes.");return}we(!0);try{const o=ra(G),u=await ua(o,i.uid,Y?{documentId:Y}:void 0);ke(u),na({id:u,...o,teacherId:i.uid}),U.success("Quiz saved to your library!")}catch(o){U.error(o instanceof Error?o.message:"Failed to save quiz")}finally{we(!1)}},Mr=async()=>{if(Y){Fs(!0);try{await Hr(Y),Tt(o=>o.map(u=>u.id===Y?{...u,status:"published"}:u)),U.success("Quiz published to Quiz Bank!")}catch(o){U.error(o instanceof Error?o.message:"Failed to publish quiz")}finally{Fs(!1)}}},is=async o=>{const u=o??Y;if(!u){U.error("Save the quiz first before assigning.");return}if(Ks(u),It(!0),Vs(null),qs(""),Qs.length===0&&i){Us(!0);try{const b=await Ds(i.uid);gr(b)}catch{U.error("Failed to load students")}finally{Us(!1)}}},Ar=async()=>{const o=jr??Y;if(!(!Xe||!o||!i)){Gs(!0);try{await Jr(o,Xe,i.uid),Tt(u=>u.map(b=>b.id===o?{...b,status:"assigned",metadata:{...b.metadata,assignedTo:Xe}}:b)),U.success("Quiz assigned to student!"),It(!1),Ks(null),c==="bank"&&ls()}catch(u){U.error(u instanceof Error?u.message:"Failed to assign quiz")}finally{Gs(!1)}}},ls=d.useCallback(async()=>{if(i){Ws(!0);try{const o=await Vr(i.uid);Tt(o)}catch{U.error("Failed to load quiz bank")}finally{Ws(!1)}}},[i]);d.useEffect(()=>{c==="bank"&&ls()},[c,ls]);const $r=async o=>{try{await Wr(o),Tt(u=>u.filter(b=>b.id!==o)),U.success("Quiz deleted")}catch{U.error("Failed to delete quiz")}},ia=Qs.filter(o=>o.name.toLowerCase().includes(ts.toLowerCase())||o.email.toLowerCase().includes(ts.toLowerCase())),la=ss==="all"?Ys:Ys.filter(o=>o.status===ss),Pr=o=>{const u=(o.metadata.topicsCovered||[]).reduce((b,H)=>(b[H]=(b[H]||0)+1,b),{});return{questions:o.questions.map(b=>({questionType:b.questionType,question:b.question,correctAnswer:b.correctAnswer,options:b.options??null,bloomLevel:b.bloomLevel,difficulty:b.difficulty,topic:b.topic,points:b.points,explanation:b.explanation})),totalPoints:o.totalPoints,metadata:{topicsCovered:u,difficultyBreakdown:o.metadata.difficultyBreakdown,bloomTaxonomyDistribution:o.metadata.bloomDistribution,questionTypeBreakdown:o.metadata.questionTypeBreakdown,gradeLevel:o.gradeLevel,totalQuestions:o.questions.length,includesGraphQuestions:!1,supplementalPurpose:o.metadata.supplementalPurpose,bloomTaxonomyRationale:"Loaded from saved quiz bank entry.",recommendedTeacherActions:o.metadata.recommendedTeacherActions||[]}}},cs=o=>{ke(o.id),de(Pr(o)),re(null),Rt(o.id),it("all"),L("all"),je(null),h("results"),m("create")},Bt=(o,u,b,H)=>{const ge=Ne===o;return e.jsxs("div",{className:"border border-[#dde3eb] rounded-xl overflow-hidden",children:[e.jsxs("button",{onClick:()=>se(ge?null:o),className:"w-full flex items-center justify-between px-4 py-3 bg-[#edf1f7] hover:bg-[#dde3eb] transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold text-[#0a1628]",children:[b,u]}),ge?e.jsx(Qt,{size:18,className:"text-slate-500"}):e.jsx(st,{size:18,className:"text-slate-500"})]}),e.jsx(et,{children:ge&&e.jsx(ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:e.jsx("div",{className:"p-4",children:H})})})]})},Or={remember:"bg-sky-100 text-sky-700 border-sky-300",understand:"bg-rose-100 text-rose-700 border-rose-300",apply:"bg-emerald-100 text-emerald-700 border-emerald-300",analyze:"bg-rose-100 text-rose-700 border-rose-300"},ca=(o,u,b)=>{const H=$e===u,ge=Or[o.bloomLevel]||"bg-[#edf1f7] text-[#5a6578] border-[#dde3eb]";return e.jsxs(ie.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:u*.05},className:"border border-[#dde3eb] rounded-xl overflow-hidden relative",children:[e.jsx("div",{className:`absolute top-2 right-2 text-[10px] font-bold uppercase px-2 py-0.5 rounded border ${ge} z-10`,children:o.bloomLevel}),e.jsx("div",{className:"p-4 cursor-pointer hover:bg-[#edf1f7] transition-colors",onClick:()=>je(H?null:u),children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[e.jsxs("span",{className:"text-xs font-bold text-white bg-sky-600 px-2 py-0.5 rounded",children:["Q",u+1]}),e.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${$a[o.bloomLevel]?.color||"bg-[#edf1f7] text-[#5a6578]"}`,children:o.bloomLevel}),e.jsx("span",{className:`text-xs font-medium ${ys[o.difficulty]||"text-[#5a6578]"}`,children:o.difficulty}),e.jsxs("span",{className:"text-xs text-slate-500",children:[o.points," pts"]}),e.jsx("span",{className:"text-xs bg-[#edf1f7] text-[#5a6578] px-2 py-0.5 rounded",children:o.topic})]}),e.jsx("p",{className:"text-sm text-[#0a1628] font-medium",children:o.question})]}),e.jsx("div",{className:"flex-shrink-0 mt-1",children:H?e.jsx(Qt,{size:16,className:"text-slate-500"}):e.jsx(st,{size:16,className:"text-slate-500"})})]})}),e.jsx(et,{children:H&&e.jsx(ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-t border-[#dde3eb] overflow-hidden",children:e.jsxs("div",{className:"p-4 space-y-3 bg-[#edf1f7]/50",children:[o.options&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-1",children:"Options:"}),e.jsx("div",{className:"space-y-1",children:o.options.map((ve,qe)=>e.jsx("div",{className:`text-sm px-3 py-1.5 rounded-lg ${ve.includes(o.correctAnswer)?"bg-green-100 text-green-800 font-medium":"bg-white text-[#0a1628]"}`,children:ve},qe))})]}),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-green-700 mb-1",children:"Correct Answer:"}),e.jsx("p",{className:"text-sm text-green-800 font-medium",children:o.correctAnswer})]}),e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-lg p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-sky-700 mb-1",children:"Explanation:"}),e.jsx("p",{className:"text-sm text-sky-800",children:o.explanation})]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-500",children:[e.jsxs("span",{children:["Type: ",gs[o.questionType]?.label||o.questionType]}),e.jsxs("span",{children:["Bloom: ",o.bloomLevel]})]}),o.provenance&&e.jsxs("div",{className:"bg-[#f7fbff] border border-sky-100 rounded-lg p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-sky-700 mb-1",children:"Item Provenance"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-1 text-xs text-[#5a6578]",children:[o.provenance.title&&e.jsxs("p",{children:["Topic: ",o.provenance.title]}),o.provenance.topicId&&e.jsxs("p",{children:["Topic ID: ",o.provenance.topicId]}),o.provenance.materialId&&e.jsxs("p",{children:["Material ID: ",o.provenance.materialId]}),o.provenance.sourceFile&&e.jsxs("p",{children:["Source File: ",o.provenance.sourceFile]}),o.provenance.sectionId&&e.jsxs("p",{children:["Section ID: ",o.provenance.sectionId]})]})]})]})})})]},u)};return e.jsxs("div",{className:"w-full flex flex-col bg-[#f7f9fc] min-h-screen",children:[e.jsxs("div",{className:"bg-white border-b border-[#dde3eb] px-6 py-4 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("button",{onClick:os,className:"p-2 hover:bg-[#edf1f7] rounded-lg transition-colors text-slate-500",children:e.jsx(Et,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628]",children:"AI Quiz Maker"}),e.jsx("p",{className:"text-[#5a6578] text-sm mt-1",children:"Generate AI-powered assessments with Bloom's Taxonomy"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>m("create"),className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-semibold transition-colors ${c==="create"?"bg-sky-100 text-sky-700 border border-sky-300":"bg-[#edf1f7] text-[#5a6578] hover:bg-[#dde3eb]"}`,children:[e.jsx(xs,{size:16})," Create Quiz"]}),e.jsxs("button",{onClick:()=>m("bank"),className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-semibold transition-colors ${c==="bank"?"bg-sky-100 text-sky-700 border border-sky-300":"bg-[#edf1f7] text-[#5a6578] hover:bg-[#dde3eb]"}`,children:[e.jsx(ka,{size:16})," Quiz Bank"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 sm:px-8 xl:px-10 py-8",children:[c==="bank"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:["all","draft","published","assigned","completed"].map(o=>e.jsx("button",{onClick:()=>yr(o),className:`px-3 py-1.5 rounded-full text-xs font-semibold capitalize transition-colors ${ss===o?"bg-sky-100 text-sky-700 border border-sky-300":"bg-[#edf1f7] text-[#5a6578] hover:bg-[#dde3eb]"}`,children:o},o))}),vr?e.jsxs("div",{className:"flex items-center justify-center py-16",children:[e.jsx(Qe,{size:24,className:"animate-spin text-sky-500"}),e.jsx("span",{className:"ml-2 text-sm text-[#5a6578]",children:"Loading quiz bank…"})]}):la.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-slate-500",children:[e.jsx(ka,{size:40,className:"mb-3"}),e.jsx("p",{className:"font-medium",children:"No quizzes found"}),e.jsx("p",{className:"text-xs mt-1",children:"Generate your first quiz in the Create tab"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:la.map(o=>e.jsxs(ie.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},onClick:()=>cs(o),role:"button",tabIndex:0,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),cs(o))},className:"border border-[#dde3eb] rounded-xl p-4 hover:shadow-md transition-shadow cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] leading-tight",children:o.title}),e.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded-full capitalize ${Ko[o.status]}`,children:o.status})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:o.metadata.topicsCovered.slice(0,3).map(u=>e.jsx("span",{className:"text-[10px] bg-[#edf1f7] text-[#5a6578] px-2 py-0.5 rounded",children:u},u))}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#5a6578] mb-3",children:[e.jsxs("span",{children:[o.questions.length," questions"]}),e.jsxs("span",{children:[o.totalPoints," pts"]}),e.jsx("span",{children:o.gradeLevel})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:u=>{u.stopPropagation(),cs(o)},className:"flex items-center gap-1 px-3 py-1.5 text-xs font-semibold bg-[#edf1f7] text-[#5a6578] rounded-lg hover:bg-[#dde3eb] transition-colors",children:[e.jsx(ds,{size:12})," View"]}),e.jsxs("button",{onClick:u=>{u.stopPropagation(),is(o.id)},className:"flex items-center gap-1 px-3 py-1.5 text-xs font-semibold bg-sky-50 text-sky-700 rounded-lg hover:bg-sky-100 transition-colors",children:[e.jsx(zt,{size:12})," Assign"]}),e.jsxs("button",{onClick:u=>{u.stopPropagation(),$r(o.id)},className:"flex items-center gap-1 px-3 py-1.5 text-xs font-semibold bg-red-50 text-red-600 rounded-lg hover:bg-red-100 transition-colors",children:[e.jsx(Xr,{size:12})," Delete"]})]})]},o.id))})]}),c==="create"&&e.jsxs(e.Fragment,{children:[Ae&&e.jsxs(ie.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-4 bg-red-50 border border-red-200 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(ws,{size:18,className:"text-red-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-red-800 font-medium",children:"Error"}),e.jsx("p",{className:"text-sm text-red-600",children:Ae})]}),e.jsx("button",{onClick:()=>w(""),className:"ml-auto",children:e.jsx(Mt,{size:14,className:"text-red-400"})})]}),J&&e.jsxs(ie.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4 bg-white border border-sky-200 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{size:16,className:"animate-spin text-sky-600"}),e.jsx("p",{className:"text-sm font-semibold text-[#0a1628]",children:"Generating Quiz in Background"})]}),e.jsxs("span",{className:"text-xs font-bold text-sky-700",children:[ye,"%"]})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:e.jsx(ie.div,{animate:{width:`${ye}%`},transition:{duration:.35,ease:"easeOut"},className:"h-full bg-gradient-to-r from-sky-600 to-cyan-500"})}),e.jsxs("p",{className:"mt-2 text-xs text-[#5a6578] capitalize",children:["Stage: ",T.replace(/_/g," ")]}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:y}),ee&&e.jsxs("p",{className:"text-[11px] text-[#7b8798] mt-1",children:["Task ID: ",ee]})]}),f==="configure"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(Yr,{size:18,className:"text-sky-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-sky-800",children:"Supplemental Assessment Tool"}),e.jsx("p",{className:"text-xs text-sky-600",children:"This quiz maker generates supplemental assessments to support your classroom instruction — it does not replace teacher-led learning. Questions follow Bloom's Taxonomy for comprehensive skill evaluation."}),e.jsxs("p",{className:"text-[11px] text-sky-400 mt-1 flex items-center gap-1",children:[e.jsx(ws,{size:11}),"Generation limit: up to ",Lt," questions and ",dt," topics per quiz."]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"quiz-grade-level",className:"text-sm font-semibold text-[#0a1628] mb-1.5 block",children:"Grade Level"}),e.jsx("select",{id:"quiz-grade-level",value:j,onChange:o=>x(bs(o.target.value)),className:"w-full border border-[#dde3eb] rounded-xl px-4 py-2.5 text-sm focus:ring-2 focus:ring-sky-500 focus:border-sky-500 outline-none bg-white",children:Ho.map(o=>e.jsx("option",{value:o,children:o},o))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"quiz-num-questions",className:"text-sm font-semibold text-[#0a1628] mb-1.5 block",children:"Number of Questions"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>I(Math.max(1,p-1)),className:"w-9 h-9 border border-[#dde3eb] rounded-lg flex items-center justify-center hover:bg-[#edf1f7] transition-colors",children:e.jsx(xa,{size:14})}),e.jsx("input",{id:"quiz-num-questions",type:"number",min:1,max:Lt,value:p,onChange:o=>I(Math.min(Lt,Math.max(1,parseInt(o.target.value)||1))),className:"w-20 text-center border border-[#dde3eb] rounded-xl px-3 py-2.5 text-sm font-semibold focus:ring-2 focus:ring-sky-500 outline-none bg-white"}),e.jsx("button",{onClick:()=>I(Math.min(Lt,p+1)),className:"w-9 h-9 border border-[#dde3eb] rounded-lg flex items-center justify-center hover:bg-[#edf1f7] transition-colors",children:e.jsx(ha,{size:14})})]})]})]}),Bt("topics","Topics",e.jsx(Kt,{size:16}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-[#f6f9ff] border border-[#dde3eb] rounded-lg p-3",children:[e.jsxs("p",{className:"text-xs font-semibold text-[#0a1628]",children:["Imported topic context",a?` for ${a}`:""]}),e.jsx("p",{className:"text-xs text-[#5a6578] mt-1",children:S?"Loading imported topics...":be.length>0?`${be.length} imported topic${be.length!==1?"s":""} available and prioritized during generation`:"No imported topics found for the current class context"}),D&&e.jsx("p",{className:"text-[11px] text-amber-700 mt-1",children:D})]}),ce?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#5a6578]",children:[e.jsx(Qe,{size:14,className:"animate-spin"})," Loading topics..."]}):Object.entries(as).map(([o,u])=>e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold text-[#5a6578] uppercase tracking-wide mb-2",children:o}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(b=>{const H=C.includes(b),ge=A.includes(b);return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>Nr(b),className:`text-xs px-3 py-1.5 rounded-full border transition-all ${H?"bg-sky-100 border-sky-400 text-sky-700 font-medium":ge?"bg-red-50 border-red-200 text-red-400 line-through":"bg-white border-[#dde3eb] text-[#5a6578] hover:border-sky-300"}`,children:b}),e.jsx("button",{onClick:()=>wr(b),title:ge?"Include this topic":"Exclude this topic",className:`w-5 h-5 rounded-full flex items-center justify-center text-[10px] transition-colors ${ge?"bg-red-500 text-white":"bg-[#edf1f7] text-slate-500 hover:bg-red-100 hover:text-red-500"}`,children:e.jsx(Mt,{size:10})})]},b)})})]},o)),C.length>0&&e.jsxs("p",{className:`text-xs mt-2 ${C.filter(o=>!A.includes(o)).length>dt?"text-rose-600 font-medium":"text-sky-600"}`,children:[C.filter(o=>!A.includes(o)).length," topic",C.filter(o=>!A.includes(o)).length!==1?"s":""," selected",C.filter(o=>!A.includes(o)).length>dt&&` (only first ${dt} will be used)`]}),A.length>0&&e.jsxs("p",{className:"text-xs text-red-500 mt-1",children:[A.length," topic",A.length!==1?"s":""," excluded (class already competent)"]})]})),Bt("types","Question Types",e.jsx($s,{size:16}),e.jsxs("div",{className:"space-y-2",children:[Object.entries(gs).map(([o,u])=>e.jsxs("button",{onClick:()=>kr(o),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left ${N.includes(o)?"bg-sky-50 border-sky-300 text-sky-700":"bg-white border-[#dde3eb] text-[#5a6578] hover:border-sky-200"}`,children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${N.includes(o)?"bg-sky-200":"bg-[#edf1f7]"}`,children:u.icon}),e.jsxs("div",{className:"flex-1",children:[e.jsx("span",{className:"text-sm font-medium",children:u.label}),e.jsx("p",{className:"text-xs text-slate-500",children:u.description})]}),N.includes(o)&&e.jsx(Dt,{size:16,className:"text-sky-600"})]},o)),e.jsxs("label",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-[#dde3eb] cursor-pointer hover:bg-[#edf1f7] transition-colors mt-3",children:[e.jsx("input",{type:"checkbox",checked:R,onChange:o=>Z(o.target.checked),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("span",{className:"text-sm font-medium text-[#0a1628]",children:"Include Graph Questions"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Generates identification-type questions about graphs (text-described, as graphing is challenging for students)"})]})]})]})),Bt("bloom",e.jsxs("span",{className:"flex items-center gap-2",children:["Bloom's Taxonomy Levels",e.jsx("span",{role:"button",tabIndex:0,onClick:o=>{o.stopPropagation(),Ee(!0)},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),Ee(!0))},className:"w-5 h-5 rounded-full bg-cyan-100 hover:bg-cyan-200 flex items-center justify-center transition-colors cursor-pointer",title:"What is Bloom's Taxonomy?",children:e.jsx(Ft,{size:12,className:"text-sky-600"})})]}),e.jsx(Va,{size:16}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"bg-[#edf1f7] rounded-lg p-3 mb-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ft,{size:14,className:"text-slate-500 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Bloom's Taxonomy ensures questions assess different cognitive levels — from basic fact recall to complex analysis — providing comprehensive skill evaluation."})]})}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries($a).map(([o,u])=>e.jsxs("button",{onClick:()=>Sr(o),className:`flex items-center gap-2 px-3 py-2.5 rounded-xl border transition-all ${v.includes(o)?u.color+" font-medium":"bg-white border-[#dde3eb] text-[#5a6578]"}`,children:[e.jsx("span",{className:"text-sm",children:u.label}),e.jsx("span",{className:"text-[10px] text-slate-500 ml-auto",children:u.description})]},o))})]})),Bt("difficulty","Difficulty Distribution",e.jsx(vt,{size:16}),e.jsxs("div",{className:"space-y-4",children:[Object.entries(F).map(([o,u])=>e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:`text-sm font-medium w-16 capitalize ${ys[o]}`,children:o}),e.jsx("div",{className:"flex-1 h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:e.jsx(ie.div,{animate:{width:`${u}%`},className:`h-full rounded-full ${o==="easy"?"bg-green-500":o==="medium"?"bg-rose-500":"bg-red-500"}`})}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>ta(o,-5),className:"w-6 h-6 rounded border border-[#dde3eb] flex items-center justify-center hover:bg-[#edf1f7] text-slate-500",children:e.jsx(xa,{size:10})}),e.jsxs("span",{className:"text-sm font-bold w-10 text-center",children:[u,"%"]}),e.jsx("button",{onClick:()=>ta(o,5),className:"w-6 h-6 rounded border border-[#dde3eb] flex items-center justify-center hover:bg-[#edf1f7] text-slate-500",children:e.jsx(ha,{size:10})})]})]},o)),e.jsxs("p",{className:"text-xs text-slate-500 text-center",children:["Total: ",Object.values(F).reduce((o,u)=>o+u,0),"%"]})]}))]}),f==="preview"&&me&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(ds,{size:18,className:"text-rose-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-rose-800",children:"Preview Mode"}),e.jsxs("p",{className:"text-xs text-rose-600",children:["Showing ",me.questions.length," sample questions. Click each question to reveal its answer and explanation. Review quality before generating the full quiz."]})]})]}),me.questions.map((o,u)=>ca(o,u)),e.jsxs("div",{className:"bg-[#edf1f7] rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Preview Metadata"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs text-[#5a6578]",children:[e.jsxs("span",{children:["Topics: ",Object.keys(me.metadata.topicsCovered).join(", ")]}),e.jsxs("span",{children:["Total Points: ",me.totalPoints]})]})]})]}),f==="results"&&G&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 border border-sky-200 rounded-xl p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-bold font-display text-[#0a1628]",children:"Quiz Generated"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:Tr,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[E?e.jsx(Dt,{size:14,className:"text-green-500"}):e.jsx(sn,{size:14}),E?"Copied!":"Copy All"]}),e.jsxs("button",{onClick:Lr,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[e.jsx(Ps,{size:14}),"Export JSON"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-sky-600",children:G.questions.length}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Questions"})]}),e.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-rose-600",children:G.totalPoints}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Total Points"})]}),e.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-rose-600",children:Object.keys(G.metadata.topicsCovered).length}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Topics"})]}),e.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-emerald-600",children:Object.keys(G.metadata.bloomTaxonomyDistribution).length}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Bloom Levels"})]})]}),(G.metadata.usedImportedTopics||(G.metadata.topicProvenance||[]).length>0)&&e.jsxs("div",{className:"mt-4 bg-white rounded-lg p-3 border border-[#dde3eb]",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Imported Topic Provenance"}),e.jsxs("p",{className:"text-xs text-[#5a6578] mb-2",children:["Imported topics used: ",G.metadata.usedImportedTopics?"Yes":"No"," • ","Materials: ",G.metadata.importedMaterialsCount??0," • ","Topics: ",G.metadata.importedTopicCount??0]}),(G.metadata.topicProvenance||[]).slice(0,5).map((o,u)=>e.jsxs("div",{className:"text-xs text-[#5a6578]",children:[o.title||"Untitled topic",o.sourceFile?` • ${o.sourceFile}`:""]},`${o.topicId||o.title||"topic"}_${u}`)),(Zs.length>0||ea.length>0)&&e.jsxs("div",{className:"mt-3 grid grid-cols-1 md:grid-cols-2 gap-2",children:[e.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Filter by Source File"}),e.jsxs("select",{value:Ge,onChange:o=>it(o.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All sources"}),Zs.map(o=>e.jsx("option",{value:o,children:o},o))]})]}),e.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Filter by Material ID"}),e.jsxs("select",{value:Je,onChange:o=>L(o.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All materials"}),ea.map(o=>e.jsx("option",{value:o,children:o},o))]})]})]}),e.jsxs("p",{className:"text-[11px] text-[#5a6578] mt-2",children:["Showing ",rs.length," of ",G.questions.length," questions after provenance filters."]})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-white rounded-lg p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Difficulty"}),Object.entries(G.metadata.difficultyBreakdown).map(([o,u])=>e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:`capitalize ${ys[o]||"text-[#5a6578]"}`,children:o}),e.jsx("span",{className:"font-medium",children:u})]},o))]}),e.jsxs("div",{className:"bg-white rounded-lg p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Bloom's Taxonomy"}),Object.entries(G.metadata.bloomTaxonomyDistribution).map(([o,u])=>e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"capitalize",children:o}),e.jsx("span",{className:"font-medium",children:u})]},o))]}),e.jsxs("div",{className:"bg-white rounded-lg p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Question Types"}),Object.entries(G.metadata.questionTypeBreakdown).map(([o,u])=>e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:gs[o]?.label||o}),e.jsx("span",{className:"font-medium",children:u})]},o))]})]}),e.jsxs("div",{className:"mt-3 bg-sky-50 rounded-lg p-3 flex items-start gap-2",children:[e.jsx(Ft,{size:14,className:"text-sky-400 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-sky-600",children:G.metadata.supplementalPurpose})]}),G.metadata.recommendedTeacherActions&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-1",children:"Recommended Actions:"}),e.jsx("ul",{className:"list-disc list-inside text-xs text-[#5a6578] space-y-0.5",children:G.metadata.recommendedTeacherActions.map((o,u)=>e.jsx("li",{children:o},u))})]})]}),e.jsx("div",{className:"space-y-3",children:rs.length>0?rs.map((o,u)=>ca(o,u)):e.jsx("div",{className:"border border-[#dde3eb] rounded-xl p-4 bg-white text-sm text-[#5a6578]",children:"No questions match the selected provenance filters. Clear one or both filters to view all questions."})})]})]})]}),c==="create"&&e.jsxs("div",{className:"border-t border-[#dde3eb] px-6 sm:px-6 xl:px-10 py-4 bg-white flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"text-xs text-slate-500",children:[f==="configure"&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(an,{size:12})," Powered by Qwen/Qwen3.5-9B"]}),f==="preview"&&e.jsxs("span",{children:["Preview: ",me?.questions.length||0," sample questions"]}),f==="results"&&e.jsxs("span",{children:[G?.questions.length||0," questions • ",G?.totalPoints||0," points"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[f==="configure"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:Ir,disabled:!_t||M,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${_t&&!M?"bg-white border border-sky-300 text-sky-700 hover:bg-sky-50":"bg-[#edf1f7] text-slate-500 cursor-not-allowed"}`,children:[M?e.jsx(Qe,{size:16,className:"animate-spin"}):e.jsx(ds,{size:16}),"Preview (3 Qs)"]}),e.jsxs("button",{onClick:aa,disabled:!_t||J,className:`flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-bold transition-all ${_t&&!J?"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white shadow-lg shadow-sky-200":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[J?e.jsx(Qe,{size:16,className:"animate-spin"}):e.jsx(xs,{size:16}),J?`Generating... ${ye}%`:"Generate Quiz"]})]}),f==="preview"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>h("configure"),className:"px-4 py-2.5 rounded-xl text-sm font-medium bg-white border border-[#dde3eb] text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:"Back to Configure"}),e.jsxs("button",{onClick:aa,disabled:J,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-bold bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white shadow-lg shadow-sky-200 transition-all",children:[J?e.jsx(Qe,{size:16,className:"animate-spin"}):e.jsx(xs,{size:16}),J?`Generating... ${ye}%`:`Generate Full Quiz (${p} Qs)`]})]}),f==="results"&&(Hs?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{m("bank"),Rt(null)},className:"px-4 py-2.5 rounded-xl text-sm font-medium bg-white border border-[#dde3eb] text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:"Back to Quiz Bank"}),e.jsxs("button",{onClick:()=>is(Hs),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-sky-50 border border-sky-300 text-sky-700 hover:bg-sky-100 transition-colors",children:[e.jsx(zt,{size:16})," Assign"]}),e.jsx("button",{onClick:os,className:"px-5 py-2.5 rounded-xl text-sm font-bold bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white transition-all",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{h("configure"),de(null),re(null),ke(null),Rt(null)},className:"px-4 py-2.5 rounded-xl text-sm font-medium bg-white border border-[#dde3eb] text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:"Create Another"}),Y?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:Mr,disabled:Pe,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-green-50 border border-green-300 text-green-700 hover:bg-green-100 transition-colors",children:[Pe?e.jsx(Qe,{size:16,className:"animate-spin"}):e.jsx(Os,{size:16}),"Publish"]}),e.jsxs("button",{onClick:()=>is(),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-sky-50 border border-sky-300 text-sky-700 hover:bg-sky-100 transition-colors",children:[e.jsx(zt,{size:16})," Assign"]})]}):e.jsxs("button",{onClick:zr,disabled:q,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-emerald-50 border border-emerald-300 text-emerald-700 hover:bg-emerald-100 transition-colors",children:[q?e.jsx(Qe,{size:16,className:"animate-spin"}):e.jsx(Wa,{size:16}),"Save to Library"]}),e.jsx("button",{onClick:os,className:"px-5 py-2.5 rounded-xl text-sm font-bold bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white transition-all",children:"Done"})]}))]})]}),e.jsx(Wo,{isOpen:X,onClose:()=>Ee(!1)}),e.jsx(et,{children:pr&&e.jsx(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/40 z-[60] flex items-center justify-center p-4",onClick:()=>It(!1),children:e.jsxs(ie.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-[#f7f9fc] rounded-2xl shadow-2xl w-full max-w-md max-h-[70vh] flex flex-col overflow-hidden border border-[#dde3eb]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"px-5 py-4 border-b border-[#dde3eb] flex items-center justify-between",children:[e.jsxs("h3",{className:"text-base font-bold font-display text-[#0a1628] flex items-center gap-2",children:[e.jsx(Gt,{size:18,className:"text-sky-600"}),"Assign to Student"]}),e.jsx("button",{onClick:()=>It(!1),className:"p-1 hover:bg-[#edf1f7] rounded-lg transition-colors",children:e.jsx(Mt,{size:16,className:"text-slate-500"})})]}),e.jsx("div",{className:"px-5 py-3 border-b border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center gap-2 bg-[#edf1f7] rounded-xl px-3 py-2",children:[e.jsx(Ht,{size:14,className:"text-slate-500"}),e.jsx("input",{type:"text",placeholder:"Search students…",value:ts,onChange:o=>qs(o.target.value),className:"flex-1 bg-transparent text-sm outline-none placeholder:text-slate-500"})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:br?e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx(Qe,{size:20,className:"animate-spin text-sky-500"})}):ia.length===0?e.jsx("p",{className:"text-center text-sm text-slate-500 py-10",children:"No students found"}):ia.map(o=>e.jsxs("button",{onClick:()=>Vs(o.id),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-left transition-colors ${Xe===o.id?"bg-sky-50 border border-sky-300":"hover:bg-[#edf1f7] border border-transparent"}`,children:[e.jsx("img",{src:o.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(o.name)}&background=random&size=32`,alt:o.name,className:"w-8 h-8 rounded-lg object-cover"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-[#0a1628] truncate",children:o.name}),e.jsx("p",{className:"text-xs text-slate-500 truncate",children:o.email})]}),Xe===o.id&&e.jsx(Dt,{size:16,className:"text-sky-600 flex-shrink-0"})]},o.id))}),e.jsxs("div",{className:"px-5 py-3 border-t border-[#dde3eb] flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>It(!1),className:"px-4 py-2 text-sm font-medium text-[#5a6578] hover:bg-[#edf1f7] rounded-xl transition-colors",children:"Cancel"}),e.jsxs("button",{onClick:Ar,disabled:!Xe||es,className:`flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-bold transition-all ${Xe&&!es?"bg-gradient-to-r from-sky-600 to-sky-500 text-white shadow-sm":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[es?e.jsx(Qe,{size:14,className:"animate-spin"}):e.jsx(zt,{size:14}),"Assign"]})]})]})})})]})},ei={"gen-math":{label:"GEN MATH",color:"bg-sky-100 text-sky-700"},"stats-prob":{label:"STAT&PROB",color:"bg-sky-100 text-sky-700"},"pre-calc":{label:"PRE-CALC",color:"bg-orange-100 text-orange-700"},"basic-calc":{label:"BASIC CALC",color:"bg-red-100 text-red-700"}},ti={mastered:{label:"MASTERED BY CLASS",color:"bg-green-100 text-green-700 border-green-300"},on_track:{label:"ON TRACK",color:"bg-sky-100 text-sky-700 border-sky-300"},needs_attention:{label:"NEEDS ATTENTION",color:"bg-red-100 text-red-700 border-red-300"},no_data:{label:"NO DATA YET",color:"bg-[#edf1f7] text-[#5a6578] border-[#dde3eb]"}},Oa={needs_attention:0,on_track:1,no_data:2,mastered:3},Ea=()=>e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{className:"h-7 w-56 bg-[#dce4ee]"}),e.jsx(z,{className:"h-4 w-11/12 bg-[#e6edf5]"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Array.from({length:4}).map((t,s)=>e.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb] space-y-3",children:[e.jsx(z,{className:"h-10 w-10 rounded-xl bg-[#e3eaf4]"}),e.jsx(z,{className:"h-7 w-20 bg-[#dce4ee]"}),e.jsx(z,{className:"h-3 w-24 bg-[#e6edf5]"})]},`summary-skeleton-${s}`))}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsx(z,{className:"h-10 w-full rounded-xl bg-[#e6edf5]"}),e.jsx(z,{className:"h-10 w-full rounded-xl bg-[#e6edf5]"}),e.jsx(z,{className:"h-10 w-full rounded-xl bg-[#e6edf5]"})]}),e.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-[#dde3eb] p-4 space-y-3",children:Array.from({length:6}).map((t,s)=>e.jsx(z,{className:"h-12 w-full rounded-xl bg-[#eef3f9]"},`row-skeleton-${s}`))})]}),si=({classSectionId:t})=>{const{currentUser:s}=Wt(),[r,a]=d.useState([]),[i,n]=d.useState({totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0}),[l,c]=d.useState(!0),[m,f]=d.useState("all"),[h,j]=d.useState("all"),[x,p]=d.useState(""),[I,C]=d.useState("classAverage"),[P,A]=d.useState("asc"),Q=fa.map(S=>S.id),N=fa.reduce((S,_)=>(S[_.id]=_.name,S),{}),[O,v]=d.useState(new Set),[$,R]=d.useState([]),Z=d.useCallback(async()=>{if(s){c(!0);try{const S=Be(Te,"teachers",s.uid,"settings","quizSettings"),_=await ut(S),D=_.exists()?_.data()?.excludedTopics||[]:[];R(D);const te="https://deign86-mathpulse-api-v3test.hf.space",J=new URLSearchParams({teacherId:s.uid});t&&J.set("classSectionId",t);const g=await s.getIdToken(),M=await fetch(`${te}/api/analytics/topic-mastery?${J.toString()}`,{headers:{Authorization:`Bearer ${g}`}});if(M.ok){const B=await M.json(),ee=(B.topics||[]).map(V=>({...V,isExcluded:D.includes(V.topicName)}));a(ee),n(B.summary||{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:D.length})}else a([]),n({totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:D.length})}catch{a([]),n({totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:$.length})}finally{c(!1)}}},[t,s]);d.useEffect(()=>{Z()},[Z]);const F=async S=>{if(!s)return;const _=$.includes(S)?$.filter(D=>D!==S):[...$,S];R(_),a(D=>D.map(te=>te.topicName===S?{...te,isExcluded:!te.isExcluded}:te)),n(D=>({...D,excludedCount:_.length}));try{const D=Be(Te,"teachers",s.uid,"settings","quizSettings");(await ut(D)).exists()?await Ke(D,{excludedTopics:_}):await tt(D,{excludedTopics:_})}catch{U.error("Failed to update excluded topics")}},le=async()=>{if(!s)return;const S=[...new Set([...$,...O])];R(S),a(_=>_.map(D=>O.has(D.topicName)?{...D,isExcluded:!0}:D)),n(_=>({..._,excludedCount:S.length})),v(new Set);try{const _=Be(Te,"teachers",s.uid,"settings","quizSettings");(await ut(_)).exists()?await Ke(_,{excludedTopics:S}):await tt(_,{excludedTopics:S}),U.success(`${O.size} topics excluded from quizzes`)}catch{U.error("Failed to update")}},oe=async()=>{if(!s)return;const S=$.filter(_=>!O.has(_));R(S),a(_=>_.map(D=>O.has(D.topicName)?{...D,isExcluded:!1}:D)),n(_=>({..._,excludedCount:S.length})),v(new Set);try{const _=Be(Te,"teachers",s.uid,"settings","quizSettings");(await ut(_)).exists()?await Ke(_,{excludedTopics:S}):await tt(_,{excludedTopics:S}),U.success(`${O.size} topics re-included in quizzes`)}catch{U.error("Failed to update")}},ae=S=>{I===S?A(_=>_==="asc"?"desc":"asc"):(C(S),A("asc"))},ce=h==="all"?Q:rn(h);d.useEffect(()=>{m!=="all"&&(ce.includes(m)||f("all"))},[ce,m]);const pe=r.filter(S=>!(m!=="all"&&S.subjectId!==m||!ce.includes(S.subjectId)||x&&!S.topicName.toLowerCase().includes(x.toLowerCase()))).sort((S,_)=>{const D=P==="asc"?1:-1;switch(I){case"topicName":return D*S.topicName.localeCompare(_.topicName);case"classAverage":return D*(S.classAverage-_.classAverage);case"studentsAttempted":return D*(S.studentsAttempted-_.studentsAttempted);case"masteryStatus":return D*((Oa[S.masteryStatus]||0)-(Oa[_.masteryStatus]||0));default:return 0}}),be=()=>{O.size===pe.length?v(new Set):v(new Set(pe.map(S=>S.topicName)))},xe=({field:S})=>I!==S?e.jsx(st,{size:12,className:"text-slate-500"}):P==="asc"?e.jsx(Qt,{size:12,className:"text-sky-600"}):e.jsx(st,{size:12,className:"text-sky-600"});return e.jsx(pt,{name:"teacher-topic-mastery-view",loading:l,fixture:e.jsx(Ea,{}),fallback:e.jsx(Ea,{}),children:e.jsxs(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:"Class Topic Mastery"}),e.jsx("p",{className:"text-sm text-[#5a6578] mt-1",children:"Topics where 75% or more of the class scored 85%+ are marked as mastered and can be excluded from future quiz generation."})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb]",children:[e.jsx("div",{className:"flex items-center gap-3 mb-2",children:e.jsx("div",{className:"w-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center",children:e.jsx(vt,{size:20,className:"text-sky-600"})})}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:i.totalTopicsTracked}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Total Topics Tracked"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-green-200",children:[e.jsx("div",{className:"flex items-center gap-3 mb-2",children:e.jsx("div",{className:"w-10 h-10 bg-green-100 rounded-xl flex items-center justify-center",children:e.jsx(Ka,{size:20,className:"text-green-600"})})}),e.jsx("p",{className:"text-2xl font-bold text-green-600",children:i.masteredCount}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Mastered by Class"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-red-200",children:[e.jsx("div",{className:"flex items-center gap-3 mb-2",children:e.jsx("div",{className:"w-10 h-10 bg-red-100 rounded-xl flex items-center justify-center",children:e.jsx(At,{size:20,className:"text-red-600"})})}),e.jsx("p",{className:"text-2xl font-bold text-red-600",children:i.needsAttentionCount}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Needs Work"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb]",children:[e.jsx("div",{className:"flex items-center gap-3 mb-2",children:e.jsx("div",{className:"w-10 h-10 bg-[#edf1f7] rounded-xl flex items-center justify-center",children:e.jsx(on,{size:20,className:"text-[#5a6578]"})})}),e.jsx("p",{className:"text-2xl font-bold text-[#5a6578]",children:i.excludedCount}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Excluded Topics"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-white rounded-xl px-3 py-2 border border-[#dde3eb]",children:[e.jsx(Ht,{size:14,className:"text-slate-500"}),e.jsx("input",{type:"text",placeholder:"Search topics...",value:x,onChange:S=>p(S.target.value),className:"bg-transparent text-sm outline-none w-40 placeholder:text-slate-500"})]}),e.jsxs("select",{value:m,onChange:S=>f(S.target.value),className:"bg-white border border-[#dde3eb] rounded-xl px-3 py-2 text-sm outline-none",children:[e.jsx("option",{value:"all",children:"All Subjects"}),ce.map(S=>e.jsx("option",{value:S,children:N[S]||S},S))]}),e.jsxs("select",{value:h,onChange:S=>j(S.target.value),className:"bg-white border border-[#dde3eb] rounded-xl px-3 py-2 text-sm outline-none",children:[e.jsx("option",{value:"all",children:"All Grades"}),nn.map(S=>e.jsx("option",{value:S,children:S},S))]})]}),e.jsx(et,{children:O.size>0&&e.jsxs(ie.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-sky-50 border border-sky-200 rounded-xl p-3 flex items-center gap-3 flex-wrap overflow-hidden",children:[e.jsxs("span",{className:"text-sm font-semibold text-sky-700",children:[O.size," topics selected"]}),e.jsx("button",{onClick:le,className:"px-3 py-1.5 bg-[#5a6578] text-white text-xs font-bold rounded-lg hover:bg-sky-600 transition-colors",children:"Exclude Selected Topics"}),e.jsx("button",{onClick:oe,className:"px-3 py-1.5 bg-green-600 text-white text-xs font-bold rounded-lg hover:bg-green-700 transition-colors",children:"Include Selected Topics"}),e.jsx("button",{onClick:()=>v(new Set),className:"px-3 py-1.5 bg-white border border-[#dde3eb] text-[#5a6578] text-xs font-bold rounded-lg hover:bg-[#edf1f7] transition-colors",children:"Clear Selection"})]})}),e.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-[#dde3eb] overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[e.jsx("th",{className:"px-4 py-3 w-10",children:e.jsx("input",{type:"checkbox",checked:O.size===pe.length&&pe.length>0,onChange:be,className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),e.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>ae("topicName"),children:e.jsxs("span",{className:"flex items-center gap-1",children:["Topic Name ",e.jsx(xe,{field:"topicName"})]})}),e.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide",children:"Unit"}),e.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>ae("classAverage"),children:e.jsxs("span",{className:"flex items-center gap-1",children:["Class Avg % ",e.jsx(xe,{field:"classAverage"})]})}),e.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>ae("studentsAttempted"),children:e.jsxs("span",{className:"flex items-center gap-1",children:["Students ",e.jsx(xe,{field:"studentsAttempted"})]})}),e.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>ae("masteryStatus"),children:e.jsxs("span",{className:"flex items-center gap-1",children:["Status ",e.jsx(xe,{field:"masteryStatus"})]})}),e.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide",children:"Exclude"})]})}),e.jsx("tbody",{children:pe.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"px-4 py-16 text-center",children:r.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(vt,{size:32,className:"text-[#dde3eb]"}),e.jsx("p",{className:"text-sm font-medium text-[#5a6578]",children:"No topic data available yet"}),e.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Import student quiz data to see class topic mastery analytics."})]}):e.jsx("span",{className:"text-sm text-slate-500",children:"No topics match the current filters."})})}):pe.map(S=>{const _=O.has(S.topicName),D=ti[S.masteryStatus],te=ei[S.subjectId]||{label:S.subjectId.toUpperCase(),color:"bg-[#edf1f7] text-[#5a6578]"},J=S.classAverage<60?"bg-red-500":S.classAverage<85?"bg-rose-500":"bg-green-500",g=S.isExcluded?"bg-[#edf1f7] opacity-60":S.masteryStatus==="needs_attention"?"bg-red-50/30":S.masteryStatus==="mastered"?"bg-green-50/30":"";return e.jsxs("tr",{className:`border-b border-[#dde3eb] hover:bg-[#edf1f7] transition-colors ${g} ${S.isExcluded?"line-through decoration-slate-400":""}`,children:[e.jsx("td",{className:"px-4 py-3",children:e.jsx("input",{type:"checkbox",checked:_,onChange:()=>{const M=new Set(O);_?M.delete(S.topicName):M.add(S.topicName),v(M)},className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[#0a1628]",children:S.topicName}),e.jsx("span",{className:`text-[10px] font-bold px-1.5 py-0.5 rounded ${te.color}`,children:te.label})]})}),e.jsx("td",{className:"px-4 py-3 text-xs text-[#5a6578]",children:S.unit}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-2 bg-[#edf1f7] rounded-full overflow-hidden max-w-20",children:e.jsx("div",{className:`h-full rounded-full ${J}`,style:{width:`${S.classAverage}%`}})}),e.jsxs("span",{className:"text-xs font-bold text-[#0a1628] w-8 text-right",children:[S.classAverage,"%"]})]})}),e.jsxs("td",{className:"px-4 py-3 text-xs text-[#5a6578]",children:[S.studentsAttempted,"/",S.totalStudents]}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded border ${D.color}`,children:D.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"group relative",children:[e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:S.isExcluded,onChange:()=>F(S.topicName),className:"sr-only peer"}),e.jsx("div",{className:"w-9 h-5 bg-[#dde3eb] peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-[#dde3eb] after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#5a6578]"})]}),e.jsx("div",{className:"hidden group-hover:block absolute z-20 bottom-full left-0 mb-1 px-2 py-1 bg-slate-800 text-white text-[10px] rounded whitespace-nowrap",children:"Excluded topics will not appear in AI-generated quizzes for your class"})]})})]},S.topicName)})})]})})})]})})};function ft(t){return(t||"").trim().toLowerCase()}function Ra(t){const s=(t.lrn||"").trim().toLowerCase();if(s)return`lrn:${s}`;const r=(t.email||"").trim().toLowerCase();if(r)return`email:${r}`;const a=ft(t.classSectionId),i=(t.id||"").trim().toLowerCase();if(a&&i)return`${a}|id:${i}`;if(i)return`id:${i}`;const n=t.name.trim().toLowerCase();return a&&n?`${a}|name:${n}`:n?`name:${n}`:`${a}|anonymous`}function ai(t,s){const r=[],a=(t.lrn||"").trim().toLowerCase(),i=(t.email||"").trim().toLowerCase(),n=t.name.trim().toLowerCase(),l=(t.id||"").trim().toLowerCase();return a&&r.push(`${s}|lrn:${a}`),i&&r.push(`${s}|email:${i}`),n&&r.push(`${s}|name:${n}`),l&&r.push(`${s}|id:${l}`),r.length===0&&r.push(`${s}|anonymous`),r}function ri(t,s){const r=[t.riskLevel,s.riskLevel].includes("High")?"High":[t.riskLevel,s.riskLevel].includes("Medium")?"Medium":"Low";return{...t,lrn:t.lrn||s.lrn,classSectionId:t.classSectionId??s.classSectionId,avgQuizScore:s.avgQuizScore>0?s.avgQuizScore:t.avgQuizScore,engagementScore:s.engagementScore>0?s.engagementScore:t.engagementScore,weakestTopic:t.weakestTopic&&t.weakestTopic!=="Foundational Skills"?t.weakestTopic:s.weakestTopic,riskLevel:r}}function hr(t,s){const r=new Map,a=new Map,i=s?ft(s):"all";return t.forEach(n=>{const l=ai(n,i),c=l.map(h=>a.get(h)).find(Boolean)||l[0],m=r.get(c),f=m?ri(m,n):n;r.set(c,f),l.forEach(h=>a.set(h,c))}),Array.from(r.values())}function _a(t,s){return hr([...t,...s])}const js={High:{bg:"bg-red-100",text:"text-red-700",ring:"ring-red-300"},Medium:{bg:"bg-rose-100",text:"text-rose-700",ring:"ring-rose-300"},Low:{bg:"bg-green-100",text:"text-green-700",ring:"ring-green-300"}},Ba={advanced:{bg:"bg-emerald-100",text:"text-emerald-700",bar:"bg-emerald-500"},proficient:{bg:"bg-sky-100",text:"text-sky-700",bar:"bg-sky-500"},developing:{bg:"bg-rose-100",text:"text-rose-700",bar:"bg-rose-500"},beginner:{bg:"bg-red-100",text:"text-red-700",bar:"bg-red-500"}},Da=()=>e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:Array.from({length:4}).map((t,s)=>e.jsxs("div",{className:"bg-card rounded-xl border border-border p-4 space-y-2",children:[e.jsx(z,{className:"h-4 w-24"}),e.jsx(z,{className:"h-8 w-20"})]},`competency-summary-skeleton-${s}`))}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-3",children:[e.jsx(z,{className:"h-10 w-full lg:w-72 rounded-lg"}),e.jsx("div",{className:"flex gap-2",children:Array.from({length:4}).map((t,s)=>e.jsx(z,{className:"h-8 w-20 rounded-lg"},`risk-pill-skeleton-${s}`))})]}),e.jsx("div",{className:"bg-card rounded-xl border border-border p-4 space-y-3",children:Array.from({length:6}).map((t,s)=>e.jsx(z,{className:"h-14 w-full rounded-lg"},`competency-row-skeleton-${s}`))})]}),ni=()=>e.jsxs("div",{className:"space-y-3 py-2",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:Array.from({length:3}).map((t,s)=>e.jsxs("div",{className:"bg-card rounded-lg border border-border p-3 space-y-2",children:[e.jsx(z,{className:"h-4 w-3/4"}),e.jsx(z,{className:"h-3 w-full"}),e.jsx(z,{className:"h-3 w-11/12"})]},`competency-detail-card-skeleton-${s}`))}),e.jsx(z,{className:"h-20 w-full rounded-lg"})]}),oi=({classSectionId:t,className:s,fallbackStudents:r=[]})=>{const{currentUser:a}=Wt(),[i,n]=d.useState([]),[l,c]=d.useState(!0),[m,f]=d.useState(""),[h,j]=d.useState("riskLevel"),[x,p]=d.useState("desc"),[I,C]=d.useState("all"),[P,A]=d.useState([]),[Q,N]=d.useState(!1),[O,v]=d.useState(""),[$,R]=d.useState(""),Z=d.useCallback(g=>({id:g.id,lrn:g.lrn||void 0,name:g.name,email:g.email||"",avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(g.name)}&background=random`,classSectionId:g.classSectionId??null,riskLevel:g.riskLevel||"Low",engagementScore:g.engagementScore,avgQuizScore:g.avgQuizScore,weakestTopic:g.weakestTopic||"Foundational Skills"}),[]),F=d.useCallback(g=>({id:g.id,lrn:g.lrn,name:g.name,email:g.email||"",avatar:g.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(g.name)}&background=random`,classSectionId:g.classSectionId??null,riskLevel:String(g.riskLevel).charAt(0).toUpperCase()+String(g.riskLevel).slice(1).toLowerCase(),engagementScore:g.engagementScore,avgQuizScore:Number(g.avgQuizScore??g.avgScore??0),weakestTopic:g.weakestTopic||"Foundational Skills"}),[]),le=d.useCallback(async()=>{if(a?.uid){c(!0),R("");try{let M=(await Ds(a.uid)).map(V=>({id:V.id,lrn:V.lrn||void 0,name:V.name,email:V.email||"",avatar:V.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(V.name)}&background=random`,classSectionId:V.classSectionId??null,riskLevel:V.riskLevel,engagementScore:V.engagementScore,avgQuizScore:V.avgQuizScore,weakestTopic:V.weakestTopic||"Foundational Skills"}));if(r.length>0&&(M=_a(M,r.map(F))),t){const V=ft(t);M=M.filter(ye=>ft(ye.classSectionId)===V)}const B=await he.getImportedClassOverview({classSectionId:t,limit:3e3});B.warnings.length>0&&R(B.warnings.join(" ")),M=_a(M,B.students.map(Z));const ee=hr(M,t);n(ee.map(V=>({rowKey:Ra(V),student:V,competency:null,loading:!1,expanded:!1})))}catch(g){if(console.error("Failed to load students:",g),r.length>0){const M=r.map(F).filter(B=>!t||ft(B.classSectionId)===ft(t)).map(B=>({rowKey:Ra(B),student:B,competency:null,loading:!1,expanded:!1}));n(M),R("Showing recently imported students while backend roster sync catches up.")}else n([]),R("Student competency roster is unavailable right now.")}finally{c(!1)}}},[t,a?.uid,r,F,Z]);d.useEffect(()=>{le()},[le]),d.useEffect(()=>{(async()=>{if(!t){A([]),v("");return}N(!0),v("");try{const M=await he.getCourseMaterialTopics({classSectionId:t,limit:20}),B=(M.topics||[]).filter(ee=>ee.title?.trim());A(B),M.warnings.length>0&&v(M.warnings.join(" "))}catch{A([]),v("Imported topic context is unavailable right now.")}finally{N(!1)}})()},[t]);const oe=async g=>{const M=i.find(ee=>ee.rowKey===g);if(!M)return;const B=!M.expanded;if(B&&!M.competency&&!M.loading){n(ee=>ee.map(V=>V.rowKey===g?{...V,expanded:!0,loading:!0}:V)),ae(g,M.student);return}n(ee=>ee.map(V=>V.rowKey===g?{...V,expanded:B}:V))},ae=async(g,M)=>{try{const B=M.id,V=((await Fr(B))?.quizAttempts??[]).map(k=>({topic:k.quizId,score:k.score,total:100,timeTaken:k.timeSpent})),ye=await he.getStudentCompetency(B,V.length>0?V:void 0);n(k=>k.map(T=>T.rowKey===g?{...T,competency:ye,loading:!1}:T))}catch{const ee=M.avgQuizScore||50,ye={studentId:M.id||"",competencies:[{topic:M.weakestTopic||"Unknown",efficiencyScore:Math.max(15,ee-20),competencyLevel:ee<50?"beginner":"developing",perspective:`Student needs focused practice in ${M.weakestTopic}.`},{topic:"Functions and Relations",efficiencyScore:Math.min(95,ee+10),competencyLevel:ee>70?"proficient":"developing",perspective:"Shows solid understanding of function concepts."},{topic:"Problem Solving",efficiencyScore:ee,competencyLevel:ee>80?"advanced":ee>60?"proficient":"developing",perspective:"Applies mathematical reasoning consistently."}],recommendedTopics:[M.weakestTopic||"Review fundamentals"],excludeTopics:[]};n(k=>k.map(T=>T.rowKey===g?{...T,competency:ye,loading:!1}:T))}},ce=g=>{h===g?p(M=>M==="asc"?"desc":"asc"):(j(g),p("asc"))},pe={High:0,Medium:1,Low:2},be=i.filter(g=>{if(I!=="all"&&g.student.riskLevel!==I)return!1;if(m){const M=m.toLowerCase();return g.student.name.toLowerCase().includes(M)||g.student.email.toLowerCase().includes(M)}return!0}).sort((g,M)=>{let B=0;switch(h){case"name":B=g.student.name.localeCompare(M.student.name);break;case"avgQuizScore":B=g.student.avgQuizScore-M.student.avgQuizScore;break;case"riskLevel":B=pe[g.student.riskLevel]-pe[M.student.riskLevel];break;case"engagementScore":B=g.student.engagementScore-M.student.engagementScore;break}return x==="asc"?B:-B}),xe=i.length,S=i.filter(g=>g.student.riskLevel==="High").length,_=xe>0?Math.round(i.reduce((g,M)=>g+M.student.avgQuizScore,0)/xe):0,D=xe>0?Math.round(i.reduce((g,M)=>g+M.student.engagementScore,0)/xe):0,te=Array.from(new Set(P.map(g=>g.title).filter(Boolean))).slice(0,10),J=({field:g})=>h!==g?e.jsx(st,{size:14,className:"text-slate-500"}):x==="asc"?e.jsx(Qt,{size:14,className:"text-sky-600"}):e.jsx(st,{size:14,className:"text-sky-600"});return e.jsx(pt,{name:"teacher-student-competency-table",loading:l,fixture:e.jsx(Da,{}),fallback:e.jsx(Da,{}),children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Total Students",value:xe,icon:e.jsx(pa,{size:20}),color:"bg-sky-50 text-sky-600"},{label:"At-Risk Students",value:S,icon:e.jsx(At,{size:20}),color:"bg-red-50 text-red-600"},{label:"Class Average",value:`${_}%`,icon:e.jsx(vt,{size:20}),color:"bg-emerald-50 text-emerald-600"},{label:"Avg. Engagement",value:`${D}%`,icon:e.jsx(Os,{size:20}),color:"bg-sky-50 text-sky-600"}].map((g,M)=>e.jsxs("div",{className:"bg-card rounded-xl border border-border p-4 flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${g.color}`,children:g.icon}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:g.value}),e.jsx("p",{className:"text-xs text-muted-foreground",children:g.label})]})]},M))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 max-w-xs",children:[e.jsx(Ht,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx("input",{id:"competency-student-search",name:"competency-student-search","aria-label":"Search students",type:"text",placeholder:"Search students...",value:m,onChange:g=>f(g.target.value),className:"w-full pl-9 pr-4 py-2 border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-sky-500/20 focus:border-sky-400"})]}),e.jsx("div",{className:"flex gap-1.5",children:["all","High","Medium","Low"].map(g=>e.jsx("button",{onClick:()=>C(g),className:`px-3 py-1.5 rounded-lg text-xs font-semibold transition-all ${I===g?"bg-sky-600 text-white":"bg-muted text-muted-foreground hover:bg-accent"}`,children:g==="all"?"All":`${g} Risk`},g))}),e.jsxs("button",{onClick:le,className:"ml-auto flex items-center gap-1.5 px-3 py-1.5 bg-muted hover:bg-accent rounded-lg text-xs font-semibold text-muted-foreground transition-colors",children:[e.jsx(Zr,{size:14}),"Refresh"]})]}),e.jsxs("div",{className:"bg-secondary border border-border rounded-xl p-3",children:[e.jsxs("p",{className:"text-xs font-semibold text-foreground",children:["Imported Topic Context",s?` for ${s}`:""]}),e.jsx("div",{className:"mt-1",children:Q?e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{className:"h-3.5 w-64"}),e.jsx(z,{className:"h-3.5 w-52"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:te.length>0?`${te.length} imported topics loaded for competency guidance`:"No imported topics found for this class context"})}),O&&e.jsx("p",{className:"text-[11px] text-amber-700 mt-1",children:O}),$&&e.jsx("p",{className:"text-[11px] text-amber-700 mt-1",children:$}),te.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:te.map(g=>e.jsx("span",{className:"text-[11px] bg-sky-100 text-sky-700 px-2 py-0.5 rounded",children:g},g))})]}),e.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:[e.jsxs("div",{className:"grid grid-cols-12 gap-2 px-4 py-3 bg-muted border-b border-border text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:[e.jsx("div",{className:"col-span-1"}),e.jsxs("button",{className:"col-span-3 flex items-center gap-1 hover:text-foreground",onClick:()=>ce("name"),children:["Student ",e.jsx(J,{field:"name"})]}),e.jsxs("button",{className:"col-span-2 flex items-center gap-1 hover:text-foreground",onClick:()=>ce("riskLevel"),children:["Risk Level ",e.jsx(J,{field:"riskLevel"})]}),e.jsxs("button",{className:"col-span-2 flex items-center gap-1 hover:text-foreground",onClick:()=>ce("avgQuizScore"),children:["Avg. Score ",e.jsx(J,{field:"avgQuizScore"})]}),e.jsxs("button",{className:"col-span-2 flex items-center gap-1 hover:text-foreground",onClick:()=>ce("engagementScore"),children:["Engagement ",e.jsx(J,{field:"engagementScore"})]}),e.jsx("div",{className:"col-span-2 text-right",children:"Weakest Topic"})]}),be.length===0?e.jsxs("div",{className:"py-12 text-center text-slate-500",children:[e.jsx(pa,{size:32,className:"mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No students match the current filters"})]}):e.jsx("div",{className:"divide-y divide-border",children:be.map(g=>{const M=g.student.riskLevel==="High"?{card:"bg-rose-50 border-rose-200",title:"text-rose-800",chip:"bg-rose-100 text-rose-700"}:g.student.riskLevel==="Medium"?{card:"bg-amber-50 border-amber-200",title:"text-amber-800",chip:"bg-amber-100 text-amber-700"}:{card:"bg-sky-50 border-sky-200",title:"text-sky-800",chip:"bg-sky-100 text-sky-700"};return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>void oe(g.rowKey),className:"w-full grid grid-cols-12 gap-2 px-4 py-3 items-center hover:bg-muted transition-colors text-left",children:[e.jsx("div",{className:"col-span-1 flex items-center",children:e.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-slate-500",children:g.expanded?e.jsx(st,{size:16}):e.jsx(Jt,{size:16})})}),e.jsxs("div",{className:"col-span-3 flex items-center gap-3",children:[e.jsx("img",{src:g.student.avatar,alt:g.student.name,className:"w-8 h-8 rounded-full bg-border object-cover"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:g.student.name}),e.jsx("p",{className:"text-xs text-slate-500",children:g.student.email})]})]}),e.jsx("div",{className:"col-span-2",children:e.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-bold ring-1 ${js[g.student.riskLevel]?.bg} ${js[g.student.riskLevel]?.text} ${js[g.student.riskLevel]?.ring}`,children:[g.student.riskLevel==="High"&&e.jsx(At,{size:10}),g.student.riskLevel]})}),e.jsx("div",{className:"col-span-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${g.student.avgQuizScore>=80?"bg-emerald-500":g.student.avgQuizScore>=60?"bg-sky-500":g.student.avgQuizScore>=40?"bg-rose-500":"bg-red-500"}`,style:{width:`${g.student.avgQuizScore}%`}})}),e.jsxs("span",{className:"text-xs font-bold text-muted-foreground w-8 text-right",children:[g.student.avgQuizScore,"%"]})]})}),e.jsx("div",{className:"col-span-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${g.student.engagementScore>=75?"bg-sky-500":g.student.engagementScore>=50?"bg-sky-400":"bg-[#a8a5b3]"}`,style:{width:`${g.student.engagementScore}%`}})}),e.jsxs("span",{className:"text-xs font-bold text-muted-foreground w-8 text-right",children:[g.student.engagementScore,"%"]})]})}),e.jsx("div",{className:"col-span-2 text-right",children:e.jsx("span",{className:"text-xs font-medium text-muted-foreground bg-muted px-2 py-1 rounded-md",children:g.student.weakestTopic})})]}),e.jsx(et,{children:g.expanded&&e.jsx(ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:e.jsx("div",{className:"px-6 py-4 bg-muted border-t border-border",children:g.loading?e.jsx(ni,{}):g.competency?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:g.competency.competencies.map((B,ee)=>e.jsx(ii,{competency:B},ee))}),g.competency.recommendedTopics.length>0&&e.jsxs("div",{className:`border rounded-lg p-3 ${M.card}`,children:[e.jsxs("h5",{className:`text-xs font-bold mb-1.5 flex items-center gap-1 ${M.title}`,children:[e.jsx(Kt,{size:12}),"Recommended Focus Areas"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.competency.recommendedTopics.map((B,ee)=>e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${M.chip}`,children:B},ee))})]}),te.length>0&&e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-lg p-3",children:[e.jsxs("h5",{className:"text-xs font-bold text-sky-800 mb-1.5 flex items-center gap-1",children:[e.jsx(Ya,{size:12}),"Class Imported Topics"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:te.slice(0,8).map((B,ee)=>e.jsx("span",{className:"inline-flex items-center bg-sky-100 text-sky-700 px-2 py-0.5 rounded text-xs font-medium",children:B},`${B}_${ee}`))})]}),g.competency.excludeTopics.length>0&&e.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded-lg p-3",children:[e.jsxs("h5",{className:"text-xs font-bold text-emerald-800 mb-1.5 flex items-center gap-1",children:[e.jsx(ln,{size:12}),"Mastered Topics (can exclude from quizzes)"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.competency.excludeTopics.map((B,ee)=>e.jsx("span",{className:"inline-flex items-center bg-emerald-100 text-emerald-700 px-2 py-0.5 rounded text-xs font-medium",children:B},ee))})]})]}):e.jsx("p",{className:"text-sm text-slate-500 text-center py-4",children:"No competency data available. Student needs to complete quizzes first."})})})})]},g.rowKey)})})]})]})})},ii=({competency:t})=>{const s=Ba[t.competencyLevel]||Ba.developing;return e.jsxs("div",{className:"bg-card rounded-lg border border-border p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h6",{className:"text-xs font-bold text-foreground truncate flex-1",children:t.topic}),e.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-[10px] font-bold uppercase ${s.bg} ${s.text}`,children:t.competencyLevel})]}),e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[e.jsx("span",{className:"text-slate-500",children:"Efficiency"}),e.jsxs("span",{className:"font-bold text-muted-foreground",children:[t.efficiencyScore,"%"]})]}),e.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:e.jsx(ie.div,{initial:{width:0},animate:{width:`${t.efficiencyScore}%`},transition:{duration:.6,delay:.1},className:`h-full rounded-full ${s.bar}`})})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug line-clamp-2",children:t.perspective})]})};function li(t){const s=t.atRiskCount>=5?"high":t.atRiskCount>=2?"medium":"low",r=Ie({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.name,grade:t.grade,gradeLevel:t.gradeLevel,classification:t.classification,strand:t.strand,section:t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId||t.teacherId,ownerTeacherName:t.ownerTeacherName,adviserTeacherId:t.adviserTeacherId||t.teacherId,adviserTeacherName:t.adviserTeacherName||t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName});return{id:t.id,name:r.className||t.name,classSectionId:r.classSectionId||t.classSectionId,classMetadata:r,gradeLevel:r.gradeLevel||void 0,classification:r.classification||void 0,strand:r.strand||void 0,managerId:r.managerId||void 0,managerName:r.managerName||void 0,schedule:t.schedule,studentCount:t.studentCount,avgScore:t.avgScore,atRiskCount:t.atRiskCount,riskLevel:s}}function ci(t,s){const r=t.riskLevel.toLowerCase(),a=t.lastActive?fr(t.lastActive.toDate()):"Unknown",i=t.className||s||"Imported Class",n=Fe(i),l=t.grade||n.grade,c=t.section||n.section,m=Ie({metadata:t.classMetadata,classSectionId:t.classSectionId||t.classroomId,className:[l,c].filter(Boolean).join(" - ")||i,grade:l,gradeLevel:t.gradeLevel,classification:t.classification,strand:t.strand,section:c,adviserTeacherId:t.teacherId,ownerTeacherId:t.teacherId,managerId:t.classMetadata?.managerId||t.managerId,managerName:t.classMetadata?.managerName||t.managerName});return{id:t.id,lrn:t.lrn,name:t.name,avatar:t.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:t.avgQuizScore,riskLevel:r,weakestTopic:t.weakestTopic||"N/A",classroomId:t.classroomId||m.classSectionId||i,className:m.className||[l,c].filter(Boolean).join(" - ")||i,grade:l,gradeLevel:m.gradeLevel||ot(l)||void 0,classification:m.classification||St(m.gradeLevel||l)||void 0,strand:m.strand||Ct(m.className,c)||void 0,section:c,classSectionId:m.classSectionId||t.classSectionId,classMetadata:m,managerId:m.managerId||void 0,managerName:m.managerName||void 0,lastActive:a,struggles:t.struggles||[],engagementScore:t.engagementScore,attendance:t.attendance,assignmentCompletion:t.assignmentCompletion}}function di(t){const s=t.atRiskCount>=5?"high":t.atRiskCount>=2?"medium":"low",r=Ie({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.name,grade:t.grade,gradeLevel:t.gradeLevel||t.classMetadata?.gradeLevel,classification:t.classification||t.classMetadata?.classification,strand:t.strand||t.classMetadata?.strand,section:t.section,managerId:t.managerId||t.classMetadata?.managerId,managerName:t.managerName||t.classMetadata?.managerName});return{id:t.id,name:r.className||t.name,classSectionId:r.classSectionId||t.classSectionId||void 0,classMetadata:r,gradeLevel:r.gradeLevel||void 0,classification:r.classification||void 0,strand:r.strand||void 0,managerId:r.managerId||void 0,managerName:r.managerName||void 0,schedule:t.schedule||"Mon-Fri",studentCount:t.studentCount,avgScore:t.avgScore,atRiskCount:t.atRiskCount,riskLevel:s}}function mi(t){const s=(t.riskLevel||"Low").toLowerCase(),r=Ie({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.className||[t.grade,t.section].filter(Boolean).join(" - ")||"Imported Class",grade:t.grade,gradeLevel:t.gradeLevel||t.classMetadata?.gradeLevel,classification:t.classification||t.classMetadata?.classification,strand:t.strand||t.classMetadata?.strand,section:t.section,managerId:t.managerId||t.classMetadata?.managerId,managerName:t.managerName||t.classMetadata?.managerName}),a=r.className||"Imported Class";return{id:t.id,lrn:t.lrn||void 0,name:t.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:t.avgQuizScore,riskLevel:s,weakestTopic:t.weakestTopic||"Foundational Skills",classroomId:r.classSectionId||t.classSectionId||a,className:a,grade:r.grade||Fe(a).grade,gradeLevel:r.gradeLevel||ot(r.grade||Fe(a).grade)||void 0,classification:r.classification||St(r.gradeLevel||r.grade)||void 0,strand:r.strand||Ct(a,r.section||t.section)||void 0,section:r.section||Fe(a).section,classSectionId:r.classSectionId||t.classSectionId||void 0,classMetadata:r,managerId:r.managerId||void 0,managerName:r.managerName||void 0,lastActive:"Recently imported",struggles:[t.weakestTopic||"Foundational Skills"],engagementScore:t.engagementScore,attendance:t.attendance,assignmentCompletion:t.assignmentCompletion}}function ui(t,s,r){return t<60||s<75||r<55?"high":t<75||s<85||r<70?"medium":"low"}function xi(t,s,r,a){const i=Ie({metadata:a,classSectionId:s,className:r}),n=i.className||"Imported Class",l=i.classSectionId||"imported_class",c=Number(t.avgQuizScore||0),m=Number(t.attendance||0),f=Number(t.engagementScore||0),h=Number(t.assignmentCompletion||0),j=t.unknownFields?.weakestTopic||t.unknownFields?.topic||"Foundational Skills",x=ui(c,m,f),p=t.studentId||t.lrn||t.email||t.name||Math.random().toString(36).slice(2);return{id:`upload-${l}-${p}`,lrn:t.lrn,name:t.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:c,riskLevel:x,weakestTopic:j,classroomId:l,className:n,grade:i.grade||Fe(n).grade,gradeLevel:i.gradeLevel||ot(i.grade||Fe(n).grade)||void 0,classification:i.classification||St(i.gradeLevel||i.grade)||void 0,strand:i.strand||Ct(n,i.section)||void 0,section:i.section||Fe(n).section,classSectionId:l,classMetadata:i,managerId:i.managerId||void 0,managerName:i.managerName||void 0,lastActive:"Recently imported",struggles:[j],engagementScore:f,attendance:m,assignmentCompletion:h}}function hi(t,s,r,a){const i=Ie({metadata:t.dashboardSync?.classMetadata||t.classMetadata||a,classSectionId:t.dashboardSync?.classSectionId||s,className:t.dashboardSync?.className||r}),n=i.classSectionId||"imported_class",l=i.className||"Imported Class";return{classSectionId:n,className:l,classMetadata:{...i,classSectionId:n,className:l}}}function fr(t){const s=Date.now()-t.getTime(),r=Math.floor(s/6e4);if(r<1)return"Just now";if(r<60)return`${r} min${r>1?"s":""} ago`;const a=Math.floor(r/60);if(a<24)return`${a} hour${a>1?"s":""} ago`;const i=Math.floor(a/24);return`${i} day${i>1?"s":""} ago`}function Ce(t){return(t||"").trim().toLowerCase()}function Fa(t){const s=Ce(t.classSectionId);if(s)return`section:${s}`;const r=(t.id||"").trim().toLowerCase();return r?`id:${r}`:`name:${(t.name||"").trim().toLowerCase()}`}function Ga(t,s){const r=new Map;return t.forEach(a=>{r.set(Fa(a),a)}),s.forEach(a=>{const i=Fa(a),n=r.get(i);if(!n){r.set(i,a);return}const l=Math.max(n.atRiskCount||0,a.atRiskCount||0),c=Math.max(n.studentCount||0,a.studentCount||0),m=a.avgScore>0?a.avgScore:n.avgScore,f=l>=5?"high":l>=2?"medium":"low",h=Ie({metadata:n.classMetadata,classSectionId:n.classSectionId||a.classSectionId,className:n.name||a.name,grade:n.classMetadata?.grade||a.classMetadata?.grade,gradeLevel:n.classMetadata?.gradeLevel||a.classMetadata?.gradeLevel,classification:n.classMetadata?.classification||a.classMetadata?.classification,strand:n.classMetadata?.strand||a.classMetadata?.strand,section:n.classMetadata?.section||a.classMetadata?.section,schoolYear:n.classMetadata?.schoolYear||a.classMetadata?.schoolYear,ownerTeacherId:n.classMetadata?.ownerTeacherId||a.classMetadata?.ownerTeacherId,ownerTeacherName:n.classMetadata?.ownerTeacherName||a.classMetadata?.ownerTeacherName,adviserTeacherId:n.classMetadata?.adviserTeacherId||a.classMetadata?.adviserTeacherId,adviserTeacherName:n.classMetadata?.adviserTeacherName||a.classMetadata?.adviserTeacherName,managerId:n.classMetadata?.managerId||a.classMetadata?.managerId,managerName:n.classMetadata?.managerName||a.classMetadata?.managerName});r.set(i,{...n,classSectionId:h.classSectionId||n.classSectionId||a.classSectionId,name:h.className||n.name||a.name,classMetadata:h,gradeLevel:h.gradeLevel||void 0,classification:h.classification||void 0,strand:h.strand||void 0,managerId:h.managerId||void 0,managerName:h.managerName||void 0,schedule:n.schedule||a.schedule,studentCount:c,atRiskCount:l,avgScore:m,riskLevel:f})}),Array.from(r.values())}function Qa(t){const s=(t.lrn||"").trim().toLowerCase();if(s)return`lrn:${s}`;const r=t.name.trim().toLowerCase();if(r)return`name:${r}`;const a=Ce(t.classSectionId)||Ce(t.classroomId),i=(t.id||"").trim().toLowerCase();return a&&i?`${a}|id:${i}`:`${a}|anonymous`}function gt(t){const s=Ce(t.classSectionId)||Ce(t.classroomId),r=(t.lrn||"").trim().toLowerCase(),a=(t.id||"").trim().toLowerCase(),i=t.name.trim().toLowerCase().replace(/\s+/g,"_");return s&&r?`${s}|lrn:${r}`:s&&a?`${s}|id:${a}`:r?`lrn:${r}`:a&&i?`id:${a}|name:${i}`:a?`id:${a}`:s&&i?`${s}|name:${i}`:`name:${i||"unknown"}`}function Ua(t,s){const r=new Map;return t.forEach(a=>{r.set(Qa(a),a)}),s.forEach(a=>{const i=Qa(a),n=r.get(i);if(!n){r.set(i,a);return}const l=[n.riskLevel,a.riskLevel].includes("high")?"high":[n.riskLevel,a.riskLevel].includes("medium")?"medium":"low",c=Ie({metadata:n.classMetadata,classSectionId:n.classSectionId||a.classSectionId,className:n.className||a.className,grade:n.grade||a.grade,gradeLevel:n.gradeLevel||a.gradeLevel,classification:n.classification||a.classification,strand:n.strand||a.strand,section:n.section||a.section,managerId:n.managerId||a.managerId,managerName:n.managerName||a.managerName});r.set(i,{...n,lrn:n.lrn||a.lrn,classSectionId:c.classSectionId||n.classSectionId||a.classSectionId,classroomId:n.classroomId||a.classroomId,className:c.className||n.className||a.className,grade:c.grade||n.grade||a.grade,gradeLevel:c.gradeLevel||n.gradeLevel||a.gradeLevel,classification:c.classification||n.classification||a.classification,strand:c.strand||n.strand||a.strand,section:c.section||n.section||a.section,managerId:c.managerId||n.managerId||a.managerId,managerName:c.managerName||n.managerName||a.managerName,classMetadata:c,avgScore:a.avgScore>0?a.avgScore:n.avgScore,attendance:a.attendance>0?a.attendance:n.attendance,engagementScore:a.engagementScore>0?a.engagementScore:n.engagementScore,assignmentCompletion:a.assignmentCompletion>0?a.assignmentCompletion:n.assignmentCompletion,weakestTopic:n.weakestTopic&&n.weakestTopic!=="N/A"?n.weakestTopic:a.weakestTopic,riskLevel:l,struggles:n.struggles.length>0?n.struggles:a.struggles})}),Array.from(r.values())}const yl=({onLogout:t,onOpenProfile:s,onOpenSettings:r})=>{const{currentUser:a,userProfile:i}=Wt(),[n,l]=d.useState("dashboard"),[c,m]=d.useState(!1),[f,h]=d.useState(!1),[j,x]=d.useState(!1),[p,I]=d.useState(!1),[C,P]=d.useState(!1),[A,Q]=d.useState(null),[N,O]=d.useState(null),[v,$]=d.useState([]),[R,Z]=d.useState([]),[F,le]=d.useState([]),[oe,ae]=d.useState(""),[ce,pe]=d.useState(!0),[be,xe]=d.useState(!1),[S,_]=d.useState(0),[D,te]=d.useState([]),[J,g]=d.useState(!1);d.useEffect(()=>{if(!a)return;const w=a.uid;let E=!0,ue;return(async()=>{pe(!0);try{const Ne=await mr(w);let se=Ne.map(li);const $e=await Go(w).catch(()=>[]),je=new Map;$e.forEach(L=>{const q=Ce(L.classSectionId);q&&je.set(q,L)}),se=se.map(L=>{const q=je.get(Ce(L.classSectionId));if(!q)return L;const we=Ie({metadata:L.classMetadata,classSectionId:q.classSectionId||L.classSectionId,className:q.className||L.name,grade:q.grade||L.classMetadata?.grade,gradeLevel:q.gradeLevel||L.classMetadata?.gradeLevel,classification:q.classification||L.classMetadata?.classification,strand:q.strand||L.classMetadata?.strand,section:q.section||L.classMetadata?.section,schoolYear:q.schoolYear||L.classMetadata?.schoolYear,ownerTeacherId:q.ownerTeacherId||L.classMetadata?.ownerTeacherId,ownerTeacherName:q.ownerTeacherName||L.classMetadata?.ownerTeacherName,managerId:q.managerId||L.classMetadata?.managerId,managerName:q.managerName||L.classMetadata?.managerName});return{...L,name:we.className||L.name,classSectionId:we.classSectionId||L.classSectionId,classMetadata:we,gradeLevel:we.gradeLevel||L.gradeLevel,classification:we.classification||L.classification,strand:we.strand||L.strand,managerId:we.managerId||L.managerId,managerName:we.managerName||L.managerName}});const X=new Map,Ee=new Map;Ne.forEach(L=>{const q=Ie({metadata:L.classMetadata,classSectionId:L.classSectionId,className:L.name,grade:L.grade,gradeLevel:L.gradeLevel,classification:L.classification,strand:L.strand,section:L.section,schoolYear:L.schoolYear,ownerTeacherId:L.ownerTeacherId||L.teacherId,ownerTeacherName:L.ownerTeacherName,adviserTeacherId:L.adviserTeacherId||L.teacherId,adviserTeacherName:L.adviserTeacherName,managerId:L.managerId,managerName:L.managerName});X.set(L.id,q.className||L.name),Ee.set(L.id,q);const we=Ce(L.classSectionId);if(we){const Y=je.get(we),ke=Ie({metadata:q,classSectionId:Y?.classSectionId||we,className:Y?.className||q.className,grade:Y?.grade||q.grade,gradeLevel:Y?.gradeLevel||q.gradeLevel,classification:Y?.classification||q.classification,strand:Y?.strand||q.strand,section:Y?.section||q.section,schoolYear:Y?.schoolYear||q.schoolYear,ownerTeacherId:Y?.ownerTeacherId||q.ownerTeacherId,ownerTeacherName:Y?.ownerTeacherName||q.ownerTeacherName,managerId:Y?.managerId||q.managerId,managerName:Y?.managerName||q.managerName});X.set(we,ke.className||L.name),Ee.set(we,ke)}});let it=(await Ds(w)).map(L=>{const q=Ce(L.classSectionId||L.classroomId),we=X.get(L.classroomId)||(q?X.get(q):void 0)||L.className||"Unknown",Y=ci(L,we);if(!q)return Y;const ke=Ee.get(q);if(!ke)return Y;const Pe=Ie({metadata:ke,classSectionId:Y.classSectionId||ke.classSectionId,className:Y.className||ke.className,grade:Y.grade||ke.grade,gradeLevel:Y.gradeLevel||ke.gradeLevel,classification:Y.classification||ke.classification,strand:Y.strand||ke.strand,section:Y.section||ke.section,managerId:Y.managerId||ke.managerId,managerName:Y.managerName||ke.managerName});return{...Y,className:Pe.className||Y.className,grade:Pe.grade||Y.grade,gradeLevel:Pe.gradeLevel||Y.gradeLevel,classification:Pe.classification||Y.classification,strand:Pe.strand||Y.strand,section:Pe.section||Y.section,classSectionId:Pe.classSectionId||Y.classSectionId,classMetadata:Pe,managerId:Pe.managerId||Y.managerId,managerName:Pe.managerName||Y.managerName}});if(!E)return;$(L=>se.length===0&&L.length>0?L:se),Z(L=>it.length===0&&L.length>0?L:it),he.getImportedClassOverview({limit:3e3,forceRefresh:S>0}).then(L=>{E&&(L.warnings.length>0&&console.warn("Imported class overview warnings:",L.warnings.join(" ")),$(q=>Ga(q,L.classrooms.map(di))),Z(q=>Ua(q,L.students.map(mi))))}).catch(L=>{console.warn("Imported class overview merge unavailable:",L)});const Je=Ne.map(L=>L.id);Je.length>0&&(ue=Uo(Je,L=>{E&&le(L.map(q=>({id:q.id,student:q.studentName,action:q.action,topic:q.topic,time:fr(q.timestamp.toDate()),type:q.type})))}))}catch(Ne){console.error("Failed to load teacher data:",Ne),U.error("Failed to load dashboard data")}finally{pe(!1)}})(),()=>{E=!1,ue&&ue()}},[a,S]),d.useEffect(()=>{if(!a)return;let w=!0;return Qo("",80).then(E=>{w&&te(E)}).catch(E=>{console.warn("Failed to load teacher directory options:",E)}),()=>{w=!1}},[a]),d.useEffect(()=>{if(R.length===0)return;(async()=>{xe(!0);try{const E=R.map(K=>({name:K.name,engagementScore:K.engagementScore,avgQuizScore:K.avgScore,attendance:K.attendance,riskLevel:K.riskLevel})),ue=await he.getDailyInsight({students:E});ae(ue.insight)}catch{ae(`${R.filter(E=>E.riskLevel==="high").length} students are at high risk of falling behind. Review their progress in the analytics view.`)}finally{xe(!1)}})()},[R]);const M=v.reduce((w,E)=>w+E.studentCount,0),B=v.reduce((w,E)=>w+E.atRiskCount,0),ee=v.length>0?Math.round(v.reduce((w,E)=>w+E.avgScore,0)/v.length):0,V=[{name:"High Risk",value:R.filter(w=>w.riskLevel==="high").length,color:"#ef4444"},{name:"Medium Risk",value:R.filter(w=>w.riskLevel==="medium").length,color:"#f43f5e"},{name:"Low Risk",value:R.filter(w=>w.riskLevel==="low").length,color:"#10b981"}],ye={};R.forEach(w=>{w.weakestTopic&&w.weakestTopic!=="N/A"&&(ye[w.weakestTopic]||(ye[w.weakestTopic]={total:0,sum:0}),ye[w.weakestTopic].total+=1,ye[w.weakestTopic].sum+=w.avgScore)});const k=Object.entries(ye).map(([w,E])=>({topic:w,score:Math.round(E.sum/E.total)})).sort((w,E)=>w.score-E.score).slice(0,6),T=w=>{Q(w),l("analytics")},ne=w=>{O(w),l("intervention")},y=()=>{O(null),l("analytics")},W=()=>{Q(null),O(null),l("dashboard")},G=async(w,E)=>{if(!a){U.error("Unable to assign manager: teacher context is missing.");return}const ue=Fe(w.classMetadata?.className||w.name),K=Ie({metadata:w.classMetadata,classSectionId:w.classSectionId,className:w.name,grade:w.classMetadata?.grade||ue.grade,gradeLevel:w.classMetadata?.gradeLevel,classification:w.classMetadata?.classification,strand:w.classMetadata?.strand,section:w.classMetadata?.section||ue.section,schoolYear:w.classMetadata?.schoolYear||String(new Date().getFullYear()),ownerTeacherId:w.classMetadata?.ownerTeacherId||a.uid,ownerTeacherName:w.classMetadata?.ownerTeacherName||de,adviserTeacherId:w.classMetadata?.adviserTeacherId||a.uid,adviserTeacherName:w.classMetadata?.adviserTeacherName||de,managerId:E.uid,managerName:E.name}),Ne=K.classSectionId||De(K.grade||ue.grade,K.section||ue.section);if(!Ne){U.error("Unable to assign manager: missing class section ID.");return}g(!0);try{await Fo({classSectionId:Ne,className:K.className||w.name,grade:K.grade||ue.grade,gradeLevel:K.gradeLevel||ot(K.grade||ue.grade)||K.grade||ue.grade,classification:K.classification||St(K.gradeLevel||K.grade)||void 0,strand:K.strand||Ct(K.className,K.section)||void 0,section:K.section||ue.section,schoolYear:K.schoolYear||String(new Date().getFullYear()),ownerTeacherId:K.ownerTeacherId||a.uid,ownerTeacherName:K.ownerTeacherName||de,managerId:E.uid,managerName:E.name});const se=Ie({metadata:K,classSectionId:Ne,managerId:E.uid,managerName:E.name}),$e=Ce(Ne);$(je=>je.map(X=>Ce(X.classSectionId)!==$e?X:{...X,name:se.className||X.name,classSectionId:se.classSectionId||X.classSectionId,classMetadata:se,gradeLevel:se.gradeLevel||X.gradeLevel,classification:se.classification||X.classification,strand:se.strand||X.strand,managerId:E.uid,managerName:E.name})),Z(je=>je.map(X=>{if(Ce(X.classSectionId||X.classroomId)!==$e)return X;const Ge=Ie({metadata:X.classMetadata,classSectionId:se.classSectionId||X.classSectionId,className:X.className||se.className,grade:X.grade||se.grade,gradeLevel:X.gradeLevel||se.gradeLevel,classification:X.classification||se.classification,strand:X.strand||se.strand,section:X.section||se.section,managerId:E.uid,managerName:E.name});return{...X,classMetadata:Ge,gradeLevel:Ge.gradeLevel||X.gradeLevel,classification:Ge.classification||X.classification,strand:Ge.strand||X.strand,managerId:E.uid,managerName:E.name}})),Q(je=>!je||Ce(je.classSectionId)!==$e?je:{...je,classMetadata:se,managerId:E.uid,managerName:E.name,gradeLevel:se.gradeLevel||je.gradeLevel,classification:se.classification||je.classification,strand:se.strand||je.strand}),U.success(`Assigned ${E.name} as section manager.`)}catch(se){console.error("Failed to assign class manager:",se),U.error(se instanceof Error?se.message:"Failed to assign class manager")}finally{g(!1)}};d.useEffect(()=>{const w=()=>{const E=window.innerWidth<1024;I(E),E?m(!1):x(!1)};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]),d.useEffect(()=>{p&&x(!1)},[n,p]);const de=i?.name||"Teacher",me=d.useMemo(()=>{if(!A)return;if(A.classMetadata?.classSectionId)return A.classMetadata.classSectionId||void 0;if(A.classSectionId)return A.classSectionId;const w=Fe(A.classMetadata?.className||A.name);return De(w.grade,w.section)||void 0},[A]),re=d.useMemo(()=>A||v[0]||null,[A,v]),Ae=d.useMemo(()=>{if(!re)return R;const w=(re.id||"").trim().toLowerCase(),E=Ce(re.classSectionId),ue=(re.name||"").trim().toLowerCase();return R.filter(K=>{const Ne=Ce(K.classroomId),se=Ce(K.classSectionId),$e=(K.className||"").trim().toLowerCase();return E&&(se===E||Ne===E)||w&&(Ne===w||se===w)||ue&&$e===ue})},[re,R]);return ce?e.jsxs("div",{className:"flex h-screen w-full bg-background p-6",children:[e.jsx("div",{className:"hidden lg:flex w-[280px] shrink-0 rounded-3xl border border-border bg-card p-5",children:e.jsxs("div",{className:"w-full space-y-4",children:[e.jsx(z,{className:"h-12 w-40"}),e.jsx(z,{className:"h-10 w-full"}),e.jsx(z,{className:"h-10 w-full"}),e.jsx(z,{className:"h-10 w-full"}),e.jsx(z,{className:"h-10 w-full"})]})}),e.jsxs("div",{className:"flex-1 space-y-4 lg:pl-6",children:[e.jsx(z,{className:"h-20 w-full rounded-2xl"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(z,{className:"h-28 w-full rounded-2xl"}),e.jsx(z,{className:"h-28 w-full rounded-2xl"}),e.jsx(z,{className:"h-28 w-full rounded-2xl"})]}),e.jsx(z,{className:"h-[420px] w-full rounded-2xl"})]})]}):e.jsxs("div",{className:"relative flex h-screen w-full bg-background overflow-hidden",children:[p&&j&&e.jsx("button",{"aria-label":"Close navigation",className:"fixed inset-0 z-30 bg-slate-900/40 backdrop-blur-[1px]",onClick:()=>x(!1)}),e.jsxs(ie.aside,{initial:!1,animate:{width:p?280:c&&!f?80:280,x:p?j?0:-300:0},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>!p&&c&&h(!0),onMouseLeave:()=>h(!1),className:"fixed inset-y-0 left-0 z-40 bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] flex flex-col shadow-sm lg:static lg:z-auto p-5",children:[e.jsxs("div",{className:`mb-8 flex items-center ${c&&!f?"justify-center":"justify-between"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-2xl flex items-center justify-center shadow-md flex-shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"MathPulse AI",className:"w-10 h-10 object-contain drop-shadow-md"})}),(!c||f)&&e.jsx("div",{children:e.jsx("h1",{className:"text-base font-bold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),!p&&(!c||f)&&e.jsx(ie.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>m(!c),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":c?"Expand sidebar":"Collapse sidebar",children:c?e.jsx(Jt,{size:20}):e.jsx(Et,{size:20})}),p&&e.jsx("button",{onClick:()=>x(!1),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:e.jsx(Mt,{size:20})})]}),e.jsxs("nav",{className:"flex-1 space-y-5",children:[e.jsxs("div",{children:[c&&!f?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:"Overview"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(We,{icon:Rr,label:"Dashboard",active:n==="dashboard",collapsed:c&&!f,onClick:W,forceExpanded:p}),e.jsx(We,{icon:vt,label:"Class Analytics",active:n==="analytics",collapsed:c&&!f,onClick:()=>l("analytics"),forceExpanded:p})]})]}),e.jsxs("div",{children:[c&&!f?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:"Students"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(We,{icon:cn,label:"Topic Mastery",active:n==="topic_mastery",collapsed:c&&!f,onClick:()=>l("topic_mastery"),forceExpanded:p}),e.jsx(We,{icon:Gt,label:"Competency",active:n==="competency",collapsed:c&&!f,onClick:()=>l("competency"),forceExpanded:p})]})]}),e.jsxs("div",{children:[c&&!f?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:"Tools"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(We,{icon:en,label:"Data Import",active:n==="import",collapsed:c&&!f,onClick:()=>l("import"),forceExpanded:p}),e.jsx(We,{icon:Za,label:"AI Quiz Maker",active:n==="quiz_maker",collapsed:c&&!f,onClick:()=>l("quiz_maker"),forceExpanded:p}),e.jsx(We,{icon:ga,label:"Notifications",active:n==="notifications",collapsed:c&&!f,onClick:()=>l("notifications"),forceExpanded:p}),e.jsx(We,{icon:ba,label:"Calendar",active:n==="calendar",collapsed:c&&!f,onClick:()=>l("calendar"),forceExpanded:p})]})]})]}),e.jsxs("div",{className:"space-y-2 border-t border-[#dde3eb] pt-4",children:[e.jsxs(ie.button,{whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-bold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap ${c&&!f?"justify-center":""}`,onClick:r,title:c&&!f?"Settings":"",children:[e.jsx(_r,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!c||f)&&e.jsx("span",{className:"font-body text-xs",children:"Settings"})]}),e.jsx("div",{className:"text-[#5a6578]",children:e.jsx(Br,{onClick:()=>P(!0),collapsed:c&&!f})})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-card/80 backdrop-blur-md border-b border-border px-6 py-3 sticky top-0 z-30",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[p&&e.jsx("button",{onClick:()=>x(!0),className:"mt-1 p-2 rounded-lg border border-border text-muted-foreground hover:text-sky-700 hover:border-sky-200 hover:bg-sky-50 transition-colors","aria-label":"Open navigation",children:e.jsx(Gr,{size:18})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-display font-bold text-foreground leading-tight",children:[n==="dashboard"&&"Teacher Dashboard",n==="analytics"&&(A?A.name:"Class Analytics"),n==="intervention"&&"Student Intervention",n==="topic_mastery"&&"Topic Mastery",n==="competency"&&"Student Competency",n==="import"&&"Data Import",n==="notifications"&&"Notifications",n==="calendar"&&"Calendar",n==="quiz_maker"&&"AI Quiz Maker"]}),e.jsxs("p",{className:"text-xs text-muted-foreground font-body",children:[n==="dashboard"&&`Welcome back, ${de}`,n==="analytics"&&"Deep dive into class performance",n==="intervention"&&N?.name,n==="topic_mastery"&&"Monitor class-wide topic mastery",n==="competency"&&"Per-student topic-level breakdown",n==="import"&&"Upload class records and materials",n==="quiz_maker"&&"Create and manage AI-powered quizzes",n==="notifications"&&"View classroom alerts and updates",n==="calendar"&&"Check upcoming class events and schedule"]})]}),n==="dashboard"&&e.jsxs("div",{className:"hidden xl:flex items-center gap-2 ml-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-sky-50 border border-sky-200/60 rounded-lg",children:[e.jsx(Gt,{size:13,className:"text-sky-600"}),e.jsxs("span",{className:"text-xs font-display font-bold text-sky-700",children:[M," students"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-rose-50 border border-rose-200/60 rounded-lg",children:[e.jsx(At,{size:13,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-display font-bold text-rose-700",children:[B," at risk"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-50 border border-emerald-200/60 rounded-lg",children:[e.jsx(Os,{size:13,className:"text-emerald-600"}),e.jsxs("span",{className:"text-xs font-display font-bold text-emerald-700",children:[ee,"% avg"]})]})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{onClick:s,className:"flex items-center gap-2.5 bg-muted p-1.5 pr-3 rounded-lg cursor-pointer hover:bg-accent transition-all group max-w-[220px]",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg overflow-hidden ring-1 ring-sky-200/70 bg-card flex items-center justify-center",children:e.jsx("img",{src:i?.photo||`https://ui-avatars.com/api/?name=${encodeURIComponent(de)}&background=random`,alt:de,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"hidden md:block min-w-0 text-left",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground leading-none group-hover:text-sky-600 transition-colors truncate",children:de}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-none",children:"Teacher"})]})]})})]})}),e.jsx("main",{className:"flex-1 overflow-y-auto",children:e.jsxs(et,{mode:"wait",children:[n==="dashboard"&&e.jsx(fi,{classes:v,liveActivity:F,onViewClass:T,onViewAllClasses:()=>l("analytics"),dailyInsight:oe,insightLoading:be,totalStudents:M,totalAtRisk:B,avgPerformance:ee}),n==="analytics"&&re&&e.jsx(pi,{selectedClass:re,students:Ae,riskDistribution:V,topicPerformance:k,onViewStudent:ne,onBack:W,teacherOptions:D,managerUpdating:J,onAssignManager:w=>G(re,w)}),n==="analytics"&&!re&&e.jsx(Ns,{icon:vt,title:"Class Analytics",description:"No classes available yet. Import class records to unlock analytics views."}),n==="intervention"&&N&&e.jsx(gi,{student:N,teacherId:a?.uid||"",teacherName:de,onStudentUpdated:w=>{const E=N?gt(N):null;O(w),Z(ue=>ue.map(K=>{const Ne=gt(K),se=E?Ne===E:!1,$e=K.id===w.id&&Ce(K.classSectionId)===Ce(w.classSectionId);return se||$e?w:K}))},onBack:y}),n==="topic_mastery"&&e.jsx(si,{classSectionId:me}),n==="competency"&&e.jsx(oi,{classSectionId:me,className:A?.name,fallbackStudents:R}),n==="import"&&e.jsx(bi,{onEditRecords:()=>l("edit_records"),classSectionId:me,className:A?.name,classMetadata:A?.classMetadata,onImportedClassRecords:w=>{const E=w.students.map(X=>xi(X,w.classSectionId,w.className,w.classMetadata)),ue=Ie({metadata:w.classMetadata,classSectionId:w.classSectionId,className:w.className}),K=ue.classSectionId||"imported_class",Ne=ue.className||"Imported Class",se=E.filter(X=>X.riskLevel==="high").length,$e=E.length>0?Math.round(E.reduce((X,Ee)=>X+Ee.avgScore,0)/E.length):0,je={id:K,name:Ne,classSectionId:K,classMetadata:{...ue,classSectionId:K,className:Ne},schedule:"Mon-Fri",studentCount:E.length,avgScore:$e,atRiskCount:se,riskLevel:se>=5?"high":se>=2?"medium":"low"};Z(X=>Ua(X,E)),$(X=>Ga(X,[je]))},onDataChanged:()=>_(w=>w+1)}),n==="notifications"&&e.jsx(Ns,{icon:ga,title:"Notifications",description:"Teacher alerts and classroom updates will appear here."}),n==="calendar"&&e.jsx(Ns,{icon:ba,title:"Calendar",description:"Your class schedule and upcoming events will appear here."}),n==="edit_records"&&e.jsx(vi,{students:R,teacherId:a?.uid||"",teacherName:de,onBack:()=>l("import")}),n==="quiz_maker"&&e.jsx(Zo,{onBack:()=>l("dashboard")})]})})]}),e.jsx(Er,{isOpen:C,onClose:()=>P(!1),onConfirm:t,title:"Logout",message:"Are you sure you want to logout?",confirmText:"Logout",cancelText:"Cancel"})]})},We=({icon:t,label:s,active:r,collapsed:a,forceExpanded:i=!1,onClick:n})=>e.jsxs(ie.button,{onClick:n,whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${a&&!i?"justify-center":""} ${r?"bg-sky-50 border-sky-200 shadow-sm text-sky-700":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[e.jsx(t,{size:18,strokeWidth:r?2.5:2,className:"flex-shrink-0"}),(!a||i)&&e.jsx("span",{className:"font-body font-bold text-xs",children:s}),r&&!a&&e.jsx(ie.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-sky-500",transition:{type:"spring",duration:.4}})]}),Ns=({icon:t,title:s,description:r})=>e.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-sky-100 text-sky-700 flex items-center justify-center mb-4",children:e.jsx(t,{size:24})}),e.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mb-2",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground font-body leading-relaxed",children:r})]})}),fi=({classes:t,liveActivity:s,onViewClass:r,onViewAllClasses:a,dailyInsight:i,insightLoading:n,totalStudents:l,totalAtRisk:c,avgPerformance:m})=>{const f=l>0?Math.round(c/l*100):0,h=l>0?Math.round((l-c)/l*100):0;return e.jsxs(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6 space-y-6",children:[e.jsx("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 rounded-2xl p-5 text-white shadow-md",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-card/20 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(At,{size:20})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"text-base font-display font-bold mb-1",children:"AI Insight"}),e.jsx(pt,{name:"teacher-dashboard-ai-insight",loading:n,fixture:e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsx(z,{className:"h-3.5 w-11/12 bg-white/25"}),e.jsx(z,{className:"h-3.5 w-10/12 bg-white/20"}),e.jsx(z,{className:"h-3.5 w-8/12 bg-white/15"})]}),fallback:e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsx(z,{className:"h-3.5 w-11/12 bg-white/25"}),e.jsx(z,{className:"h-3.5 w-10/12 bg-white/20"}),e.jsx(z,{className:"h-3.5 w-8/12 bg-white/15"})]}),children:e.jsx("div",{className:"text-sky-100 text-sm leading-relaxed [&_p]:m-0 [&_strong]:font-semibold",children:e.jsx(Ha,{children:i||`${c} students (${f}%) are at high risk of falling behind`})})})]})]})}),e.jsxs("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"Total Students"}),e.jsx("p",{className:"text-2xl font-display font-bold text-foreground",children:l})]}),e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"Class Average"}),e.jsxs("p",{className:"text-2xl font-display font-bold text-sky-600",children:[m,"%"]})]}),e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"Engagement Rate"}),e.jsxs("p",{className:"text-2xl font-display font-bold text-emerald-600",children:[h,"%"]})]}),e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-red-200/60 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"At Risk"}),e.jsx("p",{className:"text-2xl font-display font-bold text-red-600",children:c})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"xl:col-span-2 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"My Classes"}),e.jsxs("button",{onClick:a,className:"text-sm font-bold text-sky-600 hover:text-sky-700 flex items-center gap-1 group",children:["View All",e.jsx(Jt,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]}),e.jsx("div",{className:"space-y-4",children:t.map(j=>e.jsxs(ie.div,{whileHover:{scale:1.01},className:"bg-card border border-border rounded-2xl p-6 shadow-sm hover:shadow-md transition-all cursor-pointer",onClick:()=>r(j),children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:j.name}),e.jsx("span",{className:`px-3 py-1 rounded-lg text-xs font-bold border ${Zt(j.riskLevel)}`,children:j.riskLevel==="high"?"High Risk":j.riskLevel==="medium"?"Medium Risk":"Low Risk"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(dn,{size:14}),e.jsx("span",{children:j.schedule})]}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:[j.gradeLevel,j.classification,j.strand].filter(Boolean).map(x=>e.jsx("span",{className:"px-2 py-0.5 rounded-md bg-sky-50 border border-sky-200 text-sky-700 text-[11px] font-semibold",children:x},`${j.id}-${x}`))}),e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Manager: ",j.managerName||j.classMetadata?.managerName||"Not assigned"]})]}),e.jsx(Me,{className:"bg-sky-600 hover:bg-sky-700 text-white font-bold px-6 py-2 rounded-xl",children:"View Class"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Total Students"}),e.jsx("p",{className:"text-xl font-bold text-foreground",children:j.studentCount})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"At Risk"}),e.jsx("p",{className:"text-xl font-bold text-red-600",children:j.atRiskCount})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Avg Score"}),e.jsxs("p",{className:"text-xl font-bold text-sky-600",children:[j.avgScore,"%"]})]})]})]},j.id))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-10 h-10 bg-rose-100 rounded-xl flex items-center justify-center",children:e.jsx(qa,{size:20,className:"text-rose-600"})}),e.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"Live Classroom Pulse"})]}),e.jsxs("div",{className:"bg-card rounded-2xl p-5 shadow-sm border border-border space-y-3 max-h-[600px] overflow-y-auto",children:[s.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No live classroom events yet. Activity appears here in real time."}),s.map(j=>e.jsxs("div",{className:`p-4 rounded-xl border-l-4 ${j.type==="success"?"bg-green-50 border-green-500":j.type==="warning"?"bg-rose-50 border-rose-500":"bg-sky-50 border-sky-500"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("p",{className:"font-bold text-foreground text-sm",children:j.student}),e.jsx("span",{className:"text-xs text-slate-500",children:j.time})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[j.action," ",e.jsx("span",{className:"font-bold text-foreground",children:j.topic})]})]},j.id))]})]})]})]})},pi=({selectedClass:t,students:s,riskDistribution:r,topicPerformance:a,onViewStudent:i,onBack:n,teacherOptions:l,managerUpdating:c,onAssignManager:m})=>{const[f,h]=d.useState(""),[j,x]=d.useState("");d.useEffect(()=>{x(t.classMetadata?.managerId||t.managerId||"")},[t]);const p=d.useMemo(()=>{const v=f.trim().toLowerCase();return v?s.filter($=>$.name.toLowerCase().includes(v)||($.lrn||"").toLowerCase().includes(v)||($.weakestTopic||"").toLowerCase().includes(v)):s},[f,s]),I=d.useMemo(()=>{if(s.length===0)return 0;const v=s.reduce(($,R)=>$+(R.assignmentCompletion||0),0);return Math.round(v/s.length)},[s]),C=d.useMemo(()=>{if(s.length===0)return 0;const v=s.reduce((R,Z)=>R+(Z.attendance||0),0)/s.length,$=s.reduce((R,Z)=>R+(Z.engagementScore||0),0)/s.length;return Math.round(v*.6+$*.4)},[s]),P=d.useMemo(()=>[...s].sort((v,$)=>$.avgScore-v.avgScore).slice(0,5),[s]),A=d.useMemo(()=>[...s].filter(v=>v.riskLevel==="high"||v.avgScore<70||v.assignmentCompletion<65).sort((v,$)=>{if(v.riskLevel!==$.riskLevel){const R={high:3,medium:2,low:1};return R[$.riskLevel]-R[v.riskLevel]}return v.avgScore-$.avgScore}).slice(0,6),[s]),Q=d.useMemo(()=>l.find(v=>v.uid===j),[l,j]),N=()=>{if(!Q){U.error("Select a teacher manager first.");return}m(Q)},O=[t.classMetadata?.gradeLevel||t.gradeLevel,t.classMetadata?.classification||t.classification,t.classMetadata?.strand||t.strand].filter(Boolean);return e.jsxs(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:[e.jsxs("button",{onClick:n,className:"flex items-center gap-2 text-muted-foreground hover:text-sky-600 font-bold mb-6 transition-colors group",children:[e.jsx(Et,{size:20,className:"group-hover:-translate-x-1 transition-transform"}),"Back to Dashboard"]}),e.jsx("div",{className:"bg-card rounded-2xl border border-border p-5 shadow-sm mb-6",children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-display font-bold text-foreground",children:t.name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:`px-3 py-1 rounded-lg text-xs font-bold border ${Zt(t.riskLevel)}`,children:t.riskLevel==="high"?"High Risk Cohort":t.riskLevel==="medium"?"Medium Risk Cohort":"Low Risk Cohort"}),O.map(v=>e.jsx("span",{className:"px-3 py-1 rounded-lg text-xs font-semibold border bg-sky-50 border-sky-200 text-sky-700",children:v},v))]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Manager: ",t.classMetadata?.managerName||t.managerName||"Not assigned"]})]}),e.jsxs("div",{className:"min-w-[260px] bg-muted rounded-xl p-3 border border-border",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase tracking-wide",children:"Section Manager"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("select",{id:"analytics-section-manager-select",name:"analytics-section-manager-select","aria-label":"Select section manager",value:j||"",onChange:v=>x(v.target.value),className:"h-10 flex-1 rounded-lg border border-border bg-card px-3 text-sm",children:[e.jsx("option",{value:"",children:"Select teacher"}),l.map(v=>e.jsxs("option",{value:v.uid,children:[v.name," (",v.email,")"]},v.uid))]}),e.jsx(Me,{onClick:N,disabled:!j||c,className:"bg-sky-600 hover:bg-sky-700 text-white",children:c?e.jsx(z,{className:"h-4 w-12 bg-white/35"}):"Assign"})]})]})]})}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Class Average"}),e.jsxs("p",{className:"text-2xl font-display font-bold text-sky-600",children:[t.avgScore,"%"]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Completion Rate"}),e.jsxs("p",{className:"text-2xl font-display font-bold text-emerald-600",children:[I,"%"]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Participation"}),e.jsxs("p",{className:"text-2xl font-display font-bold text-violet-600",children:[C,"%"]})]}),e.jsxs("div",{className:"bg-card border border-red-200 rounded-xl p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Needs Attention"}),e.jsx("p",{className:"text-2xl font-display font-bold text-red-600",children:A.length})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-5 gap-6",children:[e.jsxs("div",{className:"xl:col-span-2 bg-card rounded-2xl p-6 shadow-sm border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("h2",{className:"text-lg font-display font-bold text-foreground",children:["Students (",p.length,")"]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ht,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:16}),e.jsx(bt,{id:"analytics-student-search",name:"analytics-student-search","aria-label":"Search students",type:"text",placeholder:"Search...",value:f,onChange:v=>h(v.target.value),className:"w-40 pl-9 pr-4 py-2 rounded-xl border-border text-sm"})]})]}),e.jsxs("div",{className:"space-y-3 max-h-[700px] overflow-y-auto",children:[p.map(v=>e.jsxs(ie.div,{whileHover:{scale:1.02},onClick:()=>i(v),className:`p-4 rounded-2xl border-2 cursor-pointer hover:shadow-md transition-all ${yi(v.riskLevel)}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("img",{src:v.avatar,alt:v.name,className:"w-12 h-12 rounded-xl object-cover border-2 border-current"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-bold text-foreground",children:v.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:v.lastActive})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs font-bold text-muted-foreground",children:"Avg Score"}),e.jsxs("span",{className:"text-xs font-bold text-foreground",children:[v.avgScore,"%"]})]}),e.jsx("div",{className:"h-2 bg-card rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${v.riskLevel==="high"?"bg-red-500":v.riskLevel==="medium"?"bg-rose-500":"bg-green-500"}`,style:{width:`${v.avgScore}%`}})})]})]},gt(v))),p.length===0&&e.jsx("div",{className:"border border-dashed border-border rounded-xl p-4 text-sm text-muted-foreground",children:"No students match your search."})]})]}),e.jsxs("div",{className:"xl:col-span-3 space-y-6",children:[e.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[e.jsx("h2",{className:"text-lg font-display font-bold text-foreground mb-5",children:"Risk Distribution"}),e.jsx(Na,{width:"100%",height:250,children:e.jsxs(Aa,{data:r,children:[e.jsx(Cs,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),e.jsx(Pt,{dataKey:"name",tick:{fontSize:12}}),e.jsx(Ot,{tick:{fontSize:12}}),e.jsx(wa,{}),e.jsx(ks,{dataKey:"value",radius:[8,8,0,0],children:r.map((v,$)=>e.jsx(kn,{fill:v.color},`cell-${$}`))})]})})]}),e.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[e.jsx("h2",{className:"text-lg font-display font-bold text-foreground mb-5",children:"Topic Performance"}),e.jsx(Na,{width:"100%",height:250,children:e.jsxs(Aa,{data:a,children:[e.jsx(Cs,{strokeDasharray:"3 3",stroke:"var(--border)"}),e.jsx(Pt,{dataKey:"topic",tick:{fontSize:12}}),e.jsx(Ot,{tick:{fontSize:12},domain:[0,100]}),e.jsx(wa,{}),e.jsx(ks,{dataKey:"score",fill:"#0284c7",radius:[8,8,0,0]})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-4",children:[e.jsx("h3",{className:"text-sm font-display font-bold text-foreground mb-3",children:"Top Performers"}),e.jsxs("div",{className:"space-y-2",children:[P.slice(0,4).map(v=>e.jsxs("button",{onClick:()=>i(v),className:"w-full flex items-center justify-between rounded-lg border border-border px-3 py-2 hover:bg-sky-50 transition-colors",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:v.name}),e.jsxs("span",{className:"text-xs font-bold text-emerald-600",children:[v.avgScore,"%"]})]},`top-${gt(v)}`)),P.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No students available yet."})]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-4",children:[e.jsx("h3",{className:"text-sm font-display font-bold text-foreground mb-3",children:"Students Needing Attention"}),e.jsxs("div",{className:"space-y-2",children:[A.slice(0,4).map(v=>e.jsxs("button",{onClick:()=>i(v),className:"w-full flex items-center justify-between rounded-lg border border-red-200 bg-red-50/40 px-3 py-2 hover:bg-red-50 transition-colors",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:v.name}),e.jsx("span",{className:"text-xs font-bold text-red-600",children:v.riskLevel.toUpperCase()})]},`attention-${gt(v)}`)),A.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No urgent students in this class right now."})]})]})]})]})]})]})},gi=({student:t,teacherId:s,teacherName:r,onStudentUpdated:a,onBack:i})=>{const n=(t.riskLevel||"low").toLowerCase(),l=n==="high"||n==="medium",c=l?{card:"bg-red-50 border-red-200",icon:"bg-red-600",bullet:"text-red-600"}:{card:"bg-sky-50 border-sky-200",icon:"bg-sky-600",bullet:"text-sky-600"},m=d.useMemo(()=>he.getImportGroundedRolloutFlags(),[]),[f,h]=d.useState(""),[j,x]=d.useState(!0),[p,I]=d.useState(t.grade||"Grade 11"),[C,P]=d.useState(t.section||"Section A"),[A,Q]=d.useState(!1),[N,O]=d.useState(null),[v,$]=d.useState(!1),[R,Z]=d.useState(""),[F,le]=d.useState("all"),[oe,ae]=d.useState("all"),[ce,pe]=d.useState(!1),[be,xe]=d.useState(!1),[S,_]=d.useState(null),[D,te]=d.useState(!1),[J,g]=d.useState(!1);d.useEffect(()=>{I(t.grade||"Grade 11"),P(t.section||"Section A")},[t.grade,t.section]),d.useEffect(()=>{(async()=>{x(!0);try{const W=await he.getLearningPath({weaknesses:t.struggles.length>0?t.struggles:[t.weakestTopic],gradeLevel:"High School"});h(W.learningPath)}catch{h("Unable to generate learning path. Please try again later.")}finally{x(!1)}})()},[t]);const M=d.useCallback(async()=>{$(!0),Z("");try{const y=t.classSectionId||De(p||"Grade 11",C||"Section A"),W=await he.generateLessonPlan({gradeLevel:p||t.grade||"Grade 11",classSectionId:y,className:[p,C].filter(Boolean).join(" - ")||t.className,focusTopics:t.struggles.length>0?t.struggles:[t.weakestTopic],topicCount:5,preferImportedTopics:m.lessonEnabled,allowReviewSources:ce,allowUnverifiedLesson:be});O(W),_(null),he.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:y,className:[p,C].filter(Boolean).join(" - ")||t.className,metadata:{usedImportedTopics:W.usedImportedTopics,importedTopicCount:W.importedTopicCount,blockCount:W.blocks.length,publishReady:W.publishReady,sourceLegitimacyStatus:W.sourceLegitimacy.status,selfValidationPassed:W.selfValidation.passed,importGroundingEnabled:m.lessonEnabled}})}catch(y){let W=y instanceof Error?y.message:"Unable to generate lesson plan at this time.";if(y instanceof As&&y.status===422)try{const de=JSON.parse(y.responseBody)?.detail;de?.message&&(W=de.message);const me=de?.sourceLegitimacy?.issues||[],re=de?.selfValidation?.issues||[],Ae=[...me,...re].filter(Boolean).slice(0,3);Ae.length>0&&(W=`${W} ${Ae.join(" ")}`)}catch{}Z(W),O(null),he.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:t.classSectionId||De(p||"Grade 11",C||"Section A"),className:[p,C].filter(Boolean).join(" - ")||t.className,metadata:{error:W,allowReviewSources:ce,allowUnverifiedLesson:be,importGroundingEnabled:m.lessonEnabled}})}finally{$(!1)}},[t,p,C,m.lessonEnabled,ce,be]),B=d.useCallback(async()=>{if(!N)return U.error("Generate a lesson plan first."),null;te(!0);try{const y=await qo(N,s,{teacherName:r,studentId:t.id,studentName:t.name});return _(y),U.success("Lesson plan saved as draft."),y}catch(y){return console.error("Failed to save lesson draft:",y),U.error(y instanceof Error?y.message:"Failed to save lesson draft."),null}finally{te(!1)}},[N,s,r,t.id,t.name]),ee=d.useCallback(async()=>{if(!N){U.error("Generate a lesson plan first.");return}if(!N.publishReady){const y=[...N.sourceLegitimacy.issues,...N.selfValidation.issues].filter(Boolean).slice(0,2).join(" ");U.error(y||"Lesson is not publish-ready. Resolve legitimacy and validation checks first.");return}g(!0);try{let y=S;if(y||(y=await B()),!y)return;await Vo(y),U.success("Lesson plan published to class content."),he.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:N.classSectionId||t.classSectionId,className:N.className||t.className,metadata:{action:"publish_lesson_plan",lessonPlanId:y,publishReady:N.publishReady,sourceLegitimacyStatus:N.sourceLegitimacy.status,selfValidationPassed:N.selfValidation.passed}})}catch(y){console.error("Failed to publish lesson plan:",y),U.error(y instanceof Error?y.message:"Failed to publish lesson plan."),he.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:N.classSectionId||t.classSectionId,className:N.className||t.className,metadata:{action:"publish_lesson_plan",error:y instanceof Error?y.message:"Failed to publish lesson plan."}})}finally{g(!1)}},[N,S,B,t.className,t.classSectionId]);d.useEffect(()=>{M()},[M]),d.useEffect(()=>{le("all"),ae("all")},[N]);const V=d.useMemo(()=>N?Array.from(new Set(N.blocks.map(y=>y.provenance?.sourceFile?.trim()).filter(y=>!!y))).sort((y,W)=>y.localeCompare(W)):[],[N]),ye=d.useMemo(()=>N?Array.from(new Set(N.blocks.map(y=>y.provenance?.materialId?.trim()).filter(y=>!!y))).sort((y,W)=>y.localeCompare(W)):[],[N]),k=d.useMemo(()=>N?N.blocks.filter(y=>{const W=F==="all"||(y.provenance?.sourceFile||"").trim()===F,G=oe==="all"||(y.provenance?.materialId||"").trim()===oe;return W&&G}):[],[N,F,oe]),T=[{id:1,type:"video",title:`${t.weakestTopic} Fundamentals`,duration:"8 mins",icon:tn},{id:2,type:"quiz",title:`${t.weakestTopic} Practice`,questions:10,icon:Za},{id:3,type:"assessment",title:"Final Check",questions:5,icon:Ka}],ne=async()=>{if(!s){U.error("Unable to update section: teacher context missing");return}Q(!0);try{await xr(t.id,p,C,s,new Date().getFullYear().toString(),r),await dr(t.id,p,C);const y={...t,grade:p,section:C,className:[p,C].filter(Boolean).join(" - "),classSectionId:De(p,C)};a(y),U.success("Student section assignment updated")}catch(y){console.error("Failed to update student section assignment:",y),U.error("Failed to update section assignment")}finally{Q(!1)}};return e.jsxs(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:[e.jsxs("button",{onClick:i,className:"flex items-center gap-2 text-muted-foreground hover:text-sky-600 font-bold mb-6 transition-colors group",children:[e.jsx(Et,{size:20,className:"group-hover:-translate-x-1 transition-transform"}),"Back to Analytics"]}),e.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[e.jsx("div",{className:"bg-card rounded-2xl p-8 shadow-sm border border-border",children:e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsx("img",{src:t.avatar,alt:t.name,className:"w-24 h-24 rounded-2xl object-cover"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-display font-bold text-foreground",children:t.name}),e.jsx("span",{className:`px-4 py-1.5 rounded-xl text-sm font-bold border-2 ${Zt(t.riskLevel)}`,children:t.riskLevel==="high"?"High Risk":t.riskLevel==="medium"?"Medium Risk":"Low Risk"})]}),e.jsx("p",{className:"text-muted-foreground mb-4",children:t.className}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-muted rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Avg Score"}),e.jsxs("p",{className:"text-2xl font-bold text-foreground",children:[t.avgScore,"%"]})]}),e.jsxs("div",{className:"bg-muted rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Last Active"}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:t.lastActive})]}),e.jsxs("div",{className:"bg-muted rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Weakest Topic"}),e.jsx("p",{className:"text-sm font-bold text-red-600",children:t.weakestTopic})]})]}),e.jsxs("div",{className:"mt-5 p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("p",{className:"text-xs font-semibold text-sky-700 mb-3 uppercase tracking-wider",children:"Section Assignment"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsx(bt,{value:p,onChange:y=>I(y.target.value),placeholder:"Grade",className:"h-10"}),e.jsx(bt,{value:C,onChange:y=>P(y.target.value),placeholder:"Section",className:"h-10"}),e.jsx(Me,{onClick:ne,disabled:A||!p.trim()||!C.trim(),className:"bg-sky-600 hover:bg-sky-700 text-white h-10",children:A?e.jsx(z,{className:"h-4 w-20 bg-white/35"}):"Save Section"})]})]})]})]})}),e.jsx("div",{className:`${c.card} border-2 rounded-2xl p-6`,children:e.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[e.jsx("div",{className:`w-12 h-12 ${c.icon} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(ws,{size:24,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-display font-bold text-foreground mb-2",children:l?"AI Analysis - Learning Barriers":"AI Analysis - Learning Strengths & Next Steps"}),e.jsx(pt,{name:"teacher-intervention-analysis",loading:j,fixture:e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsx(z,{className:"h-3.5 w-64"}),e.jsx(z,{className:"h-3.5 w-56"}),e.jsx(z,{className:"h-3.5 w-44"})]}),fallback:e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsx(z,{className:"h-3.5 w-64"}),e.jsx(z,{className:"h-3.5 w-56"}),e.jsx(z,{className:"h-3.5 w-44"})]}),children:e.jsx("ul",{className:"space-y-2 text-foreground",children:t.struggles.length>0?t.struggles.map((y,W)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:`${c.bullet} inline-flex h-5 items-center`,children:"•"}),e.jsxs("span",{children:[l?"Struggles with ":"Continue strengthening ",e.jsx("strong",{children:y})]})]},W)):e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:`${c.bullet} inline-flex h-5 items-center`,children:"•"}),e.jsxs("span",{children:[l?"Needs support in ":"Maintain momentum in ",e.jsx("strong",{children:t.weakestTopic})]})]})})})]})]})}),e.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-sm border border-border",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-foreground mb-6",children:"AI-Generated Learning Path"}),e.jsxs(pt,{name:"teacher-intervention-learning-path",loading:j,fixture:e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{className:"h-24 w-full rounded-xl"}),e.jsx(z,{className:"h-20 w-full rounded-2xl"}),e.jsx(z,{className:"h-20 w-full rounded-2xl"}),e.jsx(z,{className:"h-20 w-full rounded-2xl"})]}),fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{className:"h-24 w-full rounded-xl"}),e.jsx(z,{className:"h-20 w-full rounded-2xl"}),e.jsx(z,{className:"h-20 w-full rounded-2xl"}),e.jsx(z,{className:"h-20 w-full rounded-2xl"})]}),children:[f?e.jsx("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-5 mb-6 text-sm text-foreground",children:e.jsx(Ha,{children:f})}):null,e.jsxs("div",{className:"space-y-4 relative",children:[e.jsx("div",{className:"absolute left-6 top-8 bottom-8 w-0.5 bg-border"}),T.map((y,W)=>{const G=y.icon;return e.jsxs(ie.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:W*.1},className:"relative pl-16",children:[e.jsx("div",{className:"absolute left-0 w-12 h-12 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl flex items-center justify-center shadow-md",children:e.jsx(G,{size:24,className:"text-white"})}),e.jsx("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 border border-sky-200 rounded-2xl p-5 hover:shadow-md transition-all",children:e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-foreground mb-1",children:y.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[y.type==="video"&&`${y.duration} video lesson`,y.type==="quiz"&&`${y.questions} practice questions`,y.type==="assessment"&&`${y.questions} assessment questions`]})]}),e.jsx("span",{className:`px-3 py-1 rounded-lg text-xs font-bold ${y.type==="video"?"bg-rose-100 text-rose-700":y.type==="quiz"?"bg-sky-100 text-sky-700":"bg-green-100 text-green-700"}`,children:y.type==="video"?"Video":y.type==="quiz"?"Quiz":"Assessment"})]})})]},y.id)})]})]})]}),e.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-sm border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"Targeted Lesson Plan"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Class records drive risk signals. Import-grounded lesson generation needs uploaded course materials for topic context."})]}),e.jsx(Me,{onClick:()=>void M(),disabled:v,className:"bg-sky-600 hover:bg-sky-700 text-white",children:v?e.jsx(z,{className:"h-4 w-20 bg-white/35"}):"Regenerate"})]}),e.jsx("p",{className:"mb-4 text-xs text-muted-foreground bg-sky-50 border border-sky-200 rounded-lg px-3 py-2",children:"Class records alone are not enough for import-grounded lesson plans. Upload course materials in Data Import to provide lesson topic grounding."}),e.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-2 gap-2",children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-[#f8fafc] border border-border rounded-lg px-3 py-2",children:[e.jsx("input",{type:"checkbox",checked:ce,onChange:y=>pe(y.target.checked)}),"Allow sources requiring manual review"]}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-[#f8fafc] border border-border rounded-lg px-3 py-2",children:[e.jsx("input",{type:"checkbox",checked:be,onChange:y=>xe(y.target.checked)}),"Allow unverified lesson draft (publish remains blocked)"]})]}),e.jsxs(pt,{name:"teacher-intervention-lesson-plan",loading:v,fixture:e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{className:"h-20 w-full rounded-xl"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsx(z,{className:"h-24 w-full rounded-xl"}),e.jsx(z,{className:"h-24 w-full rounded-xl"})]}),e.jsx(z,{className:"h-28 w-full rounded-xl"}),e.jsx(z,{className:"h-28 w-full rounded-xl"})]}),fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{className:"h-20 w-full rounded-xl"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsx(z,{className:"h-24 w-full rounded-xl"}),e.jsx(z,{className:"h-24 w-full rounded-xl"})]}),e.jsx(z,{className:"h-28 w-full rounded-xl"}),e.jsx(z,{className:"h-28 w-full rounded-xl"})]}),children:[R&&e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-xl p-3 text-sm text-red-700",children:R}),N&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-secondary border border-border rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:N.lessonTitle}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Imported topics used: ",N.usedImportedTopics?"Yes":"No"," | ","Imported topic count: ",N.importedTopicCount]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Publish readiness: ",N.publishReady?"Ready":"Blocked"]}),N.warnings.length>0&&e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:N.warnings.join(" ")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-card border border-border rounded-xl p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Source Legitimacy"}),e.jsxs("p",{className:"text-sm font-bold text-foreground mt-1",children:[N.sourceLegitimacy.status," (",Math.round(N.sourceLegitimacy.score*100),"%)"]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Verified: ",N.sourceLegitimacy.verifiedMaterials," | Review: ",N.sourceLegitimacy.reviewMaterials," | Rejected: ",N.sourceLegitimacy.rejectedMaterials]}),N.sourceLegitimacy.issues.length>0&&e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:N.sourceLegitimacy.issues.slice(0,2).join(" ")})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Self Validation"}),e.jsxs("p",{className:"text-sm font-bold text-foreground mt-1",children:[N.selfValidation.passed?"Passed":"Failed"," (",Math.round(N.selfValidation.score*100),"%)"]}),N.selfValidation.issues.length>0&&e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:N.selfValidation.issues.slice(0,2).join(" ")})]})]}),(V.length>0||ye.length>0)&&e.jsxs("div",{className:"bg-card border border-border rounded-xl p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground mb-2",children:"Provenance Filters"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[e.jsxs("label",{className:"text-xs text-muted-foreground flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Source File"}),e.jsxs("select",{value:F,onChange:y=>le(y.target.value),className:"bg-card border border-border rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All sources"}),V.map(y=>e.jsx("option",{value:y,children:y},y))]})]}),e.jsxs("label",{className:"text-xs text-muted-foreground flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Material ID"}),e.jsxs("select",{value:oe,onChange:y=>ae(y.target.value),className:"bg-card border border-border rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All materials"}),ye.map(y=>e.jsx("option",{value:y,children:y},y))]})]})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground mt-2",children:["Showing ",k.length," of ",N.blocks.length," lesson blocks after provenance filters."]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:k.map(y=>e.jsxs("div",{className:"border border-border rounded-xl p-4 bg-[#fcfdff]",children:[e.jsx("h3",{className:"text-sm font-bold text-foreground",children:y.title}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[y.estimatedMinutes," mins | ",y.strategy]}),e.jsx("p",{className:"text-sm text-foreground mt-2",children:y.objective}),e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"Activities"}),y.activities.slice(0,2).map((W,G)=>e.jsxs("p",{className:"text-xs text-muted-foreground",children:["- ",W]},G))]}),y.provenance&&e.jsxs("div",{className:"mt-3 bg-sky-50 border border-sky-200 rounded-lg p-2",children:[e.jsx("p",{className:"text-[11px] font-semibold text-sky-700",children:"Provenance"}),y.provenance.sourceFile&&e.jsxs("p",{className:"text-[11px] text-sky-900",children:["Source: ",y.provenance.sourceFile]}),y.provenance.materialId&&e.jsxs("p",{className:"text-[11px] text-sky-900",children:["Material: ",y.provenance.materialId]})]})]},y.blockId))}),k.length===0&&e.jsx("div",{className:"border border-border rounded-xl p-4 bg-card text-sm text-muted-foreground",children:"No lesson blocks match the selected provenance filters. Clear one or both filters to view all blocks."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(Me,{variant:"outline",onClick:()=>void B(),disabled:D||!N,className:"border-sky-300 text-sky-700",children:D?e.jsx(z,{className:"h-4 w-16"}):"Save Draft"}),e.jsx(Me,{onClick:()=>void ee(),disabled:J||!N||!N.publishReady,className:"bg-emerald-600 hover:bg-emerald-700 text-white",children:J?e.jsx(z,{className:"h-4 w-24 bg-white/35"}):"Publish Lesson Plan"}),S&&e.jsxs("p",{className:"text-xs text-muted-foreground self-center",children:["Draft ID: ",S]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs(Me,{className:"bg-sky-600 hover:bg-sky-700 text-white font-bold py-4 rounded-xl flex items-center justify-center gap-2",children:[e.jsx(zt,{size:20}),"Schedule One-on-One Session"]}),e.jsxs(Me,{variant:"outline",className:"border-2 border-sky-600 text-sky-600 hover:bg-sky-50 font-bold py-4 rounded-xl flex items-center justify-center gap-2",children:[e.jsx(Ps,{size:20}),"Export Printed Materials"]})]})]})]})]})},bi=({onEditRecords:t,classSectionId:s,className:r,classMetadata:a,onImportedClassRecords:i,onDataChanged:n})=>{const[l,c]=d.useState(!1),[m,f]=d.useState(!1),[h,j]=d.useState(!1),[x,p]=d.useState(!1),[I,C]=d.useState(!1),[P,A]=d.useState(!1),[Q,N]=d.useState(!1),[O,v]=d.useState(""),[$,R]=d.useState(null),[Z,F]=d.useState(null),[le,oe]=d.useState(""),[ae,ce]=d.useState(null),pe=d.useRef(null),be=d.useRef(null),xe=d.useRef(null),S=async k=>{p(!0),v(""),ce(null);try{const T=await he.uploadClassRecords(k,{classSectionId:s,className:r,datasetIntent:"synthetic_student_records"}),ne=T.students.length,y=T.warnings&&T.warnings.length>0?T.warnings.slice(0,3).join(" "):"",W=T.dashboardSync?` Dashboard sync: ${T.dashboardSync.synced?"ok":"pending"} (created ${T.dashboardSync.createdStudents}, updated ${T.dashboardSync.updatedStudents}).`:"",G=hi(T,s,r,a);if(ne>0&&i?.({students:T.students,classSectionId:G.classSectionId,className:G.className,classMetadata:G.classMetadata}),T.success){U.success(`Successfully imported ${ne} student records. Next step: upload course materials for AI lesson-plan grounding.`);const de=T.riskRefresh?.queued?` Risk refresh queued for ${T.riskRefresh.studentsQueued} students (job ${T.riskRefresh.refreshId||"n/a"}).`:` Risk refresh not queued${T.riskRefresh?.reason?`: ${T.riskRefresh.reason}`:""}.`,me=T.interpretationSummary,re=me?` Interpreted columns - scoring: ${me.scoringColumns}, display: ${me.displayColumns}, storage-only: ${me.storageOnlyColumns}, low-confidence: ${me.lowConfidenceColumns}.`:"",Ae=y?` Warnings: ${y}`:"";v(`Imported ${ne} students. Next step: upload course materials to give AI lesson generation topic context.${de}${W}${re}${Ae} Column mapping: ${JSON.stringify(T.columnMapping)}`),ce({datasetIntent:T.datasetIntent,summary:T.interpretationSummary,columns:T.columnInterpretations?.map(w=>({columnName:w.columnName,mappedField:w.mappedField,usagePolicy:w.usagePolicy,confidenceBand:w.confidenceBand,domainSignals:w.domainSignals}))||[]}),n?.()}else{const me=(T.files||[]).flatMap(re=>re.warnings||[]).slice(0,3).join(" ")||y||"Import completed but no usable student rows were detected. Check required columns and retry.";v(me),U.error(me)}}catch(T){let ne=T instanceof Error?T.message:"Upload failed";const y=ne.toLowerCase();T instanceof As&&y.includes("missing required educational columns after mapping")&&y.includes("assignmentcompletion")&&(ne="Your file matches the minimal import schema, but the connected backend is running an older validator that still requires assignmentCompletion. Update/redeploy the backend or point VITE_API_URL to this updated backend."),U.error(ne),v(ne),ce(null)}finally{p(!1)}},_=async k=>{C(!0),v("");try{const T=await he.uploadCourseMaterials(k,{classSectionId:s,className:r});if(T.success){const ne=T.topics?.length??0;U.success(`Course material imported (${ne} topics extracted). Lesson generation now has material context.`),v(`Imported course material ${T.fileName} with ${ne} topics and ${T.sections.length} section(s). Lesson generation is now ready with material context.`),n?.()}}catch(T){U.error(T instanceof Error?T.message:"Course material upload failed"),v("Course material upload failed. Please check the file format and try again.")}finally{C(!1)}},D=k=>{k.preventDefault(),c(!1);const T=k.dataTransfer.files[0];T&&S(T)},te=k=>{const T=k.target.files?.[0];T&&S(T)},J=k=>{k.preventDefault(),f(!1);const T=k.dataTransfer.files[0];T&&_(T)},g=k=>{const T=k.target.files?.[0];T&&_(T)},M=k=>{const T=k.rows||[];if(T.length===0){U.error("No provisioning rows to export.");return}const ne=re=>{const Ae=String(re??"");return/[,"\n]/.test(Ae)?`"${Ae.replace(/"/g,'""')}"`:Ae},W=[["rowNumber","studentId","fullName","email","uid","classSectionId","status","message","temporaryPassword"].join(","),...T.map(re=>[re.rowNumber,re.studentId,re.fullName,re.email,re.uid||"",re.classSectionId,re.status,re.message,re.temporaryPassword||""].map(ne).join(","))],G=new Blob([W.join(` -`)],{type:"text/csv;charset=utf-8;"}),de=URL.createObjectURL(G),me=document.createElement("a");me.href=de,me.download=`student-account-provisioning-${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(me),me.click(),document.body.removeChild(me),URL.revokeObjectURL(de)},B=async k=>{A(!0),F(null),v("");try{const T=Fe(r||a?.className||"Grade 11 - Section A"),ne=await he.previewStudentAccountImport(k,{classSectionId:s,className:r,defaultGrade:a?.grade||T.grade,defaultSection:a?.section||T.section});R(ne);const y=ne.summary;U.success(`Preview ready: ${y.validRows} valid, ${y.invalidRows} invalid, ${y.duplicateRows} duplicate rows.`)}catch(T){const ne=T instanceof Error?T.message:"Failed to preview student-account import.";U.error(ne),R(null)}finally{A(!1)}},ee=k=>{k.preventDefault(),j(!1);const T=k.dataTransfer.files?.[0];T&&B(T)},V=k=>{const T=k.target.files?.[0];T&&B(T)},ye=async()=>{if(!$?.previewToken){U.error("Run preview before committing student account provisioning.");return}N(!0);try{const k=await he.commitStudentAccountImport({previewToken:$.previewToken,defaultPassword:le.trim()||void 0,forcePasswordChange:!0,createAuthUsers:!0});F(k);const{createdRows:T,updatedRows:ne,blockedRows:y,failedRows:W}=k.summary;W>0?U.error(`Provisioning completed with ${W} failed row(s).`):U.success(`Provisioned accounts: ${T} created, ${ne} updated, ${y} blocked.`),n?.()}catch(k){U.error(k instanceof Error?k.message:"Failed to commit student account provisioning.")}finally{N(!1)}};return e.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:e.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"Import Data"}),e.jsx("p",{className:"text-muted-foreground",children:"Class records drive analytics and at-risk signals. Course materials provide topic grounding for AI lesson plans."}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 items-center text-xs text-muted-foreground",children:[e.jsxs("span",{className:"px-2 py-1 rounded-md bg-muted border border-border",children:["Class scope: ",r||s||"All classes"]}),[a?.gradeLevel,a?.classification,a?.strand].filter(Boolean).map(k=>e.jsx("span",{className:"px-2 py-1 rounded-md bg-sky-50 border border-sky-200 text-sky-700 font-medium",children:k},`import-meta-${k}`))]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6",children:[e.jsxs("div",{onDragOver:k=>{k.preventDefault(),c(!0)},onDragLeave:()=>c(!1),onDrop:D,onClick:()=>pe.current?.click(),className:`bg-card border-4 border-dashed rounded-3xl p-12 text-center transition-all cursor-pointer hover:border-sky-400 hover:bg-sky-50 ${l?"border-sky-600 bg-sky-50 scale-105":"border-border"}`,children:[e.jsx("input",{ref:pe,type:"file",accept:".csv,.xlsx,.pdf",onChange:te,className:"hidden"}),e.jsx("div",{className:"w-20 h-20 bg-sky-100 rounded-2xl flex items-center justify-center mx-auto mb-6",children:x?e.jsx(z,{className:"h-10 w-10 rounded-2xl bg-sky-200"}):e.jsx(Mn,{size:40,className:"text-sky-600"})}),e.jsx("h3",{className:"text-xl font-display font-bold text-foreground mb-2",children:"Class Records"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:x?e.jsxs("span",{className:"inline-flex flex-col items-center gap-2",children:[e.jsx(z,{className:"h-4 w-44 bg-sky-200"}),e.jsx(z,{className:"h-4 w-36 bg-sky-100"})]}):"Upload student grades, attendance, and quiz scores"}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-4 flex items-center justify-center gap-2",children:[e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".csv"}),e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".xlsx"}),e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".pdf"})]}),e.jsx(Me,{className:"bg-card border-2 border-border text-muted-foreground hover:border-sky-500 hover:text-sky-600 font-bold px-6 py-3 rounded-xl w-full transition-colors",children:"Click or drag & drop"})]}),e.jsxs("div",{onDragOver:k=>{k.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:J,onClick:()=>be.current?.click(),className:`bg-card border-4 border-dashed rounded-3xl p-12 text-center transition-all cursor-pointer hover:border-rose-400 hover:bg-rose-50 ${m?"border-rose-600 bg-rose-50 scale-105":"border-border"}`,children:[e.jsx("input",{ref:be,type:"file",accept:".pdf,.docx,.txt",onChange:g,className:"hidden"}),e.jsx("div",{className:"w-20 h-20 bg-rose-100 rounded-2xl flex items-center justify-center mx-auto mb-6",children:I?e.jsx(z,{className:"h-10 w-10 rounded-2xl bg-rose-200"}):e.jsx($s,{size:40,className:"text-rose-600"})}),e.jsx("h3",{className:"text-xl font-display font-bold text-foreground mb-2",children:"Course Materials"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:I?e.jsxs("span",{className:"inline-flex flex-col items-center gap-2",children:[e.jsx(z,{className:"h-4 w-48 bg-rose-200"}),e.jsx(z,{className:"h-4 w-40 bg-rose-100"})]}):"Upload syllabus, lesson plans, and curriculum documents"}),e.jsxs("p",{className:"text-xs text-slate-500 mb-4 flex items-center justify-center gap-2",children:[e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".pdf"}),e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".docx"}),e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".txt"})]}),e.jsx(Me,{className:"bg-card border-2 border-border text-muted-foreground hover:border-rose-500 hover:text-rose-600 font-bold px-6 py-3 rounded-xl w-full transition-colors",children:"Click or drag & drop"})]}),e.jsxs("div",{onDragOver:k=>{k.preventDefault(),j(!0)},onDragLeave:()=>j(!1),onDrop:ee,onClick:()=>xe.current?.click(),className:`bg-card border-4 border-dashed rounded-3xl p-12 text-center transition-all cursor-pointer hover:border-emerald-400 hover:bg-emerald-50 ${h?"border-emerald-600 bg-emerald-50 scale-105":"border-border"}`,children:[e.jsx("input",{ref:xe,type:"file",accept:".csv,.xlsx,.xls",onChange:V,className:"hidden"}),e.jsx("div",{className:"w-20 h-20 bg-emerald-100 rounded-2xl flex items-center justify-center mx-auto mb-6",children:P?e.jsx(z,{className:"h-10 w-10 rounded-2xl bg-emerald-200"}):e.jsx(Gt,{size:40,className:"text-emerald-600"})}),e.jsx("h3",{className:"text-xl font-display font-bold text-foreground mb-2",children:"Student Accounts"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:P?e.jsxs("span",{className:"inline-flex flex-col items-center gap-2",children:[e.jsx(z,{className:"h-4 w-52 bg-emerald-200"}),e.jsx(z,{className:"h-4 w-44 bg-emerald-100"})]}):"Preview and securely provision student Auth + profile accounts"}),e.jsxs("p",{className:"text-xs text-slate-500 mb-4 flex items-center justify-center gap-2",children:[e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".csv"}),e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".xlsx"}),e.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".xls"})]}),e.jsx(Me,{className:"bg-card border-2 border-border text-muted-foreground hover:border-emerald-500 hover:text-emerald-600 font-bold px-6 py-3 rounded-xl w-full transition-colors",children:"Click or drag & drop"})]})]}),e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-2xl p-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-sky-800 mb-3",children:"How AI Uses Your Data"}),e.jsxs("div",{className:"space-y-2 text-sky-900/80 text-sm",children:[e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-sky-600 font-bold",children:"-"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-sky-800",children:"Smart Format Detection:"})," AI understands various spreadsheet formats and column names"]})]}),e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-sky-600 font-bold",children:"-"}),e.jsx("span",{children:"Analyzes historical performance patterns to predict at-risk students"})]}),e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-sky-600 font-bold",children:"-"}),e.jsx("span",{children:"Maps curriculum topics to student knowledge gaps"})]}),e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-sky-600 font-bold",children:"-"}),e.jsx("span",{children:"Generates personalized remedial learning paths"})]}),e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-sky-600 font-bold",children:"-"}),e.jsx("span",{children:"All data is processed securely and never shared"})]})]})]}),O&&e.jsx("div",{className:"bg-green-50 border border-green-200 rounded-2xl p-4 text-sm text-green-800",children:O}),ae&&e.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:"Import Interpretation"}),e.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-muted text-[#334155]",children:["Intent: ",ae.datasetIntent||"synthetic_student_records"]})]}),ae.summary&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-3 mb-4",children:[e.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Scoring"}),e.jsx("p",{className:"text-lg font-bold text-foreground",children:ae.summary.scoringColumns})]}),e.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Display"}),e.jsx("p",{className:"text-lg font-bold text-foreground",children:ae.summary.displayColumns})]}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-amber-700",children:"Storage-only"}),e.jsx("p",{className:"text-lg font-bold text-amber-800",children:ae.summary.storageOnlyColumns})]}),e.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-rose-700",children:"Low confidence"}),e.jsx("p",{className:"text-lg font-bold text-rose-800",children:ae.summary.lowConfidenceColumns})]}),e.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Domain warnings"}),e.jsx("p",{className:"text-lg font-bold text-foreground",children:ae.summary.domainMismatchWarnings})]})]}),ae.columns.length>0?e.jsx("div",{className:"space-y-2 max-h-64 overflow-auto pr-1",children:ae.columns.slice(0,40).map(k=>e.jsxs("div",{className:"bg-[#f8fafc] border border-border rounded-lg px-3 py-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:k.columnName}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["mapped: ",k.mappedField||"none"," | ","usage: ",k.usagePolicy," | ","confidence: ",k.confidenceBand]}),k.domainSignals&&k.domainSignals.length>0&&e.jsxs("p",{className:"text-xs text-amber-700 mt-1",children:["domain signals: ",k.domainSignals.join(", ")]})]},k.columnName))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No per-column interpretation data was returned for this upload."})]}),$&&e.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:"Student Account Provisioning Preview"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Validate duplicates and section mappings before creating Auth and Firestore student accounts."})]}),e.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-muted text-muted-foreground font-medium",children:["Token: ",$.previewToken?`${$.previewToken.slice(0,10)}...`:"n/a"]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Rows"}),e.jsx("p",{className:"text-xl font-bold text-foreground",children:$.summary.totalRows})]}),e.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-emerald-700",children:"Valid"}),e.jsx("p",{className:"text-xl font-bold text-emerald-700",children:$.summary.validRows})]}),e.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-rose-700",children:"Invalid"}),e.jsx("p",{className:"text-xl font-bold text-rose-700",children:$.summary.invalidRows})]}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-amber-700",children:"Duplicates"}),e.jsx("p",{className:"text-xl font-bold text-amber-700",children:$.summary.duplicateRows})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_auto] gap-3 items-end",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Default Temporary Password (optional)"}),e.jsx(bt,{value:le,onChange:k=>oe(k.target.value),placeholder:"Leave blank to auto-generate per account",className:"h-10"})]}),e.jsx(Me,{onClick:()=>void ye(),disabled:Q||$.summary.validRows===0,className:"bg-emerald-600 hover:bg-emerald-700 text-white h-10",children:Q?e.jsx(z,{className:"h-4 w-24 bg-white/35"}):"Commit Provisioning"})]}),e.jsx("div",{className:"max-h-72 overflow-auto border border-border rounded-xl",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted sticky top-0",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Row"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Name"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Student ID"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Email"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Class Section"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Status"})]})}),e.jsx("tbody",{children:$.rows.slice(0,60).map(k=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsx("td",{className:"px-3 py-2",children:k.rowNumber}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:k.fullName}),k.issues.length>0&&e.jsx("p",{className:"text-[11px] text-rose-700",children:k.issues.slice(0,2).join("; ")})]}),e.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:k.studentId||"-"}),e.jsx("td",{className:"px-3 py-2 text-xs",children:k.email||"-"}),e.jsx("td",{className:"px-3 py-2 text-xs",children:k.classSectionId||"-"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold ${k.status==="valid"?"bg-emerald-100 text-emerald-700":k.status==="duplicate"?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:k.status})})]},`preview-row-${k.rowNumber}-${k.studentId}`))})]})}),$.warnings.length>0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-3 text-xs text-amber-800",children:$.warnings.slice(0,5).join(" ")})]}),Z&&e.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:"Provisioning Result"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Created: ",Z.summary.createdRows," | Updated: ",Z.summary.updatedRows," | Blocked: ",Z.summary.blockedRows," | Failed: ",Z.summary.failedRows]})]}),e.jsxs(Me,{variant:"outline",onClick:()=>M(Z),className:"border-emerald-300 text-emerald-700",children:[e.jsx(Ps,{size:14,className:"mr-2"}),"Download Credential CSV"]})]}),e.jsx("div",{className:"max-h-64 overflow-auto border border-border rounded-xl",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted sticky top-0",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Row"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Student"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Status"}),e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Message"})]})}),e.jsx("tbody",{children:Z.rows.map(k=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsx("td",{className:"px-3 py-2",children:k.rowNumber}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:k.fullName}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:k.email})]}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold ${k.status==="created"?"bg-emerald-100 text-emerald-700":k.status==="updated"?"bg-sky-100 text-sky-700":k.status==="blocked"?"bg-amber-100 text-amber-700":k.status==="failed"?"bg-rose-100 text-rose-700":"bg-muted text-muted-foreground"}`,children:k.status})}),e.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:k.message})]},`commit-row-${k.rowNumber}-${k.studentId}`))})]})})]}),e.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-foreground mb-4",children:"Manage Imported Data"}),e.jsxs("button",{onClick:t,className:"w-full bg-[#00a86b] hover:bg-[#008f5d] text-white rounded-xl p-5 flex items-center justify-between transition-all shadow-sm hover:shadow-md group",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-card/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx(Xa,{size:24,className:"text-white"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("h4",{className:"font-bold text-lg",children:"Edit Class Records"}),e.jsx("p",{className:"text-white/90 text-sm",children:"Review and correct AI-analyzed student data"})]})]}),e.jsx(Jt,{size:24,className:"text-white/80 group-hover:text-sky-700 group-hover:translate-x-1 transition-all"})]})]})]})})},vi=({students:t,teacherId:s,teacherName:r,onBack:a})=>{const[i,n]=d.useState(t),[l,c]=d.useState(!1),m=d.useCallback(x=>gt(x),[]),[f,h]=d.useState(()=>Object.fromEntries(t.map(x=>[m(x),{grade:x.grade||"Grade 11",section:x.section||"Section A"}])));d.useEffect(()=>{n(t),h(Object.fromEntries(t.map(x=>[m(x),{grade:x.grade||"Grade 11",section:x.section||"Section A"}])))},[m,t]);const j=async()=>{c(!0);try{for(const x of i){const p=f[m(x)],I=p?.grade||x.grade,C=p?.section||x.section;s&&(I!==x.grade||C!==x.section)&&(await xr(x.id,I,C,s,new Date().getFullYear().toString(),r),await dr(x.id,I,C));try{const P=await he.predictRisk({engagementScore:x.engagementScore,avgQuizScore:x.avgScore,attendance:x.attendance,assignmentCompletion:x.assignmentCompletion});await Bo(x.id,P.riskLevel,P.confidence)}catch{}}n(x=>x.map(p=>{const I=f[m(p)];if(!I)return p;const C=Ie({metadata:p.classMetadata,classSectionId:p.classSectionId,className:[I.grade,I.section].filter(Boolean).join(" - "),grade:I.grade,section:I.section});return{...p,grade:I.grade,section:I.section,className:C.className||[I.grade,I.section].filter(Boolean).join(" - "),classSectionId:C.classSectionId||p.classSectionId,classMetadata:C}})),U.success("Records saved and risk levels updated"),a()}catch{U.error("Failed to save changes")}finally{c(!1)}};return e.jsxs(ie.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"p-6 h-full flex flex-col",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:a,className:"p-2 hover:bg-muted rounded-lg transition-colors text-muted-foreground",children:e.jsx(Et,{size:24})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-display font-bold text-foreground",children:"Edit Class Records"}),e.jsx("p",{className:"text-muted-foreground",children:"Review and modify student data manually"})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(Me,{variant:"outline",onClick:a,className:"border-border",children:"Cancel"}),e.jsxs(Me,{onClick:j,disabled:l,className:"bg-emerald-600 hover:bg-emerald-700 text-white gap-2",children:[l?e.jsx(z,{className:"h-5 w-5 rounded-full bg-white/35"}):e.jsx(Wa,{size:18}),l?"Saving...":"Save Changes"]})]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-2xl shadow-sm flex-1 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-border bg-background flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Ft,{size:18}),e.jsx("span",{className:"text-sm",children:"Click on any field to edit"})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",i.length," records"]})]}),e.jsx("div",{className:"overflow-auto flex-1",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{className:"bg-background sticky top-0 z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Student Name"}),e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"LRN"}),e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Grade"}),e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Section"}),e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Avg Score"}),e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Risk Level"}),e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Weakest Topic"}),e.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Actions"})]})}),e.jsx("tbody",{children:i.map(x=>{const p=m(x);return e.jsxs("tr",{className:"border-b border-border hover:bg-sky-50/30 group transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:x.avatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}),e.jsx("span",{className:"font-medium text-foreground",children:x.name})]})}),e.jsx("td",{className:"p-4 text-muted-foreground font-mono text-sm",children:x.lrn||"Not set"}),e.jsx("td",{className:"p-4 min-w-[140px]",children:e.jsx(bt,{id:`edit-record-grade-${p}`,name:`edit-record-grade-${p}`,"aria-label":`Edit grade for ${x.name}`,value:f[p]?.grade||x.grade,onChange:I=>h(C=>({...C,[p]:{...C[p],grade:I.target.value}})),className:"h-9 text-sm"})}),e.jsx("td",{className:"p-4 min-w-[140px]",children:e.jsx(bt,{id:`edit-record-section-${p}`,name:`edit-record-section-${p}`,"aria-label":`Edit section for ${x.name}`,value:f[p]?.section||x.section,onChange:I=>h(C=>({...C,[p]:{...C[p],section:I.target.value}})),className:"h-9 text-sm"})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:`font-bold ${x.avgScore<60?"text-red-600":x.avgScore<80?"text-rose-600":"text-green-600"}`,children:[x.avgScore,"%"]})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${Zt(x.riskLevel)}`,children:x.riskLevel.toUpperCase()})}),e.jsx("td",{className:"p-4 text-muted-foreground",children:x.weakestTopic}),e.jsx("td",{className:"p-4",children:e.jsx("button",{className:"p-2 hover:bg-muted rounded-lg text-slate-500 hover:text-sky-600 transition-colors",children:e.jsx(Xa,{size:16})})})]},p)})})]})})]})]})};function Zt(t){switch(t){case"high":return"bg-red-100 text-red-700 border-red-200";case"medium":return"bg-rose-100 text-rose-700 border-rose-200";case"low":return"bg-green-100 text-green-700 border-green-200"}}function yi(t){switch(t){case"high":return"border-red-500 bg-red-50";case"medium":return"border-rose-500 bg-rose-50";case"low":return"border-green-500 bg-green-50"}}export{yl as default}; diff --git a/assets/XPNotification-4si_K5GL.js b/assets/XPNotification-4si_K5GL.js deleted file mode 100644 index dd1a965f17be061ec641dbe56dfd0bd3da3107b0..0000000000000000000000000000000000000000 --- a/assets/XPNotification-4si_K5GL.js +++ /dev/null @@ -1 +0,0 @@ -import{r as l,j as e}from"./vendor-react-Dexh7fmo.js";import{e as n,m as r}from"./index-D4nJsLyx.js";import{S as c}from"./star-dumQ9BVG.js";import{S as m}from"./sparkles-CXUFmaBJ.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const v=({xp:i,message:a,show:t,onComplete:s})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{s()},3e3);return()=>clearTimeout(o)}},[t,s]),e.jsx(n,{children:t&&e.jsx(r.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(c,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(r.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},children:e.jsx(m,{size:16,className:"text-rose-200"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:a}),e.jsxs("p",{className:"text-2xl font-black",children:["+",i," XP"]})]})]})})}));export{v as default}; diff --git a/assets/apiService-axx1LHMk.js b/assets/apiService-axx1LHMk.js deleted file mode 100644 index 6ab03c57b1678eb7c0b775f317628e9c63cbdd67..0000000000000000000000000000000000000000 --- a/assets/apiService-axx1LHMk.js +++ /dev/null @@ -1,6 +0,0 @@ -import{G as B}from"./index-D4nJsLyx.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-BML5nJHm.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const z=3e4,ce=3,le=1e3;class E extends Error{status;statusText;endpoint;responseBody;retryable;requestId;constructor(t){super(`API Error ${t.status} (${t.statusText}) on ${t.endpoint}: ${t.responseBody}`),this.name="ApiError",this.status=t.status,this.statusText=t.statusText,this.endpoint=t.endpoint,this.responseBody=t.responseBody,this.retryable=t.retryable,this.requestId=t.requestId}}class N extends Error{endpoint;timeoutMs;constructor(t,r){super(`Request to ${t} timed out after ${r}ms`),this.name="ApiTimeoutError",this.endpoint=t,this.timeoutMs=r}}class W extends Error{endpoint;originalError;constructor(t,r){super(`Network error on ${t}: ${r.message}`),this.name="ApiNetworkError",this.endpoint=t,this.originalError=r}}class y extends Error{endpoint;details;constructor(t,r){super(`Validation error before calling ${t}: ${r}`),this.name="ApiValidationError",this.endpoint=t,this.details=r}}const me=new Set([408,429,500,502,503,504]);function fe(e){return me.has(e)}function K(e){const t=`[API ${e.level.toUpperCase()}] ${e.timestamp} ${e.method} ${e.endpoint}`;switch(e.level){case"error":console.error(t,e.message,e.details??"");break;case"warn":console.warn(t,e.message,e.details??"");break;default:console.info(t,e.message,e.details??"")}}function I(e,t,r,a){K({timestamp:new Date().toISOString(),level:"info",endpoint:e,method:t,message:r,details:a})}function Y(e,t,r,a){K({timestamp:new Date().toISOString(),level:"warn",endpoint:e,method:t,message:r,details:a})}function m(e,t,r,a){K({timestamp:new Date().toISOString(),level:"error",endpoint:e,method:t,message:r,details:a})}function pe(e,t,r=z){const a=new AbortController,s=setTimeout(()=>a.abort(),r);return{promise:fetch(e,{...t,signal:a.signal}).finally(()=>clearTimeout(s)),abort:()=>a.abort()}}let he=e=>new Promise(t=>setTimeout(t,e));function ee(e){return he(e)}function ye(e,t=le){const r=t*Math.pow(2,e),a=Math.random()*t;return Math.min(r+a,3e4)}async function te(e,t={},r={}){const{maxRetries:a=ce,timeoutMs:s=z,baseBackoffMs:f=le}=r,d=(t.method??"GET").toUpperCase();let i;for(let n=0;n<=a;n++){const g=Date.now();try{n>0&&I(e,d,`Retry attempt ${n}/${a}`);const{promise:l}=pe(e,t,s),c=await l,w=Date.now()-g;if(c.ok)return I(e,d,`${c.status} in ${w}ms`,{attempt:n}),await c.json();const L=await c.text().catch(()=>"Unable to read response body"),R=fe(c.status),k=new E({status:c.status,statusText:c.statusText,endpoint:e,responseBody:L,retryable:R,requestId:c.headers.get("x-request-id")??void 0});if(m(e,d,`${c.status} ${c.statusText} in ${w}ms`,{attempt:n,responseBody:L.slice(0,500),retryable:R}),!R)throw k;if(c.status===429){const u=c.headers.get("retry-after");if(u){const P=parseInt(u,10);if(!isNaN(P)&&P>0){Y(e,d,`Rate limited. Waiting ${P}s (Retry-After header)`),await ee(P*1e3),i=k;continue}}}i=k}catch(l){const c=Date.now()-g;if(l instanceof E&&!l.retryable)throw l;if(l instanceof DOMException&&l.name==="AbortError"){const w=new N(e,s);m(e,d,`Timeout after ${c}ms`,{attempt:n,timeoutMs:s}),i=w}else if(l instanceof TypeError&&l.message.includes("fetch")){const w=new W(e,l);m(e,d,`Network error after ${c}ms: ${l.message}`,{attempt:n}),i=w}else l instanceof E?i=l:(i=l instanceof Error?l:new Error(String(l)),m(e,d,`Unexpected error: ${i.message}`,{attempt:n}))}if(na==null||a==="").map(([a])=>a);if(r.length>0)throw new y(e,`Missing required fields: ${r.join(", ")}`)}function h(e,t,r,a,s){if(typeof r!="number"||isNaN(r)||rs)throw new y(e,`${t} must be a number between ${a} and ${s}, got ${r}`)}const U="https://deign86-mathpulse-api-v3test.hf.space",q=(e,t)=>t,de=(e,t)=>t,j=q(void 0,!0),re=q(void 0,!0),ae=q(void 0,!0),se=q(void 0,!0),ne=de(void 0,9e4),H=de(void 0,9e5);let Q=!0,ie=0;const ge=6e4,F={maxRetries:ce,timeoutMs:z,baseBackoffMs:1e3},A={...F,timeoutMs:6e4},Se={...A,maxRetries:1,timeoutMs:45e3,baseBackoffMs:750},V={maxRetries:2,timeoutMs:12e4,baseBackoffMs:2e3},we={maxRetries:0,timeoutMs:8e3,baseBackoffMs:500};let D=null;async function Be(){return D||(D=(async()=>{try{I("/health","GET","Warming up HuggingFace Space...");const e=new AbortController,t=setTimeout(()=>e.abort(),15e3),r=await fetch(`${U}/health`,{method:"GET",signal:e.signal});return clearTimeout(t),r.ok?(I("/health","GET","Backend warm and ready"),!0):(console.warn("[apiService] Backend health check returned",r.status),!1)}catch(e){return console.warn("[apiService] Backend warmup failed (cold start expected):",e),!1}})(),D)}async function o(e,t,r=F){const a=`${U}${e}`,s=t?.method??"GET";I(e,s,"Starting request");const f=async i=>{const n=new Headers(t?.headers??{});!(t?.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const g=B.currentUser;if(g)try{const l=await g.getIdToken(i);l&&n.set("Authorization",`Bearer ${l}`)}catch(l){m(e,s,"Failed to acquire Firebase ID token",l)}return{...t,headers:n}};let d=await f(!1);try{const i=await te(a,d,r);return I(e,s,"Request succeeded"),i}catch(i){if(i instanceof E&&i.status===401&&B.currentUser)try{I(e,s,"401 received, refreshing Firebase token and retrying once"),d=await f(!0);const n=await te(a,d,r);return I(e,s,"Request succeeded after token refresh"),n}catch(n){throw n instanceof E?m(e,s,`HTTP ${n.status}: ${n.responseBody.slice(0,300)}`):n instanceof N?m(e,s,`Timeout after ${n.timeoutMs}ms`):n instanceof W?m(e,s,`Network error: ${n.originalError.message}`):m(e,s,`Unexpected: ${n instanceof Error?n.message:String(n)}`),n}throw i instanceof E?m(e,s,`HTTP ${i.status}: ${i.responseBody.slice(0,300)}`):i instanceof N?m(e,s,`Timeout after ${i.timeoutMs}ms`):i instanceof W?m(e,s,`Network error: ${i.originalError.message}`):m(e,s,`Unexpected: ${i instanceof Error?i.message:String(i)}`),i}}async function Te(e,t,r=z){const a=`${U}${e}`,s=t?.method??"GET";I(e,s,"Starting blob request");const f=async d=>{const i=new Headers(t?.headers??{}),n=B.currentUser;if(n)try{const c=await n.getIdToken(d);c&&i.set("Authorization",`Bearer ${c}`)}catch(c){m(e,s,"Failed to acquire Firebase ID token",c)}const g=new AbortController,l=setTimeout(()=>g.abort(),r);try{const c=await fetch(a,{...t,headers:i,signal:g.signal});if(!c.ok){const w=await c.text();throw new E({status:c.status,statusText:c.statusText||"Request Failed",endpoint:e,responseBody:w,retryable:c.status>=500||c.status===429})}return await c.blob()}finally{clearTimeout(l)}};try{return await f(!1)}catch(d){if(d instanceof E&&d.status===401&&B.currentUser)return I(e,s,"401 received for blob request, refreshing Firebase token and retrying once"),f(!0);throw d}}const be={response:"Sorry, the AI tutor is temporarily unavailable. Please try again in a moment."},Ie={riskLevel:"Medium",confidence:0,analysis:{labels:[],scores:[]},risk_level:"medium",risk_score:0,top_factors:["Fallback risk response due to temporary service unavailability"]},Ee={learningPath:"Unable to generate a learning path right now. Please try again later."},ke={insight:"Daily insight is temporarily unavailable. Please refresh later."},Ae={expression:"",result:"Error: calculation service unavailable",steps:[],simplified:null,latex:null};function Oe(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.riskLevel=="string"&&typeof t.confidence=="number"}function oe(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.questions)&&typeof t.totalPoints=="number"}const ve=e=>new Promise(t=>setTimeout(t,e));function Re(e){if(!e)return"Generation task failed without a detailed error.";if(typeof e=="string")return e;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return"Generation task failed due to an unknown error."}}return String(e)}const b={getImportGroundedRolloutFlags(){return{quizEnabled:j,lessonEnabled:re,feedbackEnabled:ae}},async reportImportGroundedFeedback(e){return ae?o("/api/feedback/import-grounded",{method:"POST",body:JSON.stringify(e)}):{success:!0,stored:!1,warnings:["Import-grounded feedback events are disabled by frontend rollout flag."]}},async health(){return o("/health",void 0,{...F,timeoutMs:1e4})},async chat(e,t,r,a){p("/api/chat",{message:e});const s={message:e,history:t??[],...a?.expectedEndMarker?{expectedEndMarker:a.expectedEndMarker}:{},...a?.completionMode?{completionMode:a.completionMode}:{},...typeof a?.continuationMaxRounds=="number"?{continuationMaxRounds:Math.max(0,Math.floor(a.continuationMaxRounds))}:{}};if(r){const d=new AbortController;let i=null,n=null,g=null;const l=u=>{i||(i=u,d.abort())},c=()=>{n&&(clearTimeout(n),n=null),g&&(clearTimeout(g),g=null)},w=()=>{n&&clearTimeout(n),n=setTimeout(()=>l("idle"),ne)};g=setTimeout(()=>l("total"),H);const L=new Headers({"Content-Type":"application/json"}),R=B.currentUser;if(R)try{const u=await R.getIdToken(!1);u&&L.set("Authorization",`Bearer ${u}`)}catch(u){m("/api/chat/stream","POST","Failed to acquire Firebase ID token",u)}let k=null;try{w();const u=await fetch(`${U}/api/chat/stream`,{method:"POST",headers:L,body:JSON.stringify(s),signal:d.signal});if(!u.ok||!u.body){const $=await u.text().catch(()=>"Unable to read response body");throw new Error(`Streaming request failed (${u.status}): ${$.slice(0,300)}`)}k=u.body.getReader();const P=new TextDecoder;let O="",G="",X=!1;const J=$=>{const v=$.indexOf(` - -`),T=$.indexOf(`\r -\r -`);return v===-1&&T===-1?null:v===-1?{index:T,length:4}:T===-1?{index:v,length:2}:vb.chat(e,t,void 0,r),be,"chat")},async predictRisk(e){p("/api/predict-risk",{engagementScore:e.engagementScore,avgQuizScore:e.avgQuizScore,attendance:e.attendance,assignmentCompletion:e.assignmentCompletion}),h("/api/predict-risk","engagementScore",e.engagementScore,0,100),h("/api/predict-risk","avgQuizScore",e.avgQuizScore,0,100),h("/api/predict-risk","attendance",e.attendance,0,100),h("/api/predict-risk","assignmentCompletion",e.assignmentCompletion,0,100);const t=await o("/api/predict-risk",{method:"POST",body:JSON.stringify(e)});if(!Oe(t))throw m("/api/predict-risk","POST","Invalid response shape",t),new Error("Invalid risk prediction response from server");return t},async predictRiskSafe(e){return x(()=>b.predictRisk(e),Ie,"predictRisk")},async predictRiskBatch(e){if(!Array.isArray(e)||e.length===0)throw new y("/api/predict-risk/batch","students array must not be empty");return o("/api/predict-risk/batch",{method:"POST",body:JSON.stringify({students:e})})},async getLearningPath(e){if(p("/api/learning-path",{weaknesses:e.weaknesses,gradeLevel:e.gradeLevel}),!Array.isArray(e.weaknesses)||e.weaknesses.length===0)throw new y("/api/learning-path","weaknesses must be a non-empty array");return o("/api/learning-path",{method:"POST",body:JSON.stringify(e)},A)},async getLearningPathSafe(e){return x(()=>b.getLearningPath(e),Ee,"getLearningPath")},async getDailyInsight(e){if(!Array.isArray(e.students)||e.students.length===0)throw new y("/api/analytics/daily-insight","students array must not be empty");return o("/api/analytics/daily-insight",{method:"POST",body:JSON.stringify(e)},A)},async getDailyInsightSafe(e){return x(()=>b.getDailyInsight(e),ke,"getDailyInsight")},async getImportedClassOverview(e){if(!e?.forceRefresh&&!Q&&Date.now()!s||s.size===0))throw new y("/api/upload/class-records","All files must be non-empty");if(r.some(s=>s.size>10*1024*1024))throw new y("/api/upload/class-records","One or more files exceed the 10 MB size limit");const a=new FormData;return r.forEach(s=>a.append("files",s)),t?.classSectionId&&a.append("classSectionId",t.classSectionId),t?.className&&a.append("className",t.className),a.append("datasetIntent",t?.datasetIntent??"synthetic_student_records"),o("/api/upload/class-records",{method:"POST",body:a},V)},async previewStudentAccountImport(e,t){if(!e||e.size===0)throw new y("/api/import/student-accounts/preview","A non-empty file is required");if(e.size>10*1024*1024)throw new y("/api/import/student-accounts/preview","File exceeds 10 MB size limit");const r=new FormData;return r.append("file",e),t?.classSectionId&&r.append("classSectionId",t.classSectionId),t?.className&&r.append("className",t.className),t?.defaultGrade&&r.append("defaultGrade",t.defaultGrade),t?.defaultSection&&r.append("defaultSection",t.defaultSection),o("/api/import/student-accounts/preview",{method:"POST",body:r},V)},async commitStudentAccountImport(e){return p("/api/import/student-accounts/commit",{previewToken:e.previewToken}),o("/api/import/student-accounts/commit",{method:"POST",body:JSON.stringify(e)},F)},async getRiskRefreshMonitor(e){const t=e?.limit??10;h("/api/upload/class-records/risk-refresh/recent","limit",t,1,50);const r=new URLSearchParams;return r.set("limit",String(t)),e?.classSectionId&&r.set("classSectionId",e.classSectionId),o(`/api/upload/class-records/risk-refresh/recent?${r.toString()}`)},async getImportGroundedTelemetrySummary(e){const t=e?.days??7,r=e?.limit??5e3;h("/api/feedback/import-grounded/summary","days",t,1,30),h("/api/feedback/import-grounded/summary","limit",r,100,2e4);const a=new URLSearchParams;return a.set("days",String(t)),a.set("limit",String(r)),e?.classSectionId&&a.set("classSectionId",e.classSectionId),o(`/api/feedback/import-grounded/summary?${a.toString()}`)},async getImportGroundedAccessAudit(e){const t=e?.days??7,r=e?.limit??200;h("/api/import-grounded/access-audit","days",t,1,30),h("/api/import-grounded/access-audit","limit",r,1,1e3);const a=new URLSearchParams;return a.set("days",String(t)),a.set("limit",String(r)),a.set("export","json"),e?.classSectionId&&a.set("classSectionId",e.classSectionId),o(`/api/import-grounded/access-audit?${a.toString()}`)},async exportImportGroundedAccessAuditCsv(e){const t=e?.days??7,r=e?.limit??200;h("/api/import-grounded/access-audit","days",t,1,30),h("/api/import-grounded/access-audit","limit",r,1,1e3);const a=new URLSearchParams;return a.set("days",String(t)),a.set("limit",String(r)),a.set("export","csv"),e?.classSectionId&&a.set("classSectionId",e.classSectionId),Te(`/api/import-grounded/access-audit?${a.toString()}`,{method:"GET"},3e4)},async uploadCourseMaterials(e,t){const r=Array.isArray(e)?e:[e];if(r.length===0)throw new y("/api/upload/course-materials","At least one file is required");if(r.some(s=>!s||s.size===0))throw new y("/api/upload/course-materials","All files must be non-empty");if(r.some(s=>s.size>10*1024*1024))throw new y("/api/upload/course-materials","One or more files exceed the 10 MB size limit");const a=new FormData;return r.forEach(s=>a.append("files",s)),t?.classSectionId&&a.append("classSectionId",t.classSectionId),t?.className&&a.append("className",t.className),o("/api/upload/course-materials",{method:"POST",body:a},V)},async getRecentCourseMaterials(e){const t=e?.limit??10;h("/api/upload/course-materials/recent","limit",t,1,50);const r=new URLSearchParams;return r.set("limit",String(t)),e?.classSectionId&&r.set("classSectionId",e.classSectionId),o(`/api/upload/course-materials/recent?${r.toString()}`)},async getCourseMaterialTopics(e){const t=e?.limit??20;h("/api/course-materials/topics","limit",t,1,50);const r=new URLSearchParams;return r.set("limit",String(t)),e?.classSectionId&&r.set("classSectionId",e.classSectionId),e?.materialId&&r.set("materialId",e.materialId),o(`/api/course-materials/topics?${r.toString()}`)},async generateLessonPlan(e){p("/api/lesson/generate",{gradeLevel:e.gradeLevel});const t={...e,preferImportedTopics:re&&(e.preferImportedTopics??!0)};if(se){const r=await b.submitLessonPlanAsync(t),s=(await b.waitForTaskResult(r.taskId,{timeoutMs:24e4,pollIntervalMs:1500})).result;if(!s||typeof s!="object")throw new Error("Lesson generation completed without a valid result payload.");return s}return o("/api/lesson/generate",{method:"POST",body:JSON.stringify(t)},A)},async generateQuiz(e,t){if(p("/api/quiz/generate",{topics:e.topics,gradeLevel:e.gradeLevel}),!Array.isArray(e.topics)||e.topics.length===0)throw new y("/api/quiz/generate","topics must be a non-empty array");const r={...e,preferImportedTopics:j&&(e.preferImportedTopics??!0)};if(se){const s=await b.submitQuizAsync(r);t?.onTaskCreated?.(s.taskId);const d=(await b.waitForTaskResult(s.taskId,{timeoutMs:24e4,pollIntervalMs:1500,onProgress:t?.onProgress})).result;if(!d||typeof d!="object")throw new Error("Quiz generation completed without a valid result payload.");if(!oe(d))throw new Error("Invalid quiz generation response from async task payload.");return d}const a=await o("/api/quiz/generate",{method:"POST",body:JSON.stringify(r)},A);if(!oe(a))throw m("/api/quiz/generate","POST","Invalid response shape",a),new Error("Invalid quiz generation response from server");return a},async previewQuiz(e){p("/api/quiz/preview",{topics:e.topics,gradeLevel:e.gradeLevel});const t={...e,preferImportedTopics:j&&(e.preferImportedTopics??!0)};return o("/api/quiz/preview",{method:"POST",body:JSON.stringify(t)},A)},async submitLessonPlanAsync(e){return o("/api/lesson/generate-async",{method:"POST",body:JSON.stringify(e)},A)},async submitQuizAsync(e){return o("/api/quiz/generate-async",{method:"POST",body:JSON.stringify(e)},A)},async getTaskStatus(e){return p("/api/tasks/{taskId}",{taskId:e}),o(`/api/tasks/${encodeURIComponent(e)}`)},async listTasks(e){const t=new URLSearchParams;e?.limit!=null&&(h("/api/tasks","limit",e.limit,1,200),t.set("limit",String(e.limit))),e?.status&&t.set("status",e.status),e?.includeResults!=null&&t.set("include_results",String(e.includeResults));const r=t.toString();return o(`/api/tasks${r?`?${r}`:""}`)},async cancelTask(e){return p("/api/tasks/{taskId}/cancel",{taskId:e}),o(`/api/tasks/${encodeURIComponent(e)}/cancel`,{method:"POST"})},async waitForTaskResult(e,t){const r=t?.timeoutMs??18e4,a=t?.pollIntervalMs??1500,s=Date.now();for(;Date.now()-s<=r;){const f=await b.getTaskStatus(e);if(t?.onProgress?.(f),f.status==="completed")return f;if(f.status==="failed"||f.status==="cancelled")throw new Error(Re(f.error));await ve(a)}throw new Error(`Async generation task timed out after ${Math.round(r/1e3)} seconds.`)},async getQuizTopics(e){const t=e?`?gradeLevel=${encodeURIComponent(e)}`:"";return o(`/api/quiz/topics${t}`)},async getStudentCompetency(e,t){return p("/api/quiz/student-competency",{studentId:e}),o("/api/quiz/student-competency",{method:"POST",body:JSON.stringify({studentId:e,quizHistory:t})})},async evaluateExpression(e){return p("/api/calculator/evaluate",{expression:e}),o("/api/calculator/evaluate",{method:"POST",body:JSON.stringify({expression:e})})},async evaluateExpressionSafe(e){return x(()=>b.evaluateExpression(e),{...Ae,expression:e},"evaluateExpression")},async automationDiagnosticCompleted(e){return p("/api/automation/diagnostic-completed",{lrn:e.lrn,results:e.results}),o("/api/automation/diagnostic-completed",{method:"POST",body:JSON.stringify(e)})},async automationQuizSubmitted(e){return p("/api/automation/quiz-submitted",{lrn:e.lrn,quizId:e.quizId,subject:e.subject}),o("/api/automation/quiz-submitted",{method:"POST",body:JSON.stringify(e)})},async automationStudentEnrolled(e){return p("/api/automation/student-enrolled",{lrn:e.lrn,name:e.name,email:e.email}),o("/api/automation/student-enrolled",{method:"POST",body:JSON.stringify(e)})},async automationDataImported(e){return p("/api/automation/data-imported",{teacherId:e.teacherId,students:e.students}),o("/api/automation/data-imported",{method:"POST",body:JSON.stringify(e)})},async automationContentUpdated(e){return p("/api/automation/content-updated",{adminId:e.adminId,action:e.action,contentType:e.contentType,contentId:e.contentId}),o("/api/automation/content-updated",{method:"POST",body:JSON.stringify(e)})}};export{E as ApiError,W as ApiNetworkError,N as ApiTimeoutError,y as ApiValidationError,b as apiService,Be as warmupBackend}; diff --git a/assets/automationService-DNyauqGd.js b/assets/automationService-DNyauqGd.js deleted file mode 100644 index 9657a6bd6cd7a3a0b86746b0ca26c129e2889710..0000000000000000000000000000000000000000 --- a/assets/automationService-DNyauqGd.js +++ /dev/null @@ -1 +0,0 @@ -import{m as p,e as r,q as w,w as h,f as z,n as Q,a as i,s as I,d as b,u as A}from"./vendor-firebase-firestore-BML5nJHm.js";import{d as s,O as a,P as $}from"./index-D4nJsLyx.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";async function T(e){if(!e)return 0;const n=r(s,"deepDiagnosticAssignments"),c=w(n,h("lrn","==",e));return(await z(c)).docs.filter(o=>{const t=o.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function k(e,n,c="Grade 11",u,o="iar_only",t="initial_assessment"){if(t==="followup_diagnostic"){const D=r(s,"deepDiagnosticAssignments"),C=w(D,h("lrn","==",e)),d=await z(C);if(!d.empty){const m=Q(s);let g=!1;for(const l of d.docs){const f=l.data().status;(f==="pending"||f==="queued")&&(m.update(l.ref,{status:"in_progress",startedAt:i()}),g=!0)}g&&await m.commit()}}return await I(b(s,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:c,workflowMode:o,assessmentType:t,questionBreakdown:u||null,completedAt:i(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function B(e){return await p(r(s,"quizResults"),{lrn:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:i()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function M(e){return await $(e.lrn),await a(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await a(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function U(e){return await p(r(s,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:i(),processed:!1}),await a(e.teacherId,"message","Data Import Processed",`Data import complete — ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete — ${e.students.length} student records processed.`]}}async function x(e){const n=b(s,"curriculumContent",e.contentId);return e.action==="delete"?await A(n,{deleted:!0,deletedBy:e.adminId,deletedAt:i(),contentType:e.contentType,subjectId:e.subjectId||null}):await I(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:i()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{T as getPendingDeepDiagnosticCount,x as triggerContentUpdated,U as triggerDataImported,k as triggerDiagnosticCompleted,B as triggerQuizSubmitted,M as triggerStudentEnrolled}; diff --git a/assets/avatarData-BW_TX0b4.js b/assets/avatarData-BW_TX0b4.js deleted file mode 100644 index 7a9947ded1e01e55b1195ce68dc8a760c22b8902..0000000000000000000000000000000000000000 --- a/assets/avatarData-BW_TX0b4.js +++ /dev/null @@ -1 +0,0 @@ -const r=[{id:"top_blue",name:"Blue Uniform",category:"top",src:"/avatar/uniform_blue.png",thumbnail:"/avatar/uniform_blue_thumbnail.png",price:0},{id:"top_pink",name:"Pink Uniform",category:"top",src:"/avatar/uniform_pink.png",thumbnail:"/avatar/uniform_pink_thumbnail.png",price:200},{id:"bot_black",name:"Black Pants",category:"bottom",src:"/avatar/pants_black.png",thumbnail:"/avatar/pants_black_thumbnail.png",price:0},{id:"shoe_black",name:"Black Shoes",category:"shoes",src:"/avatar/shoes_black.png",thumbnail:"/avatar/shoes_black_thumbnail.png",price:0},{id:"acc_leaf_clip",name:"Leaf Clip",category:"accessory",src:"/avatar/leaf_clip.png",thumbnail:"/avatar/leaf_clip_thumbnail.png",price:0},{id:"acc_blue_cap",name:"Blue Cap",category:"accessory",src:"/avatar/blue_cap.png",thumbnail:"/avatar/blue_cap_thumbnail.png",price:250},{id:"acc_red_cap",name:"Red Cap",category:"accessory",src:"/avatar/red_cap.png",thumbnail:"/avatar/red_cap_thumbnail.png",price:250},{id:"acc_traffic_cone",name:"Traffic Cone",category:"accessory",src:"/avatar/traffic_cone.png",thumbnail:"/avatar/traffic_cone_thumbnail.png",price:500},{id:"acc_crown",name:"Crown",category:"accessory",src:"/avatar/crown.png",thumbnail:"/avatar/crown_thumbnail.png",price:1e3}],n=a=>{if(a)return r.find(c=>c.id===a)?.src};export{r as M,n as g}; diff --git a/assets/award-oJTbc9W5.js b/assets/award-oJTbc9W5.js deleted file mode 100644 index d7fd7823a6ee58974d726cf6e55ab2c07b46e32e..0000000000000000000000000000000000000000 --- a/assets/award-oJTbc9W5.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],e=c("award",a);export{e as A}; diff --git a/assets/bell-CbSbac2W.js b/assets/bell-CbSbac2W.js deleted file mode 100644 index d7eafdbbf163abfd4c22648f1055aa525d8105e8..0000000000000000000000000000000000000000 --- a/assets/bell-CbSbac2W.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],t=e("bell",c);export{t as B}; diff --git a/assets/book-open-BH50GByv.js b/assets/book-open-BH50GByv.js deleted file mode 100644 index d7e74c9fcb58207d7ef476c1df050e972d62ee04..0000000000000000000000000000000000000000 --- a/assets/book-open-BH50GByv.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as o}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],t=o("book-open",a);export{t as B}; diff --git a/assets/brain-CPvGdgWE.js b/assets/brain-CPvGdgWE.js deleted file mode 100644 index 75ce27af637379ab2ff472c8ac8e0fc847810575..0000000000000000000000000000000000000000 --- a/assets/brain-CPvGdgWE.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],p=a("brain",e);export{p as B}; diff --git a/assets/button-BpeUVhBo.js b/assets/button-BpeUVhBo.js deleted file mode 100644 index 58467c8080899bf89c3e57eb45ad771ae85602ab..0000000000000000000000000000000000000000 --- a/assets/button-BpeUVhBo.js +++ /dev/null @@ -1 +0,0 @@ -import{j as y}from"./vendor-react-Dexh7fmo.js";import{z as k}from"./vendor-radix-BRdei-zg.js";import{c as V}from"./clsx-B-dksMZM.js";import{c as p}from"./utils-BQQgILNW.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function 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}; diff --git a/assets/calendar-BJ8oE6yW.js b/assets/calendar-BJ8oE6yW.js deleted file mode 100644 index 5aada8290435578ae86670b636446056658e92e0..0000000000000000000000000000000000000000 --- a/assets/calendar-BJ8oE6yW.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],a=e("calendar",t);export{a as C}; diff --git a/assets/chart-column-D5mAWcRx.js b/assets/chart-column-D5mAWcRx.js deleted file mode 100644 index 0bb37894a9bf111332f77e317a74a9692a229700..0000000000000000000000000000000000000000 --- a/assets/chart-column-D5mAWcRx.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as t}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],o=t("chart-column",a);export{o as C}; diff --git a/assets/chatService-BXbCYY4-.js b/assets/chatService-BXbCYY4-.js new file mode 100644 index 0000000000000000000000000000000000000000..c6be5a6a070afc359061e16db368f79d7d5bea08 --- /dev/null +++ b/assets/chatService-BXbCYY4-.js @@ -0,0 +1 @@ +import{d as c,c as d,a as g,b as i,s as w,u as p,q as l,w as u,e as y,f as A}from"./vendor-firebase-firestore-C0C-blIn.js";import{d as o}from"./index-B36njGvu.js";import"./vendor-firebase-core-BireMWc7.js";import"./vendor-react-CCIuKUIB.js";import"./vendor-firebase-auth-DUGvAaJx.js";import"./vendor-firebase-storage-CnCozLgy.js";import"./vendor-firebase-analytics-FE_tmzXh.js";import"./vendor-radix-DkXsqQ-A.js";import"./vendor-markdown-CDZ6ydrN.js";const T=async(s,t="New Conversation")=>{try{const e=c(d(o,"chatSessions")),r={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...r,createdAt:i(),updatedAt:i()}),r}catch(e){throw console.error("Error creating chat session:",e),e}},b=async s=>{try{const t=l(d(o,"chatSessions"),u("userId","==",s),u("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,createdAt:a.createdAt?.toDate()||new Date,updatedAt:a.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},q=async s=>{try{const t=await g(c(o,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},Q=async(s,t,e,r)=>{try{const a=c(d(o,"chatMessages")),n={id:a.id,userId:"",role:t,content:e,timestamp:new Date,...r?{context:r}:{}},h=await g(c(o,"chatSessions",s));h.exists()&&(n.userId=h.data().userId);const m={id:n.id,userId:n.userId,role:n.role,content:n.content,sessionId:s,timestamp:i()};return n.context&&(m.context=n.context),await w(a,m),await p(c(o,"chatSessions",s),{updatedAt:i()}),n}catch(a){throw console.error("Error adding message:",a),a}},R=async s=>{try{const t=l(d(o,"chatMessages"),u("sessionId","==",s),y("timestamp","asc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,timestamp:a.timestamp?.toDate()||new Date}})}catch(t){return console.error("Error getting session messages:",t),[]}},B=async(s,t)=>{try{await p(c(o,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},N=async s=>{try{await p(c(o,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{Q as addMessageToSession,T as createChatSession,N as deleteSession,q as getChatSession,R as getSessionMessages,b as getUserChatSessions,B as updateSessionTitle}; diff --git a/assets/chatService-LsXGqjoV.js b/assets/chatService-LsXGqjoV.js deleted file mode 100644 index 79b30de6faa18b0676cae9e13aac3bf37842b237..0000000000000000000000000000000000000000 --- a/assets/chatService-LsXGqjoV.js +++ /dev/null @@ -1 +0,0 @@ -import{d as c,e as d,b as g,a as i,s as w,u as p,q as l,w as u,o as y,f as A}from"./vendor-firebase-firestore-BML5nJHm.js";import{d as o}from"./index-D4nJsLyx.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const C=async(s,t="New Conversation")=>{try{const e=c(d(o,"chatSessions")),r={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...r,createdAt:i(),updatedAt:i()}),r}catch(e){throw console.error("Error creating chat session:",e),e}},M=async s=>{try{const t=l(d(o,"chatSessions"),u("userId","==",s),u("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,createdAt:a.createdAt?.toDate()||new Date,updatedAt:a.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},T=async s=>{try{const t=await g(c(o,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},b=async(s,t,e,r)=>{try{const a=c(d(o,"chatMessages")),n={id:a.id,userId:"",role:t,content:e,timestamp:new Date,...r?{context:r}:{}},h=await g(c(o,"chatSessions",s));h.exists()&&(n.userId=h.data().userId);const m={id:n.id,userId:n.userId,role:n.role,content:n.content,sessionId:s,timestamp:i()};return n.context&&(m.context=n.context),await w(a,m),await p(c(o,"chatSessions",s),{updatedAt:i()}),n}catch(a){throw console.error("Error adding message:",a),a}},q=async s=>{try{const t=l(d(o,"chatMessages"),u("sessionId","==",s),y("timestamp","asc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,timestamp:a.timestamp?.toDate()||new Date}})}catch(t){return console.error("Error getting session messages:",t),[]}},Q=async(s,t)=>{try{await p(c(o,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},R=async s=>{try{await p(c(o,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{b as addMessageToSession,C as createChatSession,R as deleteSession,T as getChatSession,q as getSessionMessages,M as getUserChatSessions,Q as updateSessionTitle}; diff --git a/assets/check-BACdUlFL.js b/assets/check-BACdUlFL.js deleted file mode 100644 index 74103d114240bb9f44ebf8fc5715f7fcb798d1be..0000000000000000000000000000000000000000 --- a/assets/check-BACdUlFL.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C}; diff --git a/assets/chevron-right-COMox1Xb.js b/assets/chevron-right-COMox1Xb.js deleted file mode 100644 index 8848bd0ca635b412e272741a13c16d0979e0b27b..0000000000000000000000000000000000000000 --- a/assets/chevron-right-COMox1Xb.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as o}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],e=o("chevron-right",t);export{e as C}; diff --git a/assets/chevron-up-Bfmq3Clw.js b/assets/chevron-up-Bfmq3Clw.js deleted file mode 100644 index fafcf9da8fe2318bdc6329643184d923b8d515a0..0000000000000000000000000000000000000000 --- a/assets/chevron-up-Bfmq3Clw.js +++ /dev/null @@ -1,11 +0,0 @@ -import{c as o}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],r=o("chevron-down",n);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],t=o("chevron-up",c);export{t as C,r as a}; diff --git a/assets/circle-alert-CBefjicJ.js b/assets/circle-alert-CBefjicJ.js deleted file mode 100644 index ed41ef5e19f4ffdc7fb5293132fc1a67e0ee8560..0000000000000000000000000000000000000000 --- a/assets/circle-alert-CBefjicJ.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C}; diff --git a/assets/circle-check-big-0Gzyt_f3.js b/assets/circle-check-big-0Gzyt_f3.js deleted file mode 100644 index 445d5eabaa19790d6c7a567d5be34bf851b5ba94..0000000000000000000000000000000000000000 --- a/assets/circle-check-big-0Gzyt_f3.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],t=c("circle-check-big",e);export{t as C}; diff --git a/assets/circle-help-BmjHdT5a.js b/assets/circle-help-BmjHdT5a.js deleted file mode 100644 index 2b6e4aea59edf37454aaf2707ebb2d0962070976..0000000000000000000000000000000000000000 --- a/assets/circle-help-BmjHdT5a.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],p=c("circle-help",e);export{p as C}; diff --git a/assets/clock-DUJO-a50.js b/assets/clock-DUJO-a50.js deleted file mode 100644 index 5fbf2ad312b918cb25e5149a133e0de361180355..0000000000000000000000000000000000000000 --- a/assets/clock-DUJO-a50.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],i=c("clock",o);export{i as C}; diff --git a/assets/clsx-B-dksMZM.js b/assets/clsx-B-dksMZM.js deleted file mode 100644 index b8badebbb2b14d6bf0fb27d3a873feae19beaad7..0000000000000000000000000000000000000000 --- a/assets/clsx-B-dksMZM.js +++ /dev/null @@ -1 +0,0 @@ -function a(r){var f,n,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(f=0;f-1}return za=t,za}var Ga,sh;function mx(){if(sh)return Ga;sh=1;var e=Ni();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ga=t,Ga}var Ka,ch;function qi(){if(ch)return Ka;ch=1;var e=dx(),t=vx(),r=yx(),n=gx(),i=mx();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u0?1:-1},It=function(t){return Bt(t)&&t.indexOf("%")===t.length-1},F=function(t){return Fx(t)&&!On(t)},Ux=function(t){return J(t)},be=function(t){return F(t)||Bt(t)},Wx=0,Li=function(t){var r=++Wx;return"".concat(t||"").concat(r)},ze=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!F(t)&&!Bt(t))return n;var a;if(It(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return On(a)&&(a=n),i&&a>r&&(a=r),a},gt=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},Hx=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zx(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var qh={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ut=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},kh=null,xo=null,Nl=function e(t){if(t===kh&&Array.isArray(xo))return xo;var r=[];return q.Children.forEach(t,function(n){J(n)||(qx.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),xo=r,kh=t,r};function Ge(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return ut(i)}):n=[ut(t)],Nl(e).forEach(function(i){var a=Ye(i,"type.displayName")||Ye(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Re(e,t){var r=Ge(e,t);return r&&r[0]}var Bh=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!F(n)||n<=0||!F(i)||i<=0)},Jx=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Qx=function(t){return t&&t.type&&Bt(t.type)&&Jx.indexOf(t.type)>=0},ew=function(t,r,n,i){var a,o=(a=bo?.[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Z(t)&&(i&&o.includes(r)||Kx.includes(r))||n&&Dl.includes(r)},ce=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(q.isValidElement(t)&&(i=t.props),!xr(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;ew((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},bc=function e(t,r){if(t===r)return!0;var n=q.Children.count(t);if(n!==q.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Lh(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aw(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wc(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,s=e.desc,c=iw(e,nw),f=i||{width:r,height:n,x:0,y:0},l=se("recharts-surface",a);return E.createElement("svg",xc({},ce(c,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),E.createElement("title",null,u),E.createElement("desc",null,s),t)}var ow=["children","className"];function _c(){return _c=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sw(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ae=E.forwardRef(function(e,t){var r=e.children,n=e.className,i=uw(e,ow),a=se("recharts-layer",n);return E.createElement("g",_c({className:a},ce(i,!0),{ref:t}),r)}),Dt=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return _o=t,_o}var Oo,Hh;function dm(){if(Hh)return Oo;Hh=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+i+a+"]");function s(c){return u.test(c)}return Oo=s,Oo}var So,zh;function fw(){if(zh)return So;zh=1;function e(t){return t.split("")}return So=e,So}var Ao,Gh;function hw(){if(Gh)return Ao;Gh=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",u="["+i+"]",s="\\ud83c[\\udffb-\\udfff]",c="(?:"+u+"|"+s+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",d="\\u200d",g=c+"?",v="["+a+"]?",p="(?:"+d+"(?:"+[f,l,h].join("|")+")"+v+g+")*",b=v+g+p,x="(?:"+[f+u+"?",u,l,h,o].join("|")+")",w=RegExp(s+"(?="+s+")|"+x+b,"g");function O(y){return y.match(w)||[]}return Ao=O,Ao}var Po,Kh;function pw(){if(Kh)return Po;Kh=1;var e=fw(),t=dm(),r=hw();function n(i){return t(i)?r(i):e(i)}return Po=n,Po}var To,Xh;function dw(){if(Xh)return To;Xh=1;var e=lw(),t=dm(),r=pw(),n=lm();function i(a){return function(o){o=n(o);var u=t(o)?r(o):void 0,s=u?u[0]:o.charAt(0),c=u?e(u,1).join(""):o.slice(1);return s[a]()+c}}return To=i,To}var Eo,Vh;function vw(){if(Vh)return Eo;Vh=1;var e=dw(),t=e("toUpperCase");return Eo=t,Eo}var yw=vw();const Fi=ae(yw);function ie(e){return function(){return e}}const vm=Math.cos,Gn=Math.sin,Ke=Math.sqrt,Kn=Math.PI,Ui=2*Kn,Oc=Math.PI,Sc=2*Oc,jt=1e-6,gw=Sc-jt;function ym(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ym;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;ijt)if(!(Math.abs(l*s-c*f)>jt)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=n-o,g=i-u,v=s*s+c*c,p=d*d+g*g,b=Math.sqrt(v),x=Math.sqrt(h),w=a*Math.tan((Oc-Math.acos((v+h-p)/(2*b*x)))/2),O=w/x,y=w/b;Math.abs(O-1)>jt&&this._append`L${t+O*f},${r+O*l}`,this._append`A${a},${a},0,0,${+(l*d>f*g)},${this._x1=t+y*s},${this._y1=r+y*c}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),s=n*Math.sin(i),c=t+u,f=r+s,l=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${c},${f}`:(Math.abs(this._x1-c)>jt||Math.abs(this._y1-f)>jt)&&this._append`L${c},${f}`,n&&(h<0&&(h=h%Sc+Sc),h>gw?this._append`A${n},${n},0,1,${l},${t-u},${r-s}A${n},${n},0,1,${l},${this._x1=c},${this._y1=f}`:h>jt&&this._append`A${n},${n},0,${+(h>=Oc)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ql(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new bw(t)}function kl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gm(e){this._context=e}gm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Wi(e){return new gm(e)}function mm(e){return e[0]}function bm(e){return e[1]}function xm(e,t){var r=ie(!0),n=null,i=Wi,a=null,o=ql(u);e=typeof e=="function"?e:e===void 0?mm:ie(e),t=typeof t=="function"?t:t===void 0?bm:ie(t);function u(s){var c,f=(s=kl(s)).length,l,h=!1,d;for(n==null&&(a=i(d=o())),c=0;c<=f;++c)!(c=d;--g)u.point(w[g],O[g]);u.lineEnd(),u.areaEnd()}b&&(w[h]=+e(p,h,l),O[h]=+t(p,h,l),u.point(n?+n(p,h,l):w[h],r?+r(p,h,l):O[h]))}if(x)return u=null,x+""||null}function f(){return xm().defined(i).curve(o).context(a)}return c.x=function(l){return arguments.length?(e=typeof l=="function"?l:ie(+l),n=null,c):e},c.x0=function(l){return arguments.length?(e=typeof l=="function"?l:ie(+l),c):e},c.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:ie(+l),c):n},c.y=function(l){return arguments.length?(t=typeof l=="function"?l:ie(+l),r=null,c):t},c.y0=function(l){return arguments.length?(t=typeof l=="function"?l:ie(+l),c):t},c.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:ie(+l),c):r},c.lineX0=c.lineY0=function(){return f().x(e).y(t)},c.lineY1=function(){return f().x(e).y(r)},c.lineX1=function(){return f().x(n).y(t)},c.defined=function(l){return arguments.length?(i=typeof l=="function"?l:ie(!!l),c):i},c.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),c):o},c.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),c):a},c}class wm{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function xw(e){return new wm(e,!0)}function ww(e){return new wm(e,!1)}const Bl={draw(e,t){const r=Ke(t/Kn);e.moveTo(r,0),e.arc(0,0,r,0,Ui)}},_w={draw(e,t){const r=Ke(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},_m=Ke(1/3),Ow=_m*2,Sw={draw(e,t){const r=Ke(t/Ow),n=r*_m;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Aw={draw(e,t){const r=Ke(t),n=-r/2;e.rect(n,n,r,r)}},Pw=.8908130915292852,Om=Gn(Kn/10)/Gn(7*Kn/10),Tw=Gn(Ui/10)*Om,Ew=-vm(Ui/10)*Om,Mw={draw(e,t){const r=Ke(t*Pw),n=Tw*r,i=Ew*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Ui*a/5,u=vm(o),s=Gn(o);e.lineTo(s*r,-u*r),e.lineTo(u*n-s*i,s*n+u*i)}e.closePath()}},Mo=Ke(3),jw={draw(e,t){const r=-Ke(t/(Mo*3));e.moveTo(0,r*2),e.lineTo(-Mo*r,-r),e.lineTo(Mo*r,-r),e.closePath()}},Ne=-.5,qe=Ke(3)/2,Ac=1/Ke(12),Cw=(Ac/2+1)*3,Iw={draw(e,t){const r=Ke(t/Cw),n=r/2,i=r*Ac,a=n,o=r*Ac+r,u=-a,s=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,s),e.lineTo(Ne*n-qe*i,qe*n+Ne*i),e.lineTo(Ne*a-qe*o,qe*a+Ne*o),e.lineTo(Ne*u-qe*s,qe*u+Ne*s),e.lineTo(Ne*n+qe*i,Ne*i-qe*n),e.lineTo(Ne*a+qe*o,Ne*o-qe*a),e.lineTo(Ne*u+qe*s,Ne*s-qe*u),e.closePath()}};function $w(e,t){let r=null,n=ql(i);e=typeof e=="function"?e:ie(e||Bl),t=typeof t=="function"?t:ie(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:ie(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ie(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Xn(){}function Vn(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Sm(e){this._context=e}Sm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Vn(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Vn(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rw(e){return new Sm(e)}function Am(e){this._context=e}Am.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Vn(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Dw(e){return new Am(e)}function Pm(e){this._context=e}Pm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Vn(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nw(e){return new Pm(e)}function Tm(e){this._context=e}Tm.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function qw(e){return new Tm(e)}function Yh(e){return e<0?-1:1}function Zh(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(Yh(a)+Yh(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function Jh(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function jo(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Yn(e){this._context=e}Yn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:jo(this,this._t0,Jh(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,jo(this,Jh(this,r=Zh(this,e,t)),r);break;default:jo(this,this._t0,r=Zh(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Em(e){this._context=new Mm(e)}(Em.prototype=Object.create(Yn.prototype)).point=function(e,t){Yn.prototype.point.call(this,t,e)};function Mm(e){this._context=e}Mm.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function kw(e){return new Yn(e)}function Bw(e){return new Em(e)}function jm(e){this._context=e}jm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Qh(e),i=Qh(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Fw(e){return new Hi(e,.5)}function Uw(e){return new Hi(e,0)}function Ww(e){return new Hi(e,1)}function tr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function Hw(e,t){return e[t]}function zw(e){const t=[];return t.key=e,t}function Gw(){var e=ie([]),t=Pc,r=tr,n=Hw;function i(a){var o=Array.from(e.apply(this,arguments),zw),u,s=o.length,c=-1,f;for(const l of a)for(u=0,++c;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function t1(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Cm={symbolCircle:Bl,symbolCross:_w,symbolDiamond:Sw,symbolSquare:Aw,symbolStar:Mw,symbolTriangle:jw,symbolWye:Iw},r1=Math.PI/180,n1=function(t){var r="symbol".concat(Fi(t));return Cm[r]||Bl},i1=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*r1;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},a1=function(t,r){Cm["symbol".concat(Fi(t))]=r},Ll=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,s=e1(t,Yw),c=tp(tp({},s),{},{type:n,size:a,sizeType:u}),f=function(){var p=n1(n),b=$w().type(p).size(i1(a,u,n));return b()},l=c.className,h=c.cx,d=c.cy,g=ce(c,!0);return h===+h&&d===+d&&a===+a?E.createElement("path",Tc({},g,{className:se("recharts-symbols",l),transform:"translate(".concat(h,", ").concat(d,")"),d:f()})):null};Ll.registerSymbol=a1;function rr(e){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rr(e)}function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=d.inactive?c:d.color;return E.createElement("li",Ec({className:p,style:l,key:"legend-item-".concat(g)},mc(n.props,d,g)),E.createElement(wc,{width:o,height:o,viewBox:f,style:h},n.renderIcon(d)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(b,d,g):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(q.PureComponent);Ur(Fl,"displayName","Legend");Ur(Fl,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Co,np;function v1(){if(np)return Co;np=1;var e=qi();function t(){this.__data__=new e,this.size=0}return Co=t,Co}var Io,ip;function y1(){if(ip)return Io;ip=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Io=e,Io}var $o,ap;function g1(){if(ap)return $o;ap=1;function e(t){return this.__data__.get(t)}return $o=e,$o}var Ro,op;function m1(){if(op)return Ro;op=1;function e(t){return this.__data__.has(t)}return Ro=e,Ro}var Do,up;function b1(){if(up)return Do;up=1;var e=qi(),t=Cl(),r=Il(),n=200;function i(a,o){var u=this.__data__;if(u instanceof e){var s=u.__data__;if(!t||s.lengthd))return!1;var v=l.get(o),p=l.get(u);if(v&&p)return v==u&&p==o;var b=-1,x=!0,w=s&i?new e:void 0;for(l.set(o,u),l.set(u,o);++b-1&&n%1==0&&n-1&&r%1==0&&r<=e}return nu=t,nu}var iu,Cp;function I1(){if(Cp)return iu;Cp=1;var e=ht(),t=zl(),r=pt(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",s="[object Function]",c="[object Map]",f="[object Number]",l="[object Object]",h="[object RegExp]",d="[object Set]",g="[object String]",v="[object WeakMap]",p="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",y="[object Int16Array]",m="[object Int32Array]",_="[object Uint8Array]",S="[object Uint8ClampedArray]",A="[object Uint16Array]",C="[object Uint32Array]",T={};T[x]=T[w]=T[O]=T[y]=T[m]=T[_]=T[S]=T[A]=T[C]=!0,T[n]=T[i]=T[p]=T[a]=T[b]=T[o]=T[u]=T[s]=T[c]=T[f]=T[l]=T[h]=T[d]=T[g]=T[v]=!1;function P(M){return r(M)&&t(M.length)&&!!T[e(M)]}return iu=P,iu}var au,Ip;function Fm(){if(Ip)return au;Ip=1;function e(t){return function(r){return t(r)}}return au=e,au}var Dr={exports:{}};Dr.exports;var $p;function $1(){return $p||($p=1,(function(e,t){var r=um(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,u=(function(){try{var s=i&&i.require&&i.require("util").types;return s||o&&o.binding&&o.binding("util")}catch{}})();e.exports=u})(Dr,Dr.exports)),Dr.exports}var ou,Rp;function Um(){if(Rp)return ou;Rp=1;var e=I1(),t=Fm(),r=$1(),n=r&&r.isTypedArray,i=n?t(n):e;return ou=i,ou}var uu,Dp;function R1(){if(Dp)return uu;Dp=1;var e=M1(),t=Wl(),r=Ce(),n=Lm(),i=Hl(),a=Um(),o=Object.prototype,u=o.hasOwnProperty;function s(c,f){var l=r(c),h=!l&&t(c),d=!l&&!h&&n(c),g=!l&&!h&&!d&&a(c),v=l||h||d||g,p=v?e(c.length,String):[],b=p.length;for(var x in c)(f||u.call(c,x))&&!(v&&(x=="length"||d&&(x=="offset"||x=="parent")||g&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,b)))&&p.push(x);return p}return uu=s,uu}var su,Np;function D1(){if(Np)return su;Np=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return su=t,su}var cu,qp;function Wm(){if(qp)return cu;qp=1;function e(t,r){return function(n){return t(r(n))}}return cu=e,cu}var lu,kp;function N1(){if(kp)return lu;kp=1;var e=Wm(),t=e(Object.keys,Object);return lu=t,lu}var fu,Bp;function q1(){if(Bp)return fu;Bp=1;var e=D1(),t=N1(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&o.push(u);return o}return fu=i,fu}var hu,Lp;function Sn(){if(Lp)return hu;Lp=1;var e=Ml(),t=zl();function r(n){return n!=null&&t(n.length)&&!e(n)}return hu=r,hu}var pu,Fp;function zi(){if(Fp)return pu;Fp=1;var e=R1(),t=q1(),r=Sn();function n(i){return r(i)?e(i):t(i)}return pu=n,pu}var du,Up;function k1(){if(Up)return du;Up=1;var e=A1(),t=E1(),r=zi();function n(i){return e(i,r,t)}return du=n,du}var vu,Wp;function B1(){if(Wp)return vu;Wp=1;var e=k1(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,u,s,c,f){var l=u&t,h=e(a),d=h.length,g=e(o),v=g.length;if(d!=v&&!l)return!1;for(var p=d;p--;){var b=h[p];if(!(l?b in o:n.call(o,b)))return!1}var x=f.get(a),w=f.get(o);if(x&&w)return x==o&&w==a;var O=!0;f.set(a,o),f.set(o,a);for(var y=l;++p-1}return Fu=t,Fu}var Uu,yd;function a_(){if(yd)return Uu;yd=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var b=c?null:i(s);if(b)return a(b);g=!1,h=n,p=new e}else p=c?[]:v;e:for(;++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function x_(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function w_(e){return e.value}function __(e,t){if(E.isValidElement(e))return E.cloneElement(e,t);if(typeof e=="function")return E.createElement(e,t);t.ref;var r=b_(t,f_);return E.createElement(Fl,r)}var Sd=1,Jt=(function(e){function t(){var r;h_(this,t);for(var n=arguments.length,i=new Array(n),a=0;aSd||Math.abs(i.height-this.lastBoundingBox.height)>Sd)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?rt({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,s=i.margin,c=i.chartWidth,f=i.chartHeight,l,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();l={left:((c||0)-d.width)/2}}else l=o==="right"?{right:s&&s.right||0}:{left:s&&s.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var g=this.getBBoxSnapshot();h={top:((f||0)-g.height)/2}}else h=u==="bottom"?{bottom:s&&s.bottom||0}:{top:s&&s.top||0};return rt(rt({},l),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,s=i.wrapperStyle,c=i.payloadUniqBy,f=i.payload,l=rt(rt({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(s)),s);return E.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(d){n.wrapperNode=d}},__(a,rt(rt({},this.props),{},{payload:Xm(f,c,w_)})))}}],[{key:"getWithHeight",value:function(n,i){var a=rt(rt({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&F(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(q.PureComponent);Gi(Jt,"displayName","Legend");Gi(Jt,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Ku,Ad;function O_(){if(Ad)return Ku;Ad=1;var e=_n(),t=Wl(),r=Ce(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return Ku=i,Ku}var Xu,Pd;function Zm(){if(Pd)return Xu;Pd=1;var e=Bm(),t=O_();function r(n,i,a,o,u){var s=-1,c=n.length;for(a||(a=t),u||(u=[]);++s0&&a(f)?i>1?r(f,i-1,a,o,u):e(u,f):o||(u[u.length]=f)}return u}return Xu=r,Xu}var Vu,Td;function S_(){if(Td)return Vu;Td=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),s=u.length;s--;){var c=u[t?s:++a];if(n(o[c],c,o)===!1)break}return r}}return Vu=e,Vu}var Yu,Ed;function A_(){if(Ed)return Yu;Ed=1;var e=S_(),t=e();return Yu=t,Yu}var Zu,Md;function Jm(){if(Md)return Zu;Md=1;var e=A_(),t=zi();function r(n,i){return n&&e(n,i,t)}return Zu=r,Zu}var Ju,jd;function P_(){if(jd)return Ju;jd=1;var e=Sn();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,u=n?o:-1,s=Object(i);(n?u--:++un||u&&s&&f&&!c&&!l||a&&s&&f||!i&&f||!o)return 1;if(!a&&!u&&!l&&r=c)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return ns=t,ns}var is,Nd;function j_(){if(Nd)return is;Nd=1;var e=$l(),t=Rl(),r=_t(),n=Qm(),i=T_(),a=Fm(),o=M_(),u=wr(),s=Ce();function c(f,l,h){l.length?l=e(l,function(v){return s(v)?function(p){return t(p,v.length===1?v[0]:v)}:v}):l=[u];var d=-1;l=e(l,a(r));var g=n(f,function(v,p,b){var x=e(l,function(w){return w(v)});return{criteria:x,index:++d,value:v}});return i(g,function(v,p){return o(v,p,h)})}return is=c,is}var as,qd;function C_(){if(qd)return as;qd=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return as=e,as}var os,kd;function I_(){if(kd)return os;kd=1;var e=C_(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,s=t(o.length-i,0),c=Array(s);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return ls=n,ls}var fs,Wd;function N_(){if(Wd)return fs;Wd=1;var e=R_(),t=D_(),r=t(e);return fs=r,fs}var hs,Hd;function q_(){if(Hd)return hs;Hd=1;var e=wr(),t=I_(),r=N_();function n(i,a){return r(t(i,a,e),i+"")}return hs=n,hs}var ps,zd;function Ki(){if(zd)return ps;zd=1;var e=jl(),t=Sn(),r=Hl(),n=wt();function i(a,o,u){if(!n(u))return!1;var s=typeof o;return(s=="number"?t(u)&&r(o,u.length):s=="string"&&o in u)?e(u[o],a):!1}return ps=i,ps}var ds,Gd;function k_(){if(Gd)return ds;Gd=1;var e=Zm(),t=j_(),r=q_(),n=Ki(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return ds=i,ds}var B_=k_();const Xl=ae(B_);function Wr(e){"@babel/helpers - typeof";return Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wr(e)}function Cc(){return Cc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Ar,"-left"),F(r)&&t&&F(t.x)&&r=t.y),"".concat(Ar,"-top"),F(n)&&t&&F(t.y)&&nv?Math.max(f,s[n]):Math.max(l,s[n])}function eO(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function tO(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,s=e.viewBox,c,f,l;return o.height>0&&o.width>0&&r?(f=Vd({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:s,viewBoxDimension:s.width}),l=Vd({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:s,viewBoxDimension:s.height}),c=eO({translateX:f,translateY:l,useTranslate3d:u})):c=J_,{cssProperties:c,cssClasses:Q_({translateX:f,translateY:l,coordinate:r})}}function ir(e){"@babel/helpers - typeof";return ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ir(e)}function Yd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zd(e){for(var t=1;tJd||Math.abs(n.height-this.state.lastBoundingBox.height)>Jd)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,s=i.animationEasing,c=i.children,f=i.coordinate,l=i.hasPayload,h=i.isAnimationActive,d=i.offset,g=i.position,v=i.reverseDirection,p=i.useTranslate3d,b=i.viewBox,x=i.wrapperStyle,w=tO({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:d,position:g,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:b}),O=w.cssClasses,y=w.cssProperties,m=Zd(Zd({transition:h&&a?"transform ".concat(u,"ms ").concat(s):void 0},y),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&l?"visible":"hidden",position:"absolute",top:0,left:0},x);return E.createElement("div",{tabIndex:-1,className:O,style:m,ref:function(S){n.wrapperNode=S}},c)}}])})(q.PureComponent),fO=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Xi={isSsr:fO()};function ar(e){"@babel/helpers - typeof";return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ar(e)}function Qd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ev(e){for(var t=1;t0;return E.createElement(lO,{allowEscapeViewBox:o,animationDuration:u,animationEasing:s,isAnimationActive:h,active:a,coordinate:f,hasPayload:m,offset:d,position:p,reverseDirection:b,useTranslate3d:x,viewBox:w,wrapperStyle:O},wO(c,ev(ev({},this.props),{},{payload:y})))}}])})(q.PureComponent);Vl(nt,"displayName","Tooltip");Vl(nt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Xi.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var ys,tv;function _O(){if(tv)return ys;tv=1;var e=tt(),t=function(){return e.Date.now()};return ys=t,ys}var gs,rv;function OO(){if(rv)return gs;rv=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return gs=t,gs}var ms,nv;function SO(){if(nv)return ms;nv=1;var e=OO(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return ms=r,ms}var bs,iv;function ab(){if(iv)return bs;iv=1;var e=SO(),t=wt(),r=br(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function s(c){if(typeof c=="number")return c;if(r(c))return n;if(t(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=t(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=e(c);var l=a.test(c);return l||o.test(c)?u(c.slice(2),l?2:8):i.test(c)?n:+c}return bs=s,bs}var xs,av;function AO(){if(av)return xs;av=1;var e=wt(),t=_O(),r=ab(),n="Expected a function",i=Math.max,a=Math.min;function o(u,s,c){var f,l,h,d,g,v,p=0,b=!1,x=!1,w=!0;if(typeof u!="function")throw new TypeError(n);s=r(s)||0,e(c)&&(b=!!c.leading,x="maxWait"in c,h=x?i(r(c.maxWait)||0,s):h,w="trailing"in c?!!c.trailing:w);function O(M){var I=f,j=l;return f=l=void 0,p=M,d=u.apply(j,I),d}function y(M){return p=M,g=setTimeout(S,s),b?O(M):d}function m(M){var I=M-v,j=M-p,R=s-I;return x?a(R,h-j):R}function _(M){var I=M-v,j=M-p;return v===void 0||I>=s||I<0||x&&j>=h}function S(){var M=t();if(_(M))return A(M);g=setTimeout(S,m(M))}function A(M){return g=void 0,w&&f?O(M):(f=l=void 0,d)}function C(){g!==void 0&&clearTimeout(g),p=0,f=v=l=g=void 0}function T(){return g===void 0?d:A(t())}function P(){var M=t(),I=_(M);if(f=arguments,l=this,v=M,I){if(g===void 0)return y(v);if(x)return clearTimeout(g),g=setTimeout(S,s),O(v)}return g===void 0&&(g=setTimeout(S,s)),d}return P.cancel=C,P.flush=T,P}return xs=o,xs}var ws,ov;function PO(){if(ov)return ws;ov=1;var e=AO(),t=wt(),r="Expected a function";function n(i,a,o){var u=!0,s=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,s="trailing"in o?!!o.trailing:s),e(i,a,{leading:u,maxWait:a,trailing:s})}return ws=n,ws}var TO=PO();const ob=ae(TO);function zr(e){"@babel/helpers - typeof";return zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(e)}function uv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Rn(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=ob(M,v,{trailing:!0,leading:!1}));var I=new ResizeObserver(M),j=y.current.getBoundingClientRect(),R=j.width,N=j.height;return T(R,N),I.observe(y.current),function(){I.disconnect()}},[T,v]);var P=q.useMemo(function(){var M=A.containerWidth,I=A.containerHeight;if(M<0||I<0)return null;Dt(It(o)||It(s),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,s),Dt(!r||r>0,"The aspect(%s) must be greater than zero.",r);var j=It(o)?M:o,R=It(s)?I:s;r&&r>0&&(j?R=j/r:R&&(j=R*r),h&&R>h&&(R=h)),Dt(j>0||R>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,j,R,o,s,f,l,r);var N=!Array.isArray(d)&&ut(d.type).endsWith("Chart");return E.Children.map(d,function(k){return E.isValidElement(k)?q.cloneElement(k,Rn({width:j,height:R},N?{style:Rn({height:"100%",width:"100%",maxHeight:R,maxWidth:j},k.props.style)}:{})):k})},[r,d,s,h,l,f,A,o]);return E.createElement("div",{id:p?"".concat(p):void 0,className:se("recharts-responsive-container",b),style:Rn(Rn({},O),{},{width:o,height:s,minWidth:f,minHeight:l,maxHeight:h}),ref:y},P)}),ub=function(t){return null};ub.displayName="Cell";function Gr(e){"@babel/helpers - typeof";return Gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(e)}function cv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Dc(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Xi.isSsr)return{width:0,height:0};var n=FO(r),i=JSON.stringify({text:t,copyStyle:n});if(Xt.widthCache[i])return Xt.widthCache[i];try{var a=document.getElementById(lv);a||(a=document.createElement("span"),a.setAttribute("id",lv),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Dc(Dc({},LO),n);Object.assign(a.style,o),a.textContent="".concat(t);var u=a.getBoundingClientRect(),s={width:u.width,height:u.height};return Xt.widthCache[i]=s,++Xt.cacheCount>BO&&(Xt.cacheCount=0,Xt.widthCache={}),s}catch{return{width:0,height:0}}},UO=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Kr(e){"@babel/helpers - typeof";return Kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kr(e)}function ti(e,t){return GO(e)||zO(e,t)||HO(e,t)||WO()}function WO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HO(e,t){if(e){if(typeof e=="string")return hv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hv(e,t)}}function hv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oS(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mv(e,t){return lS(e)||cS(e,t)||sS(e,t)||uS()}function uS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sS(e,t){if(e){if(typeof e=="string")return bv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bv(e,t)}}function bv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return j.reduce(function(R,N){var k=N.word,B=N.width,H=R[R.length-1];if(H&&(i==null||a||H.width+B+nN.width?R:N})};if(!f)return d;for(var v="…",p=function(j){var R=l.slice(0,j),N=fb({breakAll:c,style:s,children:R+v}).wordsWithComputedWidth,k=h(N),B=k.length>o||g(k).width>Number(i);return[B,k]},b=0,x=l.length-1,w=0,O;b<=x&&w<=l.length-1;){var y=Math.floor((b+x)/2),m=y-1,_=p(m),S=mv(_,2),A=S[0],C=S[1],T=p(y),P=mv(T,1),M=P[0];if(!A&&!M&&(b=y+1),A&&M&&(x=y-1),!A&&M){O=C;break}w++}return O||d},xv=function(t){var r=J(t)?[]:t.toString().split(lb);return[{words:r}]},hS=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!Xi.isSsr){var s,c,f=fb({breakAll:o,children:i,style:a});if(f){var l=f.wordsWithComputedWidth,h=f.spaceWidth;s=l,c=h}else return xv(i);return fS({breakAll:o,children:i,maxLines:u,style:a},s,c,r,n)}return xv(i)},wv="#808080",qc=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,u=o===void 0?"1em":o,s=t.capHeight,c=s===void 0?"0.71em":s,f=t.scaleToFit,l=f===void 0?!1:f,h=t.textAnchor,d=h===void 0?"start":h,g=t.verticalAnchor,v=g===void 0?"end":g,p=t.fill,b=p===void 0?wv:p,x=gv(t,iS),w=q.useMemo(function(){return hS({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:l,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,l,x.style,x.width]),O=x.dx,y=x.dy,m=x.angle,_=x.className,S=x.breakAll,A=gv(x,aS);if(!be(n)||!be(a))return null;var C=n+(F(O)?O:0),T=a+(F(y)?y:0),P;switch(v){case"start":P=_s("calc(".concat(c,")"));break;case"middle":P=_s("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(c," / 2))"));break;default:P=_s("calc(".concat(w.length-1," * -").concat(u,")"));break}var M=[];if(l){var I=w[0].width,j=x.width;M.push("scale(".concat((F(j)?j/I:1)/I,")"))}return m&&M.push("rotate(".concat(m,", ").concat(C,", ").concat(T,")")),M.length&&(A.transform=M.join(" ")),E.createElement("text",Nc({},ce(A,!0),{x:C,y:T,className:se("recharts-text",_),textAnchor:d,fill:b.includes("url")?wv:b}),w.map(function(R,N){var k=R.words.join(S?"":" ");return E.createElement("tspan",{x:C,dy:N===0?P:u,key:"".concat(k,"-").concat(N)},k)}))};function bt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function pS(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Yl(e){let t,r,n;e.length!==2?(t=bt,r=(u,s)=>bt(e(u),s),n=(u,s)=>e(u)-s):(t=e===bt||e===pS?e:dS,r=e,n=e);function i(u,s,c=0,f=u.length){if(c>>1;r(u[l],s)<0?c=l+1:f=l}while(c>>1;r(u[l],s)<=0?c=l+1:f=l}while(cc&&n(u[l-1],s)>-n(u[l],s)?l-1:l}return{left:i,center:o,right:a}}function dS(){return 0}function hb(e){return e===null?NaN:+e}function*vS(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const yS=Yl(bt),An=yS.right;Yl(hb).center;class _v extends Map{constructor(t,r=bS){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Ov(this,t))}has(t){return super.has(Ov(this,t))}set(t,r){return super.set(gS(this,t),r)}delete(t){return super.delete(mS(this,t))}}function Ov({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function gS({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function mS({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function bS(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xS(e=bt){if(e===bt)return pb;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function pb(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const wS=Math.sqrt(50),_S=Math.sqrt(10),OS=Math.sqrt(2);function ri(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=wS?10:a>=_S?5:a>=OS?2:1;let u,s,c;return i<0?(c=Math.pow(10,-i)/o,u=Math.round(e*c),s=Math.round(t*c),u/ct&&--s,c=-c):(c=Math.pow(10,i)*o,u=Math.round(e/c),s=Math.round(t/c),u*ct&&--s),s0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,s=new Array(u);if(n)if(o<0)for(let c=0;c=n)&&(r=n);return r}function Av(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function db(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?pb:xS(i);n>r;){if(n-r>600){const s=n-r+1,c=t-r+1,f=Math.log(s),l=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*l*(s-l)/s)*(c-s/2<0?-1:1),d=Math.max(r,Math.floor(t-c*l/s+h)),g=Math.min(n,Math.floor(t+(s-c)*l/s+h));db(e,t,d,g,i)}const a=e[t];let o=r,u=n;for(Pr(e,r,t),i(e[n],a)>0&&Pr(e,r,n);o0;)--u}i(e[r],a)===0?Pr(e,r,u):(++u,Pr(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Pr(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function SS(e,t,r){if(e=Float64Array.from(vS(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Av(e);if(t>=1)return Sv(e);var n,i=(n-1)*t,a=Math.floor(i),o=Sv(db(e,a).subarray(0,a+1)),u=Av(e.subarray(a+1));return o+(u-o)*(i-a)}}function AS(e,t,r=hb){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function PS(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Nn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Nn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ES.exec(e))?new je(t[1],t[2],t[3],1):(t=MS.exec(e))?new je(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=jS.exec(e))?Nn(t[1],t[2],t[3],t[4]):(t=CS.exec(e))?Nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=IS.exec(e))?Iv(t[1],t[2]/100,t[3]/100,1):(t=$S.exec(e))?Iv(t[1],t[2]/100,t[3]/100,t[4]):Pv.hasOwnProperty(e)?Mv(Pv[e]):e==="transparent"?new je(NaN,NaN,NaN,0):null}function Mv(e){return new je(e>>16&255,e>>8&255,e&255,1)}function Nn(e,t,r,n){return n<=0&&(e=t=r=NaN),new je(e,t,r,n)}function NS(e){return e instanceof Pn||(e=Zr(e)),e?(e=e.rgb(),new je(e.r,e.g,e.b,e.opacity)):new je}function Uc(e,t,r,n){return arguments.length===1?NS(e):new je(e,t,r,n??1)}function je(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Jl(je,Uc,yb(Pn,{brighter(e){return e=e==null?ni:Math.pow(ni,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vr:Math.pow(Vr,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new je(Nt(this.r),Nt(this.g),Nt(this.b),ii(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:jv,formatHex:jv,formatHex8:qS,formatRgb:Cv,toString:Cv}));function jv(){return`#${$t(this.r)}${$t(this.g)}${$t(this.b)}`}function qS(){return`#${$t(this.r)}${$t(this.g)}${$t(this.b)}${$t((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cv(){const e=ii(this.opacity);return`${e===1?"rgb(":"rgba("}${Nt(this.r)}, ${Nt(this.g)}, ${Nt(this.b)}${e===1?")":`, ${e})`}`}function ii(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Nt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $t(e){return e=Nt(e),(e<16?"0":"")+e.toString(16)}function Iv(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new He(e,t,r,n)}function gb(e){if(e instanceof He)return new He(e.h,e.s,e.l,e.opacity);if(e instanceof Pn||(e=Zr(e)),!e)return new He;if(e instanceof He)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,s=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&s<1?0:o,new He(o,u,s,e.opacity)}function kS(e,t,r,n){return arguments.length===1?gb(e):new He(e,t,r,n??1)}function He(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Jl(He,kS,yb(Pn,{brighter(e){return e=e==null?ni:Math.pow(ni,e),new He(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vr:Math.pow(Vr,e),new He(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new je(Os(e>=240?e-240:e+120,i,n),Os(e,i,n),Os(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new He($v(this.h),qn(this.s),qn(this.l),ii(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ii(this.opacity);return`${e===1?"hsl(":"hsla("}${$v(this.h)}, ${qn(this.s)*100}%, ${qn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $v(e){return e=(e||0)%360,e<0?e+360:e}function qn(e){return Math.max(0,Math.min(1,e||0))}function Os(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Ql=e=>()=>e;function BS(e,t){return function(r){return e+r*t}}function LS(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function FS(e){return(e=+e)==1?mb:function(t,r){return r-t?LS(t,r,e):Ql(isNaN(t)?r:t)}}function mb(e,t){var r=t-e;return r?BS(e,r):Ql(isNaN(e)?t:e)}const Rv=(function e(t){var r=FS(t);function n(i,a){var o=r((i=Uc(i)).r,(a=Uc(a)).r),u=r(i.g,a.g),s=r(i.b,a.b),c=mb(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=s(f),i.opacity=c(f),i+""}}return n.gamma=e,n})(1);function US(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,s.push({i:o,x:ai(n,i)})),r=Ss.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function QS(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?eA:QS,s=c=null,l}function l(h){return h==null||isNaN(h=+h)?a:(s||(s=u(e.map(n),t,r)))(n(o(h)))}return l.invert=function(h){return o(i((c||(c=u(t,e.map(n),ai)))(h)))},l.domain=function(h){return arguments.length?(e=Array.from(h,oi),f()):e.slice()},l.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},l.rangeRound=function(h){return t=Array.from(h),r=ef,f()},l.clamp=function(h){return arguments.length?(o=h?!0:Te,f()):o!==Te},l.interpolate=function(h){return arguments.length?(r=h,f()):r},l.unknown=function(h){return arguments.length?(a=h,l):a},function(h,d){return n=h,i=d,f()}}function tf(){return Vi()(Te,Te)}function tA(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ui(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function or(e){return e=ui(Math.abs(e)),e?e[1]:NaN}function rA(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],s=0;i>0&&u>0&&(s+u+1>n&&(u=Math.max(1,n-s)),a.push(r.substring(i-=u,i+u)),!((s+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function nA(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var iA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jr(e){if(!(t=iA.exec(e)))throw new Error("invalid format: "+e);var t;return new rf({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Jr.prototype=rf.prototype;function rf(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}rf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function aA(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var si;function oA(e,t){var r=ui(e,t);if(!r)return si=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(si=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+ui(e,Math.max(0,t+a-1))[0]}function Nv(e,t){var r=ui(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const qv={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:tA,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Nv(e*100,t),r:Nv,s:oA,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kv(e){return e}var Bv=Array.prototype.map,Lv=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uA(e){var t=e.grouping===void 0||e.thousands===void 0?kv:rA(Bv.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?kv:nA(Bv.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",s=e.nan===void 0?"NaN":e.nan+"";function c(l,h){l=Jr(l);var d=l.fill,g=l.align,v=l.sign,p=l.symbol,b=l.zero,x=l.width,w=l.comma,O=l.precision,y=l.trim,m=l.type;m==="n"?(w=!0,m="g"):qv[m]||(O===void 0&&(O=12),y=!0,m="g"),(b||d==="0"&&g==="=")&&(b=!0,d="0",g="=");var _=(h&&h.prefix!==void 0?h.prefix:"")+(p==="$"?r:p==="#"&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),S=(p==="$"?n:/[%p]/.test(m)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),A=qv[m],C=/[defgprs%]/.test(m);O=O===void 0?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function T(P){var M=_,I=S,j,R,N;if(m==="c")I=A(P)+I,P="";else{P=+P;var k=P<0||1/P<0;if(P=isNaN(P)?s:A(Math.abs(P),O),y&&(P=aA(P)),k&&+P==0&&v!=="+"&&(k=!1),M=(k?v==="("?v:u:v==="-"||v==="("?"":v)+M,I=(m==="s"&&!isNaN(P)&&si!==void 0?Lv[8+si/3]:"")+I+(k&&v==="("?")":""),C){for(j=-1,R=P.length;++jN||N>57){I=(N===46?i+P.slice(j+1):P.slice(j))+I,P=P.slice(0,j);break}}}w&&!b&&(P=t(P,1/0));var B=M.length+P.length+I.length,H=B>1)+M+P+I+H.slice(B);break;default:P=H+M+P+I;break}return a(P)}return T.toString=function(){return l+""},T}function f(l,h){var d=Math.max(-8,Math.min(8,Math.floor(or(h)/3)))*3,g=Math.pow(10,-d),v=c((l=Jr(l),l.type="f",l),{suffix:Lv[8+d/3]});return function(p){return v(g*p)}}return{format:c,formatPrefix:f}}var kn,nf,bb;sA({thousands:",",grouping:[3],currency:["$",""]});function sA(e){return kn=uA(e),nf=kn.format,bb=kn.formatPrefix,kn}function cA(e){return Math.max(0,-or(Math.abs(e)))}function lA(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(or(t)/3)))*3-or(Math.abs(e)))}function fA(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,or(t)-or(e))+1}function xb(e,t,r,n){var i=Lc(e,t,r),a;switch(n=Jr(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=lA(i,o))&&(n.precision=a),bb(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=fA(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=cA(i))&&(n.precision=a-(n.type==="%")*2);break}}return nf(n)}function Ot(e){var t=e.domain;return e.ticks=function(r){var n=t();return kc(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return xb(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],s,c,f=10;for(u0;){if(c=Bc(o,u,r),c===s)return n[i]=o,n[a]=u,t(n);if(c>0)o=Math.floor(o/c)*c,u=Math.ceil(u/c)*c;else if(c<0)o=Math.ceil(o*c)/c,u=Math.floor(u*c)/c;else break;s=c}return e},e}function ci(){var e=tf();return e.copy=function(){return Tn(e,ci())},Fe.apply(e,arguments),Ot(e)}function wb(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,oi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return wb(e).unknown(t)},e=arguments.length?Array.from(e,oi):[0,1],Ot(r)}function _b(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function yA(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Wv(e){return(t,r)=>-e(-t,r)}function af(e){const t=e(Fv,Uv),r=t.domain;let n=10,i,a;function o(){return i=yA(n),a=vA(n),r()[0]<0?(i=Wv(i),a=Wv(a),e(hA,pA)):e(Fv,Uv),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const s=r();let c=s[0],f=s[s.length-1];const l=f0){for(;h<=d;++h)for(g=1;gf)break;b.push(v)}}else for(;h<=d;++h)for(g=n-1;g>=1;--g)if(v=h>0?g/a(-h):g*a(h),!(vf)break;b.push(v)}b.length*2{if(u==null&&(u=10),s==null&&(s=n===10?"s":","),typeof s!="function"&&(!(n%1)&&(s=Jr(s)).precision==null&&(s.trim=!0),s=nf(s)),u===1/0)return s;const c=Math.max(1,n*u/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*nr(_b(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function Ob(){const e=af(Vi()).domain([1,10]);return e.copy=()=>Tn(e,Ob()).base(e.base()),Fe.apply(e,arguments),e}function Hv(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zv(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function of(e){var t=1,r=e(Hv(t),zv(t));return r.constant=function(n){return arguments.length?e(Hv(t=+n),zv(t)):t},Ot(r)}function Sb(){var e=of(Vi());return e.copy=function(){return Tn(e,Sb()).constant(e.constant())},Fe.apply(e,arguments)}function Gv(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function gA(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function mA(e){return e<0?-e*e:e*e}function uf(e){var t=e(Te,Te),r=1;function n(){return r===1?e(Te,Te):r===.5?e(gA,mA):e(Gv(r),Gv(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Ot(t)}function sf(){var e=uf(Vi());return e.copy=function(){return Tn(e,sf()).exponent(e.exponent())},Fe.apply(e,arguments),e}function bA(){return sf.apply(null,arguments).exponent(.5)}function Kv(e){return Math.sign(e)*e*e}function xA(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Ab(){var e=tf(),t=[0,1],r=!1,n;function i(a){var o=xA(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Kv(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,oi)).map(Kv)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Ab(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Fe.apply(i,arguments),Ot(i)}function Pb(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(s){return arguments.length&&(a=s),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Tb().domain([e,t]).range(i).unknown(a)},Fe.apply(Ot(o),arguments)}function Eb(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[An(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Eb().domain(e).range(t).unknown(r)},Fe.apply(i,arguments)}const As=new Date,Ps=new Date;function xe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const s=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return s;let c;do s.push(c=new Date(+a)),t(a,u),e(a);while(cxe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(As.setTime(+a),Ps.setTime(+o),e(As),e(Ps),Math.floor(r(As,Ps))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const li=xe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);li.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?xe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):li);li.range;const at=1e3,Be=at*60,ot=Be*60,ct=ot*24,cf=ct*7,Xv=ct*30,Ts=ct*365,Rt=xe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*at)},(e,t)=>(t-e)/at,e=>e.getUTCSeconds());Rt.range;const lf=xe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*at)},(e,t)=>{e.setTime(+e+t*Be)},(e,t)=>(t-e)/Be,e=>e.getMinutes());lf.range;const ff=xe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Be)},(e,t)=>(t-e)/Be,e=>e.getUTCMinutes());ff.range;const hf=xe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*at-e.getMinutes()*Be)},(e,t)=>{e.setTime(+e+t*ot)},(e,t)=>(t-e)/ot,e=>e.getHours());hf.range;const pf=xe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ot)},(e,t)=>(t-e)/ot,e=>e.getUTCHours());pf.range;const En=xe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Be)/ct,e=>e.getDate()-1);En.range;const Yi=xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ct,e=>e.getUTCDate()-1);Yi.range;const Mb=xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ct,e=>Math.floor(e/ct));Mb.range;function Wt(e){return xe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Be)/cf)}const Zi=Wt(0),fi=Wt(1),wA=Wt(2),_A=Wt(3),ur=Wt(4),OA=Wt(5),SA=Wt(6);Zi.range;fi.range;wA.range;_A.range;ur.range;OA.range;SA.range;function Ht(e){return xe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/cf)}const Ji=Ht(0),hi=Ht(1),AA=Ht(2),PA=Ht(3),sr=Ht(4),TA=Ht(5),EA=Ht(6);Ji.range;hi.range;AA.range;PA.range;sr.range;TA.range;EA.range;const df=xe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());df.range;const vf=xe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());vf.range;const lt=xe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());lt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});lt.range;const ft=xe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ft.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ft.range;function jb(e,t,r,n,i,a){const o=[[Rt,1,at],[Rt,5,5*at],[Rt,15,15*at],[Rt,30,30*at],[a,1,Be],[a,5,5*Be],[a,15,15*Be],[a,30,30*Be],[i,1,ot],[i,3,3*ot],[i,6,6*ot],[i,12,12*ot],[n,1,ct],[n,2,2*ct],[r,1,cf],[t,1,Xv],[t,3,3*Xv],[e,1,Ts]];function u(c,f,l){const h=fp).right(o,h);if(d===o.length)return e.every(Lc(c/Ts,f/Ts,l));if(d===0)return li.every(Math.max(Lc(c,f,l),1));const[g,v]=o[h/o[d-1][2]53)return null;"w"in D||(D.w=1),"Z"in D?(Y=Ms(Tr(D.y,0,1)),ye=Y.getUTCDay(),Y=ye>4||ye===0?hi.ceil(Y):hi(Y),Y=Yi.offset(Y,(D.V-1)*7),D.y=Y.getUTCFullYear(),D.m=Y.getUTCMonth(),D.d=Y.getUTCDate()+(D.w+6)%7):(Y=Es(Tr(D.y,0,1)),ye=Y.getDay(),Y=ye>4||ye===0?fi.ceil(Y):fi(Y),Y=En.offset(Y,(D.V-1)*7),D.y=Y.getFullYear(),D.m=Y.getMonth(),D.d=Y.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),ye="Z"in D?Ms(Tr(D.y,0,1)).getUTCDay():Es(Tr(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(ye+5)%7:D.w+D.U*7-(ye+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ms(D)):Es(D)}}function S(L,X,V,D){for(var fe=0,Y=X.length,ye=V.length,ge,Me;fe=ye)return-1;if(ge=X.charCodeAt(fe++),ge===37){if(ge=X.charAt(fe++),Me=y[ge in Vv?X.charAt(fe++):ge],!Me||(D=Me(L,V,D))<0)return-1}else if(ge!=V.charCodeAt(D++))return-1}return D}function A(L,X,V){var D=c.exec(X.slice(V));return D?(L.p=f.get(D[0].toLowerCase()),V+D[0].length):-1}function C(L,X,V){var D=d.exec(X.slice(V));return D?(L.w=g.get(D[0].toLowerCase()),V+D[0].length):-1}function T(L,X,V){var D=l.exec(X.slice(V));return D?(L.w=h.get(D[0].toLowerCase()),V+D[0].length):-1}function P(L,X,V){var D=b.exec(X.slice(V));return D?(L.m=x.get(D[0].toLowerCase()),V+D[0].length):-1}function M(L,X,V){var D=v.exec(X.slice(V));return D?(L.m=p.get(D[0].toLowerCase()),V+D[0].length):-1}function I(L,X,V){return S(L,t,X,V)}function j(L,X,V){return S(L,r,X,V)}function R(L,X,V){return S(L,n,X,V)}function N(L){return o[L.getDay()]}function k(L){return a[L.getDay()]}function B(L){return s[L.getMonth()]}function H(L){return u[L.getMonth()]}function G(L){return i[+(L.getHours()>=12)]}function U(L){return 1+~~(L.getMonth()/3)}function K(L){return o[L.getUTCDay()]}function oe(L){return a[L.getUTCDay()]}function pe(L){return s[L.getUTCMonth()]}function Ie(L){return u[L.getUTCMonth()]}function Pt(L){return i[+(L.getUTCHours()>=12)]}function Ee(L){return 1+~~(L.getUTCMonth()/3)}return{format:function(L){var X=m(L+="",w);return X.toString=function(){return L},X},parse:function(L){var X=_(L+="",!1);return X.toString=function(){return L},X},utcFormat:function(L){var X=m(L+="",O);return X.toString=function(){return L},X},utcParse:function(L){var X=_(L+="",!0);return X.toString=function(){return L},X}}}var Vv={"-":"",_:" ",0:"0"},_e=/^\s*\d+/,RA=/^%/,DA=/[\\^$*+?|[\]().{}]/g;function Q(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function qA(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function kA(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function BA(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function LA(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function FA(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Yv(e,t,r){var n=_e.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Zv(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function UA(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function WA(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function HA(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Jv(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function zA(e,t,r){var n=_e.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Qv(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function GA(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function KA(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function XA(e,t,r){var n=_e.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function VA(e,t,r){var n=_e.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function YA(e,t,r){var n=RA.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function ZA(e,t,r){var n=_e.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function JA(e,t,r){var n=_e.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function ey(e,t){return Q(e.getDate(),t,2)}function QA(e,t){return Q(e.getHours(),t,2)}function eP(e,t){return Q(e.getHours()%12||12,t,2)}function tP(e,t){return Q(1+En.count(lt(e),e),t,3)}function Cb(e,t){return Q(e.getMilliseconds(),t,3)}function rP(e,t){return Cb(e,t)+"000"}function nP(e,t){return Q(e.getMonth()+1,t,2)}function iP(e,t){return Q(e.getMinutes(),t,2)}function aP(e,t){return Q(e.getSeconds(),t,2)}function oP(e){var t=e.getDay();return t===0?7:t}function uP(e,t){return Q(Zi.count(lt(e)-1,e),t,2)}function Ib(e){var t=e.getDay();return t>=4||t===0?ur(e):ur.ceil(e)}function sP(e,t){return e=Ib(e),Q(ur.count(lt(e),e)+(lt(e).getDay()===4),t,2)}function cP(e){return e.getDay()}function lP(e,t){return Q(fi.count(lt(e)-1,e),t,2)}function fP(e,t){return Q(e.getFullYear()%100,t,2)}function hP(e,t){return e=Ib(e),Q(e.getFullYear()%100,t,2)}function pP(e,t){return Q(e.getFullYear()%1e4,t,4)}function dP(e,t){var r=e.getDay();return e=r>=4||r===0?ur(e):ur.ceil(e),Q(e.getFullYear()%1e4,t,4)}function vP(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Q(t/60|0,"0",2)+Q(t%60,"0",2)}function ty(e,t){return Q(e.getUTCDate(),t,2)}function yP(e,t){return Q(e.getUTCHours(),t,2)}function gP(e,t){return Q(e.getUTCHours()%12||12,t,2)}function mP(e,t){return Q(1+Yi.count(ft(e),e),t,3)}function $b(e,t){return Q(e.getUTCMilliseconds(),t,3)}function bP(e,t){return $b(e,t)+"000"}function xP(e,t){return Q(e.getUTCMonth()+1,t,2)}function wP(e,t){return Q(e.getUTCMinutes(),t,2)}function _P(e,t){return Q(e.getUTCSeconds(),t,2)}function OP(e){var t=e.getUTCDay();return t===0?7:t}function SP(e,t){return Q(Ji.count(ft(e)-1,e),t,2)}function Rb(e){var t=e.getUTCDay();return t>=4||t===0?sr(e):sr.ceil(e)}function AP(e,t){return e=Rb(e),Q(sr.count(ft(e),e)+(ft(e).getUTCDay()===4),t,2)}function PP(e){return e.getUTCDay()}function TP(e,t){return Q(hi.count(ft(e)-1,e),t,2)}function EP(e,t){return Q(e.getUTCFullYear()%100,t,2)}function MP(e,t){return e=Rb(e),Q(e.getUTCFullYear()%100,t,2)}function jP(e,t){return Q(e.getUTCFullYear()%1e4,t,4)}function CP(e,t){var r=e.getUTCDay();return e=r>=4||r===0?sr(e):sr.ceil(e),Q(e.getUTCFullYear()%1e4,t,4)}function IP(){return"+0000"}function ry(){return"%"}function ny(e){return+e}function iy(e){return Math.floor(+e/1e3)}var Vt,Db,Nb;$P({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function $P(e){return Vt=$A(e),Db=Vt.format,Vt.parse,Nb=Vt.utcFormat,Vt.utcParse,Vt}function RP(e){return new Date(e)}function DP(e){return e instanceof Date?+e:+new Date(+e)}function yf(e,t,r,n,i,a,o,u,s,c){var f=tf(),l=f.invert,h=f.domain,d=c(".%L"),g=c(":%S"),v=c("%I:%M"),p=c("%I %p"),b=c("%a %d"),x=c("%b %d"),w=c("%B"),O=c("%Y");function y(m){return(s(m)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>SS(e,a/n))},r.copy=function(){return Lb(t).domain(e)},dt.apply(r,arguments)}function ea(){var e=0,t=.5,r=1,n=1,i,a,o,u,s,c=Te,f,l=!1,h;function d(v){return isNaN(v=+v)?h:(v=.5+((v=+f(v))-a)*(n*vr}return Cs=e,Cs}var Is,sy;function FP(){if(sy)return Is;sy=1;var e=Hb(),t=LP(),r=wr();function n(i){return i&&i.length?e(i,r,t):void 0}return Is=n,Is}var UP=FP();const ta=ae(UP);var $s,cy;function WP(){if(cy)return $s;cy=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};W.decimalPlaces=W.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ue;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};W.dividedBy=W.div=function(e){return st(this,new this.constructor(e))};W.dividedToIntegerBy=W.idiv=function(e){var t=this,r=t.constructor;return ne(st(t,new r(e),0,1),r.precision)};W.equals=W.eq=function(e){return!this.cmp(e)};W.exponent=function(){return ve(this)};W.greaterThan=W.gt=function(e){return this.cmp(e)>0};W.greaterThanOrEqualTo=W.gte=function(e){return this.cmp(e)>=0};W.isInteger=W.isint=function(){return this.e>this.d.length-2};W.isNegative=W.isneg=function(){return this.s<0};W.isPositive=W.ispos=function(){return this.s>0};W.isZero=function(){return this.s===0};W.lessThan=W.lt=function(e){return this.cmp(e)<0};W.lessThanOrEqualTo=W.lte=function(e){return this.cmp(e)<1};W.logarithm=W.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(De))throw Error(Le+"NaN");if(r.s<1)throw Error(Le+(r.s?"NaN":"-Infinity"));return r.eq(De)?new n(0):(le=!1,t=st(Qr(r,a),Qr(e,a),a),le=!0,ne(t,i))};W.minus=W.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Xb(t,e):Gb(t,(e.s=-e.s,e))};W.modulo=W.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Le+"NaN");return r.s?(le=!1,t=st(r,e,0,1).times(e),le=!0,r.minus(t)):ne(new n(r),i)};W.naturalExponential=W.exp=function(){return Kb(this)};W.naturalLogarithm=W.ln=function(){return Qr(this)};W.negated=W.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};W.plus=W.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Gb(t,e):Xb(t,(e.s=-e.s,e))};W.precision=W.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qt+e);if(t=ve(i)+1,n=i.d.length-1,r=n*ue+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};W.squareRoot=W.sqrt=function(){var e,t,r,n,i,a,o,u=this,s=u.constructor;if(u.s<1){if(!u.s)return new s(0);throw Error(Le+"NaN")}for(e=ve(u),le=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Ve(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Sr((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new s(t)):n=new s(i.toString()),r=s.precision,i=o=r+3;;)if(a=n,n=a.plus(st(u,a,o+2)).times(.5),Ve(a.d).slice(0,o)===(t=Ve(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ne(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return le=!0,ne(n,r)};W.times=W.mul=function(e){var t,r,n,i,a,o,u,s,c,f=this,l=f.constructor,h=f.d,d=(e=new l(e)).d;if(!f.s||!e.s)return new l(0);for(e.s*=f.s,r=f.e+e.e,s=h.length,c=d.length,s=0;){for(t=0,i=s+n;i>n;)u=a[i]+d[n]*h[i-n-1]+t,a[i--]=u%we|0,t=u/we|0;a[i]=(a[i]+t)%we|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,le?ne(e,l.precision):e};W.toDecimalPlaces=W.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Qe(e,0,Or),t===void 0?t=n.rounding:Qe(t,0,8),ne(r,e+ve(r)+1,t))};W.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Lt(n,!0):(Qe(e,0,Or),t===void 0?t=i.rounding:Qe(t,0,8),n=ne(new i(n),e+1,t),r=Lt(n,!0,e+1)),r};W.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Lt(i):(Qe(e,0,Or),t===void 0?t=a.rounding:Qe(t,0,8),n=ne(new a(i),e+ve(i)+1,t),r=Lt(n.abs(),!1,e+ve(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};W.toInteger=W.toint=function(){var e=this,t=e.constructor;return ne(new t(e),ve(e)+1,t.rounding)};W.toNumber=function(){return+this};W.toPower=W.pow=function(e){var t,r,n,i,a,o,u=this,s=u.constructor,c=12,f=+(e=new s(e));if(!e.s)return new s(De);if(u=new s(u),!u.s){if(e.s<1)throw Error(Le+"Infinity");return u}if(u.eq(De))return u;if(n=s.precision,e.eq(De))return ne(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=f<0?-f:f)<=zb){for(i=new s(De),t=Math.ceil(n/ue+4),le=!1;r%2&&(i=i.times(u),vy(i.d,t)),r=Sr(r/2),r!==0;)u=u.times(u),vy(u.d,t);return le=!0,e.s<0?new s(De).div(i):ne(i,n)}}else if(a<0)throw Error(Le+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,le=!1,i=e.times(Qr(u,n+c)),le=!0,i=Kb(i),i.s=a,i};W.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=ve(i),n=Lt(i,r<=a.toExpNeg||r>=a.toExpPos)):(Qe(e,1,Or),t===void 0?t=a.rounding:Qe(t,0,8),i=ne(new a(i),e,t),r=ve(i),n=Lt(i,e<=r||r<=a.toExpNeg,e)),n};W.toSignificantDigits=W.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Qe(e,1,Or),t===void 0?t=n.rounding:Qe(t,0,8)),ne(new n(r),e,t)};W.toString=W.valueOf=W.val=W.toJSON=W[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ve(e),r=e.constructor;return Lt(e,t<=r.toExpNeg||t>=r.toExpPos)};function Gb(e,t){var r,n,i,a,o,u,s,c,f=e.constructor,l=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),le?ne(t,l):t;if(s=e.d,c=t.d,o=e.e,i=t.e,s=s.slice(),a=o-i,a){for(a<0?(n=s,a=-a,u=c.length):(n=c,i=o,u=s.length),o=Math.ceil(l/ue),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=s.length,a=c.length,u-a<0&&(a=u,n=c,c=s,s=n),r=0;a;)r=(s[--a]=s[a]+c[a]+r)/we|0,s[a]%=we;for(r&&(s.unshift(r),++i),u=s.length;s[--u]==0;)s.pop();return t.d=s,t.e=i,le?ne(t,l):t}function Qe(e,t,r){if(e!==~~e||er)throw Error(qt+e)}function Ve(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=s=0;ui[u]?1:-1;break}return s}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,s,c,f,l,h,d,g,v,p,b,x,w,O,y,m,_,S,A=n.constructor,C=n.s==i.s?1:-1,T=n.d,P=i.d;if(!n.s)return new A(n);if(!i.s)throw Error(Le+"Division by zero");for(s=n.e-i.e,_=P.length,y=T.length,d=new A(C),g=d.d=[],c=0;P[c]==(T[c]||0);)++c;if(P[c]>(T[c]||0)&&--s,a==null?x=a=A.precision:o?x=a+(ve(n)-ve(i))+1:x=a,x<0)return new A(0);if(x=x/ue+2|0,c=0,_==1)for(f=0,P=P[0],x++;(c1&&(P=e(P,f),T=e(T,f),_=P.length,y=T.length),O=_,v=T.slice(0,_),p=v.length;p<_;)v[p++]=0;S=P.slice(),S.unshift(0),m=P[0],P[1]>=we/2&&++m;do f=0,u=t(P,v,_,p),u<0?(b=v[0],_!=p&&(b=b*we+(v[1]||0)),f=b/m|0,f>1?(f>=we&&(f=we-1),l=e(P,f),h=l.length,p=v.length,u=t(l,v,h,p),u==1&&(f--,r(l,_16)throw Error(xf+ve(e));if(!e.s)return new f(De);for(le=!1,u=l,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),c+=5;for(n=Math.log(Ct(2,c))/Math.LN10*2+5|0,u+=n,r=i=a=new f(De),f.precision=u;;){if(i=ne(i.times(e),u),r=r.times(++s),o=a.plus(st(i,r,u)),Ve(o.d).slice(0,u)===Ve(a.d).slice(0,u)){for(;c--;)a=ne(a.times(a),u);return f.precision=l,t==null?(le=!0,ne(a,l)):a}a=o}}function ve(e){for(var t=e.e*ue,r=e.d[0];r>=10;r/=10)t++;return t}function ks(e,t,r){if(t>e.LN10.sd())throw le=!0,r&&(e.precision=r),Error(Le+"LN10 precision limit exceeded");return ne(new e(e.LN10),t)}function yt(e){for(var t="";e--;)t+="0";return t}function Qr(e,t){var r,n,i,a,o,u,s,c,f,l=1,h=10,d=e,g=d.d,v=d.constructor,p=v.precision;if(d.s<1)throw Error(Le+(d.s?"NaN":"-Infinity"));if(d.eq(De))return new v(0);if(t==null?(le=!1,c=p):c=t,d.eq(10))return t==null&&(le=!0),ks(v,c);if(c+=h,v.precision=c,r=Ve(g),n=r.charAt(0),a=ve(d),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)d=d.times(e),r=Ve(d.d),n=r.charAt(0),l++;a=ve(d),n>1?(d=new v("0."+r),a++):d=new v(n+"."+r.slice(1))}else return s=ks(v,c+2,p).times(a+""),d=Qr(new v(n+"."+r.slice(1)),c-h).plus(s),v.precision=p,t==null?(le=!0,ne(d,p)):d;for(u=o=d=st(d.minus(De),d.plus(De),c),f=ne(d.times(d),c),i=3;;){if(o=ne(o.times(f),c),s=u.plus(st(o,new v(i),c)),Ve(s.d).slice(0,c)===Ve(u.d).slice(0,c))return u=u.times(2),a!==0&&(u=u.plus(ks(v,c+2,p).times(a+""))),u=st(u,new v(l),c),v.precision=p,t==null?(le=!0,ne(u,p)):u;u=s,i+=2}}function dy(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Sr(r/ue),e.d=[],n=(r+1)%ue,r<0&&(n+=ue),npi||e.e<-pi))throw Error(xf+r)}else e.s=0,e.e=0,e.d=[0];return e}function ne(e,t,r){var n,i,a,o,u,s,c,f,l=e.d;for(o=1,a=l[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=ue,i=t,c=l[f=0];else{if(f=Math.ceil((n+1)/ue),a=l.length,f>=a)return e;for(c=a=l[f],o=1;a>=10;a/=10)o++;n%=ue,i=n-ue+o}if(r!==void 0&&(a=Ct(10,o-i-1),u=c/a%10|0,s=t<0||l[f+1]!==void 0||c%a,s=r<4?(u||s)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||s||r==6&&(n>0?i>0?c/Ct(10,o-i):0:l[f-1])%10&1||r==(e.s<0?8:7))),t<1||!l[0])return s?(a=ve(e),l.length=1,t=t-a-1,l[0]=Ct(10,(ue-t%ue)%ue),e.e=Sr(-t/ue)||0):(l.length=1,l[0]=e.e=e.s=0),e;if(n==0?(l.length=f,a=1,f--):(l.length=f+1,a=Ct(10,ue-n),l[f]=i>0?(c/Ct(10,o-i)%Ct(10,i)|0)*a:0),s)for(;;)if(f==0){(l[0]+=a)==we&&(l[0]=1,++e.e);break}else{if(l[f]+=a,l[f]!=we)break;l[f--]=0,a=1}for(n=l.length;l[--n]===0;)l.pop();if(le&&(e.e>pi||e.e<-pi))throw Error(xf+ve(e));return e}function Xb(e,t){var r,n,i,a,o,u,s,c,f,l,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),le?ne(t,d):t;if(s=e.d,l=t.d,n=t.e,c=e.e,s=s.slice(),o=c-n,o){for(f=o<0,f?(r=s,o=-o,u=l.length):(r=l,n=c,u=s.length),i=Math.max(Math.ceil(d/ue),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=s.length,u=l.length,f=i0;--i)s[u++]=0;for(i=l.length;i>o;){if(s[--i]0?a=a.charAt(0)+"."+a.slice(1)+yt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+yt(-i-1)+a,r&&(n=r-o)>0&&(a+=yt(n))):i>=o?(a+=yt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+yt(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=yt(n))),e.s<0?"-"+a:a}function vy(e,t){if(e.length>t)return e.length=t,!0}function Vb(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(qt+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return dy(o,a.toString())}else if(typeof a!="string")throw Error(qt+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,QP.test(a))dy(o,a);else throw Error(qt+a)}if(i.prototype=W,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Vb,i.config=i.set=eT,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(qt+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(qt+r+": "+n);return this}var wf=Vb(JP);De=new wf(1);const re=wf;function tT(e){return aT(e)||iT(e)||nT(e)||rT()}function rT(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nT(e,t){if(e){if(typeof e=="string")return zc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zc(e,t)}}function iT(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function aT(e){if(Array.isArray(e))return zc(e)}function zc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,yy(function(){for(var u=arguments.length,s=new Array(u),c=0;ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(s){i=!0,a=s}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function xT(e){if(Array.isArray(e))return e}function e0(e){var t=en(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function t0(e,t,r){if(e.lte(0))return new re(0);var n=ia.getDigitCount(e.toNumber()),i=new re(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new re(Math.ceil(a.div(o).toNumber())).add(r).mul(o),s=u.mul(i);return t?s:new re(Math.ceil(s))}function wT(e,t,r){var n=1,i=new re(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new re(10).pow(ia.getDigitCount(e)-1),i=new re(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new re(Math.floor(e)))}else e===0?i=new re(Math.floor((t-1)/2)):r||(i=new re(Math.floor(e)));var o=Math.floor((t-1)/2),u=cT(sT(function(s){return i.add(new re(s-o).mul(n)).toNumber()}),Gc);return u(0,t)}function r0(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new re(0),tickMin:new re(0),tickMax:new re(0)};var a=t0(new re(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new re(0):(o=new re(e).add(t).div(2),o=o.sub(new re(o).mod(a)));var u=Math.ceil(o.sub(e).div(a).toNumber()),s=Math.ceil(new re(t).sub(o).div(a).toNumber()),c=u+s+1;return c>r?r0(e,t,r,n,i+1):(c0?s+(r-c):s,u=t>0?u:u+(r-c)),{step:a,tickMin:o.sub(new re(u).mul(a)),tickMax:o.add(new re(s).mul(a))})}function _T(e){var t=en(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),u=e0([r,n]),s=en(u,2),c=s[0],f=s[1];if(c===-1/0||f===1/0){var l=f===1/0?[c].concat(Xc(Gc(0,i-1).map(function(){return 1/0}))):[].concat(Xc(Gc(0,i-1).map(function(){return-1/0})),[f]);return r>n?Kc(l):l}if(c===f)return wT(c,i,a);var h=r0(c,f,o,a),d=h.step,g=h.tickMin,v=h.tickMax,p=ia.rangeStep(g,v.add(new re(.1).mul(d)),d);return r>n?Kc(p):p}function OT(e,t){var r=en(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=e0([n,i]),u=en(o,2),s=u[0],c=u[1];if(s===-1/0||c===1/0)return[n,i];if(s===c)return[s];var f=Math.max(t,2),l=t0(new re(c).sub(s).div(f-1),a,0),h=[].concat(Xc(ia.rangeStep(new re(s),new re(c).sub(new re(.99).mul(l)),l)),[c]);return n>i?Kc(h):h}var ST=Jb(_T),AT=Jb(OT),PT="Invariant failed";function Ft(e,t){throw new Error(PT)}var TT=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function cr(e){"@babel/helpers - typeof";return cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(e)}function di(){return di=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function RT(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function DT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NT(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var s=a.range,c=0;c0?i[c-1].coordinate:i[u-1].coordinate,l=i[c].coordinate,h=c>=u-1?i[0].coordinate:i[c+1].coordinate,d=void 0;if(Xe(l-f)!==Xe(h-l)){var g=[];if(Xe(h-l)===Xe(s[1]-s[0])){d=h;var v=l+s[1]-s[0];g[0]=Math.min(v,(v+f)/2),g[1]=Math.max(v,(v+f)/2)}else{d=f;var p=h+s[1]-s[0];g[0]=Math.min(l,(p+l)/2),g[1]=Math.max(l,(p+l)/2)}var b=[Math.min(l,(d+l)/2),Math.max(l,(d+l)/2)];if(t>b[0]&&t<=b[1]||t>=g[0]&&t<=g[1]){o=i[c].index;break}}else{var x=Math.min(f,h),w=Math.max(f,h);if(t>(x+l)/2&&t<=(w+l)/2){o=i[c].index;break}}}else for(var O=0;O0&&O(n[O].coordinate+n[O-1].coordinate)/2&&t<=(n[O].coordinate+n[O+1].coordinate)/2||O===u-1&&t>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},_f=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?he(he({},t.type.defaultProps),t.props):t.props,o=a.stroke,u=a.fill,s;switch(i){case"Line":s=o;break;case"Area":case"Radar":s=o&&o!=="none"?o:u;break;default:s=u;break}return s},QT=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},u=Object.keys(a),s=0,c=u.length;s=0});if(b&&b.length){var x=b[0].type.defaultProps,w=x!==void 0?he(he({},x),b[0].props):b[0].props,O=w.barSize,y=w[p];o[y]||(o[y]=[]);var m=J(O)?r:O;o[y].push({item:b[0],stackList:b.slice(1),barSize:J(m)?void 0:ze(m,n,0)})}}return o},eE=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,u=t.maxBarSize,s=o.length;if(s<1)return null;var c=ze(r,i,0,!0),f,l=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/s,g=o.reduce(function(O,y){return O+y.barSize||0},0);g+=(s-1)*c,g>=i&&(g-=(s-1)*c,c=0),g>=i&&d>0&&(h=!0,d*=.9,g=s*d);var v=(i-g)/2>>0,p={offset:v-c,size:0};f=o.reduce(function(O,y){var m={item:y.item,position:{offset:p.offset+p.size+c,size:h?d:y.barSize}},_=[].concat(by(O),[m]);return p=_[_.length-1].position,y.stackList&&y.stackList.length&&y.stackList.forEach(function(S){_.push({item:S,position:p})}),_},l)}else{var b=ze(n,i,0,!0);i-2*b-(s-1)*c<=0&&(c=0);var x=(i-2*b-(s-1)*c)/s;x>1&&(x>>=0);var w=u===+u?Math.min(x,u):x;f=o.reduce(function(O,y,m){var _=[].concat(by(O),[{item:y.item,position:{offset:b+(x+c)*m+(x-w)/2,size:w}}]);return y.stackList&&y.stackList.length&&y.stackList.forEach(function(S){_.push({item:S,position:_[_.length-1].position})}),_},l)}return f},tE=function(t,r,n,i){var a=n.children,o=n.width,u=n.margin,s=o-(u.left||0)-(u.right||0),c=o0({children:a,legendWidth:s});if(c){var f=i||{},l=f.width,h=f.height,d=c.align,g=c.verticalAlign,v=c.layout;if((v==="vertical"||v==="horizontal"&&g==="middle")&&d!=="center"&&F(t[d]))return he(he({},t),{},er({},d,t[d]+(l||0)));if((v==="horizontal"||v==="vertical"&&d==="center")&&g!=="middle"&&F(t[g]))return he(he({},t),{},er({},g,t[g]+(h||0)))}return t},rE=function(t,r,n){return J(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},u0=function(t,r,n,i,a){var o=r.props.children,u=Ge(o,aa).filter(function(c){return rE(i,a,c.props.direction)});if(u&&u.length){var s=u.map(function(c){return c.props.dataKey});return t.reduce(function(c,f){var l=et(f,n);if(J(l))return c;var h=Array.isArray(l)?[ra(l),ta(l)]:[l,l],d=s.reduce(function(g,v){var p=et(f,v,0),b=h[0]-Math.abs(Array.isArray(p)?p[0]:p),x=h[1]+Math.abs(Array.isArray(p)?p[1]:p);return[Math.min(b,g[0]),Math.max(x,g[1])]},[1/0,-1/0]);return[Math.min(d[0],c[0]),Math.max(d[1],c[1])]},[1/0,-1/0])}return null},nE=function(t,r,n,i,a){var o=r.map(function(u){return u0(t,u,n,a,i)}).filter(function(u){return!J(u)});return o&&o.length?o.reduce(function(u,s){return[Math.min(u[0],s[0]),Math.max(u[1],s[1])]},[1/0,-1/0]):null},s0=function(t,r,n,i,a){var o=r.map(function(s){var c=s.props.dataKey;return n==="number"&&c&&u0(t,s,c,i)||Br(t,c,n,a)});if(n==="number")return o.reduce(function(s,c){return[Math.min(s[0],c[0]),Math.max(s[1],c[1])]},[1/0,-1/0]);var u={};return o.reduce(function(s,c){for(var f=0,l=c.length;f=2?Xe(u[0]-u[1])*2*c:c,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(l){var h=a?a.indexOf(l):l;return{coordinate:i(h)+c,value:l,offset:c}});return f.filter(function(l){return!On(l.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(l,h){return{coordinate:i(l)+c,value:l,index:h,offset:c}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(l){return{coordinate:i(l)+c,value:l,offset:c}}):i.domain().map(function(l,h){return{coordinate:i(l)+c,value:a?a[l]:l,index:h,offset:c}})},Bs=new WeakMap,Bn=function(t,r){if(typeof r!="function")return t;Bs.has(t)||Bs.set(t,new WeakMap);var n=Bs.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},l0=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,u=t.axisType;if(i==="auto")return o==="radial"&&u==="radiusAxis"?{scale:Xr(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:ci(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:kr(),realScaleType:"point"}:a==="category"?{scale:Xr(),realScaleType:"band"}:{scale:ci(),realScaleType:"linear"};if(Bt(i)){var s="scale".concat(Fi(i));return{scale:(ay[s]||kr)(),realScaleType:ay[s]?s:"point"}}return Z(i)?{scale:i}:{scale:kr(),realScaleType:"point"}},wy=1e-4,f0=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-wy,o=Math.max(i[0],i[1])+wy,u=t(r[0]),s=t(r[n-1]);(uo||so)&&t.domain([r[0],r[n-1]])}},iE=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[u][n][0]=a,t[u][n][1]=a+s,a=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+s,o=t[u][n][1])}},uE=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+u,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},sE={sign:oE,expand:Kw,none:tr,silhouette:Xw,wiggle:Vw,positive:uE},cE=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),a=sE[n],o=Gw().keys(i).value(function(u,s){return+et(u,s,0)}).order(Pc).offset(a);return o(t)},lE=function(t,r,n,i,a,o){if(!t)return null;var u=o?r.reverse():r,s={},c=u.reduce(function(l,h){var d,g=(d=h.type)!==null&&d!==void 0&&d.defaultProps?he(he({},h.type.defaultProps),h.props):h.props,v=g.stackId,p=g.hide;if(p)return l;var b=g[n],x=l[b]||{hasStack:!1,stackGroups:{}};if(be(v)){var w=x.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[v]=w}else x.stackGroups[Li("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return he(he({},l),{},er({},b,x))},s),f={};return Object.keys(c).reduce(function(l,h){var d=c[h];if(d.hasStack){var g={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(v,p){var b=d.stackGroups[p];return he(he({},v),{},er({},p,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:cE(t,b.items,a)}))},g)}return he(he({},l),{},er({},h,d))},f)},h0=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,u=r.allowDecimals,s=n||r.scale;if(s!=="auto"&&s!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var c=t.domain();if(!c.length)return null;var f=ST(c,a,u);return t.domain([ra(f),ta(f)]),{niceTicks:f}}if(a&&i==="number"){var l=t.domain(),h=AT(l,a,u);return{niceTicks:h}}return null},_y=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var s=et(o,r.dataKey,r.domain[u]);return J(s)?null:r.scale(s)-a/2+i},fE=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},hE=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?he(he({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(be(a)){var o=r[a];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},pE=function(t){return t.reduce(function(r,n){return[ra(n.concat([r[0]]).filter(F)),ta(n.concat([r[1]]).filter(F))]},[1/0,-1/0])},p0=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],u=o.stackedData,s=u.reduce(function(c,f){var l=pE(f.slice(r,n+1));return[Math.min(c[0],l[0]),Math.max(c[1],l[1])]},[1/0,-1/0]);return[Math.min(s[0],i[0]),Math.max(s[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Oy=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Sy=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Jc=function(t,r,n){if(Z(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(F(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(Oy.test(t[0])){var a=+Oy.exec(t[0])[1];i[0]=r[0]-a}else Z(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(F(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(Sy.test(t[1])){var o=+Sy.exec(t[1])[1];i[1]=r[1]+o}else Z(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},yi=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Xl(r,function(l){return l.coordinate}),o=1/0,u=1,s=a.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},WR=function(t,r,n,i,a){var o=t.width,u=t.height,s=t.startAngle,c=t.endAngle,f=ze(t.cx,o,o/2),l=ze(t.cy,u,u/2),h=_E(o,u,n),d=ze(t.innerRadius,h,0),g=ze(t.outerRadius,h,h*.8),v=Object.keys(r);return v.reduce(function(p,b){var x=r[b],w=x.domain,O=x.reversed,y;if(J(x.range))i==="angleAxis"?y=[s,c]:i==="radiusAxis"&&(y=[d,g]),O&&(y=[y[1],y[0]]);else{y=x.range;var m=y,_=yE(m,2);s=_[0],c=_[1]}var S=l0(x,a),A=S.realScaleType,C=S.scale;C.domain(w).range(y),f0(C);var T=h0(C,it(it({},x),{},{realScaleType:A})),P=it(it(it({},x),T),{},{range:y,radius:g,realScaleType:A,scale:C,cx:f,cy:l,innerRadius:d,outerRadius:g,startAngle:s,endAngle:c});return it(it({},p),{},v0({},b,P))},{})},OE=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},SE=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,u=OE({x:n,y:i},{x:a,y:o});if(u<=0)return{radius:u};var s=(n-a)/u,c=Math.acos(s);return i>o&&(c=2*Math.PI-c),{radius:u,angle:wE(c),angleInRadian:c}},AE=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},PE=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),u=Math.min(a,o);return t+u*360},Ey=function(t,r){var n=t.x,i=t.y,a=SE({x:n,y:i},r),o=a.radius,u=a.angle,s=r.innerRadius,c=r.outerRadius;if(oc)return!1;if(o===0)return!0;var f=AE(r),l=f.startAngle,h=f.endAngle,d=u,g;if(l<=h){for(;d>h;)d-=360;for(;d=l&&d<=h}else{for(;d>l;)d-=360;for(;d=h&&d<=l}return g?it(it({},r),{},{radius:o,angle:PE(d,r)}):null},HR=function(t){return!q.isValidElement(t)&&!Z(t)&&typeof t!="boolean"?t.className:""};function an(e){"@babel/helpers - typeof";return an=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},an(e)}var TE=["offset"];function EE(e){return IE(e)||CE(e)||jE(e)||ME()}function ME(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jE(e,t){if(e){if(typeof e=="string")return Qc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qc(e,t)}}function CE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IE(e){if(Array.isArray(e))return Qc(e)}function Qc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function RE(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function My(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function me(e){for(var t=1;t=0?1:-1,w,O;i==="insideStart"?(w=d+x*o,O=v):i==="insideEnd"?(w=g-x*o,O=!v):i==="end"&&(w=g+x*o,O=v),O=b<=0?O:!O;var y=Se(c,f,p,w),m=Se(c,f,p,w+(O?1:-1)*359),_="M".concat(y.x,",").concat(y.y,` - A`).concat(p,",").concat(p,",0,1,").concat(O?0:1,`, - `).concat(m.x,",").concat(m.y),S=J(t.id)?Li("recharts-radial-line-"):t.id;return E.createElement("text",on({},n,{dominantBaseline:"central",className:se("recharts-radial-bar-label",u)}),E.createElement("defs",null,E.createElement("path",{id:S,d:_})),E.createElement("textPath",{xlinkHref:"#".concat(S)},r))},FE=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,u=a.cy,s=a.innerRadius,c=a.outerRadius,f=a.startAngle,l=a.endAngle,h=(f+l)/2;if(i==="outside"){var d=Se(o,u,c+n,h),g=d.x,v=d.y;return{x:g,y:v,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var p=(s+c)/2,b=Se(o,u,p,h),x=b.x,w=b.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},UE=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,u=o.x,s=o.y,c=o.width,f=o.height,l=f>=0?1:-1,h=l*i,d=l>0?"end":"start",g=l>0?"start":"end",v=c>=0?1:-1,p=v*i,b=v>0?"end":"start",x=v>0?"start":"end";if(a==="top"){var w={x:u+c/2,y:s-l*i,textAnchor:"middle",verticalAnchor:d};return me(me({},w),n?{height:Math.max(s-n.y,0),width:c}:{})}if(a==="bottom"){var O={x:u+c/2,y:s+f+h,textAnchor:"middle",verticalAnchor:g};return me(me({},O),n?{height:Math.max(n.y+n.height-(s+f),0),width:c}:{})}if(a==="left"){var y={x:u-p,y:s+f/2,textAnchor:b,verticalAnchor:"middle"};return me(me({},y),n?{width:Math.max(y.x-n.x,0),height:f}:{})}if(a==="right"){var m={x:u+c+p,y:s+f/2,textAnchor:x,verticalAnchor:"middle"};return me(me({},m),n?{width:Math.max(n.x+n.width-m.x,0),height:f}:{})}var _=n?{width:c,height:f}:{};return a==="insideLeft"?me({x:u+p,y:s+f/2,textAnchor:x,verticalAnchor:"middle"},_):a==="insideRight"?me({x:u+c-p,y:s+f/2,textAnchor:b,verticalAnchor:"middle"},_):a==="insideTop"?me({x:u+c/2,y:s+h,textAnchor:"middle",verticalAnchor:g},_):a==="insideBottom"?me({x:u+c/2,y:s+f-h,textAnchor:"middle",verticalAnchor:d},_):a==="insideTopLeft"?me({x:u+p,y:s+h,textAnchor:x,verticalAnchor:g},_):a==="insideTopRight"?me({x:u+c-p,y:s+h,textAnchor:b,verticalAnchor:g},_):a==="insideBottomLeft"?me({x:u+p,y:s+f-h,textAnchor:x,verticalAnchor:d},_):a==="insideBottomRight"?me({x:u+c-p,y:s+f-h,textAnchor:b,verticalAnchor:d},_):xr(a)&&(F(a.x)||It(a.x))&&(F(a.y)||It(a.y))?me({x:u+ze(a.x,c),y:s+ze(a.y,f),textAnchor:"end",verticalAnchor:"end"},_):me({x:u+c/2,y:s+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},WE=function(t){return"cx"in t&&F(t.cx)};function Pe(e){var t=e.offset,r=t===void 0?5:t,n=$E(e,TE),i=me({offset:r},n),a=i.viewBox,o=i.position,u=i.value,s=i.children,c=i.content,f=i.className,l=f===void 0?"":f,h=i.textBreakAll;if(!a||J(u)&&J(s)&&!q.isValidElement(c)&&!Z(c))return null;if(q.isValidElement(c))return q.cloneElement(c,i);var d;if(Z(c)){if(d=q.createElement(c,i),q.isValidElement(d))return d}else d=kE(i);var g=WE(a),v=ce(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return LE(i,d,v);var p=g?FE(i):UE(i);return E.createElement(qc,on({className:se("recharts-label",l)},v,p,{breakAll:h}),d)}Pe.displayName="Label";var y0=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,u=t.r,s=t.radius,c=t.innerRadius,f=t.outerRadius,l=t.x,h=t.y,d=t.top,g=t.left,v=t.width,p=t.height,b=t.clockWise,x=t.labelViewBox;if(x)return x;if(F(v)&&F(p)){if(F(l)&&F(h))return{x:l,y:h,width:v,height:p};if(F(d)&&F(g))return{x:d,y:g,width:v,height:p}}return F(l)&&F(h)?{x:l,y:h,width:0,height:0}:F(r)&&F(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:c||0,outerRadius:f||s||u||0,clockWise:b}:t.viewBox?t.viewBox:{}},HE=function(t,r){return t?t===!0?E.createElement(Pe,{key:"label-implicit",viewBox:r}):be(t)?E.createElement(Pe,{key:"label-implicit",viewBox:r,value:t}):q.isValidElement(t)?t.type===Pe?q.cloneElement(t,{key:"label-implicit",viewBox:r}):E.createElement(Pe,{key:"label-implicit",content:t,viewBox:r}):Z(t)?E.createElement(Pe,{key:"label-implicit",content:t,viewBox:r}):xr(t)?E.createElement(Pe,on({viewBox:r},t,{key:"label-implicit"})):null:null},zE=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=y0(t),o=Ge(i,Pe).map(function(s,c){return q.cloneElement(s,{viewBox:r||a,key:"label-".concat(c)})});if(!n)return o;var u=HE(t.label,r||a);return[u].concat(EE(o))};Pe.parseViewBox=y0;Pe.renderCallByParent=zE;var Ls,jy;function GE(){if(jy)return Ls;jy=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ls=e,Ls}var KE=GE();const XE=ae(KE);function un(e){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},un(e)}var VE=["valueAccessor"],YE=["data","dataKey","clockWise","id","textBreakAll"];function ZE(e){return tM(e)||eM(e)||QE(e)||JE()}function JE(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QE(e,t){if(e){if(typeof e=="string")return el(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return el(e,t)}}function eM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tM(e){if(Array.isArray(e))return el(e)}function el(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var oM=function(t){return Array.isArray(t.value)?XE(t.value):t.value};function kt(e){var t=e.valueAccessor,r=t===void 0?oM:t,n=$y(e,VE),i=n.data,a=n.dataKey,o=n.clockWise,u=n.id,s=n.textBreakAll,c=$y(n,YE);return!i||!i.length?null:E.createElement(Ae,{className:"recharts-label-list"},i.map(function(f,l){var h=J(a)?r(f,l):et(f&&f.payload,a),d=J(u)?{}:{id:"".concat(u,"-").concat(l)};return E.createElement(Pe,mi({},ce(f,!0),c,d,{parentViewBox:f.parentViewBox,value:h,textBreakAll:s,viewBox:Pe.parseViewBox(J(o)?f:Iy(Iy({},f),{},{clockWise:o})),key:"label-".concat(l),index:l}))}))}kt.displayName="LabelList";function uM(e,t){return e?e===!0?E.createElement(kt,{key:"labelList-implicit",data:t}):E.isValidElement(e)||Z(e)?E.createElement(kt,{key:"labelList-implicit",data:t,content:e}):xr(e)?E.createElement(kt,mi({data:t},e,{key:"labelList-implicit"})):null:null}function sM(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ge(n,kt).map(function(o,u){return q.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var a=uM(e.label,t);return[a].concat(ZE(i))}kt.renderCallByParent=sM;function sn(e){"@babel/helpers - typeof";return sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sn(e)}function tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>c),`, - `).concat(l.x,",").concat(l.y,` - `);if(i>0){var d=Se(r,n,i,o),g=Se(r,n,i,c);h+="L ".concat(g.x,",").concat(g.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(s)>180),",").concat(+(o<=c),`, - `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},pM=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,s=t.cornerIsExternal,c=t.startAngle,f=t.endAngle,l=Xe(f-c),h=Ln({cx:r,cy:n,radius:a,angle:c,sign:l,cornerRadius:o,cornerIsExternal:s}),d=h.circleTangency,g=h.lineTangency,v=h.theta,p=Ln({cx:r,cy:n,radius:a,angle:f,sign:-l,cornerRadius:o,cornerIsExternal:s}),b=p.circleTangency,x=p.lineTangency,w=p.theta,O=s?Math.abs(c-f):Math.abs(c-f)-v-w;if(O<0)return u?"M ".concat(g.x,",").concat(g.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):g0({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:c,endAngle:f});var y="M ".concat(g.x,",").concat(g.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(d.x,",").concat(d.y,` - A`).concat(a,",").concat(a,",0,").concat(+(O>180),",").concat(+(l<0),",").concat(b.x,",").concat(b.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(x.x,",").concat(x.y,` - `);if(i>0){var m=Ln({cx:r,cy:n,radius:i,angle:c,sign:l,isExternal:!0,cornerRadius:o,cornerIsExternal:s}),_=m.circleTangency,S=m.lineTangency,A=m.theta,C=Ln({cx:r,cy:n,radius:i,angle:f,sign:-l,isExternal:!0,cornerRadius:o,cornerIsExternal:s}),T=C.circleTangency,P=C.lineTangency,M=C.theta,I=s?Math.abs(c-f):Math.abs(c-f)-A-M;if(I<0&&o===0)return"".concat(y,"L").concat(r,",").concat(n,"Z");y+="L".concat(P.x,",").concat(P.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(T.x,",").concat(T.y,` - A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(l>0),",").concat(_.x,",").concat(_.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(S.x,",").concat(S.y,"Z")}else y+="L".concat(r,",").concat(n,"Z");return y},dM={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},m0=function(t){var r=Dy(Dy({},dM),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,s=r.forceCornerRadius,c=r.cornerIsExternal,f=r.startAngle,l=r.endAngle,h=r.className;if(o0&&Math.abs(f-l)<360?p=pM({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,g/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:f,endAngle:l}):p=g0({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:l}),E.createElement("path",tl({},ce(r,!0),{className:d,d:p,role:"img"}))};function cn(e){"@babel/helpers - typeof";return cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cn(e)}function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;tPM.call(e,t));function zt(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const MM="__v",jM="__o",CM="_owner",{getOwnPropertyDescriptor:Hy,keys:zy}=Object;function IM(e,t){return e.byteLength===t.byteLength&&bi(new Uint8Array(e),new Uint8Array(t))}function $M(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function RM(e,t){return e.byteLength===t.byteLength&&bi(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function DM(e,t){return zt(e.getTime(),t.getTime())}function NM(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function qM(e,t){return e===t}function Gy(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,u,s=0;for(;(o=a.next())&&!o.done;){const c=t.entries();let f=!1,l=0;for(;(u=c.next())&&!u.done;){if(i[l]){l++;continue}const h=o.value,d=u.value;if(r.equals(h[0],d[0],s,l,e,t,r)&&r.equals(h[1],d[1],h[0],d[0],e,t,r)){f=i[l]=!0;break}l++}if(!f)return!1;s++}return!0}const kM=zt;function BM(e,t,r){const n=zy(e);let i=n.length;if(zy(t).length!==i)return!1;for(;i-- >0;)if(!b0(e,t,r,n[i]))return!1;return!0}function Ir(e,t,r){const n=Wy(e);let i=n.length;if(Wy(t).length!==i)return!1;let a,o,u;for(;i-- >0;)if(a=n[i],!b0(e,t,r,a)||(o=Hy(e,a),u=Hy(t,a),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function LM(e,t){return zt(e.valueOf(),t.valueOf())}function FM(e,t){return e.source===t.source&&e.flags===t.flags}function Ky(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,u;for(;(o=a.next())&&!o.done;){const s=t.values();let c=!1,f=0;for(;(u=s.next())&&!u.done;){if(!i[f]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){c=i[f]=!0;break}f++}if(!c)return!1}return!0}function bi(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function UM(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function b0(e,t,r,n){return(n===CM||n===jM||n===MM)&&(e.$$typeof||t.$$typeof)?!0:EM(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const WM="[object ArrayBuffer]",HM="[object Arguments]",zM="[object Boolean]",GM="[object DataView]",KM="[object Date]",XM="[object Error]",VM="[object Map]",YM="[object Number]",ZM="[object Object]",JM="[object RegExp]",QM="[object Set]",ej="[object String]",tj={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},rj="[object URL]",nj=Object.prototype.toString;function ij({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:u,areObjectsEqual:s,arePrimitiveWrappersEqual:c,areRegExpsEqual:f,areSetsEqual:l,areTypedArraysEqual:h,areUrlsEqual:d,unknownTagComparators:g}){return function(p,b,x){if(p===b)return!0;if(p==null||b==null)return!1;const w=typeof p;if(w!==typeof b)return!1;if(w!=="object")return w==="number"?u(p,b,x):w==="function"?a(p,b,x):!1;const O=p.constructor;if(O!==b.constructor)return!1;if(O===Object)return s(p,b,x);if(Array.isArray(p))return t(p,b,x);if(O===Date)return n(p,b,x);if(O===RegExp)return f(p,b,x);if(O===Map)return o(p,b,x);if(O===Set)return l(p,b,x);const y=nj.call(p);if(y===KM)return n(p,b,x);if(y===JM)return f(p,b,x);if(y===VM)return o(p,b,x);if(y===QM)return l(p,b,x);if(y===ZM)return typeof p.then!="function"&&typeof b.then!="function"&&s(p,b,x);if(y===rj)return d(p,b,x);if(y===XM)return i(p,b,x);if(y===HM)return s(p,b,x);if(tj[y])return h(p,b,x);if(y===WM)return e(p,b,x);if(y===GM)return r(p,b,x);if(y===zM||y===YM||y===ej)return c(p,b,x);if(g){let m=g[y];if(!m){const _=TM(p);_&&(m=g[_])}if(m)return m(p,b,x)}return!1}}function aj({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:IM,areArraysEqual:r?Ir:$M,areDataViewsEqual:RM,areDatesEqual:DM,areErrorsEqual:NM,areFunctionsEqual:qM,areMapsEqual:r?Hs(Gy,Ir):Gy,areNumbersEqual:kM,areObjectsEqual:r?Ir:BM,arePrimitiveWrappersEqual:LM,areRegExpsEqual:FM,areSetsEqual:r?Hs(Ky,Ir):Ky,areTypedArraysEqual:r?Hs(bi,Ir):bi,areUrlsEqual:UM,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Un(n.areArraysEqual),a=Un(n.areMapsEqual),o=Un(n.areObjectsEqual),u=Un(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:u})}return n}function oj(e){return function(t,r,n,i,a,o,u){return e(t,r,u)}}function uj({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(u,s){const{cache:c=e?new WeakMap:void 0,meta:f}=r();return t(u,s,{cache:c,equals:n,meta:f,strict:i})};if(e)return function(u,s){return t(u,s,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(u,s){return t(u,s,a)}}const sj=At();At({strict:!0});At({circular:!0});At({circular:!0,strict:!0});At({createInternalComparator:()=>zt});At({strict:!0,createInternalComparator:()=>zt});At({circular:!0,createInternalComparator:()=>zt});At({circular:!0,createInternalComparator:()=>zt,strict:!0});function At(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=aj(e),o=ij(a),u=r?r(o):oj(o);return uj({circular:t,comparator:o,createState:n,equals:u,strict:i})}function cj(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Xy(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):cj(i)};requestAnimationFrame(n)}function nl(e){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}function lj(e){return dj(e)||pj(e)||hj(e)||fj()}function fj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hj(e,t){if(e){if(typeof e=="string")return Vy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vy(e,t)}}function Vy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},v=function(b){for(var x=b>1?1:b,w=x,O=0;O<8;++O){var y=l(w)-x,m=d(w);if(Math.abs(y-x)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?17:o,s=function(f,l,h){var d=-(f-l)*n,g=h*a,v=h+(d-g)*u/1e3,p=h*u/1e3+f;return Math.abs(p-l)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zj(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function zs(e){return Vj(e)||Xj(e)||Kj(e)||Gj()}function Gj(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kj(e,t){if(e){if(typeof e=="string")return sl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sl(e,t)}}function Xj(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vj(e){if(Array.isArray(e))return sl(e)}function sl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _i(e){return _i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_i(e)}var xt=(function(e){eC(r,e);var t=tC(r);function r(n,i){var a;Yj(this,r),a=t.call(this,n,i);var o=a.props,u=o.isActive,s=o.attributeName,c=o.from,f=o.to,l=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(fl(a)),a.changeStyle=a.changeStyle.bind(fl(a)),!u||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),ll(a);if(l&&l.length)a.state={style:l[0].style};else if(c){if(typeof h=="function")return a.state={style:c},ll(a);a.state={style:s?qr({},s,c):c}}else a.state={style:{}};return a}return Jj(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,u=a.canBegin,s=a.attributeName,c=a.shouldReAnimate,f=a.to,l=a.from,h=this.state.style;if(u){if(!o){var d={style:s?qr({},s,f):f};this.state&&h&&(s&&h[s]!==f||!s&&h!==f)&&this.setState(d);return}if(!(sj(i.to,f)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=g||c?l:i.to;if(this.state&&h){var p={style:s?qr({},s,v):v};(s&&h[s]!==v||!s&&h!==v)&&this.setState(p)}this.runAnimation(Ue(Ue({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,u=i.to,s=i.duration,c=i.easing,f=i.begin,l=i.onAnimationEnd,h=i.onAnimationStart,d=Uj(o,u,Cj(c),s,this.changeStyle),g=function(){a.stopJSAnimation=d()};this.manager.start([h,f,g,s,l])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,u=i.begin,s=i.onAnimationStart,c=o[0],f=c.style,l=c.duration,h=l===void 0?0:l,d=function(v,p,b){if(b===0)return v;var x=p.duration,w=p.easing,O=w===void 0?"ease":w,y=p.style,m=p.properties,_=p.onAnimationEnd,S=b>0?o[b-1]:p,A=m||Object.keys(y);if(typeof O=="function"||O==="spring")return[].concat(zs(v),[a.runJSAnimation.bind(a,{from:S.style,to:y,duration:x,easing:O}),x]);var C=Jy(A,x,O),T=Ue(Ue(Ue({},S.style),y),{},{transition:C});return[].concat(zs(v),[T,x,_]).filter(bj)};return this.manager.start([s].concat(zs(o.reduce(d,[f,Math.max(h,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=vj());var a=i.begin,o=i.duration,u=i.attributeName,s=i.to,c=i.easing,f=i.onAnimationStart,l=i.onAnimationEnd,h=i.steps,d=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof c=="function"||typeof d=="function"||c==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var v=u?qr({},u,s):s,p=Jy(Object.keys(v),o,c);g.start([f,a,Ue(Ue({},v),{},{transition:p}),o,l])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var s=Hj(i,Wj),c=q.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!u||c===0||o<=0)return a;var l=function(d){var g=d.props,v=g.style,p=v===void 0?{}:v,b=g.className,x=q.cloneElement(d,Ue(Ue({},s),{},{style:Ue(Ue({},p),f),className:b}));return x};return c===1?l(q.Children.only(a)):E.createElement("div",null,q.Children.map(a,function(h){return l(h)}))}}]),r})(q.PureComponent);xt.displayName="Animate";xt.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};xt.propTypes={from:te.oneOfType([te.object,te.string]),to:te.oneOfType([te.object,te.string]),attributeName:te.string,duration:te.number,begin:te.number,easing:te.oneOfType([te.string,te.func]),steps:te.arrayOf(te.shape({duration:te.number.isRequired,style:te.object.isRequired,easing:te.oneOfType([te.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),te.func]),properties:te.arrayOf("string"),onAnimationEnd:te.func})),children:te.oneOfType([te.node,te.func]),isActive:te.bool,canBegin:te.bool,onAnimationEnd:te.func,shouldReAnimate:te.bool,onAnimationStart:te.func,onAnimationReStart:te.func};function hn(e){"@babel/helpers - typeof";return hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(e)}function Oi(){return Oi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,s=n>=0?1:-1,c=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var l=[0,0,0,0],h=0,d=4;ho?o:a[h];f="M".concat(t,",").concat(r+u*l[0]),l[0]>0&&(f+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(c,",").concat(t+s*l[0],",").concat(r)),f+="L ".concat(t+n-s*l[1],",").concat(r),l[1]>0&&(f+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(c,`, - `).concat(t+n,",").concat(r+u*l[1])),f+="L ".concat(t+n,",").concat(r+i-u*l[2]),l[2]>0&&(f+="A ".concat(l[2],",").concat(l[2],",0,0,").concat(c,`, - `).concat(t+n-s*l[2],",").concat(r+i)),f+="L ".concat(t+s*l[3],",").concat(r+i),l[3]>0&&(f+="A ".concat(l[3],",").concat(l[3],",0,0,").concat(c,`, - `).concat(t,",").concat(r+i-u*l[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);f="M ".concat(t,",").concat(r+u*g,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+s*g,",").concat(r,` - L `).concat(t+n-s*g,",").concat(r,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+n,",").concat(r+u*g,` - L `).concat(t+n,",").concat(r+i-u*g,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+n-s*g,",").concat(r+i,` - L `).concat(t+s*g,",").concat(r+i,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t,",").concat(r+i-u*g," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},fC=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,u=r.width,s=r.height;if(Math.abs(u)>0&&Math.abs(s)>0){var c=Math.min(a,a+u),f=Math.max(a,a+u),l=Math.min(o,o+s),h=Math.max(o,o+s);return n>=c&&n<=f&&i>=l&&i<=h}return!1},hC={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Of=function(t){var r=og(og({},hC),t),n=q.useRef(),i=q.useState(-1),a=nC(i,2),o=a[0],u=a[1];q.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&u(O)}catch{}},[]);var s=r.x,c=r.y,f=r.width,l=r.height,h=r.radius,d=r.className,g=r.animationEasing,v=r.animationDuration,p=r.animationBegin,b=r.isAnimationActive,x=r.isUpdateAnimationActive;if(s!==+s||c!==+c||f!==+f||l!==+l||f===0||l===0)return null;var w=se("recharts-rectangle",d);return x?E.createElement(xt,{canBegin:o>0,from:{width:f,height:l,x:s,y:c},to:{width:f,height:l,x:s,y:c},duration:v,animationEasing:g,isActive:x},function(O){var y=O.width,m=O.height,_=O.x,S=O.y;return E.createElement(xt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:v,isActive:b,easing:g},E.createElement("path",Oi({},ce(r,!0),{className:w,d:ug(_,S,y,m,h),ref:n})))}):E.createElement("path",Oi({},ce(r,!0),{className:w,d:ug(s,c,f,l,h)}))};function hl(){return hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bC(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var xC=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},wC=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,u=o===void 0?0:o,s=t.left,c=s===void 0?0:s,f=t.width,l=f===void 0?0:f,h=t.height,d=h===void 0?0:h,g=t.className,v=mC(t,pC),p=dC({x:n,y:a,top:u,left:c,width:l,height:d},v);return!F(n)||!F(a)||!F(l)||!F(d)||!F(u)||!F(c)?null:E.createElement("path",pl({},ce(p,!0),{className:se("recharts-cross",g),d:xC(n,a,l,d,u,c)}))},Gs,cg;function _C(){if(cg)return Gs;cg=1;var e=Wm(),t=e(Object.getPrototypeOf,Object);return Gs=t,Gs}var Ks,lg;function OC(){if(lg)return Ks;lg=1;var e=ht(),t=_C(),r=pt(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,u=a.hasOwnProperty,s=o.call(Object);function c(f){if(!r(f)||e(f)!=n)return!1;var l=t(f);if(l===null)return!0;var h=u.call(l,"constructor")&&l.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==s}return Ks=c,Ks}var SC=OC();const AC=ae(SC);var Xs,fg;function PC(){if(fg)return Xs;fg=1;var e=ht(),t=pt(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return Xs=n,Xs}var TC=PC();const EC=ae(TC);function dn(e){"@babel/helpers - typeof";return dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(e)}function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:s,y:c},to:{upperWidth:f,lowerWidth:l,height:h,x:s,y:c},duration:v,animationEasing:g,isActive:b},function(w){var O=w.upperWidth,y=w.lowerWidth,m=w.height,_=w.x,S=w.y;return E.createElement(xt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:v,easing:g},E.createElement("path",Si({},ce(r,!0),{className:x,d:vg(_,S,O,y,m),ref:n})))}):E.createElement("g",null,E.createElement("path",Si({},ce(r,!0),{className:x,d:vg(s,c,f,l,h)})))},BC=["option","shapeType","propTransformer","activeClassName","isActive"];function vn(e){"@babel/helpers - typeof";return vn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(e)}function LC(e,t){if(e==null)return{};var r=FC(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FC(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function yg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),$e(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,u=i.startIndex;o?.({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),$e(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),$e(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),$e(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),$e(n,"handleSlideDragStart",function(i){var a=Pg(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return vI(t,e),fI(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,u=this.props,s=u.gap,c=u.data,f=c.length-1,l=Math.min(i,a),h=Math.max(i,a),d=t.getIndexInRange(o,l),g=t.getIndexInRange(o,h);return{startIndex:d-d%s,endIndex:g===f?f:g-g%s}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,u=i.dataKey,s=et(a[n],u,n);return Z(o)?o(s,n):s}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,u=i.endX,s=this.props,c=s.x,f=s.width,l=s.travellerWidth,h=s.startIndex,d=s.endIndex,g=s.onChange,v=n.pageX-a;v>0?v=Math.min(v,c+f-l-u,c+f-l-o):v<0&&(v=Math.max(v,c-o,c-u));var p=this.getIndex({startX:o+v,endX:u+v});(p.startIndex!==h||p.endIndex!==d)&&g&&g(p),this.setState({startX:o+v,endX:u+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=Pg(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,u=i.endX,s=i.startX,c=this.state[o],f=this.props,l=f.x,h=f.width,d=f.travellerWidth,g=f.onChange,v=f.gap,p=f.data,b={startX:this.state.startX,endX:this.state.endX},x=n.pageX-a;x>0?x=Math.min(x,l+h-d-c):x<0&&(x=Math.max(x,l-c)),b[o]=c+x;var w=this.getIndex(b),O=w.startIndex,y=w.endIndex,m=function(){var S=p.length-1;return o==="startX"&&(u>s?O%v===0:y%v===0)||us?y%v===0:O%v===0)||u>s&&y===S};this.setState($e($e({},o,c+x),"brushMoveStartX",n.pageX),function(){g&&m()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,u=o.scaleValues,s=o.startX,c=o.endX,f=this.state[i],l=u.indexOf(f);if(l!==-1){var h=l+n;if(!(h===-1||h>=u.length)){var d=u[h];i==="startX"&&d>=c||i==="endX"&&d<=s||this.setState($e({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,s=n.fill,c=n.stroke;return E.createElement("rect",{stroke:c,fill:s,x:i,y:a,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,s=n.data,c=n.children,f=n.padding,l=q.Children.only(c);return l?E.cloneElement(l,{x:i,y:a,width:o,height:u,margin:f,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,u=this,s=this.props,c=s.y,f=s.travellerWidth,l=s.height,h=s.traveller,d=s.ariaLabel,g=s.data,v=s.startIndex,p=s.endIndex,b=Math.max(n,this.props.x),x=Qs(Qs({},ce(this.props,!1)),{},{x:b,y:c,width:f,height:l}),w=d||"Min value: ".concat((a=g[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[p])===null||o===void 0?void 0:o.name);return E.createElement(Ae,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(y){["ArrowLeft","ArrowRight"].includes(y.key)&&(y.preventDefault(),y.stopPropagation(),u.handleTravellerMoveKeyboard(y.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,u=a.height,s=a.stroke,c=a.travellerWidth,f=Math.min(n,i)+c,l=Math.max(Math.abs(i-n)-c,0);return E.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:s,fillOpacity:.2,x:f,y:o,width:l,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,u=n.height,s=n.travellerWidth,c=n.stroke,f=this.state,l=f.startX,h=f.endX,d=5,g={pointerEvents:"none",fill:c};return E.createElement(Ae,{className:"recharts-brush-texts"},E.createElement(qc,Ti({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,h)-d,y:o+u/2},g),this.getTextOfTick(i)),E.createElement(qc,Ti({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,h)+s+d,y:o+u/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,u=n.x,s=n.y,c=n.width,f=n.height,l=n.alwaysShowText,h=this.state,d=h.startX,g=h.endX,v=h.isTextActive,p=h.isSlideMoving,b=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!F(u)||!F(s)||!F(c)||!F(f)||c<=0||f<=0)return null;var w=se("recharts-brush",a),O=E.Children.count(o)===1,y=cI("userSelect","none");return E.createElement(Ae,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:y},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(d,g),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(g,"endX"),(v||p||b||x||l)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,u=n.height,s=n.stroke,c=Math.floor(a+u/2)-1;return E.createElement(E.Fragment,null,E.createElement("rect",{x:i,y:a,width:o,height:u,fill:s,stroke:"none"}),E.createElement("line",{x1:i+1,y1:c,x2:i+o-1,y2:c,fill:"none",stroke:"#fff"}),E.createElement("line",{x1:i+1,y1:c+2,x2:i+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return E.isValidElement(n)?a=E.cloneElement(n,i):Z(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,u=n.x,s=n.travellerWidth,c=n.updateId,f=n.startIndex,l=n.endIndex;if(a!==i.prevData||c!==i.prevUpdateId)return Qs({prevData:a,prevTravellerWidth:s,prevUpdateId:c,prevX:u,prevWidth:o},a&&a.length?gI({data:a,width:o,x:u,travellerWidth:s,startIndex:f,endIndex:l}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||u!==i.prevX||s!==i.prevTravellerWidth)){i.scale.range([u,u+o-s]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:s,prevUpdateId:c,prevX:u,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,u=a-1;u-o>1;){var s=Math.floor((o+u)/2);n[s]>i?u=s:o=s}return i>=n[u]?u:o}}])})(q.PureComponent);$e(hr,"displayName","Brush");$e(hr,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var ec,Tg;function mI(){if(Tg)return ec;Tg=1;var e=Kl();function t(r,n){var i;return e(r,function(a,o,u){return i=n(a,o,u),!i}),!!i}return ec=t,ec}var tc,Eg;function bI(){if(Eg)return tc;Eg=1;var e=Nm(),t=_t(),r=mI(),n=Ce(),i=Ki();function a(o,u,s){var c=n(o)?e:r;return s&&i(o,u,s)&&(u=void 0),c(o,t(u,3))}return tc=a,tc}var xI=bI();const wI=ae(xI);var Je=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},rc,Mg;function _I(){if(Mg)return rc;Mg=1;var e=eb();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return rc=t,rc}var nc,jg;function OI(){if(jg)return nc;jg=1;var e=_I(),t=Jm(),r=_t();function n(i,a){var o={};return a=r(a,3),t(i,function(u,s,c){e(o,s,a(u,s,c))}),o}return nc=n,nc}var SI=OI();const AI=ae(SI);var ic,Cg;function PI(){if(Cg)return ic;Cg=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function DI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function NI(e,t){var r=e.x,n=e.y,i=RI(e,jI),a="".concat(r),o=parseInt(a,10),u="".concat(n),s=parseInt(u,10),c="".concat(t.height||i.height),f=parseInt(c,10),l="".concat(t.width||i.width),h=parseInt(l,10);return $r($r($r($r($r({},t),i),o?{x:o}:{}),s?{y:s}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function Dg(e){return E.createElement(XC,vl({shapeType:"rectangle",propTransformer:NI,activeClassName:"recharts-active-bar"},e))}var qI=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=F(n)||Ux(n);return a?t(n,i):(a||Ft(),r)}},kI=["value","background"],I0;function pr(e){"@babel/helpers - typeof";return pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(e)}function BI(e,t){if(e==null)return{};var r=LI(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Mi(){return Mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(j)0&&Math.abs(I)0&&(M=Math.min((oe||0)-(I[pe-1]||0),M))}),Number.isFinite(M)){var j=M/P,R=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(_=j*R/2),v.padding==="no-gap"){var N=ze(t.barCategoryGap,j*R),k=j*R/2;_=k-N-(k-N)/R*N}}}i==="xAxis"?S=[n.left+(w.left||0)+(_||0),n.left+n.width-(w.right||0)-(_||0)]:i==="yAxis"?S=s==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(_||0),n.top+n.height-(w.bottom||0)-(_||0)]:S=v.range,y&&(S=[S[1],S[0]]);var B=l0(v,a,h),H=B.scale,G=B.realScaleType;H.domain(b).range(S),f0(H);var U=h0(H,We(We({},v),{},{realScaleType:G}));i==="xAxis"?(T=p==="top"&&!O||p==="bottom"&&O,A=n.left,C=l[m]-T*v.height):i==="yAxis"&&(T=p==="left"&&!O||p==="right"&&O,A=l[m]-T*v.width,C=n.top);var K=We(We(We({},v),U),{},{realScaleType:G,x:A,y:C,scale:H,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return K.bandSize=yi(K,U),!v.hide&&i==="xAxis"?l[m]+=(T?-1:1)*K.height:v.hide||(l[m]+=(T?-1:1)*K.width),We(We({},d),{},sa({},g,K))},{})},N0=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},ZI=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return N0({x:r,y:n},{x:i,y:a})},q0=(function(){function e(t){XI(this,e),this.scale=t}return VI(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();sa(q0,"EPS",1e-4);var Sf=function(t){var r=Object.keys(t).reduce(function(n,i){return We(We({},n),{},sa({},i,q0.create(t[i])))},{});return We(We({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,u=a.position;return AI(i,function(s,c){return r[c].apply(s,{bandAware:o,position:u})})},isInRange:function(i){return C0(i,function(a,o){return r[o].isInRange(a)})}})};function JI(e){return(e%180+180)%180}var GR=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=JI(i),o=a*Math.PI/180,u=Math.atan(n/r),s=o>u&&o-1?s[c?a[f]:f]:void 0}}return uc=n,uc}var sc,Fg;function e$(){if(Fg)return sc;Fg=1;var e=T0();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return sc=t,sc}var cc,Ug;function t$(){if(Ug)return cc;Ug=1;var e=Km(),t=_t(),r=e$(),n=Math.max;function i(a,o,u){var s=a==null?0:a.length;if(!s)return-1;var c=u==null?0:r(u);return c<0&&(c=n(s+c,0)),e(a,t(o,3),c)}return cc=i,cc}var lc,Wg;function r$(){if(Wg)return lc;Wg=1;var e=QI(),t=t$(),r=e(t);return lc=r,lc}var n$=r$();const i$=ae(n$);var a$=cm();const o$=ae(a$);var u$=o$(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Af=q.createContext(void 0),Pf=q.createContext(void 0),k0=q.createContext(void 0),B0=q.createContext({}),L0=q.createContext(void 0),F0=q.createContext(0),U0=q.createContext(0),Hg=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,u=t.children,s=t.width,c=t.height,f=u$(a);return E.createElement(Af.Provider,{value:n},E.createElement(Pf.Provider,{value:i},E.createElement(B0.Provider,{value:a},E.createElement(k0.Provider,{value:f},E.createElement(L0.Provider,{value:o},E.createElement(F0.Provider,{value:c},E.createElement(U0.Provider,{value:s},u)))))))},s$=function(){return q.useContext(L0)},c$=function(t){var r=q.useContext(Af);r==null&&Ft();var n=r[t];return n==null&&Ft(),n},KR=function(){var t=q.useContext(Af);return gt(t)},XR=function(){var t=q.useContext(Pf),r=i$(t,function(n){return C0(n.domain,Number.isFinite)});return r||gt(t)},l$=function(t){var r=q.useContext(Pf);r==null&&Ft();var n=r[t];return n==null&&Ft(),n},f$=function(){var t=q.useContext(k0);return t},VR=function(){return q.useContext(B0)},YR=function(){return q.useContext(U0)},ZR=function(){return q.useContext(F0)};function dr(e){"@babel/helpers - typeof";return dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dr(e)}function h$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p$(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mR(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&F(i)&&F(a)?t.slice(i,a+1):[]};function tx(e){return e==="number"?[0,"auto"]:void 0}var Tl=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=pa(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(s,c){var f,l=(f=c.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=l===void 0?u:l;h=vc(d,o.dataKey,i)}else h=l&&l[n]||u[n];return h?[].concat(mr(s),[d0(c,h)]):s},[])},im=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=jR(a,n),u=t.orderedTooltipTicks,s=t.tooltipAxis,c=t.tooltipTicks,f=JT(o,u,c,s);if(f>=0&&c){var l=c[f]&&c[f].value,h=Tl(t,r,f,l),d=CR(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:h,activeCoordinate:d}}return null},IR=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,s=r.dataStartIndex,c=r.dataEndIndex,f=t.layout,l=t.children,h=t.stackOffset,d=c0(f,a);return n.reduce(function(g,v){var p,b=v.type.defaultProps!==void 0?$($({},v.type.defaultProps),v.props):v.props,x=b.type,w=b.dataKey,O=b.allowDataOverflow,y=b.allowDuplicatedCategory,m=b.scale,_=b.ticks,S=b.includeHidden,A=b[o];if(g[A])return g;var C=pa(t.data,{graphicalItems:i.filter(function(U){var K,oe=o in U.props?U.props[o]:(K=U.type.defaultProps)===null||K===void 0?void 0:K[o];return oe===A}),dataStartIndex:s,dataEndIndex:c}),T=C.length,P,M,I;iR(b.domain,O,x)&&(P=Jc(b.domain,null,O),d&&(x==="number"||m!=="auto")&&(I=Br(C,w,"category")));var j=tx(x);if(!P||P.length===0){var R,N=(R=b.domain)!==null&&R!==void 0?R:j;if(w){if(P=Br(C,w,x),x==="category"&&d){var k=Hx(P);y&&k?(M=P,P=Pi(0,T)):y||(P=Ay(N,P,v).reduce(function(U,K){return U.indexOf(K)>=0?U:[].concat(mr(U),[K])},[]))}else if(x==="category")y?P=P.filter(function(U){return U!==""&&!J(U)}):P=Ay(N,P,v).reduce(function(U,K){return U.indexOf(K)>=0||K===""||J(K)?U:[].concat(mr(U),[K])},[]);else if(x==="number"){var B=nE(C,i.filter(function(U){var K,oe,pe=o in U.props?U.props[o]:(K=U.type.defaultProps)===null||K===void 0?void 0:K[o],Ie="hide"in U.props?U.props.hide:(oe=U.type.defaultProps)===null||oe===void 0?void 0:oe.hide;return pe===A&&(S||!Ie)}),w,a,f);B&&(P=B)}d&&(x==="number"||m!=="auto")&&(I=Br(C,w,"category"))}else d?P=Pi(0,T):u&&u[A]&&u[A].hasStack&&x==="number"?P=h==="expand"?[0,1]:p0(u[A].stackGroups,s,c):P=s0(C,i.filter(function(U){var K=o in U.props?U.props[o]:U.type.defaultProps[o],oe="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return K===A&&(S||!oe)}),x,f,!0);if(x==="number")P=Sl(l,P,A,a,_),N&&(P=Jc(N,P,O));else if(x==="category"&&N){var H=N,G=P.every(function(U){return H.indexOf(U)>=0});G&&(P=H)}}return $($({},g),{},z({},A,$($({},b),{},{axisType:a,domain:P,categoricalDomain:I,duplicateDomain:M,originalDomain:(p=b.domain)!==null&&p!==void 0?p:j,isCategorical:d,layout:f})))},{})},$R=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,s=r.dataStartIndex,c=r.dataEndIndex,f=t.layout,l=t.children,h=pa(t.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),d=h.length,g=c0(f,a),v=-1;return n.reduce(function(p,b){var x=b.type.defaultProps!==void 0?$($({},b.type.defaultProps),b.props):b.props,w=x[o],O=tx("number");if(!p[w]){v++;var y;return g?y=Pi(0,d):u&&u[w]&&u[w].hasStack?(y=p0(u[w].stackGroups,s,c),y=Sl(l,y,w,a)):(y=Jc(O,s0(h,n.filter(function(m){var _,S,A=o in m.props?m.props[o]:(_=m.type.defaultProps)===null||_===void 0?void 0:_[o],C="hide"in m.props?m.props.hide:(S=m.type.defaultProps)===null||S===void 0?void 0:S.hide;return A===w&&!C}),"number",f),i.defaultProps.allowDataOverflow),y=Sl(l,y,w,a)),$($({},p),{},z({},w,$($({axisType:a},i.defaultProps),{},{hide:!0,orientation:Ye(ER,"".concat(a,".").concat(v%2),null),domain:y,originalDomain:O,isCategorical:g,layout:f})))}return p},{})},RR=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,s=r.dataStartIndex,c=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),h=Ge(f,a),d={};return h&&h.length?d=IR(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:s,dataEndIndex:c}):o&&o.length&&(d=$R(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:s,dataEndIndex:c})),d},DR=function(t){var r=gt(t),n=Nr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Xl(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:yi(r,n)}},am=function(t){var r=t.children,n=t.defaultShowTooltip,i=Re(r,hr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},NR=function(t){return!t||!t.length?!1:t.some(function(r){var n=ut(r&&r.type);return n&&n.indexOf("Bar")>=0})},om=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},qR=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,s=u===void 0?{}:u,c=n.width,f=n.height,l=n.children,h=n.margin||{},d=Re(l,hr),g=Re(l,Jt),v=Object.keys(s).reduce(function(y,m){var _=s[m],S=_.orientation;return!_.mirror&&!_.hide?$($({},y),{},z({},S,y[S]+_.width)):y},{left:h.left||0,right:h.right||0}),p=Object.keys(o).reduce(function(y,m){var _=o[m],S=_.orientation;return!_.mirror&&!_.hide?$($({},y),{},z({},S,Ye(y,"".concat(S))+_.height)):y},{top:h.top||0,bottom:h.bottom||0}),b=$($({},p),v),x=b.bottom;d&&(b.bottom+=d.props.height||hr.defaultProps.height),g&&r&&(b=tE(b,i,n,r));var w=c-b.left-b.right,O=f-b.top-b.bottom;return $($({brushBottom:x},b),{},{width:Math.max(w,0),height:Math.max(O,0)})},kR=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},JR=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,s=t.axisComponents,c=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,h=function(b,x){var w=x.graphicalItems,O=x.stackGroups,y=x.offset,m=x.updateId,_=x.dataStartIndex,S=x.dataEndIndex,A=b.barSize,C=b.layout,T=b.barGap,P=b.barCategoryGap,M=b.maxBarSize,I=om(C),j=I.numericAxisName,R=I.cateAxisName,N=NR(w),k=[];return w.forEach(function(B,H){var G=pa(b.data,{graphicalItems:[B],dataStartIndex:_,dataEndIndex:S}),U=B.type.defaultProps!==void 0?$($({},B.type.defaultProps),B.props):B.props,K=U.dataKey,oe=U.maxBarSize,pe=U["".concat(j,"Id")],Ie=U["".concat(R,"Id")],Pt={},Ee=s.reduce(function(Tt,Et){var da=x["".concat(Et.axisType,"Map")],Mf=U["".concat(Et.axisType,"Id")];da&&da[Mf]||Et.axisType==="zAxis"||Ft();var jf=da[Mf];return $($({},Tt),{},z(z({},Et.axisType,jf),"".concat(Et.axisType,"Ticks"),Nr(jf)))},Pt),L=Ee[R],X=Ee["".concat(R,"Ticks")],V=O&&O[pe]&&O[pe].hasStack&&hE(B,O[pe].stackGroups),D=ut(B.type).indexOf("Bar")>=0,fe=yi(L,X),Y=[],ye=N&&QT({barSize:A,stackGroups:O,totalSize:kR(Ee,R)});if(D){var ge,Me,vt=J(oe)?M:oe,Gt=(ge=(Me=yi(L,X,!0))!==null&&Me!==void 0?Me:vt)!==null&&ge!==void 0?ge:0;Y=eE({barGap:T,barCategoryGap:P,bandSize:Gt!==fe?Gt:fe,sizeList:ye[Ie],maxBarSize:vt}),Gt!==fe&&(Y=Y.map(function(Tt){return $($({},Tt),{},{position:$($({},Tt.position),{},{offset:Tt.position.offset-Gt/2})})}))}var jn=B&&B.type&&B.type.getComposedData;jn&&k.push({props:$($({},jn($($({},Ee),{},{displayedData:G,props:b,dataKey:K,item:B,bandSize:fe,barPosition:Y,offset:y,stackedData:V,layout:C,dataStartIndex:_,dataEndIndex:S}))),{},z(z(z({key:B.key||"item-".concat(H)},j,Ee[j]),R,Ee[R]),"animationId",m)),childIndex:rw(B,b.children),item:B})}),k},d=function(b,x){var w=b.props,O=b.dataStartIndex,y=b.dataEndIndex,m=b.updateId;if(!Bh({props:w}))return null;var _=w.children,S=w.layout,A=w.stackOffset,C=w.data,T=w.reverseStackOrder,P=om(S),M=P.numericAxisName,I=P.cateAxisName,j=Ge(_,n),R=lE(C,j,"".concat(M,"Id"),"".concat(I,"Id"),A,T),N=s.reduce(function(U,K){var oe="".concat(K.axisType,"Map");return $($({},U),{},z({},oe,RR(w,$($({},K),{},{graphicalItems:j,stackGroups:K.axisType===M&&R,dataStartIndex:O,dataEndIndex:y}))))},{}),k=qR($($({},N),{},{props:w,graphicalItems:j}),x?.legendBBox);Object.keys(N).forEach(function(U){N[U]=f(w,N[U],k,U.replace("Map",""),r)});var B=N["".concat(I,"Map")],H=DR(B),G=h(w,$($({},N),{},{dataStartIndex:O,dataEndIndex:y,updateId:m,graphicalItems:j,stackGroups:R,offset:k}));return $($({formattedGraphicalItems:G,graphicalItems:j,offset:k,stackGroups:R},H),N)},g=(function(p){function b(x){var w,O,y;return gR(this,b),y=xR(this,b,[x]),z(y,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),z(y,"accessibilityManager",new nR),z(y,"handleLegendBBoxUpdate",function(m){if(m){var _=y.state,S=_.dataStartIndex,A=_.dataEndIndex,C=_.updateId;y.setState($({legendBBox:m},d({props:y.props,dataStartIndex:S,dataEndIndex:A,updateId:C},$($({},y.state),{},{legendBBox:m}))))}}),z(y,"handleReceiveSyncEvent",function(m,_,S){if(y.props.syncId===m){if(S===y.eventEmitterSymbol&&typeof y.props.syncMethod!="function")return;y.applySyncEvent(_)}}),z(y,"handleBrushChange",function(m){var _=m.startIndex,S=m.endIndex;if(_!==y.state.dataStartIndex||S!==y.state.dataEndIndex){var A=y.state.updateId;y.setState(function(){return $({dataStartIndex:_,dataEndIndex:S},d({props:y.props,dataStartIndex:_,dataEndIndex:S,updateId:A},y.state))}),y.triggerSyncEvent({dataStartIndex:_,dataEndIndex:S})}}),z(y,"handleMouseEnter",function(m){var _=y.getMouseInfo(m);if(_){var S=$($({},_),{},{isTooltipActive:!0});y.setState(S),y.triggerSyncEvent(S);var A=y.props.onMouseEnter;Z(A)&&A(S,m)}}),z(y,"triggeredAfterMouseMove",function(m){var _=y.getMouseInfo(m),S=_?$($({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};y.setState(S),y.triggerSyncEvent(S);var A=y.props.onMouseMove;Z(A)&&A(S,m)}),z(y,"handleItemMouseEnter",function(m){y.setState(function(){return{isTooltipActive:!0,activeItem:m,activePayload:m.tooltipPayload,activeCoordinate:m.tooltipPosition||{x:m.cx,y:m.cy}}})}),z(y,"handleItemMouseLeave",function(){y.setState(function(){return{isTooltipActive:!1}})}),z(y,"handleMouseMove",function(m){m.persist(),y.throttleTriggeredAfterMouseMove(m)}),z(y,"handleMouseLeave",function(m){y.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};y.setState(_),y.triggerSyncEvent(_);var S=y.props.onMouseLeave;Z(S)&&S(_,m)}),z(y,"handleOuterEvent",function(m){var _=tw(m),S=Ye(y.props,"".concat(_));if(_&&Z(S)){var A,C;/.*touch.*/i.test(_)?C=y.getMouseInfo(m.changedTouches[0]):C=y.getMouseInfo(m),S((A=C)!==null&&A!==void 0?A:{},m)}}),z(y,"handleClick",function(m){var _=y.getMouseInfo(m);if(_){var S=$($({},_),{},{isTooltipActive:!0});y.setState(S),y.triggerSyncEvent(S);var A=y.props.onClick;Z(A)&&A(S,m)}}),z(y,"handleMouseDown",function(m){var _=y.props.onMouseDown;if(Z(_)){var S=y.getMouseInfo(m);_(S,m)}}),z(y,"handleMouseUp",function(m){var _=y.props.onMouseUp;if(Z(_)){var S=y.getMouseInfo(m);_(S,m)}}),z(y,"handleTouchMove",function(m){m.changedTouches!=null&&m.changedTouches.length>0&&y.throttleTriggeredAfterMouseMove(m.changedTouches[0])}),z(y,"handleTouchStart",function(m){m.changedTouches!=null&&m.changedTouches.length>0&&y.handleMouseDown(m.changedTouches[0])}),z(y,"handleTouchEnd",function(m){m.changedTouches!=null&&m.changedTouches.length>0&&y.handleMouseUp(m.changedTouches[0])}),z(y,"handleDoubleClick",function(m){var _=y.props.onDoubleClick;if(Z(_)){var S=y.getMouseInfo(m);_(S,m)}}),z(y,"handleContextMenu",function(m){var _=y.props.onContextMenu;if(Z(_)){var S=y.getMouseInfo(m);_(S,m)}}),z(y,"triggerSyncEvent",function(m){y.props.syncId!==void 0&&hc.emit(pc,y.props.syncId,m,y.eventEmitterSymbol)}),z(y,"applySyncEvent",function(m){var _=y.props,S=_.layout,A=_.syncMethod,C=y.state.updateId,T=m.dataStartIndex,P=m.dataEndIndex;if(m.dataStartIndex!==void 0||m.dataEndIndex!==void 0)y.setState($({dataStartIndex:T,dataEndIndex:P},d({props:y.props,dataStartIndex:T,dataEndIndex:P,updateId:C},y.state)));else if(m.activeTooltipIndex!==void 0){var M=m.chartX,I=m.chartY,j=m.activeTooltipIndex,R=y.state,N=R.offset,k=R.tooltipTicks;if(!N)return;if(typeof A=="function")j=A(k,m);else if(A==="value"){j=-1;for(var B=0;B=0){var V,D;if(M.dataKey&&!M.allowDuplicatedCategory){var fe=typeof M.dataKey=="function"?X:"payload.".concat(M.dataKey.toString());V=vc(B,fe,j),D=H&&G&&vc(G,fe,j)}else V=B?.[I],D=H&&G&&G[I];if(Ie||pe){var Y=m.props.activeIndex!==void 0?m.props.activeIndex:I;return[q.cloneElement(m,$($($({},A.props),Ee),{},{activeIndex:Y})),null,null]}if(!J(V))return[L].concat(mr(y.renderActivePoints({item:A,activePoint:V,basePoint:D,childIndex:I,isRange:H})))}else{var ye,ge=(ye=y.getItemByXY(y.state.activeCoordinate))!==null&&ye!==void 0?ye:{graphicalItem:L},Me=ge.graphicalItem,vt=Me.item,Gt=vt===void 0?m:vt,jn=Me.childIndex,Tt=$($($({},A.props),Ee),{},{activeIndex:jn});return[q.cloneElement(Gt,Tt),null,null]}return H?[L,null,null]:[L,null]}),z(y,"renderCustomized",function(m,_,S){return q.cloneElement(m,$($({key:"recharts-customized-".concat(S)},y.props),y.state))}),z(y,"renderMap",{CartesianGrid:{handler:Hn,once:!0},ReferenceArea:{handler:y.renderReferenceElement},ReferenceLine:{handler:Hn},ReferenceDot:{handler:y.renderReferenceElement},XAxis:{handler:Hn},YAxis:{handler:Hn},Brush:{handler:y.renderBrush,once:!0},Bar:{handler:y.renderGraphicChild},Line:{handler:y.renderGraphicChild},Area:{handler:y.renderGraphicChild},Radar:{handler:y.renderGraphicChild},RadialBar:{handler:y.renderGraphicChild},Scatter:{handler:y.renderGraphicChild},Pie:{handler:y.renderGraphicChild},Funnel:{handler:y.renderGraphicChild},Tooltip:{handler:y.renderCursor,once:!0},PolarGrid:{handler:y.renderPolarGrid,once:!0},PolarAngleAxis:{handler:y.renderPolarAxis},PolarRadiusAxis:{handler:y.renderPolarAxis},Customized:{handler:y.renderCustomized}}),y.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:Li("recharts"),"-clip"),y.throttleTriggeredAfterMouseMove=ob(y.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),y.state={},y}return OR(b,p),bR(b,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,y=w.data,m=w.height,_=w.layout,S=Re(O,nt);if(S){var A=S.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,T=Tl(this.state,y,A,C),P=this.state.tooltipTicks[A].coordinate,M=(this.state.offset.top+m)/2,I=_==="horizontal",j=I?{x:P,y:M}:{y:P,x:M},R=this.state.formattedGraphicalItems.find(function(k){var B=k.item;return B.type.name==="Scatter"});R&&(j=$($({},j),R.props.points[A].tooltipPosition),T=R.props.points[A].tooltipPayload);var N={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:C,activePayload:T,activeCoordinate:j};this.setState(N),this.renderCursor(S),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var y,m;this.accessibilityManager.setDetails({offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(m=this.props.margin.top)!==null&&m!==void 0?m:0}})}return null}},{key:"componentDidUpdate",value:function(w){bc([Re(w.children,nt)],[Re(this.props.children,nt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Re(this.props.children,nt);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return u.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,y=O.getBoundingClientRect(),m=UO(y),_={chartX:Math.round(w.pageX-m.left),chartY:Math.round(w.pageY-m.top)},S=y.width/O.offsetWidth||1,A=this.inRange(_.chartX,_.chartY,S);if(!A)return null;var C=this.state,T=C.xAxisMap,P=C.yAxisMap,M=this.getTooltipEventType(),I=im(this.state,this.props.data,this.props.layout,A);if(M!=="axis"&&T&&P){var j=gt(T).scale,R=gt(P).scale,N=j&&j.invert?j.invert(_.chartX):null,k=R&&R.invert?R.invert(_.chartY):null;return $($({},_),{},{xValue:N,yValue:k},I)}return I?$($({},_),I):null}},{key:"inRange",value:function(w,O){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,m=this.props.layout,_=w/y,S=O/y;if(m==="horizontal"||m==="vertical"){var A=this.state.offset,C=_>=A.left&&_<=A.left+A.width&&S>=A.top&&S<=A.top+A.height;return C?{x:_,y:S}:null}var T=this.state,P=T.angleAxisMap,M=T.radiusAxisMap;if(P&&M){var I=gt(P);return Ey({x:_,y:S},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),y=Re(w,nt),m={};y&&O==="axis"&&(y.props.trigger==="click"?m={onClick:this.handleClick}:m={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=zn(this.props,this.handleOuterEvent);return $($({},_),m)}},{key:"addListener",value:function(){hc.on(pc,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){hc.removeListener(pc,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,y){for(var m=this.state.formattedGraphicalItems,_=0,S=m.length;_i.map(i=>d[i]); +import{r as v,j as a,c as U,e as sl,g as st,b as VM,f as UM}from"./vendor-react-CCIuKUIB.js";import{g as GM,G as WM,s as HM,c as KM,u as XM,a as YM,o as QM}from"./vendor-firebase-auth-DUGvAaJx.js";import{R as ZM,T as JM,U as e6,V as t6}from"./vendor-firebase-core-BireMWc7.js";import{g as n6,d as Me,a as Lt,s as rt,b as ke,o as Zc,i as ql,u as vt,c as _e,w as Je,e as Zn,l as Er,q as at,f as Ye,h as zo,j as r6,k as Jc,m as a6}from"./vendor-firebase-firestore-C0C-blIn.js";import{g as s6}from"./vendor-firebase-storage-CnCozLgy.js";import{g as i6}from"./vendor-firebase-analytics-FE_tmzXh.js";import{R as o6,T as l6,P as c6,C as d6,A as u6,a as f6,S as m6,b as h6,c as p6,d as x6,e as g6,D as b6,f as y6,O as v6,g as w6,h as j6,I as N6,V as S6,i as k6,j as A6,k as C6,l as T6,m as P6,n as M6,o as E6,p as _6,q as I6,r as O6,F as D6,s as R6,L as L6,t as $6,u as z6,v as F6,w as B6}from"./vendor-radix-DkXsqQ-A.js";import{M as q6,r as V6,a as U6}from"./vendor-markdown-CDZ6ydrN.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const G6="modulepreload",W6=function(e){return"/"+e},sy={},Lr=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=o(n.map(d=>{if(d=W6(d),d in sy)return;sy[d]=!0;const f=d.endsWith(".css"),u=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${u}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":G6,f||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Bg=v.createContext({});function qg(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const w5=typeof window<"u",j5=w5?v.useLayoutEffect:v.useEffect,ed=v.createContext(null);function Vg(e,t){e.indexOf(t)===-1&&e.push(t)}function Vl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ur=(e,t,n)=>n>t?t:n{};const _r={},N5=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function S5(e){return typeof e=="object"&&e!==null}const k5=e=>/^0[^.\s]+$/u.test(e);function Gg(e){let t;return()=>(t===void 0&&(t=e()),t)}const En=e=>e,H6=(e,t)=>n=>t(e(n)),Fo=(...e)=>e.reduce(H6),Wi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Wg{constructor(){this.subscriptions=[]}add(t){return Vg(this.subscriptions,t),()=>Vl(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;ie*1e3,Pn=e=>e/1e3;function A5(e,t){return t?e*(1e3/t):0}const C5=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,K6=1e-7,X6=12;function Y6(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=C5(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>K6&&++lY6(i,0,1,e,n);return i=>i===0||i===1?i:C5(s(i),t,r)}const T5=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,P5=e=>t=>1-e(1-t),M5=Bo(.33,1.53,.69,.99),Hg=P5(M5),E5=T5(Hg),_5=e=>(e*=2)<1?.5*Hg(e):.5*(2-Math.pow(2,-10*(e-1))),Kg=e=>1-Math.sin(Math.acos(e)),I5=P5(Kg),O5=T5(Kg),Q6=Bo(.42,0,1,1),Z6=Bo(0,0,.58,1),D5=Bo(.42,0,.58,1),J6=e=>Array.isArray(e)&&typeof e[0]!="number",R5=e=>Array.isArray(e)&&typeof e[0]=="number",eE={linear:En,easeIn:Q6,easeInOut:D5,easeOut:Z6,circIn:Kg,circInOut:O5,circOut:I5,backIn:Hg,backInOut:E5,backOut:M5,anticipate:_5},tE=e=>typeof e=="string",iy=e=>{if(R5(e)){Ug(e.length===4);const[t,n,r,s]=e;return Bo(t,n,r,s)}else if(tE(e))return eE[e];return e},il=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function nE(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(f){o.has(f)&&(d.schedule(f),e()),f(l)}const d={schedule:(f,u=!1,m=!1)=>{const g=m&&s?n:r;return u&&o.add(f),g.has(f)||g.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(l=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,i&&(i=!1,d.process(f))}};return d}const rE=40;function L5(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=il.reduce((y,N)=>(y[N]=nE(i),y),{}),{setup:l,read:c,resolveKeyframes:d,preUpdate:f,update:u,preRender:m,render:h,postRender:g}=o,x=()=>{const y=_r.useManualTiming?s.timestamp:performance.now();n=!1,_r.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,rE),1)),s.timestamp=y,s.isProcessing=!0,l.process(s),c.process(s),d.process(s),f.process(s),u.process(s),m.process(s),h.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(x))},p=()=>{n=!0,r=!0,s.isProcessing||e(x)};return{schedule:il.reduce((y,N)=>{const b=o[N];return y[N]=(w,k=!1,A=!1)=>(n||p(),b.schedule(w,k,A)),y},{}),cancel:y=>{for(let N=0;N(Il===void 0&&sn.set(qt.isProcessing||_r.useManualTiming?qt.timestamp:performance.now()),Il),set:e=>{Il=e,queueMicrotask(aE)}},$5=e=>t=>typeof t=="string"&&t.startsWith(e),z5=$5("--"),sE=$5("var(--"),Xg=e=>sE(e)?iE.test(e.split("/*")[0].trim()):!1,iE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function oy(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ti={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hi={...ti,transform:e=>ur(0,1,e)},ol={...ti,default:1},Li=e=>Math.round(e*1e5)/1e5,Yg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function oE(e){return e==null}const lE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qg=(e,t)=>n=>!!(typeof n=="string"&&lE.test(n)&&n.startsWith(e)||t&&!oE(n)&&Object.prototype.hasOwnProperty.call(n,t)),F5=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Yg);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},cE=e=>ur(0,255,e),tu={...ti,transform:e=>Math.round(cE(e))},Sa={test:Qg("rgb","red"),parse:F5("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+tu.transform(e)+", "+tu.transform(t)+", "+tu.transform(n)+", "+Li(Hi.transform(r))+")"};function dE(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Fp={test:Qg("#"),parse:dE,transform:Sa.transform},qo=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Vr=qo("deg"),or=qo("%"),ge=qo("px"),uE=qo("vh"),fE=qo("vw"),ly={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},hs={test:Qg("hsl","hue"),parse:F5("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(Li(t))+", "+or.transform(Li(n))+", "+Li(Hi.transform(r))+")"},St={test:e=>Sa.test(e)||Fp.test(e)||hs.test(e),parse:e=>Sa.test(e)?Sa.parse(e):hs.test(e)?hs.parse(e):Fp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Sa.transform(e):hs.transform(e),getAnimatableNone:e=>{const t=St.parse(e);return t.alpha=0,St.transform(t)}},mE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function hE(e){return isNaN(e)&&typeof e=="string"&&(e.match(Yg)?.length||0)+(e.match(mE)?.length||0)>0}const B5="number",q5="color",pE="var",xE="var(",cy="${}",gE=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ki(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(gE,c=>(St.test(c)?(r.color.push(i),s.push(q5),n.push(St.parse(c))):c.startsWith(xE)?(r.var.push(i),s.push(pE),n.push(c)):(r.number.push(i),s.push(B5),n.push(parseFloat(c))),++i,cy)).split(cy);return{values:n,split:l,indexes:r,types:s}}function V5(e){return Ki(e).values}function U5(e){const{split:t,types:n}=Ki(e),r=t.length;return s=>{let i="";for(let o=0;otypeof e=="number"?0:St.test(e)?St.getAnimatableNone(e):e;function yE(e){const t=V5(e);return U5(e)(t.map(bE))}const ea={test:hE,parse:V5,createTransformer:U5,getAnimatableNone:yE};function nu(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function vE({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=nu(c,l,e+1/3),i=nu(c,l,e),o=nu(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Ul(e,t){return n=>n>0?t:e}const ft=(e,t,n)=>e+(t-e)*n,ru=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},wE=[Fp,Sa,hs],jE=e=>wE.find(t=>t.test(e));function dy(e){const t=jE(e);if(!t)return!1;let n=t.parse(e);return t===hs&&(n=vE(n)),n}const uy=(e,t)=>{const n=dy(e),r=dy(t);if(!n||!r)return Ul(e,t);const s={...n};return i=>(s.red=ru(n.red,r.red,i),s.green=ru(n.green,r.green,i),s.blue=ru(n.blue,r.blue,i),s.alpha=ft(n.alpha,r.alpha,i),Sa.transform(s))},Bp=new Set(["none","hidden"]);function NE(e,t){return Bp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function SE(e,t){return n=>ft(e,t,n)}function Zg(e){return typeof e=="number"?SE:typeof e=="string"?Xg(e)?Ul:St.test(e)?uy:CE:Array.isArray(e)?G5:typeof e=="object"?St.test(e)?uy:kE:Ul}function G5(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zg(i)(i,t[o]));return i=>{for(let o=0;o{for(const i in r)n[i]=r[i](s);return n}}function AE(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=ea.createTransformer(t),r=Ki(e),s=Ki(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Bp.has(e)&&!s.values.length||Bp.has(t)&&!r.values.length?NE(e,t):Fo(G5(AE(r,s),s.values),n):Ul(e,t)};function W5(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ft(e,t,n):Zg(e)(e,t)}const TE=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>nt.update(t,n),stop:()=>Jr(t),now:()=>qt.isProcessing?qt.timestamp:sn.now()}},H5=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i=Gl?1/0:t}function PE(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Jg(r),Gl);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Pn(s)}}const ME=5;function K5(e,t,n){const r=Math.max(t-ME,0);return A5(n-e(r),t-r)}const xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},au=.001;function EE({duration:e=xt.duration,bounce:t=xt.bounce,velocity:n=xt.velocity,mass:r=xt.mass}){let s,i,o=1-t;o=ur(xt.minDamping,xt.maxDamping,o),e=ur(xt.minDuration,xt.maxDuration,Pn(e)),o<1?(s=d=>{const f=d*o,u=f*e,m=f-n,h=qp(d,o),g=Math.exp(-u);return au-m/h*g},i=d=>{const u=d*o*e,m=u*n+n,h=Math.pow(o,2)*Math.pow(d,2)*e,g=Math.exp(-u),x=qp(Math.pow(d,2),o);return(-s(d)+au>0?-1:1)*((m-h)*g)/x}):(s=d=>{const f=Math.exp(-d*e),u=(d-n)*e+1;return-au+f*u},i=d=>{const f=Math.exp(-d*e),u=(n-d)*(e*e);return f*u});const l=5/e,c=IE(s,i,l);if(e=Wn(e),isNaN(c))return{stiffness:xt.stiffness,damping:xt.damping,duration:e};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:e}}}const _E=12;function IE(e,t,n){let r=n;for(let s=1;s<_E;s++)r=r-e(r)/t(r);return r}function qp(e,t){return e*Math.sqrt(1-t*t)}const OE=["duration","bounce"],DE=["stiffness","damping","mass"];function fy(e,t){return t.some(n=>e[n]!==void 0)}function RE(e){let t={velocity:xt.velocity,stiffness:xt.stiffness,damping:xt.damping,mass:xt.mass,isResolvedFromDuration:!1,...e};if(!fy(e,DE)&&fy(e,OE))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ur(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:xt.mass,stiffness:s,damping:i}}else{const n=EE(e);t={...t,...n,mass:xt.mass},t.isResolvedFromDuration=!0}return t}function Wl(e=xt.visualDuration,t=xt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:d,mass:f,duration:u,velocity:m,isResolvedFromDuration:h}=RE({...n,velocity:-Pn(n.velocity||0)}),g=m||0,x=d/(2*Math.sqrt(c*f)),p=o-i,j=Pn(Math.sqrt(c/f)),S=Math.abs(p)<5;r||(r=S?xt.restSpeed.granular:xt.restSpeed.default),s||(s=S?xt.restDelta.granular:xt.restDelta.default);let y;if(x<1){const b=qp(j,x);y=w=>{const k=Math.exp(-x*j*w);return o-k*((g+x*j*p)/b*Math.sin(b*w)+p*Math.cos(b*w))}}else if(x===1)y=b=>o-Math.exp(-j*b)*(p+(g+j*p)*b);else{const b=j*Math.sqrt(x*x-1);y=w=>{const k=Math.exp(-x*j*w),A=Math.min(b*w,300);return o-k*((g+x*j*p)*Math.sinh(A)+b*p*Math.cosh(A))/b}}const N={calculatedDuration:h&&u||null,next:b=>{const w=y(b);if(h)l.done=b>=u;else{let k=b===0?g:0;x<1&&(k=b===0?Wn(g):K5(y,b,w));const A=Math.abs(k)<=r,C=Math.abs(o-w)<=s;l.done=A&&C}return l.value=l.done?o:w,l},toString:()=>{const b=Math.min(Jg(N),Gl),w=H5(k=>N.next(b*k).value,b,30);return b+"ms "+w},toTransition:()=>{}};return N}Wl.applyToOptions=e=>{const t=PE(e,100,Wl);return e.ease=t.ease,e.duration=Wn(t.duration),e.type="keyframes",e};function Vp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:f}){const u=e[0],m={done:!1,value:u},h=A=>l!==void 0&&Ac,g=A=>l===void 0?c:c===void 0||Math.abs(l-A)-x*Math.exp(-A/r),y=A=>j+S(A),N=A=>{const C=S(A),F=y(A);m.done=Math.abs(C)<=d,m.value=m.done?j:F};let b,w;const k=A=>{h(m.value)&&(b=A,w=Wl({keyframes:[m.value,g(m.value)],velocity:K5(y,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return k(0),{calculatedDuration:null,next:A=>{let C=!1;return!w&&b===void 0&&(C=!0,N(A),k(A)),b!==void 0&&A>=b?w.next(A-b):(!C&&N(A),m)}}}function LE(e,t,n){const r=[],s=n||_r.mix||W5,i=e.length-1;for(let o=0;ot[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=LE(t,r,s),c=l.length,d=f=>{if(o&&f1)for(;ud(ur(e[0],e[i-1],f)):d}function zE(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Wi(0,t,r);e.push(ft(n,1,s))}}function FE(e){const t=[0];return zE(t,e.length-1),t}function BE(e,t){return e.map(n=>n*t)}function qE(e,t){return e.map(()=>t||D5).splice(0,e.length-1)}function $i({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=J6(r)?r.map(iy):iy(r),i={done:!1,value:t[0]},o=BE(n&&n.length===t.length?n:FE(t),e),l=$E(o,t,{ease:Array.isArray(s)?s:qE(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const VE=e=>e!==null;function e0(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(VE),l=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const UE={decay:Vp,inertia:Vp,tween:$i,keyframes:$i,spring:Wl};function X5(e){typeof e.type=="string"&&(e.type=UE[e.type])}class t0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const GE=e=>e/100;class n0 extends t0{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==sn.now()&&this.tick(sn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;X5(t);const{type:n=$i,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:l}=t;const c=n||$i;c!==$i&&typeof l[0]!="number"&&(this.mixKeyframes=Fo(GE,W5(l[0],l[1])),l=[0,100]);const d=c({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Jg(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:u,repeatType:m,repeatDelay:h,type:g,onUpdate:x,finalKeyframe:p}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const j=this.currentTime-d*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?j<0:j>s;this.currentTime=Math.max(j,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let y=this.currentTime,N=r;if(u){const A=Math.min(this.currentTime,s)/l;let C=Math.floor(A),F=A%1;!F&&A>=1&&(F=1),F===1&&C--,C=Math.min(C,u+1),!!(C%2)&&(m==="reverse"?(F=1-F,h&&(F-=h/l)):m==="mirror"&&(N=o)),y=ur(0,1,F)*l}const b=S?{done:!1,value:f[0]}:N.next(y);i&&(b.value=i(b.value));let{done:w}=b;!S&&c!==null&&(w=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return k&&g!==Vp&&(b.value=e0(f,this.options,p,this.speed)),x&&x(b.value),k&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return Pn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Pn(t)}get time(){return Pn(this.currentTime)}set time(t){t=Wn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(sn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Pn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=TE,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(sn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function WE(e){for(let t=1;te*180/Math.PI,Up=e=>{const t=ka(Math.atan2(e[1],e[0]));return Gp(t)},HE={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Up,rotateZ:Up,skewX:e=>ka(Math.atan(e[1])),skewY:e=>ka(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Gp=e=>(e=e%360,e<0&&(e+=360),e),my=Up,hy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),py=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),KE={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hy,scaleY:py,scale:e=>(hy(e)+py(e))/2,rotateX:e=>Gp(ka(Math.atan2(e[6],e[5]))),rotateY:e=>Gp(ka(Math.atan2(-e[2],e[0]))),rotateZ:my,rotate:my,skewX:e=>ka(Math.atan(e[4])),skewY:e=>ka(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Wp(e){return e.includes("scale")?1:0}function Hp(e,t){if(!e||e==="none")return Wp(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=KE,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=HE,s=l}if(!s)return Wp(t);const i=r[t],o=s[1].split(",").map(YE);return typeof i=="function"?i(o):o[i]}const XE=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Hp(n,t)};function YE(e){return parseFloat(e.trim())}const ni=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ri=new Set(ni),xy=e=>e===ti||e===ge,QE=new Set(["x","y","z"]),ZE=ni.filter(e=>!QE.has(e));function JE(e){const t=[];return ZE.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Hr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Hp(t,"x"),y:(e,{transform:t})=>Hp(t,"y")};Hr.translateX=Hr.x;Hr.translateY=Hr.y;const Ra=new Set;let Kp=!1,Xp=!1,Yp=!1;function Y5(){if(Xp){const e=Array.from(Ra).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=JE(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{r.getValue(i)?.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Xp=!1,Kp=!1,Ra.forEach(e=>e.complete(Yp)),Ra.clear()}function Q5(){Ra.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Xp=!0)})}function e_(){Yp=!0,Q5(),Y5(),Yp=!1}class r0{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ra.add(this),Kp||(Kp=!0,nt.read(Q5),nt.resolveKeyframes(Y5))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s?.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}WE(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ra.delete(this)}cancel(){this.state==="scheduled"&&(Ra.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const t_=e=>e.startsWith("--");function n_(e,t,n){t_(t)?e.style.setProperty(t,n):e.style[t]=n}const r_=Gg(()=>window.ScrollTimeline!==void 0),a_={};function s_(e,t){const n=Gg(e);return()=>a_[t]??n()}const Z5=s_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ii=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,gy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ii([0,.65,.55,1]),circOut:Ii([.55,0,1,.45]),backIn:Ii([.31,.01,.66,-.59]),backOut:Ii([.33,1.53,.69,.99])};function J5(e,t){if(e)return typeof e=="function"?Z5()?H5(e,t):"ease-out":R5(e)?Ii(e):Array.isArray(e)?e.map(n=>J5(n,t)||gy.easeOut):gy[e]}function i_(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:c}={},d=void 0){const f={[t]:n};c&&(f.offset=c);const u=J5(l,s);Array.isArray(u)&&(f.easing=u);const m={delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),e.animate(f,m)}function eA(e){return typeof e=="function"&&"applyToOptions"in e}function o_({type:e,...t}){return eA(e)&&Z5()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class tA extends t0{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,Ug(typeof t.type!="string");const d=o_(t);this.animation=i_(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=e0(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(f):n_(n,r,f),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Pn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Pn(t)}get time(){return Pn(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Wn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&r_()?(this.animation.timeline=t,En):n(this)}}const nA={anticipate:_5,backInOut:E5,circInOut:O5};function l_(e){return e in nA}function c_(e){typeof e.ease=="string"&&l_(e.ease)&&(e.ease=nA[e.ease])}const su=10;class d_ extends tA{constructor(t){c_(t),X5(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new n0({...o,autoplay:!1}),c=Math.max(su,sn.now()-this.startTime),d=ur(0,su,c-su);n.setWithVelocity(l.sample(Math.max(0,c-d)).value,l.sample(c).value,d),l.stop()}}const by=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ea.test(e)||e==="0")&&!e.startsWith("url("));function u_(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function p_(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return h_()&&n&&m_.has(n)&&(n!=="transform"||!d)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const x_=40;class g_ extends t0{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:c,motionValue:d,element:f,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=sn.now();const m={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:c,motionValue:d,element:f,...u},h=f?.KeyframeResolver||r0;this.keyframeResolver=new h(l,(g,x,p)=>this.onKeyframesResolved(g,x,m,!p),c,d,f),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:f}=r;this.resolvedAt=sn.now(),f_(t,i,o,l)||((_r.instantAnimations||!c)&&f?.(e0(t,r,n)),t[0]=t[t.length-1],Qp(r),r.repeat=0);const m={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>x_?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!d&&p_(m),g=m.motionValue?.owner?.current,x=h?new d_({...m,element:g}):new n0(m);x.finished.then(()=>{this.notifyFinished()}).catch(En),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),e_()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function rA(e,t,n,r=0,s=1){const i=Array.from(e).sort((d,f)=>d.sortNodePosition(f)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const b_=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function y_(e){const t=b_.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function aA(e,t,n=1){const[r,s]=y_(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return N5(o)?parseFloat(o):o}return Xg(s)?aA(s,t,n+1):s}const v_={type:"spring",stiffness:500,damping:25,restSpeed:10},w_=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),j_={type:"keyframes",duration:.8},N_={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},S_=(e,{keyframes:t})=>t.length>2?j_:ri.has(e)?e.startsWith("scale")?w_(t[1]):v_:N_,k_=e=>e!==null;function A_(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(k_),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[i]}function sA(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function a0(e,t){const n=e?.[t]??e?.default??e;return n!==e?sA(n,e):n}function C_({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:l,from:c,elapsed:d,...f}){return!!Object.keys(f).length}const s0=(e,t,n,r={},s,i)=>o=>{const l=a0(r,e)||{},c=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Wn(c);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-d,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};C_(l)||Object.assign(f,S_(e,f)),f.duration&&(f.duration=Wn(f.duration)),f.repeatDelay&&(f.repeatDelay=Wn(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let u=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Qp(f),f.delay===0&&(u=!0)),(_r.instantAnimations||_r.skipAnimations||s?.shouldSkipAnimations)&&(u=!0,Qp(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,u&&!i&&t.get()!==void 0){const m=A_(f.keyframes,l);if(m!==void 0){nt.update(()=>{f.onUpdate(m),f.onComplete()});return}}return l.isSync?new n0(f):new g_(f)};function yy(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function i0(e,t,n,r){if(typeof t=="function"){const[s,i]=yy(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=yy(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Ns(e,t,n){const r=e.getProps();return i0(r,t,n!==void 0?n:r.custom,e)}const iA=new Set(["width","height","top","left","right","bottom",...ni]),vy=30,T_=e=>!isNaN(parseFloat(e));class P_{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=sn.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=T_(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Wg);const r=this.events[t].add(n);return t==="change"?()=>{r(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vy);return A5(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ms(e,t){return new P_(e,t)}const Zp=e=>Array.isArray(e);function M_(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ms(n))}function E_(e){return Zp(e)?e[e.length-1]||0:e}function __(e,t){const n=Ns(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=E_(i[o]);M_(e,o,l)}}const Zt=e=>!!(e&&e.getVelocity);function I_(e){return!!(Zt(e)&&e.add)}function Jp(e,t){const n=e.getValue("willChange");if(I_(n))return n.add(t);if(!n&&_r.WillChange){const r=new _r.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function o0(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const O_="framerAppearId",oA="data-"+o0(O_);function lA(e){return e.props[oA]}function D_({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cA(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=t;const c=e.getDefaultTransition();i=i?sA(i,c):c;const d=i?.reduceMotion;r&&(i=r);const f=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const m in l){const h=e.getValue(m,e.latestValues[m]??null),g=l[m];if(g===void 0||u&&D_(u,m))continue;const x={delay:n,...a0(i||{},m)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(g)&&g===p&&!x.velocity)continue;let j=!1;if(window.MotionHandoffAnimation){const N=lA(e);if(N){const b=window.MotionHandoffAnimation(N,m,nt);b!==null&&(x.startTime=b,j=!0)}}Jp(e,m);const S=d??e.shouldReduceMotion;h.start(s0(m,h,g,S&&iA.has(m)?{type:!1}:x,e,j));const y=h.animation;y&&f.push(y)}if(o){const m=()=>nt.update(()=>{o&&__(e,o)});f.length?Promise.all(f).then(m):m()}return f}function ex(e,t,n={}){const r=Ns(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(cA(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:u}=s;return R_(e,t,c,d,f,u,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,d]=l==="beforeChildren"?[i,o]:[o,i];return c().then(()=>d())}else return Promise.all([i(),o(n.delay)])}function R_(e,t,n=0,r=0,s=0,i=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(ex(c,t,{...o,delay:n+(typeof r=="function"?0:r)+rA(e.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function L_(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ex(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ex(e,t,n);else{const s=typeof t=="function"?Ns(e,t,n.custom):t;r=Promise.all(cA(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const $_={test:e=>e==="auto",parse:e=>e},dA=e=>t=>t.test(e),uA=[ti,ge,or,Vr,fE,uE,$_],wy=e=>uA.find(dA(e));function z_(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||k5(e):!0}const F_=new Set(["brightness","contrast","saturate","opacity"]);function B_(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yg)||[];if(!r)return e;const s=n.replace(r,"");let i=F_.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const q_=/\b([a-z-]*)\(.*?\)/gu,tx={...ea,getAnimatableNone:e=>{const t=e.match(q_);return t?t.map(B_).join(" "):e}},jy={...ti,transform:Math.round},V_={rotate:Vr,rotateX:Vr,rotateY:Vr,rotateZ:Vr,scale:ol,scaleX:ol,scaleY:ol,scaleZ:ol,skew:Vr,skewX:Vr,skewY:Vr,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:Hi,originX:ly,originY:ly,originZ:ge},l0={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,inset:ge,insetBlock:ge,insetBlockStart:ge,insetBlockEnd:ge,insetInline:ge,insetInlineStart:ge,insetInlineEnd:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,paddingBlock:ge,paddingBlockStart:ge,paddingBlockEnd:ge,paddingInline:ge,paddingInlineStart:ge,paddingInlineEnd:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,marginBlock:ge,marginBlockStart:ge,marginBlockEnd:ge,marginInline:ge,marginInlineStart:ge,marginInlineEnd:ge,fontSize:ge,backgroundPositionX:ge,backgroundPositionY:ge,...V_,zIndex:jy,fillOpacity:Hi,strokeOpacity:Hi,numOctaves:jy},U_={...l0,color:St,backgroundColor:St,outlineColor:St,fill:St,stroke:St,borderColor:St,borderTopColor:St,borderRightColor:St,borderBottomColor:St,borderLeftColor:St,filter:tx,WebkitFilter:tx},fA=e=>U_[e];function mA(e,t){let n=fA(e);return n!==tx&&(n=ea),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const G_=new Set(["auto","none","0"]);function W_(e,t,n){let r=0,s;for(;r{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const K_=new Set(["opacity","clipPath","filter","transform"]);function hA(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const pA=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function nx(e){return S5(e)&&"offsetHeight"in e}const{schedule:c0}=L5(queueMicrotask,!1),Fn={x:!1,y:!1};function xA(){return Fn.x||Fn.y}function X_(e){return e==="x"||e==="y"?Fn[e]?null:(Fn[e]=!0,()=>{Fn[e]=!1}):Fn.x||Fn.y?null:(Fn.x=Fn.y=!0,()=>{Fn.x=Fn.y=!1})}function gA(e,t){const n=hA(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Y_(e){return!(e.pointerType==="touch"||xA())}function Q_(e,t,n={}){const[r,s,i]=gA(e,n);return r.forEach(o=>{let l=!1,c=!1,d;const f=()=>{o.removeEventListener("pointerleave",g)},u=p=>{d&&(d(p),d=void 0),f()},m=p=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,u(p))},h=()=>{l=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},g=p=>{if(p.pointerType!=="touch"){if(l){c=!0;return}u(p)}},x=p=>{if(!Y_(p))return;c=!1;const j=t(o,p);typeof j=="function"&&(d=j,o.addEventListener("pointerleave",g,s))};o.addEventListener("pointerenter",x,s),o.addEventListener("pointerdown",h,s)}),i}const bA=(e,t)=>t?e===t?!0:bA(e,t.parentElement):!1,d0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Z_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function J_(e){return Z_.has(e.tagName)||e.isContentEditable===!0}const e4=new Set(["INPUT","SELECT","TEXTAREA"]);function t4(e){return e4.has(e.tagName)||e.isContentEditable===!0}const Ol=new WeakSet;function Ny(e){return t=>{t.key==="Enter"&&e(t)}}function iu(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const n4=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ny(()=>{if(Ol.has(n))return;iu(n,"down");const s=Ny(()=>{iu(n,"up")}),i=()=>iu(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Sy(e){return d0(e)&&!xA()}const ky=new WeakSet;function r4(e,t,n={}){const[r,s,i]=gA(e,n),o=l=>{const c=l.currentTarget;if(!Sy(l)||ky.has(l))return;Ol.add(c),n.stopPropagation&&ky.add(l);const d=t(c,l),f=(h,g)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",m),Ol.has(c)&&Ol.delete(c),Sy(h)&&typeof d=="function"&&d(h,{success:g})},u=h=>{f(h,c===window||c===document||n.useGlobalTarget||bA(c,h.target))},m=h=>{f(h,!1)};window.addEventListener("pointerup",u,s),window.addEventListener("pointercancel",m,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),nx(l)&&(l.addEventListener("focus",d=>n4(d,s)),!J_(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function u0(e){return S5(e)&&"ownerSVGElement"in e}const Dl=new WeakMap;let Rl;const yA=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:u0(r)&&"getBBox"in r?r.getBBox()[t]:r[n],a4=yA("inline","width","offsetWidth"),s4=yA("block","height","offsetHeight");function i4({target:e,borderBoxSize:t}){Dl.get(e)?.forEach(n=>{n(e,{get width(){return a4(e,t)},get height(){return s4(e,t)}})})}function o4(e){e.forEach(i4)}function l4(){typeof ResizeObserver>"u"||(Rl=new ResizeObserver(o4))}function c4(e,t){Rl||l4();const n=hA(e);return n.forEach(r=>{let s=Dl.get(r);s||(s=new Set,Dl.set(r,s)),s.add(t),Rl?.observe(r)}),()=>{n.forEach(r=>{const s=Dl.get(r);s?.delete(t),s?.size||Rl?.unobserve(r)})}}const Ll=new Set;let ps;function d4(){ps=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ll.forEach(t=>t(e))},window.addEventListener("resize",ps)}function u4(e){return Ll.add(e),ps||d4(),()=>{Ll.delete(e),!Ll.size&&typeof ps=="function"&&(window.removeEventListener("resize",ps),ps=void 0)}}function Ay(e,t){return typeof e=="function"?u4(e):c4(e,t)}function f4(e){return u0(e)&&e.tagName==="svg"}const m4=[...uA,St,ea],h4=e=>m4.find(dA(e)),Cy=()=>({translate:0,scale:1,origin:0,originPoint:0}),xs=()=>({x:Cy(),y:Cy()}),Ty=()=>({min:0,max:0}),Mt=()=>({x:Ty(),y:Ty()}),p4=new WeakMap;function td(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Xi(e){return typeof e=="string"||Array.isArray(e)}const f0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],m0=["initial",...f0];function nd(e){return td(e.animate)||m0.some(t=>Xi(e[t]))}function vA(e){return!!(nd(e)||e.variants)}function x4(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Zt(s))e.addValue(r,s);else if(Zt(i))e.addValue(r,Ms(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Ms(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const rx={current:null},wA={current:!1},g4=typeof window<"u";function b4(){if(wA.current=!0,!!g4)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>rx.current=e.matches;e.addEventListener("change",t),t()}else rx.current=!1}const Py=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Hl={};function jA(e){Hl=e}function y4(){return Hl}class v4{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=r0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=sn.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(wA.current||b4(),this.shouldReduceMotion=rx.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Jr(this.notifyUpdate),Jr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&K_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:d,duration:f}=n.accelerate,u=new tA({element:this.current,name:t,keyframes:l,times:c,ease:d,duration:Wn(f)}),m=o(u);this.valueSubscriptions.set(t,()=>{m(),u.cancel()});return}const r=ri.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&nt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Hl){const n=Hl[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ms(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(N5(r)||k5(r))?r=parseFloat(r):!h4(r)&&ea.test(n)&&(r=mA(t,n)),this.setBaseTarget(t,Zt(r)?r.get():r)),Zt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=i0(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Zt(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Wg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){c0.render(this.render)}}class NA extends v4{constructor(){super(...arguments),this.KeyframeResolver=H_}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Zt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ca{constructor(t){this.isMounted=!1,this.node=t}update(){}}function SA({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function w4({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function j4(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ou(e){return e===void 0||e===1}function ax({scale:e,scaleX:t,scaleY:n}){return!ou(e)||!ou(t)||!ou(n)}function va(e){return ax(e)||kA(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function kA(e){return My(e.x)||My(e.y)}function My(e){return e&&e!=="0%"}function Kl(e,t,n){const r=e-n,s=t*r;return n+s}function Ey(e,t,n,r,s){return s!==void 0&&(e=Kl(e,s,r)),Kl(e,n,r)+t}function sx(e,t=0,n=1,r,s){e.min=Ey(e.min,t,n,r,s),e.max=Ey(e.max,t,n,r,s)}function AA(e,{x:t,y:n}){sx(e.x,t.translate,t.scale,t.originPoint),sx(e.y,n.translate,n.scale,n.originPoint)}const _y=.999999999999,Iy=1.0000000000001;function N4(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l_y&&(t.x=1),t.y_y&&(t.y=1)}function gs(e,t){e.min=e.min+t,e.max=e.max+t}function Oy(e,t,n,r,s=.5){const i=ft(e.min,e.max,s);sx(e,t,n,i,r)}function bs(e,t){Oy(e.x,t.x,t.scaleX,t.scale,t.originX),Oy(e.y,t.y,t.scaleY,t.scale,t.originY)}function CA(e,t){return SA(j4(e.getBoundingClientRect(),t))}function S4(e,t,n){const r=CA(e,n),{scroll:s}=t;return s&&(gs(r.x,s.offset.x),gs(r.y,s.offset.y)),r}const k4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},A4=ni.length;function C4(e,t,n){let r="",s=!0;for(let i=0;i{if(!t.target)return e;if(typeof e=="string")if(ge.test(e))e=parseFloat(e);else return e;const n=Dy(e,t.target.x),r=Dy(e,t.target.y);return`${n}% ${r}%`}},T4={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ea.parse(e);if(s.length>5)return r;const i=ea.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const d=ft(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},ix={borderRadius:{...gi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gi,borderTopRightRadius:gi,borderBottomLeftRadius:gi,borderBottomRightRadius:gi,boxShadow:T4};function PA(e,{layout:t,layoutId:n}){return ri.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ix[e]||e==="opacity")}function p0(e,t,n){const r=e.style,s=t?.style,i={};if(!r)return i;for(const o in r)(Zt(r[o])||s&&Zt(s[o])||PA(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=r[o]);return i}function P4(e){return window.getComputedStyle(e)}class M4 extends NA{constructor(){super(...arguments),this.type="html",this.renderInstance=TA}readValueFromInstance(t,n){if(ri.has(n))return this.projection?.isProjecting?Wp(n):XE(t,n);{const r=P4(t),s=(z5(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return CA(t,n)}build(t,n,r){h0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return p0(t,n,r)}}const E4={offset:"stroke-dashoffset",array:"stroke-dasharray"},_4={offset:"strokeDashoffset",array:"strokeDasharray"};function I4(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?E4:_4;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const O4=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function MA(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},c,d,f){if(h0(e,l,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:u,style:m}=e;u.transform&&(m.transform=u.transform,delete u.transform),(m.transform||u.transformOrigin)&&(m.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),m.transform&&(m.transformBox=f?.transformBox??"fill-box",delete u.transformBox);for(const h of O4)u[h]!==void 0&&(m[h]=u[h],delete u[h]);t!==void 0&&(u.x=t),n!==void 0&&(u.y=n),r!==void 0&&(u.scale=r),s!==void 0&&I4(u,s,i,o,!1)}const EA=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),_A=e=>typeof e=="string"&&e.toLowerCase()==="svg";function D4(e,t,n,r){TA(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(EA.has(s)?s:o0(s),t.attrs[s])}function IA(e,t,n){const r=p0(e,t,n);for(const s in e)if(Zt(e[s])||Zt(t[s])){const i=ni.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class R4 extends NA{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Mt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ri.has(n)){const r=fA(n);return r&&r.default||0}return n=EA.has(n)?n:o0(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return IA(t,n,r)}build(t,n,r){MA(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){D4(t,n,r,s)}mount(t){this.isSVGTag=_A(t.tagName),super.mount(t)}}const L4=m0.length;function OA(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?OA(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>L_(e,n,r)))}function B4(e){let t=F4(e),n=Ry(),r=!0;const s=c=>(d,f)=>{const u=Ns(e,f,c==="exit"?e.presenceContext?.custom:void 0);if(u){const{transition:m,transitionEnd:h,...g}=u;d={...d,...g,...h}}return d};function i(c){t=c(e)}function o(c){const{props:d}=e,f=OA(e.parent)||{},u=[],m=new Set;let h={},g=1/0;for(let p=0;pg&&N,C=!1;const F=Array.isArray(y)?y:[y];let D=F.reduce(s(j),{});b===!1&&(D={});const{prevResolvedValues:L={}}=S,P={...L,...D},H=O=>{A=!0,m.has(O)&&(C=!0,m.delete(O)),S.needsAnimating[O]=!0;const E=e.getValue(O);E&&(E.liveStyle=!1)};for(const O in P){const E=D[O],B=L[O];if(h.hasOwnProperty(O))continue;let T=!1;Zp(E)&&Zp(B)?T=!DA(E,B):T=E!==B,T?E!=null?H(O):m.add(O):E!==void 0&&m.has(O)?H(O):S.protectedKeys[O]=!0}S.prevProp=y,S.prevResolvedValues=D,S.isActive&&(h={...h,...D}),r&&e.blockInitialAnimation&&(A=!1);const Y=w&&k;A&&(!Y||C)&&u.push(...F.map(O=>{const E={type:j};if(typeof O=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:B}=e,T=Ns(B,O);if(B.enteringChildren&&T){const{delayChildren:M}=T.transition||{};E.delay=rA(B.enteringChildren,e,M)}}return{animation:O,options:E}}))}if(m.size){const p={};if(typeof d.initial!="boolean"){const j=Ns(e,Array.isArray(d.initial)?d.initial[0]:d.initial);j&&j.transition&&(p.transition=j.transition)}m.forEach(j=>{const S=e.getBaseTarget(j),y=e.getValue(j);y&&(y.liveStyle=!0),p[j]=S??null}),u.push({animation:p})}let x=!!u.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(u):Promise.resolve()}function l(c,d){if(n[c].isActive===d)return Promise.resolve();e.variantChildren?.forEach(u=>u.animationState?.setActive(c,d)),n[c].isActive=d;const f=o(c);for(const u in n)n[u].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ry()}}}function q4(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!DA(t,e):!1}function xa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ry(){return{animate:xa(!0),whileInView:xa(),whileHover:xa(),whileTap:xa(),whileDrag:xa(),whileFocus:xa(),exit:xa()}}function Ly(e,t){e.min=t.min,e.max=t.max}function $n(e,t){Ly(e.x,t.x),Ly(e.y,t.y)}function $y(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const RA=1e-4,V4=1-RA,U4=1+RA,LA=.01,G4=0-LA,W4=0+LA;function on(e){return e.max-e.min}function H4(e,t,n){return Math.abs(e-t)<=n}function zy(e,t,n,r=.5){e.origin=r,e.originPoint=ft(t.min,t.max,e.origin),e.scale=on(n)/on(t),e.translate=ft(n.min,n.max,e.origin)-e.originPoint,(e.scale>=V4&&e.scale<=U4||isNaN(e.scale))&&(e.scale=1),(e.translate>=G4&&e.translate<=W4||isNaN(e.translate))&&(e.translate=0)}function zi(e,t,n,r){zy(e.x,t.x,n.x,r?r.originX:void 0),zy(e.y,t.y,n.y,r?r.originY:void 0)}function Fy(e,t,n){e.min=n.min+t.min,e.max=e.min+on(t)}function K4(e,t,n){Fy(e.x,t.x,n.x),Fy(e.y,t.y,n.y)}function By(e,t,n){e.min=t.min-n.min,e.max=e.min+on(t)}function Xl(e,t,n){By(e.x,t.x,n.x),By(e.y,t.y,n.y)}function qy(e,t,n,r,s){return e-=t,e=Kl(e,1/n,r),s!==void 0&&(e=Kl(e,1/s,r)),e}function X4(e,t=0,n=1,r=.5,s,i=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=ft(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ft(i.min,i.max,r);e===i&&(l-=t),e.min=qy(e.min,t,n,l,s),e.max=qy(e.max,t,n,l,s)}function Vy(e,t,[n,r,s],i,o){X4(e,t[n],t[r],t[s],t.scale,i,o)}const Y4=["x","scaleX","originX"],Q4=["y","scaleY","originY"];function Uy(e,t,n,r){Vy(e.x,t,Y4,n?n.x:void 0,r?r.x:void 0),Vy(e.y,t,Q4,n?n.y:void 0,r?r.y:void 0)}function Gy(e){return e.translate===0&&e.scale===1}function $A(e){return Gy(e.x)&&Gy(e.y)}function Wy(e,t){return e.min===t.min&&e.max===t.max}function Z4(e,t){return Wy(e.x,t.x)&&Wy(e.y,t.y)}function Hy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function zA(e,t){return Hy(e.x,t.x)&&Hy(e.y,t.y)}function Ky(e){return on(e.x)/on(e.y)}function Xy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ar(e){return[e("x"),e("y")]}function J4(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=n?.z||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:f,rotateX:u,rotateY:m,skewX:h,skewY:g}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),u&&(r+=`rotateX(${u}deg) `),m&&(r+=`rotateY(${m}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const FA=["TopLeft","TopRight","BottomLeft","BottomRight"],eI=FA.length,Yy=e=>typeof e=="string"?parseFloat(e):e,Qy=e=>typeof e=="number"||ge.test(e);function tI(e,t,n,r,s,i){s?(e.opacity=ft(0,n.opacity??1,nI(r)),e.opacityExit=ft(t.opacity??1,0,rI(r))):i&&(e.opacity=ft(t.opacity??1,n.opacity??1,r));for(let o=0;ort?1:n(Wi(e,t,r))}function aI(e,t,n){const r=Zt(e)?e:Ms(e);return r.start(s0("",r,t,n)),r.animation}function Yi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const sI=(e,t)=>e.depth-t.depth;class iI{constructor(){this.children=[],this.isDirty=!1}add(t){Vg(this.children,t),this.isDirty=!0}remove(t){Vl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sI),this.isDirty=!1,this.children.forEach(t)}}function oI(e,t){const n=sn.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Jr(r),e(i-t))};return nt.setup(r,!0),()=>Jr(r)}function $l(e){return Zt(e)?e.get():e}class lI{constructor(){this.members=[]}add(t){Vg(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;s&&s.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&Vl(this.members,r)}t.scheduleRender()}remove(t){if(Vl(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s],o=i.instance;if(i.isPresent!==!1&&(!o||o.isConnected!==!1)){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const s=r.options.layoutDependency,i=t.options.layoutDependency;if(!(s!==void 0&&i!==void 0&&s===i)){const c=r.instance;c&&c.isConnected===!1&&!r.snapshot||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:l}=t.options;l===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const zl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},lu=["","X","Y","Z"],cI=1e3;let dI=0;function cu(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qA(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lA(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",nt,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qA(r)}function VA({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t?.()){this.id=dI++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(mI),this.nodes.forEach(gI),this.nodes.forEach(bI),this.nodes.forEach(hI)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;nt.read(()=>{u=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==u&&(u=h,this.root.updateBlockedByResize=!0,f&&f(),f=oI(m,250),zl.hasAnimatedSinceResize&&(zl.hasAnimatedSinceResize=!1,this.nodes.forEach(tv)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:u,hasRelativeLayoutChanged:m,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||d.getDefaultTransition()||NI,{onLayoutAnimationStart:x,onLayoutAnimationComplete:p}=d.getProps(),j=!this.targetLayout||!zA(this.targetLayout,h),S=!u&&m;if(this.options.layoutRoot||this.resumeFrom||S||u&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...a0(g,"layout"),onPlay:x,onComplete:p};(d.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(f,S)}else u||tv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Jr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yI),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qA(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!on(this.snapshot.measuredBox.x)&&!on(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const b=N/1e3;nv(u.x,o.x,b),nv(u.y,o.y,b),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xl(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wI(this.relativeTarget,this.relativeTargetOrigin,m,b),y&&Z4(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Mt()),$n(y,this.relativeTarget)),x&&(this.animationValues=f,tI(f,d,this.latestValues,b,S,j)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{zl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ms(0)),this.currentAnimation=aI(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(cI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:f}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&UA(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Mt();const u=on(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+u;const m=on(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}$n(l,c),bs(l,f),zi(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new lI),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const d={};c.z&&cu("z",o,d,this.animationValues);for(let f=0;fo.currentAnimation?.stop()),this.root.nodes.forEach(Jy),this.root.sharedNodes.clear()}}}function uI(e){e.updateLayout()}function fI(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?ar(f=>{const u=i?t.measuredBox[f]:t.layoutBox[f],m=on(u);u.min=n[f].min,u.max=u.min+m}):UA(s,t.layoutBox,n)&&ar(f=>{const u=i?t.measuredBox[f]:t.layoutBox[f],m=on(n[f]);u.max=u.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const o=xs();zi(o,n,t.layoutBox);const l=xs();i?zi(l,e.applyTransform(r,!0),t.measuredBox):zi(l,n,t.layoutBox);const c=!$A(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:u,layout:m}=f;if(u&&m){const h=Mt();Xl(h,t.layoutBox,u.layoutBox);const g=Mt();Xl(g,n,m.layoutBox),zA(h,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:l,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function mI(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function hI(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function pI(e){e.clearSnapshot()}function Jy(e){e.clearMeasurements()}function ev(e){e.isLayoutDirty=!1}function xI(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function tv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function gI(e){e.resolveTargetDelta()}function bI(e){e.calcProjection()}function yI(e){e.resetSkewAndRotation()}function vI(e){e.removeLeadSnapshot()}function nv(e,t,n){e.translate=ft(t.translate,0,n),e.scale=ft(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rv(e,t,n,r){e.min=ft(t.min,n.min,r),e.max=ft(t.max,n.max,r)}function wI(e,t,n,r){rv(e.x,t.x,n.x,r),rv(e.y,t.y,n.y,r)}function jI(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const NI={duration:.45,ease:[.4,0,.1,1]},av=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sv=av("applewebkit/")&&!av("chrome/")?Math.round:En;function iv(e){e.min=sv(e.min),e.max=sv(e.max)}function SI(e){iv(e.x),iv(e.y)}function UA(e,t,n){return e==="position"||e==="preserve-aspect"&&!H4(Ky(t),Ky(n),.2)}function kI(e){return e!==e.root&&e.scroll?.wasRoot}const AI=VA({attachResizeListener:(e,t)=>Yi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),du={current:void 0},GA=VA({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!du.current){const e=new AI({});e.mount(window),e.setOptions({layoutScroll:!0}),du.current=e}return du.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),x0=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ov(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function CI(...e){return t=>{let n=!1;const r=e.map(s=>{const i=ov(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{width:m,height:h,top:g,left:x,right:p,bottom:j}=c.current;if(t||i===!1||!l.current||!m||!h)return;const S=n==="left"?`left: ${x}`:`right: ${p}`,y=r==="bottom"?`bottom: ${j}`:`top: ${g}`;l.current.dataset.motionPopId=o;const N=document.createElement("style");d&&(N.nonce=d);const b=s??document.head;return b.appendChild(N),N.sheet&&N.sheet.insertRule(` + [data-motion-pop-id="${o}"] { + position: absolute !important; + width: ${m}px !important; + height: ${h}px !important; + ${S}px !important; + ${y}px !important; + } + `),()=>{b.contains(N)&&b.removeChild(N)}},[t]),a.jsx(PI,{isPresent:t,childRef:l,sizeRef:c,pop:i,children:i===!1?e:v.cloneElement(e,{ref:u})})}const EI=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:c,root:d})=>{const f=qg(_I),u=v.useId();let m=!0,h=v.useMemo(()=>(m=!1,{id:u,initial:t,isPresent:n,custom:s,onExitComplete:g=>{f.set(g,!0);for(const x of f.values())if(!x)return;r&&r()},register:g=>(f.set(g,!1),()=>f.delete(g))}),[n,f,r]);return i&&m&&(h={...h}),v.useMemo(()=>{f.forEach((g,x)=>f.set(x,!1))},[n]),v.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),e=a.jsx(MI,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:c,root:d,children:e}),a.jsx(ed.Provider,{value:h,children:e})};function _I(){return new Map}function WA(e=!0){const t=v.useContext(ed);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=v.useId();v.useEffect(()=>{if(e)return s(i)},[e]);const o=v.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const ll=e=>e.key||"";function lv(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Ke=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:d})=>{const[f,u]=WA(o),m=v.useMemo(()=>lv(e),[e]),h=o&&!f?[]:m.map(ll),g=v.useRef(!0),x=v.useRef(m),p=qg(()=>new Map),j=v.useRef(new Set),[S,y]=v.useState(m),[N,b]=v.useState(m);j5(()=>{g.current=!1,x.current=m;for(let A=0;A{const C=ll(A),F=o&&!f?!1:m===N||h.includes(C),D=()=>{if(j.current.has(C))return;if(j.current.add(C),p.has(C))p.set(C,!0);else return;let L=!0;p.forEach(P=>{P||(L=!1)}),L&&(k?.(),b(x.current),o&&u?.(),r&&r())};return a.jsx(EI,{isPresent:F,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:F?void 0:D,anchorX:l,anchorY:c,children:A},C)})})},HA=v.createContext({strict:!1}),cv={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let dv=!1;function II(){if(dv)return;const e={};for(const t in cv)e[t]={isEnabled:n=>cv[t].some(r=>!!n[r])};jA(e),dv=!0}function KA(){return II(),y4()}function OI(e){const t=KA();for(const n in e)t[n]={...t[n],...e[n]};jA(t)}const DI=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||DI.has(e)}let XA=e=>!Yl(e);function RI(e){typeof e=="function"&&(XA=t=>t.startsWith("on")?!Yl(t):e(t))}try{RI(require("@emotion/is-prop-valid").default)}catch{}function LI(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(XA(s)||n===!0&&Yl(s)||!t&&!Yl(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const rd=v.createContext({});function $I(e,t){if(nd(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Xi(n)?n:void 0,animate:Xi(r)?r:void 0}}return e.inherit!==!1?t:{}}function zI(e){const{initial:t,animate:n}=$I(e,v.useContext(rd));return v.useMemo(()=>({initial:t,animate:n}),[uv(t),uv(n)])}function uv(e){return Array.isArray(e)?e.join(" "):e}const g0=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function YA(e,t,n){for(const r in t)!Zt(t[r])&&!PA(r,n)&&(e[r]=t[r])}function FI({transformTemplate:e},t){return v.useMemo(()=>{const n=g0();return h0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function BI(e,t){const n=e.style||{},r={};return YA(r,n,e),Object.assign(r,FI(e,t)),r}function qI(e,t){const n={},r=BI(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const QA=()=>({...g0(),attrs:{}});function VI(e,t,n,r){const s=v.useMemo(()=>{const i=QA();return MA(i,t,_A(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};YA(i,e.style,e),s.style={...i,...s.style}}return s}const UI=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function b0(e){return typeof e!="string"||e.includes("-")?!1:!!(UI.indexOf(e)>-1||/[A-Z]/u.test(e))}function GI(e,t,n,{latestValues:r},s,i=!1,o){const c=(o??b0(e)?VI:qI)(t,r,s,e),d=LI(t,typeof e=="string",i),f=e!==v.Fragment?{...d,...c,ref:n}:{},{children:u}=t,m=v.useMemo(()=>Zt(u)?u.get():u,[u]);return v.createElement(e,{...f,children:m})}function WI({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:HI(n,r,s,e),renderState:t()}}function HI(e,t,n,r){const s={},i=r(e,{});for(const m in i)s[m]=$l(i[m]);let{initial:o,animate:l}=e;const c=nd(e),d=vA(e);t&&d&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const u=f?l:o;if(u&&typeof u!="boolean"&&!td(u)){const m=Array.isArray(u)?u:[u];for(let h=0;h(t,n)=>{const r=v.useContext(rd),s=v.useContext(ed),i=()=>WI(e,t,r,s);return n?i():qg(i)},KI=ZA({scrapeMotionValuesFromProps:p0,createRenderState:g0}),XI=ZA({scrapeMotionValuesFromProps:IA,createRenderState:QA}),YI=Symbol.for("motionComponentSymbol");function QI(e,t,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{i&&e.onMount?.(i),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const JA=v.createContext({});function ms(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ZI(e,t,n,r,s,i){const{visualElement:o}=v.useContext(rd),l=v.useContext(HA),c=v.useContext(ed),d=v.useContext(x0),f=d.reducedMotion,u=d.skipAnimations,m=v.useRef(null),h=v.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f,skipAnimations:u,isSVG:i}),h.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const g=m.current,x=v.useContext(JA);g&&!g.projection&&s&&(g.type==="html"||g.type==="svg")&&JI(m.current,n,s,x);const p=v.useRef(!1);v.useInsertionEffect(()=>{g&&p.current&&g.update(n,c)});const j=n[oA],S=v.useRef(!!j&&!window.MotionHandoffIsComplete?.(j)&&window.MotionHasOptimisedAnimation?.(j));return j5(()=>{h.current=!0,g&&(p.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),S.current&&g.animationState&&g.animationState.animateChanges())}),v.useEffect(()=>{g&&(!S.current&&g.animationState&&g.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(j)}),S.current=!1),g.enteringChildren=void 0)}),g}function JI(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:eC(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&ms(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:d})}function eC(e){if(e)return e.options.allowProjection!==!1?e.projection:eC(e.parent)}function uu(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&OI(r);const i=n?n==="svg":b0(e),o=i?XI:KI;function l(d,f){let u;const m={...v.useContext(x0),...d,layoutId:eO(d)},{isStatic:h}=m,g=zI(d),x=o(d,h);if(!h&&w5){tO();const p=nO(m);u=p.MeasureLayout,g.visualElement=ZI(e,x,m,s,p.ProjectionNode,i)}return a.jsxs(rd.Provider,{value:g,children:[u&&g.visualElement?a.jsx(u,{visualElement:g.visualElement,...m}):null,GI(e,d,QI(x,g.visualElement,f),x,h,t,i)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=v.forwardRef(l);return c[YI]=e,c}function eO({layoutId:e}){const t=v.useContext(Bg).id;return t&&e!==void 0?t+"-"+e:e}function tO(e,t){v.useContext(HA).strict}function nO(e){const t=KA(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function rO(e,t){if(typeof Proxy>"u")return uu;const n=new Map,r=(i,o)=>uu(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,uu(o,void 0,e,t)),n.get(o))})}const aO=(e,t)=>t.isSVG??b0(e)?new R4(t):new M4(t,{allowProjection:e!==v.Fragment});class sO extends ca{constructor(t){super(t),t.animationState||(t.animationState=B4(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();td(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let iO=0;class oO extends ca{constructor(){super(...arguments),this.id=iO++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const lO={animation:{Feature:sO},exit:{Feature:oO}};function Vo(e){return{point:{x:e.pageX,y:e.pageY}}}const cO=e=>t=>d0(t)&&e(t,Vo(t));function Fi(e,t,n,r){return Yi(e,t,cO(n),r)}const tC=({current:e})=>e?e.ownerDocument.defaultView:null,fv=(e,t)=>Math.abs(e-t);function dO(e,t){const n=fv(e.x,t.x),r=fv(e.y,t.y);return Math.sqrt(n**2+r**2)}const mv=new Set(["auto","scroll"]);class nC{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=mu(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=dO(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;const{point:p}=h,{timestamp:j}=qt;this.history.push({...p,timestamp:j});const{onStart:S,onMove:y}=this.handlers;g||(S&&S(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=fu(g,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();const{onEnd:x,onSessionEnd:p,resumeAnimation:j}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=mu(h.type==="pointercancel"?this.lastMoveEventInfo:fu(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,S),p&&p(h,S)},!d0(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=Vo(t),d=fu(c,this.transformPagePoint),{point:f}=d,{timestamp:u}=qt;this.history=[{...f,timestamp:u}];const{onSessionStart:m}=n;m&&m(t,mu(d,this.history)),this.removeListeners=Fo(Fi(this.contextWindow,"pointermove",this.handlePointerMove),Fi(this.contextWindow,"pointerup",this.handlePointerUp),Fi(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(mv.has(r.overflowX)||mv.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),nt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Jr(this.updatePoint)}}function fu(e,t){return t?{point:t(e.point)}:e}function hv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mu({point:e},t){return{point:e,delta:hv(e,rC(t)),offset:hv(e,uO(t)),velocity:fO(t,.1)}}function uO(e){return e[0]}function rC(e){return e[e.length-1]}function fO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=rC(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Wn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Wn(t)*2&&(r=e[1]);const i=Pn(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function mO(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?ft(n,e,r.max):Math.min(e,n)),e}function pv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function hO(e,{top:t,left:n,bottom:r,right:s}){return{x:pv(e.x,n,s),y:pv(e.y,t,r)}}function xv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Wi(t.min,t.max-r,e.min):r>s&&(n=Wi(e.min,e.max-s,t.min)),ur(0,1,n)}function gO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ox=.35;function bO(e=ox){return e===!1?e=0:e===!0&&(e=ox),{x:gv(e,"left","right"),y:gv(e,"top","bottom")}}function gv(e,t,n){return{min:bv(e,t),max:bv(e,n)}}function bv(e,t){return typeof e=="number"?e:e[t]||0}const yO=new WeakMap;class vO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=u=>{n&&this.snapToCursor(Vo(u).point),this.stopAnimation()},o=(u,m)=>{const{drag:h,dragPropagation:g,onDragStart:x}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=X_(h),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ar(j=>{let S=this.getAxisMotionValue(j).get()||0;if(or.test(S)){const{projection:y}=this.visualElement;if(y&&y.layout){const N=y.layout.layoutBox[j];N&&(S=on(N)*(parseFloat(S)/100))}}this.originPoint[j]=S}),x&&nt.update(()=>x(u,m),!1,!0),Jp(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},l=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:x,onDrag:p}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:j}=m;if(g&&this.currentDirection===null){this.currentDirection=jO(j),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",m.point,j),this.updateAxis("y",m.point,j),this.visualElement.render(),p&&nt.update(()=>p(u,m),!1,!0)},c=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m,this.stop(u,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:u}=this.getProps();(u||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new nC(t,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:tC(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&nt.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!cl(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=mO(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&ms(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=hO(r.layoutBox,t):this.constraints=!1,this.elastic=bO(n),s!==this.constraints&&!ms(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&ar(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=gO(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ms(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=S4(r,s.root,this.visualElement.getTransformPagePoint());let o=pO(s.layout.layoutBox,i);if(n){const l=n(w4(o));this.hasMutatedConstraints=!!l,l&&(o=SA(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=ar(f=>{if(!cl(f,n,this.currentDirection))return;let u=c&&c[f]||{};o&&(u={min:0,max:0});const m=s?200:1e6,h=s?40:1e7,g={type:"inertia",velocity:r?t[f]:0,bounceStiffness:m,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(f,g)});return Promise.all(d).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Jp(this.visualElement,t),r.start(s0(t,r,0,n,this.visualElement,!1))}stopAnimation(){ar(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ar(n=>{const{drag:r}=this.getProps();if(!cl(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],c=i.get()||0;i.set(t[n]-ft(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ms(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ar(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=xO({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),ar(o=>{if(!cl(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(ft(c,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;yO.set(this.visualElement,this);const t=this.visualElement.current,n=Fi(t,"pointerdown",d=>{const{drag:f,dragListener:u=!0}=this.getProps(),m=d.target,h=m!==t&&t4(m);f&&u&&!h&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();ms(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=wO(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),nt.read(s);const l=Yi(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(ar(u=>{const m=this.getAxisMotionValue(u);m&&(this.originPoint[u]+=d[u].translate,m.set(m.get()+d[u].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=ox,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function yv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function wO(e,t,n){const r=Ay(e,yv(n)),s=Ay(t,yv(n));return()=>{r(),s()}}function cl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function jO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class NO extends ca{constructor(t){super(t),this.removeGroupControls=En,this.removeListeners=En,this.controls=new vO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||En}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const hu=e=>(t,n)=>{e&&nt.update(()=>e(t,n),!1,!0)};class SO extends ca{constructor(){super(...arguments),this.removePointerDownListener=En}onPointerDown(t){this.session=new nC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:hu(t),onStart:hu(n),onMove:hu(r),onEnd:(i,o)=>{delete this.session,s&&nt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Fi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let pu=!1;class kO extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),pu&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),zl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),pu=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||nt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),c0.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;pu=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function aC(e){const[t,n]=WA(),r=v.useContext(Bg);return a.jsx(kO,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(JA),isPresent:t,safeToRemove:n})}const AO={pan:{Feature:SO},drag:{Feature:NO,ProjectionNode:GA,MeasureLayout:aC}};function vv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&nt.postRender(()=>i(t,Vo(t)))}class CO extends ca{mount(){const{current:t}=this.node;t&&(this.unmount=Q_(t,(n,r)=>(vv(this.node,r,"Start"),s=>vv(this.node,s,"End"))))}unmount(){}}class TO extends ca{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fo(Yi(this.node.current,"focus",()=>this.onFocus()),Yi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wv(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&nt.postRender(()=>i(t,Vo(t)))}class PO extends ca{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=r4(t,(s,i)=>(wv(this.node,i,"Start"),(o,{success:l})=>wv(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const lx=new WeakMap,xu=new WeakMap,MO=e=>{const t=lx.get(e.target);t&&t(e)},EO=e=>{e.forEach(MO)};function _O({root:e,...t}){const n=e||document;xu.has(n)||xu.set(n,{});const r=xu.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(EO,{root:e,...t})),r[s]}function IO(e,t,n){const r=_O(t);return lx.set(e,n),r.observe(e),()=>{lx.delete(e),r.unobserve(e)}}const OO={some:0,all:1};class DO extends ca{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:OO[s]},l=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:u}=this.node.getProps(),m=d?f:u;m&&m(c)};return IO(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(RO(t,n))&&this.startObserver()}unmount(){}}function RO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const LO={inView:{Feature:DO},tap:{Feature:PO},focus:{Feature:TO},hover:{Feature:CO}},$O={layout:{ProjectionNode:GA,MeasureLayout:aC}},zO={...lO,...LO,...AO,...$O},J=rO(zO,aO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FO=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),BO=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),jv=e=>{const t=BO(e);return t.charAt(0).toUpperCase()+t.slice(1)},sC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var qO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VO=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...l},c)=>v.createElement("svg",{ref:c,...qO,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:sC("lucide",s),...l},[...o.map(([d,f])=>v.createElement(d,f)),...Array.isArray(i)?i:[i]]));/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ce=(e,t)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(VO,{ref:i,iconNode:t,className:sC(`lucide-${FO(jv(e))}`,`lucide-${e}`,r),...s}));return n.displayName=jv(e),n};/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UO=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Nv=ce("activity",UO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GO=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],cx=ce("arrow-left",GO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ba=ce("arrow-right",WO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HO=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],yt=ce("award",HO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KO=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],XO=ce("badge-check",KO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],QO=ce("ban",YO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZO=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Ar=ce("bell",ZO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JO=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],e8=ce("binary",JO);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t8=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],n8=ce("book-marked",t8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r8=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],De=ce("book-open",r8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a8=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],s8=ce("bookmark",a8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i8=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],iC=ce("bot",i8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o8=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Sv=ce("box",o8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l8=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],kv=ce("braces",l8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c8=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],lr=ce("brain",c8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d8=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]],u8=ce("building",d8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const f8=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],Un=ce("calculator",f8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m8=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],h8=ce("calendar-days",m8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p8=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ta=ce("calendar",p8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const x8=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],g8=ce("camera",x8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const b8=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],wn=ce("chart-column",b8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y8=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],v8=ce("chart-no-axes-column",y8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const w8=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],j8=ce("chart-pie",w8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const N8=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],oC=ce("check-check",N8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const S8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jr=ce("check",S8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const k8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Hn=ce("chevron-down",k8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const A8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ya=ce("chevron-left",A8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const C8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],jn=ce("chevron-right",C8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const T8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Es=ce("chevron-up",T8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const P8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Xr=ce("circle-alert",P8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M8=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Kn=ce("circle-check-big",M8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const E8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],_8=ce("circle-check",E8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const I8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],lC=ce("circle-help",I8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Av=ce("circle-x",O8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Cv=ce("circle",D8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const R8=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],cC=ce("clipboard-check",R8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const L8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],On=ce("clock",L8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $8=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],z8=ce("copy",$8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F8=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Cr=ce("crown",F8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B8=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],ys=ce("database",B8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q8=[["circle",{cx:"12",cy:"6",r:"1",key:"1bh7o1"}],["line",{x1:"5",x2:"19",y1:"12",y2:"12",key:"13b5wn"}],["circle",{cx:"12",cy:"18",r:"1",key:"lqb9t5"}]],gu=ce("divide",q8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],qa=ce("download",V8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U8=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],G8=ce("external-link",U8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W8=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],dC=ce("eye-off",W8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H8=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bi=ce("eye",H8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K8=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],X8=ce("file-spreadsheet",K8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y8=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ad=ce("file-text",Y8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q8=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],Z8=ce("flag",Q8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J8=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],Nn=ce("flame",J8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eD=[["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"}]],tD=ce("footprints",eD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nD=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],uC=ce("funnel",nD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],y0=ce("globe",rD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aD=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],fr=ce("graduation-cap",aD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sD=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],iD=ce("grid-3x3",sD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oD=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],lD=ce("grip-horizontal",oD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cD=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],dD=ce("hand",cD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uD=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],fD=ce("hash",uD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Yr=ce("info",mD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hD=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],pD=ce("keyboard",hD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],fC=ce("layers",xD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Fl=ce("layout-dashboard",gD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bD=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Tv=ce("library",bD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yD=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],dx=ce("lightbulb",yD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vD=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],He=ce("loader-circle",vD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wD=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],_s=ce("lock",wD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jD=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],mC=ce("log-out",jD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ND=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],hC=ce("mail",ND);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SD=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],kD=ce("maximize-2",SD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AD=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],CD=ce("menu",AD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TD=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],v0=ce("message-square",TD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PD=[["path",{d:"M5 12h14",key:"1ays0h"}]],Qi=ce("minus",PD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MD=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],ED=ce("palette",MD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _D=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],Zi=ce("pen-line",_D);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ID=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],ux=ce("pen-tool",ID);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OD=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],Pv=ce("percent",OD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DD=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],RD=ce("phone",DD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LD=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],pC=ce("play",LD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $D=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qr=ce("plus",$D);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zD=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],sd=ce("refresh-cw",zD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FD=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],BD=ce("ruler",FD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qD=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],id=ce("save",qD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VD=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M14 15H9v-5",key:"pi4jk9"}],["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M21 3 9 15",key:"15kdhq"}]],UD=ce("scaling",VD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GD=[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7.382a1 1 0 0 1 .553-.894L6 10",key:"1xqip1"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 7.106-3.553a2 2 0 0 1 1.788 0L20 6",key:"9d2mlk"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]],WD=ce("school",GD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HD=[["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"}]],KD=ce("scissors",HD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XD=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],_n=ce("search",XD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YD=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Aa=ce("send",YD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QD=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ZD=ce("server",QD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JD=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],w0=ce("settings",JD);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tR=ce("shield-check",eR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],na=ce("shield",nR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rR=[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]],xC=ce("shirt",rR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aR=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],fx=ce("sigma",aR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sR=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],iR=ce("smartphone",sR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oR=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],ra=ce("sparkles",oR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],bu=ce("square-function",lR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cR=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],dR=ce("square-pen",cR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Mv=ce("square",uR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fR=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],aa=ce("star",fR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],cn=ce("target",mR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hR=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],sa=ce("trash-2",hR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pR=[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]],gC=ce("trending-down",pR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xR=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],ot=ce("trending-up",xR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Gt=ce("triangle-alert",gR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bR=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],Ev=ce("triangle",bR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yR=[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]],Jt=ce("trophy",yR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vR=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],wR=ce("type",vR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],NR=ce("user-check",jR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SR=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ji=ce("user",SR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],kt=ce("users",kR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AR=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],bC=ce("video",AR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CR=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],yu=ce("wand-sparkles",CR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xe=ce("x",TR);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PR=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Jn=ce("zap",PR);function yC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),vC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ql="-",_v=[],_R="arbitrary..",IR=e=>{const t=DR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return OR(o);const l=o.split(Ql),c=l[0]===""&&l.length>1?1:0;return wC(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?MR(d,c):c:d||_v}return n[o]||_v}}},wC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const d=wC(e,t+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=t===0?e.join(Ql):e.slice(t).join(Ql),c=o.length;for(let d=0;de.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?_R+r:void 0})(),DR=e=>{const{theme:t,classGroups:n}=e;return RR(n,t)},RR=(e,t)=>{const n=vC();for(const r in e){const s=e[r];j0(s,n,r,t)}return n},j0=(e,t,n,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){$R(e,t,n);return}if(typeof e=="function"){zR(e,t,n,r);return}FR(e,t,n,r)},$R=(e,t,n)=>{const r=e===""?t:jC(t,e);r.classGroupId=n},zR=(e,t,n,r)=>{if(BR(e)){j0(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ER(n,e))},FR=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let o=0;o{let n=e;const r=t.split(Ql),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,qR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},mx="!",Iv=":",VR=[],Ov=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),UR=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let o=0,l=0,c=0,d;const f=s.length;for(let x=0;xc?d-c:void 0;return Ov(i,h,m,g)};if(t){const s=t+Iv,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):Ov(VR,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},GR=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},WR=e=>({cache:qR(e.cacheSize),parseClassName:UR(e),sortModifiers:GR(e),...IR(e)}),HR=/\s+/,KR=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,o=[],l=e.trim().split(HR);let c="";for(let d=l.length-1;d>=0;d-=1){const f=l[d],{isExternal:u,modifiers:m,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:x}=n(f);if(u){c=f+(c.length>0?" "+c:c);continue}let p=!!x,j=r(p?g.substring(0,x):g);if(!j){if(!p){c=f+(c.length>0?" "+c:c);continue}if(j=r(g),!j){c=f+(c.length>0?" "+c:c);continue}p=!1}const S=m.length===0?"":m.length===1?m[0]:i(m).join(":"),y=h?S+mx:S,N=y+j;if(o.indexOf(N)>-1)continue;o.push(N);const b=s(j,p);for(let w=0;w0?" "+c:c)}return c},XR=(...e)=>{let t=0,n,r,s="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,s,i;const o=c=>{const d=t.reduce((f,u)=>u(f),e());return n=WR(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const f=KR(c,n);return s(c,f),f};return i=o,(...c)=>i(XR(...c))},QR=[],Ct=e=>{const t=n=>n[e]||QR;return t.isThemeGetter=!0,t},SC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ZR=/^\d+\/\d+$/,JR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ss=e=>ZR.test(e),Re=e=>!!e&&!Number.isNaN(Number(e)),Br=e=>!!e&&Number.isInteger(Number(e)),vu=e=>e.endsWith("%")&&Re(e.slice(0,-1)),yr=e=>JR.test(e),AC=()=>!0,aL=e=>eL.test(e)&&!tL.test(e),N0=()=>!1,sL=e=>nL.test(e),iL=e=>rL.test(e),oL=e=>!be(e)&&!ye(e),lL=e=>da(e,PC,N0),be=e=>SC.test(e),ga=e=>da(e,MC,aL),Dv=e=>da(e,xL,Re),cL=e=>da(e,_C,AC),dL=e=>da(e,EC,N0),Rv=e=>da(e,CC,N0),uL=e=>da(e,TC,iL),dl=e=>da(e,IC,sL),ye=e=>kC.test(e),bi=e=>Qa(e,MC),fL=e=>Qa(e,EC),Lv=e=>Qa(e,CC),mL=e=>Qa(e,PC),hL=e=>Qa(e,TC),ul=e=>Qa(e,IC,!0),pL=e=>Qa(e,_C,!0),da=(e,t,n)=>{const r=SC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Qa=(e,t,n=!1)=>{const r=kC.exec(e);return r?r[1]?t(r[1]):n:!1},CC=e=>e==="position"||e==="percentage",TC=e=>e==="image"||e==="url",PC=e=>e==="length"||e==="size"||e==="bg-size",MC=e=>e==="length",xL=e=>e==="number",EC=e=>e==="family-name",_C=e=>e==="number"||e==="weight",IC=e=>e==="shadow",gL=()=>{const e=Ct("color"),t=Ct("font"),n=Ct("text"),r=Ct("font-weight"),s=Ct("tracking"),i=Ct("leading"),o=Ct("breakpoint"),l=Ct("container"),c=Ct("spacing"),d=Ct("radius"),f=Ct("shadow"),u=Ct("inset-shadow"),m=Ct("text-shadow"),h=Ct("drop-shadow"),g=Ct("blur"),x=Ct("perspective"),p=Ct("aspect"),j=Ct("ease"),S=Ct("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...N(),ye,be],w=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],A=()=>[ye,be,c],C=()=>[ss,"full","auto",...A()],F=()=>[Br,"none","subgrid",ye,be],D=()=>["auto",{span:["full",Br,ye,be]},Br,ye,be],L=()=>[Br,"auto",ye,be],P=()=>["auto","min","max","fr",ye,be],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...A()],O=()=>[ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],E=()=>[e,ye,be],B=()=>[...N(),Lv,Rv,{position:[ye,be]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",mL,lL,{size:[ye,be]}],K=()=>[vu,bi,ga],X=()=>["","none","full",d,ye,be],I=()=>["",Re,bi,ga],Z=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[Re,vu,Lv,Rv],$=()=>["","none",g,ye,be],_=()=>["none",Re,ye,be],Q=()=>["none",Re,ye,be],R=()=>[Re,ye,be],G=()=>[ss,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yr],breakpoint:[yr],color:[AC],container:[yr],"drop-shadow":[yr],ease:["in","out","in-out"],font:[oL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yr],shadow:[yr],spacing:["px",Re],text:[yr],"text-shadow":[yr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ss,be,ye,p]}],container:["container"],columns:[{columns:[Re,be,ye,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[Br,"auto",ye,be]}],basis:[{basis:[ss,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,ss,"auto","initial","none",be]}],grow:[{grow:["",Re,ye,be]}],shrink:[{shrink:["",Re,ye,be]}],order:[{order:[Br,"first","last","none",ye,be]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[l,"screen",...O()]}],"min-w":[{"min-w":[l,"screen","none",...O()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,bi,ga]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pL,cL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vu,be]}],"font-family":[{font:[fL,dL,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ye,be]}],"line-clamp":[{"line-clamp":[Re,"none",ye,Dv]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",ye,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",ye,ga]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Re,"auto",ye,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Br,ye,be],radial:["",ye,be],conic:[Br,ye,be]},hL,uL]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Re,ye,be]}],"outline-w":[{outline:["",Re,bi,ga]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",f,ul,dl]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,ul,dl]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Re,ga]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,ul,dl]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Re,ye,be]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Re]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[ye,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,be]}],filter:[{filter:["","none",ye,be]}],blur:[{blur:$()}],brightness:[{brightness:[Re,ye,be]}],contrast:[{contrast:[Re,ye,be]}],"drop-shadow":[{"drop-shadow":["","none",h,ul,dl]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Re,ye,be]}],"hue-rotate":[{"hue-rotate":[Re,ye,be]}],invert:[{invert:["",Re,ye,be]}],saturate:[{saturate:[Re,ye,be]}],sepia:[{sepia:["",Re,ye,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,be]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[Re,ye,be]}],"backdrop-contrast":[{"backdrop-contrast":[Re,ye,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,ye,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,ye,be]}],"backdrop-invert":[{"backdrop-invert":["",Re,ye,be]}],"backdrop-opacity":[{"backdrop-opacity":[Re,ye,be]}],"backdrop-saturate":[{"backdrop-saturate":[Re,ye,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,ye,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Re,"initial",ye,be]}],ease:[{ease:["linear","initial",j,ye,be]}],delay:[{delay:[Re,ye,be]}],animate:[{animate:["none",S,ye,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,ye,be]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:_()}],"rotate-x":[{"rotate-x":_()}],"rotate-y":[{"rotate-y":_()}],"rotate-z":[{"rotate-z":_()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[ye,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,be]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Re,bi,ga,Dv]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},bL=YR(gL);function Be(...e){return bL(Fe(e))}const OC=({onClick:e,collapsed:t=!1,className:n})=>a.jsxs(J.button,{type:"button",whileTap:{scale:.98},whileHover:{x:2},onClick:e,title:t?"Log Out":void 0,className:Be("w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-bold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap",t&&"justify-center",n),children:[a.jsx(mC,{size:18,strokeWidth:1.5,className:"flex-shrink-0"}),!t&&a.jsx("span",{className:"font-body text-xs",children:"Log Out"})]}),DC=({activeTab:e,setActiveTab:t,userRole:n="student",onOpenSettings:r,onLogout:s,sidebarCollapsed:i=!1,setSidebarCollapsed:o,mode:l="desktop",onRequestClose:c})=>{const[d,f]=v.useState(!1),u=l==="mobile",m=!u&&i&&!d,h=!u,x=n==="admin"?[{label:"Management",items:[{icon:Fl,label:"Overview"},{icon:kt,label:"User Management"},{icon:De,label:"Content"}]},{label:"Insights",items:[{icon:wn,label:"Analytics"},{icon:na,label:"Audit Log"}]}]:n==="teacher"?[{label:"Teaching",items:[{icon:Fl,label:"Dashboard"},{icon:kt,label:"My Students"},{icon:De,label:"Classes"}]},{label:"Insights",items:[{icon:wn,label:"Analytics"}]}]:[{label:"Learn",items:[{icon:Fl,label:"Dashboard"},{icon:De,label:"Modules"},{icon:v0,label:"AI Chat"}]},{label:"Progress",items:[{icon:fr,label:"Grades",displayLabel:"Performance"},{icon:Jt,label:"Leaderboard",displayLabel:"Leadership Board"}]},{label:"Customization",items:[{icon:xC,label:"Avatar Studio",displayLabel:"Avatar Studio"}]}];return a.jsxs(J.aside,{initial:!1,animate:u?{width:280}:{width:i&&!d?80:280},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>h&&i&&f(!0),onMouseLeave:()=>f(!1),className:Be("h-full bg-[#f7f9fc] border border-[#dde3eb] shadow-sm flex flex-col",u?"rounded-2xl p-4":"rounded-3xl p-5"),children:[a.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[a.jsxs("div",{className:`mb-8 flex items-center ${m?"justify-center":"justify-between"}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI",className:"w-12 h-12 object-contain drop-shadow-md flex-shrink-0"}),(!m||d)&&a.jsx("div",{children:a.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),u&&c&&a.jsx("button",{onClick:c,className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:a.jsx(Xe,{size:20})}),!u&&o&&(!i||d)&&a.jsx(J.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>o(!i),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":i?"Expand sidebar":"Collapse sidebar",title:i?"Expand sidebar":"Collapse sidebar",children:i?a.jsx(jn,{size:20}):a.jsx(Ya,{size:20})})]}),a.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto space-y-5 pr-1",children:x.map((p,j)=>a.jsxs("div",{children:[m?a.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:a.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):p.label&&a.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:p.label}),a.jsx("div",{className:"space-y-1",children:p.items.map(S=>a.jsxs(J.button,{whileHover:{x:2},whileTap:{scale:.98},onClick:()=>t(S.label),className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${m?"justify-center":""} ${e===S.label?"bg-sky-50 border-sky-200 shadow-sm text-sky-700":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[a.jsx(S.icon,{size:18,strokeWidth:e===S.label?2.5:2,className:"flex-shrink-0"}),(!m||d)&&a.jsx("span",{className:"font-body font-bold text-xs",children:S.displayLabel||S.label}),e===S.label&&(!m||d)&&a.jsx(J.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-sky-500",transition:{type:"spring",duration:.4}})]},S.label))})]},j))})]}),a.jsxs("div",{className:"mt-4 space-y-2 border-t border-[#dde3eb] pt-4",children:[a.jsxs(J.button,{whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-bold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap ${m?"justify-center":""}`,onClick:r,title:m?"Settings":"",children:[a.jsx(w0,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!m||d)&&a.jsx("span",{className:"font-body text-xs",children:"Settings"})]}),s&&a.jsx("div",{className:"text-[#5a6578]",children:a.jsx(OC,{onClick:s,collapsed:m})})]})]})},yL=v.lazy(()=>Lr(()=>import("./DashboardAvatar-CK5sUmxI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),vL=({userName:e="Student",userLevel:t=1,avatarLayers:n,onContinueLearning:r,showAssessmentTooltip:s,onOpenAssessment:i})=>{const o=()=>{const l=new Date().getHours();return l<12?"Good Morning":l<18?"Good Afternoon":"Good Evening"};return a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"relative w-full mt-0 rounded-[2rem] p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/50 to-white border border-slate-200/80 card-elevated-lg",children:[a.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-[2rem] pointer-events-none",children:[a.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/50 to-transparent"}),a.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"}),a.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"}),a.jsx("div",{className:"absolute inset-0 bg-dot-pattern opacity-40"})]}),a.jsx("div",{className:"relative z-10 flex min-h-[140px] lg:min-h-[160px] items-center justify-between gap-6 pb-0",children:a.jsxs("div",{className:"flex-1 min-w-0 pr-40 lg:pr-[280px] py-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-sky-100 border border-sky-200",children:a.jsxs("span",{className:"text-xs md:text-sm font-body font-bold text-sky-700",children:["Level ",t]})}),a.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[a.jsx(Jn,{size:14,className:"inline -mt-0.5 text-rose-500 mr-1"}),a.jsx("span",{className:"text-xs md:text-sm font-body font-bold text-rose-700",children:"Active"})]})]}),a.jsxs("h1",{className:"text-xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[o(),", ",e,"! ",a.jsx(dD,{size:20,className:"inline -mt-1 ml-1"})]}),a.jsx("p",{className:"text-slate-500 mb-1 text-xs md:text-sm font-body font-bold",children:"Today is a great day to move one step forward in math mastery."}),a.jsx("p",{className:"text-[11px] md:text-xs text-slate-400 font-body mb-4",children:"Focus on your next recommended lesson and keep your momentum."}),a.jsxs(J.button,{onClick:r,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-2 rounded-xl font-body font-bold text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex items-center gap-2 group",children:["Continue Learning",a.jsx(Ba,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),s&&a.jsx(J.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:i,className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:a.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:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-amber-500",children:a.jsx(lr,{size:16})}),a.jsxs("p",{className:"text-xs lg:text-sm font-bold text-amber-900 leading-tight",children:["Don't forget to take the",a.jsx("br",{}),"Initial Assessment!"]})]}),a.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"})]})}),a.jsx("div",{className:"hidden md:block absolute right-0 lg:right-10 bottom-0 w-[150px] lg:w-[270px] pointer-events-none z-20",style:{clipPath:"inset(-100% -50% 0 -50%)"},children:a.jsx("div",{className:"relative w-full aspect-[4/5] translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:a.jsx(v.Suspense,{fallback:a.jsx("div",{className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:a.jsx(yL,{layers:n,className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})},wL=e=>{if(!e||e.includes("your_project")||e.includes("your_database")||e.includes("your_"))return!1;try{const t=new URL(e);return t.protocol!=="https:"?!1:t.hostname.endsWith(".firebaseio.com")||t.hostname.endsWith(".firebasedatabase.app")}catch{return!1}},hx="".trim(),eo=wL(hx)?hx:"";hx&&!eo&&console.warn("[FIREBASE] VITE_FIREBASE_DATABASE_URL is set but invalid. Expected an https URL ending in .firebaseio.com or .firebasedatabase.app. RTDB presence is disabled.");const Ss={apiKey:"AIzaSyBtKDbf3CoNSJHMX2W-Bfru8qEX2mKm03Y",authDomain:"mathpulse-ai-2026.firebaseapp.com",projectId:"mathpulse-ai-2026",storageBucket:"mathpulse-ai-2026.firebasestorage.app",messagingSenderId:"441656461",appId:"1:441656461:web:68f877c7bdde7065ec2ec4",measurementId:void 0,...eo?{databaseURL:eo}:{}};Ss.apiKey||console.error("[ERROR] Firebase API key is missing! Copy .env.example to .env.local and fill in your values.");console.log("[FIREBASE] Config:",{projectId:Ss.projectId,authDomain:Ss.authDomain,configured:!!Ss.apiKey});const ai=ZM(Ss),Ir=GM(ai),fe=n6(ai);s6(ai);const jL=JM(ai),NL="".toLowerCase()==="true";if(NL){const e="127.0.0.1".trim()||"127.0.0.1",t=5001,n=Number.isFinite(t)&&t>0?Math.floor(t):5001;e6(jL,e,n),console.log(`[FIREBASE] Functions emulator enabled at ${e}:${n}`)}eo&&t6(ai,eo);typeof window<"u"&&Ss.measurementId&&i6(ai);new WM;const px="mathpulse.pendingAuthRole",RC="mathpulse.lastAuthRole",SL=e=>{if(e==="admin")throw new Error("Admin account creation is restricted. Please contact an existing administrator.")},$v=e=>{try{localStorage.setItem(px,e),localStorage.setItem(RC,e)}catch{}},kL=()=>{try{const e=localStorage.getItem(px);return localStorage.removeItem(px),e==="student"||e==="teacher"||e==="admin"?e:null}catch{return null}},AL=()=>{try{const e=localStorage.getItem(RC);return e==="student"||e==="teacher"||e==="admin"?e:null}catch{return null}},CL=async(e,t,n,r,s={})=>{try{SL(r);const o=(await KM(Ir,e,t)).user;return await XM(o,{displayName:n}),await LC(o,r,s)}catch(i){const o=i;throw console.error("[ERROR] Error signing up:",{code:o.code,message:o.message,fullError:i}),new Error(o.message||"Failed to create account")}},zv=async(e,t)=>{try{console.log("[AUTH] Attempting sign in...",{email:e}),await YM(Ir,e,t),console.log("[OK] Sign in successful, AuthContext will handle profile creation")}catch(n){const r=n;throw console.error("[ERROR] Error signing in:",{code:r.code,message:r.message,fullError:n}),new Error(r.message||"Failed to sign in")}},TL=async()=>{try{await HM(Ir)}catch(e){throw console.error("Error signing out:",e),new Error(e instanceof Error?e.message:"Failed to sign out")}},LC=async(e,t,n)=>{const r=`${Date.now()}`.slice(-12).padStart(12,"0"),s={uid:e.uid,email:e.email||"",name:e.displayName||n.name||"User",role:t,photo:e.photoURL||"",createdAt:ke(),updatedAt:ke()},i=(()=>{switch(t){case"student":return{lrn:n.lrn||r,grade:n.grade||"Grade 11",section:n.section||"Section A",classSectionId:n.classSectionId||"",adviserTeacherId:n.adviserTeacherId||"",adviserTeacherName:n.adviserTeacherName||"",schoolYear:n.schoolYear||"",school:n.school||"",enrollmentDate:new Date().toISOString().split("T")[0],major:n.major||"General",gpa:n.gpa||"0.00",level:1,currentXP:0,totalXP:0,streak:0,atRiskSubjects:[],hasTakenDiagnostic:!1,iarAssessmentState:"not_started",startingQuarterG11:"Q1",recommendedPace:"normal"};case"teacher":return{teacherId:`TCH-${Date.now()}`,department:n.department||"Mathematics",subject:n.subject||"Mathematics",yearsOfExperience:n.yearsOfExperience||"0",qualification:n.qualification||"",students:[]};case"admin":return{adminId:`ADM-${Date.now()}`,position:n.position||"Administrator",department:n.department||"System"}}})(),o={...s,...i};return await rt(Me(fe,"users",e.uid),o),o},xx=async e=>{try{const t=Me(fe,"users",e),n=await Lt(t);return n.exists()?{...n.data(),uid:n.id}:null}catch(t){return console.error("Error getting user profile:",t),null}},$C=async(e,t)=>{try{const n=await xx(e);if(!n)throw new Error("Profile not found");const r=["name","email","phone","photo","avatarLayers"],s={student:["lrn","grade","section","school","enrollmentDate","major","gpa"],teacher:["department","subject","yearsOfExperience","qualification"],admin:["department","position"]},i=new Set([...r,...s[n.role]]),o={};Object.entries(t).forEach(([c,d])=>{d!==void 0&&i.has(c)&&(o[c]=d)});const l=Me(fe,"users",e);await rt(l,{...o,updatedAt:ke()},{merge:!0})}catch(n){throw console.error("Error updating user profile:",n),n}},zC=v.createContext({currentUser:null,userProfile:null,loading:!0,isLoggedIn:!1,userRole:"student",refreshProfile:async()=>{}}),$t=()=>{const e=v.useContext(zC);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},PL=({children:e})=>{const[t,n]=v.useState(null),[r,s]=v.useState(null),[i,o]=v.useState(!0),[l,c]=v.useState("student"),d=m=>{if(!m)return null;const h=m.trim().toLowerCase();return h==="testteacher@school.edu"?"teacher":h==="testadmin@school.edu"?"admin":h==="teststudent@school.edu"?"student":null};v.useEffect(()=>QM(Ir,async h=>{if(o(!0),n(h),h){const g=kL()||AL()||d(h.email)||"student",x=g==="admin"?"student":g;let p=await xx(h.uid);if(!p&&h.email){console.log("[WARN] AuthContext: Profile missing, auto-creating...");const j=x,S=h.displayName||"User";try{p=await LC(h,j,{name:S}),console.log("[OK] AuthContext: Profile auto-created:",{role:j,name:S}),j==="student"&&Lr(async()=>{const{triggerStudentEnrolled:y}=await Promise.resolve().then(()=>o$);return{triggerStudentEnrolled:y}},void 0).then(({triggerStudentEnrolled:y})=>y({lrn:p?.lrn||h.uid,name:S,email:h.email||"",gradeLevel:""})).catch(y=>console.error("[WARN] Automation: enrollment pipeline failed:",y))}catch(y){console.error("[ERROR] AuthContext: Failed to auto-create profile:",y)}}p?(c(p.role),s(p)):(c(x),s({uid:h.uid,email:h.email||"",name:h.displayName||"User",role:x,photo:h.photoURL||"",createdAt:new Date,updatedAt:new Date}))}else c("student"),s(null);o(!1)}),[]);const f=async()=>{if(t){const m=await xx(t.uid);m&&s(m)}},u={currentUser:t,userProfile:r,loading:i,isLoggedIn:!!t,userRole:r?.role||l,refreshProfile:f};return a.jsx(zC.Provider,{value:u,children:e})},od=async e=>{const t={userId:e,subjects:{},lessons:{},quizAttempts:[],totalLessonsCompleted:0,totalQuizzesCompleted:0,averageScore:0,updatedAt:new Date};return await rt(Me(fe,"progress",e),t),t},Is=async e=>{try{const t=Me(fe,"progress",e),n=await Lt(t);if(n.exists()){const r=n.data();return{...r,updatedAt:r.updatedAt?.toDate()||new Date}}return await od(e)}catch(t){return console.error("Error getting user progress:",t),null}},ML=(e,t)=>{const n=Me(fe,"progress",e);return Zc(n,r=>{if(!r.exists()){t(null);return}const s=r.data();t({...s,updatedAt:s.updatedAt?.toDate?.()||new Date})},r=>{console.error("Error subscribing to user progress:",r),t(null)})},EL=async(e,t,n)=>{const r=Math.max(0,Math.min(100,n)),s=Me(fe,"progress",e);await rt(s,{[`lessons.${t}.lessonId`]:t,[`lessons.${t}.progressPercent`]:r,updatedAt:ke()},{merge:!0})},Fv=async(e,t,n,r,s)=>{const i=Me(fe,"progress",e),o=await Lt(i);if(!o.exists())return 0;const c=o.data().subjects?.[t]?.modulesProgress?.[n];if(!c)return 0;const d=Math.max(1,r+s),f=c.lessonsCompleted?.length||0,u=c.quizzesCompleted?.length||0,m=Math.round((f+u)/d*100);return await rt(i,{[`subjects.${t}.modulesProgress.${n}.progress`]:m,[`subjects.${t}.modulesProgress.${n}.lastAccessedAt`]:ke(),updatedAt:ke()},{merge:!0}),m},_L=async(e,t,n,r,s,i=50)=>{try{const o=Me(fe,"progress",e);let l=await Lt(o);l.exists()||(await od(e),l=await Lt(o));const c=l.data(),d={lessonId:r,completed:!0,completedAt:new Date,timeSpent:s};c.subjects||(c.subjects={}),c.subjects[t]||(c.subjects[t]={subjectId:t,progress:0,completedModules:0,totalModules:0,modulesProgress:{}});const f=c.subjects[t];f.modulesProgress[n]||(f.modulesProgress[n]={moduleId:n,subjectId:t,progress:0,lessonsCompleted:[],quizzesCompleted:[],startedAt:new Date,lastAccessedAt:new Date});const u=f.modulesProgress[n],m=!u.lessonsCompleted.includes(r);m&&(u.lessonsCompleted.push(r),u.lastAccessedAt=new Date),await rt(o,{[`lessons.${r}`]:d,[`subjects.${t}.modulesProgress.${n}`]:u,...m&&{totalLessonsCompleted:ql(1)},updatedAt:ke()},{merge:!0}),await FC(e,i,"lesson_complete",`Completed lesson: ${r}`)}catch(o){throw console.error("Error completing lesson:",o),o}},IL=async(e,t,n,r,s,i,o)=>{try{const l=Me(fe,"progress",e);let c=await Lt(l);c.exists()||(await od(e),c=await Lt(l));const d=c.data(),f={quizId:r,attemptNumber:(d.quizAttempts?.filter(x=>x.quizId===r).length||0)+1,score:s,completedAt:new Date,timeSpent:o,answers:i},u=Math.floor(s/100*100);d.subjects||(d.subjects={}),d.subjects[t]||(d.subjects[t]={subjectId:t,progress:0,completedModules:0,totalModules:0,modulesProgress:{}});const m=d.subjects[t];m.modulesProgress[n]||(m.modulesProgress[n]={moduleId:n,subjectId:t,progress:0,lessonsCompleted:[],quizzesCompleted:[],startedAt:new Date,lastAccessedAt:new Date});const h=m.modulesProgress[n],g=!h.quizzesCompleted.includes(r);g&&(h.quizzesCompleted.push(r),h.lastAccessedAt=new Date),await vt(l,{quizAttempts:[...d.quizAttempts||[],f],[`subjects.${t}.modulesProgress.${n}`]:h,...g&&{totalQuizzesCompleted:ql(1)},updatedAt:ke()}),await FC(e,u,"quiz_complete",`Completed quiz: ${r} (Score: ${s}%)`)}catch(l){throw console.error("Error completing quiz:",l),l}},FC=async(e,t,n,r)=>{try{const s=Me(fe,"users",e);await vt(s,{currentXP:ql(t),totalXP:ql(t),updatedAt:ke()});const i=Me(_e(fe,"xpActivities"));await rt(i,{activityId:i.id,userId:e,type:n,xpEarned:t,description:r,timestamp:ke()})}catch(s){console.error("Error awarding XP:",s)}},Va=[{id:"gen-math",code:"GEN MATH",name:"General Mathematics",gradeLevel:"Grade 11",semester:"1st Semester",color:"from-blue-500 to-cyan-500",topics:[{id:"gen-math-001",name:"Patterns and Real-Life Relationships",unit:"Patterns, Relations, and Functions"},{id:"gen-math-002",name:"Functions as Mathematical Models",unit:"Patterns, Relations, and Functions"},{id:"gen-math-003",name:"Function Notation and Evaluation",unit:"Patterns, Relations, and Functions"},{id:"gen-math-004",name:"Domain and Range of Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-005",name:"Operations on Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-006",name:"Composite Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-007",name:"Inverse Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-008",name:"Graphs of Rational Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-009",name:"Graphs of Exponential Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-010",name:"Graphs of Logarithmic Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-011",name:"Simple and Compound Interest",unit:"Financial Mathematics"},{id:"gen-math-012",name:"Simple and General Annuities",unit:"Financial Mathematics"},{id:"gen-math-013",name:"Present and Future Value",unit:"Financial Mathematics"},{id:"gen-math-014",name:"Loans, Amortization, and Sinking Funds",unit:"Financial Mathematics"},{id:"gen-math-015",name:"Stocks, Bonds, and Market Indices",unit:"Financial Mathematics"},{id:"gen-math-016",name:"Business Decision-Making with Mathematical Models",unit:"Financial Mathematics"},{id:"gen-math-017",name:"Propositions and Logical Connectives",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-018",name:"Truth Values and Truth Tables",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-019",name:"Logical Equivalence and Implication",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-020",name:"Quantifiers and Negation",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-021",name:"Validity of Arguments",unit:"Logic and Mathematical Reasoning"}]},{id:"stats-prob",code:"STAT&PROB",name:"Statistics and Probability",gradeLevel:"Grade 11",semester:"2nd Semester",color:"from-sky-500 to-cyan-500",topics:[{id:"stat-001",name:"Random Variables",unit:"Random Variables"},{id:"stat-002",name:"Discrete Probability Distributions",unit:"Random Variables"},{id:"stat-003",name:"Mean and Variance of Discrete RV",unit:"Random Variables"},{id:"stat-004",name:"Normal Distribution",unit:"Normal Distribution"},{id:"stat-005",name:"Standard Normal Distribution and Z-scores",unit:"Normal Distribution"},{id:"stat-006",name:"Areas Under the Normal Curve",unit:"Normal Distribution"},{id:"stat-007",name:"Sampling Distributions",unit:"Sampling and Estimation"},{id:"stat-008",name:"Central Limit Theorem",unit:"Sampling and Estimation"},{id:"stat-009",name:"Point Estimation",unit:"Sampling and Estimation"},{id:"stat-010",name:"Confidence Intervals",unit:"Sampling and Estimation"},{id:"stat-011",name:"Hypothesis Testing Concepts",unit:"Hypothesis Testing"},{id:"stat-012",name:"T-test",unit:"Hypothesis Testing"},{id:"stat-013",name:"Z-test",unit:"Hypothesis Testing"},{id:"stat-014",name:"Correlation and Regression",unit:"Correlation and Regression"}]},{id:"pre-calc",code:"PRE-CALC",name:"Pre-Calculus",gradeLevel:"Grade 12",semester:"1st Semester",color:"from-orange-500 to-red-500",topics:[{id:"pre-calc-001",name:"Conic Sections - Parabola",unit:"Analytic Geometry"},{id:"pre-calc-002",name:"Conic Sections - Ellipse",unit:"Analytic Geometry"},{id:"pre-calc-003",name:"Conic Sections - Hyperbola",unit:"Analytic Geometry"},{id:"pre-calc-004",name:"Conic Sections - Circle",unit:"Analytic Geometry"},{id:"pre-calc-005",name:"Systems of Nonlinear Equations",unit:"Analytic Geometry"},{id:"pre-calc-006",name:"Sequences and Series",unit:"Series and Induction"},{id:"pre-calc-007",name:"Arithmetic Sequences",unit:"Series and Induction"},{id:"pre-calc-008",name:"Geometric Sequences",unit:"Series and Induction"},{id:"pre-calc-009",name:"Mathematical Induction",unit:"Series and Induction"},{id:"pre-calc-010",name:"Binomial Theorem",unit:"Series and Induction"},{id:"pre-calc-011",name:"Angles and Unit Circle",unit:"Trigonometry"},{id:"pre-calc-012",name:"Trigonometric Functions",unit:"Trigonometry"},{id:"pre-calc-013",name:"Trigonometric Identities",unit:"Trigonometry"},{id:"pre-calc-014",name:"Sum and Difference Formulas",unit:"Trigonometry"},{id:"pre-calc-015",name:"Inverse Trigonometric Functions",unit:"Trigonometry"},{id:"pre-calc-016",name:"Polar Coordinates",unit:"Trigonometry"}]},{id:"basic-calc",code:"BASIC CALC",name:"Basic Calculus",gradeLevel:"Grade 12",semester:"2nd Semester",color:"from-green-500 to-teal-500",topics:[{id:"calc-001",name:"Limits of Functions",unit:"Limits"},{id:"calc-002",name:"Limit Theorems",unit:"Limits"},{id:"calc-003",name:"One-Sided Limits",unit:"Limits"},{id:"calc-004",name:"Infinite Limits and Limits at Infinity",unit:"Limits"},{id:"calc-005",name:"Continuity of Functions",unit:"Limits"},{id:"calc-006",name:"Definition of the Derivative",unit:"Derivatives"},{id:"calc-007",name:"Differentiation Rules",unit:"Derivatives"},{id:"calc-008",name:"Chain Rule",unit:"Derivatives"},{id:"calc-009",name:"Implicit Differentiation",unit:"Derivatives"},{id:"calc-010",name:"Higher-Order Derivatives",unit:"Derivatives"},{id:"calc-011",name:"Related Rates",unit:"Derivatives"},{id:"calc-012",name:"Extrema and the First Derivative Test",unit:"Derivatives"},{id:"calc-013",name:"Concavity and the Second Derivative Test",unit:"Derivatives"},{id:"calc-014",name:"Optimization Problems",unit:"Derivatives"},{id:"calc-015",name:"Antiderivatives and Indefinite Integrals",unit:"Integration"},{id:"calc-016",name:"Definite Integrals and the FTC",unit:"Integration"},{id:"calc-017",name:"Integration by Substitution",unit:"Integration"},{id:"calc-018",name:"Area Under a Curve",unit:"Integration"}]}],OL=["Grade 11","Grade 12"];Va.filter(e=>e.gradeLevel==="Grade 11"),Va.filter(e=>e.gradeLevel==="Grade 12");const DL={"Grade 11":["gen-math","pre-calc","stats-prob","basic-calc"],"Grade 12":["pre-calc","basic-calc","gen-math","stats-prob"]};function RL(e){if(!e)return null;const t=e.trim().toLowerCase();return t==="grade 11"||t==="11"||t.includes("11")?"Grade 11":t==="grade 12"||t==="12"||t.includes("12")?"Grade 12":null}function ld(e){const t=RL(e);return t?DL[t]:Va.map(n=>n.id)}const ia=[{id:"gen-math",title:"General Mathematics",description:"Functions, business math, and logic for Grade 11 Senior High School students.",icon:Un,color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,totalModules:3,completedModules:0,rating:4.9,reviewCount:204,modules:[{id:"gm-1",title:"Functions and Their Graphs",description:"Evaluate, compose, and represent functions including rational, exponential, and logarithmic types.",color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,lessons:[{id:"gm-1-l1",title:"Patterns and Real-Life Relationships",duration:"15 min",completed:!1,locked:!1},{id:"gm-1-l2",title:"Functions as Mathematical Models",duration:"16 min",completed:!1,locked:!1},{id:"gm-1-l3",title:"Operations on Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l4",title:"Composite Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l5",title:"Function Notation and Evaluation",duration:"16 min",completed:!1,locked:!1},{id:"gm-1-l6",title:"Domain and Range of Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l7",title:"Inverse Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l8",title:"Graphs of Rational Functions",duration:"20 min",completed:!1,locked:!1},{id:"gm-1-l9",title:"Graphs of Exponential Functions",duration:"20 min",completed:!1,locked:!1},{id:"gm-1-l10",title:"Graphs of Logarithmic Functions",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"gm-1-q1",title:"Practice Quiz: Functions",questions:10,duration:"15 min",completed:!1,locked:!1,type:"practice"},{id:"gm-1-q2",title:"Module Quiz: Functions and Graphs",questions:15,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"gm-2",title:"Business Mathematics",description:"Simple and compound interest, annuities, stocks, and bonds.",color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,lessons:[{id:"gm-2-l1",title:"Simple and Compound Interest",duration:"18 min",completed:!1,locked:!1},{id:"gm-2-l2",title:"Simple and General Annuities",duration:"20 min",completed:!1,locked:!1},{id:"gm-2-l3",title:"Present and Future Value",duration:"18 min",completed:!1,locked:!1},{id:"gm-2-l4",title:"Loans, Amortization, and Sinking Funds",duration:"20 min",completed:!1,locked:!1},{id:"gm-2-l5",title:"Stocks, Bonds, and Market Indices",duration:"18 min",completed:!1,locked:!1},{id:"gm-2-l6",title:"Business Decision-Making with Mathematical Models",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"gm-2-q1",title:"Practice Quiz: Interest",questions:12,duration:"18 min",completed:!1,locked:!1,type:"practice"},{id:"gm-2-q2",title:"Module Quiz: Business Math",questions:15,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"gm-3",title:"Logic",description:"Propositions, truth tables, logical equivalence, and valid arguments.",color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,lessons:[{id:"gm-3-l1",title:"Propositions and Connectives",duration:"15 min",completed:!1,locked:!1},{id:"gm-3-l2",title:"Truth Values and Truth Tables",duration:"18 min",completed:!1,locked:!1},{id:"gm-3-l3",title:"Logical Equivalence and Implication",duration:"18 min",completed:!1,locked:!1},{id:"gm-3-l4",title:"Quantifiers and Negation",duration:"18 min",completed:!1,locked:!1},{id:"gm-3-l5",title:"Validity of Arguments",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"gm-3-q1",title:"Practice Quiz: Logic",questions:10,duration:"15 min",completed:!1,locked:!1,type:"practice"},{id:"gm-3-q2",title:"Module Quiz: Logic",questions:12,duration:"18 min",completed:!1,locked:!0,type:"module"}]}]},{id:"pre-calc",title:"Pre-Calculus",description:"Analytic geometry, trigonometry, and series for Grade 12 STEM students.",icon:ot,color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,totalModules:3,completedModules:0,rating:4.7,reviewCount:192,modules:[{id:"pc-1",title:"Analytic Geometry",description:"Conic sections: circles, parabolas, ellipses, and hyperbolas.",color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,lessons:[{id:"pc-1-l1",title:"Conic Sections - Parabola",duration:"22 min",completed:!1,locked:!1},{id:"pc-1-l2",title:"Conic Sections - Ellipse",duration:"24 min",completed:!1,locked:!1},{id:"pc-1-l3",title:"Conic Sections - Hyperbola",duration:"24 min",completed:!1,locked:!1},{id:"pc-1-l4",title:"Conic Sections - Circle",duration:"18 min",completed:!1,locked:!1},{id:"pc-1-l5",title:"Systems of Nonlinear Equations",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"pc-1-q1",title:"Practice Quiz: Conics",questions:14,duration:"20 min",completed:!1,locked:!1,type:"practice"},{id:"pc-1-q2",title:"Module Quiz: Analytic Geometry",questions:18,duration:"25 min",completed:!1,locked:!1,type:"module"}]},{id:"pc-2",title:"Series and Induction",description:"Sequences, series, mathematical induction, and the binomial theorem.",color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,lessons:[{id:"pc-2-l1",title:"Sequences and Series",duration:"18 min",completed:!1,locked:!1},{id:"pc-2-l2",title:"Arithmetic Sequences",duration:"18 min",completed:!1,locked:!1},{id:"pc-2-l3",title:"Geometric Sequences",duration:"20 min",completed:!1,locked:!1},{id:"pc-2-l4",title:"Mathematical Induction",duration:"24 min",completed:!1,locked:!1},{id:"pc-2-l5",title:"Binomial Theorem",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"pc-2-q1",title:"Practice Quiz: Sequences & Series",questions:12,duration:"18 min",completed:!1,locked:!1,type:"practice"},{id:"pc-2-q2",title:"Module Quiz: Series and Induction",questions:16,duration:"24 min",completed:!1,locked:!1,type:"module"}]},{id:"pc-3",title:"Trigonometry",description:"Trigonometric functions, identities, equations, and the unit circle.",color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,lessons:[{id:"pc-3-l1",title:"Angles and Unit Circle",duration:"18 min",completed:!1,locked:!1},{id:"pc-3-l2",title:"Trigonometric Functions",duration:"22 min",completed:!1,locked:!1},{id:"pc-3-l3",title:"Trigonometric Identities",duration:"22 min",completed:!1,locked:!1},{id:"pc-3-l4",title:"Sum and Difference Formulas",duration:"20 min",completed:!1,locked:!1},{id:"pc-3-l5",title:"Inverse Trigonometric Functions",duration:"20 min",completed:!1,locked:!1},{id:"pc-3-l6",title:"Polar Coordinates",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"pc-3-q1",title:"Practice Quiz: Trig Functions",questions:15,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"pc-3-q2",title:"Module Quiz: Trigonometry",questions:20,duration:"30 min",completed:!1,locked:!0,type:"module"}]}]},{id:"stats-prob",title:"Statistics and Probability",description:"Random variables, distributions, sampling, and hypothesis testing for Grade 11 students.",icon:wn,color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,totalModules:4,completedModules:0,rating:4.8,reviewCount:160,modules:[{id:"sp-1",title:"Random Variables and Probability Distributions",description:"Discrete random variables, probability distributions, mean, and variance.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-1-l1",title:"Random Variables",duration:"16 min",completed:!1,locked:!1},{id:"sp-1-l2",title:"Discrete Probability Distributions",duration:"18 min",completed:!1,locked:!1},{id:"sp-1-l3",title:"Mean and Variance of Discrete RV",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"sp-1-q1",title:"Practice Quiz: Random Variables",questions:10,duration:"15 min",completed:!1,locked:!1,type:"practice"},{id:"sp-1-q2",title:"Module Quiz: Probability Distributions",questions:15,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"sp-2",title:"Normal Distribution",description:"The normal curve, standard normal distribution, z-scores, and areas under the curve.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-2-l1",title:"Normal Distribution",duration:"16 min",completed:!1,locked:!1},{id:"sp-2-l2",title:"Standard Normal Distribution and Z-scores",duration:"18 min",completed:!1,locked:!1},{id:"sp-2-l3",title:"Areas Under the Normal Curve",duration:"18 min",completed:!1,locked:!1}],quizzes:[{id:"sp-2-q1",title:"Practice Quiz: Normal Distribution",questions:12,duration:"18 min",completed:!1,locked:!1,type:"practice"},{id:"sp-2-q2",title:"Module Quiz: Z-Scores & Normal Curve",questions:14,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"sp-3",title:"Sampling and Estimation",description:"Sampling distributions, central limit theorem, point estimation, and confidence intervals.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-3-l1",title:"Sampling Distributions",duration:"18 min",completed:!1,locked:!1},{id:"sp-3-l2",title:"Central Limit Theorem",duration:"20 min",completed:!1,locked:!1},{id:"sp-3-l3",title:"Point Estimation",duration:"18 min",completed:!1,locked:!1},{id:"sp-3-l4",title:"Confidence Intervals",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"sp-3-q1",title:"Practice Quiz: Sampling",questions:14,duration:"20 min",completed:!1,locked:!1,type:"practice"},{id:"sp-3-q2",title:"Module Quiz: Estimation",questions:16,duration:"24 min",completed:!1,locked:!0,type:"module"}]},{id:"sp-4",title:"Hypothesis Testing",description:"Hypothesis testing concepts, T-test, Z-test, and correlation & regression.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-4-l1",title:"Hypothesis Testing Concepts",duration:"20 min",completed:!1,locked:!1},{id:"sp-4-l2",title:"T-test",duration:"22 min",completed:!1,locked:!1},{id:"sp-4-l3",title:"Z-test",duration:"22 min",completed:!1,locked:!1},{id:"sp-4-l4",title:"Correlation and Regression",duration:"24 min",completed:!1,locked:!1}],quizzes:[{id:"sp-4-q1",title:"Practice Quiz: Hypothesis Testing",questions:14,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"sp-4-q2",title:"Module Quiz: Hypothesis Testing",questions:18,duration:"28 min",completed:!1,locked:!0,type:"module"}]}]},{id:"basic-calc",title:"Basic Calculus",description:"Limits, derivatives, and integrals for Grade 12 STEM students.",icon:fx,color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,totalModules:3,completedModules:0,rating:4.9,reviewCount:216,modules:[{id:"bc-1",title:"Limits",description:"Limits of functions, limit theorems, one-sided limits, infinite limits, and continuity.",color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,lessons:[{id:"bc-1-l1",title:"Limits of Functions",duration:"20 min",completed:!1,locked:!1},{id:"bc-1-l2",title:"Limit Theorems",duration:"22 min",completed:!1,locked:!1},{id:"bc-1-l3",title:"One-Sided Limits",duration:"18 min",completed:!1,locked:!1},{id:"bc-1-l4",title:"Infinite Limits and Limits at Infinity",duration:"20 min",completed:!1,locked:!1},{id:"bc-1-l5",title:"Continuity of Functions",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"bc-1-q1",title:"Practice Quiz: Limits",questions:12,duration:"20 min",completed:!1,locked:!1,type:"practice"},{id:"bc-1-q2",title:"Module Quiz: Limits & Continuity",questions:16,duration:"25 min",completed:!1,locked:!1,type:"module"}]},{id:"bc-2",title:"Derivatives",description:"Differentiation rules, chain rule, implicit differentiation, related rates, and optimization.",color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,lessons:[{id:"bc-2-l1",title:"Definition of the Derivative",duration:"22 min",completed:!1,locked:!1},{id:"bc-2-l2",title:"Differentiation Rules",duration:"20 min",completed:!1,locked:!1},{id:"bc-2-l3",title:"Chain Rule",duration:"24 min",completed:!1,locked:!1},{id:"bc-2-l4",title:"Implicit Differentiation",duration:"26 min",completed:!1,locked:!1},{id:"bc-2-l5",title:"Higher-Order Derivatives",duration:"20 min",completed:!1,locked:!1},{id:"bc-2-l6",title:"Related Rates",duration:"26 min",completed:!1,locked:!1},{id:"bc-2-l7",title:"Extrema and the First Derivative Test",duration:"22 min",completed:!1,locked:!1},{id:"bc-2-l8",title:"Concavity and the Second Derivative Test",duration:"22 min",completed:!1,locked:!1},{id:"bc-2-l9",title:"Optimization Problems",duration:"24 min",completed:!1,locked:!1}],quizzes:[{id:"bc-2-q1",title:"Practice Quiz: Derivatives",questions:14,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"bc-2-q2",title:"Module Quiz: Differentiation",questions:18,duration:"28 min",completed:!1,locked:!1,type:"module"}]},{id:"bc-3",title:"Integration",description:"Antiderivatives, definite integrals, the fundamental theorem of calculus, and applications.",color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,lessons:[{id:"bc-3-l1",title:"Antiderivatives and Indefinite Integrals",duration:"20 min",completed:!1,locked:!1},{id:"bc-3-l2",title:"Definite Integrals and the FTC",duration:"24 min",completed:!1,locked:!1},{id:"bc-3-l3",title:"Integration by Substitution",duration:"22 min",completed:!1,locked:!1},{id:"bc-3-l4",title:"Area Under a Curve",duration:"24 min",completed:!1,locked:!1}],quizzes:[{id:"bc-3-q1",title:"Practice Quiz: Antiderivatives",questions:14,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"bc-3-q2",title:"Module Quiz: Integration",questions:20,duration:"32 min",completed:!1,locked:!0,type:"module"}]}]}],Bv=[{bg:"bg-[#9956DE]",tab:"bg-[#8248c2]",shadow:"shadow-[#9956DE]/30"},{bg:"bg-[#1FA7E1]",tab:"bg-[#198abf]",shadow:"shadow-[#1FA7E1]/30"},{bg:"bg-[#FFB356]",tab:"bg-[#e09841]",shadow:"shadow-[#FFB356]/30"},{bg:"bg-[#FB96BB]",tab:"bg-[#de7b9f]",shadow:"shadow-[#FB96BB]/30"}],Zl=({module:e,index:t,onClick:n,isAtRisk:r,badgeLabel:s})=>{const i=Bv[t%Bv.length];return a.jsxs(J.button,{whileHover:{y:-8},onClick:n,className:"relative text-left rounded-[1.4rem] overflow-visible min-h-[290px] bg-transparent group w-full",children:[a.jsx("div",{className:`absolute top-0 left-4 h-7 w-32 rounded-t-xl shadow-sm transition-colors duration-300 ${i.tab}`}),a.jsxs("div",{className:`relative mt-6 rounded-[1.4rem] p-6 transition-all duration-300 overflow-hidden flex flex-col h-[calc(100%-24px)] ${i.bg} shadow-[0_18px_30px_-20px_rgba(0,0,0,0.45)] group-hover:shadow-[0_24px_40px_-15px_rgba(0,0,0,0.5)]`,children:[a.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 mix-blend-overlay bg-white/40"}),a.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-48 h-48 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110"}),a.jsx("div",{className:"absolute bottom-4 right-12 w-32 h-32 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110 delay-75"}),a.jsxs("div",{className:"relative z-10 flex-1 flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsx("span",{className:"px-3 py-1.5 rounded-full bg-white/20 text-white text-[10px] font-black uppercase tracking-wider backdrop-blur-sm shadow-sm border border-white/10",children:"General Mathematics"}),(s||e.status==="Locked")&&a.jsx("span",{className:"px-2.5 py-1 rounded-full bg-black/30 text-white/90 text-[10px] font-black uppercase tracking-wider backdrop-blur-sm",children:s||"Locked"})]}),a.jsx("h3",{className:"text-2xl md:text-[22px] font-display font-black text-white leading-[1.1] mb-2 drop-shadow-sm pr-4 line-clamp-2",children:e.title}),a.jsx("p",{className:"text-white/85 text-sm line-clamp-2 mb-6 font-medium leading-relaxed pr-2",children:e.subtitle||e.description||"Master this module to unlock the next level of your mathematical journey."}),a.jsxs("div",{className:"mt-auto",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[a.jsx(De,{size:14,className:"opacity-90"})," ",e.totalLessons||e.lessons?.length||0," lessons"]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[a.jsx(On,{size:14,className:"opacity-90"})," ",e.totalQuizzes||e.quizzes?.length||0," quizzes"]})]}),a.jsxs("div",{className:"flex justify-between text-white font-bold text-[13px] mb-1.5 drop-shadow-sm",children:[a.jsx("span",{children:"Progress"}),a.jsxs("span",{children:[e.progress>0?e.progress:0,"%"]})]}),a.jsx("div",{className:"w-full h-2.5 rounded-full bg-black/20 overflow-hidden shadow-inner flex-shrink-0",children:a.jsx("div",{className:"h-full bg-white rounded-full transition-all duration-1000 ease-out",style:{width:`${e.progress>0?e.progress:0}%`}})})]}),r&&a.jsxs("div",{className:"absolute -top-3 -right-2 bg-rose-500 text-white px-3 py-1.5 rounded-full text-[11px] font-black uppercase tracking-wider flex items-center gap-1.5 shadow-lg border border-rose-400 animate-pulse",children:[a.jsx(Gt,{size:12,strokeWidth:3})," Review"]})]})]})]})},LL={Functions:"Functions and Graphs",BusinessMath:"Business and Financial Mathematics",Logic:"Logic and Reasoning"},BC={Functions:"gm-1",BusinessMath:"gm-2",Logic:"gm-3"},qC=e=>{const t=e.trim().toLowerCase();return t==="functions"||t.includes("function")?"Functions":t==="businessmath"||t.includes("business")?"BusinessMath":t==="logic"||t.includes("reason")?"Logic":null},$L=({onNavigateToModules:e,atRiskSubjects:t=[],priorityTopics:n=[]})=>{const{userProfile:r}=$t(),[s,i]=v.useState(null),o=r?.grade,l=ld(o),c=ia.filter(x=>l.includes(x.id)),d=c.find(x=>x.id==="gen-math")??c[0],f=U.useMemo(()=>{const x=n.length>0?n:t.map(j=>qC(j)).filter(j=>j!==null),p=new Set;return x.filter(j=>p.has(j)?!1:(p.add(j),!0))},[n,t]),u=U.useMemo(()=>{const x=d?.modules??[];if(f.length===0)return x;const p=new Map(f.map((j,S)=>[BC[j],S]));return[...x].sort((j,S)=>{const y=p.get(j.id)??Number.POSITIVE_INFINITY,N=p.get(S.id)??Number.POSITIVE_INFINITY;return y-N})},[d?.modules,f]);v.useEffect(()=>{r?.uid&&Is(r.uid).then(i).catch(console.error)},[r?.uid]);const m=u.slice(0,4).map(x=>{const S=s?.subjects?.[d.id]?.modulesProgress?.[x.id]?.lessonsCompleted?.length||0,y=x.lessons.length>0?Math.round(S/x.lessons.length*100):0;return{...x,progress:y,status:y===100?"Completed":y>0?"In Progress":"Not Started"}}),g=m.some(x=>x.progress>0)?"Continue Learning":"Start Learning";return a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-6 px-1",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:a.jsx(De,{size:20,strokeWidth:2.5})}),a.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:g})]}),a.jsxs("button",{onClick:()=>e?.(),className:"text-primary font-bold text-sm flex items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-4 py-2 rounded-xl hover:bg-primary/20",children:["View All ",a.jsx(Ba,{size:16})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:m.map((x,p)=>a.jsx(Zl,{module:x,index:p,onClick:()=>e?.(x.id),isAtRisk:f.length>0,badgeLabel:x.status!=="Not Started"?x.status:void 0},x.id))})]})},qv=[{id:1,title:"Daily challenge",subtitle:"Do your plan before 09:00 AM",bgColor:"bg-[#6ED1CF]",orbColor:"bg-[#50B8B6]",avatars:["https://i.pravatar.cc/150?img=1","https://i.pravatar.cc/150?img=5","https://i.pravatar.cc/150?img=8"],extraCount:4,icon:a.jsx(Jn,{size:24,fill:"currentColor",className:"text-white"})},{id:2,title:"Weekend Warrior",subtitle:"Complete 3 modules this weekend",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",avatars:["https://i.pravatar.cc/150?img=12","https://i.pravatar.cc/150?img=32"],extraCount:12,icon:a.jsx(Nn,{size:24,fill:"currentColor",className:"text-white"})},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",avatars:["https://i.pravatar.cc/150?img=44","https://i.pravatar.cc/150?img=55","https://i.pravatar.cc/150?img=68"],extraCount:8,icon:a.jsx(Kn,{size:24,className:"text-white"})}],zL=(e=[])=>{const t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=new Date,r=n.getDay(),s=[];for(let i=0;i<7;i++){const o=new Date(n);o.setDate(n.getDate()-r+i);const l=i===r,c=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`,d=e.includes(c);s.push({dayName:t[i],dateNumber:o.getDate(),isToday:l,hasDot:d})}return s},FL=({streakHistory:e=[]})=>{const[t,n]=v.useState(0),r=zL(e);v.useEffect(()=>{const i=setInterval(()=>{n(o=>(o+1)%qv.length)},5e3);return()=>clearInterval(i)},[]);const s=qv[t];return a.jsxs("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:[a.jsx("div",{className:"relative h-[170px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:a.jsx(Ke,{mode:"wait",children:a.jsxs(J.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${s.bgColor} p-5 flex flex-col justify-between overflow-hidden`,children:[a.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[a.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),a.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${s.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),a.jsx("div",{className:"absolute right-4 bottom-4 w-[52px] h-[52px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-45 group-hover:scale-110 transition-transform duration-700 flex items-center justify-center",children:s.icon}),a.jsxs("div",{className:"relative z-10 w-3/4",children:[a.jsx("h3",{className:"font-display font-bold text-[22px] text-white mb-1",children:s.title}),a.jsx("p",{className:"text-[13px] font-medium text-white/80 leading-snug",children:s.subtitle})]}),a.jsxs("div",{className:"flex items-center -space-x-2.5 relative z-10 mt-auto",children:[s.avatars.map((i,o)=>a.jsx("img",{src:i,alt:"User",className:"w-[34px] h-[34px] rounded-full border-2 border-transparent object-cover relative z-[3] z-[2] z-[1]",style:{borderColor:s.bgColor.replace("bg-[","").replace("]","")}},o)),a.jsxs("div",{className:"w-[34px] h-[34px] rounded-full border-2 text-[12px] font-bold flex items-center justify-center text-white relative z-0",style:{backgroundColor:"rgba(0,0,0,0.2)",borderColor:s.bgColor.replace("bg-[","").replace("]","")},children:["+",s.extraCount]})]})]},s.id)})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-display text-[15px] font-bold text-[#141b2d] mb-4 px-1",children:"Your streak"}),a.jsx("div",{className:"flex justify-between items-center gap-1.5 px-0.5",children:r.map((i,o)=>a.jsxs("div",{className:`flex flex-col items-center pt-2 pb-3 w-[46px] h-[72px] rounded-[24px] border ${i.isToday?"bg-[#12192b] text-white border-transparent shadow-[0_8px_16px_rgba(18,25,43,0.3)] transform -translate-y-1":"bg-white text-slate-400 border-slate-200/80 hover:border-slate-300"} transition-all duration-200 cursor-pointer`,children:[a.jsx("div",{className:"h-1.5 flex items-center justify-center mb-1.5",children:i.hasDot?a.jsx("div",{className:`w-[5px] h-[5px] rounded-full ${i.isToday?"bg-white":"bg-slate-300"}`}):a.jsx("div",{className:`text-[10px] ${i.isToday?"text-white/50":"text-slate-200"} font-bold`,children:"+"})}),a.jsx("span",{className:`text-[11px] font-bold mb-1 ${i.isToday?"text-slate-300":"text-slate-400/80"}`,children:i.dayName}),a.jsx("span",{className:`text-[15px] font-bold leading-none ${i.isToday?"text-white":"text-[#334155]"}`,children:i.dateNumber})]},o))})]})]})};function BL({delayDuration:e=0,...t}){return a.jsx(f6,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function qL({...e}){return a.jsx(BL,{children:a.jsx(o6,{"data-slot":"tooltip",...e})})}function VL({...e}){return a.jsx(l6,{"data-slot":"tooltip-trigger",...e})}function UL({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(c6,{children:a.jsxs(d6,{"data-slot":"tooltip-content",sideOffset:t,className:Be("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,a.jsx(u6,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const GL=({onOpenRewards:e,onOpenLeaderboard:t,onNavigateToModules:n,userLevel:r,currentXP:s,xpToNextLevel:i,streak:o,streakHistory:l=[]})=>{const c=s/i*100;return a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs(J.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:e,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:[a.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%)]"}),a.jsxs("div",{className:"relative z-10 p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-9 h-9 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:a.jsx(Jt,{size:16,className:"text-white"})}),a.jsx("h3",{className:"font-display font-bold text-sm text-white tracking-wide",children:"Rewards & Achievements"})]}),a.jsx(jn,{size:16,className:"text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),a.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white",children:[a.jsx(Cr,{size:12,className:"text-[#FFB356]"}),a.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),a.jsx("div",{className:"w-px h-3 bg-white/35"}),a.jsxs(qL,{children:[a.jsx(VL,{asChild:!0,children:a.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white cursor-pointer hover:bg-white/20 transition-colors active:scale-95",children:[a.jsx(aa,{size:12,className:"text-[#6ED1CF]"}),a.jsxs("span",{className:"font-bold",children:[s," XP"]})]})}),a.jsx(UL,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]}),a.jsx("div",{className:"w-px h-3 bg-white/35"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white",children:[a.jsx(Nn,{size:12,className:"text-[#FF8B8B]"}),a.jsxs("span",{className:"font-bold",children:[o,"d"]})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[a.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),a.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(c),"%"]})]}),a.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:a.jsx(J.div,{initial:{width:0},animate:{width:`${c}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),a.jsx(J.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:a.jsx(FL,{streakHistory:l})}),a.jsxs(J.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:t,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:[a.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.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:a.jsx(Cr,{size:14,className:"text-amber-500"})}),a.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),a.jsx(jn,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),a.jsxs("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:[a.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[a.jsxs(J.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.5},className:"relative mb-2",children:[a.jsx("img",{src:"https://i.pravatar.cc/150?img=33",alt:"You",className:"w-10 h-10 rounded-full border-[3px] border-sky-400 z-10 relative object-cover shadow-sm bg-white"}),a.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-sky-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"2"})]}),a.jsxs(J.div,{initial:{height:0},animate:{height:"54px"},transition:{delay:.4,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-slate-200 to-slate-100 rounded-t-xl rounded-b-md border-t-2 border-slate-50 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]",children:[a.jsx("span",{className:"text-slate-400 font-black text-2xl opacity-40 translate-y-1",children:"2"}),a.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),a.jsxs("div",{className:"mt-2 text-center",children:[a.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"You"}),a.jsx("span",{className:"block text-[10px] text-sky-600 font-bold",children:"2.1k XP"})]})]}),a.jsxs("div",{className:"flex flex-col items-center relative z-20 -mx-2",children:[a.jsxs(J.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.7},className:"relative mb-2",children:[a.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:a.jsx(Cr,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),a.jsx("img",{src:"https://i.pravatar.cc/150?img=68",alt:"Alex",className:"w-[52px] h-[52px] rounded-full border-[3px] border-amber-400 z-10 relative object-cover shadow-md bg-white"}),a.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-amber-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"1"})]}),a.jsxs(J.div,{initial:{height:0},animate:{height:"74px"},transition:{delay:.6,duration:.5,ease:"easeOut"},className:"w-[78px] bg-gradient-to-b from-amber-100 to-amber-50 rounded-t-xl rounded-b-md border-t-2 border-amber-50 flex items-center justify-center relative shadow-[inset_0_-4px_8px_rgba(251,191,36,0.1),0_6px_8px_rgba(0,0,0,0.05)]",children:[a.jsx("span",{className:"text-amber-400 font-black text-3xl opacity-50 translate-y-1",children:"1"}),a.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/80 rounded-t-xl"})]}),a.jsxs("div",{className:"mt-2 text-center",children:[a.jsx("span",{className:"block text-[13px] font-black text-[#0a1628]",children:"Alex M."}),a.jsx("span",{className:"block text-[11px] text-amber-600 font-bold",children:"2.4k XP"})]})]}),a.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[a.jsxs(J.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.6},className:"relative mb-2",children:[a.jsx("img",{src:"https://i.pravatar.cc/150?img=47",alt:"Sarah",className:"w-10 h-10 rounded-full border-[3px] border-orange-400 z-10 relative object-cover shadow-sm bg-white"}),a.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-orange-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"3"})]}),a.jsxs(J.div,{initial:{height:0},animate:{height:"38px"},transition:{delay:.5,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-orange-50 to-slate-50 rounded-t-xl rounded-b-md border-t-2 border-orange-100 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(249,115,22,0.05),0_4px_6px_rgba(0,0,0,0.02)]",children:[a.jsx("span",{className:"text-orange-400/60 font-black text-2xl opacity-60 translate-y-1",children:"3"}),a.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),a.jsxs("div",{className:"mt-2 text-center",children:[a.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"Sarah K."}),a.jsx("span",{className:"block text-[10px] text-orange-600 font-bold",children:"1.9k XP"})]})]})]})]})]})},Vv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Uv=Fe,WL=(e,t)=>n=>{var r;if(t?.variants==null)return Uv(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const f=n?.[d],u=i?.[d];if(f===null)return null;const m=Vv(f)||Vv(u);return s[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[u,m]=f;return m===void 0||(d[u]=m),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:u,className:m,...h}=f;return Object.entries(h).every(g=>{let[x,p]=g;return Array.isArray(p)?p.includes({...i,...l}[x]):{...i,...l}[x]===p})?[...d,u,m]:d},[]);return Uv(e,o,c,n?.class,n?.className)},HL=WL("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 pe({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?m6:"button";return a.jsx(i,{"data-slot":"button",className:Be(HL({variant:t,size:n,className:e})),...s})}function ve({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:Be("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","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",e),...n})}const Gv=()=>{const e=["#4F46E5","#EC4899","#f43f5e","#10B981","#0ea5e9"],t=Array.from({length:50},(n,r)=>({id:r,left:Math.random()*100,animationDelay:Math.random()*.5,backgroundColor:e[Math.floor(Math.random()*e.length)],rotation:Math.random()*360}));return a.jsx("div",{className:"fixed inset-0 pointer-events-none z-[100] overflow-hidden",children:t.map(n=>a.jsx(J.div,{initial:{y:-20,x:`${n.left}vw`,opacity:1,rotate:0},animate:{y:"100vh",rotate:n.rotation,opacity:0},transition:{duration:2+Math.random()*2,delay:n.animationDelay,ease:"easeIn"},style:{position:"absolute",width:"10px",height:"10px",backgroundColor:n.backgroundColor},className:"rounded-sm"},n.id))})},KL=({streak:e})=>e<3?null:a.jsx(J.div,{initial:{scale:0,y:50},animate:{scale:1,y:0},exit:{scale:0,opacity:0},className:"fixed top-24 left-1/2 -translate-x-1/2 z-[70] pointer-events-none",children:a.jsxs("div",{className:"bg-gradient-to-r from-orange-500 to-red-500 text-white px-6 py-3 rounded-2xl shadow-2xl flex items-center gap-3",children:[a.jsx(Nn,{size:24,className:"animate-pulse"}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-lg font-black",children:[e,"x STREAK!"]}),a.jsxs("p",{className:"text-xs font-bold opacity-90",children:["+",e*5," Bonus XP"]})]})]})}),XL=({lesson:e,questions:t,onComplete:n,onBack:r})=>{const[s,i]=v.useState(0),[o,l]=v.useState(null),[c,d]=v.useState(""),[f,u]=v.useState(!1),[m,h]=v.useState(!1),[g,x]=v.useState(0),[p,j]=v.useState(0),[S,y]=v.useState(0),[N,b]=v.useState(!1),[w,k]=v.useState([]),[A,C]=v.useState(!1),[F,D]=v.useState(!1),[L,P]=v.useState([]),[H]=v.useState(Date.now()),[Y,V]=v.useState(0),O=t[s],E=e.title,B=e.type,T=_=>{const Q={correct:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",incorrect:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",complete:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",streak:"data:audio/wav;base64,UklGRhIAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YW4AAAAAAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="};try{const R=new Audio(Q[_]);R.volume=.3,R.play().catch(()=>{})}catch{}};v.useEffect(()=>{O?.type==="multiple-choice"&&O.options&&k([...O.options].sort(()=>Math.random()-.5))},[s,O]),v.useEffect(()=>{const _=Q=>{Q.key==="Enter"&&(!f&&M()?K():f&&X())};return window.addEventListener("keypress",_),()=>window.removeEventListener("keypress",_)},[f,o,c]);const M=()=>O.type==="fill-in-blank"?c.trim().length>0:o!==null,K=()=>{if(!M())return;let _=!1,Q="";if(O.type==="fill-in-blank"){Q=c.trim().toLowerCase();const R=O.correctAnswer.toLowerCase().trim();_=Q===R||Q.replace(/\s+/g,"")===R.replace(/\s+/g,"")}else{if(!o)return;Q=o,_=Q===O.correctAnswer}if(h(_),u(!0),P([...L,_]),_){x(G=>G+1);const R=p+1;if(j(R),y(Math.max(S,R)),R>=3){const G=R*5;V(ae=>ae+G),C(!0),T("streak"),setTimeout(()=>C(!1),2e3)}else T("correct")}else j(0),T("incorrect")},X=()=>{sD(!1),3e3)),i(_=>_+1),u(!1),l(null),d(""),h(!1)):I()},I=()=>{b(!0),D(!0),T("complete"),setTimeout(()=>D(!1),5e3)},Z=B==="quiz"?{gradient:"bg-gradient-to-br from-indigo-600 via-sky-600 to-indigo-800",text:"text-sky-900",bgLight:"bg-sky-50",border:"border-sky-200"}:{gradient:"bg-gradient-to-br from-teal-500 via-emerald-500 to-teal-700",text:"text-teal-900",bgLight:"bg-teal-50",border:"border-teal-200"},ee=(()=>{const _=E.toLowerCase();return _.includes("geometry")||_.includes("shape")?[Ev,Cv,Mv,Sv,BD,UD]:_.includes("algebra")||_.includes("equation")?[Xe,gu,kv,bu,Un,Pv]:_.includes("calculus")||_.includes("derivative")||_.includes("integral")?[fx,bu,ot,Un,gu,kv]:_.includes("statistics")||_.includes("probability")?[cn,ot,Sv,Cv,Ev,Mv]:[Un,fx,gu,Pv,bu,e8]})(),$=ee[0];if(N){const _=Math.round(g/t.length*100),Q=B==="quiz"?100:50,R=Math.round(g/t.length*100),G=Q+R+Y,ae=Math.floor((Date.now()-H)/1e3),re=Math.floor(ae/60),te=ae%60;return a.jsxs(a.Fragment,{children:[F&&a.jsx(Gv,{}),a.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-md p-4 animate-in fade-in duration-500",children:a.jsxs(J.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",duration:.5},className:"bg-white rounded-[32px] w-full max-w-lg p-6 text-center shadow-2xl relative overflow-hidden",children:[a.jsx("div",{className:`absolute top-0 left-0 w-full h-24 ${Z.gradient} opacity-10 rounded-b-[50%]`}),a.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none opacity-[0.03]",children:ee.map((se,q)=>a.jsx(se,{className:"absolute text-[#0a1628]",size:30+q%3*15,style:{top:`${Math.random()*100}%`,left:`${Math.random()*100}%`,transform:`rotate(${Math.random()*360}deg)`}},q))}),a.jsxs("div",{className:"relative mb-4 flex justify-center",children:[a.jsx(J.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",delay:.2},className:"w-20 h-20 bg-gradient-to-br from-rose-400 to-orange-500 rounded-full flex items-center justify-center text-white shadow-2xl shadow-rose-200",children:a.jsx(Jt,{size:40,fill:"currentColor"})}),a.jsx(J.div,{animate:{scale:[1,1.2,1],rotate:[0,180,360]},transition:{duration:2,repeat:1/0},className:"absolute top-0 right-1/3 text-xl",children:a.jsx(ra,{size:20,className:"text-rose-400"})}),a.jsx(J.div,{animate:{scale:[1,1.2,1],rotate:[0,-180,-360]},transition:{duration:2,repeat:1/0,delay:.5},className:"absolute bottom-0 left-1/3 text-xl",children:a.jsx(ra,{size:20,className:"text-rose-400"})})]}),a.jsx(J.h2,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3},className:"text-3xl font-bold text-[#0a1628] mb-2",children:_>=90?"Perfect!":_>=80?"Excellent Job!":_>=70?"Great Work!":_>=60?"Good Effort!":"Keep Practicing!"}),a.jsxs(J.p,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.4},className:"text-[#5a6578] mb-6 font-medium",children:["You answered ",g," out of ",t.length," questions correctly"]}),a.jsxs(J.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.5},className:"grid grid-cols-2 gap-3 mb-5",children:[a.jsxs("div",{className:"bg-gradient-to-br from-indigo-50 to-indigo-100 rounded-2xl p-4 border-2 border-sky-200",children:[a.jsx("div",{className:"flex items-center justify-center mb-1",children:a.jsx(cn,{className:"text-sky-600",size:20})}),a.jsx("p",{className:"text-[10px] text-sky-600 font-bold uppercase mb-1 tracking-wider",children:"Accuracy"}),a.jsxs("p",{className:"text-3xl font-black text-sky-700",children:[_,"%"]})]}),a.jsxs("div",{className:"bg-gradient-to-br from-orange-50 to-orange-100 rounded-2xl p-4 border-2 border-orange-200",children:[a.jsx("div",{className:"flex items-center justify-center mb-1",children:a.jsx(Jn,{className:"text-orange-600",size:20})}),a.jsx("p",{className:"text-[10px] text-orange-600 font-bold uppercase mb-1 tracking-wider",children:"Total XP"}),a.jsxs("p",{className:"text-3xl font-black text-orange-600",children:["+",G]})]}),a.jsxs("div",{className:"bg-gradient-to-br from-teal-50 to-teal-100 rounded-2xl p-4 border-2 border-teal-200",children:[a.jsx("div",{className:"flex items-center justify-center mb-1",children:a.jsx(Nn,{className:"text-teal-600",size:20})}),a.jsx("p",{className:"text-[10px] text-teal-600 font-bold uppercase mb-1 tracking-wider",children:"Best Streak"}),a.jsxs("p",{className:"text-3xl font-black text-teal-700",children:[S,"x"]})]}),a.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-sky-100 rounded-2xl p-4 border-2 border-sky-200",children:[a.jsx("div",{className:"flex items-center justify-center mb-1",children:a.jsx(yt,{className:"text-sky-600",size:20})}),a.jsx("p",{className:"text-[10px] text-sky-600 font-bold uppercase mb-1 tracking-wider",children:"Time"}),a.jsxs("p",{className:"text-3xl font-black text-sky-700",children:[re,":",te.toString().padStart(2,"0")]})]})]}),a.jsxs(J.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.6},className:"bg-[#edf1f7] rounded-2xl p-4 mb-5 text-left",children:[a.jsxs("h3",{className:"font-bold text-[#0a1628] mb-2 flex items-center gap-2 text-sm",children:[a.jsx(aa,{className:"text-rose-500",size:16}),"XP Breakdown"]}),a.jsxs("div",{className:"space-y-1.5 text-sm",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("span",{className:"text-[#5a6578] text-xs",children:["Base XP (",B,")"]}),a.jsxs("span",{className:"font-bold text-[#0a1628] text-sm",children:["+",Q]})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("span",{className:"text-[#5a6578] text-xs",children:["Score Bonus (",_,"%)"]}),a.jsxs("span",{className:"font-bold text-[#0a1628] text-sm",children:["+",R]})]}),Y>0&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[#5a6578] text-xs",children:"Streak Bonuses"}),a.jsxs("span",{className:"font-bold text-orange-600 text-sm",children:["+",Y]})]}),a.jsxs("div",{className:"border-t-2 border-[#dde3eb] pt-1.5 flex justify-between items-center",children:[a.jsx("span",{className:"text-[#0a1628] font-bold text-xs",children:"Total XP Earned"}),a.jsxs("span",{className:"font-black text-orange-600",children:["+",G]})]})]})]}),a.jsx(J.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.7},className:"flex items-center justify-center gap-1.5 mb-6",children:L.map((se,q)=>a.jsx(J.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.7+q*.05},className:`w-7 h-7 rounded-lg flex items-center justify-center ${se?"bg-teal-500":"bg-red-400"}`,children:se?a.jsx(jr,{className:"text-white",size:14}):a.jsx(Xe,{className:"text-white",size:14})},q))}),a.jsx(J.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.8},children:a.jsx(pe,{onClick:()=>n(_,G),className:`w-full py-5 rounded-2xl font-bold ${Z.gradient} text-white hover:opacity-90 shadow-xl hover:shadow-2xl transition-all hover:scale-[1.02] active:scale-[0.98]`,children:"Continue Learning"})})]})})]})}return a.jsxs(a.Fragment,{children:[F&&a.jsx(Gv,{}),a.jsx(Ke,{children:A&&a.jsx(KL,{streak:p})}),a.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[#edf1f7] overflow-hidden font-sans",children:[a.jsxs("div",{className:`absolute top-0 left-0 right-0 h-[45vh] ${Z.gradient} rounded-b-[60px] md:rounded-b-[80px] shadow-2xl z-0 overflow-hidden`,children:[a.jsx("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white opacity-5 rounded-full -translate-x-1/2 -translate-y-1/2 blur-2xl"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-80 h-80 bg-white opacity-10 rounded-full translate-x-1/3 translate-y-1/3 blur-3xl"}),a.jsx("div",{className:"absolute top-1/4 right-1/4 w-32 h-32 bg-white opacity-5 rounded-full blur-xl"}),a.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[ee.map((_,Q)=>a.jsx("div",{className:"absolute text-white/10 animate-pulse",style:{top:`${10+Q*15}%`,left:`${10+Q*25%80}%`,animationDuration:`${3+Q}s`,transform:`rotate(${Q*45}deg) scale(${1+Q%3*.2})`},children:a.jsx(_,{size:48+Q%2*32})},Q)),a.jsx("div",{className:"absolute -bottom-10 -left-10 text-white/5 rotate-12",children:a.jsx($,{size:200})})]})]}),a.jsxs("header",{className:"relative z-[60] h-20 flex items-center justify-between px-6 pt-2",children:[a.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[a.jsx("button",{onClick:r,className:"w-10 h-10 rounded-xl bg-white/20 backdrop-blur-md flex items-center justify-center text-white hover:bg-white/30 transition-all border border-slate-300 hover:scale-110 active:scale-95",children:a.jsx(Xe,{size:20})}),a.jsxs("div",{className:"text-white",children:[a.jsx("h1",{className:"font-bold text-lg leading-tight",children:E}),a.jsxs("div",{className:"flex items-center gap-2 opacity-80 text-xs font-medium uppercase tracking-wide",children:[a.jsx("span",{children:B}),a.jsx("span",{className:"w-1 h-1 bg-white rounded-full"}),a.jsxs("span",{children:["Question ",s+1,"/",t.length]})]})]})]}),a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs(J.div,{animate:p>=3?{scale:[1,1.1,1]}:{},transition:{duration:.5,repeat:p>=3?1/0:0},className:"flex items-center gap-2 bg-black/20 backdrop-blur-md px-3 py-1.5 rounded-full border border-slate-300",children:[a.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white shadow-sm ${p>=3?"bg-gradient-to-r from-orange-500 to-red-500":"bg-orange-500"}`,children:a.jsx(Nn,{size:14,fill:"currentColor"})}),a.jsx("span",{className:"text-sm font-bold text-white",children:p})]})})]}),a.jsxs("main",{className:"relative z-10 flex-1 flex flex-col items-center justify-start px-4 sm:px-6 xl:px-10 pb-8 pt-4 md:pt-8 overflow-y-auto",children:[a.jsxs("div",{className:"w-full max-w-md mb-8 px-2",children:[a.jsxs("div",{className:"flex justify-between text-[10px] font-bold text-white/80 mb-2 uppercase tracking-wider",children:[a.jsx("span",{children:"Progress"}),a.jsxs("span",{children:[Math.round(s/t.length*100),"%"]})]}),a.jsx("div",{className:"h-2 w-full bg-black/20 rounded-full overflow-hidden backdrop-blur-sm",children:a.jsx(J.div,{initial:{width:0},animate:{width:`${s/t.length*100}%`},transition:{duration:.5,ease:"easeOut"},className:"h-full bg-white rounded-full shadow-[0_0_10px_rgba(255,255,255,0.5)]"})})]}),s===Math.floor(t.length/2)&&s>0&&a.jsxs(J.div,{initial:{scale:0,y:20},animate:{scale:1,y:0},className:"mb-4 bg-white/20 backdrop-blur-md text-white px-6 py-3 rounded-2xl font-bold shadow-lg",children:[a.jsx(cn,{size:20,className:"inline mr-2 text-white"}),"Halfway there! Keep it up!"]}),a.jsx(Ke,{mode:"wait",children:a.jsxs(J.div,{initial:{opacity:0,x:100},animate:{opacity:1,x:0},exit:{opacity:0,x:-100},transition:{type:"spring",stiffness:300,damping:30},className:"w-full max-w-3xl",children:[a.jsxs("div",{className:"bg-white rounded-[40px] shadow-[0_20px_60px_-15px_rgba(0,0,0,0.2)] overflow-hidden border border-[#dde3eb] min-h-[450px] flex flex-col relative",children:[a.jsxs("div",{className:"p-8 md:p-12 flex-1 flex flex-col items-center justify-center text-center",children:[a.jsx("span",{className:`inline-block px-4 py-1.5 ${Z.bgLight} ${Z.text} rounded-full text-[11px] font-black mb-8 uppercase tracking-widest border ${Z.border}`,children:O.type==="multiple-choice"?"Multiple Choice":O.type==="true-false"?"True or False":"Fill in the Blank"}),a.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-[#0a1628] leading-snug max-w-2xl",children:O.question})]}),a.jsxs("div",{className:"p-6 md:p-10 bg-[#edf1f7]/80 backdrop-blur-sm border-t border-[#dde3eb]",children:[(O.type==="multiple-choice"||O.type==="true-false")&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(O.type==="true-false"?["True","False"]:w).map((_,Q)=>{let R="hover:border-[#dde3eb] hover:shadow-lg bg-white border-[#dde3eb] text-[#5a6578] shadow-sm";return f?_===O.correctAnswer?R="bg-teal-50 border-teal-500 text-teal-700 shadow-teal-100 ring-2 ring-teal-200":_===o?R="bg-red-50 border-red-500 text-red-700 shadow-red-100 ring-2 ring-red-200":R="bg-[#edf1f7] border-[#dde3eb] text-slate-500 opacity-60 scale-[0.98]":o===_&&(R=`${Z.bgLight} ${Z.border} ${Z.text} ring-2 ring-indigo-100 shadow-md scale-[1.02] z-10`),a.jsxs(J.button,{disabled:f,onClick:()=>l(_),whileHover:f?{}:{scale:1.02},whileTap:f?{}:{scale:.98},className:` + relative p-6 rounded-2xl border-2 font-bold text-lg transition-all duration-200 text-left flex items-center justify-between group + ${R} + `,children:[a.jsx("span",{className:"relative z-10",children:_}),f&&_===O.correctAnswer&&a.jsx(J.div,{initial:{scale:0},animate:{scale:1},className:"bg-teal-100 p-1 rounded-full",children:a.jsx(jr,{size:18,className:"text-teal-600"})}),f&&_===o&&_!==O.correctAnswer&&a.jsx(J.div,{initial:{scale:0},animate:{scale:1},className:"bg-red-100 p-1 rounded-full",children:a.jsx(Xe,{size:18,className:"text-red-600"})}),!f&&a.jsx("div",{className:`w-6 h-6 rounded-full border-2 border-[#dde3eb] group-hover:border-[#dde3eb] transition-colors ${o===_?`bg-current border-current ${Z.text}`:""}`})]},Q)})}),f&&a.jsxs(J.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"space-y-3 mt-6",children:[!m&&o&&o!==O.correctAnswer&&a.jsx("div",{className:"bg-red-50 border-2 border-red-200 rounded-2xl p-4",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.jsx(Xe,{size:18,className:"text-red-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-red-700 mb-1",children:"Not quite"}),a.jsx("p",{className:"text-red-800 text-sm leading-relaxed",children:O.optionExplanations?.[o]||`${o} is not the correct answer. Review the concept and try again.`})]})]})}),a.jsx("div",{className:"bg-teal-50 border-2 border-teal-200 rounded-2xl p-4",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.jsx(jr,{size:18,className:"text-teal-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-teal-700 mb-1",children:m?"That's right!":"Right answer"}),a.jsx("p",{className:"text-teal-800 text-sm leading-relaxed",children:O.explanation||O.optionExplanations?.[O.correctAnswer]||`${O.correctAnswer} is the correct answer.`})]})]})})]})]}),O.type==="fill-in-blank"&&a.jsxs("div",{className:"max-w-md mx-auto",children:[a.jsxs("div",{className:"relative group",children:[a.jsx(ve,{disabled:f,value:c,onChange:_=>d(_.target.value),placeholder:"Type your answer here...",className:` + py-8 px-6 text-xl rounded-2xl border-2 font-bold transition-all text-center placeholder:font-medium placeholder:text-slate-500 + ${f?m?"bg-teal-50 border-teal-500 text-teal-800":"bg-red-50 border-red-500 text-red-800":"bg-white border-[#dde3eb] focus:border-indigo-500 focus:ring-4 focus:ring-indigo-100 shadow-sm"} + `}),f&&a.jsx(J.div,{initial:{scale:0},animate:{scale:1},className:"absolute right-4 top-1/2 -translate-y-1/2",children:m?a.jsx("div",{className:"bg-teal-100 p-1.5 rounded-full",children:a.jsx(jr,{className:"text-teal-600",size:20})}):a.jsx("div",{className:"bg-red-100 p-1.5 rounded-full",children:a.jsx(Xe,{className:"text-red-600",size:20})})})]}),f&&!m&&a.jsxs(J.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mt-4 text-center",children:[a.jsx("p",{className:"text-slate-500 text-xs font-bold uppercase tracking-wider mb-1",children:"Correct answer"}),a.jsx("p",{className:"text-teal-600 font-black text-xl",children:O.correctAnswer})]})]})]}),a.jsxs("div",{className:"p-6 border-t border-[#dde3eb] bg-white flex items-center justify-between",children:[a.jsxs(pe,{variant:"ghost",size:"sm",className:"text-slate-500 hover:text-[#5a6578] hover:bg-[#edf1f7] rounded-xl",children:[a.jsx(Z8,{size:16,className:"mr-2"})," Report"]}),f?a.jsxs(pe,{onClick:X,className:`px-10 py-7 rounded-2xl font-bold text-base shadow-xl transition-all flex items-center gap-2 hover:-translate-y-1 ${m?"bg-teal-500 hover:bg-teal-600 text-white shadow-teal-200":"bg-sky-600 hover:bg-sky-700 text-white shadow-sm"}`,children:[s({title:e,sections:[{type:"text",heading:"Introduction",content:`Welcome to this lesson on ${e}. In this lesson, you'll learn the fundamental concepts and practical applications that will build your mathematical foundation.`},{type:"key-point",heading:"Key Concepts",content:"Understanding the core principles is essential for mastering this topic. Pay close attention to the definitions and properties we'll explore."},{type:"video",heading:"Video Lesson",content:"Watch this explanation to understand the concepts visually.",videoUrl:"https://www.youtube.com/embed/dQw4w9WgXcQ"},{type:"example",heading:"Worked Examples",content:"Let's work through some examples to see these concepts in action.",examples:[{problem:"Example Problem 1: Apply the concept to solve this problem.",solution:`Step 1: Identify what we know. +Step 2: Apply the formula or method. +Step 3: Simplify and solve. +Answer: The solution demonstrates how to approach similar problems.`},{problem:"Example Problem 2: A more complex application.",solution:`Step 1: Break down the problem. +Step 2: Use what we learned. +Step 3: Verify our answer. +Answer: This shows the method works for various cases.`}]},{type:"text",heading:"Important Notes",content:`Remember these key points as you practice: +• Always check your work +• Look for patterns +• Practice makes perfect +• Don't hesitate to review if needed`},{type:"practice",heading:"Try It Yourself",content:"Now it's your turn! Try applying what you've learned. You can practice with the exercises at the end of this module."},{type:"text",heading:"Summary",content:`Great job! You've completed the lesson on ${e}. Make sure you understand the key concepts before moving on. Feel free to review this lesson anytime.`}]}),QL=({lesson:e,onBack:t,onComplete:n,onProgressUpdate:r})=>{const[s,i]=v.useState(0),[o,l]=v.useState(!1),[c,d]=v.useState(0),[f,u]=v.useState(!1);v.useEffect(()=>{i(0),u(!1),l(!1),d(0)},[e.id,e.title]);const m=YL(e.title),h=m.sections.length;v.useEffect(()=>{const N=(s+1)/h*100;d(N),r?.(N)},[s,h,r]);const g=()=>{sN+1):u(!0)},x=()=>{s>0&&i(N=>N-1)},p=N=>{n(void 0,void 0,N)},j=m.sections[s],y=j&&{text:"📝",example:"📎",video:"🎬","key-point":"💡",practice:"✍️"}[j.type]||"📘";return a.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[radial-gradient(circle_at_top_left,#f8fbff_0%,#eef4ff_40%,#f8f4ff_100%)] overflow-hidden",children:[a.jsx("header",{className:"flex-none bg-white/90 backdrop-blur-md border-b border-[#dde3eb] px-6 sm:px-10 lg:px-16 py-4 shadow-sm relative z-40",children:a.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:t,className:"w-10 h-10 rounded-xl bg-[#edf1f7] hover:bg-[#dde3eb] flex items-center justify-center text-[#5a6578] transition-all hover:scale-110",children:a.jsx(cx,{size:20})}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-[#5a6578] font-medium mb-1 uppercase tracking-wider",children:[a.jsx(De,{size:14}),a.jsx("span",{children:"Notebook Lesson"})]}),a.jsx("h1",{className:"font-bold text-lg text-[#0a1628]",children:m.title})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"text-right mr-3",children:[a.jsx("p",{className:"text-xs text-[#5a6578] font-medium",children:"Progress"}),a.jsxs("p",{className:"text-sm font-bold text-[#0a1628]",children:[Math.round(c),"%"]})]}),a.jsx("div",{className:"w-32 h-2 bg-[#dde3eb] rounded-full overflow-hidden",children:a.jsx(J.div,{className:"h-full bg-gradient-to-r from-teal-500 to-emerald-500 rounded-full",initial:{width:0},animate:{width:`${c}%`},transition:{duration:.3}})})]})]})}),a.jsx("main",{className:"flex-1 overflow-y-auto px-6 sm:px-10 lg:px-16 py-10",children:a.jsxs("div",{className:"max-w-4xl mx-auto",children:[a.jsx(Ke,{mode:"wait",children:a.jsxs(J.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{duration:.3},children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"flex items-center gap-2 text-sm text-[#5a6578] font-medium mb-2",children:a.jsxs("span",{children:["Section ",s+1," of ",h]})}),j.heading&&a.jsxs("h2",{className:"text-3xl font-black text-[#0a1628] mb-4 tracking-tight flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:y}),a.jsx("span",{children:j.heading})]})]}),a.jsxs("div",{className:"relative bg-white rounded-3xl p-8 shadow-lg border border-[#dde3eb] min-h-[500px] overflow-hidden",children:[a.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/70 pointer-events-none"}),a.jsx("div",{className:"absolute left-[56px] top-0 bottom-0 w-px bg-rose-100/60 pointer-events-none"}),a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-60",style:{backgroundImage:"repeating-linear-gradient(transparent, transparent 37px, #e9eef8 37px, #e9eef8 38px)"}}),a.jsxs("div",{className:"relative z-10 pl-8 md:pl-12",children:[j.type==="text"&&a.jsx("div",{className:"prose prose-slate max-w-none",children:a.jsx("p",{className:"text-lg text-[#0a1628] leading-relaxed whitespace-pre-line",children:j.content})}),j.type==="key-point"&&a.jsx("div",{className:"bg-gradient-to-br from-rose-50 to-orange-50 rounded-2xl p-6 border-2 border-rose-200",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-rose-500 rounded-xl flex items-center justify-center flex-shrink-0",children:a.jsx(dx,{size:24,className:"text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-rose-900 mb-2 text-lg",children:"Important!"}),a.jsx("p",{className:"text-rose-800 leading-relaxed",children:j.content})]})]})}),j.type==="video"&&a.jsxs("div",{children:[a.jsx("div",{className:"bg-slate-900 rounded-2xl overflow-hidden mb-4 aspect-video flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-20 h-20 bg-white/10 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(pC,{size:32,className:"text-white ml-1"})}),a.jsx("p",{className:"text-white/70 text-sm",children:"Video content would be embedded here"}),a.jsx("p",{className:"text-white/50 text-xs mt-2",children:"In production, this would show actual video lessons"})]})}),a.jsx("p",{className:"text-[#5a6578]",children:j.content})]}),j.type==="example"&&a.jsxs("div",{children:[a.jsx("p",{className:"text-[#0a1628] mb-6",children:j.content}),a.jsx("div",{className:"space-y-4",children:j.examples?.map((N,b)=>a.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 rounded-2xl p-6 border-2 border-sky-200",children:[a.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[a.jsx("div",{className:"w-8 h-8 bg-sky-500 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(Un,{size:18,className:"text-white"})}),a.jsx("div",{className:"flex-1",children:a.jsx("h4",{className:"font-bold text-sky-900 mb-2",children:N.problem})})]}),a.jsxs("div",{className:"ml-11 bg-white/60 rounded-xl p-4 border border-sky-100",children:[a.jsx("p",{className:"text-sm font-bold text-sky-700 mb-2",children:"Solution:"}),a.jsx("p",{className:"text-[#0a1628] whitespace-pre-line text-sm leading-relaxed",children:N.solution})]})]},b))})]}),j.type==="practice"&&a.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 rounded-2xl p-8 border-2 border-sky-200 text-center",children:[a.jsx("div",{className:"w-16 h-16 bg-sky-500 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Kn,{size:32,className:"text-white"})}),a.jsx("h3",{className:"text-2xl font-bold text-sky-900 mb-3",children:j.heading}),a.jsx("p",{className:"text-sky-800 text-lg mb-6",children:j.content}),a.jsx("div",{className:"bg-white/60 rounded-xl p-4 inline-block",children:a.jsxs("p",{className:"text-sm text-sky-700",children:[a.jsx(dx,{size:14,className:"inline mr-1 -mt-0.5"}),a.jsx("strong",{children:"Tip:"})," Complete the practice quizzes after this lesson to reinforce your learning!"]})})]})]})]})]},s)}),a.jsx("div",{className:"flex items-center justify-center gap-2 mt-8 mb-4",children:m.sections.map((N,b)=>a.jsx("button",{onClick:()=>i(b),className:`h-2 rounded-full transition-all ${b===s?"w-8 bg-teal-500":bp(!0),className:"w-full py-3.5 rounded-xl font-bold text-[15px] bg-gradient-to-r from-teal-500 to-emerald-500 text-white hover:shadow-lg hover:shadow-teal-500/25 hover:-translate-y-0.5 transition-all outline-none",children:"Continue to Next Lesson"}),a.jsx("button",{onClick:()=>p(!1),className:"w-full py-3.5 rounded-xl font-bold text-[15px] bg-slate-100 text-slate-600 hover:bg-slate-200 hover:text-slate-700 transition-all outline-none",children:"Back to Modules"})]})]})})]})},yi={"gm-1":[{id:1,type:"multiple-choice",question:"Which statement best describes a function?",options:["Each input has exactly one output","Each output has exactly one input","Inputs and outputs must be equal","A function is always linear"],correctAnswer:"Each input has exactly one output",explanation:"A relation is a function when every input is paired with only one output value.",optionExplanations:{"Each input has exactly one output":"Correct. This is the defining condition of a function.","Each output has exactly one input":"Not required. Different inputs can share the same output.","Inputs and outputs must be equal":"Functions can map inputs to different values.","A function is always linear":"Many functions are nonlinear."}},{id:2,type:"multiple-choice",question:"If f(x) = 2x + 3, what is f(4)?",options:["8","11","10","5"],correctAnswer:"11",explanation:"Substitute x = 4. f(4) = 2(4) + 3 = 11.",optionExplanations:{8:"This is 2x only. Add 3 as well.",11:"Correct. 2(4)+3 = 11.",10:"Check substitution carefully.",5:"This would come from a different expression."}},{id:3,type:"fill-in-blank",question:"For f(x) = x^2, the range is y ___ 0 (answer with >= or >).",correctAnswer:">=",explanation:"Squares are never negative, and 0 is included when x = 0."},{id:4,type:"multiple-choice",question:"If f(x) = x - 5 and g(x) = x^2, what is (g o f)(x)?",options:["x^2 - 5","(x - 5)^2","x^2 + 5","2x - 5"],correctAnswer:"(x - 5)^2",explanation:"Compose by substituting f(x) into g. g(f(x)) = g(x-5) = (x-5)^2.",optionExplanations:{"x^2 - 5":"This is not the result of composition.","(x - 5)^2":"Correct. Substitute x-5 into g(x)=x^2.","x^2 + 5":"Incorrect sign and operation.","2x - 5":"This is linear, but g(x) is quadratic."}},{id:5,type:"true-false",question:"A one-to-one function always has an inverse that is also a function.",correctAnswer:"True",explanation:"One-to-one functions pass the horizontal line test, which guarantees an inverse function.",optionExplanations:{True:"Correct. One-to-one is the key condition for inverses to be functions.",False:"If a function is one-to-one, its inverse relation is a function."}},{id:6,type:"multiple-choice",question:"Which parent graph has a horizontal asymptote at y = 0?",options:["y = log(x)","y = x^2","y = 2^x","y = x + 1"],correctAnswer:"y = 2^x",explanation:"Basic exponential functions approach y = 0 but never reach it.",optionExplanations:{"y = log(x)":"Logarithmic functions have a vertical asymptote at x = 0.","y = x^2":"Parabolas have no horizontal asymptote.","y = 2^x":"Correct. Exponential graphs approach y = 0.","y = x + 1":"Linear functions do not have asymptotes."}}],"gm-2":[{id:1,type:"multiple-choice",question:"What is the simple interest on Php 8,000 at 6% per year for 2 years?",options:["Php 480","Php 960","Php 1,200","Php 1,600"],correctAnswer:"Php 960",explanation:"Simple interest I = Prt = 8000(0.06)(2) = 960.",optionExplanations:{"Php 480":"That is one year of interest only.","Php 960":"Correct. Multiply principal, rate, and time.","Php 1,200":"Check the rate and time values.","Php 1,600":"This overstates the computed interest."}},{id:2,type:"multiple-choice",question:"Which formula gives compound amount after t periods?",options:["A = P(1 + rt)","A = P(1 + r)^t","A = P - rt","A = Prt"],correctAnswer:"A = P(1 + r)^t",explanation:"Compound growth multiplies by (1 + r) each period.",optionExplanations:{"A = P(1 + rt)":"This is the simple interest amount form.","A = P(1 + r)^t":"Correct. This is the standard compound amount formula.","A = P - rt":"This is not an amount model.","A = Prt":"This computes simple interest, not total compound amount."}},{id:3,type:"fill-in-blank",question:"If the future value is 12,000 and discount rate is 20%, present value is ___",correctAnswer:"10000",explanation:"Present value PV = FV/(1+r) = 12000/1.2 = 10000."},{id:4,type:"true-false",question:"A general annuity has payment interval different from the compounding interval.",correctAnswer:"True",explanation:"That mismatch between payment and conversion periods defines a general annuity.",optionExplanations:{True:"Correct. Different intervals make it a general annuity.",False:"Matching intervals correspond to a simple annuity."}},{id:5,type:"multiple-choice",question:"In an amortization schedule, each regular payment is split into:",options:["Tax and insurance","Principal and interest","Deposit and withdrawal","Discount and markup"],correctAnswer:"Principal and interest",explanation:"Loan payments reduce outstanding principal and cover interest charges.",optionExplanations:{"Tax and insurance":"These may appear in housing payments, but are not the core loan split.","Principal and interest":"Correct. This is the fundamental breakdown.","Deposit and withdrawal":"These terms describe bank account activity, not amortization.","Discount and markup":"These are pricing terms, not amortization terms."}},{id:6,type:"multiple-choice",question:"Which statement is true about a stock market index?",options:["It guarantees profit","It tracks performance of a selected group of stocks","It sets loan interest rates","It replaces bond yields"],correctAnswer:"It tracks performance of a selected group of stocks",explanation:"An index is a benchmark that summarizes how a basket of stocks performs.",optionExplanations:{"It guarantees profit":"No index can guarantee returns.","It tracks performance of a selected group of stocks":"Correct. That is the purpose of an index.","It sets loan interest rates":"Loan rates are set by lenders and market conditions, not indexes directly.","It replaces bond yields":"Bond yields and stock indexes measure different markets."}}],"gm-3":[{id:1,type:"multiple-choice",question:"Which of the following is a proposition?",options:["Open the door.","x + 5 = 12","Manila is in the Philippines.","How are you?"],correctAnswer:"Manila is in the Philippines.",explanation:"A proposition is a declarative statement that is either true or false.",optionExplanations:{"Open the door.":"This is a command, not a proposition.","x + 5 = 12":"Without a value for x, this is an open sentence.","Manila is in the Philippines.":"Correct. This statement has a definite truth value.","How are you?":"This is a question, not a proposition."}},{id:2,type:"true-false",question:"If p is true and q is false, then p AND q is false.",correctAnswer:"True",explanation:"A conjunction p AND q is true only when both p and q are true.",optionExplanations:{True:"Correct. One false part makes the conjunction false.",False:"Conjunction requires both components to be true."}},{id:3,type:"multiple-choice",question:'What is the negation of the statement: "All students passed"?',options:["No student passed","At least one student did not pass","Some students passed","All students did not pass"],correctAnswer:"At least one student did not pass",explanation:'Negating "all" gives "there exists at least one" that does not satisfy the statement.',optionExplanations:{"No student passed":"This is stronger than the logical negation.","At least one student did not pass":"Correct. This is the precise negation.","Some students passed":"This can still be true with the original statement.","All students did not pass":'This is not equivalent to the negation of "all passed".'}},{id:4,type:"fill-in-blank",question:'In logic, "if p then q" is written as p ___ q',correctAnswer:"->",explanation:"The conditional symbol is arrow, often typed as ->."},{id:5,type:"multiple-choice",question:"Which argument form is valid?",options:["If p then q; q; therefore p","If p then q; p; therefore q","p OR q; p; therefore not q","If p then q; not p; therefore not q"],correctAnswer:"If p then q; p; therefore q",explanation:"This is modus ponens, a valid argument form.",optionExplanations:{"If p then q; q; therefore p":"This is affirming the consequent, invalid.","If p then q; p; therefore q":"Correct. This is modus ponens.","p OR q; p; therefore not q":"From inclusive OR, not q does not follow.","If p then q; not p; therefore not q":"This is denying the antecedent, invalid."}},{id:6,type:"multiple-choice",question:"A tautology is a proposition that is:",options:["Always true","Always false","True only when p is true","Undefined"],correctAnswer:"Always true",explanation:"A tautology evaluates to true for all possible truth assignments.",optionExplanations:{"Always true":"Correct. This is the definition of tautology.","Always false":"That describes a contradiction.","True only when p is true":"That depends on p and is not always true.",Undefined:"Tautologies are fully defined and always true."}}],"gm-4":[{id:1,type:"multiple-choice",question:"Solve for x: 2x + 4 = 10",options:["x = 3","x = 2","x = 6","x = 4"],correctAnswer:"x = 3",explanation:"Subtract 4: 2x = 6. Divide by 2: x = 3.",optionExplanations:{"x = 3":"Correct! 2(3)+4 = 10.","x = 2":"2(2)+4 = 8, not 10.","x = 6":"You may have forgotten to divide by 2.","x = 4":"2(4)+4 = 12, not 10."}},{id:2,type:"fill-in-blank",question:"Simplify: 3(x + 2) = ___",correctAnswer:"3x + 6",explanation:"Distribute: 3·x + 3·2 = 3x + 6."},{id:3,type:"true-false",question:"The expression 5x − 3x simplifies to 2x.",correctAnswer:"True",explanation:"Combine like terms: 5x − 3x = 2x.",optionExplanations:{True:"Correct! Subtracting coefficients: 5−3 = 2.",False:"5x and 3x are like terms and can be combined."}},{id:4,type:"multiple-choice",question:"What is the slope-intercept form of a linear equation?",options:["ax + by = c","y = mx + b","x = my + b","y = mx − b"],correctAnswer:"y = mx + b",explanation:"Slope-intercept form is y = mx + b, where m is slope and b is y-intercept.",optionExplanations:{"ax + by = c":"This is standard form.","y = mx + b":"Correct! m = slope, b = y-intercept.","x = my + b":"x and y are reversed.","y = mx − b":"The intercept should be + b."}},{id:5,type:"multiple-choice",question:"If f(x) = 3x + 2, what is f(4)?",options:["10","12","14","16"],correctAnswer:"14",explanation:"f(4) = 3(4) + 2 = 12 + 2 = 14.",optionExplanations:{10:"Check: 3(4)+2 = 14, not 10.",12:"You forgot to add 2. 3(4) = 12, then +2 = 14.",14:"Correct! 3(4)+2 = 14.",16:"Check your multiplication: 3×4 = 12, not 14."}}],"gm-5":[{id:1,type:"multiple-choice",question:"What is the sum of interior angles in a triangle?",options:["90°","180°","270°","360°"],correctAnswer:"180°",explanation:"The sum of interior angles in any triangle is always 180°.",optionExplanations:{"90°":"That is a right angle, not the sum of all angles.","180°":"Correct! All triangle angles sum to 180°.","270°":"This is the sum for a different shape.","360°":"This is the sum for a quadrilateral."}},{id:2,type:"fill-in-blank",question:"The area of a rectangle with length 8 and width 5 is ___",correctAnswer:"40",explanation:"Area = length × width = 8 × 5 = 40."},{id:3,type:"true-false",question:"A square is a special type of rectangle.",correctAnswer:"True",explanation:"A square has four right angles and opposite sides equal, meeting all rectangle criteria.",optionExplanations:{True:"Correct! A square is a rectangle with all sides equal.",False:"A square satisfies all properties of a rectangle."}},{id:4,type:"multiple-choice",question:"What is the circumference of a circle with radius 7? (Use π ≈ 22/7)",options:["22","44","154","14"],correctAnswer:"44",explanation:"C = 2πr = 2 × 22/7 × 7 = 44.",optionExplanations:{22:"This is πr, not 2πr.",44:"Correct! 2 × 22/7 × 7 = 44.",154:"This is the area (πr²), not circumference.",14:"This is the diameter (2r)."}},{id:5,type:"multiple-choice",question:"How many sides does a hexagon have?",options:["5","6","7","8"],correctAnswer:"6",explanation:'A hexagon has 6 sides. The prefix "hex" means 6.',optionExplanations:{5:"That is a pentagon.",6:"Correct! Hexagon = 6 sides.",7:"That is a heptagon.",8:"That is an octagon."}}],"gm-6":[{id:1,type:"multiple-choice",question:"If A = {1,2,3} and B = {2,3,4}, what is A ∩ B?",options:["{1,2,3,4}","{2,3}","{1,4}","{1}"],correctAnswer:"{2,3}",explanation:"A ∩ B (intersection) contains elements common to both: {2,3}.",optionExplanations:{"{1,2,3,4}":"That is A ∪ B (union).","{2,3}":"Correct! The intersection has shared elements.","{1,4}":"These elements are only in one set each.","{1}":"1 is only in A, not in both."}},{id:2,type:"true-false",question:"The empty set is a subset of every set.",correctAnswer:"True",explanation:"By definition, the empty set ∅ is a subset of every set.",optionExplanations:{True:"Correct! ∅ ⊆ A for any set A.",False:"The empty set is indeed a subset of every set by definition."}},{id:3,type:"fill-in-blank",question:"If A = {a, b, c}, the number of elements |A| = ___",correctAnswer:"3",explanation:"The cardinality |A| counts the elements: a, b, c → 3."},{id:4,type:"multiple-choice",question:"What does A ∪ B represent?",options:["Elements in both A and B","Elements in A or B or both","Elements in A but not B","Elements not in A"],correctAnswer:"Elements in A or B or both",explanation:"Union (∪) combines all elements from both sets.",optionExplanations:{"Elements in both A and B":"That describes intersection (∩).","Elements in A or B or both":"Correct! Union includes all elements.","Elements in A but not B":"That describes set difference A−B.","Elements not in A":"That describes the complement of A."}},{id:5,type:"multiple-choice",question:'Which logical connective represents "and"?',options:["∨","∧","¬","→"],correctAnswer:"∧",explanation:"∧ is the logical AND connective.",optionExplanations:{"∨":"∨ means OR.","∧":"Correct! ∧ means AND.","¬":"¬ means NOT.","→":"→ means IMPLIES."}}],"pc-1":[{id:1,type:"multiple-choice",question:"If f(x) = x² + 1, what is f(3)?",options:["7","9","10","12"],correctAnswer:"10",explanation:"f(3) = 3² + 1 = 9 + 1 = 10.",optionExplanations:{7:"Check: 3²+1 = 10.",9:"You forgot to add 1.",10:"Correct! 9+1 = 10.",12:"Check your calculation."}},{id:2,type:"true-false",question:"Every function is a relation, but not every relation is a function.",correctAnswer:"True",explanation:"A function is a special relation where each input has exactly one output.",optionExplanations:{True:"Correct! Functions are a subset of relations.",False:"Functions require unique outputs for each input, making them a special type of relation."}},{id:3,type:"fill-in-blank",question:"The domain of f(x) = 1/x excludes x = ___",correctAnswer:"0",explanation:"Division by zero is undefined, so x = 0 is excluded."},{id:4,type:"multiple-choice",question:"What is the range of f(x) = x²?",options:["All real numbers","x ≥ 0","y ≥ 0","y > 0"],correctAnswer:"y ≥ 0",explanation:"x² is always non-negative, so the range is y ≥ 0.",optionExplanations:{"All real numbers":"x² can never be negative.","x ≥ 0":"This describes the domain restriction, not the range.","y ≥ 0":"Correct! Squares are always ≥ 0.","y > 0":"f(0) = 0, so y = 0 is included."}},{id:5,type:"multiple-choice",question:"If f(x) = 2x and g(x) = x+3, what is (f∘g)(x)?",options:["2x+3","2x+6","2(x+3)","Both B and C"],correctAnswer:"Both B and C",explanation:"f(g(x)) = f(x+3) = 2(x+3) = 2x+6. Both B and C are equivalent.",optionExplanations:{"2x+3":"This adds 3 after multiplying. The correct order is f(g(x)) = 2(x+3).","2x+6":"Correct form! 2(x+3) = 2x+6.","2(x+3)":"Correct form! This equals 2x+6.","Both B and C":"Correct! 2(x+3) and 2x+6 are equivalent."}}],bc:[{id:1,type:"multiple-choice",question:"What is the derivative of x²?",options:["2x","x","2","x²"],correctAnswer:"2x",explanation:"Using the power rule d/dx[xⁿ] = nxⁿ⁻¹: derivative of x² is 2x.",optionExplanations:{"2x":"Correct! Power rule: 2x²⁻¹ = 2x.",x:"This would be the derivative of x²/2.",2:"The derivative of x² varies with x.","x²":"This is the original function."}},{id:2,type:"true-false",question:"The limit of a function always exists at every point.",correctAnswer:"False",explanation:"Limits don't always exist, e.g. lim(x→0) 1/x does not exist.",optionExplanations:{True:"Limits can fail at discontinuities or asymptotes.",False:"Correct! Limits do not always exist."}},{id:3,type:"fill-in-blank",question:"The integral of 2x is ___",correctAnswer:"x²",explanation:"∫2x dx = x² + C."},{id:4,type:"multiple-choice",question:"What is the derivative of sin(x)?",options:["cos(x)","-cos(x)","sin(x)","-sin(x)"],correctAnswer:"cos(x)",explanation:"d/dx[sin(x)] = cos(x).",optionExplanations:{"cos(x)":"Correct!","-cos(x)":"The derivative of sin is positive cos.","sin(x)":"sin is the original, not the derivative.","-sin(x)":"This is the derivative of cos(x)."}},{id:5,type:"multiple-choice",question:"What does the derivative represent geometrically?",options:["Area under the curve","Slope of the tangent line","Y-intercept","Maximum value"],correctAnswer:"Slope of the tangent line",explanation:"The derivative at a point gives the slope of the tangent line at that point.",optionExplanations:{"Area under the curve":"That is the integral.","Slope of the tangent line":"Correct!","Y-intercept":"The y-intercept is f(0).","Maximum value":"Derivatives help find max/min but don't directly give them."}}],sp:[{id:1,type:"multiple-choice",question:"What is the mean of {2, 4, 6, 8, 10}?",options:["4","5","6","8"],correctAnswer:"6",explanation:"Mean = (2+4+6+8+10)/5 = 30/5 = 6.",optionExplanations:{4:"Sum is 30, not 20.",5:"There are 5 numbers but the mean is sum/count = 30/5 = 6.",6:"Correct! 30/5 = 6.",8:"Check the sum: 2+4+6+8+10 = 30."}},{id:2,type:"fill-in-blank",question:"The probability of getting heads on a fair coin flip is ___",correctAnswer:"0.5",explanation:"A fair coin has equal probability: 1/2 = 0.5."},{id:3,type:"true-false",question:"The median of a dataset is always equal to the mean.",correctAnswer:"False",explanation:"Median and mean are equal only in symmetric distributions.",optionExplanations:{True:"They are equal only in perfectly symmetric distributions.",False:"Correct! Skewed data has different mean and median."}},{id:4,type:"multiple-choice",question:"What is the mode of {3, 5, 5, 7, 9}?",options:["3","5","7","9"],correctAnswer:"5",explanation:"Mode is the most frequent value. 5 appears twice.",optionExplanations:{3:"3 appears once.",5:"Correct! 5 appears most frequently (twice).",7:"7 appears once.",9:"9 appears once."}},{id:5,type:"multiple-choice",question:"If P(A) = 0.3, what is P(not A)?",options:["0.3","0.5","0.7","1.0"],correctAnswer:"0.7",explanation:"P(not A) = 1 − P(A) = 1 − 0.3 = 0.7.",optionExplanations:{"0.3":"That is P(A), not its complement.","0.5":"Complements only equal 0.5 when P(A) = 0.5.","0.7":"Correct! 1 − 0.3 = 0.7.","1.0":"1.0 means certain, but A doesn't always not happen."}}]},ZL=(e,t)=>{const n=e.split("-");let r="";if(n.length>=3?r=`${n[0]}-${n[1]}`:n.length===2&&(r=e),yi[r])return yi[r];const s=n[0],o={gm:"gm-4",pc:"pc-1",bc:"bc",sp:"sp"}[s];return o&&yi[o]?yi[o]:yi["gm-4"]},JL=({module:e,onBack:t,onEarnXP:n})=>{const[r,s]=v.useState(null),{userProfile:i}=$t(),[o,l]=v.useState(null),c=v.useMemo(()=>{const k=Number(e.id.split("-").pop());return Number.isFinite(k)&&k>0?k:1},[e.id]),d=v.useMemo(()=>ia.find(A=>A.modules.some(C=>C.id===e.id))?.id??null,[e.id]),f=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"],u=v.useMemo(()=>{const A=(d?ia.find(F=>F.id===d):null)?.modules?.findIndex(F=>F.id===e.id)??0,C=A>=0?A:0;return f[C%f.length]},[e.id,d]);v.useEffect(()=>{if(i?.uid)return ML(i.uid,l)},[i?.uid]);const m=v.useMemo(()=>d?o?.subjects?.[d]?.modulesProgress?.[e.id]??null:null,[e.id,d,o?.subjects]),h=v.useMemo(()=>{const k=m?.lessonsCompleted??[];return new Set(k)},[m?.lessonsCompleted]),g=v.useMemo(()=>{const k=m?.quizzesCompleted??[];return new Set(k)},[m?.quizzesCompleted]),x=m?.lessonsCompleted?.length??e.lessons.filter(k=>k.completed).length,p=m?.quizzesCompleted?.length??e.quizzes.filter(k=>k.completed).length,j=m?.progress??e.progress,S=e.lessons.length+e.quizzes.length,y=x+p;e.lessons.length&&x/e.lessons.length*100,e.quizzes.length&&p/e.quizzes.length*100;const N=(k,A)=>{const C=o?.lessons?.[k]?.progressPercent;return typeof C=="number"&&Number.isFinite(C)?Math.max(0,Math.min(100,C)):A?100:0},b=v.useMemo(()=>{if(!S)return 0;const k=e.lessons.reduce((C,F)=>{const D=h.has(F.id)||F.completed;return C+N(F.id,D)},0),A=p*100;return Math.round((k+A)/S)},[h,p,e.lessons,e.quizzes.length,S,o?.lessons]),w=j>0?j:b;if(r){if(r.type==="lesson")return a.jsx(QL,{lesson:r.lesson,onBack:()=>s(null),onProgressUpdate:k=>{i?.uid&&EL(i.uid,r.lesson.id,k),l(A=>{if(!A)return A;const C=r.lesson.id,F=A.lessons?.[C]?.progressPercent,D=typeof F=="number"&&Number.isFinite(F)?F:0,L=Math.max(D,Math.max(0,Math.min(100,k)));return{...A,lessons:{...A.lessons||{},[C]:{...A.lessons?.[C]||{},lessonId:C,progressPercent:L}},updatedAt:new Date}})},onComplete:(k,A,C)=>{const F=Math.max(A||50,50);if(console.log("[LessonComplete] XP Award:",F,"for",r.lesson.title),n?.(F,`Completed "${r.lesson.title}"`),i?.uid&&d&&(async()=>{try{await _L(i.uid,d,e.id,r.lesson.id,0,F),await Fv(i.uid,d,e.id,e.lessons.length,e.quizzes.length)}catch(D){console.error("[LessonComplete] Failed to persist progress:",D)}})(),C){const D=e.lessons.findIndex(L=>L.id===r.lesson.id);D!==-1&&D0?s({type:"quiz",quiz:e.quizzes[0]}):s(null)}else s(null)}});{const k=ZL(r.quiz.id);return a.jsx(XL,{lesson:{id:parseInt(r.quiz.id.split("-").pop()||"1"),title:r.quiz.title,duration:r.quiz.duration,type:"quiz",completed:r.quiz.completed,locked:r.quiz.locked},questions:k,onBack:()=>s(null),onComplete:(A,C)=>{console.log("[QuizComplete] Score:",A,"totalXP from calculator:",C);const F=C&&C>0?C:Math.max(100,Math.round(A*1.5));console.log("[QuizComplete] Awarding XP:",F),n?.(F,`Scored ${A}% on "${r.quiz.title}"`),i?.uid&&d&&(async()=>{try{await IL(i.uid,d,e.id,r.quiz.id,A,[],0),await Fv(i.uid,d,e.id,e.lessons.length,e.quizzes.length)}catch(D){console.error("[QuizComplete] Failed to persist progress:",D)}})(),s(null)}})}}return a.jsxs("div",{className:"h-full flex flex-col px-4 sm:px-6 xl:px-10 py-6 sm:py-8 lg:overflow-hidden relative",children:[a.jsx("div",{className:"sticky top-0 sm:top-4 z-50 mb-6 xl:mb-8 w-full sm:w-max",children:a.jsxs("button",{onClick:t,className:"flex items-center gap-2 px-4 py-2.5 rounded-full bg-white/80 backdrop-blur-xl border border-slate-200/60 text-slate-600 hover:text-indigo-600 font-bold text-sm tracking-wide transition-all hover:-translate-x-1 shadow-sm hover:shadow-md",children:[a.jsx(cx,{size:18}),"Back"]})}),a.jsxs(J.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:`relative mb-6 lg:mb-8 rounded-[2rem] ${e.accentColor} shadow-[0_20px_40px_-15px_rgba(0,0,0,0.3)] shrink-0 overflow-hidden`,children:[a.jsx("div",{className:"absolute inset-0 bg-black/60 pointer-events-none z-0"}),a.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 39px, #ffffff 39px, #ffffff 40px), repeating-linear-gradient(90deg, transparent, transparent 39px, #ffffff 39px, #ffffff 40px)"}}),a.jsx("div",{className:"absolute top-0 right-0 w-[400px] h-[400px] bg-sky-500/20 blur-[100px] rounded-full pointer-events-none"}),a.jsxs("div",{className:"relative p-5 sm:p-7 md:p-10 flex flex-col md:flex-row md:items-center justify-between gap-6 md:gap-8",children:[a.jsxs("div",{className:"flex-1 text-white",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-4 md:mb-5",children:[a.jsxs("div",{className:"px-3 py-1 bg-white/10 backdrop-blur-md rounded-full text-[11px] font-black uppercase tracking-widest text-[#f8fafc] border border-white/20 shadow-sm flex items-center gap-1.5",children:[a.jsx(s8,{size:14})," Chapter ",e.id.split("-").pop()||"1"]}),a.jsxs("div",{className:"px-3 py-1 bg-white/10 backdrop-blur-md rounded-full text-[11px] font-black uppercase tracking-widest text-emerald-400 border border-emerald-400/30",children:["Lv ",c]})]}),a.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-display font-black text-white mb-3 md:mb-4 tracking-[-0.02em] leading-tight",children:e.title}),a.jsx("p",{className:"text-slate-300 text-sm md:text-[15px] max-w-2xl font-medium leading-relaxed mb-6 md:mb-8",children:e.description}),a.jsxs("div",{className:"bg-black/20 backdrop-blur-md rounded-2xl p-4 md:p-5 border border-white/10 max-w-xl",children:[a.jsxs("div",{className:"flex justify-between items-end mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(yt,{size:20,className:"text-emerald-400"}),a.jsx("span",{className:"text-[12px] md:text-[13px] font-black text-white uppercase tracking-wider",children:"Module Mastery"})]}),a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsxs("span",{className:"text-[12px] md:text-[13px] font-bold text-slate-400 mb-0.5",children:[y,"/",S," steps"]}),a.jsxs("span",{className:"text-xl md:text-2xl font-black text-white shrink-0 leading-none",children:[Math.round(w),"%"]})]})]}),a.jsx("div",{className:"h-3 bg-black/40 rounded-full overflow-hidden shadow-inner ring-1 ring-white/10 p-0.5",children:a.jsx(J.div,{initial:{width:0},animate:{width:`${w}%`},transition:{duration:1.5,ease:"easeOut",delay:.2},className:`h-full rounded-full relative ${w===100?"bg-gradient-to-r from-emerald-400 to-teal-300":e.accentColor}`,children:a.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=')] opacity-30 mix-blend-overlay"})})})]})]}),a.jsxs("div",{className:"hidden lg:flex w-48 h-48 bg-white/5 rounded-[2rem] border border-white/10 backdrop-blur-md items-center justify-center transform rotate-[-3deg] shadow-2xl relative group hover:rotate-0 transition-all duration-500 shrink-0",children:[a.jsx("div",{className:`absolute inset-0 opacity-40 rounded-[2rem] ${e.progress===100?"bg-gradient-to-br from-emerald-400 to-teal-600":e.accentColor}`}),w===100?a.jsx(Jt,{size:80,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}):a.jsx(De,{size:80,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}),a.jsx(J.div,{animate:{y:[-5,5,-5],rotate:[-10,10,-10]},transition:{duration:4,repeat:1/0},className:"absolute top-6 left-6 text-emerald-300 z-20",children:a.jsx(aa,{size:20,fill:"currentColor"})}),a.jsx(J.div,{animate:{y:[5,-5,5],rotate:[10,-10,10]},transition:{duration:3.5,repeat:1/0},className:"absolute bottom-8 right-6 text-sky-300 z-20",children:a.jsx(fD,{size:24})})]})]})]}),a.jsxs("div",{className:"flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-8 lg:min-h-0 pb-6 lg:pb-0",children:[a.jsxs("div",{className:"relative flex flex-col bg-[#FAFAFA] rounded-[2rem] border border-slate-200 shadow-sm overflow-hidden lg:h-full",children:[a.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/60 pointer-events-none z-0"}),a.jsx("div",{className:"absolute left-[54px] top-0 bottom-0 w-px bg-rose-100/40 pointer-events-none z-0"}),a.jsxs("div",{className:"px-4 sm:px-6 md:px-8 py-5 md:py-6 border-b border-slate-200/60 bg-white/80 backdrop-blur-sm relative z-10 flex items-center justify-between sticky top-0 shrink-0",children:[a.jsxs("h2",{className:"font-display font-black text-xl md:text-2xl text-slate-800 flex items-center gap-3",children:[a.jsx(De,{size:24,className:"text-sky-500"}),"Study Notes"]}),a.jsx("div",{className:"flex flex-col items-end gap-2",children:a.jsxs("div",{className:"text-xs md:text-sm font-bold bg-sky-100 text-sky-600 px-3 py-1 rounded-full shadow-sm border border-sky-200/50",children:[x,"/",e.lessons.length]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 md:px-8 py-5 md:py-6 space-y-4 scrollbar-hide relative z-10",style:{backgroundImage:"repeating-linear-gradient(transparent, transparent 31px, #f1f5f9 31px, #f1f5f9 32px)",backgroundAttachment:"local",lineHeight:"32px"},children:[e.lessons.map((k,A)=>{const C=h.has(k.id)||k.completed,F=N(k.id,C);return a.jsxs(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:A*.05},onClick:()=>!k.locked&&s({lesson:k,type:"lesson"}),className:`relative bg-transparent rounded-[1.2rem] overflow-visible group transition-all duration-300 ${k.locked?"opacity-60 saturate-50 cursor-not-allowed":(k.completed,"cursor-pointer")}`,children:[a.jsx("div",{className:"absolute top-0 left-4 h-6 w-24 rounded-t-xl bg-[#d8e9ff] border border-[#b7d3ff] border-b-0 shadow-sm"}),a.jsxs("div",{className:`mt-5 rounded-[1.2rem] border p-3 md:p-4 relative overflow-hidden shadow-sm transition-all duration-300 ${k.locked?"border-slate-200 bg-slate-100":C?"border-teal-200 bg-white hover:shadow-md":"border-sky-200 bg-white hover:shadow-md"}`,children:[a.jsx("div",{className:"absolute top-0 left-0 right-0 h-2.5 bg-slate-100 rounded-t-[1.2rem]"}),a.jsx(J.div,{className:"absolute top-0 left-0 h-2.5 rounded-t-[1.2rem]",initial:!1,animate:{width:`${F}%`},transition:{duration:.45,ease:"easeOut"},style:{background:`linear-gradient(90deg, ${u}66, ${u})`}}),a.jsxs("div",{className:"flex items-center justify-between relative z-10 pt-1",children:[a.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[a.jsx("div",{className:`w-9 h-9 md:w-10 md:h-10 rounded-[10px] flex items-center justify-center shrink-0 shadow-sm ${k.locked?"bg-slate-100 text-slate-400":C?"bg-teal-50 text-teal-600":"bg-sky-50 text-sky-600"}`,children:k.locked?a.jsx(_s,{size:16}):C?a.jsx(_8,{size:16}):a.jsx(pC,{size:16,className:"ml-1"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-[10px] md:text-[11px] font-black uppercase tracking-wider text-slate-400 mb-0.5",children:["Lesson ",A+1]}),a.jsx("h3",{className:`font-bold text-[14px] md:text-[15px] leading-tight transition-colors ${k.locked?"text-slate-600":"text-[#0a1628] group-hover:text-sky-600"}`,children:k.title})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0 ml-3 md:ml-4",children:[F>0&&F<100&&a.jsxs("div",{className:"hidden sm:flex items-center justify-center px-2 py-1 rounded-md text-[11px] font-black",style:{backgroundColor:`${u}1A`,color:u,border:`1px solid ${u}33`},title:"Lesson progress",children:[Math.round(F),"%"]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-slate-400 text-[11px] md:text-xs font-bold bg-slate-50 px-2 py-1 rounded-md",children:[a.jsx(On,{size:12}),a.jsx("span",{children:k.duration})]})]})]})]})]},k.id)}),a.jsx("div",{className:"h-4 pointer-events-none"})]})]}),a.jsxs("div",{className:"relative flex flex-col bg-white rounded-[2rem] border border-slate-200 shadow-sm overflow-hidden lg:h-full",children:[a.jsx("div",{className:"h-5 bg-slate-200/50 border-b border-slate-200 w-full flex items-center justify-center pointer-events-none sticky top-0 z-20",children:a.jsx("div",{className:"w-16 h-1.5 bg-slate-300 rounded-full"})}),a.jsxs("div",{className:"px-4 sm:px-6 md:px-8 py-4 md:py-5 border-b-2 border-dashed border-slate-200 bg-white relative z-10 flex items-center justify-between sticky top-5 shrink-0",children:[a.jsxs("h2",{className:"font-display font-black text-xl md:text-2xl text-slate-800 flex items-center gap-3",children:[a.jsx(ux,{size:24,className:"text-rose-500"}),"Assessments"]}),a.jsx("div",{className:"flex flex-col items-end gap-2",children:a.jsxs("div",{className:"text-xs md:text-sm font-bold bg-rose-100 text-rose-600 px-3 py-1 rounded-full shadow-sm border border-rose-200/50",children:[p,"/",e.quizzes.length]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 md:px-8 py-5 md:py-6 space-y-4 md:space-y-5 scrollbar-hide relative z-10",style:{backgroundImage:"radial-gradient(#CBD5E1 1px, transparent 1px)",backgroundSize:"24px 24px",backgroundPosition:"-12px -12px"},children:[e.quizzes.map((k,A)=>{const C=k.locked,F=k.type==="final",D=k.type==="module",L=e.lessons[Math.min(A,Math.max(e.lessons.length-1,0))],P=g.has(k.id)||k.completed;return a.jsx(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:(e.lessons.length+A)*.05},onClick:()=>!C&&s({quiz:k,type:"quiz"}),className:`bg-white/90 backdrop-blur-sm rounded-2xl p-4 md:p-5 border-2 relative select-none transition-all duration-300 ${C?"border-slate-200 opacity-60 saturate-50 cursor-not-allowed":P?"border-teal-200 shadow-sm hover:border-teal-300 hover:shadow-md cursor-pointer":F?"border-indigo-200 shadow-sm hover:border-indigo-300 hover:shadow-md cursor-pointer":"border-orange-200 shadow-sm hover:border-orange-300 hover:shadow-md cursor-pointer"} group`,children:a.jsxs("div",{className:"flex items-center justify-between gap-3 md:gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[a.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-xl flex items-center justify-center shrink-0 shadow-sm transform group-hover:rotate-3 transition-transform ${C?"bg-slate-100 text-slate-400":P?"bg-teal-500 text-white":F?"bg-indigo-500 text-white":"bg-orange-500 text-white"}`,children:C?a.jsx(_s,{size:18}):P?a.jsx(Jt,{size:18}):a.jsx(ux,{size:18})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[a.jsx("span",{className:`px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider ${F?"bg-indigo-100 text-indigo-700":D?"bg-orange-100 text-orange-700":"bg-sky-100 text-sky-700"}`,children:F?"Final Exam":D?"Module Task":"Quiz"}),!!L&&a.jsxs("span",{className:"px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider bg-violet-100 text-violet-700",children:["For: ",L.title]}),!C&&!k.completed&&a.jsx("span",{className:"w-1.5 h-1.5 md:w-2 md:h-2 rounded-full bg-rose-500 animate-pulse"})]}),a.jsx("h3",{className:`font-bold text-[14px] md:text-[16px] leading-tight mb-1 md:mb-1.5 transition-colors ${C?"text-slate-600":"text-[#0a1628]"}`,children:k.title}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-3 text-[11px] md:text-[12px] font-bold text-slate-400",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(De,{size:12})," ",k.questions," Qs"]}),a.jsx("span",{className:"hidden sm:inline",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(On,{size:12})," ",k.duration]})]})]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[k.score!==void 0&&P&&a.jsx("div",{className:"text-right",children:a.jsxs("div",{className:"text-xl md:text-2xl font-black text-teal-600 leading-none",children:[k.score,"%"]})}),!C&&a.jsx("div",{className:`px-3 py-1.5 md:px-4 md:py-2 rounded-xl text-[11px] md:text-[12px] font-black uppercase tracking-wider shadow-sm transition-all ${k.completed?"bg-white border border-slate-200 text-slate-600 group-hover:bg-slate-50":"bg-slate-900 text-white group-hover:bg-slate-600"}`,children:k.completed?"Review":"Start"})]})]})},k.id)}),a.jsx("div",{className:"h-4 pointer-events-none"})]})]})]})]})},e$=({onStartQuiz:e,searchQuery:t="",allowedSubjectIds:n})=>{const{userProfile:r}=$t(),[s,i]=v.useState("all"),[o,l]=v.useState("all"),[c,d]=v.useState(null),f=v.useMemo(()=>!n||n.length===0?ia:ia.filter(S=>n.includes(S.id)),[n]);v.useEffect(()=>{r?.uid&&Is(r.uid).then(d).catch(console.error)},[r?.uid]),v.useEffect(()=>{if(o==="all")return;f.some(y=>y.title===o)||l("all")},[f,o]);const u=c?.totalQuizzesCompleted||0,m=r?.totalXP||0,h=c?.averageScore?Math.round(c.averageScore):0,g=new Set(c?.quizAttempts?.map(S=>S.quizId)||[]),x={};if(c?.quizAttempts)for(const S of c.quizAttempts)(!x[S.quizId]||S.score>x[S.quizId])&&(x[S.quizId]=S.score);const j=f.flatMap(S=>S.modules.flatMap(y=>y.quizzes.map(N=>({id:N.id,title:N.title,subject:S.title,difficulty:N.type==="module"?"Medium":"Easy",questions:N.questions,duration:N.duration,xpReward:N.questions*5,type:N.type==="module"?"challenge":"practice",completed:g.has(N.id),bestScore:x[N.id],locked:N.locked})))).filter(S=>{const y=s==="all"||S.type===s,N=o==="all"||S.subject===o,b=!t||S.title.toLowerCase().includes(t.toLowerCase())||S.subject.toLowerCase().includes(t.toLowerCase());return y&&N&&b});return a.jsxs("div",{className:"h-full flex flex-col px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h1",{className:"text-2xl font-bold text-[#0a1628] mb-2",children:"Practice Center"}),a.jsx("p",{className:"text-[#5a6578]",children:"Sharpen your skills with quizzes, challenges, and mastery tests"})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[a.jsxs(J.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-sky-700 to-sky-500 rounded-2xl p-5 text-white shadow-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center",children:a.jsx(yt,{size:24})}),a.jsx("span",{className:"text-3xl font-bold",children:u})]}),a.jsx("p",{className:"text-sm font-medium text-sky-100",children:"Quizzes Completed"})]}),a.jsxs(J.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-rose-500 to-rose-600 rounded-2xl p-5 text-white shadow-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center",children:a.jsx(Jn,{size:24})}),a.jsx("span",{className:"text-3xl font-bold",children:m.toLocaleString()})]}),a.jsx("p",{className:"text-sm font-medium text-cyan-100",children:"Total XP Earned"})]}),a.jsxs(J.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-indigo-600 to-indigo-700 rounded-2xl p-5 text-white shadow-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center",children:a.jsx(cn,{size:24})}),a.jsxs("span",{className:"text-3xl font-bold",children:[h,"%"]})]}),a.jsx("p",{className:"text-sm font-medium text-sky-100",children:"Average Score"})]})]}),a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2 bg-white rounded-xl p-1 shadow-sm",children:[a.jsx("button",{onClick:()=>i("all"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${s==="all"?"bg-sky-600 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"All"}),a.jsx("button",{onClick:()=>i("practice"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${s==="practice"?"bg-sky-500 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"Practice"}),a.jsx("button",{onClick:()=>i("challenge"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${s==="challenge"?"bg-orange-500 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"Challenge"}),a.jsx("button",{onClick:()=>i("mastery"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${s==="mastery"?"bg-sky-500 text-white shadow-md":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:"Mastery"})]}),a.jsxs("select",{value:o,onChange:S=>l(S.target.value),className:"px-4 py-2.5 bg-white border-2 border-[#dde3eb] rounded-xl text-sm font-bold text-[#0a1628] focus:border-indigo-600 focus:outline-none",children:[a.jsx("option",{value:"all",children:"All Subjects"}),f.map(S=>a.jsx("option",{value:S.title,children:S.title},S.id))]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto pr-2 pb-4 scrollbar-hide rounded-[2rem] border border-slate-200 shadow-inner relative",style:{backgroundImage:"radial-gradient(#CBD5E1 1px, transparent 1px)",backgroundSize:"24px 24px",backgroundPosition:"-12px -12px",backgroundColor:"#FAFAFA"},children:[a.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/60 pointer-events-none z-0"}),a.jsx("div",{className:"absolute left-[54px] top-0 bottom-0 w-px bg-rose-100/40 pointer-events-none z-0"}),a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-5 p-4 md:p-6 relative z-10",children:j.map((S,y)=>{const N=S.locked,b=S.difficulty==="Hard",w=S.type==="challenge";return a.jsx(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:y*.05},onClick:()=>!N&&e?.(S),className:`bg-white/90 backdrop-blur-sm rounded-2xl p-4 md:p-5 border-2 relative select-none transition-all duration-300 ${N?"border-slate-200 opacity-60 saturate-50 cursor-not-allowed":S.completed?"border-teal-200 shadow-sm hover:border-teal-300 hover:shadow-md cursor-pointer":b?"border-indigo-200 shadow-sm hover:border-indigo-300 hover:shadow-md cursor-pointer":"border-orange-200 shadow-sm hover:border-orange-300 hover:shadow-md cursor-pointer"} group`,children:a.jsxs("div",{className:"flex items-center justify-between gap-3 md:gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[a.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-xl flex items-center justify-center shrink-0 shadow-sm transform group-hover:rotate-3 transition-transform ${N?"bg-slate-100 text-slate-400":S.completed?"bg-teal-500 text-white":b?"bg-indigo-500 text-white":"bg-orange-500 text-white"}`,children:N?a.jsx(_s,{size:18}):S.completed?a.jsx(Jt,{size:18}):a.jsx(ux,{size:18})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[a.jsxs("span",{className:`px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider ${b?"bg-indigo-100 text-indigo-700":w?"bg-orange-100 text-orange-700":"bg-sky-100 text-sky-700"}`,children:[S.type," • ",S.difficulty]}),!N&&!S.completed&&a.jsx("span",{className:"w-1.5 h-1.5 md:w-2 md:h-2 rounded-full bg-rose-500 animate-pulse"})]}),a.jsx("h3",{className:`font-bold text-[14px] md:text-[16px] leading-tight mb-1 md:mb-1.5 transition-colors ${N?"text-slate-600":"text-[#0a1628]"}`,children:S.title}),a.jsx("p",{className:"text-[11px] md:text-[12px] text-slate-500 mb-1.5 line-clamp-1",children:S.subject}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-3 text-[11px] md:text-[12px] font-bold text-slate-400",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(De,{size:12})," ",S.questions," Qs"]}),a.jsx("span",{className:"hidden sm:inline",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(On,{size:12})," ",S.duration]}),a.jsx("span",{className:"hidden sm:inline",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1 text-rose-500",children:[a.jsx(Jt,{size:12})," +",S.xpReward," XP"]})]})]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[S.bestScore!==void 0&&a.jsxs("div",{className:"text-right",children:[a.jsxs("div",{className:`text-xl md:text-2xl font-black leading-none ${S.bestScore>=80?"text-teal-600":"text-orange-500"}`,children:[S.bestScore,"%"]}),a.jsx("div",{className:"text-[9px] uppercase tracking-wide text-slate-400 font-bold mt-1",children:"Best Score"})]}),!N&&a.jsx("div",{className:`px-3 py-1.5 md:px-4 md:py-2 rounded-xl text-[11px] md:text-[12px] font-black uppercase tracking-wider shadow-sm transition-all ${S.completed?"bg-white border border-slate-200 text-slate-600 group-hover:bg-slate-50":"bg-slate-900 text-white group-hover:bg-slate-600"}`,children:S.completed?"Review":"Start"})]})]})},S.id)})}),j.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-slate-500 relative z-10",children:[a.jsx(cn,{size:48,className:"mb-3"}),a.jsx("p",{className:"font-medium",children:"No quizzes found"}),a.jsx("p",{className:"text-sm",children:"Try adjusting your filters or search query"})]})]})]})};var S0={};(function e(t,n,r,s){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=(function(){if(!t.OffscreenCanvas)return!1;try{var T=new OffscreenCanvas(1,1),M=T.getContext("2d");M.fillRect(0,0,1,1);var K=T.transferToImageBitmap();M.createPattern(K,"no-repeat")}catch{return!1}return!0})();function c(){}function d(T){var M=n.exports.Promise,K=M!==void 0?M:t.Promise;return typeof K=="function"?new K(T):(T(c,c),null)}var f=(function(T,M){return{transform:function(K){if(T)return K;if(M.has(K))return M.get(K);var X=new OffscreenCanvas(K.width,K.height),I=X.getContext("2d");return I.drawImage(K,0,0),M.set(K,X),X},clear:function(){M.clear()}}})(l,new Map),u=(function(){var T=Math.floor(16.666666666666668),M,K,X={},I=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(M=function(Z){var ne=Math.random();return X[ne]=requestAnimationFrame(function ee($){I===$||I+T-1<$?(I=$,delete X[ne],Z()):X[ne]=requestAnimationFrame(ee)}),ne},K=function(Z){X[Z]&&cancelAnimationFrame(X[Z])}):(M=function(Z){return setTimeout(Z,T)},K=function(Z){return clearTimeout(Z)}),{frame:M,cancel:K}})(),m=(function(){var T,M,K={};function X(I){function Z(ne,ee){I.postMessage({options:ne||{},callback:ee})}I.init=function(ee){var $=ee.transferControlToOffscreen();I.postMessage({canvas:$},[$])},I.fire=function(ee,$,_){if(M)return Z(ee,null),M;var Q=Math.random().toString(36).slice(2);return M=d(function(R){function G(ae){ae.data.callback===Q&&(delete K[Q],I.removeEventListener("message",G),M=null,f.clear(),_(),R())}I.addEventListener("message",G),Z(ee,Q),K[Q]=G.bind(null,{data:{callback:Q}})}),M},I.reset=function(){I.postMessage({reset:!0});for(var ee in K)K[ee](),delete K[ee]}}return function(){if(T)return T;if(!r&&i){var I=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` +`);try{T=new Worker(URL.createObjectURL(new Blob([I])))}catch(Z){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",Z),null}X(T)}return T}})(),h={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function g(T,M){return M?M(T):T}function x(T){return T!=null}function p(T,M,K){return g(T&&x(T[M])?T[M]:h[M],K)}function j(T){return T<0?0:Math.floor(T)}function S(T,M){return Math.floor(Math.random()*(M-T))+T}function y(T){return parseInt(T,16)}function N(T){return T.map(b)}function b(T){var M=String(T).replace(/[^0-9a-f]/gi,"");return M.length<6&&(M=M[0]+M[0]+M[1]+M[1]+M[2]+M[2]),{r:y(M.substring(0,2)),g:y(M.substring(2,4)),b:y(M.substring(4,6))}}function w(T){var M=p(T,"origin",Object);return M.x=p(M,"x",Number),M.y=p(M,"y",Number),M}function k(T){T.width=document.documentElement.clientWidth,T.height=document.documentElement.clientHeight}function A(T){var M=T.getBoundingClientRect();T.width=M.width,T.height=M.height}function C(T){var M=document.createElement("canvas");return M.style.position="fixed",M.style.top="0px",M.style.left="0px",M.style.pointerEvents="none",M.style.zIndex=T,M}function F(T,M,K,X,I,Z,ne,ee,$){T.save(),T.translate(M,K),T.rotate(Z),T.scale(X,I),T.arc(0,0,1,ne,ee,$),T.restore()}function D(T){var M=T.angle*(Math.PI/180),K=T.spread*(Math.PI/180);return{x:T.x,y:T.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:T.startVelocity*.5+Math.random()*T.startVelocity,angle2D:-M+(.5*K-Math.random()*K),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:T.color,shape:T.shape,tick:0,totalTicks:T.ticks,decay:T.decay,drift:T.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:T.gravity*3,ovalScalar:.6,scalar:T.scalar,flat:T.flat}}function L(T,M){M.x+=Math.cos(M.angle2D)*M.velocity+M.drift,M.y+=Math.sin(M.angle2D)*M.velocity+M.gravity,M.velocity*=M.decay,M.flat?(M.wobble=0,M.wobbleX=M.x+10*M.scalar,M.wobbleY=M.y+10*M.scalar,M.tiltSin=0,M.tiltCos=0,M.random=1):(M.wobble+=M.wobbleSpeed,M.wobbleX=M.x+10*M.scalar*Math.cos(M.wobble),M.wobbleY=M.y+10*M.scalar*Math.sin(M.wobble),M.tiltAngle+=.1,M.tiltSin=Math.sin(M.tiltAngle),M.tiltCos=Math.cos(M.tiltAngle),M.random=Math.random()+2);var K=M.tick++/M.totalTicks,X=M.x+M.random*M.tiltCos,I=M.y+M.random*M.tiltSin,Z=M.wobbleX+M.random*M.tiltCos,ne=M.wobbleY+M.random*M.tiltSin;if(T.fillStyle="rgba("+M.color.r+", "+M.color.g+", "+M.color.b+", "+(1-K)+")",T.beginPath(),o&&M.shape.type==="path"&&typeof M.shape.path=="string"&&Array.isArray(M.shape.matrix))T.fill(O(M.shape.path,M.shape.matrix,M.x,M.y,Math.abs(Z-X)*.1,Math.abs(ne-I)*.1,Math.PI/10*M.wobble));else if(M.shape.type==="bitmap"){var ee=Math.PI/10*M.wobble,$=Math.abs(Z-X)*.1,_=Math.abs(ne-I)*.1,Q=M.shape.bitmap.width*M.scalar,R=M.shape.bitmap.height*M.scalar,G=new DOMMatrix([Math.cos(ee)*$,Math.sin(ee)*$,-Math.sin(ee)*_,Math.cos(ee)*_,M.x,M.y]);G.multiplySelf(new DOMMatrix(M.shape.matrix));var ae=T.createPattern(f.transform(M.shape.bitmap),"no-repeat");ae.setTransform(G),T.globalAlpha=1-K,T.fillStyle=ae,T.fillRect(M.x-Q/2,M.y-R/2,Q,R),T.globalAlpha=1}else if(M.shape==="circle")T.ellipse?T.ellipse(M.x,M.y,Math.abs(Z-X)*M.ovalScalar,Math.abs(ne-I)*M.ovalScalar,Math.PI/10*M.wobble,0,2*Math.PI):F(T,M.x,M.y,Math.abs(Z-X)*M.ovalScalar,Math.abs(ne-I)*M.ovalScalar,Math.PI/10*M.wobble,0,2*Math.PI);else if(M.shape==="star")for(var re=Math.PI/2*3,te=4*M.scalar,se=8*M.scalar,q=M.x,W=M.y,de=5,Ae=Math.PI/de;de--;)q=M.x+Math.cos(re)*se,W=M.y+Math.sin(re)*se,T.lineTo(q,W),re+=Ae,q=M.x+Math.cos(re)*te,W=M.y+Math.sin(re)*te,T.lineTo(q,W),re+=Ae;else T.moveTo(Math.floor(M.x),Math.floor(M.y)),T.lineTo(Math.floor(M.wobbleX),Math.floor(I)),T.lineTo(Math.floor(Z),Math.floor(ne)),T.lineTo(Math.floor(X),Math.floor(M.wobbleY));return T.closePath(),T.fill(),M.tick{const t=e.data(),n=t.createdAt,r=typeof n?.toDate=="function"?n.toDate():n instanceof Date?n:new Date,s=t.actionUrl??t.link??void 0;return{...t,id:e.id,createdAt:r,actionUrl:s}},gx=async(e,t,n,r,s)=>{try{const i=Me(_e(fe,"notifications")),o={id:i.id,userId:e,type:t,title:n,message:r,read:!1,...s?{actionUrl:s}:{},createdAt:new Date},l={id:o.id,userId:o.userId,type:o.type,title:o.title,message:o.message,read:o.read,createdAt:ke(),link:s||null};return await rt(i,{...l}),o}catch(i){throw console.error("Error creating notification:",i),i}},t$=async(e,t=50,n=!1)=>{try{let r=at(_e(fe,"notifications"),Je("userId","==",e),Zn("createdAt","desc"),Er(t));return n&&(r=at(_e(fe,"notifications"),Je("userId","==",e),Je("read","==",!1),Zn("createdAt","desc"),Er(t))),(await Ye(r)).docs.map(i=>VC(i))}catch(r){return console.error("Error getting notifications:",r),[]}},n$=(e,t={},n,r)=>{if(!e)return n([]),()=>{};const{limitCount:s=50,unreadOnly:i=!1}=t,o=[Je("userId","==",e),Zn("createdAt","desc"),Er(s)],l=i?at(_e(fe,"notifications"),Je("userId","==",e),Je("read","==",!1),Zn("createdAt","desc"),Er(s)):at(_e(fe,"notifications"),...o);return Zc(l,c=>{n(c.docs.map(d=>VC(d)))},c=>{console.error("Error subscribing to notifications:",c),r?.(c)})},UC=async e=>{try{const t=Me(fe,"notifications",e);await vt(t,{read:!0})}catch(t){throw console.error("Error marking notification as read:",t),t}},GC=async e=>{try{const t=at(_e(fe,"notifications"),Je("userId","==",e),Je("read","==",!1)),n=await Ye(t);await Promise.all(n.docs.map(r=>vt(r.ref,{read:!0})))}catch(t){throw console.error("Error marking all notifications as read:",t),t}};async function r$(e){if(!e)return 0;const t=_e(fe,"deepDiagnosticAssignments"),n=at(t,Je("lrn","==",e));return(await Ye(n)).docs.filter(s=>{const i=s.data().status;return i==="pending"||i==="queued"||i==="in_progress"||i==="expired"}).length}async function WC(e,t,n="Grade 11",r,s="iar_only",i="initial_assessment"){if(i==="followup_diagnostic"){const o=_e(fe,"deepDiagnosticAssignments"),l=at(o,Je("lrn","==",e)),c=await Ye(l);if(!c.empty){const d=r6(fe);let f=!1;for(const u of c.docs){const m=u.data().status;(m==="pending"||m==="queued")&&(d.update(u.ref,{status:"in_progress",startedAt:ke()}),f=!0)}f&&await d.commit()}}return await rt(Me(fe,"diagnosticResults",e),{lrn:e,results:t,gradeLevel:n,workflowMode:s,assessmentType:i,questionBreakdown:r||null,completedAt:ke(),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 HC(e){return await zo(_e(fe,"quizResults"),{lrn:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:ke()}),{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 a$(e){return await od(e.lrn),await gx(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await gx(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 s$(e){return await zo(_e(fe,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:ke(),processed:!1}),await gx(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 i$(e){const t=Me(fe,"curriculumContent",e.contentId);return e.action==="delete"?await vt(t,{deleted:!0,deletedBy:e.adminId,deletedAt:ke(),contentType:e.contentType,subjectId:e.subjectId||null}):await rt(t,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:ke()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}const o$=Object.freeze(Object.defineProperty({__proto__:null,getPendingDeepDiagnosticCount:r$,triggerContentUpdated:i$,triggerDataImported:s$,triggerDiagnosticCompleted:WC,triggerQuizSubmitted:HC,triggerStudentEnrolled:a$},Symbol.toStringTag,{value:"Module"})),l$=e=>{if(!(e instanceof Error))return!1;const t=e.code,n=(e.message||"").toLowerCase();return t==="failed-precondition"&&n.includes("requires an index")},Hv=e=>{if(!e)return 0;if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;if(typeof e=="string"){const t=Date.parse(e);return Number.isNaN(t)?0:t}if(typeof e=="object"){const t=e;if(typeof t.toMillis=="function")return t.toMillis();if(typeof t.seconds=="number")return t.seconds*1e3}return 0};async function Kv(e,t,n){const r=n?.documentId?Me(fe,"generatedQuizzes",n.documentId):Me(_e(fe,"generatedQuizzes")),s={...e,teacherId:t,createdAt:ke(),status:"draft"};return n?.documentId?await rt(r,s,{merge:!0}):await rt(r,s),r.id}async function c$(e){await vt(Me(fe,"generatedQuizzes",e),{status:"published",publishedAt:ke()})}async function d$(e){await Jc(Me(fe,"generatedQuizzes",e))}async function u$(e,t,n){await vt(Me(fe,"generatedQuizzes",e),{status:"assigned","metadata.assignedTo":t,assignedBy:n,assignedAt:ke()});const r=Me(_e(fe,"quizAssignments"));await rt(r,{quizId:e,lrn:t,teacherId:n,status:"pending",assignedAt:ke(),dueDate:null});const s=Me(_e(fe,"notifications"));await rt(s,{userId:t,type:"quiz_assigned",title:"New Quiz Assigned",message:"Your teacher has assigned you a new quiz. Complete it to earn XP!",quizId:e,read:!1,createdAt:ke()})}async function f$(e){try{const t=at(_e(fe,"generatedQuizzes"),Je("teacherId","==",e),Zn("createdAt","desc"));return(await Ye(t)).docs.map(r=>({id:r.id,...r.data()}))}catch(t){if(!l$(t))throw t;const n=at(_e(fe,"generatedQuizzes"),Je("teacherId","==",e));return(await Ye(n)).docs.map(s=>({id:s.id,...s.data()})).sort((s,i)=>Hv(i.createdAt)-Hv(s.createdAt))}}async function m$(e,t,n,r,s,i,o,l,c,d){const f=Me(_e(fe,"quizSubmissions"));if(await rt(f,{submissionId:f.id,lrn:e,quizId:t,generatedQuizId:n??null,subject:r,source:s,score:i,xpEarned:o,totalTime:l,answers:c,correctCount:c.filter(u=>u.correct).length,totalQuestions:c.length,questionBreakdown:c.map((u,m)=>({questionId:u.questionId,topic:d[m]?.topic??r,difficulty:d[m]?.difficulty??"medium",bloomLevel:d[m]?.bloomLevel??"understand",correct:u.correct,timeSpent:u.timeSpent})),submittedAt:ke()}),n){const u=at(_e(fe,"quizAssignments"),Je("quizId","==",n),Je("lrn","==",e)),m=await Ye(u);for(const h of m.docs)await vt(h.ref,{status:"completed",completedAt:ke(),score:i});try{await vt(Me(fe,"generatedQuizzes",n),{status:"completed"})}catch{}}}const cd=3e4,KC=3,XC=1e3;class vn extends Error{status;statusText;endpoint;responseBody;retryable;requestId;constructor(t){super(`API Error ${t.status} (${t.statusText}) on ${t.endpoint}: ${t.responseBody}`),this.name="ApiError",this.status=t.status,this.statusText=t.statusText,this.endpoint=t.endpoint,this.responseBody=t.responseBody,this.retryable=t.retryable,this.requestId=t.requestId}}class La extends Error{endpoint;timeoutMs;constructor(t,n){super(`Request to ${t} timed out after ${n}ms`),this.name="ApiTimeoutError",this.endpoint=t,this.timeoutMs=n}}class Jl extends Error{endpoint;originalError;constructor(t,n){super(`Network error on ${t}: ${n.message}`),this.name="ApiNetworkError",this.endpoint=t,this.originalError=n}}class an extends Error{endpoint;details;constructor(t,n){super(`Validation error before calling ${t}: ${n}`),this.name="ApiValidationError",this.endpoint=t,this.details=n}}const h$=new Set([408,429,500,502,503,504]);function p$(e){return h$.has(e)}function k0(e){const t=`[API ${e.level.toUpperCase()}] ${e.timestamp} ${e.method} ${e.endpoint}`;switch(e.level){case"error":console.error(t,e.message,e.details??"");break;case"warn":console.warn(t,e.message,e.details??"");break;default:console.info(t,e.message,e.details??"")}}function sr(e,t,n,r){k0({timestamp:new Date().toISOString(),level:"info",endpoint:e,method:t,message:n,details:r})}function bx(e,t,n,r){k0({timestamp:new Date().toISOString(),level:"warn",endpoint:e,method:t,message:n,details:r})}function Ot(e,t,n,r){k0({timestamp:new Date().toISOString(),level:"error",endpoint:e,method:t,message:n,details:r})}function x$(e,t,n=cd){const r=new AbortController,s=setTimeout(()=>r.abort(),n);return{promise:fetch(e,{...t,signal:r.signal}).finally(()=>clearTimeout(s)),abort:()=>r.abort()}}let g$=e=>new Promise(t=>setTimeout(t,e));function Xv(e){return g$(e)}function b$(e,t=XC){const n=t*Math.pow(2,e),r=Math.random()*t;return Math.min(n+r,3e4)}async function Yv(e,t={},n={}){const{maxRetries:r=KC,timeoutMs:s=cd,baseBackoffMs:i=XC}=n,o=(t.method??"GET").toUpperCase();let l;for(let c=0;c<=r;c++){const d=Date.now();try{c>0&&sr(e,o,`Retry attempt ${c}/${r}`);const{promise:f}=x$(e,t,s),u=await f,m=Date.now()-d;if(u.ok)return sr(e,o,`${u.status} in ${m}ms`,{attempt:c}),await u.json();const h=await u.text().catch(()=>"Unable to read response body"),g=p$(u.status),x=new vn({status:u.status,statusText:u.statusText,endpoint:e,responseBody:h,retryable:g,requestId:u.headers.get("x-request-id")??void 0});if(Ot(e,o,`${u.status} ${u.statusText} in ${m}ms`,{attempt:c,responseBody:h.slice(0,500),retryable:g}),!g)throw x;if(u.status===429){const p=u.headers.get("retry-after");if(p){const j=parseInt(p,10);if(!isNaN(j)&&j>0){bx(e,o,`Rate limited. Waiting ${j}s (Retry-After header)`),await Xv(j*1e3),l=x;continue}}}l=x}catch(f){const u=Date.now()-d;if(f instanceof vn&&!f.retryable)throw f;if(f instanceof DOMException&&f.name==="AbortError"){const m=new La(e,s);Ot(e,o,`Timeout after ${u}ms`,{attempt:c,timeoutMs:s}),l=m}else if(f instanceof TypeError&&f.message.includes("fetch")){const m=new Jl(e,f);Ot(e,o,`Network error after ${u}ms: ${f.message}`,{attempt:c}),l=m}else f instanceof vn?l=f:(l=f instanceof Error?f:new Error(String(f)),Ot(e,o,`Unexpected error: ${l.message}`,{attempt:c}))}if(cr==null||r==="").map(([r])=>r);if(n.length>0)throw new an(e,`Missing required fields: ${n.join(", ")}`)}function rn(e,t,n,r,s){if(typeof n!="number"||isNaN(n)||ns)throw new an(e,`${t} must be a number between ${r} and ${s}, got ${n}`)}const dd="https://deign86-mathpulse-api-v3test.hf.space",ud=(e,t)=>t,YC=(e,t)=>t,wu=ud(void 0,!0),Qv=ud(void 0,!0),Zv=ud(void 0,!0),Jv=ud(void 0,!0),e1=YC(void 0,9e4),ju=YC(void 0,9e5);let Nu=!0,t1=0;const y$=6e4,ec={maxRetries:KC,timeoutMs:cd,baseBackoffMs:1e3},Ur={...ec,timeoutMs:6e4},v$={...Ur,maxRetries:1,timeoutMs:45e3,baseBackoffMs:750},Su={maxRetries:2,timeoutMs:12e4,baseBackoffMs:2e3},w$={maxRetries:0,timeoutMs:8e3,baseBackoffMs:500};let fl=null;async function j$(){return fl||(fl=(async()=>{try{sr("/health","GET","Warming up HuggingFace Space...");const e=new AbortController,t=setTimeout(()=>e.abort(),15e3),n=await fetch(`${dd}/health`,{method:"GET",signal:e.signal});return clearTimeout(t),n.ok?(sr("/health","GET","Backend warm and ready"),!0):(console.warn("[apiService] Backend health check returned",n.status),!1)}catch(e){return console.warn("[apiService] Backend warmup failed (cold start expected):",e),!1}})(),fl)}async function ze(e,t,n=ec){const r=`${dd}${e}`,s=t?.method??"GET";sr(e,s,"Starting request");const i=async l=>{const c=new Headers(t?.headers??{});!(t?.body instanceof FormData)&&!c.has("Content-Type")&&c.set("Content-Type","application/json");const d=Ir.currentUser;if(d)try{const f=await d.getIdToken(l);f&&c.set("Authorization",`Bearer ${f}`)}catch(f){Ot(e,s,"Failed to acquire Firebase ID token",f)}return{...t,headers:c}};let o=await i(!1);try{const l=await Yv(r,o,n);return sr(e,s,"Request succeeded"),l}catch(l){if(l instanceof vn&&l.status===401&&Ir.currentUser)try{sr(e,s,"401 received, refreshing Firebase token and retrying once"),o=await i(!0);const c=await Yv(r,o,n);return sr(e,s,"Request succeeded after token refresh"),c}catch(c){throw c instanceof vn?Ot(e,s,`HTTP ${c.status}: ${c.responseBody.slice(0,300)}`):c instanceof La?Ot(e,s,`Timeout after ${c.timeoutMs}ms`):c instanceof Jl?Ot(e,s,`Network error: ${c.originalError.message}`):Ot(e,s,`Unexpected: ${c instanceof Error?c.message:String(c)}`),c}throw l instanceof vn?Ot(e,s,`HTTP ${l.status}: ${l.responseBody.slice(0,300)}`):l instanceof La?Ot(e,s,`Timeout after ${l.timeoutMs}ms`):l instanceof Jl?Ot(e,s,`Network error: ${l.originalError.message}`):Ot(e,s,`Unexpected: ${l instanceof Error?l.message:String(l)}`),l}}async function N$(e,t,n=cd){const r=`${dd}${e}`,s=t?.method??"GET";sr(e,s,"Starting blob request");const i=async o=>{const l=new Headers(t?.headers??{}),c=Ir.currentUser;if(c)try{const u=await c.getIdToken(o);u&&l.set("Authorization",`Bearer ${u}`)}catch(u){Ot(e,s,"Failed to acquire Firebase ID token",u)}const d=new AbortController,f=setTimeout(()=>d.abort(),n);try{const u=await fetch(r,{...t,headers:l,signal:d.signal});if(!u.ok){const m=await u.text();throw new vn({status:u.status,statusText:u.statusText||"Request Failed",endpoint:e,responseBody:m,retryable:u.status>=500||u.status===429})}return await u.blob()}finally{clearTimeout(f)}};try{return await i(!1)}catch(o){if(o instanceof vn&&o.status===401&&Ir.currentUser)return sr(e,s,"401 received for blob request, refreshing Firebase token and retrying once"),i(!0);throw o}}const S$={response:"Sorry, the AI tutor is temporarily unavailable. Please try again in a moment."},k$={riskLevel:"Medium",confidence:0,analysis:{labels:[],scores:[]},risk_level:"medium",risk_score:0,top_factors:["Fallback risk response due to temporary service unavailability"]},A$={learningPath:"Unable to generate a learning path right now. Please try again later."},C$={insight:"Daily insight is temporarily unavailable. Please refresh later."},T$={expression:"",result:"Error: calculation service unavailable",steps:[],simplified:null,latex:null};function P$(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.riskLevel=="string"&&typeof t.confidence=="number"}function n1(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.questions)&&typeof t.totalPoints=="number"}const M$=e=>new Promise(t=>setTimeout(t,e));function E$(e){if(!e)return"Generation task failed without a detailed error.";if(typeof e=="string")return e;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return"Generation task failed due to an unknown error."}}return String(e)}const $e={getImportGroundedRolloutFlags(){return{quizEnabled:wu,lessonEnabled:Qv,feedbackEnabled:Zv}},async reportImportGroundedFeedback(e){return Zv?ze("/api/feedback/import-grounded",{method:"POST",body:JSON.stringify(e)}):{success:!0,stored:!1,warnings:["Import-grounded feedback events are disabled by frontend rollout flag."]}},async health(){return ze("/health",void 0,{...ec,timeoutMs:1e4})},async chat(e,t,n,r){Kt("/api/chat",{message:e});const s={message:e,history:t??[],...r?.expectedEndMarker?{expectedEndMarker:r.expectedEndMarker}:{},...r?.completionMode?{completionMode:r.completionMode}:{},...typeof r?.continuationMaxRounds=="number"?{continuationMaxRounds:Math.max(0,Math.floor(r.continuationMaxRounds))}:{}};if(n){const o=new AbortController;let l=null,c=null,d=null;const f=p=>{l||(l=p,o.abort())},u=()=>{c&&(clearTimeout(c),c=null),d&&(clearTimeout(d),d=null)},m=()=>{c&&clearTimeout(c),c=setTimeout(()=>f("idle"),e1)};d=setTimeout(()=>f("total"),ju);const h=new Headers({"Content-Type":"application/json"}),g=Ir.currentUser;if(g)try{const p=await g.getIdToken(!1);p&&h.set("Authorization",`Bearer ${p}`)}catch(p){Ot("/api/chat/stream","POST","Failed to acquire Firebase ID token",p)}let x=null;try{m();const p=await fetch(`${dd}/api/chat/stream`,{method:"POST",headers:h,body:JSON.stringify(s),signal:o.signal});if(!p.ok||!p.body){const w=await p.text().catch(()=>"Unable to read response body");throw new Error(`Streaming request failed (${p.status}): ${w.slice(0,300)}`)}x=p.body.getReader();const j=new TextDecoder;let S="",y="",N=!1;const b=w=>{const k=w.indexOf(` + +`),A=w.indexOf(`\r +\r +`);return k===-1&&A===-1?null:k===-1?{index:A,length:4}:A===-1?{index:k,length:2}:k$e.chat(e,t,void 0,n),S$,"chat")},async predictRisk(e){Kt("/api/predict-risk",{engagementScore:e.engagementScore,avgQuizScore:e.avgQuizScore,attendance:e.attendance,assignmentCompletion:e.assignmentCompletion}),rn("/api/predict-risk","engagementScore",e.engagementScore,0,100),rn("/api/predict-risk","avgQuizScore",e.avgQuizScore,0,100),rn("/api/predict-risk","attendance",e.attendance,0,100),rn("/api/predict-risk","assignmentCompletion",e.assignmentCompletion,0,100);const t=await ze("/api/predict-risk",{method:"POST",body:JSON.stringify(e)});if(!P$(t))throw Ot("/api/predict-risk","POST","Invalid response shape",t),new Error("Invalid risk prediction response from server");return t},async predictRiskSafe(e){return vi(()=>$e.predictRisk(e),k$,"predictRisk")},async predictRiskBatch(e){if(!Array.isArray(e)||e.length===0)throw new an("/api/predict-risk/batch","students array must not be empty");return ze("/api/predict-risk/batch",{method:"POST",body:JSON.stringify({students:e})})},async getLearningPath(e){if(Kt("/api/learning-path",{weaknesses:e.weaknesses,gradeLevel:e.gradeLevel}),!Array.isArray(e.weaknesses)||e.weaknesses.length===0)throw new an("/api/learning-path","weaknesses must be a non-empty array");return ze("/api/learning-path",{method:"POST",body:JSON.stringify(e)},Ur)},async getLearningPathSafe(e){return vi(()=>$e.getLearningPath(e),A$,"getLearningPath")},async getDailyInsight(e){if(!Array.isArray(e.students)||e.students.length===0)throw new an("/api/analytics/daily-insight","students array must not be empty");return ze("/api/analytics/daily-insight",{method:"POST",body:JSON.stringify(e)},Ur)},async getDailyInsightSafe(e){return vi(()=>$e.getDailyInsight(e),C$,"getDailyInsight")},async getImportedClassOverview(e){if(!e?.forceRefresh&&!Nu&&Date.now()!s||s.size===0))throw new an("/api/upload/class-records","All files must be non-empty");if(n.some(s=>s.size>10*1024*1024))throw new an("/api/upload/class-records","One or more files exceed the 10 MB size limit");const r=new FormData;return n.forEach(s=>r.append("files",s)),t?.classSectionId&&r.append("classSectionId",t.classSectionId),t?.className&&r.append("className",t.className),r.append("datasetIntent",t?.datasetIntent??"synthetic_student_records"),ze("/api/upload/class-records",{method:"POST",body:r},Su)},async previewStudentAccountImport(e,t){if(!e||e.size===0)throw new an("/api/import/student-accounts/preview","A non-empty file is required");if(e.size>10*1024*1024)throw new an("/api/import/student-accounts/preview","File exceeds 10 MB size limit");const n=new FormData;return n.append("file",e),t?.classSectionId&&n.append("classSectionId",t.classSectionId),t?.className&&n.append("className",t.className),t?.defaultGrade&&n.append("defaultGrade",t.defaultGrade),t?.defaultSection&&n.append("defaultSection",t.defaultSection),ze("/api/import/student-accounts/preview",{method:"POST",body:n},Su)},async commitStudentAccountImport(e){return Kt("/api/import/student-accounts/commit",{previewToken:e.previewToken}),ze("/api/import/student-accounts/commit",{method:"POST",body:JSON.stringify(e)},ec)},async getRiskRefreshMonitor(e){const t=e?.limit??10;rn("/api/upload/class-records/risk-refresh/recent","limit",t,1,50);const n=new URLSearchParams;return n.set("limit",String(t)),e?.classSectionId&&n.set("classSectionId",e.classSectionId),ze(`/api/upload/class-records/risk-refresh/recent?${n.toString()}`)},async getImportGroundedTelemetrySummary(e){const t=e?.days??7,n=e?.limit??5e3;rn("/api/feedback/import-grounded/summary","days",t,1,30),rn("/api/feedback/import-grounded/summary","limit",n,100,2e4);const r=new URLSearchParams;return r.set("days",String(t)),r.set("limit",String(n)),e?.classSectionId&&r.set("classSectionId",e.classSectionId),ze(`/api/feedback/import-grounded/summary?${r.toString()}`)},async getImportGroundedAccessAudit(e){const t=e?.days??7,n=e?.limit??200;rn("/api/import-grounded/access-audit","days",t,1,30),rn("/api/import-grounded/access-audit","limit",n,1,1e3);const r=new URLSearchParams;return r.set("days",String(t)),r.set("limit",String(n)),r.set("export","json"),e?.classSectionId&&r.set("classSectionId",e.classSectionId),ze(`/api/import-grounded/access-audit?${r.toString()}`)},async exportImportGroundedAccessAuditCsv(e){const t=e?.days??7,n=e?.limit??200;rn("/api/import-grounded/access-audit","days",t,1,30),rn("/api/import-grounded/access-audit","limit",n,1,1e3);const r=new URLSearchParams;return r.set("days",String(t)),r.set("limit",String(n)),r.set("export","csv"),e?.classSectionId&&r.set("classSectionId",e.classSectionId),N$(`/api/import-grounded/access-audit?${r.toString()}`,{method:"GET"},3e4)},async uploadCourseMaterials(e,t){const n=Array.isArray(e)?e:[e];if(n.length===0)throw new an("/api/upload/course-materials","At least one file is required");if(n.some(s=>!s||s.size===0))throw new an("/api/upload/course-materials","All files must be non-empty");if(n.some(s=>s.size>10*1024*1024))throw new an("/api/upload/course-materials","One or more files exceed the 10 MB size limit");const r=new FormData;return n.forEach(s=>r.append("files",s)),t?.classSectionId&&r.append("classSectionId",t.classSectionId),t?.className&&r.append("className",t.className),ze("/api/upload/course-materials",{method:"POST",body:r},Su)},async getRecentCourseMaterials(e){const t=e?.limit??10;rn("/api/upload/course-materials/recent","limit",t,1,50);const n=new URLSearchParams;return n.set("limit",String(t)),e?.classSectionId&&n.set("classSectionId",e.classSectionId),ze(`/api/upload/course-materials/recent?${n.toString()}`)},async getCourseMaterialTopics(e){const t=e?.limit??20;rn("/api/course-materials/topics","limit",t,1,50);const n=new URLSearchParams;return n.set("limit",String(t)),e?.classSectionId&&n.set("classSectionId",e.classSectionId),e?.materialId&&n.set("materialId",e.materialId),ze(`/api/course-materials/topics?${n.toString()}`)},async generateLessonPlan(e){Kt("/api/lesson/generate",{gradeLevel:e.gradeLevel});const t={...e,preferImportedTopics:Qv&&(e.preferImportedTopics??!0)};if(Jv){const n=await $e.submitLessonPlanAsync(t),s=(await $e.waitForTaskResult(n.taskId,{timeoutMs:24e4,pollIntervalMs:1500})).result;if(!s||typeof s!="object")throw new Error("Lesson generation completed without a valid result payload.");return s}return ze("/api/lesson/generate",{method:"POST",body:JSON.stringify(t)},Ur)},async generateQuiz(e,t){if(Kt("/api/quiz/generate",{topics:e.topics,gradeLevel:e.gradeLevel}),!Array.isArray(e.topics)||e.topics.length===0)throw new an("/api/quiz/generate","topics must be a non-empty array");const n={...e,preferImportedTopics:wu&&(e.preferImportedTopics??!0)};if(Jv){const s=await $e.submitQuizAsync(n);t?.onTaskCreated?.(s.taskId);const o=(await $e.waitForTaskResult(s.taskId,{timeoutMs:24e4,pollIntervalMs:1500,onProgress:t?.onProgress})).result;if(!o||typeof o!="object")throw new Error("Quiz generation completed without a valid result payload.");if(!n1(o))throw new Error("Invalid quiz generation response from async task payload.");return o}const r=await ze("/api/quiz/generate",{method:"POST",body:JSON.stringify(n)},Ur);if(!n1(r))throw Ot("/api/quiz/generate","POST","Invalid response shape",r),new Error("Invalid quiz generation response from server");return r},async previewQuiz(e){Kt("/api/quiz/preview",{topics:e.topics,gradeLevel:e.gradeLevel});const t={...e,preferImportedTopics:wu&&(e.preferImportedTopics??!0)};return ze("/api/quiz/preview",{method:"POST",body:JSON.stringify(t)},Ur)},async submitLessonPlanAsync(e){return ze("/api/lesson/generate-async",{method:"POST",body:JSON.stringify(e)},Ur)},async submitQuizAsync(e){return ze("/api/quiz/generate-async",{method:"POST",body:JSON.stringify(e)},Ur)},async getTaskStatus(e){return Kt("/api/tasks/{taskId}",{taskId:e}),ze(`/api/tasks/${encodeURIComponent(e)}`)},async listTasks(e){const t=new URLSearchParams;e?.limit!=null&&(rn("/api/tasks","limit",e.limit,1,200),t.set("limit",String(e.limit))),e?.status&&t.set("status",e.status),e?.includeResults!=null&&t.set("include_results",String(e.includeResults));const n=t.toString();return ze(`/api/tasks${n?`?${n}`:""}`)},async cancelTask(e){return Kt("/api/tasks/{taskId}/cancel",{taskId:e}),ze(`/api/tasks/${encodeURIComponent(e)}/cancel`,{method:"POST"})},async waitForTaskResult(e,t){const n=t?.timeoutMs??18e4,r=t?.pollIntervalMs??1500,s=Date.now();for(;Date.now()-s<=n;){const i=await $e.getTaskStatus(e);if(t?.onProgress?.(i),i.status==="completed")return i;if(i.status==="failed"||i.status==="cancelled")throw new Error(E$(i.error));await M$(r)}throw new Error(`Async generation task timed out after ${Math.round(n/1e3)} seconds.`)},async getQuizTopics(e){const t=e?`?gradeLevel=${encodeURIComponent(e)}`:"";return ze(`/api/quiz/topics${t}`)},async getStudentCompetency(e,t){return Kt("/api/quiz/student-competency",{studentId:e}),ze("/api/quiz/student-competency",{method:"POST",body:JSON.stringify({studentId:e,quizHistory:t})})},async evaluateExpression(e){return Kt("/api/calculator/evaluate",{expression:e}),ze("/api/calculator/evaluate",{method:"POST",body:JSON.stringify({expression:e})})},async evaluateExpressionSafe(e){return vi(()=>$e.evaluateExpression(e),{...T$,expression:e},"evaluateExpression")},async automationDiagnosticCompleted(e){return Kt("/api/automation/diagnostic-completed",{lrn:e.lrn,results:e.results}),ze("/api/automation/diagnostic-completed",{method:"POST",body:JSON.stringify(e)})},async automationQuizSubmitted(e){return Kt("/api/automation/quiz-submitted",{lrn:e.lrn,quizId:e.quizId,subject:e.subject}),ze("/api/automation/quiz-submitted",{method:"POST",body:JSON.stringify(e)})},async automationStudentEnrolled(e){return Kt("/api/automation/student-enrolled",{lrn:e.lrn,name:e.name,email:e.email}),ze("/api/automation/student-enrolled",{method:"POST",body:JSON.stringify(e)})},async automationDataImported(e){return Kt("/api/automation/data-imported",{teacherId:e.teacherId,students:e.students}),ze("/api/automation/data-imported",{method:"POST",body:JSON.stringify(e)})},async automationContentUpdated(e){return Kt("/api/automation/content-updated",{adminId:e.adminId,action:e.action,contentType:e.contentType,contentId:e.contentId}),ze("/api/automation/content-updated",{method:"POST",body:JSON.stringify(e)})}},A0=Object.freeze(Object.defineProperty({__proto__:null,ApiError:vn,ApiNetworkError:Jl,ApiTimeoutError:La,ApiValidationError:an,apiService:$e,warmupBackend:j$},Symbol.toStringTag,{value:"Module"}));function _$(e){const t=[];let n=0;for(;n0){const f=l[l.length-1],u=f===")"||f==="π"||f==="e"||f==="Ans"||/^\d/.test(f),m=d==="("||d==="π"||d==="e"||d==="Ans"||o.has(d)||/^\d/.test(d);u&&m&&l.push("×")}l.push(d)}for(const c of l)if(/^-?[\d.]+([eE][+-]?\d+)?$/.test(c))n.push(c);else if(c==="π")n.push(String(Math.PI));else if(c==="e"&&!o.has(c))n.push(String(Math.E));else if(c==="Ans")n.push("__ANS__");else if(o.has(c))r.push(c);else if(c==="(")r.push(c);else if(c===")"){for(;r.length&&r[r.length-1]!=="(";)n.push(r.pop());r.pop(),r.length&&o.has(r[r.length-1])&&n.push(r.pop())}else if(c in s){const d=s[c];for(;r.length&&r[r.length-1]!=="("&&r[r.length-1]in s&&(s[r[r.length-1]]>d||s[r[r.length-1]]===d&&!i.has(c));)n.push(r.pop());r.push(c)}for(;r.length;)n.push(r.pop());return n}function O$(e){if(e<0||!Number.isInteger(e))return NaN;if(e>170)return 1/0;let t=1;for(let n=2;n<=e;n++)t*=n;return t}function D$(e){return e*Math.PI/180}function R$(e){return e*180/Math.PI}function L$(e,t,n){const r=[],s=t==="DEG"?D$:o=>o,i=t==="DEG"?R$:o=>o;for(const o of e){if(o==="__ANS__"){r.push(n);continue}const l=parseFloat(o);if(!isNaN(l)&&/^-?[\d.]+([eE][+-]?\d+)?$/.test(o)){r.push(l);continue}if(["+","-","×","÷","*","/","^","%"].includes(o)){const d=r.pop(),f=r.pop();switch(o){case"+":r.push(f+d);break;case"-":r.push(f-d);break;case"×":case"*":r.push(f*d);break;case"÷":case"/":if(d===0){r.push(NaN);break}r.push(f/d);break;case"^":r.push(Math.pow(f,d));break;case"%":r.push(f*d/100);break}continue}const c=r.pop();switch(o){case"sin":r.push(Math.sin(s(c)));break;case"cos":r.push(Math.cos(s(c)));break;case"tan":{const d=s(c);if(Math.abs(Math.cos(d))<1e-15){r.push(NaN);break}r.push(Math.tan(d));break}case"asin":if(c<-1||c>1){r.push(NaN);break}r.push(i(Math.asin(c)));break;case"acos":if(c<-1||c>1){r.push(NaN);break}r.push(i(Math.acos(c)));break;case"atan":r.push(i(Math.atan(c)));break;case"sinh":r.push(Math.sinh(c));break;case"cosh":r.push(Math.cosh(c));break;case"tanh":r.push(Math.tanh(c));break;case"log":r.push(c<=0?NaN:Math.log10(c));break;case"ln":r.push(c<=0?NaN:Math.log(c));break;case"sqrt":r.push(c<0?NaN:Math.sqrt(c));break;case"cbrt":r.push(Math.cbrt(c));break;case"abs":r.push(Math.abs(c));break;case"factorial":r.push(O$(c));break;case"tenPow":r.push(Math.pow(10,c));break;case"ePow":r.push(Math.exp(c));break;case"neg":r.push(-c);break;case"nroot":{const d=r.pop();r.push(Math.pow(d,1/c));break}default:r.push(NaN)}}return r.length===1?r[0]:NaN}function $$(e){let t=0;for(const n of e)n==="("?t++:n===")"&&t--;return e+")".repeat(Math.max(0,t))}function z$(e){if(!isFinite(e))return isNaN(e)?"Math Error":e>0?"∞":"-∞";if(Number.isInteger(e)&&Math.abs(e)<1e15)return e.toString();if(Math.abs(e)>=1e10||Math.abs(e)<1e-10&&e!==0)return e.toExponential(6);const t=e.toPrecision(10);return parseFloat(t).toString()}function F$(e,t,n){try{const r=$$(e),s=_$(r);if(s.length===0)return"0";const i=I$(s,t),o=L$(i,t,n);return z$(o)}catch{return"Error"}}const C0=({isOpen:e,onClose:t,inline:n=!1})=>{const[r,s]=v.useState(""),[i,o]=v.useState("0"),[l,c]=v.useState(""),[d,f]=v.useState("DEG"),[u,m]=v.useState(!1),[h,g]=v.useState(!1),[x,p]=v.useState(0),[j,S]=v.useState([]),[y,N]=v.useState(!1),[b,w]=v.useState(!1),[k,A]=v.useState(null),[C,F]=v.useState(()=>{try{return localStorage.getItem("mathpulse_calc_minimized")==="true"}catch{return!1}}),[D,L]=v.useState(!1),[P,H]=v.useState(!1),Y=v.useRef(null),V=v.useRef(null),O=v.useRef(!1),[E,B]=v.useState({x:0,y:0});v.useEffect(()=>{e&&B({x:Math.round((window.innerWidth-380)/2),y:Math.max(20,Math.round((window.innerHeight-600)/2))})},[e]),v.useEffect(()=>{try{localStorage.setItem("mathpulse_calc_minimized",String(C))}catch{}},[C]),v.useEffect(()=>{Y.current&&(Y.current.scrollLeft=Y.current.scrollWidth)},[r]),v.useEffect(()=>{const te=se=>{V.current&&!V.current.contains(se.target)&&L(!1)};return document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[]),v.useEffect(()=>{if(!e)return;const te=se=>{if(!D)return;const q=se.key;if(se.altKey){if(se.preventDefault(),se.shiftKey){if(q==="S"||q==="s"){M("asin");return}if(q==="C"||q==="c"){M("acos");return}if(q==="T"||q==="t"){M("atan");return}}if(q==="s"||q==="S"){M("sin");return}if(q==="c"||q==="C"){M("cos");return}if(q==="t"||q==="T"){M("tan");return}if(q==="l"||q==="L"){M("log");return}if(q==="n"||q==="N"){M("ln");return}if(q==="r"||q==="R"){M("sqrt");return}if(q==="p"||q==="P"){T("π");return}if(q==="e"||q==="E"){T("e");return}if(q==="2"){T("²");return}if(q==="3"){T("³");return}if(q==="^"||q==="6"){T("^");return}if(q==="a"||q==="A"){T("Ans");return}if(q==="d"||q==="D"){Z();return}return}se.stopPropagation(),/^[0-9.]$/.test(q)?(T(q),se.preventDefault()):q==="+"?(T("+"),se.preventDefault()):q==="-"?(T("-"),se.preventDefault()):q==="*"?(T("×"),se.preventDefault()):q==="/"?(T("÷"),se.preventDefault()):q==="%"?(T("%"),se.preventDefault()):q==="("?(T("("),se.preventDefault()):q===")"?(T(")"),se.preventDefault()):q==="^"?(T("^"),se.preventDefault()):q==="Enter"||q==="="?(I(),se.preventDefault()):q==="Backspace"?(K(),se.preventDefault()):(q==="Escape"||q==="Delete")&&(X(),se.preventDefault())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[e,D,r,x,d]);const T=v.useCallback(te=>{N(!1),A(null),s(se=>se+te)},[]),M=v.useCallback(te=>{N(!1),A(null),s(se=>se+te+"("),m(!1)},[]),K=v.useCallback(()=>{s(te=>te.slice(0,-1)),N(!1)},[]),X=v.useCallback(()=>{s(""),o("0"),c(""),N(!1),A(null)},[]),I=v.useCallback(()=>{if(!r.trim())return;const te=F$(r,d,x),se=te==="Error"||te==="Math Error";if(N(se),o(te),!se){const q=parseFloat(te);isNaN(q)||p(q),S(W=>[...W.slice(-19),{expression:r,result:te}]),c(r+" =")}s("")},[r,d,x]),Z=v.useCallback(()=>{f(te=>te==="DEG"?"RAD":"DEG")},[]),ne=v.useCallback(()=>{m(te=>!te),g(!1)},[]),ee=v.useCallback(()=>{g(te=>!te),m(!1)},[]),$=v.useCallback(()=>{T("Ans")},[T]),_=v.useCallback(()=>{T("×10^")},[T]),Q=v.useCallback(async()=>{const te=r.trim()||(j.length>0?j[j.length-1].expression:"");if(te){w(!0);try{const se=te.replace(/×/g,"*").replace(/÷/g,"/").replace(/π/g,"pi").replace(/Ans/g,String(x)).replace(/(\d)\(/g,"$1*(").replace(/\)(\d)/g,")*$1"),q=await $e.evaluateExpression(se);A(q)}catch{A({expression:te,result:"Verification unavailable",steps:["Backend unavailable — using client-side result"],simplified:null,latex:null})}finally{w(!1)}}},[r,j,x]),R=[[{label:"SHIFT",action:ne,variant:"shift"},{label:"ALPHA",action:ee,variant:"shift"},{label:d,action:Z,variant:"mode"},{label:"◀",action:()=>{K()},variant:"mode"},{label:"▶",action:()=>{T(" ")},variant:"mode"}],[{label:"x²",shiftLabel:"√",action:()=>T("^2"),shiftAction:()=>M("sqrt"),variant:"func"},{label:"x³",shiftLabel:"³√",action:()=>T("^3"),shiftAction:()=>M("cbrt"),variant:"func"},{label:"xʸ",shiftLabel:"ʸ√x",action:()=>T("^"),shiftAction:()=>M("nroot"),variant:"func"},{label:"log",shiftLabel:"10ˣ",action:()=>M("log"),shiftAction:()=>M("tenPow"),variant:"func"},{label:"ln",shiftLabel:"eˣ",action:()=>M("ln"),shiftAction:()=>M("ePow"),variant:"func"}],[{label:"√",shiftLabel:"x²",action:()=>M("sqrt"),shiftAction:()=>T("^2"),variant:"func"},{label:"³√",shiftLabel:"x³",action:()=>M("cbrt"),shiftAction:()=>T("^3"),variant:"func"},{label:"ʸ√x",shiftLabel:"xʸ",action:()=>M("nroot"),shiftAction:()=>T("^"),variant:"func"},{label:"sin",shiftLabel:"sin⁻¹",action:()=>M("sin"),shiftAction:()=>M("asin"),variant:"func"},{label:"cos",shiftLabel:"cos⁻¹",action:()=>M("cos"),shiftAction:()=>M("acos"),variant:"func"}],[{label:"tan",shiftLabel:"tan⁻¹",action:()=>M("tan"),shiftAction:()=>M("atan"),variant:"func"},{label:"sin⁻¹",shiftLabel:"sinh",action:()=>M("asin"),shiftAction:()=>M("sinh"),variant:"func"},{label:"cos⁻¹",shiftLabel:"cosh",action:()=>M("acos"),shiftAction:()=>M("cosh"),variant:"func"},{label:"tan⁻¹",shiftLabel:"tanh",action:()=>M("atan"),shiftAction:()=>M("tanh"),variant:"func"},{label:"π",action:()=>T("π"),variant:"func"}],[{label:"(",action:()=>T("("),variant:"func"},{label:")",action:()=>T(")"),variant:"func"},{label:"e",action:()=>T("e"),variant:"func"},{label:"EXP",action:_,variant:"func"},{label:"%",action:()=>T("%"),variant:"func"}],[{label:"7",action:()=>T("7"),variant:"number"},{label:"8",action:()=>T("8"),variant:"number"},{label:"9",action:()=>T("9"),variant:"number"},{label:"DEL",action:K,variant:"del"},{label:"AC",action:X,variant:"del"}],[{label:"4",action:()=>T("4"),variant:"number"},{label:"5",action:()=>T("5"),variant:"number"},{label:"6",action:()=>T("6"),variant:"number"},{label:"×",action:()=>T("×"),variant:"op"},{label:"÷",action:()=>T("÷"),variant:"op"}],[{label:"1",action:()=>T("1"),variant:"number"},{label:"2",action:()=>T("2"),variant:"number"},{label:"3",action:()=>T("3"),variant:"number"},{label:"+",action:()=>T("+"),variant:"op"},{label:"−",action:()=>T("-"),variant:"op"}],[{label:"0",action:()=>T("0"),variant:"number"},{label:".",action:()=>T("."),variant:"number"},{label:"×10ˣ",action:_,variant:"func"},{label:"Ans",action:$,variant:"op"},{label:"=",action:I,variant:"equals"}]],G=(te,se)=>{const q="flex items-center justify-center rounded-2xl font-bold transition-all duration-150 active:scale-95 select-none cursor-pointer touch-manipulation relative overflow-hidden",W="min-h-[56px] text-[16px]",de="min-h-[56px] text-[14px]";switch(te){case"number":return`${q} ${W} bg-white hover:bg-[#edf1f7] text-[#0a1628] border border-[#dde3eb] shadow-sm`;case"op":return`${q} ${W} bg-[#edf1f7] hover:bg-[#dde3eb] text-[#7274ED] border border-[#dde3eb] shadow-sm font-bold`;case"func":return`${q} ${de} bg-[#9956DE] hover:bg-[#8A4DCA] text-white shadow-md shadow-[#9956DE]/20`;case"del":return`${q} ${W} ${se==="AC"?"bg-[#FF8B8B] hover:bg-[#FF7373]":"bg-[#FB96BB] hover:bg-[#FA7DA9]"} text-[#8A1A1A] shadow-md shadow-red-900/10 font-bold border-none`;case"equals":return`${q} ${W} bg-[#1FA7E1] hover:bg-[#1C96CB] text-white shadow-lg shadow-[#1FA7E1]/30 font-bold text-lg`;case"shift":return`${q} ${de} bg-white hover:bg-[#edf1f7] text-[#9956DE] border border-[#dde3eb] shadow-sm font-bold uppercase tracking-wider text-[11px]`;case"mode":return`${q} ${de} bg-white hover:bg-[#edf1f7] text-[#1FA7E1] border border-[#dde3eb] shadow-sm font-bold`;default:return`${q} ${W} bg-slate-100 text-[#0a1628] border border-slate-200`}},ae=v.useCallback(te=>{te.preventDefault(),O.current=!0;const se=te.clientX,q=te.clientY,W=E.x,de=E.y,Ae=Ce=>{const Se=W+(Ce.clientX-se),ct=de+(Ce.clientY-q);B({x:Se,y:ct})},we=Ce=>{O.current=!1;const Se={x:W+(Ce.clientX-se),y:de+(Ce.clientY-q)};B(Se);try{localStorage.setItem("mathpulse_calc_position",JSON.stringify(Se))}catch{}document.removeEventListener("mousemove",Ae),document.removeEventListener("mouseup",we)};document.addEventListener("mousemove",Ae),document.addEventListener("mouseup",we)},[E]);if(!e)return null;const re=a.jsxs("div",{className:"flex flex-col w-full select-none",children:[a.jsxs("div",{className:"bg-white rounded-t-2xl p-4 border border-slate-200 border-b-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:` + text-[10px] font-bold px-2 py-0.5 rounded-full + ${d==="DEG"?"bg-rose-500/20 text-rose-400 border border-sky-500/30":"bg-rose-500/20 text-rose-400 border border-rose-500/30"} + `,children:d}),u&&a.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-[#6ED1CF]/30 text-[#1FA7E1] border border-[#1FA7E1]/40 animate-pulse",children:"SHIFT"}),h&&a.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-sky-500/20 text-sky-400 border border-indigo-500/30",children:"ALPHA"}),b&&a.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-sky-500/20 text-sky-400 border border-sky-500/30 animate-pulse",children:"Verifying…"})]}),a.jsx("div",{ref:Y,className:"text-right text-slate-500 text-[14px] font-mono h-6 overflow-x-auto overflow-y-hidden whitespace-nowrap scrollbar-hide",children:l||" "}),a.jsx("div",{className:` + text-right font-mono font-bold text-[32px] leading-tight h-10 overflow-hidden whitespace-nowrap + ${y?"text-red-400":"text-[#0a1628]"} + `,children:r||i}),a.jsx(Ke,{children:k&&a.jsxs(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-2 pt-2 border-t border-slate-300",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-sky-400"}),a.jsx("span",{className:"text-[10px] text-rose-400 font-semibold uppercase tracking-wider",children:"SymPy Verified"})]}),a.jsx("p",{className:"text-xs text-slate-500 font-mono",children:k.result}),k.latex&&a.jsxs("p",{className:"text-[10px] text-[#5a6578] font-mono mt-0.5",children:["LaTeX: ",k.latex]}),k.steps.length>1&&a.jsx("div",{className:"mt-1 space-y-0.5",children:k.steps.slice(1).map((te,se)=>a.jsx("p",{className:"text-[10px] text-[#5a6578]",children:te},se))})]})})]}),a.jsxs("button",{onClick:Q,disabled:b,className:` + w-full py-1.5 bg-slate-50 border-x border-slate-200 + text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:bg-slate-100 + transition-colors disabled:opacity-50 disabled:cursor-not-allowed + flex items-center justify-center gap-1.5 + `,children:[a.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),b?"Verifying with SymPy…":"Verify with SymPy"]}),a.jsx("div",{className:"bg-white rounded-b-2xl p-4 border border-slate-200 border-t-0 space-y-1.5",children:R.map((te,se)=>a.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:te.map((q,W)=>{const de=u&&q.shiftAction,Ae=de&&q.shiftLabel||q.label,we=de?q.shiftAction:q.action;return a.jsxs("button",{onClick:we,className:` + ${G(q.variant,q.label)} + ${q.variant==="shift"&&q.label==="SHIFT"&&u?"!bg-[#6ED1CF]/35 !text-[#1FA7E1] ring-2 ring-[#1FA7E1]/35 border-[#1FA7E1]/30":""} + ${q.variant==="shift"&&q.label==="ALPHA"&&h?"!bg-[#7274ED] !text-white ring-2 ring-[#9956DE]/50":""} + ${q.colSpan?`col-span-${q.colSpan}`:""} + ${de&&q.variant==="func"?"!bg-gradient-to-br !from-[#6ED1CF] !to-[#1FA7E1] hover:!from-[#8FE4DA] hover:!to-[#49BDEB] !text-white shadow-md shadow-[#1FA7E1]/20":""} + ${q.variant==="op"&&!["DEL","AC"].includes(q.label)?"bg-gradient-to-br from-[#FFB356] to-[#FF8B8B] !text-white font-bold shadow-md":""} + relative + `,title:q.shiftLabel?`SHIFT: ${q.shiftLabel}`:void 0,children:[q.shiftLabel&&!u&&a.jsx("span",{className:"absolute top-1 right-1 text-[10px] leading-none bg-white/95 text-[#9956DE] font-black px-1.5 py-0.5 rounded-md shadow-sm",children:q.shiftLabel}),a.jsx("span",{className:de?"text-[#EAFBFF]":"",children:Ae})]},W)})},se))}),P&&a.jsx("div",{className:"bg-slate-50 border-t border-slate-200 text-xs text-slate-500 p-3 rounded-b-2xl",children:a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+S"}),a.jsx("span",{children:"sin("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+S"}),a.jsx("span",{children:"sin⁻¹("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+C"}),a.jsx("span",{children:"cos("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+C"}),a.jsx("span",{children:"cos⁻¹("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+T"}),a.jsx("span",{children:"tan("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+T"}),a.jsx("span",{children:"tan⁻¹("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+L"}),a.jsx("span",{children:"log("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+N"}),a.jsx("span",{children:"ln("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+R"}),a.jsx("span",{children:"√("})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+P"}),a.jsx("span",{children:"π"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+E"}),a.jsx("span",{children:"e"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+2"}),a.jsx("span",{children:"²"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+3"}),a.jsx("span",{children:"³"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+^"}),a.jsx("span",{children:"^"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+A"}),a.jsx("span",{children:"Ans"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#5a6578]",children:"Alt+D"}),a.jsx("span",{children:"DEG/RAD"})]})]})})]});return n?re:a.jsx(Ke,{children:e&&a.jsxs("div",{ref:V,className:"fixed z-50",style:{top:E.y,left:E.x,width:380},onClick:()=>L(!0),children:[a.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 rounded-t-2xl px-4 py-2.5 flex items-center justify-between",style:{cursor:"move"},onMouseDown:ae,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(lD,{size:14,className:"text-white/50"}),a.jsx("h3",{className:"text-white font-bold text-sm",children:"Scientific Calculator"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>H(te=>!te),className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",title:"Keyboard shortcuts",children:a.jsx(pD,{size:14,className:"text-white"})}),a.jsx("button",{onClick:()=>F(!C),className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",children:C?a.jsx(Es,{size:14,className:"text-white"}):a.jsx(Hn,{size:14,className:"text-white"})}),a.jsx("button",{onClick:t,className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",children:a.jsx(Xe,{size:14,className:"text-white"})})]})]}),!C&&re,C&&a.jsx("div",{className:"bg-slate-50 rounded-b-2xl p-3 border border-slate-200 border-t-0",children:a.jsx("p",{className:"text-right text-[#0a1628] font-mono font-bold text-lg",children:i})})]})})},r1={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"};function B$(e){let t=e;return t=t.replace(/sin⁻¹/g,"sin-1"),t=t.replace(/cos⁻¹/g,"cos-1"),t=t.replace(/tan⁻¹/g,"tan-1"),t=t.replace(/⁻¹/g,"-1"),t=t.replace(/²/g,"2"),t=t.replace(/³/g,"3"),t=t.replace(/[⁰¹⁴⁵⁶⁷⁸⁹]/g,n=>`${{"⁰":"0","¹":"1","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9"}[n]??n}`),t=t.replace(/√/g,"√"),t=t.replace(/π/g,"π"),t=t.replace(/<(?!\/?(?:sup|sub)\b)[^>]*>/gi,""),t}const QC=({value:e,onChange:t,placeholder:n,onCalculatorOpen:r,onSubmit:s})=>{const[i,o]=v.useState(!1),[l,c]=v.useState(null),[d,f]=v.useState({top:0,left:0}),u=v.useRef(null),m=v.useRef(!1),h=v.useCallback(b=>{const w=u.current;if(!w){t(e+b);return}const k=w.selectionStart??e.length,A=w.selectionEnd??e.length,C=e.slice(0,k)+b+e.slice(A);t(C),setTimeout(()=>{w.setSelectionRange(k+b.length,k+b.length),w.focus()},0)},[e,t]),g=v.useCallback(b=>{const w=b.key;if(w==="Enter"){b.preventDefault(),s?.();return}if(w==="^"){m.current=!0,b.preventDefault();return}if(m.current){if(w==="-"){h("⁻"),b.preventDefault();return}if(/^[0-9]$/.test(w)&&r1[w]){h(r1[w]),m.current=!1,b.preventDefault();return}m.current=!1}if(w==="Tab"&&l!==null){h(l),c(null),b.preventDefault();return}setTimeout(()=>{const k=u.current?.value??e;if(k.endsWith("pi"))t(k.slice(0,-2)+"π"),c(null);else if(k.endsWith("sqrt"))t(k.slice(0,-4)+"√");else if(k.endsWith("sin-1")||k.endsWith("sin^-1")){const A=k.endsWith("sin^-1")?6:5;t(k.slice(0,-A)+"sin⁻¹")}else if(k.endsWith("cos-1")||k.endsWith("cos^-1")){const A=k.endsWith("cos^-1")?6:5;t(k.slice(0,-A)+"cos⁻¹")}else if(k.endsWith("tan-1")||k.endsWith("tan^-1")){const A=k.endsWith("tan^-1")?6:5;t(k.slice(0,-A)+"tan⁻¹")}},0)},[e,t,l,h,s]),x=v.useCallback(()=>{if(u.current){const b=u.current.getBoundingClientRect();f({top:Math.max(20,b.bottom-280),left:Math.max(10,b.left-240)})}},[]),p=v.useCallback(()=>{x(),o(!0)},[x]);U.useEffect(()=>{const b=setTimeout(()=>{x(),o(!0)},50);return()=>clearTimeout(b)},[x]),U.useEffect(()=>{if(i)return window.addEventListener("resize",x),window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("resize",x),window.removeEventListener("scroll",x,!0)}},[i,x]);const j=v.useCallback(()=>{},[]),S=B$(e),y=S!==e&&e.length>0,N="bg-slate-100 hover:bg-slate-200 text-[#0a1628] text-sm px-2 py-1 rounded-lg transition-colors";return a.jsxs("div",{className:"relative",children:[i&&a.jsxs("div",{className:"fixed z-[60] bg-white border border-slate-200 rounded-xl shadow-xl px-3 py-3 flex flex-col gap-3 w-[220px] pointer-events-auto",style:{top:d.top,left:d.left},onMouseDown:b=>b.preventDefault(),children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Powers"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("button",{type:"button",className:N,title:"Square",onClick:()=>h("²"),children:"x²"}),a.jsx("button",{type:"button",className:N,title:"Cube",onClick:()=>h("³"),children:"x³"}),a.jsx("button",{type:"button",className:N,title:"Power",onClick:()=>h("^"),children:"xⁿ"}),a.jsx("button",{type:"button",className:N,title:"Inverse",onClick:()=>h("⁻¹"),children:"x⁻¹"}),a.jsx("button",{type:"button",className:N,title:"Square root",onClick:()=>h("√("),children:"√"}),a.jsx("button",{type:"button",className:N,title:"Cube root",onClick:()=>h("∛("),children:"∛"})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Inverse Trig"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("button",{type:"button",className:N,title:"Inverse sine",onClick:()=>h("sin⁻¹("),children:"sin⁻¹"}),a.jsx("button",{type:"button",className:N,title:"Inverse cosine",onClick:()=>h("cos⁻¹("),children:"cos⁻¹"}),a.jsx("button",{type:"button",className:N,title:"Inverse tangent",onClick:()=>h("tan⁻¹("),children:"tan⁻¹"})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Symbols"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("button",{type:"button",className:N,title:"Pi",onClick:()=>h("π"),children:"π"}),a.jsx("button",{type:"button",className:N,title:"Euler's number",onClick:()=>h("e"),children:"e"}),a.jsx("button",{type:"button",className:N,title:"Infinity",onClick:()=>h("∞"),children:"∞"}),a.jsx("button",{type:"button",className:N,title:"Plus-minus",onClick:()=>h("±"),children:"±"}),a.jsx("button",{type:"button",className:N,title:"Approximately",onClick:()=>h("≈"),children:"≈"}),a.jsx("button",{type:"button",className:N,title:"Degree",onClick:()=>h("°"),children:"°"})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Other"}),a.jsxs("div",{className:"flex gap-1 items-center",children:[a.jsx("button",{type:"button",className:N,title:"Fraction",onClick:()=>h("(/)"),children:"a/b"}),a.jsx("div",{className:"ml-auto",children:a.jsxs("button",{type:"button",className:"bg-sky-600 hover:bg-rose-500 text-white text-xs px-3 py-1 rounded-lg flex items-center gap-1",onClick:()=>r?.(),children:[a.jsx(Un,{size:12}),"Use Calc"]})})]})]})]}),a.jsx("input",{ref:u,id:"math-answer-input",name:"math-answer-input","aria-label":"Math answer input",type:"text",value:e,onChange:b=>t(b.target.value),onKeyDown:g,onFocus:p,onBlur:j,placeholder:n||"Type your answer... use ^ for powers e.g. x^2 for x²",className:"w-full bg-white border border-slate-200 focus:border-sky-500 rounded-xl px-4 py-3 text-[#0a1628] font-mono text-base outline-none transition-colors"}),y&&a.jsx("div",{className:"text-rose-300 text-sm font-mono mt-1",dangerouslySetInnerHTML:{__html:S}})]})},ZC={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:a.jsx(ot,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:a.jsx(De,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:a.jsx(ot,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:a.jsx(lr,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:a.jsx(ot,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:a.jsx(lr,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:a.jsx(ot,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:a.jsx(lr,{size:14})}]};function tc(e){const t=e.toLowerCase();return t==="functions"||t.includes("function")||t==="businessmath"||t.includes("business")||t==="logic"||t.includes("reason")||t.includes("general")||t.includes("gen-math")||t.includes("gen math")?"General Mathematics":t.includes("stat")||t.includes("prob")?"Statistics and Probability":t.includes("pre-calc")||t.includes("pre calc")||t.includes("precalc")?"Pre-Calculus":t.includes("basic")||t.includes("calc")?"Basic Calculus":null}function q$(e){const t=e.trim().toLowerCase();return t==="functions"?"Functions and Graphs":t==="businessmath"?"Business and Financial Mathematics":t==="logic"?"Logic and Reasoning":e}const V$=({atRiskSubjects:e=[],onAction:t,onDismiss:n})=>{const[r,s]=v.useState(!1);if(r||e.length===0)return null;const i=()=>{s(!0),n?.()};return a.jsx(Ke,{children:!r&&a.jsx(J.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:a.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:[a.jsx("button",{onClick:i,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:a.jsx(Xe,{size:14})}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:a.jsx(ra,{size:24})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),a.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."}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:e.map(o=>a.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:[a.jsx(Gt,{size:12}),q$(o)]},o))}),a.jsxs("button",{onClick:t,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",a.jsx(jn,{size:16})]})]})]})]})})})},U$=({quizSubject:e,atRiskSubjects:t=[]})=>{const n=e?tc(e):null;if(!t.some(i=>{const o=tc(i);return o&&o===n})||!n)return null;const s=ZC[n]||[];return a.jsx(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:a.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx(Gt,{size:14,className:"text-rose-600"}),a.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area — ",n]})]}),a.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."}),s.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.slice(0,2).map((i,o)=>a.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:[i.icon,i.label]},o))})]})})},G$=({quizSubject:e,quizScore:t=0,atRiskSubjects:n=[],onAction:r})=>{const s=e?tc(e):null,i=n.some(c=>{const d=tc(c);return d&&d===s});if(t>=70&&!i)return null;const o=s?ZC[s]||[]:[],l=t<70;return a.jsx(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:a.jsx("div",{className:`rounded-2xl p-4 border-2 ${l?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${l?"bg-orange-500":"bg-sky-500"}`,children:a.jsx(De,{size:20,className:"text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:l?"Review Recommended":"Supplemental Materials"}),a.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:l?`You scored ${t}% 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."}),o.length>0&&a.jsx("div",{className:"space-y-1.5 mb-3",children:o.map((c,d)=>a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${l?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),a.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),a.jsxs("span",{className:"text-slate-500",children:["— ",c.description]})]},d))}),r&&a.jsxs("button",{onClick:r,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${l?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Open Practice Center",a.jsx(jn,{size:12})]})]})]})})})},yx=e=>{switch(e.variant){case"compact":return a.jsx(U$,{...e});case"results":return a.jsx(G$,{...e});case"full":default:return a.jsx(V$,{...e})}};function W$(e){if(e.questionType==="multiple_choice"&&e.options&&e.options.length>0){const t=e.options.findIndex(n=>n.trim().toLowerCase()===e.correctAnswer.trim().toLowerCase());return{id:e.id,question:e.question,options:e.options,correctAnswer:t>=0?t:0,correctAnswerText:e.correctAnswer,explanation:e.explanation,questionType:e.questionType,points:e.points,difficulty:e.difficulty,topic:e.topic,bloomLevel:e.bloomLevel}}return{id:e.id,question:e.question,options:[],correctAnswer:-1,correctAnswerText:e.correctAnswer,explanation:e.explanation,questionType:e.questionType,points:e.points,difficulty:e.difficulty,topic:e.topic,bloomLevel:e.bloomLevel}}function a1(e){return e.replace(/²/g,"^2").replace(/³/g,"^3").replace(/⁻¹/g,"^-1").replace(/⁰/g,"^0").replace(/¹/g,"^1").replace(/⁴/g,"^4").replace(/⁵/g,"^5").replace(/⁶/g,"^6").replace(/⁷/g,"^7").replace(/⁸/g,"^8").replace(/⁹/g,"^9").replace(/π/g,"pi").replace(/√/g,"sqrt").replace(/×/g,"*").replace(/÷/g,"/").replace(/\s+/g,"").toLowerCase().trim()}function H$(e,t,n){const r=s=>s.trim().toLowerCase().replace(/\s+/g," ");switch(n){case"identification":return r(e)===r(t);case"enumeration":{const s=e.split(",").map(o=>r(o)).filter(Boolean).sort(),i=t.split(",").map(o=>r(o)).filter(Boolean).sort();return JSON.stringify(s)===JSON.stringify(i)}case"word_problem":case"equation_based":{const s=a1(e),i=a1(t);if(s===i)return!0;const o=parseFloat(e.replace(/[^\d.\-]/g,"")),l=parseFloat(t.replace(/[^\d.\-]/g,""));return!isNaN(o)&&!isNaN(l)?Math.abs(o-l)<=.01:r(e)===r(t)}default:return r(e)===r(t)}}function K$(e){switch(e){case"identification":return"Type your answer below";case"enumeration":return"List your answers separated by commas";case"word_problem":return"Show your work and type the final answer";case"equation_based":return"Solve the equation and type the result";default:return"Select the correct answer"}}const X$=({quiz:e,onClose:t,onComplete:n,studentId:r,atRiskSubjects:s=[]})=>{const[i,o]=v.useState(0),[l,c]=v.useState(null),[d,f]=v.useState(""),[u,m]=v.useState(!1),[h,g]=v.useState(!1),[x,p]=v.useState(0),[j,S]=v.useState(0),[y,N]=v.useState(1),[b,w]=v.useState([]),[k,A]=v.useState([]),[C,F]=v.useState(Date.now()),[D,L]=v.useState(!1),[P,H]=v.useState(0),[Y,V]=v.useState(0),[O,E]=v.useState(!1),[B]=v.useState(()=>e.loadedQuestions&&e.loadedQuestions.length>0?e.loadedQuestions.map(W$):Array.from({length:e.questions},($,_)=>({id:`q${_+1}`,question:Y$(e.subject,_),options:Q$(e.subject,_),correctAnswer:Z$(e.subject,_),explanation:J$(e.subject,_,e.difficulty)}))),T=B[i];v.useEffect(()=>{const $=parseInt(e.duration);H($*60);const _=setInterval(()=>{H(Q=>Q<=1?(clearInterval(_),K(),0):Q-1)},1e3);return()=>clearInterval(_)},[]);const M=$=>{const _=new(window.AudioContext||window.webkitAudioContext),Q=_.createOscillator(),R=_.createGain();switch(Q.connect(R),R.connect(_.destination),$){case"correct":Q.frequency.value=800,R.gain.setValueAtTime(.3,_.currentTime),R.gain.exponentialRampToValueAtTime(.01,_.currentTime+.3),Q.start(_.currentTime),Q.stop(_.currentTime+.3);break;case"incorrect":Q.frequency.value=200,R.gain.setValueAtTime(.3,_.currentTime),R.gain.exponentialRampToValueAtTime(.01,_.currentTime+.2),Q.start(_.currentTime),Q.stop(_.currentTime+.2);break;case"combo":Q.frequency.value=1200,R.gain.setValueAtTime(.2,_.currentTime),R.gain.exponentialRampToValueAtTime(.01,_.currentTime+.4),Q.start(_.currentTime),Q.stop(_.currentTime+.4);break;case"complete":Q.frequency.value=600,R.gain.setValueAtTime(.3,_.currentTime),R.gain.exponentialRampToValueAtTime(.01,_.currentTime+.5),Q.start(_.currentTime),Q.stop(_.currentTime+.5);break}},K=()=>{L(!0),ne()},X=$=>{h||c($)},I=()=>{const $=T.questionType!=null&&T.questionType!=="multiple_choice";if($){if(!d.trim())return}else if(l===null)return;const _=$?H$(d,T.correctAnswerText||"",T.questionType||""):l===T.correctAnswer,Q=[...b];Q[i]=$?_?1:0:l,w(Q),m(_);const R=Math.round((Date.now()-C)/1e3);if(A(G=>[...G,{questionId:T.id,answer:$?d:String(l),correct:_,timeSpent:R}]),_){M("correct"),p(x+1);const G=j+1;S(G),G>=5?(N(3),M("combo"),Wv({particleCount:50,spread:60,origin:{y:.6}})):G>=3?(N(2),M("combo")):N(1)}else M("incorrect"),S(0),N(1);g(!0)},Z=()=>{i{const $=Math.round(x/B.length*100);let _=e.xpReward;$>=90?_=Math.round(_*1.5):$>=80&&(_=Math.round(_*1.25));const Q=parseInt(e.duration)*60;P>Q*.5&&(_=Math.round(_*1.2)),V(_);const R=Q-P;r&&HC({lrn:r,quizId:e.id,subject:e.subject,score:$,totalQuestions:B.length,correctAnswers:x,timeSpentSeconds:R}).catch(G=>console.error("[WARN] Automation: quiz pipeline failed:",G)),e.source==="ai_generated"&&r&&m$(r,e.id,e.generatedQuizId,e.subject,e.source,$,_,R,k,B.map(G=>({topic:G.topic||e.subject,difficulty:G.difficulty||"medium",bloomLevel:G.bloomLevel||"understand"}))).catch(G=>console.error("[WARN] Quiz result save failed:",G)),M("complete"),Wv({particleCount:100,spread:70,origin:{y:.6}}),setTimeout(()=>{n($,_)},3e3)},ee=$=>{const _=Math.floor($/60),Q=$%60;return`${_}:${Q.toString().padStart(2,"0")}`};if(D){const $=Math.round(x/B.length*100),_=$>=70;return a.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-6",children:a.jsxs(J.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-3xl shadow-2xl max-w-2xl w-full p-8",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx(J.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 ${_?"bg-gradient-to-br from-teal-500 to-emerald-500":"bg-gradient-to-br from-orange-500 to-red-500"}`,children:_?a.jsx(Jt,{size:48,className:"text-white"}):a.jsx(cn,{size:48,className:"text-white"})}),a.jsx("h2",{className:"text-3xl font-bold font-display text-[#0a1628] mb-2",children:_?"Great Job!":"Keep Practicing!"}),a.jsx("p",{className:"text-[#5a6578]",children:e.title})]}),a.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 rounded-2xl p-6 mb-6",children:[a.jsxs("div",{className:"text-center mb-4",children:[a.jsxs("div",{className:"text-6xl font-bold text-sky-600 mb-2",children:[$,"%"]}),a.jsx("p",{className:"text-[#5a6578]",children:"Final Score"})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-white rounded-xl p-4 text-center",children:[a.jsx(Kn,{size:24,className:"mx-auto mb-2 text-teal-600"}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:x}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Correct"})]}),a.jsxs("div",{className:"bg-white rounded-xl p-4 text-center",children:[a.jsx(Av,{size:24,className:"mx-auto mb-2 text-red-500"}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:B.length-x}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Incorrect"})]}),a.jsxs("div",{className:"bg-white rounded-xl p-4 text-center",children:[a.jsx(Jn,{size:24,className:"mx-auto mb-2 text-rose-500"}),a.jsxs("p",{className:"text-2xl font-bold text-[#0a1628]",children:["+",Y]}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"XP Earned"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-6",children:[$>=90&&a.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-3 flex items-center gap-3",children:[a.jsx(aa,{size:20,className:"text-sky-600"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-sm text-[#0a1628]",children:"Perfect Score!"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"+50% Bonus XP"})]})]}),P>parseInt(e.duration)*30&&a.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-3 flex items-center gap-3",children:[a.jsx(On,{size:20,className:"text-sky-600"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-sm text-[#0a1628]",children:"Speed Demon"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"+20% Bonus XP"})]})]}),j>=5&&a.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-xl p-3 flex items-center gap-3",children:[a.jsx(Nn,{size:20,className:"text-orange-600"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-sm text-[#0a1628]",children:"Hot Streak!"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"3x Combo Achieved"})]})]})]}),a.jsx(yx,{variant:"results",quizSubject:e.subject,quizScore:$,atRiskSubjects:s}),a.jsx("button",{onClick:t,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white font-bold py-4 rounded-xl transition-all mt-4",children:"Continue"})]})})}return a.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-6",children:a.jsxs(J.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-3xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[a.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-6 text-white",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:e.title}),a.jsx("p",{className:"text-cyan-100 text-sm",children:e.subject})]}),a.jsx("button",{onClick:t,className:"w-10 h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",children:a.jsx(Xe,{size:20})})]}),a.jsx("div",{className:"flex items-center gap-2 mb-3",children:a.jsxs("button",{onClick:()=>E($=>!$),className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-sm font-semibold transition-all ${O?"bg-sky-400/30 text-white ring-1 ring-sky-300/50":"bg-white/20 hover:bg-white/30 text-cyan-100"}`,title:"Toggle Scientific Calculator",children:[a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),a.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"}),a.jsx("line",{x1:"16",x2:"16",y1:"14",y2:"18"}),a.jsx("path",{d:"M16 10h.01"}),a.jsx("path",{d:"M12 10h.01"}),a.jsx("path",{d:"M8 10h.01"}),a.jsx("path",{d:"M12 14h.01"}),a.jsx("path",{d:"M8 14h.01"}),a.jsx("path",{d:"M12 18h.01"}),a.jsx("path",{d:"M8 18h.01"})]}),"Calc"]})}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsxs("span",{className:"text-sm font-medium",children:["Question ",i+1," of ",B.length]}),a.jsxs("div",{className:"flex items-center gap-4",children:[j>0&&a.jsxs("div",{className:"flex items-center gap-1 bg-orange-500/30 px-3 py-1 rounded-full",children:[a.jsx(Nn,{size:16}),a.jsxs("span",{className:"text-sm font-bold",children:[j," Streak"]}),y>1&&a.jsxs("span",{className:"text-xs ml-1",children:["x",y]})]}),a.jsxs("div",{className:"flex items-center gap-1 bg-white/20 px-3 py-1 rounded-full",children:[a.jsx(On,{size:16}),a.jsx("span",{className:"text-sm font-bold",children:ee(P)})]})]})]}),a.jsx("div",{className:"h-2 bg-white/20 rounded-full overflow-hidden",children:a.jsx(J.div,{initial:{width:0},animate:{width:`${(i+1)/B.length*100}%`},className:"h-full bg-white rounded-full"})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center gap-3",children:a.jsx("div",{className:"bg-white/20 px-3 py-1 rounded-full",children:a.jsxs("span",{className:"text-sm font-bold",children:["Score: ",x,"/",B.length]})})}),a.jsxs("div",{className:"flex items-center gap-2 bg-rose-500/30 px-3 py-1 rounded-full",children:[a.jsx(Jt,{size:16}),a.jsxs("span",{className:"text-sm font-bold",children:["+",e.xpReward," XP"]})]})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-8 relative",children:[a.jsx(Ke,{children:O&&a.jsx(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-6 overflow-hidden",children:a.jsxs("div",{className:"bg-[#edf1f7] rounded-2xl p-4 border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] flex items-center gap-1.5",children:[a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),a.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"})]}),"Scientific Calculator"]}),a.jsx("button",{onClick:()=>E(!1),className:"text-slate-500 hover:text-[#5a6578] transition-colors",children:a.jsx(Xe,{size:14})})]}),a.jsx(C0,{isOpen:!0,onClose:()=>E(!1),inline:!0})]})})}),i===0&&a.jsx(yx,{variant:"compact",quizSubject:e.subject,atRiskSubjects:s}),a.jsx(Ke,{mode:"wait",children:a.jsxs(J.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-xl font-bold text-[#0a1628] mb-2",children:T.question}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:K$(T.questionType)})]}),T.questionType&&T.questionType!=="multiple_choice"?a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute left-3 top-3.5",children:a.jsx(Zi,{size:16,className:"text-slate-500"})}),T.questionType==="enumeration"?a.jsx("textarea",{value:d,onChange:$=>f($.target.value),disabled:h,placeholder:"Type each answer separated by commas…",rows:4,className:`w-full pl-10 pr-4 py-3 rounded-xl border-2 text-sm outline-none transition-all resize-none ${h?u?"bg-teal-50 border-teal-400":"bg-red-50 border-red-400":"border-[#dde3eb] focus:border-sky-500 bg-white"}`}):T.questionType==="equation_based"||T.questionType==="word_problem"?a.jsx(QC,{value:d,onChange:f,placeholder:T.questionType==="equation_based"?"Enter the numerical result…":"Enter your answer…",onCalculatorOpen:()=>E(!0)}):a.jsx("input",{type:"text",value:d,onChange:$=>f($.target.value),disabled:h,onKeyDown:$=>{$.key==="Enter"&&!h&&I()},placeholder:"Type your answer…",className:`w-full pl-10 pr-4 py-3.5 rounded-xl border-2 text-sm outline-none transition-all ${h?u?"bg-teal-50 border-teal-400":"bg-red-50 border-red-400":"border-[#dde3eb] focus:border-sky-500 bg-white"}`})]}),h&&!u&&a.jsxs("p",{className:"mt-2 text-sm font-semibold text-teal-700",children:["Correct answer: ",T.correctAnswerText]})]}):a.jsx("div",{className:"space-y-3 mb-6",children:T.options.map(($,_)=>{const Q=l===_,R=_===T.correctAnswer,G=h;let ae="bg-[#edf1f7] hover:bg-[#dde3eb] border-[#dde3eb]";return G?R?ae="bg-teal-50 border-teal-500":Q&&!R&&(ae="bg-red-50 border-red-500"):Q&&(ae="bg-sky-50 border-sky-500"),a.jsx(J.button,{whileHover:h?{}:{scale:1.01},whileTap:h?{}:{scale:.99},onClick:()=>X(_),disabled:h,className:`w-full text-left p-4 rounded-xl border-2 transition-all ${ae} ${h?"cursor-default":"cursor-pointer"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center font-bold ${G&&R?"bg-teal-500 text-white":G&&Q&&!R?"bg-red-500 text-white":Q?"bg-sky-500 text-white":"bg-white text-[#0a1628]"}`,children:String.fromCharCode(65+_)}),a.jsx("span",{className:"font-medium text-[#0a1628]",children:$}),G&&R&&a.jsx(Kn,{size:20,className:"ml-auto text-teal-600"}),G&&Q&&!R&&a.jsx(Av,{size:20,className:"ml-auto text-red-600"})]})},_)})}),h&&a.jsx(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`p-4 rounded-xl border-2 ${u?"bg-teal-50 border-teal-200":"bg-sky-50 border-sky-200"}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 ${u?"bg-teal-500":"bg-sky-500"}`,children:a.jsx(yt,{size:18,className:"text-white"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-bold text-[#0a1628] mb-1",children:u?"Correct!":"Not quite"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:T.explanation})]})]})})]},i)})]}),a.jsx("div",{className:"p-6 bg-[#edf1f7] border-t border-[#dde3eb]",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"text-sm text-[#5a6578]",children:h?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(ot,{size:16}),"Keep going! You're doing great"]}):a.jsx("span",{children:"Select an answer to continue"})}),h?a.jsxs("button",{onClick:Z,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white font-bold px-8 py-3 rounded-xl flex items-center gap-2 transition-all",children:[i -3"],["9","5","7","3"],["1","2","3","1/3"],["12","27","64","81"]],"General Mathematics":[["2x² - 5x - 12","2x² + 5x - 12","2x² - 8x + 12","2x² - 5x + 12"],["36","32","28","24"],["x = 5","x = 4","x = 6","x = 7"],["120","24","60","720"],["3/4","1/2","2/3","4/5"],["90","80","100","72"],["2/3","3/4","4/6","6/9"],["12","6","8","4"],["0.375","0.38","0.35","0.325"],["$32","$28","$30","$36"],["11/12","3/7","5/6","2/3"],["$12","$10","$15","$8"],["3/4","2/3","4/5","9/12"],["1/8","1/4","1/5","1/6"],["150","135","120","160"]],"Statistics and Probability":[["1/6","1/3","1/2","2/3"],["9.4","8.5","10.2","7.8"],["8","9","7","10"],["5/8","3/8","1/2","2/5"],["20","15","25","30"],["5","3","7","8"],["Spread of data from the mean","The highest value","The average","The middle value"],["0.15","0.8","0.35","0.2"],["8.5","7","10","9"],["6","3","9","12"]],"Basic Calculus":[["6x","3x","9x²","6x²"],["4","2","0","undefined"],["x² + C","2x² + C","x²/2 + C","2x + C"],["15x² - 2","15x² - 2x","5x² - 2","15x - 2"],["cos(x)","-cos(x)","tan(x)","-sin(x)"],["eˣ + 3","eˣ + 3x","xeˣ + 3","eˣ"],["sin(x) + C","-sin(x) + C","tan(x) + C","-cos(x) + C"],["1/x","x","ln(x)","-1/x²"],["0","1","∞","undefined"],["4x³ - 4x","4x³ - 2x","x³ - 4x","4x⁴ - 4x²"]]},r=fd(e),s=n[r]||n["General Mathematics"];return s[t%s.length]}function Z$(e,t){const n={"Pre-Calculus":[0,1,0,0,1,0,0,0,2,3],"General Mathematics":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Statistics and Probability":[0,0,0,0,0,0,0,0,0,0],"Basic Calculus":[0,0,0,0,0,0,0,0,0,0]},r=fd(e),s=n[r]||n["General Mathematics"];return s[t%s.length]}function J$(e,t,n){const r={"Pre-Calculus":["The expression under the square root must be non-negative: x - 2 ≥ 0, so x ≥ 2.","Since 2⁴ = 16, we get x = 4.","The period of sin(kx) is 2π/k. Here k = 2, so period = 2π/2 = π.","To find the inverse: y = 3x + 5 → x = 3y + 5 → y = (x - 5)/3.","Since 2⁵ = 32, log₂(32) = 5.","(x² - 9)/(x - 3) = (x+3)(x-3)/(x-3) = x + 3 (for x ≠ 3).","The absolute value |x| ≥ 0 for all x, so |x| - 3 ≥ -3. The range is y ≥ -3.","g(2) = 4, then f(4) = 2(4) + 1 = 9.","The amplitude of y = Acos(x) is |A|. Here A = 3, so amplitude = 3.","log₃(x) = 4 means 3⁴ = x, so x = 81."],"General Mathematics":["(2x + 3)(x - 4) = 2x² - 8x + 3x - 12 = 2x² - 5x - 12","15% of 240 = 0.15 × 240 = 36","3x + 7 = 22 → 3x = 15 → x = 5","5! = 5 × 4 × 3 × 2 × 1 = 120","0.75 = 75/100 = 3/4 after simplifying by dividing both by 25","25% of 360 = 0.25 × 360 = 90","12/18 = (12÷6)/(18÷6) = 2/3","Factors of 24: {1,2,3,4,6,8,12,24}. Factors of 36: {1,2,3,4,6,9,12,18,36}. GCD = 12","3 ÷ 8 = 0.375","20% off $40 = $40 × 0.80 = $32","2/3 + 1/4 = 8/12 + 3/12 = 11/12","15% of $80 = 0.15 × 80 = $12","45/60 = (45÷15)/(60÷15) = 3/4","0.125 = 125/1000 = 1/8","30% × N = 45 → N = 45/0.30 = 150"],"Statistics and Probability":["A fair die has 6 outcomes, each equally likely. P(6) = 1/6.","Mean = (4 + 7 + 9 + 12 + 15) / 5 = 47/5 = 9.4","Sorted: 2, 5, 8, 11, 14. The middle value is 8.","P(red) = 5/(5+3) = 5/8","Range = max - min = 30 - 10 = 20","The value 5 appears 3 times, more than any other value. Mode = 5.","Standard deviation measures how spread out data points are from the mean.","For independent events: P(A and B) = P(A) × P(B) = 0.3 × 0.5 = 0.15","For even-count dataset {4,7,10,13}: median = (7+10)/2 = 8.5","3 books can be arranged in 3! = 3 × 2 × 1 = 6 ways."],"Basic Calculus":["Using the power rule: d/dx[3x²] = 3 × 2x = 6x","Factor: (x²-4)/(x-2) = (x+2)(x-2)/(x-2) = x+2. As x→2: 2+2 = 4","∫ 2x dx = 2 × x²/2 + C = x² + C","f'(x) = 5 × 3x² - 2 = 15x² - 2","The derivative of sin(x) is cos(x). This is a fundamental trigonometric derivative.","d/dx[eˣ + 3x] = eˣ + 3. The derivative of eˣ is eˣ and of 3x is 3.","∫ cos(x) dx = sin(x) + C. Integration is the reverse of differentiation.","The derivative of ln(x) is 1/x. This is a fundamental logarithmic derivative.","As x → ∞, 1/x approaches 0. The function gets infinitely close to zero.","f'(x) = 4x³ - 4x using the power rule on each term."]},s=fd(e),i=r[s]||r["General Mathematics"];return i[t%i.length]}const ez=({onEarnXP:e,atRiskSubjects:t=[],priorityTopics:n=[],initialModuleId:r=null})=>{const{userProfile:s}=$t(),[i,o]=v.useState("modules"),l=s?.grade,c=ld(l),d=ia.filter(w=>c.includes(w.id)),f=r&&d.flatMap(w=>w.modules).find(w=>w.id===r)||null,[u,m]=v.useState(f),[h,g]=v.useState(null),[x,p]=v.useState("");v.useEffect(()=>{if(r){const w=d.flatMap(k=>k.modules).find(k=>k.id===r);w&&m(w)}},[r]);const j=d.find(w=>w.id==="gen-math")??d[0]??null,S=v.useMemo(()=>{const w=n.length>0?n:t.map(A=>qC(A)).filter(A=>A!==null),k=new Set;return w.filter(A=>k.has(A)?!1:(k.add(A),!0))},[n,t]),y=v.useMemo(()=>{const w=j?.modules??[];if(S.length===0)return w;const k=new Map(S.map((A,C)=>[BC[A],C]));return[...w].sort((A,C)=>{const F=k.get(A.id)??Number.POSITIVE_INFINITY,D=k.get(C.id)??Number.POSITIVE_INFINITY;return F-D})},[j?.modules,S]),N=v.useMemo(()=>{const w=x.trim().toLowerCase();return w?y.filter(k=>{const A=k.title.toLowerCase().includes(w),C=k.description.toLowerCase().includes(w),F=k.lessons.some(L=>L.title.toLowerCase().includes(w)),D=k.quizzes.some(L=>L.title.toLowerCase().includes(w));return A||C||F||D}):y},[y,x]),b=(w,k)=>{e&&e(k,`Quiz Completed! +${k} XP`),g(null)};return h?a.jsx(X$,{quiz:h,onClose:()=>g(null),onComplete:b,studentId:s?.uid}):u?a.jsx(JL,{module:u,onBack:()=>m(null),onEarnXP:e}):a.jsxs("div",{className:"h-full flex flex-col px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[a.jsxs("div",{className:"mb-8",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center mb-8 gap-6",children:[a.jsxs("div",{className:"flex-1 max-w-3xl",children:[a.jsx("h1",{className:"text-[36px] md:text-[44px] font-display font-black text-[#202124] tracking-tight leading-[1.1] mb-4",children:"Explore Modules"}),a.jsxs("p",{className:"text-[#3c4043] text-[16px] md:text-[17px] leading-[1.7] md:pr-10",children:["Welcome to your personalized learning hub for ",a.jsx("span",{className:"font-bold text-indigo-700",children:"General Mathematics"}),". These modules are organized directly under the subject so you can jump straight into lessons and assessments without extra steps. MathPulse AI adapts challenge level and quiz support as you progress, helping you master each module with focus and momentum."]})]}),a.jsx("div",{className:"hidden md:flex flex-shrink-0 items-center justify-end w-[350px]",children:a.jsxs("svg",{viewBox:"0 0 300 180",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-auto drop-shadow-sm",children:[a.jsx("circle",{cx:"210",cy:"90",r:"45",fill:"#202124"}),a.jsx("path",{d:"M165 90 C165 65.1472 185.147 45 210 45 C234.853 45 255 65.1472 255 90 C255 114.853 234.853 135 210 135 C185.147 135 165 114.853 165 90 Z",fill:"#202124"}),a.jsx("path",{d:"M150 140 C140 120 160 80 200 70 C240 60 260 80 270 120 C275 140 260 180 210 180 C160 180 155 160 150 140 Z",fill:"#202124"}),a.jsx("path",{d:"M210 125 C195 125 185 110 185 95 C185 80 200 72 215 72 C230 72 245 80 245 95 C245 115 225 125 210 125 Z",fill:"#e8eaed"}),a.jsx("circle",{cx:"202",cy:"92",r:"2",fill:"#202124"}),a.jsx("circle",{cx:"225",cy:"92",r:"2",fill:"#202124"}),a.jsx("path",{d:"M210 105 Q 215 110 220 105",stroke:"#202124",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"}),a.jsx("path",{d:"M198 86 Q 202 84 206 86",stroke:"#202124",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"}),a.jsx("path",{d:"M220 86 Q 225 84 230 86",stroke:"#202124",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"}),a.jsx("circle",{cx:"180",cy:"100",r:"6",stroke:"#202124",strokeWidth:"2",fill:"none"}),a.jsx("circle",{cx:"248",cy:"100",r:"6",stroke:"#202124",strokeWidth:"2",fill:"none"}),a.jsx("path",{d:"M175 180 L 180 135 C185 125 235 125 240 135 L 245 180 Z",fill:"#f8f9fa"}),a.jsx("path",{d:"M175 180 L 180 135 C185 125 235 125 240 135 L 245 180 Z",stroke:"#202124",strokeWidth:"2",fill:"none"}),a.jsx("path",{d:"M170 178 L 220 178 L 230 130 L 180 130 Z",fill:"white",stroke:"#202124",strokeWidth:"2",strokeLinejoin:"round"}),a.jsx("path",{d:"M160 178 L 250 178",stroke:"#202124",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("path",{d:"M195 130 C195 130 190 155 180 170",stroke:"#202124",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),a.jsx("circle",{cx:"120",cy:"50",r:"14",fill:"white",stroke:"#202124",strokeWidth:"1.5"}),a.jsx("path",{d:"M112 50 L 128 50 M 120 42 L 120 58 M 115 45 L 125 55 M 115 55 L 125 45",stroke:"#202124",strokeWidth:"1"}),a.jsx("rect",{x:"135",cy:"55",width:"16",height:"12",rx:"2",fill:"white",stroke:"#202124",strokeWidth:"1.5",y:"45"}),a.jsx("path",{d:"M140 50 h6 M140 53 h4",stroke:"#202124",strokeWidth:"1",strokeLinecap:"round"}),a.jsx("circle",{cx:"50",cy:"110",r:"4",fill:"#202124"}),a.jsx("circle",{cx:"80",cy:"70",r:"3",fill:"#1FA7E1"}),a.jsx("circle",{cx:"30",cy:"80",r:"3",fill:"#1FA7E1"}),a.jsx("circle",{cx:"85",cy:"140",r:"3",fill:"#1FA7E1"}),a.jsx("circle",{cx:"100",cy:"100",r:"3",fill:"#1FA7E1"}),a.jsx("circle",{cx:"20",cy:"130",r:"3",fill:"#1FA7E1"}),a.jsx("path",{d:"M50 110 L80 70 M50 110 L30 80 M50 110 L85 140 M50 110 L100 100 M50 110 L20 130",stroke:"#1FA7E1",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.6"}),a.jsx("path",{d:"M100 35 L 105 25 L 110 35 L 100 35 Z",fill:"white",stroke:"#202124",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M40 40 L 45 40 L 42.5 35 Z",fill:"#202124"})]})})]}),a.jsxs("div",{className:"relative mb-6",children:[a.jsx("div",{className:"absolute left-6 top-1/2 -translate-y-1/2 text-[#5f6368]",children:a.jsx(_n,{size:22,strokeWidth:2.5})}),a.jsx("input",{id:"modules-search",name:"modules-search","aria-label":"Search modules",type:"text",value:x,onChange:w=>p(w.target.value),placeholder:"Search modules, lessons, or assessments...",className:"w-full pl-16 pr-6 py-4 rounded-full border border-[#dadce0] bg-white text-[#202124] text-[15px] font-medium focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all shadow-sm"})]}),a.jsx("div",{className:"flex items-center bg-slate-100/80 p-1.5 rounded-full border border-slate-200/60 shadow-inner gap-1 w-max overflow-x-auto max-w-full no-scrollbar",children:[{id:"modules",label:"Modules",icon:De,color:"text-[#1FA7E1]"},{id:"recommended",label:"Recommended",icon:ot,color:"text-[#75D06A]"},{id:"practice",label:"Practice",icon:cn,color:"text-[#FFB356]"}].map(w=>{const k=i===w.id;return a.jsxs("button",{onClick:()=>o(w.id),className:`relative flex items-center gap-2.5 px-6 py-3 rounded-full text-[15px] font-bold transition-all duration-300 flex-shrink-0 ${k?"shadow-sm":"text-slate-500 hover:text-slate-700 hover:bg-slate-200/50"}`,children:[k&&a.jsx(J.div,{layoutId:"modulesTabBackground",className:"absolute inset-0 bg-white rounded-full shadow-[0_2px_15px_-3px_rgba(0,0,0,0.1)] border border-slate-100",transition:{type:"spring",bounce:.2,duration:.6}}),a.jsxs("span",{className:`relative z-10 flex items-center gap-2 ${k?w.color:""}`,children:[a.jsx(w.icon,{size:18,strokeWidth:k?2.5:2}),w.label]})]},w.id)})}),S.length>0&&a.jsxs("div",{className:"mt-6 rounded-2xl border border-amber-300 bg-amber-50 px-5 py-4 shadow-sm",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"inline-flex items-center gap-2 text-sm font-black text-amber-900",children:[a.jsx(Gt,{size:15}),"Assessment Focus Areas"]}),a.jsx("p",{className:"mt-1 text-sm text-amber-900/80",children:"Modules are currently prioritized by your latest diagnostic needs."})]}),a.jsxs("button",{type:"button",onClick:()=>o("recommended"),className:"inline-flex items-center gap-1.5 rounded-xl bg-amber-600 px-3 py-2 text-xs font-bold text-white transition-colors hover:bg-amber-700",children:["View Recommended",a.jsx(Ba,{size:14})]})]}),a.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:S.map((w,k)=>a.jsxs("span",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-amber-900 shadow-sm",children:[k+1,". ",LL[w]]},w))})]})]}),a.jsx(Ke,{mode:"wait",children:a.jsx(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},className:"flex-1 overflow-y-auto",children:i==="practice"?a.jsx(e$,{onStartQuiz:g,searchQuery:x,allowedSubjectIds:c}):i==="modules"?a.jsx(tz,{modules:N,onSelectModule:m,isAtRisk:S.length>0}):a.jsx(nz,{modules:N,fullPool:y,onSelectModule:m,isAtRisk:S.length>0})},i)})]})},tz=({modules:e,onSelectModule:t,isAtRisk:n=!1})=>a.jsx("div",{className:"h-full overflow-y-auto pr-2 pb-8 scrollbar-hide space-y-8",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:a.jsx(fC,{size:20,strokeWidth:2.5})}),a.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"General Mathematics Modules"})]}),e.length===0?a.jsxs("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center",children:[a.jsx("p",{className:"text-slate-700 font-semibold",children:"No matching modules found."}),a.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"If modules are not yet available for your selected view, this area will unlock after assessment sync and content rollout."})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:e.map((r,s)=>a.jsx(Zl,{module:r,index:s,onClick:()=>t(r),isAtRisk:n},r.id))})]})}),nz=({modules:e,fullPool:t,onSelectModule:n,isAtRisk:r=!1})=>{const s=e.filter(o=>o.progress>0&&o.progress<100),i=(e.length>0?e:t).filter(o=>o.progress===0).slice(0,6);return a.jsxs("div",{className:"h-full overflow-y-auto pr-2 pb-8 space-y-10 scrollbar-hide",children:[s.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-[#FF8B8B]/10 flex items-center justify-center text-[20px] shadow-inner",children:"🔥"}),a.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Continue This Module"})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:s.slice(0,4).map((o,l)=>a.jsx(Zl,{module:o,index:l,onClick:()=>n(o),isAtRisk:r,badgeLabel:"In Progress"},o.id))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-[#75D06A]/10 flex items-center justify-center text-[20px] shadow-inner",children:a.jsx(ra,{size:19,className:"text-[#75D06A]"})}),a.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Suggested Next"})]}),i.length===0?a.jsx("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center text-slate-500 font-medium",children:"You are all caught up. Practice more quizzes to unlock additional recommendations."}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:i.map((o,l)=>a.jsx(Zl,{module:o,index:l,onClick:()=>n(o),isAtRisk:r,badgeLabel:"Start"},o.id))})]})]})},rz=/(```[\s\S]*?```|`[^`\n]+`)/g,az=/(\$\$[\s\S]*?\$\$|\$[^$\n]+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\])/g,sz=/\\(?:boxed\{[^{}]+\}|frac\{[^{}]+\}\{[^{}]+\}|sqrt\{[^{}]+\}|(?:cdot|times|pm|mp|leq|geq|neq|approx|alpha|beta|gamma|delta|theta|pi|sum|int)(?:_[a-zA-Z0-9]+|_\{[^{}]+\})?(?:\^[a-zA-Z0-9]+|\^\{[^{}]+\})?)/g,iz=/<\s*think\b[^>]*>[\s\S]*?<\s*\/\s*think\s*>/gi,oz=/<\s*\/?\s*think\b[^>]*>/gi,lz=/<\s*\/\s*think\s*>/gi,cz=/<\s*(\/?)\s*think\b([\s\S]*?)>/gi,dz=/(?:<\s*\/?\s*t(?:h(?:i(?:n(?:k)?)?)?)?)\s*$/i,uz=/(?:<\s*\/?\s*t(?:h(?:i(?:n(?:k)?)?)?)?)\s*$/i,fz=/\bfinal\s+answer\s*:|(?:^|\n)\s*#{1,6}\s+\S|(?:^|\n)\s*(?:answer|solution)\s*:|(?:^|\n)\s*here(?:'s| is)\b|(?:^|\n)\s*(?:\d+[.)]|[-*])\s+\S/i,mz=/^\s*(?:okay|alright|let\s+me|i\s+should|i\s+need\s+to|i\s+will|wait|hmm|maybe|the\s+user\s+asked|let\s+us|let's)\b/i;function JC(e){return e.replace(cz,(t,n,r)=>`<${n?"/":""}think${r}>`)}function hz(e,t){t.lastIndex=0;let n=-1,r=t.exec(e);for(;r;)n=r.index+r[0].length,r=t.exec(e);return n}function pz(e){const t=JC(e);if(/<\s*think\b/i.test(t))return"";const n=hz(t,lz);return n===-1?"":t.slice(n).trim()}function xz(e){const t=e.replace(/\r\n?/g,` +`).trim();if(!t)return"";const n=fz.exec(t);return n&&typeof n.index=="number"?t.slice(n.index).trim():t.split(` +`).map(i=>i.trim()).filter(i=>i&&mz.test(i)).length>=2?"":t}function vx(e,t={}){if(!e||typeof e!="string")return"";let n=JC(e),r="";for(;n!==r;)r=n,n=n.replace(iz,"");if(!t.preserveUnclosedThinkBlocks){const s=n.toLowerCase(),i=s.lastIndexOf("");i!==-1&&i>o&&(n=n.slice(0,i))}return n=n.replace(oz,""),t.streamingSafeTail&&(n=n.replace(dz,"").replace(uz,"")),n}function gz(e){return vx(e,{streamingSafeTail:!0}).trim()}function Tn(e){const t=pz(e);if(t)return t;const n=vx(e,{streamingSafeTail:!0}).trim();if(n)return n;const r=vx(e,{streamingSafeTail:!0,preserveUnclosedThinkBlocks:!0}).trim();return xz(r)}function bz(e){return e.replace(sz,t=>`$${t}$`)}function eT(e){return!e||typeof e!="string"?"":Tn(e).replace(/\r\n?/g,` +`).split(rz).map((s,i)=>i%2===1?s:s.replace(/\\\\(?=(?:boxed|frac|sqrt|cdot|times|pm|mp|leq|geq|neq|approx|alpha|beta|gamma|delta|theta|pi|sum|int)\b|[()[\]{}])/g,"\\").replace(/\\n/g,` +`).split(az).map((c,d)=>d%2===1?c:bz(c)).join("")).join("")}const yz=80;function ku(e,t=yz){if(!e||typeof e!="string")return"";const n=eT(e).replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/```(?:[a-zA-Z0-9_-]+\n)?([\s\S]*?)```/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\$\$([\s\S]+?)\$\$/g,"$1").replace(/\$([^$\n]+)\$/g,"$1").replace(/\\\(([\s\S]+?)\\\)/g,"$1").replace(/\\\[([\s\S]+?)\\\]/g,"$1").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm,"").replace(/^\s{0,3}(?:[-*_]\s?){3,}$/gm," ").replace(/\\boxed\{([^{}]+)\}/g,"$1").replace(/\\frac\{([^{}]+)\}\{([^{}]+)\}/g,"$1/$2").replace(/\\sqrt\{([^{}]+)\}/g,"sqrt($1)").replace(/\\(?:cdot|times)/g,"*").replace(/\\(alpha|beta|gamma|delta|theta|pi|sum|int|pm|mp|leq|geq|neq|approx)\b/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1").replace(/~~([^~]+)~~/g,"$1").replace(/\*{2,}|_{2,}|~{2,}/g,"").replace(/`+/g,"").replace(/\|/g," ").replace(/\s+/g," ").trim();return n.length<=t?n:n.slice(0,t)}const vz=/^\s*(?:hi|hello|hey|good\s+(?:morning|afternoon|evening))\b/i,wz=/\b(?:thanks|thank\s+you|thank\s+u|ty)\b/i,tT=["Hi! I am MathPulse, your math tutor. I can help with algebra, geometry, calculus, and more. What math question would you like to try?","Hello! Great to see you. I am here for math topics and step-by-step solutions whenever you are ready."],nT=["You are very welcome. If you want, send another math question and we can work through it together.","Glad I could help. I am here anytime you want to practice more math."],s1=["That topic is outside my math scope, but I would be happy to help with mathematics like algebra, calculus, geometry, trigonometry, or statistics.","I focus on math-only support, so I may not be the best for that request. Share a math question and I will guide you step by step.","I am built for math tutoring, so I can best help with mathematical problems and explanations. If you want, ask me any math question next."],jz=["math","mathematics","algebra","geometry","trigonometry","calculus","statistics","probability","arithmetic","equation","inequality","function","graph","slope","derivative","integral","limit","matrix","determinant","fraction","percentage","ratio","polynomial","quadratic","logarithm","exponent","angle","triangle","circle","perimeter","area","volume","mean","median","mode","standard deviation","solve","simplify","factor","evaluate","compute","calculate"],Nz=[/\d+\s*[%+\-*/^=]\s*[-+]?\d*/,/\b(?:sin|cos|tan|cot|sec|csc|log|ln|sqrt)\s*\(?/,/\b(?:differentiate|integrate|derive|proof|prove)\b/,/\b(?:x|y|z)\s*[=+\-*/^]\s*[-+]?\d/],Sz=new Set(["go","continue","yes","ok","next","more"]),kz=[/\bshall\s+we\s+continue\b/i,/\b(?:would|do)\s+you\s+like\s+to\s+continue\b/i,/\b(?:want|need)\s+me\s+to\s+continue\b/i,/\bshould\s+(?:i|we)\s+continue\b/i,/\bcontinue\s*\?\s*$/i,/\b(?:ready\s+for|go\s+to)\s+the\s+next\s+step\b/i,/\bnext\s+step(?:s)?\s*\?\s*$/i,/\bkeep\s+going\s*\?\s*$/i],i1="I can continue once I know which math problem you mean. Please share the problem again or tell me which step to continue.";function ml(e){return e.length===0?"":e[Math.floor(Math.random()*e.length)]??e[0]}function Az(e){const t=(e??"").trim().toLowerCase();return t?jz.some(n=>t.includes(n))?!0:Nz.some(n=>n.test(t)):!1}function Cz(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").replace(/[\p{P}]+$/gu,"")}function rT(e){const t=Cz(e);return t?Sz.has(t):!1}function o1(e){const t=(e??"").trim();return t?Az(t)?null:vz.test(t)?ml(tT):wz.test(t)?ml(nT):ml(s1):ml(s1)}function Tz(e){const t=(e?.latestAssistantMessage??"").trim();if(t)return t;const n=e?.history??[];for(let r=n.length-1;r>=0;r-=1){const s=n[r],i=(s?.role??"").toLowerCase(),o=(s?.content??"").trim();if(o&&(i==="assistant"||i==="ai"))return o}return null}function Pz(e){const t=Tz(e);return t?kz.some(n=>n.test(t)):!1}function Mz(e){const t=e?.history??[];for(let n=t.length-1;n>=0;n-=1){const r=t[n],s=(r?.role??"").toLowerCase(),i=(r?.content??"").trim();if(i&&s==="user"&&!rT(i))return i}return null}function Ez(e){return tT.includes(e)||nT.includes(e)}function aT(e,t){const n=o1(e);if(n===null)return null;if(!rT(e))return n;if(Pz(t))return null;const r=Mz(t);if(!r)return i1;const s=o1(r);return s===null?null:Ez(s)?i1:s}const sT=v.createContext(void 0);let Au=null,Cu=null;const l1=()=>(Au||(Au=Lr(()=>Promise.resolve().then(()=>A0),void 0)),Au),ba=()=>(Cu||(Cu=Lr(()=>import("./chatService-BXbCYY4-.js"),__vite__mapDeps([10,4,3,1,2,5,6,7,8,9]))),Cu),_z=new Set(["go","continue","next","more","yes","ok"]),Iz=[/\b(?:end|finish|stop)\s+with(?:\s+the\s+(?:exact\s+)?(?:marker|text))?\s*[:\-]?\s*(["'`]?)([A-Za-z0-9_:\-]{2,96})\1/i,/\b(?:include|append)\s+(?:the\s+)?marker\s*[:\-]?\s*(["'`]?)([A-Za-z0-9_:\-]{2,96})\1/i];function Uo(e){if(!e)return null;let t=e.trim();return!t||(t.length>=2&&t[0]===t[t.length-1]&&['"',"'","`"].includes(t[0])&&(t=t.slice(1,-1).trim()),t=t.replace(/[.,;\s]+$/g,""),!t)?null:t.slice(0,120)}function Oz(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").replace(/[\p{P}]+$/gu,"")}function iT(e){const t=Oz(e);return t?_z.has(t):!1}function Dz(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.role!=="user")continue;const r=(n.content??"").trim();if(r&&!iT(r))return r}return null}function Rz(e){return["Continue the ongoing math explanation for the same user request.","Do not refuse or reset the topic if the request is mathematical.","Original user request:",e].join(` +`)}function Lz(e){const t=(e??"").trim();if(!t)return null;for(const n of Iz){const r=n.exec(t);if(!r)continue;const s=Uo(r[2]);if(s)return s}return null}function $z(e,t){const n=Uo(t);return n?e.toLowerCase().includes(n.toLowerCase()):!1}function wx(e,t,n,r){return n&&!$z(t,n)?!0:r?Fz(e,t):!1}function zz(e){const t=e.trim();if(!t||[/```[^`]*$/,/\$\$[^$]*$/,/\$[^$\n]*$/,/\\\[[^\]]*$/,/\\\([^\)]*$/,/\\boxed\{[^}]*$/,/\\frac\{[^}]*\}\{?$/,/\\[a-zA-Z]+\s*$/,/(?:Step\s*\d+[:.]?)\s*$/i,/(?:Final\s*Answer[:.]?)\s*$/i].some(m=>m.test(t))||(t.match(/```/g)??[]).length%2!==0||(()=>{let m=0;for(let h=0;h=0&&t[x]==="\\";x-=1)g+=1;g%2===0&&(m+=1)}return m})()%2!==0)return!0;const i=(t.match(/\\left\b/g)??[]).length,o=(t.match(/\\right\b/g)??[]).length;if(i!==o)return!0;const l=[["(",")"],["[","]"],["{","}"]];for(const[m,h]of l){const g=(t.match(new RegExp(`\\${m}`,"g"))??[]).length,x=(t.match(new RegExp(`\\${h}`,"g"))??[]).length;if(g>x)return!0}if(t.length>=80&&/\b(?:and|or|but|because|since|so|then|which|that|where|when|with|for|to|from|of|in|on|at|by)\s*$/i.test(t))return!0;const c=t.split(/\r?\n/).map(m=>m.trim()).filter(Boolean),d=c.length>0?c[c.length-1]:t,f=/[.!?)]$/.test(d),u=/(?:=|\\boxed|\\int|d\/dx|f\(x\)|x\^\d+|\b\d+(?:\.\d+)?\b)\s*$/.test(d);return t.length>=140&&!f&&!u}function Fz(e,t){const n=t.trim(),r=e.toLowerCase();if(!n||zz(n))return!0;const s=n.replace(/[#*_`>|\-]/g," ").replace(/\s+/g," ").trim();if(!s||s.length<24&&/(derivative|integral|equation|complete|explain|step)/.test(r))return!0;if(r.includes("derivative")&&r.includes("integral")){const i=n.toLowerCase(),o=/derivative|f'|d\/dx/.test(i),l=/integral|∫|\\int/.test(i);if(!o||!l)return!0}return!!((r.includes("complete equation")||r.includes("complete equations")||r.includes("step-by-step")||r.includes("step by step"))&&((n.match(/=|\\frac|\\int|∫|\\boxed|d\/dx|\b(dx|x\^\d+)\b/g)??[]).length<2||n.length<120))}function is(e){const t=e.split(/\n{2,}/).map(s=>s.trim()).filter(Boolean);if(t.length<=1)return e.trim();const n=new Set,r=[];for(const s of t){const i=s.toLowerCase().replace(/[#*_`]/g,"").replace(/\s+/g," ").trim();!i||n.has(i)||(n.add(i),r.push(s))}return r.join(` + +`).trim()}function hl(e,t){const n=e.trim(),r=t.trim();if(!n)return is(r);if(!r)return is(n);const s=Math.min(n.length,r.length,220);for(let i=s;i>=24;i-=1){const o=n.slice(-i),l=r.slice(0,i);if(o===l)return is(`${n}${r.slice(i)}`.trim())}return n.endsWith(r)?is(n):r.startsWith(n)?is(r):is(`${n} + +${r}`.trim())}function c1(e,t,n){const r=["Continue the same solution from exactly where it stopped.","Do not restart. Do not repeat completed parts. Keep the same formatting style.","Finish all remaining steps and provide a complete final answer.","",`Question: ${e}`,"","Current partial answer:",t],s=Uo(n);return s&&(r.push(""),r.push(`Include the exact marker "${s}" at the very end when done.`)),r.join(` +`)}function d1(e,t,n){const r=["Continue and complete the answer in plain text only.","No markdown, no LaTeX, no code fences. Do not restart.","",`Question: ${e}`,"","Current partial answer:",t],s=Uo(n);return s&&(r.push(""),r.push(`End with the exact marker "${s}".`)),r.join(` +`)}function u1(e,t){const n=["Provide a complete final tutoring answer for the student question below.","Do not include meta commentary, internal reasoning, or notes about instructions.","Cover every requested part explicitly and include final results.","",`Question: ${e}`],r=Uo(t);return r&&(n.push(""),n.push(`Include the exact marker "${r}" once all requested parts are complete.`)),n.join(` +`)}function f1(e,t,n,r=null,s=!0){const i=t.trim(),o=n.trim();if(!o)return i;if(!i)return o;const l=wx(e,i,r,s),c=wx(e,o,r,s);return l!==c?c?i:o:o.length>=i.length+80?o:i}function Bz(e){const t=e.toLowerCase();return!["derivative","integral","equation","latex","step-by-step","step by step","formatting","proof","fraction","limit","matrix","sqrt","boxed","^","dx"].some(r=>t.includes(r))}function qz(e){const n=e.toLowerCase().trim();return!n||/^(hi|hello|hey|yo|sup|good morning|good afternoon|good evening)\b/.test(n)||/^(thanks|thank you|thx|ty)\b/.test(n)||/^(bye|goodbye|see you|later)\b/.test(n)||n.includes("fun fact")&&!/(solve|deriv|integr|equation|step|proof|show work|explain)/.test(n)?!1:["derivative","integral","equation","step-by-step","step by step","solve","differentiat","integrat","limit","proof","find","compute","simplify","factor","evaluate","calculate","graph","matrix","probability","statistics","trigonometry","algebra","geometry","calculus","show work","explain","define","describe","how","why","what is"].some(r=>n.includes(r))}function pl(e,t=[]){const n=aT(e,{history:t});if(n)return n;const r=e.toLowerCase().trim();if(/^(hi|hello|hey|good morning|good afternoon|good evening)\b/.test(r))return"Hello! I'm your MathPulse AI tutor. I can help you with algebra, calculus, geometry, statistics, and more. What math topic would you like to explore today?";if(r.includes("thank")||r.includes("thanks"))return"You're welcome! I'm always here to help with math. Feel free to ask about any topic — algebra, calculus, geometry, statistics, or anything else. Keep up the great work!";if(/^(bye|goodbye|see you|later)\b/.test(r))return"Goodbye! Come back anytime you need math help. Happy studying!";const s=r.match(/(?:what(?:'s| is| are)|tell me (?:about|what)|explain|define|describe)\s+(.+)/);if(s){const i=s[1].replace(/[?.!]+$/,"").trim();return/\balgebra\b/.test(i)?`## What is Algebra? + +Algebra is a branch of mathematics that uses **letters and symbols** (like *x*, *y*, *a*, *b*) to represent numbers and quantities in equations and formulas. + +### Key concepts: +- **Variables** — symbols that stand for unknown values +- **Expressions** — combinations of numbers, variables, and operations (e.g., \`3x + 5\`) +- **Equations** — statements that two expressions are equal (e.g., \`2x + 3 = 11\`) +- **Functions** — rules that assign each input exactly one output + +### Why it matters: +Algebra is the foundation for almost all higher mathematics, including calculus, statistics, and physics. It teaches you to think abstractly and solve problems systematically. + +### Quick example: +Solve \`2x + 3 = 11\` +1. Subtract 3 from both sides → \`2x = 8\` +2. Divide by 2 → \`x = 4\` + +Would you like to dive deeper into any specific area of algebra?`:/\bcalculus\b/.test(i)?`## What is Calculus? + +Calculus is the mathematical study of **continuous change**. It has two main branches: + +### 1. Differential Calculus +Studies **rates of change** and slopes of curves. +- *Core tool:* the **derivative** — measures how fast a function changes at any point +- *Example:* If position = t², then velocity = 2t + +### 2. Integral Calculus +Studies **accumulation** of quantities and areas under curves. +- *Core tool:* the **integral** — adds up infinitely many tiny pieces +- *Example:* Area under y = x from 0 to 3 = ∫₀³ x dx = 9/2 = 4.5 + +### Why it matters: +Calculus is used in physics, engineering, economics, biology, and virtually every science. It lets you model anything that changes continuously. + +Want to start with derivatives, integrals, or limits?`:/\bgeometry\b/.test(i)?`## What is Geometry? + +Geometry is the branch of mathematics that studies **shapes, sizes, positions, and properties** of figures and spaces. + +### Key areas: +- **Euclidean Geometry** — points, lines, angles, triangles, circles, polygons +- **Coordinate Geometry** — shapes on the x-y plane using algebra +- **Solid Geometry** — 3D shapes like spheres, cylinders, cones +- **Transformations** — rotations, reflections, translations, dilations + +### Fundamental concepts: +- **Angles** — measured in degrees or radians +- **Congruence & Similarity** — same shape/size vs. same shape/different size +- **Pythagorean Theorem** — a² + b² = c² for right triangles +- **Area & Volume formulas** for common shapes + +What geometry topic would you like to explore?`:/\btrigonometry|trig\b/.test(i)?`## What is Trigonometry? + +Trigonometry is the study of relationships between **angles and sides** of triangles. + +### The core functions (SOH-CAH-TOA): +- **sin(θ)** = Opposite / Hypotenuse +- **cos(θ)** = Adjacent / Hypotenuse +- **tan(θ)** = Opposite / Adjacent + +### Beyond triangles: +Trig functions describe **periodic phenomena** like sound waves, light, tides, and circular motion. + +### Key identities: +- sin²θ + cos²θ = 1 +- tan(θ) = sin(θ)/cos(θ) + +Trigonometry is essential for calculus, physics, and engineering. What trig topic would you like help with?`:/\bstatistic/.test(i)?`## What is Statistics? + +Statistics is the branch of mathematics that deals with **collecting, analyzing, interpreting, and presenting data**. + +### Key areas: +- **Descriptive Statistics** — summarizing data with measures like mean, median, mode, and standard deviation +- **Inferential Statistics** — drawing conclusions about populations from samples +- **Probability** — the mathematics of chance and uncertainty + +### Common measures: +| Measure | Purpose | +|---------|--------| +| Mean | Average of all values | +| Median | Middle value when sorted | +| Mode | Most frequent value | +| Std Dev | How spread out values are | + +Want help with a specific statistics concept?`:/\bderivative/.test(i)?`## What is a Derivative? + +A derivative measures the **instantaneous rate of change** of a function — essentially, how fast something is changing at a specific point. + +### Formal definition: +f'(x) = lim(h→0) [f(x+h) - f(x)] / h + +### Intuition: +- The derivative of **position** is **velocity** +- The derivative of **velocity** is **acceleration** +- Geometrically, it's the **slope of the tangent line** to the curve + +### Key rules: +- **Power Rule:** d/dx[xⁿ] = nxⁿ⁻¹ +- **Product Rule:** d/dx[fg] = f'g + fg' +- **Chain Rule:** d/dx[f(g(x))] = f'(g(x)) · g'(x) + +Would you like to practice finding derivatives?`:/\bintegral|integration/.test(i)?`## What is Integration? + +Integration is the process of finding the **accumulated total** of a quantity. It's the reverse of differentiation. + +### Two types: +1. **Indefinite Integral** — finds a family of antiderivatives: ∫f(x) dx = F(x) + C +2. **Definite Integral** — calculates the area under a curve: ∫ₐᵇ f(x) dx + +### Intuition: +- If a derivative tells you *how fast* something changes, an integral tells you *how much* it accumulates +- Area under a velocity-time graph = total distance traveled + +### Key rule: +**Power Rule:** ∫xⁿ dx = xⁿ⁺¹/(n+1) + C (n ≠ -1) + +Want to try some integration problems?`:/\blimit/.test(i)?`## What is a Limit? + +A limit describes the value a function **approaches** as the input approaches some value. + +### Notation: +lim(x→a) f(x) = L means "as x gets closer and closer to a, f(x) gets closer and closer to L." + +### Why it matters: +Limits are the **foundation of calculus** — both derivatives and integrals are defined using limits. + +### How to evaluate: +1. **Direct substitution** — plug in the value first +2. **Factor & cancel** — if you get 0/0 +3. **L'Hôpital's Rule** — for 0/0 or ∞/∞ forms + +### Example: +lim(x→2) (x²-4)/(x-2) = lim(x→2) (x+2)(x-2)/(x-2) = lim(x→2) (x+2) = **4** + +What limit problem are you working on?`:/\bfraction/.test(i)?`## What is a Fraction? + +A fraction represents a **part of a whole**. It's written as **a/b**, where: +- **a** = numerator (parts you have) +- **b** = denominator (total equal parts) + +### Operations: +- **Addition:** a/b + c/d = (ad + bc) / bd +- **Multiplication:** a/b × c/d = ac / bd +- **Division:** a/b ÷ c/d = a/b × d/c (flip and multiply) + +### Example: +3/4 + 2/3 = 9/12 + 8/12 = **17/12** + +What fraction problem can I help you with?`:/\bpercent/.test(i)?`## What is a Percentage? + +A percentage is a way of expressing a number as a **fraction of 100**. The symbol **%** means "per hundred." + +### Key formulas: +- Percentage = (Part / Whole) × 100 +- Part = (Percentage × Whole) / 100 +- % Change = ((New - Old) / Old) × 100 + +### Examples: +- 25% of 200 = (25 × 200) / 100 = **50** +- 15 is what % of 60? → (15/60) × 100 = **25%** + +Need help with a specific percentage problem?`:/\bpythag/.test(i)?`## What is the Pythagorean Theorem? + +The Pythagorean Theorem states that in a **right triangle**, the square of the hypotenuse equals the sum of the squares of the other two sides: + +### **a² + b² = c²** + +where *c* is the hypotenuse (longest side, opposite the right angle). + +### Example: +If a = 3 and b = 4: +- 3² + 4² = 9 + 16 = 25 +- c = √25 = **5** + +### Common Pythagorean Triples: +- (3, 4, 5) +- (5, 12, 13) +- (8, 15, 17) + +Need help with a specific problem?`:`That's a great question about **${i}**! I'm currently in offline mode with limited responses. Here's what I can help with right now: + +- **Algebra** — equations, variables, functions +- **Calculus** — derivatives, integrals, limits +- **Geometry** — shapes, areas, volumes +- **Trigonometry** — angles, sin/cos/tan +- **Statistics** — data analysis, probability +- **Arithmetic** — fractions, percentages, ratios + +Try asking "What is algebra?" or "How do I solve quadratic equations?" for a detailed explanation. + +*Tip: The AI tutor works best when the server is online for full, personalized answers.*`}if(/\bhow (?:do|can|to|would|should)\b/.test(r)||/\bsolve\b/.test(r)||/\bfind\b/.test(r)||/\bcalculate\b/.test(r)){if(r.includes("quadratic")||r.includes("ax")&&r.includes("bx"))return`## Solving Quadratic Equations + +A quadratic equation has the form **ax² + bx + c = 0**. + +### Method 1: Quadratic Formula +**x = (-b ± √(b² - 4ac)) / 2a** + +### Steps: +1. Identify a, b, and c from your equation +2. Calculate the discriminant: **b² - 4ac** +3. If discriminant > 0 → two real solutions +4. If discriminant = 0 → one real solution +5. If discriminant < 0 → no real solutions + +### Example: x² - 5x + 6 = 0 +- a=1, b=-5, c=6 +- Discriminant = 25 - 24 = 1 +- x = (5 ± 1) / 2 → **x = 3** or **x = 2** + +### Method 2: Factoring +x² - 5x + 6 = (x - 3)(x - 2) = 0 + +Want me to help solve a specific quadratic?`;if(r.includes("derivative")||r.includes("differentiat"))return`## How to Find Derivatives + +The derivative measures the rate of change of a function. + +### Key Rules: +| Rule | Formula | +|------|--------| +| Power | d/dx[xⁿ] = nxⁿ⁻¹ | +| Constant | d/dx[c] = 0 | +| Sum | d/dx[f+g] = f' + g' | +| Product | d/dx[fg] = f'g + fg' | +| Chain | d/dx[f(g(x))] = f'(g(x)) · g'(x) | + +### Common Derivatives: +- d/dx[sin(x)] = cos(x) +- d/dx[cos(x)] = -sin(x) +- d/dx[eˣ] = eˣ +- d/dx[ln(x)] = 1/x + +### Example: f(x) = 3x² + 2x - 5 +f'(x) = 6x + 2 + +What function would you like to differentiate?`;if(r.includes("integral")||r.includes("integrat"))return`## How to Integrate + +Integration is the reverse of differentiation. + +### Key Rules: +- **Power Rule:** ∫xⁿ dx = xⁿ⁺¹/(n+1) + C (n ≠ -1) +- ∫1/x dx = ln|x| + C +- ∫eˣ dx = eˣ + C +- ∫sin(x) dx = -cos(x) + C +- ∫cos(x) dx = sin(x) + C + +### Techniques: +1. **Substitution (u-sub)** — simplify by substituting a part of the expression +2. **Integration by parts** — ∫u dv = uv - ∫v du +3. **Partial fractions** — break rational functions into simpler pieces + +Want help with a specific integral?`;if(r.includes("equation")||r.includes("solve"))return`## How to Solve Equations + +### Linear Equations (ax + b = c): +1. Move constants to one side +2. Divide by the coefficient of x + +**Example:** 3x + 7 = 22 +- 3x = 22 - 7 = 15 +- x = 15/3 = **5** + +### Systems of Equations: +- **Substitution** — solve one equation for a variable, plug into the other +- **Elimination** — add/subtract equations to eliminate a variable +- **Graphing** — find the intersection point + +### Tips: +- Always check your answer by substituting back +- Whatever you do to one side, do to the other + +Share your equation and I'll help solve it step by step!`;if(r.includes("area")||r.includes("perimeter")||r.includes("volume"))return`## Geometry Formulas + +### 2D Shapes: +| Shape | Area | Perimeter | +|-------|------|----------| +| Rectangle | l × w | 2(l + w) | +| Triangle | ½ × b × h | a + b + c | +| Circle | πr² | 2πr | +| Trapezoid | ½(a+b) × h | sum of sides | + +### 3D Shapes: +| Shape | Volume | Surface Area | +|-------|--------|--------------| +| Sphere | (4/3)πr³ | 4πr² | +| Cylinder | πr²h | 2πr² + 2πrh | +| Cone | (1/3)πr²h | πr² + πrl | + +What geometry problem do you need help with?`;if(r.includes("graph")||r.includes("plot")||r.includes("slope"))return`## Graphing & Linear Functions + +### Slope-Intercept Form: y = mx + b +- **m** = slope (rise / run) +- **b** = y-intercept (where the line crosses the y-axis) + +### Finding Slope: +m = (y₂ - y₁) / (x₂ - x₁) + +### Example: +Through (1, 3) and (4, 9): +- m = (9-3)/(4-1) = 6/3 = 2 +- Plug into y = mx + b: 3 = 2(1) + b → b = 1 +- Equation: **y = 2x + 1** + +What would you like to graph or understand?`;if(r.includes("factor"))return`## How to Factor + +### Common Techniques: +1. **GCF (Greatest Common Factor):** Factor out the largest shared factor + - 6x² + 9x = **3x(2x + 3)** + +2. **Difference of Squares:** a² - b² = (a+b)(a-b) + - x² - 25 = **(x+5)(x-5)** + +3. **Trinomial Factoring:** x² + bx + c = (x + p)(x + q) where p·q = c and p+q = b + - x² + 5x + 6 = **(x+2)(x+3)** + +4. **Grouping:** For 4-term polynomials + +What expression would you like to factor?`}return r.includes("pythag")||r.includes("right")&&r.includes("triangle")?`## Pythagorean Theorem + +For a right triangle with legs a and b, and hypotenuse c: + +### **a² + b² = c²** + +**Example:** If a = 3, b = 4: +- 9 + 16 = 25 +- c = √25 = **5** + +### Common Pythagorean Triples: +- (3, 4, 5) +- (5, 12, 13) +- (8, 15, 17) +- (7, 24, 25) + +Need help with a specific problem?`:r.includes("trig")||/\b(sin|cos|tan)\b/.test(r)?`## Trigonometry + +### SOH-CAH-TOA: +- **sin(θ)** = Opposite / Hypotenuse +- **cos(θ)** = Adjacent / Hypotenuse +- **tan(θ)** = Opposite / Adjacent + +### Key Identities: +- sin²θ + cos²θ = 1 +- tan(θ) = sin(θ)/cos(θ) +- sin(2θ) = 2sin(θ)cos(θ) + +### Unit Circle Values: +| Angle | sin | cos | +|-------|-----|-----| +| 0° | 0 | 1 | +| 30° | 1/2 | √3/2 | +| 45° | √2/2 | √2/2 | +| 90° | 1 | 0 | + +What trig topic would you like help with?`:r.includes("statistic")||r.includes("probability")||r.includes("mean")||r.includes("median")?`## Statistics & Probability + +### Measures of Central Tendency: +- **Mean:** Sum of all values ÷ number of values +- **Median:** Middle value when sorted +- **Mode:** Most frequent value + +### Probability Basics: +- P(event) = favorable outcomes / total outcomes +- 0 ≤ P(event) ≤ 1 +- P(A or B) = P(A) + P(B) - P(A and B) + +### Example: +For data {2, 5, 5, 8, 10}: +- Mean = 30/5 = **6** +- Median = **5** +- Mode = **5** + +What statistics concept do you need help with?`:r.includes("percent")||r.includes("%")?`## Percentages + +### Key Formulas: +- Percentage = (Part / Whole) × 100 +- Part = (Percentage × Whole) / 100 +- % Change = ((New - Old) / Old) × 100 + +### Examples: +- 25% of 200 = (25 × 200) / 100 = **50** +- 15 is what % of 60? → (15/60) × 100 = **25%** +- % increase from 80 to 100 = (20/80) × 100 = **25%** + +Need help with a specific percentage problem?`:r.includes("fraction")||r.includes("numerator")||r.includes("denominator")?`## Fractions + +### Operations: +- **Addition:** a/b + c/d = (ad + bc) / bd +- **Subtraction:** a/b - c/d = (ad - bc) / bd +- **Multiplication:** a/b × c/d = ac / bd +- **Division:** a/b ÷ c/d = a/b × d/c + +### Simplifying: +Divide both numerator and denominator by their GCD. + +### Example: +3/4 + 2/3 = 9/12 + 8/12 = **17/12** + +What fraction problem can I help you with?`:r.includes("limit")?`## Limits + +The limit describes what value a function **approaches** as x approaches some value. + +### How to evaluate: +1. **Direct substitution** — try plugging in the value first +2. **Factor & cancel** — if you get 0/0 +3. **L'Hôpital's Rule** — for 0/0 or ∞/∞ forms + +### Example: +lim(x→2) (x²-4)/(x-2) += lim(x→2) (x+2)(x-2)/(x-2) += lim(x→2) (x+2) = **4** + +What limit problem are you working on?`:r.includes("matrix")||r.includes("matrices")?`## Matrices + +A matrix is a rectangular array of numbers arranged in rows and columns. + +### Operations: +- **Addition:** Add corresponding elements (same dimensions required) +- **Scalar multiplication:** Multiply every element by a constant +- **Matrix multiplication:** Rows × Columns (dimensions must be compatible: m×n · n×p = m×p) + +### Determinant (2×2): +For matrix [[a, b], [c, d]]: det = **ad - bc** + +### Example: +| 2 3 | | 1 0 | | 3 3 | +| 4 1 | + | 2 5 | = | 6 6 | + +What matrix operation do you need help with?`:r.includes("logarithm")||r.includes("log")?`## Logarithms + +A logarithm answers: **"What exponent gives me this number?"** + +log_b(x) = y means b^y = x + +### Key Properties: +- log(ab) = log(a) + log(b) +- log(a/b) = log(a) - log(b) +- log(aⁿ) = n · log(a) +- log_b(b) = 1 +- log_b(1) = 0 + +### Common bases: +- **log** = log₁₀ (common log) +- **ln** = logₑ (natural log, e ≈ 2.718) + +### Example: +log₂(8) = 3 because 2³ = 8 + +What logarithm problem are you working on?`:r.includes("exponent")||r.includes("power")?`## Exponents + +An exponent tells you how many times to multiply a base by itself. + +### Key Rules: +- aᵐ · aⁿ = aᵐ⁺ⁿ +- aᵐ / aⁿ = aᵐ⁻ⁿ +- (aᵐ)ⁿ = aᵐⁿ +- a⁰ = 1 (any nonzero number) +- a⁻ⁿ = 1/aⁿ +- a^(1/n) = ⁿ√a + +### Example: +2³ × 2⁴ = 2⁷ = **128** + +What exponent problem can I help with?`:`I'm your **MathPulse AI** math tutor! + +I can help with a wide range of math topics. Try asking: + +- **"What is algebra?"** — get a clear explanation of any topic +- **"How do I solve quadratic equations?"** — step-by-step instructions +- **"Explain the Pythagorean theorem"** — concept breakdowns +- **"What is the derivative of x²?"** — specific problems + +### Topics I cover: +- Algebra, Geometry, Trigonometry +- Calculus (derivatives, integrals, limits) +- Statistics & Probability +- Arithmetic (fractions, percentages) +- Logarithms, Exponents, Matrices + +What would you like to learn about?`}const oT=()=>{const e=v.useContext(sT);if(!e)throw new Error("useChatContext must be used within ChatProvider");return e},Vz=({children:e})=>{const{currentUser:t}=$t(),[n,r]=v.useState([]),[s,i]=v.useState(null),[o,l]=v.useState(!1),[c,d]=v.useState(null),[f,u]=v.useState(!1),m=v.useRef(new Map);v.useEffect(()=>{if(!t){r([]),u(!1);return}(async()=>{try{const b=await ba(),w=await b.getUserChatSessions(t.uid),k=await Promise.all(w.map(async A=>{const F=(await b.getSessionMessages(A.id)).map(D=>({id:D.id,sender:D.role==="user"?"user":"ai",text:D.role==="assistant"?Tn(D.content):D.content,timestamp:D.timestamp instanceof Date?D.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):new Date(D.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}));return{id:A.id,title:A.title,date:A.updatedAt instanceof Date?A.updatedAt.toLocaleDateString():new Date(A.updatedAt).toLocaleDateString(),messageCount:F.length,preview:F.length>0&&ku(F[F.length-1].text)||"No messages yet",topics:[],messages:F,createdAt:A.createdAt instanceof Date?A.createdAt:new Date(A.createdAt),updatedAt:A.updatedAt instanceof Date?A.updatedAt:new Date(A.updatedAt)}}));r(k)}catch(b){console.error("Error loading chat sessions:",b)}finally{u(!0)}})()},[t]);const h=N=>{if(N.length===0)return"New Chat";const b=N.find(A=>A.sender==="user")?.text||"",w=b.toLowerCase();if(w.includes("quadratic")||w.includes("ax² + bx + c"))return"Quadratic Equations Help";if(w.includes("derivative")||w.includes("calculus"))return"Derivatives & Calculus";if(w.includes("pythagor")||w.includes("right triangle"))return"Pythagorean Theorem";if(w.includes("trig")||w.includes("sin")||w.includes("cos"))return"Trigonometry Help";if(w.includes("area")||w.includes("perimeter"))return"Geometry - Area & Perimeter";if(w.includes("algebra")||w.includes("solve")&&w.includes("x"))return"Algebra Problem Solving";if(w.includes("factor"))return"Factoring Practice";if(w.includes("graph")||w.includes("plot"))return"Graphing Functions";if(w.includes("matrix")||w.includes("matrices"))return"Matrix Operations";if(w.includes("integral")||w.includes("integrate"))return"Integration Problems";if(w.includes("limit"))return"Limits in Calculus";if(w.includes("statistic")||w.includes("probability"))return"Statistics & Probability";const k=b.slice(0,40);return k.length{const b=Date.now().toString(),w=new Date,k={id:b,title:N?h([N]):"New Chat",date:"Just now",messageCount:N?1:0,preview:N&&ku(N.text)||"Start a new conversation...",topics:[],messages:N?[N]:[],createdAt:w,updatedAt:w};if(r(A=>[k,...A]),t){const A=N?h([N]):"New Chat",C=ba().then(async F=>{const D=await F.createChatSession(t.uid,A);return N&&await F.addMessageToSession(D.id,N.sender==="user"?"user":"assistant",N.text),D.id}).catch(F=>(console.error("Error creating Firebase session:",F),b));m.current.set(b,C)}return b},[t]),x=v.useCallback((N,b)=>{const w=b.sender==="ai"?{...b,text:Tn(b.text)}:b;r(A=>A.map(C=>{if(C.id===N){const F=[...C.messages,w];return{...C,messages:F,messageCount:F.length,preview:ku(w.text)||C.preview,updatedAt:new Date,title:F.length===2?h(F):C.title}}return C}));const k=async A=>{const C=m.current.get(A);return C?await C:A};k(N).then(async A=>{await(await ba()).addMessageToSession(A,w.sender==="user"?"user":"assistant",w.text)}).catch(A=>console.error("Error persisting message:",A)),r(A=>{const C=A.find(F=>F.id===N);if(C&&C.messages.length===2){const F=h(C.messages);k(N).then(async D=>{await(await ba()).updateSessionTitle(D,F)}).catch(D=>console.error("Error updating title:",D))}return A})},[]),p=v.useCallback(async(N,b)=>{const w=b.trim(),k={id:Date.now().toString(),sender:"user",text:w,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};x(N,k),d(N),l(!0);try{let A=null,C=null;const F=n.find(ee=>ee.id===N),D=(F?.messages||[]).map(ee=>({role:ee.sender==="user"?"user":"assistant",content:ee.text})),L=iT(w)?Dz(D):null,P=L?Rz(L):w,H=L??w,Y=aT(w,{history:D});if(Y){const ee={id:(Date.now()+1).toString(),sender:"ai",text:Y,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};x(N,ee);return}try{const ee=await l1();A=ee.apiService,C=ee.ApiTimeoutError}catch(ee){console.error("Failed to load API service for chat:",ee);const $={id:(Date.now()+1).toString(),sender:"ai",text:pl(H),timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};x(N,$);return}const V=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});let O="",E=null;const B=Bz(w),T=qz(w),M=Lz(w),K=T||!!M,X=M?{expectedEndMarker:M,completionMode:"marker"}:void 0,I=ee=>wx(w,ee,M,T),Z=ee=>{ee.trim()&&r($=>$.map(_=>{if(_.id!==N)return _;if(!E){E=`stream-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;const Q={id:E,sender:"ai",text:ee,timestamp:V},R=[..._.messages,Q];return{..._,messages:R,messageCount:R.length,updatedAt:new Date}}return{..._,messages:_.messages.map(Q=>Q.id===E?{...Q,text:ee}:Q),updatedAt:new Date}}))},ne=()=>{if(!E)return;const ee=E;r($=>$.map(_=>{if(_.id!==N)return _;const Q=_.messages.filter(R=>R.id!==ee);return{..._,messages:Q,messageCount:Q.length,updatedAt:new Date}}))};try{const{response:ee}=await A.chat(P,D,R=>{O+=R,B&&Z(gz(O))},X);let $=Tn(ee||O).trim();if(K&&$&&I($)){try{const R=await A.chatSafe(c1(w,$,M),D,X),G=Tn(R.data.response).trim();$=hl($,G)}catch(R){console.warn("Streaming completion repair failed:",R)}if(K&&$&&I($))try{const R=await A.chatSafe(d1(w,$,M),D,X),G=Tn(R.data.response).trim();$=hl($,G)}catch(R){console.warn("Streaming plain continuation repair failed:",R)}if(K&&$&&I($))try{const R=await A.chatSafe(u1(w,M),D,X),G=Tn(R.data.response).trim();G&&($=f1(w,$,G,M,T))}catch(R){console.warn("Streaming full completion repair failed:",R)}}const _=I($);(!$||_&&!K)&&($=pl(H,D)),E&&ne();const Q={id:(Date.now()+1).toString(),sender:"ai",text:$,timestamp:V};x(N,Q)}catch(ee){C&&ee instanceof C?console.warn(`Streaming timed out after ${ee.timeoutMs}ms, falling back to non-streaming chat.`,ee):console.warn("Streaming failed, falling back to non-streaming chat:",ee),E&&ne();let $="";try{const R=A??(await l1()).apiService,{data:G}=await R.chatSafe(P,D,X);if($=Tn(G.response).trim(),K&&$&&I($))try{const ae=await R.chatSafe(c1(w,$,M),D,X),re=Tn(ae.data.response).trim();$=hl($,re)}catch(ae){console.warn("Non-stream completion repair failed:",ae)}if(K&&$&&I($))try{const ae=await R.chatSafe(d1(w,$,M),D,X),re=Tn(ae.data.response).trim();$=hl($,re)}catch(ae){console.warn("Non-stream plain continuation repair failed:",ae)}if(K&&$&&I($))try{const ae=await R.chatSafe(u1(w,M),D,X),re=Tn(ae.data.response).trim();re&&($=f1(w,$,re,M,T))}catch(ae){console.warn("Non-stream full completion repair failed:",ae)}}catch(R){console.warn("Chat request failed, using local fallback response:",R),$=pl(H,D)}const _=I($);(!$||_&&!K)&&($=pl(H,D));const Q={id:(Date.now()+1).toString(),sender:"ai",text:Tn($),timestamp:V};x(N,Q)}if(F&&F.messages.length===1){const ee=n.find($=>$.id===N);if(ee&&ee.messages.length>1){const $=h(ee.messages),_=m.current.get(N);(_||Promise.resolve(N)).then(async R=>{await(await ba()).updateSessionTitle(R,$)}).catch(R=>console.error("Error updating title:",R))}}}finally{l(!1),d(null)}},[n,x]),j=v.useCallback((N,b)=>{r(A=>A.map(C=>C.id===N?{...C,title:b}:C));const w=m.current.get(N);(w||Promise.resolve(N)).then(async A=>{await(await ba()).updateSessionTitle(A,b)}).catch(A=>console.error("Error updating session title:",A))},[]),S=v.useCallback(N=>{r(k=>k.filter(A=>A.id!==N)),s===N&&i(null);const b=m.current.get(N);(b||Promise.resolve(N)).then(async k=>{await(await ba()).deleteSession(k)}).catch(k=>console.error("Error deleting session:",k)),m.current.delete(N)},[s]),y=v.useCallback(()=>n.find(N=>N.id===s)||null,[n,s]);return a.jsx(sT.Provider,{value:{sessions:n,activeSessionId:s,isLoading:o,loadingSessionId:c,sessionsLoaded:f,setActiveSessionId:i,createNewSession:g,addMessageToSession:x,sendMessage:p,updateSessionTitle:j,deleteSession:S,getActiveSession:y,generateTitleFromMessages:h},children:e})};let Tu=null;const Uz=()=>(Tu||(Tu=Lr(()=>import("./vendor-markdown-CDZ6ydrN.js").then(e=>e.k),__vite__mapDeps([8,1,9]))),Tu),md=({children:e})=>{if(v.useEffect(()=>{Uz()},[]),!e||typeof e!="string")return null;const t=eT(e);return a.jsx("div",{className:"chat-markdown",children:a.jsx(q6,{remarkPlugins:[U6],rehypePlugins:[V6],components:{a:({href:n,children:r})=>a.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:r}),code:n=>{const{inline:r,className:s,children:i,...o}=n;return a.jsx("code",{className:`${r?"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"} ${s||""}`,...o,children:i})},blockquote:({children:n})=>a.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:n}),h1:({children:n})=>a.jsx("h1",{className:"text-2xl font-bold my-2",children:n}),h2:({children:n})=>a.jsx("h2",{className:"text-xl font-bold my-2",children:n}),h3:({children:n})=>a.jsx("h3",{className:"text-lg font-bold my-2",children:n}),h4:({children:n})=>a.jsx("h4",{className:"text-base font-bold my-2",children:n}),h5:({children:n})=>a.jsx("h5",{className:"text-sm font-bold my-2",children:n}),h6:({children:n})=>a.jsx("h6",{className:"text-xs font-bold my-2",children:n}),ul:({children:n})=>a.jsx("ul",{className:"list-disc list-inside my-2",children:n}),ol:({children:n})=>a.jsx("ol",{className:"list-decimal list-inside my-2",children:n}),li:({children:n})=>a.jsx("li",{className:"ml-2",children:n}),hr:()=>a.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:n})=>a.jsx("p",{className:"my-1",children:n})},children:t})})},Gz=Object.freeze(Object.defineProperty({__proto__:null,default:md},Symbol.toStringTag,{value:"Module"})),Wz=()=>{const{sessions:e,activeSessionId:t,isLoading:n,loadingSessionId:r,setActiveSessionId:s,createNewSession:i,sendMessage:o,deleteSession:l,getActiveSession:c}=oT(),[d,f]=v.useState(""),[u,m]=v.useState(""),[h,g]=v.useState(!1),x=v.useRef(null),p=v.useRef(!0),j=v.useRef(!1),S=c(),y=S?.messages||[],N=y.some(P=>P.sender==="ai"&&P.id.startsWith("stream-")),b=n&&t===r&&!N,w=(P="auto")=>{const H=x.current;H&&H.scrollTo({top:H.scrollHeight,behavior:P})},k=()=>{const P=x.current;return P?P.scrollHeight-P.scrollTop-P.clientHeight<=120:!0},A=()=>{p.current=k()};v.useEffect(()=>{Lr(async()=>{const{warmupBackend:P}=await Promise.resolve().then(()=>A0);return{warmupBackend:P}},void 0).then(({warmupBackend:P})=>{P()}).catch(P=>{console.warn("AI chat warmup skipped:",P)})},[]),v.useEffect(()=>{if(!p.current)return;const P=window.requestAnimationFrame(()=>w("auto"));return()=>window.cancelAnimationFrame(P)},[y,b]),v.useEffect(()=>{p.current=!0,w("auto")},[t]);const C=async()=>{if(!(!u.trim()||n||h||j.current)){j.current=!0,g(!0);try{let P=t;P||(P=i(),s(P));const H=u.trim();m(""),await o(P,H)}finally{j.current=!1,g(!1)}}},F=()=>{const P=i();s(P)},D=(P,H)=>{H.stopPropagation(),l(P)},L=e.filter(P=>P.title.toLowerCase().includes(d.toLowerCase())||P.preview.toLowerCase().includes(d.toLowerCase()));return a.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex gap-4 px-4 sm:px-6 xl:px-10 py-6",children:[a.jsxs("div",{className:"w-80 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:[a.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-2xl flex items-center justify-center",children:a.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-10 h-10 object-contain drop-shadow-md"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),a.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),a.jsxs("button",{onClick:F,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-4 py-3 rounded-xl text-sm font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-2",children:[a.jsx(Qr,{size:18}),"New Chat"]}),a.jsxs("div",{className:"relative mt-3",children:[a.jsx(_n,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),a.jsx(ve,{type:"text",placeholder:"Search conversations...",value:d,onChange:P=>f(P.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"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[a.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:a.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[L.length," Conversations"]})}),a.jsx(Ke,{children:L.map(P=>a.jsxs(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>s(P.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${t===P.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[a.jsxs("div",{className:"flex items-start justify-between mb-1",children:[a.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${t===P.id?"text-sky-700":"text-[#0a1628]"}`,children:P.title}),a.jsx("button",{onClick:H=>D(P.id,H),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:a.jsx(sa,{size:12})})]}),a.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:P.preview}),a.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[a.jsx("span",{className:"text-slate-500",children:P.date}),a.jsxs("span",{className:`px-2 py-0.5 rounded-full ${t===P.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[P.messageCount," msgs"]})]})]},P.id))}),L.length===0&&a.jsxs("div",{className:"text-center py-8",children:[a.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"}),a.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),a.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),a.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:t?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"font-bold font-display text-[#0a1628]",children:S?.title}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:S?.date})]}),a.jsx("div",{className:"flex items-center gap-2",children:S?.topics.map((P,H)=>a.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:P},H))})]}),a.jsxs("div",{ref:x,onScroll:A,className:"flex-1 overflow-y-auto overscroll-contain p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[a.jsx(Ke,{children:y.map(P=>a.jsx(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${P.sender==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${P.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[P.sender==="user"?a.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:P.text}):a.jsx(md,{children:P.text}),a.jsx("p",{className:`text-[10px] mt-1.5 ${P.sender==="user"?"text-sky-200":"text-slate-500"}`,children:P.timestamp})]})},P.id))}),b&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),a.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),a.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),a.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:a.jsxs("div",{className:"flex gap-3",children:[a.jsx(ve,{type:"text",value:u,onChange:P=>m(P.target.value),onKeyPress:P=>P.key==="Enter"&&C(),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"}),a.jsx(pe,{onClick:C,disabled:!u.trim()||n||h,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:a.jsx(Aa,{size:18})})]})})]}):a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[a.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:a.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),a.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),a.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),a.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."}),a.jsx("button",{onClick:F,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"}),a.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(P=>a.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[a.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:P}),a.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",P.toLowerCase()]})]},P))})]})})]})},Hz=v.lazy(()=>Lr(()=>Promise.resolve().then(()=>Gz),void 0)),Kz=({constraintsRef:e,onFullScreen:t})=>{const{activeSessionId:n,setActiveSessionId:r,createNewSession:s,getActiveSession:i,sendMessage:o,isLoading:l}=oT(),[c,d]=v.useState(!1),[f,u]=v.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[m,h]=v.useState(""),g=v.useRef(null);v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",f?"1":"0")},[f]),v.useEffect(()=>{c&&Lr(async()=>{const{warmupBackend:w}=await Promise.resolve().then(()=>A0);return{warmupBackend:w}},void 0).then(({warmupBackend:w})=>{w()}).catch(w=>{console.warn("Floating tutor warmup skipped:",w)})},[c]),v.useEffect(()=>{if(c&&!n){const w={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},k=s(w);r(k)}},[c]);const p=i()?.messages||[],j=()=>{g.current?.scrollIntoView({behavior:"smooth"})};v.useEffect(()=>{j()},[p]);const S=async()=>{if(!m.trim()||!n||l)return;const w=m.trim();h(""),await o(n,w)},y=()=>{t()},N=()=>{d(!1),u(!0)},b=()=>{u(!1)};return a.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[a.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 ${c?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{maxHeight:c?"32rem":"0"},children:[a.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:a.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),a.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",a.jsx("br",{}),"Learning Intelligence"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:y,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:a.jsx(kD,{size:16,className:"text-white"})}),a.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:N,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:a.jsx(Qi,{size:16,className:"text-white"})}),a.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>d(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:a.jsx(Xe,{size:16,className:"text-white"})})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[p.map(w=>a.jsx("div",{className:`flex ${w.sender==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${w.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[w.sender==="user"?a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:w.text}):a.jsx(v.Suspense,{fallback:a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:w.text}),children:a.jsx(Hz,{children:w.text})}),a.jsx("p",{className:`text-[10px] mt-1 ${w.sender==="user"?"text-sky-200":"text-slate-500"}`,children:w.timestamp})]})},w.id)),l&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),a.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),a.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),a.jsx("div",{ref:g})]}),a.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{id:"ai-tutor-input",name:"ai-tutor-input","aria-label":"Ask AI tutor a question",type:"text",value:m,onChange:w=>h(w.target.value),onKeyPress:w=>w.key==="Enter"&&S(),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]"}),a.jsx("button",{type:"button","aria-label":"Send message",onClick:S,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:!m.trim()||l,children:a.jsx(Aa,{size:18})})]})})]}),a.jsx("div",{className:"pointer-events-auto relative self-end",children:f?a.jsx(J.button,{type:"button",onClick:b,whileHover:{scale:1.08},whileTap:{scale:.95},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",children:a.jsx(iC,{size:14})}):a.jsxs("div",{className:"relative group",children:[!c&&a.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?",a.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!c&&a.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:N,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:a.jsx(Qi,{size:12})}),a.jsx(J.button,{type:"button",onClick:()=>d(!c),whileHover:{scale:1.1},whileTap:{scale:.9},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":c?"Close AI tutor chat":"Open AI tutor chat",children:c?a.jsx(Xe,{size:28}):a.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})},Xz=({xp:e,message:t,show:n,onComplete:r})=>(v.useEffect(()=>{if(n){const s=setTimeout(()=>{r()},3e3);return()=>clearTimeout(s)}},[n,r]),a.jsx(Ke,{children:n&&a.jsx(J.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",children:a.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:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:a.jsx(aa,{size:20,className:"text-white",fill:"currentColor"})}),a.jsx(J.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},children:a.jsx(ra,{size:16,className:"text-rose-200"})})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold",children:t}),a.jsxs("p",{className:"text-2xl font-black",children:["+",e," XP"]})]})]})})})),Yz=({isOpen:e,onClose:t,userLevel:n,currentXP:r,xpToNextLevel:s,totalXP:i,streak:o})=>{if(!e)return null;const l=[{id:"1",icon:aa,title:"First Steps",description:"Complete your first video lesson",unlocked:!0,color:"text-[#9956DE]",bgColor:"bg-[#FB96BB]/20"},{id:"2",icon:Jt,title:"Quiz Master",description:"Score 100% on any quiz",unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"3",icon:Nn,title:"Week Warrior",description:"Maintain a 7-day login streak",progress:2,total:7,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"4",icon:cn,title:"Practice Makes Perfect",description:"Complete 10 practice sets",progress:2,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"5",icon:De,title:"Knowledge Seeker",description:"Watch 20 video lessons",unlocked:!0,color:"text-[#1FA7E1]",bgColor:"bg-[#6ED1CF]/20"},{id:"6",icon:Jn,title:"Speed Learner",description:"Complete 5 lessons in one day",unlocked:!0,color:"text-[#FFB356]",bgColor:"bg-[#FFB356]/20"},{id:"7",icon:Cr,title:"Crown Achiever",description:"Reach Level 10",progress:4,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"8",icon:yt,title:"XP Hunter",description:"Earn 1000 XP",unlocked:!0,color:"text-[#7274ED]",bgColor:"bg-[#7274ED]/15"},{id:"9",icon:ta,title:"Dedicated Learner",description:"Maintain a 14-day streak",progress:2,total:14,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"10",icon:kt,title:"Monthly Champion",description:"Maintain a 30-day streak",progress:2,total:30,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"}],c=[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily login streak",xp:25}];return a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-8",children:[a.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),a.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[85vh] overflow-hidden",children:[a.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-6 text-white relative overflow-hidden",children:[a.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%)]"}),a.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-display font-bold",children:"Rewards & Achievements"}),a.jsx("p",{className:"text-white/90 text-sm font-body",children:"Track your learning progress and unlock badges"})]}),a.jsx("button",{onClick:t,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:a.jsx(Xe,{size:24})})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3 relative z-10",children:[a.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Cr,{size:18,className:"text-[#FFB356]"}),a.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Level"})]}),a.jsx("p",{className:"text-2xl font-bold",children:n})]}),a.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(aa,{size:18,className:"text-[#6ED1CF]"}),a.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),a.jsx("p",{className:"text-2xl font-bold",children:i.toLocaleString()})]}),a.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Nn,{size:18,className:"text-[#FF8B8B]"}),a.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Day Streak"})]}),a.jsxs("p",{className:"text-2xl font-bold",children:[o," days"]})]})]}),a.jsxs("div",{className:"mt-4 relative z-10",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n]}),a.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n+1]})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"flex justify-between items-center mb-1",children:a.jsxs("span",{className:"text-xs text-white/90",children:[r," / ",s," XP"]})}),a.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:a.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500",style:{width:`${r/s*100}%`}})})]})]})]}),a.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(85vh-280px)]",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:l.map(d=>{const f=d.icon;return a.jsx("div",{className:`${d.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${d.unlocked?"shadow-md":"opacity-60"}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:`w-12 h-12 ${d.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:a.jsx(f,{size:24,className:d.color})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("h4",{className:`text-sm font-bold ${d.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:d.title}),d.unlocked&&a.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),a.jsx("p",{className:`text-xs ${d.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:d.description}),d.progress!==void 0&&d.total!==void 0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),a.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[d.progress," / ",d.total]})]}),a.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all",style:{width:`${d.progress/d.total*100}%`}})})]})]})]})},d.id)})})]}),a.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:a.jsx(ot,{size:16,className:"text-white"})}),a.jsx("h3",{className:"text-base font-display font-bold text-[#0a1628]",children:"How to Earn XP"})]}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:c.map((d,f)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),a.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[d.activity,":"]}),a.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",d.xp," XP"]})]},f))})]})]})]})]})};function Qz(e){if(Array.isArray(e)){if(e.length<5||e.length>6)throw new Error(`Invalid bone format: expected [x,y,w,h,r,c?] but got ${e.length} elements`);return{x:e[0],y:e[1],w:e[2],h:e[3],r:e[4],c:e[5]||void 0}}return e}const m1=new Set(["p","h1","h2","h3","h4","h5","h6","li","td","th"]);function Zz(e,t="component",n){const r=e.getBoundingClientRect(),s=[],i=n?.leafTags?new Set([...m1,...n.leafTags]):m1,o=n?.captureRoundedBorders??!0,l=n?.excludeTags?new Set(n.excludeTags):null,c=n?.excludeSelectors??null;function d(f){const u=getComputedStyle(f);if(u.display==="none"||u.visibility==="hidden"||u.opacity==="0")return;const m=f.tagName.toLowerCase();if(l?.has(m)||c?.some(C=>f.matches(C)))return;const h=[...f.children].filter(C=>{const F=getComputedStyle(C);return F.display!=="none"&&F.visibility!=="hidden"&&F.opacity!=="0"}),g=m==="img"||m==="svg"||m==="video"||m==="canvas",x=m==="input"||m==="button"||m==="textarea"||m==="select",p=h.length===0||g||x||i.has(m),j=u.backgroundColor,S=j!=="rgba(0, 0, 0, 0)"&&j!=="transparent",y=u.backgroundImage!=="none",N=parseFloat(u.borderTopWidth)||0,b=o&&N>0&&u.borderTopColor!=="rgba(0, 0, 0, 0)"&&u.borderTopColor!=="transparent",w=(parseFloat(u.borderTopLeftRadius)||0)>0,k=S||y||b&&w,A=m==="tr"||m==="td"||m==="th"||m==="thead"||m==="tbody"||m==="table";if(p){const C=f.getBoundingClientRect();if(C.width<1||C.height<1)return;const F=g&&C.width>0&&C.height>0&&Math.abs(C.width-C.height)<4,D=A?0:F?"50%":h1(u,f)??8,L=r.width;s.push({x:L>0?+((C.left-r.left)/L*100).toFixed(4):0,y:Math.round(C.top-r.top),w:L>0?+(C.width/L*100).toFixed(4):0,h:Math.round(C.height),r:D});return}if(k){const C=f.getBoundingClientRect();if(C.width>=1&&C.height>=1){const F=A?0:h1(u,f)??8,D=r.width;s.push({x:D>0?+((C.left-r.left)/D*100).toFixed(4):0,y:Math.round(C.top-r.top),w:D>0?+(C.width/D*100).toFixed(4):0,h:Math.round(C.height),r:F,c:!0})}}for(const C of h)d(C)}for(const f of e.children)d(f);return{name:t,viewportWidth:Math.round(r.width),width:Math.round(r.width),height:Math.round(r.height),bones:s}}function h1(e,t){const n=parseFloat(e.borderTopLeftRadius)||0,r=parseFloat(e.borderTopRightRadius)||0,s=parseFloat(e.borderBottomRightRadius)||0,i=parseFloat(e.borderBottomLeftRadius)||0;if(n===0&&r===0&&s===0&&i===0)return;const o=t?(()=>{const d=t.getBoundingClientRect();return d.width>0&&d.height>0&&Math.abs(d.width-d.height)<4})():!1;return e.borderRadius==="50%"?"50%":Math.max(n,r,s,i)>9998?o?"50%":9999:n===r&&r===s&&s===i?n!==8?n:void 0:`${n}px ${r}px ${s}px ${i}px`}const Jz=new Map;function e7(e){return Jz.get(e)}function t7(){typeof window<"u"&&window.__BONEYARD_BUILD&&(window.__BONEYARD_SNAPSHOT=Zz)}function n7(){return typeof window<"u"&&window.__BONEYARD_BUILD===!0}function r7(e,t){if(!("breakpoints"in e))return e;const n=Object.keys(e.breakpoints).map(Number).sort((s,i)=>s-i);if(n.length===0)return null;const r=[...n].reverse().find(s=>t>=s)??n[0];return e.breakpoints[r]??null}const a7=/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+))?\s*\)/;function Pu(e,t){const n=e.match(a7);if(n){const[,r,s,i,o="1"]=n,l=Math.min(1,parseFloat(o)+t*.5);return`rgba(${r},${s},${i},${l.toFixed(3)})`}if(e.startsWith("#")&&e.length>=7){const r=parseInt(e.slice(1,3),16),s=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);if(!isNaN(r)&&!isNaN(s)&&!isNaN(i)){const o=Math.round(r+(255-r)*t),l=Math.round(s+(255-s)*t),c=Math.round(i+(255-i)*t);return`#${o.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}}return e}t7();let os={};function Bl({loading:e,children:t,name:n,initialBones:r,color:s,darkColor:i,animate:o,stagger:l=!1,transition:c=!1,boneClass:d,className:f,fallback:u,fixture:m,snapshotConfig:h}){const g=v.useRef(null),x=v.useRef(Math.random().toString(36).slice(2,8)).current,[p,j]=v.useState(0),[S,y]=v.useState(0),[N,b]=v.useState(!1);v.useEffect(()=>{if(typeof window>"u")return;const Q=()=>{window.matchMedia("(prefers-color-scheme: dark)");const re=document.documentElement.classList.contains("dark")||!!g.current?.closest(".dark");b(re)};Q();const R=window.matchMedia("(prefers-color-scheme: dark)"),G=()=>Q();R.addEventListener("change",G);const ae=new MutationObserver(Q);return ae.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{R.removeEventListener("change",G),ae.disconnect()}},[]);const w=s??os.color??"rgba(0,0,0,0.08)",k=i??os.darkColor??"rgba(255,255,255,0.06)",A=N?k:w,C=o??os.animate??"pulse",F=C===!0?"pulse":C===!1?"solid":C;v.useEffect(()=>{const Q=g.current;if(!Q)return;const R=new ResizeObserver(ae=>{const re=ae[0]?.contentRect;j(Math.round(re?.width??0)),re&&re.height>0&&y(Math.round(re.height))});R.observe(Q);const G=Q.getBoundingClientRect();return j(Math.round(G.width)),G.height>0&&y(Math.round(G.height)),()=>R.disconnect()},[]);const D={};if(n&&(D["data-boneyard"]=n,h&&(D["data-boneyard-config"]=JSON.stringify(h))),n7())return a.jsx("div",{ref:g,className:f,style:{position:"relative"},...D,children:a.jsx("div",{children:m??t})});const[L,P]=v.useState(!1);v.useEffect(()=>{P(!0)},[]);const H=r??(n?e7(n):void 0),Y=L&&typeof window<"u"?window.innerWidth:0,V=p>0?p:Y,O=H&&V>0?r7(H,V):null,E=d??os.boneClass,B=(()=>{const Q=l??os.stagger;return Q===!0?80:Q===!1||!Q?0:Q})(),T=(()=>{const Q=c??os.transition;return Q===!0?300:Q===!1||!Q?0:Q})(),[M,K]=v.useState(!1),X=v.useRef(e),I=v.useRef(null);v.useEffect(()=>(X.current&&!e&&T>0&&O&&(I.current&&clearTimeout(I.current),K(!0),I.current=setTimeout(()=>{K(!1),I.current=null},T)),X.current=e,()=>{I.current&&clearTimeout(I.current)}),[e,T,O]);const Z=(e||M)&&O,ne=e&&!O&&!M,ee=S>0?S:O?.height??0,$=O?.height??0,_=ee>0&&$>0?ee/$:1;return a.jsxs("div",{ref:g,className:f,style:{position:"relative"},...D,children:[a.jsx("div",{"data-boneyard-content":"true",style:Z&&!M?{visibility:"hidden"}:void 0,children:ne?u:t}),Z&&a.jsx("div",{"data-boneyard-overlay":"true",style:{position:"absolute",inset:0,overflow:"hidden",opacity:M?0:1,transition:T>0?`opacity ${T}ms ease-out`:void 0},children:a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[O.bones.map((Q,R)=>{const G=Qz(Q),ae=G.c?Pu(A,N?.03:.45):A,re=Pu(A,N?.04:.3),te={position:"absolute",left:`${G.x}%`,top:G.y*_,width:`${G.w}%`,height:G.h*_,borderRadius:typeof G.r=="string"?G.r:`${G.r}px`,backgroundColor:ae};return F==="pulse"?te.animation=`bp-${x} 1.8s ease-in-out infinite`:F==="shimmer"&&(te.background=`linear-gradient(90deg, ${ae} 30%, ${re} 50%, ${ae} 70%)`,te.backgroundSize="200% 100%",te.animation=`bs-${x} 2.4s linear infinite`),B>0&&(te.opacity=0,te.animation=`${te.animation?te.animation+",":""} by-${x} 0.3s ease-out ${R*B}ms forwards`),a.jsx("div",{"data-boneyard-bone":"true",className:E,style:te},R)}),F==="pulse"&&a.jsx("style",{children:`@keyframes bp-${x}{0%,100%{background-color:${A}}50%{background-color:${Pu(A,N?.04:.3)}}}`}),F==="shimmer"&&a.jsx("style",{children:`@keyframes bs-${x}{0%{background-position:200% 0}100%{background-position:-200% 0}}`}),B>0&&a.jsx("style",{children:`@keyframes by-${x}{from{opacity:0}to{opacity:1}}`})]})})]})}const Ua=({isOpen:e,onClose:t,onConfirm:n,title:r,message:s,confirmText:i="Confirm",cancelText:o="Cancel",type:l="warning",icon:c="warning",zIndexClass:d="z-50"})=>{const f=()=>{switch(c){case"logout":return a.jsx(mC,{size:32});case"delete":return a.jsx(sa,{size:32});case"warning":default:return a.jsx(Gt,{size:32})}},m=(()=>{switch(l){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"}}})(),h=async()=>{try{await n(),t()}catch{}};return a.jsx(Ke,{children:e&&a.jsx(a.Fragment,{children:a.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${d} flex items-center justify-center p-4`,children:a.jsxs(J.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:g=>g.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[a.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:a.jsx(Xe,{size:20})}),a.jsxs("div",{className:"p-8 text-center",children:[a.jsx(J.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${m.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${m.iconColor}`,children:f()}),a.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:r}),a.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:s}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(pe,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:o}),a.jsx(pe,{onClick:h,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${m.buttonBg} ${m.buttonText} transition-colors shadow-lg`,children:i})]})]})]})})})})};var Mu,p1;function hn(){if(p1)return Mu;p1=1;var e=Array.isArray;return Mu=e,Mu}var Eu,x1;function lT(){if(x1)return Eu;x1=1;var e=typeof sl=="object"&&sl&&sl.Object===Object&&sl;return Eu=e,Eu}var _u,g1;function pr(){if(g1)return _u;g1=1;var e=lT(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return _u=n,_u}var Iu,b1;function Go(){if(b1)return Iu;b1=1;var e=pr(),t=e.Symbol;return Iu=t,Iu}var Ou,y1;function s7(){if(y1)return Ou;y1=1;var e=Go(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function i(o){var l=n.call(o,s),c=o[s];try{o[s]=void 0;var d=!0}catch{}var f=r.call(o);return d&&(l?o[s]=c:delete o[s]),f}return Ou=i,Ou}var Du,v1;function i7(){if(v1)return Du;v1=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Du=n,Du}var Ru,w1;function $r(){if(w1)return Ru;w1=1;var e=Go(),t=s7(),n=i7(),r="[object Null]",s="[object Undefined]",i=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?s:r:i&&i in Object(l)?t(l):n(l)}return Ru=o,Ru}var Lu,j1;function zr(){if(j1)return Lu;j1=1;function e(t){return t!=null&&typeof t=="object"}return Lu=e,Lu}var $u,N1;function si(){if(N1)return $u;N1=1;var e=$r(),t=zr(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return $u=r,$u}var zu,S1;function T0(){if(S1)return zu;S1=1;var e=hn(),t=si(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(i,o){if(e(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||o!=null&&i in Object(o)}return zu=s,zu}var Fu,k1;function ua(){if(k1)return Fu;k1=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Fu=e,Fu}var Bu,A1;function P0(){if(A1)return Bu;A1=1;var e=$r(),t=ua(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",i="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==r||c==s||c==n||c==i}return Bu=o,Bu}var qu,C1;function o7(){if(C1)return qu;C1=1;var e=pr(),t=e["__core-js_shared__"];return qu=t,qu}var Vu,T1;function l7(){if(T1)return Vu;T1=1;var e=o7(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Vu=n,Vu}var Uu,P1;function cT(){if(P1)return Uu;P1=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Uu=n,Uu}var Gu,M1;function c7(){if(M1)return Gu;M1=1;var e=P0(),t=l7(),n=ua(),r=cT(),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,d=l.hasOwnProperty,f=RegExp("^"+c.call(d).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function u(m){if(!n(m)||t(m))return!1;var h=e(m)?f:i;return h.test(r(m))}return Gu=u,Gu}var Wu,E1;function d7(){if(E1)return Wu;E1=1;function e(t,n){return t?.[n]}return Wu=e,Wu}var Hu,_1;function Za(){if(_1)return Hu;_1=1;var e=c7(),t=d7();function n(r,s){var i=t(r,s);return e(i)?i:void 0}return Hu=n,Hu}var Ku,I1;function hd(){if(I1)return Ku;I1=1;var e=Za(),t=e(Object,"create");return Ku=t,Ku}var Xu,O1;function u7(){if(O1)return Xu;O1=1;var e=hd();function t(){this.__data__=e?e(null):{},this.size=0}return Xu=t,Xu}var Yu,D1;function f7(){if(D1)return Yu;D1=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Yu=e,Yu}var Qu,R1;function m7(){if(R1)return Qu;R1=1;var e=hd(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(i){var o=this.__data__;if(e){var l=o[i];return l===t?void 0:l}return r.call(o,i)?o[i]:void 0}return Qu=s,Qu}var Zu,L1;function h7(){if(L1)return Zu;L1=1;var e=hd(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var i=this.__data__;return e?i[s]!==void 0:n.call(i,s)}return Zu=r,Zu}var Ju,$1;function p7(){if($1)return Ju;$1=1;var e=hd(),t="__lodash_hash_undefined__";function n(r,s){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&s===void 0?t:s,this}return Ju=n,Ju}var ef,z1;function x7(){if(z1)return ef;z1=1;var e=u7(),t=f7(),n=m7(),r=h7(),s=p7();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l-1}return of=t,of}var lf,W1;function w7(){if(W1)return lf;W1=1;var e=pd();function t(n,r){var s=this.__data__,i=e(s,n);return i<0?(++this.size,s.push([n,r])):s[i][1]=r,this}return lf=t,lf}var cf,H1;function xd(){if(H1)return cf;H1=1;var e=g7(),t=b7(),n=y7(),r=v7(),s=w7();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l0?1:-1},Ca=function(t){return Ga(t)&&t.indexOf("%")===t.length-1},he=function(t){return U7(t)&&!Wo(t)},G7=function(t){return Ue(t)},Et=function(t){return he(t)||Ga(t)},W7=0,yd=function(t){var n=++W7;return"".concat(t||"").concat(n)},Wa=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!he(t)&&!Ga(t))return r;var i;if(Ca(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Wo(i)&&(i=r),s&&i>n&&(i=n),i},Wr=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},H7=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ww={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Tr=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},jw=null,Df=null,R0=function e(t){if(t===jw&&Array.isArray(Df))return Df;var n=[];return v.Children.forEach(t,function(r){Ue(r)||(F7.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Df=n,jw=t,n};function Xn(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return Tr(s)}):r=[Tr(t)],R0(e).forEach(function(s){var i=In(s,"type.displayName")||In(s,"type.name");r.indexOf(i)!==-1&&n.push(s)}),n}function bn(e,t){var n=Xn(e,t);return n&&n[0]}var Nw=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!he(r)||r<=0||!he(s)||s<=0)},tF=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],nF=function(t){return t&&t.type&&Ga(t.type)&&tF.indexOf(t.type)>=0},rF=function(t,n,r,s){var i,o=(i=Of?.[s])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Le(t)&&(s&&o.includes(n)||Y7.includes(n))||r&&D0.includes(n)},Ve=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(v.isValidElement(t)&&(s=t.props),!ii(s))return null;var i={};return Object.keys(s).forEach(function(o){var l;rF((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(i[o]=s[o])}),i},Sx=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Sw(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ax(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,d=oF(e,iF),f=s||{width:n,height:r,x:0,y:0},u=Fe("recharts-surface",i);return U.createElement("svg",kx({},Ve(d,!0,"svg"),{className:u,width:n,height:r,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),U.createElement("title",null,l),U.createElement("desc",null,c),t)}var cF=["children","className"];function Cx(){return Cx=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Rt=U.forwardRef(function(e,t){var n=e.children,r=e.className,s=dF(e,cF),i=Fe("recharts-layer",r);return U.createElement("g",Cx({className:i},Ve(s,!0),{ref:t}),n)}),Pr=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;ii?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(i);++s=i?n:e(n,r,s)}return Lf=t,Lf}var $f,Tw;function pT(){if(Tw)return $f;Tw=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+s+i+"]");function c(d){return l.test(d)}return $f=c,$f}var zf,Pw;function hF(){if(Pw)return zf;Pw=1;function e(t){return t.split("")}return zf=e,zf}var Ff,Mw;function pF(){if(Mw)return Ff;Mw=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",o="["+e+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+l+"|"+c+")",f="[^"+e+"]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d",g=d+"?",x="["+i+"]?",p="(?:"+h+"(?:"+[f,u,m].join("|")+")"+x+g+")*",j=x+g+p,S="(?:"+[f+l+"?",l,u,m,o].join("|")+")",y=RegExp(c+"(?="+c+")|"+S+j,"g");function N(b){return b.match(y)||[]}return Ff=N,Ff}var Bf,Ew;function xF(){if(Ew)return Bf;Ew=1;var e=hF(),t=pT(),n=pF();function r(s){return t(s)?n(s):e(s)}return Bf=r,Bf}var qf,_w;function gF(){if(_w)return qf;_w=1;var e=mF(),t=pT(),n=xF(),r=uT();function s(i){return function(o){o=r(o);var l=t(o)?n(o):void 0,c=l?l[0]:o.charAt(0),d=l?e(l,1).join(""):o.slice(1);return c[i]()+d}}return qf=s,qf}var Vf,Iw;function bF(){if(Iw)return Vf;Iw=1;var e=gF(),t=e("toUpperCase");return Vf=t,Vf}var yF=bF();const vd=st(yF);function tt(e){return function(){return e}}const xT=Math.cos,ac=Math.sin,er=Math.sqrt,sc=Math.PI,wd=2*sc,Tx=Math.PI,Px=2*Tx,wa=1e-6,vF=Px-wa;function gT(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return gT;const n=10**t;return function(r){this._+=r[0];for(let s=1,i=r.length;swa)if(!(Math.abs(u*c-d*f)>wa)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,g=s-l,x=c*c+d*d,p=h*h+g*g,j=Math.sqrt(x),S=Math.sqrt(m),y=i*Math.tan((Tx-Math.acos((x+m-p)/(2*j*S)))/2),N=y/S,b=y/j;Math.abs(N-1)>wa&&this._append`L${t+N*f},${n+N*u}`,this._append`A${i},${i},0,0,${+(u*h>f*g)},${this._x1=t+b*c},${this._y1=n+b*d}`}}arc(t,n,r,s,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),d=t+l,f=n+c,u=1^o,m=o?s-i:i-s;this._x1===null?this._append`M${d},${f}`:(Math.abs(this._x1-d)>wa||Math.abs(this._y1-f)>wa)&&this._append`L${d},${f}`,r&&(m<0&&(m=m%Px+Px),m>vF?this._append`A${r},${r},0,1,${u},${t-l},${n-c}A${r},${r},0,1,${u},${this._x1=d},${this._y1=f}`:m>wa&&this._append`A${r},${r},0,${+(m>=Tx)},${u},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function L0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new jF(t)}function $0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bT(e){this._context=e}bT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function jd(e){return new bT(e)}function yT(e){return e[0]}function vT(e){return e[1]}function wT(e,t){var n=tt(!0),r=null,s=jd,i=null,o=L0(l);e=typeof e=="function"?e:e===void 0?yT:tt(e),t=typeof t=="function"?t:t===void 0?vT:tt(t);function l(c){var d,f=(c=$0(c)).length,u,m=!1,h;for(r==null&&(i=s(h=o())),d=0;d<=f;++d)!(d=h;--g)l.point(y[g],N[g]);l.lineEnd(),l.areaEnd()}j&&(y[m]=+e(p,m,u),N[m]=+t(p,m,u),l.point(r?+r(p,m,u):y[m],n?+n(p,m,u):N[m]))}if(S)return l=null,S+""||null}function f(){return wT().defined(s).curve(o).context(i)}return d.x=function(u){return arguments.length?(e=typeof u=="function"?u:tt(+u),r=null,d):e},d.x0=function(u){return arguments.length?(e=typeof u=="function"?u:tt(+u),d):e},d.x1=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:tt(+u),d):r},d.y=function(u){return arguments.length?(t=typeof u=="function"?u:tt(+u),n=null,d):t},d.y0=function(u){return arguments.length?(t=typeof u=="function"?u:tt(+u),d):t},d.y1=function(u){return arguments.length?(n=u==null?null:typeof u=="function"?u:tt(+u),d):n},d.lineX0=d.lineY0=function(){return f().x(e).y(t)},d.lineY1=function(){return f().x(e).y(n)},d.lineX1=function(){return f().x(r).y(t)},d.defined=function(u){return arguments.length?(s=typeof u=="function"?u:tt(!!u),d):s},d.curve=function(u){return arguments.length?(o=u,i!=null&&(l=o(i)),d):o},d.context=function(u){return arguments.length?(u==null?i=l=null:l=o(i=u),d):i},d}class jT{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function NF(e){return new jT(e,!0)}function SF(e){return new jT(e,!1)}const z0={draw(e,t){const n=er(t/sc);e.moveTo(n,0),e.arc(0,0,n,0,wd)}},kF={draw(e,t){const n=er(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},NT=er(1/3),AF=NT*2,CF={draw(e,t){const n=er(t/AF),r=n*NT;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},TF={draw(e,t){const n=er(t),r=-n/2;e.rect(r,r,n,n)}},PF=.8908130915292852,ST=ac(sc/10)/ac(7*sc/10),MF=ac(wd/10)*ST,EF=-xT(wd/10)*ST,_F={draw(e,t){const n=er(t*PF),r=MF*n,s=EF*n;e.moveTo(0,-n),e.lineTo(r,s);for(let i=1;i<5;++i){const o=wd*i/5,l=xT(o),c=ac(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},Uf=er(3),IF={draw(e,t){const n=-er(t/(Uf*3));e.moveTo(0,n*2),e.lineTo(-Uf*n,-n),e.lineTo(Uf*n,-n),e.closePath()}},kn=-.5,An=er(3)/2,Mx=1/er(12),OF=(Mx/2+1)*3,DF={draw(e,t){const n=er(t/OF),r=n/2,s=n*Mx,i=r,o=n*Mx+n,l=-i,c=o;e.moveTo(r,s),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(kn*r-An*s,An*r+kn*s),e.lineTo(kn*i-An*o,An*i+kn*o),e.lineTo(kn*l-An*c,An*l+kn*c),e.lineTo(kn*r+An*s,kn*s-An*r),e.lineTo(kn*i+An*o,kn*o-An*i),e.lineTo(kn*l+An*c,kn*c-An*l),e.closePath()}};function RF(e,t){let n=null,r=L0(s);e=typeof e=="function"?e:tt(e||z0),t=typeof t=="function"?t:tt(t===void 0?64:+t);function s(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:tt(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:tt(+i),s):t},s.context=function(i){return arguments.length?(n=i??null,s):n},s}function ic(){}function oc(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function kT(e){this._context=e}kT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:oc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:oc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LF(e){return new kT(e)}function AT(e){this._context=e}AT.prototype={areaStart:ic,areaEnd:ic,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:oc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $F(e){return new AT(e)}function CT(e){this._context=e}CT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:oc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zF(e){return new CT(e)}function TT(e){this._context=e}TT.prototype={areaStart:ic,areaEnd:ic,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function FF(e){return new TT(e)}function Ow(e){return e<0?-1:1}function Dw(e,t,n){var r=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(i*s+o*r)/(r+s);return(Ow(i)+Ow(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function Rw(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gf(e,t,n){var r=e._x0,s=e._y0,i=e._x1,o=e._y1,l=(i-r)/3;e._context.bezierCurveTo(r+l,s+l*t,i-l,o-l*n,i,o)}function lc(e){this._context=e}lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Gf(this,this._t0,Rw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Gf(this,Rw(this,n=Dw(this,e,t)),n);break;default:Gf(this,this._t0,n=Dw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function PT(e){this._context=new MT(e)}(PT.prototype=Object.create(lc.prototype)).point=function(e,t){lc.prototype.point.call(this,t,e)};function MT(e){this._context=e}MT.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,s,i){this._context.bezierCurveTo(t,e,r,n,i,s)}};function BF(e){return new lc(e)}function qF(e){return new PT(e)}function ET(e){this._context=e}ET.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Lw(e),s=Lw(t),i=0,o=1;o=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[n-1]=(e[n]+s[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function UF(e){return new Nd(e,.5)}function GF(e){return new Nd(e,0)}function WF(e){return new Nd(e,1)}function Os(e,t){if((o=e.length)>1)for(var n=1,r,s,i=e[t[0]],o,l=i.length;n=0;)n[t]=t;return n}function HF(e,t){return e[t]}function KF(e){const t=[];return t.key=e,t}function XF(){var e=tt([]),t=Ex,n=Os,r=HF;function s(i){var o=Array.from(e.apply(this,arguments),KF),l,c=o.length,d=-1,f;for(const u of i)for(l=0,++d;l0){for(var n,r,s=0,i=e[0].length,o;s0){for(var n=0,r=e[t[0]],s,i=r.length;n0)||!((i=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,i,o;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aB(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var _T={symbolCircle:z0,symbolCross:kF,symbolDiamond:CF,symbolSquare:TF,symbolStar:_F,symbolTriangle:IF,symbolWye:DF},sB=Math.PI/180,iB=function(t){var n="symbol".concat(vd(t));return _T[n]||z0},oB=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*sB;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},lB=function(t,n){_T["symbol".concat(vd(t))]=n},F0=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,i=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=rB(t,JF),d=zw(zw({},c),{},{type:r,size:i,sizeType:l}),f=function(){var p=iB(r),j=RF().type(p).size(oB(i,l,r));return j()},u=d.className,m=d.cx,h=d.cy,g=Ve(d,!0);return m===+m&&h===+h&&i===+i?U.createElement("path",_x({},g,{className:Fe("recharts-symbols",u),transform:"translate(".concat(m,", ").concat(h,")"),d:f()})):null};F0.registerSymbol=lB;function Ds(e){"@babel/helpers - typeof";return Ds=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ds(e)}function Ix(){return Ix=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var S=h.inactive?d:h.color;return U.createElement("li",Ix({className:p,style:u,key:"legend-item-".concat(g)},rc(r.props,h,g)),U.createElement(Ax,{width:o,height:o,viewBox:f,style:m},r.renderIcon(h)),U.createElement("span",{className:"recharts-legend-item-text",style:{color:S}},x?x(j,h,g):j))})}},{key:"render",value:function(){var r=this.props,s=r.payload,i=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return U.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(v.PureComponent);no(B0,"displayName","Legend");no(B0,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Wf,Bw;function bB(){if(Bw)return Wf;Bw=1;var e=xd();function t(){this.__data__=new e,this.size=0}return Wf=t,Wf}var Hf,qw;function yB(){if(qw)return Hf;qw=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Hf=e,Hf}var Kf,Vw;function vB(){if(Vw)return Kf;Vw=1;function e(t){return this.__data__.get(t)}return Kf=e,Kf}var Xf,Uw;function wB(){if(Uw)return Xf;Uw=1;function e(t){return this.__data__.has(t)}return Xf=e,Xf}var Yf,Gw;function jB(){if(Gw)return Yf;Gw=1;var e=xd(),t=E0(),n=_0(),r=200;function s(i,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.lengthh))return!1;var x=u.get(o),p=u.get(l);if(x&&p)return x==l&&p==o;var j=-1,S=!0,y=c&s?new e:void 0;for(u.set(o,l),u.set(l,o);++j-1&&r%1==0&&r-1&&n%1==0&&n<=e}return bm=t,bm}var ym,pj;function DB(){if(pj)return ym;pj=1;var e=$r(),t=G0(),n=zr(),r="[object Arguments]",s="[object Array]",i="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",d="[object Map]",f="[object Number]",u="[object Object]",m="[object RegExp]",h="[object Set]",g="[object String]",x="[object WeakMap]",p="[object ArrayBuffer]",j="[object DataView]",S="[object Float32Array]",y="[object Float64Array]",N="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",k="[object Uint8Array]",A="[object Uint8ClampedArray]",C="[object Uint16Array]",F="[object Uint32Array]",D={};D[S]=D[y]=D[N]=D[b]=D[w]=D[k]=D[A]=D[C]=D[F]=!0,D[r]=D[s]=D[p]=D[i]=D[j]=D[o]=D[l]=D[c]=D[d]=D[f]=D[u]=D[m]=D[h]=D[g]=D[x]=!1;function L(P){return n(P)&&t(P.length)&&!!D[e(P)]}return ym=L,ym}var vm,xj;function qT(){if(xj)return vm;xj=1;function e(t){return function(n){return t(n)}}return vm=e,vm}var Di={exports:{}};Di.exports;var gj;function RB(){return gj||(gj=1,(function(e,t){var n=lT(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===r,o=i&&n.process,l=(function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=l})(Di,Di.exports)),Di.exports}var wm,bj;function VT(){if(bj)return wm;bj=1;var e=DB(),t=qT(),n=RB(),r=n&&n.isTypedArray,s=r?t(r):e;return wm=s,wm}var jm,yj;function LB(){if(yj)return jm;yj=1;var e=_B(),t=V0(),n=hn(),r=BT(),s=U0(),i=VT(),o=Object.prototype,l=o.hasOwnProperty;function c(d,f){var u=n(d),m=!u&&t(d),h=!u&&!m&&r(d),g=!u&&!m&&!h&&i(d),x=u||m||h||g,p=x?e(d.length,String):[],j=p.length;for(var S in d)(f||l.call(d,S))&&!(x&&(S=="length"||h&&(S=="offset"||S=="parent")||g&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||s(S,j)))&&p.push(S);return p}return jm=c,jm}var Nm,vj;function $B(){if(vj)return Nm;vj=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return Nm=t,Nm}var Sm,wj;function UT(){if(wj)return Sm;wj=1;function e(t,n){return function(r){return t(n(r))}}return Sm=e,Sm}var km,jj;function zB(){if(jj)return km;jj=1;var e=UT(),t=e(Object.keys,Object);return km=t,km}var Am,Nj;function FB(){if(Nj)return Am;Nj=1;var e=$B(),t=zB(),n=Object.prototype,r=n.hasOwnProperty;function s(i){if(!e(i))return t(i);var o=[];for(var l in Object(i))r.call(i,l)&&l!="constructor"&&o.push(l);return o}return Am=s,Am}var Cm,Sj;function Ho(){if(Sj)return Cm;Sj=1;var e=P0(),t=G0();function n(r){return r!=null&&t(r.length)&&!e(r)}return Cm=n,Cm}var Tm,kj;function Sd(){if(kj)return Tm;kj=1;var e=LB(),t=FB(),n=Ho();function r(s){return n(s)?e(s):t(s)}return Tm=r,Tm}var Pm,Aj;function BB(){if(Aj)return Pm;Aj=1;var e=TB(),t=EB(),n=Sd();function r(s){return e(s,n,t)}return Pm=r,Pm}var Mm,Cj;function qB(){if(Cj)return Mm;Cj=1;var e=BB(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(i,o,l,c,d,f){var u=l&t,m=e(i),h=m.length,g=e(o),x=g.length;if(h!=x&&!u)return!1;for(var p=h;p--;){var j=m[p];if(!(u?j in o:r.call(o,j)))return!1}var S=f.get(i),y=f.get(o);if(S&&y)return S==o&&y==i;var N=!0;f.set(i,o),f.set(o,i);for(var b=u;++p-1}return nh=t,nh}var rh,e2;function lq(){if(e2)return rh;e2=1;function e(t,n,r){for(var s=-1,i=t==null?0:t.length;++s=o){var j=d?null:s(c);if(j)return i(j);g=!1,m=r,p=new e}else p=d?[]:x;e:for(;++u=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nq(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Sq(e){return e.value}function kq(e,t){if(U.isValidElement(e))return U.cloneElement(e,t);if(typeof e=="function")return U.createElement(e,t);t.ref;var n=jq(t,hq);return U.createElement(B0,n)}var l2=1,As=(function(e){function t(){var n;pq(this,t);for(var r=arguments.length,s=new Array(r),i=0;il2||Math.abs(s.height-this.lastBoundingBox.height)>l2)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?vr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,i=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,d=s.chartWidth,f=s.chartHeight,u,m;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var h=this.getBBoxSnapshot();u={left:((d||0)-h.width)/2}}else u=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();m={top:((f||0)-g.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return vr(vr({},u),m)}},{key:"render",value:function(){var r=this,s=this.props,i=s.content,o=s.width,l=s.height,c=s.wrapperStyle,d=s.payloadUniqBy,f=s.payload,u=vr(vr({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return U.createElement("div",{className:"recharts-legend-wrapper",style:u,ref:function(h){r.wrapperNode=h}},kq(i,vr(vr({},this.props),{},{payload:XT(f,d,Sq)})))}}],[{key:"getWithHeight",value:function(r,s){var i=vr(vr({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&he(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])})(v.PureComponent);kd(As,"displayName","Legend");kd(As,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var lh,c2;function Aq(){if(c2)return lh;c2=1;var e=Go(),t=V0(),n=hn(),r=e?e.isConcatSpreadable:void 0;function s(i){return n(i)||t(i)||!!(r&&i&&i[r])}return lh=s,lh}var ch,d2;function ZT(){if(d2)return ch;d2=1;var e=FT(),t=Aq();function n(r,s,i,o,l){var c=-1,d=r.length;for(i||(i=t),l||(l=[]);++c0&&i(f)?s>1?n(f,s-1,i,o,l):e(l,f):o||(l[l.length]=f)}return l}return ch=n,ch}var dh,u2;function Cq(){if(u2)return dh;u2=1;function e(t){return function(n,r,s){for(var i=-1,o=Object(n),l=s(n),c=l.length;c--;){var d=l[t?c:++i];if(r(o[d],d,o)===!1)break}return n}}return dh=e,dh}var uh,f2;function Tq(){if(f2)return uh;f2=1;var e=Cq(),t=e();return uh=t,uh}var fh,m2;function JT(){if(m2)return fh;m2=1;var e=Tq(),t=Sd();function n(r,s){return r&&e(r,s,t)}return fh=n,fh}var mh,h2;function Pq(){if(h2)return mh;h2=1;var e=Ho();function t(n,r){return function(s,i){if(s==null)return s;if(!e(s))return n(s,i);for(var o=s.length,l=r?o:-1,c=Object(s);(r?l--:++lr||l&&c&&f&&!d&&!u||i&&c&&f||!s&&f||!o)return 1;if(!i&&!l&&!u&&n=d)return f;var u=s[i];return f*(u=="desc"?-1:1)}}return n.index-r.index}return bh=t,bh}var yh,v2;function Iq(){if(v2)return yh;v2=1;var e=I0(),t=O0(),n=fa(),r=eP(),s=Mq(),i=qT(),o=_q(),l=oi(),c=hn();function d(f,u,m){u.length?u=e(u,function(x){return c(x)?function(p){return t(p,x.length===1?x[0]:x)}:x}):u=[l];var h=-1;u=e(u,i(n));var g=r(f,function(x,p,j){var S=e(u,function(y){return y(x)});return{criteria:S,index:++h,value:x}});return s(g,function(x,p){return o(x,p,m)})}return yh=d,yh}var vh,w2;function Oq(){if(w2)return vh;w2=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return vh=e,vh}var wh,j2;function Dq(){if(j2)return wh;j2=1;var e=Oq(),t=Math.max;function n(r,s,i){return s=t(s===void 0?r.length-1:s,0),function(){for(var o=arguments,l=-1,c=t(o.length-s,0),d=Array(c);++l0){if(++i>=e)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}return kh=r,kh}var Ah,C2;function zq(){if(C2)return Ah;C2=1;var e=Lq(),t=$q(),n=t(e);return Ah=n,Ah}var Ch,T2;function Fq(){if(T2)return Ch;T2=1;var e=oi(),t=Dq(),n=zq();function r(s,i){return n(t(s,i,e),s+"")}return Ch=r,Ch}var Th,P2;function Ad(){if(P2)return Th;P2=1;var e=M0(),t=Ho(),n=U0(),r=ua();function s(i,o,l){if(!r(l))return!1;var c=typeof o;return(c=="number"?t(l)&&n(o,l.length):c=="string"&&o in l)?e(l[o],i):!1}return Th=s,Th}var Ph,M2;function Bq(){if(M2)return Ph;M2=1;var e=ZT(),t=Iq(),n=Fq(),r=Ad(),s=n(function(i,o){if(i==null)return[];var l=o.length;return l>1&&r(i,o[0],o[1])?o=[]:l>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return Ph=s,Ph}var qq=Bq();const K0=st(qq);function ro(e){"@babel/helpers - typeof";return ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ro(e)}function Rx(){return Rx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(wi,"-left"),he(n)&&t&&he(t.x)&&n=t.y),"".concat(wi,"-top"),he(r)&&t&&he(t.y)&&rx?Math.max(f,c[r]):Math.max(u,c[r])}function r9(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function a9(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,d,f,u;return o.height>0&&o.width>0&&n?(f=I2({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),u=I2({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),d=r9({translateX:f,translateY:u,useTranslate3d:l})):d=t9,{cssProperties:d,cssClasses:n9({translateX:f,translateY:u,coordinate:n})}}function Ls(e){"@babel/helpers - typeof";return Ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ls(e)}function O2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function D2(e){for(var t=1;tR2||Math.abs(r.height-this.state.lastBoundingBox.height)>R2)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,d=s.children,f=s.coordinate,u=s.hasPayload,m=s.isAnimationActive,h=s.offset,g=s.position,x=s.reverseDirection,p=s.useTranslate3d,j=s.viewBox,S=s.wrapperStyle,y=a9({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:g,reverseDirection:x,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:j}),N=y.cssClasses,b=y.cssProperties,w=D2(D2({transition:m&&i?"transform ".concat(l,"ms ").concat(c):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&u?"visible":"hidden",position:"absolute",top:0,left:0},S);return U.createElement("div",{tabIndex:-1,className:N,style:w,ref:function(A){r.wrapperNode=A}},d)}}])})(v.PureComponent),h9=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ko={isSsr:h9()};function $s(e){"@babel/helpers - typeof";return $s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(e)}function L2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function $2(e){for(var t=1;t0;return U.createElement(m9,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:m,active:i,coordinate:f,hasPayload:w,offset:h,position:p,reverseDirection:j,useTranslate3d:S,viewBox:y,wrapperStyle:N},S9(d,$2($2({},this.props),{},{payload:b})))}}])})(v.PureComponent);X0(Bn,"displayName","Tooltip");X0(Bn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ko.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Eh,z2;function k9(){if(z2)return Eh;z2=1;var e=pr(),t=function(){return e.Date.now()};return Eh=t,Eh}var _h,F2;function A9(){if(F2)return _h;F2=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return _h=t,_h}var Ih,B2;function C9(){if(B2)return Ih;B2=1;var e=A9(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Ih=n,Ih}var Oh,q2;function iP(){if(q2)return Oh;q2=1;var e=C9(),t=ua(),n=si(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var f=typeof d.valueOf=="function"?d.valueOf():d;d=t(f)?f+"":f}if(typeof d!="string")return d===0?d:+d;d=e(d);var u=i.test(d);return u||o.test(d)?l(d.slice(2),u?2:8):s.test(d)?r:+d}return Oh=c,Oh}var Dh,V2;function T9(){if(V2)return Dh;V2=1;var e=ua(),t=k9(),n=iP(),r="Expected a function",s=Math.max,i=Math.min;function o(l,c,d){var f,u,m,h,g,x,p=0,j=!1,S=!1,y=!0;if(typeof l!="function")throw new TypeError(r);c=n(c)||0,e(d)&&(j=!!d.leading,S="maxWait"in d,m=S?s(n(d.maxWait)||0,c):m,y="trailing"in d?!!d.trailing:y);function N(P){var H=f,Y=u;return f=u=void 0,p=P,h=l.apply(Y,H),h}function b(P){return p=P,g=setTimeout(A,c),j?N(P):h}function w(P){var H=P-x,Y=P-p,V=c-H;return S?i(V,m-Y):V}function k(P){var H=P-x,Y=P-p;return x===void 0||H>=c||H<0||S&&Y>=m}function A(){var P=t();if(k(P))return C(P);g=setTimeout(A,w(P))}function C(P){return g=void 0,y&&f?N(P):(f=u=void 0,h)}function F(){g!==void 0&&clearTimeout(g),p=0,f=x=u=g=void 0}function D(){return g===void 0?h:C(t())}function L(){var P=t(),H=k(P);if(f=arguments,u=this,x=P,H){if(g===void 0)return b(x);if(S)return clearTimeout(g),g=setTimeout(A,c),N(x)}return g===void 0&&(g=setTimeout(A,c)),h}return L.cancel=F,L.flush=D,L}return Dh=o,Dh}var Rh,U2;function P9(){if(U2)return Rh;U2=1;var e=T9(),t=ua(),n="Expected a function";function r(s,i,o){var l=!0,c=!0;if(typeof s!="function")throw new TypeError(n);return t(o)&&(l="leading"in o?!!o.leading:l,c="trailing"in o?!!o.trailing:c),e(s,i,{leading:l,maxWait:i,trailing:c})}return Rh=r,Rh}var M9=P9();const oP=st(M9);function so(e){"@babel/helpers - typeof";return so=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},so(e)}function G2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function bl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(P=oP(P,x,{trailing:!0,leading:!1}));var H=new ResizeObserver(P),Y=b.current.getBoundingClientRect(),V=Y.width,O=Y.height;return D(V,O),H.observe(b.current),function(){H.disconnect()}},[D,x]);var L=v.useMemo(function(){var P=C.containerWidth,H=C.containerHeight;if(P<0||H<0)return null;Pr(Ca(o)||Ca(c),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,c),Pr(!n||n>0,"The aspect(%s) must be greater than zero.",n);var Y=Ca(o)?P:o,V=Ca(c)?H:c;n&&n>0&&(Y?V=Y/n:V&&(Y=V*n),m&&V>m&&(V=m)),Pr(Y>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,Y,V,o,c,f,u,n);var O=!Array.isArray(h)&&Tr(h.type).endsWith("Chart");return U.Children.map(h,function(E){return U.isValidElement(E)?v.cloneElement(E,bl({width:Y,height:V},O?{style:bl({height:"100%",width:"100%",maxHeight:V,maxWidth:Y},E.props.style)}:{})):E})},[n,h,c,m,u,f,C,o]);return U.createElement("div",{id:p?"".concat(p):void 0,className:Fe("recharts-responsive-container",j),style:bl(bl({},N),{},{width:o,height:c,minWidth:f,minHeight:u,maxHeight:m}),ref:b},L)}),Y0=function(t){return null};Y0.displayName="Cell";function io(e){"@babel/helpers - typeof";return io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},io(e)}function K2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Fx(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ko.isSsr)return{width:0,height:0};var r=U9(n),s=JSON.stringify({text:t,copyStyle:r});if(cs.widthCache[s])return cs.widthCache[s];try{var i=document.getElementById(X2);i||(i=document.createElement("span"),i.setAttribute("id",X2),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=Fx(Fx({},V9),r);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return cs.widthCache[s]=c,++cs.cacheCount>q9&&(cs.cacheCount=0,cs.widthCache={}),c}catch{return{width:0,height:0}}},G9=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function oo(e){"@babel/helpers - typeof";return oo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oo(e)}function mc(e,t){return X9(e)||K9(e,t)||H9(e,t)||W9()}function W9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H9(e,t){if(e){if(typeof e=="string")return Y2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y2(e,t)}}function Y2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cV(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nN(e,t){return mV(e)||fV(e,t)||uV(e,t)||dV()}function dV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uV(e,t){if(e){if(typeof e=="string")return rN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rN(e,t)}}function rN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return Y.reduce(function(V,O){var E=O.word,B=O.width,T=V[V.length-1];if(T&&(s==null||i||T.width+B+rO.width?V:O})};if(!f)return h;for(var x="…",p=function(Y){var V=u.slice(0,Y),O=uP({breakAll:d,style:c,children:V+x}).wordsWithComputedWidth,E=m(O),B=E.length>o||g(E).width>Number(s);return[B,E]},j=0,S=u.length-1,y=0,N;j<=S&&y<=u.length-1;){var b=Math.floor((j+S)/2),w=b-1,k=p(w),A=nN(k,2),C=A[0],F=A[1],D=p(b),L=nN(D,1),P=L[0];if(!C&&!P&&(j=b+1),C&&P&&(S=b-1),!C&&P){N=F;break}y++}return N||h},aN=function(t){var n=Ue(t)?[]:t.toString().split(dP);return[{words:n}]},pV=function(t){var n=t.width,r=t.scaleToFit,s=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!Ko.isSsr){var c,d,f=uP({breakAll:o,children:s,style:i});if(f){var u=f.wordsWithComputedWidth,m=f.spaceWidth;c=u,d=m}else return aN(s);return hV({breakAll:o,children:s,maxLines:l,style:i},c,d,n,r)}return aN(s)},sN="#808080",hc=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,i=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,d=c===void 0?"0.71em":c,f=t.scaleToFit,u=f===void 0?!1:f,m=t.textAnchor,h=m===void 0?"start":m,g=t.verticalAnchor,x=g===void 0?"end":g,p=t.fill,j=p===void 0?sN:p,S=tN(t,oV),y=v.useMemo(function(){return pV({breakAll:S.breakAll,children:S.children,maxLines:S.maxLines,scaleToFit:u,style:S.style,width:S.width})},[S.breakAll,S.children,S.maxLines,u,S.style,S.width]),N=S.dx,b=S.dy,w=S.angle,k=S.className,A=S.breakAll,C=tN(S,lV);if(!Et(r)||!Et(i))return null;var F=r+(he(N)?N:0),D=i+(he(b)?b:0),L;switch(x){case"start":L=Lh("calc(".concat(d,")"));break;case"middle":L=Lh("calc(".concat((y.length-1)/2," * -").concat(l," + (").concat(d," / 2))"));break;default:L=Lh("calc(".concat(y.length-1," * -").concat(l,")"));break}var P=[];if(u){var H=y[0].width,Y=S.width;P.push("scale(".concat((he(Y)?Y/H:1)/H,")"))}return w&&P.push("rotate(".concat(w,", ").concat(F,", ").concat(D,")")),P.length&&(C.transform=P.join(" ")),U.createElement("text",Bx({},Ve(C,!0),{x:F,y:D,className:Fe("recharts-text",k),textAnchor:h,fill:j.includes("url")?sN:j}),y.map(function(V,O){var E=V.words.join(A?"":" ");return U.createElement("tspan",{x:F,dy:O===0?L:l,key:"".concat(E,"-").concat(O)},E)}))};function Zr(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function xV(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Q0(e){let t,n,r;e.length!==2?(t=Zr,n=(l,c)=>Zr(e(l),c),r=(l,c)=>e(l)-c):(t=e===Zr||e===xV?e:gV,n=e,r=e);function s(l,c,d=0,f=l.length){if(d>>1;n(l[u],c)<0?d=u+1:f=u}while(d>>1;n(l[u],c)<=0?d=u+1:f=u}while(dd&&r(l[u-1],c)>-r(l[u],c)?u-1:u}return{left:s,center:o,right:i}}function gV(){return 0}function fP(e){return e===null?NaN:+e}function*bV(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const yV=Q0(Zr),Xo=yV.right;Q0(fP).center;class iN extends Map{constructor(t,n=jV){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(oN(this,t))}has(t){return super.has(oN(this,t))}set(t,n){return super.set(vV(this,t),n)}delete(t){return super.delete(wV(this,t))}}function oN({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function vV({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function wV({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function jV(e){return e!==null&&typeof e=="object"?e.valueOf():e}function NV(e=Zr){if(e===Zr)return mP;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function mP(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const SV=Math.sqrt(50),kV=Math.sqrt(10),AV=Math.sqrt(2);function pc(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),i=r/Math.pow(10,s),o=i>=SV?10:i>=kV?5:i>=AV?2:1;let l,c,d;return s<0?(d=Math.pow(10,-s)/o,l=Math.round(e*d),c=Math.round(t*d),l/dt&&--c,d=-d):(d=Math.pow(10,s)*o,l=Math.round(e/d),c=Math.round(t/d),l*dt&&--c),c0))return[];if(e===t)return[e];const r=t=s))return[];const l=i-s+1,c=new Array(l);if(r)if(o<0)for(let d=0;d=r)&&(n=r);return n}function cN(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function hP(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?mP:NV(s);r>n;){if(r-n>600){const c=r-n+1,d=t-n+1,f=Math.log(c),u=.5*Math.exp(2*f/3),m=.5*Math.sqrt(f*u*(c-u)/c)*(d-c/2<0?-1:1),h=Math.max(n,Math.floor(t-d*u/c+m)),g=Math.min(r,Math.floor(t+(c-d)*u/c+m));hP(e,t,h,g,s)}const i=e[t];let o=n,l=r;for(ji(e,n,t),s(e[r],i)>0&&ji(e,n,r);o0;)--l}s(e[n],i)===0?ji(e,n,l):(++l,ji(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function ji(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function CV(e,t,n){if(e=Float64Array.from(bV(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return cN(e);if(t>=1)return lN(e);var r,s=(r-1)*t,i=Math.floor(s),o=lN(hP(e,i).subarray(0,i+1)),l=cN(e.subarray(i+1));return o+(l-o)*(s-i)}}function TV(e,t,n=fP){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,i=Math.floor(s),o=+n(e[i],i,e),l=+n(e[i+1],i+1,e);return o+(l-o)*(s-i)}}function PV(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(s);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=EV.exec(e))?new mn(t[1],t[2],t[3],1):(t=_V.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=IV.exec(e))?vl(t[1],t[2],t[3],t[4]):(t=OV.exec(e))?vl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=DV.exec(e))?xN(t[1],t[2]/100,t[3]/100,1):(t=RV.exec(e))?xN(t[1],t[2]/100,t[3]/100,t[4]):dN.hasOwnProperty(e)?mN(dN[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function mN(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function vl(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function zV(e){return e instanceof Yo||(e=fo(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function Wx(e,t,n,r){return arguments.length===1?zV(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}J0(mn,Wx,xP(Yo,{brighter(e){return e=e==null?xc:Math.pow(xc,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?co:Math.pow(co,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn($a(this.r),$a(this.g),$a(this.b),gc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hN,formatHex:hN,formatHex8:FV,formatRgb:pN,toString:pN}));function hN(){return`#${Ta(this.r)}${Ta(this.g)}${Ta(this.b)}`}function FV(){return`#${Ta(this.r)}${Ta(this.g)}${Ta(this.b)}${Ta((isNaN(this.opacity)?1:this.opacity)*255)}`}function pN(){const e=gc(this.opacity);return`${e===1?"rgb(":"rgba("}${$a(this.r)}, ${$a(this.g)}, ${$a(this.b)}${e===1?")":`, ${e})`}`}function gc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $a(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ta(e){return e=$a(e),(e<16?"0":"")+e.toString(16)}function xN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vn(e,t,n,r)}function gP(e){if(e instanceof Vn)return new Vn(e.h,e.s,e.l,e.opacity);if(e instanceof Yo||(e=fo(e)),!e)return new Vn;if(e instanceof Vn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,l=i-s,c=(i+s)/2;return l?(t===i?o=(n-r)/l+(n0&&c<1?0:o,new Vn(o,l,c,e.opacity)}function BV(e,t,n,r){return arguments.length===1?gP(e):new Vn(e,t,n,r??1)}function Vn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}J0(Vn,BV,xP(Yo,{brighter(e){return e=e==null?xc:Math.pow(xc,e),new Vn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?co:Math.pow(co,e),new Vn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new mn($h(e>=240?e-240:e+120,s,r),$h(e,s,r),$h(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Vn(gN(this.h),wl(this.s),wl(this.l),gc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=gc(this.opacity);return`${e===1?"hsl(":"hsla("}${gN(this.h)}, ${wl(this.s)*100}%, ${wl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function gN(e){return e=(e||0)%360,e<0?e+360:e}function wl(e){return Math.max(0,Math.min(1,e||0))}function $h(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const eb=e=>()=>e;function qV(e,t){return function(n){return e+n*t}}function VV(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function UV(e){return(e=+e)==1?bP:function(t,n){return n-t?VV(t,n,e):eb(isNaN(t)?n:t)}}function bP(e,t){var n=t-e;return n?qV(e,n):eb(isNaN(e)?t:e)}const bN=(function e(t){var n=UV(t);function r(s,i){var o=n((s=Wx(s)).r,(i=Wx(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),d=bP(s.opacity,i.opacity);return function(f){return s.r=o(f),s.g=l(f),s.b=c(f),s.opacity=d(f),s+""}}return r.gamma=e,r})(1);function GV(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;sn&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:bc(r,s)})),n=zh.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function nU(e,t,n){var r=e[0],s=e[1],i=t[0],o=t[1];return s2?rU:nU,c=d=null,u}function u(m){return m==null||isNaN(m=+m)?i:(c||(c=l(e.map(r),t,n)))(r(o(m)))}return u.invert=function(m){return o(s((d||(d=l(t,e.map(r),bc)))(m)))},u.domain=function(m){return arguments.length?(e=Array.from(m,yc),f()):e.slice()},u.range=function(m){return arguments.length?(t=Array.from(m),f()):t.slice()},u.rangeRound=function(m){return t=Array.from(m),n=tb,f()},u.clamp=function(m){return arguments.length?(o=m?!0:ln,f()):o!==ln},u.interpolate=function(m){return arguments.length?(n=m,f()):n},u.unknown=function(m){return arguments.length?(i=m,u):i},function(m,h){return r=m,s=h,f()}}function nb(){return Cd()(ln,ln)}function aU(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function vc(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function zs(e){return e=vc(Math.abs(e)),e?e[1]:NaN}function sU(e,t){return function(n,r){for(var s=n.length,i=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),i.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function iU(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var oU=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mo(e){if(!(t=oU.exec(e)))throw new Error("invalid format: "+e);var t;return new rb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}mo.prototype=rb.prototype;function rb(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}rb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function lU(e){e:for(var t=e.length,n=1,r=-1,s;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var wc;function cU(e,t){var n=vc(e,t);if(!n)return wc=void 0,e.toPrecision(t);var r=n[0],s=n[1],i=s-(wc=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+vc(e,Math.max(0,t+i-1))[0]}function vN(e,t){var n=vc(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const wN={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:aU,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vN(e*100,t),r:vN,s:cU,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function jN(e){return e}var NN=Array.prototype.map,SN=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dU(e){var t=e.grouping===void 0||e.thousands===void 0?jN:sU(NN.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?jN:iU(NN.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(u,m){u=mo(u);var h=u.fill,g=u.align,x=u.sign,p=u.symbol,j=u.zero,S=u.width,y=u.comma,N=u.precision,b=u.trim,w=u.type;w==="n"?(y=!0,w="g"):wN[w]||(N===void 0&&(N=12),b=!0,w="g"),(j||h==="0"&&g==="=")&&(j=!0,h="0",g="=");var k=(m&&m.prefix!==void 0?m.prefix:"")+(p==="$"?n:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),A=(p==="$"?r:/[%p]/.test(w)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),C=wN[w],F=/[defgprs%]/.test(w);N=N===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function D(L){var P=k,H=A,Y,V,O;if(w==="c")H=C(L)+H,L="";else{L=+L;var E=L<0||1/L<0;if(L=isNaN(L)?c:C(Math.abs(L),N),b&&(L=lU(L)),E&&+L==0&&x!=="+"&&(E=!1),P=(E?x==="("?x:l:x==="-"||x==="("?"":x)+P,H=(w==="s"&&!isNaN(L)&&wc!==void 0?SN[8+wc/3]:"")+H+(E&&x==="("?")":""),F){for(Y=-1,V=L.length;++YO||O>57){H=(O===46?s+L.slice(Y+1):L.slice(Y))+H,L=L.slice(0,Y);break}}}y&&!j&&(L=t(L,1/0));var B=P.length+L.length+H.length,T=B>1)+P+L+H+T.slice(B);break;default:L=T+P+L+H;break}return i(L)}return D.toString=function(){return u+""},D}function f(u,m){var h=Math.max(-8,Math.min(8,Math.floor(zs(m)/3)))*3,g=Math.pow(10,-h),x=d((u=mo(u),u.type="f",u),{suffix:SN[8+h/3]});return function(p){return x(g*p)}}return{format:d,formatPrefix:f}}var jl,ab,yP;uU({thousands:",",grouping:[3],currency:["$",""]});function uU(e){return jl=dU(e),ab=jl.format,yP=jl.formatPrefix,jl}function fU(e){return Math.max(0,-zs(Math.abs(e)))}function mU(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(zs(t)/3)))*3-zs(Math.abs(e)))}function hU(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zs(t)-zs(e))+1}function vP(e,t,n,r){var s=Ux(e,t,n),i;switch(r=mo(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=mU(s,o))&&(r.precision=i),yP(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=hU(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=fU(s))&&(r.precision=i-(r.type==="%")*2);break}}return ab(r)}function ma(e){var t=e.domain;return e.ticks=function(n){var r=t();return qx(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return vP(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,i=r.length-1,o=r[s],l=r[i],c,d,f=10;for(l0;){if(d=Vx(o,l,n),d===c)return r[s]=o,r[i]=l,t(r);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function jc(){var e=nb();return e.copy=function(){return Qo(e,jc())},Rn.apply(e,arguments),ma(e)}function wP(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,yc),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return wP(e).unknown(t)},e=arguments.length?Array.from(e,yc):[0,1],ma(n)}function jP(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],i=e[r],o;return iMath.pow(e,t)}function yU(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function CN(e){return(t,n)=>-e(-t,n)}function sb(e){const t=e(kN,AN),n=t.domain;let r=10,s,i;function o(){return s=yU(r),i=bU(r),n()[0]<0?(s=CN(s),i=CN(i),e(pU,xU)):e(kN,AN),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let d=c[0],f=c[c.length-1];const u=f0){for(;m<=h;++m)for(g=1;gf)break;j.push(x)}}else for(;m<=h;++m)for(g=r-1;g>=1;--g)if(x=m>0?g/i(-m):g*i(m),!(xf)break;j.push(x)}j.length*2{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=mo(c)).precision==null&&(c.trim=!0),c=ab(c)),l===1/0)return c;const d=Math.max(1,r*l/t.ticks().length);return f=>{let u=f/i(Math.round(s(f)));return u*rn(jP(n(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),t}function NP(){const e=sb(Cd()).domain([1,10]);return e.copy=()=>Qo(e,NP()).base(e.base()),Rn.apply(e,arguments),e}function TN(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function PN(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ib(e){var t=1,n=e(TN(t),PN(t));return n.constant=function(r){return arguments.length?e(TN(t=+r),PN(t)):t},ma(n)}function SP(){var e=ib(Cd());return e.copy=function(){return Qo(e,SP()).constant(e.constant())},Rn.apply(e,arguments)}function MN(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function vU(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function wU(e){return e<0?-e*e:e*e}function ob(e){var t=e(ln,ln),n=1;function r(){return n===1?e(ln,ln):n===.5?e(vU,wU):e(MN(n),MN(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},ma(t)}function lb(){var e=ob(Cd());return e.copy=function(){return Qo(e,lb()).exponent(e.exponent())},Rn.apply(e,arguments),e}function jU(){return lb.apply(null,arguments).exponent(.5)}function EN(e){return Math.sign(e)*e*e}function NU(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function kP(){var e=nb(),t=[0,1],n=!1,r;function s(i){var o=NU(e(i));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(i){return e.invert(EN(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,yc)).map(EN)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(n=!!i,s):n},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return kP(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Rn.apply(s,arguments),ma(s)}function AP(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o0?n[l-1]:e[0],l=n?[r[n-1],t]:[r[d-1],r[d]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return CP().domain([e,t]).range(s).unknown(i)},Rn.apply(ma(o),arguments)}function TP(){var e=[.5],t=[0,1],n,r=1;function s(i){return i!=null&&i<=i?t[Xo(e,i,0,r)]:n}return s.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return TP().domain(e).range(t).unknown(n)},Rn.apply(s,arguments)}const Fh=new Date,Bh=new Date;function _t(e,t,n,r){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),l=s.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,l)=>{const c=[];if(i=s.ceil(i),l=l==null?1:Math.floor(l),!(i0))return c;let d;do c.push(d=new Date(+i)),t(i,l),e(i);while(d_t(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),n&&(s.count=(i,o)=>(Fh.setTime(+i),Bh.setTime(+o),e(Fh),e(Bh),Math.floor(n(Fh,Bh))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(r?o=>r(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const Nc=_t(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Nc.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_t(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Nc);Nc.range;const Nr=1e3,Mn=Nr*60,Sr=Mn*60,Or=Sr*24,cb=Or*7,_N=Or*30,qh=Or*365,Pa=_t(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Nr)},(e,t)=>(t-e)/Nr,e=>e.getUTCSeconds());Pa.range;const db=_t(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nr)},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getMinutes());db.range;const ub=_t(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getUTCMinutes());ub.range;const fb=_t(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nr-e.getMinutes()*Mn)},(e,t)=>{e.setTime(+e+t*Sr)},(e,t)=>(t-e)/Sr,e=>e.getHours());fb.range;const mb=_t(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sr)},(e,t)=>(t-e)/Sr,e=>e.getUTCHours());mb.range;const Zo=_t(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Mn)/Or,e=>e.getDate()-1);Zo.range;const Td=_t(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Or,e=>e.getUTCDate()-1);Td.range;const PP=_t(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Or,e=>Math.floor(e/Or));PP.range;function Ja(e){return _t(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Mn)/cb)}const Pd=Ja(0),Sc=Ja(1),SU=Ja(2),kU=Ja(3),Fs=Ja(4),AU=Ja(5),CU=Ja(6);Pd.range;Sc.range;SU.range;kU.range;Fs.range;AU.range;CU.range;function es(e){return _t(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/cb)}const Md=es(0),kc=es(1),TU=es(2),PU=es(3),Bs=es(4),MU=es(5),EU=es(6);Md.range;kc.range;TU.range;PU.range;Bs.range;MU.range;EU.range;const hb=_t(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());hb.range;const pb=_t(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());pb.range;const Dr=_t(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Dr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_t(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Dr.range;const Rr=_t(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Rr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_t(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Rr.range;function MP(e,t,n,r,s,i){const o=[[Pa,1,Nr],[Pa,5,5*Nr],[Pa,15,15*Nr],[Pa,30,30*Nr],[i,1,Mn],[i,5,5*Mn],[i,15,15*Mn],[i,30,30*Mn],[s,1,Sr],[s,3,3*Sr],[s,6,6*Sr],[s,12,12*Sr],[r,1,Or],[r,2,2*Or],[n,1,cb],[t,1,_N],[t,3,3*_N],[e,1,qh]];function l(d,f,u){const m=fp).right(o,m);if(h===o.length)return e.every(Ux(d/qh,f/qh,u));if(h===0)return Nc.every(Math.max(Ux(d,f,u),1));const[g,x]=o[m/o[h-1][2]53)return null;"w"in G||(G.w=1),"Z"in G?(re=Uh(Ni(G.y,0,1)),te=re.getUTCDay(),re=te>4||te===0?kc.ceil(re):kc(re),re=Td.offset(re,(G.V-1)*7),G.y=re.getUTCFullYear(),G.m=re.getUTCMonth(),G.d=re.getUTCDate()+(G.w+6)%7):(re=Vh(Ni(G.y,0,1)),te=re.getDay(),re=te>4||te===0?Sc.ceil(re):Sc(re),re=Zo.offset(re,(G.V-1)*7),G.y=re.getFullYear(),G.m=re.getMonth(),G.d=re.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),te="Z"in G?Uh(Ni(G.y,0,1)).getUTCDay():Vh(Ni(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(te+5)%7:G.w+G.U*7-(te+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,Uh(G)):Vh(G)}}function A(_,Q,R,G){for(var ae=0,re=Q.length,te=R.length,se,q;ae=te)return-1;if(se=Q.charCodeAt(ae++),se===37){if(se=Q.charAt(ae++),q=b[se in IN?Q.charAt(ae++):se],!q||(G=q(_,R,G))<0)return-1}else if(se!=R.charCodeAt(G++))return-1}return G}function C(_,Q,R){var G=d.exec(Q.slice(R));return G?(_.p=f.get(G[0].toLowerCase()),R+G[0].length):-1}function F(_,Q,R){var G=h.exec(Q.slice(R));return G?(_.w=g.get(G[0].toLowerCase()),R+G[0].length):-1}function D(_,Q,R){var G=u.exec(Q.slice(R));return G?(_.w=m.get(G[0].toLowerCase()),R+G[0].length):-1}function L(_,Q,R){var G=j.exec(Q.slice(R));return G?(_.m=S.get(G[0].toLowerCase()),R+G[0].length):-1}function P(_,Q,R){var G=x.exec(Q.slice(R));return G?(_.m=p.get(G[0].toLowerCase()),R+G[0].length):-1}function H(_,Q,R){return A(_,t,Q,R)}function Y(_,Q,R){return A(_,n,Q,R)}function V(_,Q,R){return A(_,r,Q,R)}function O(_){return o[_.getDay()]}function E(_){return i[_.getDay()]}function B(_){return c[_.getMonth()]}function T(_){return l[_.getMonth()]}function M(_){return s[+(_.getHours()>=12)]}function K(_){return 1+~~(_.getMonth()/3)}function X(_){return o[_.getUTCDay()]}function I(_){return i[_.getUTCDay()]}function Z(_){return c[_.getUTCMonth()]}function ne(_){return l[_.getUTCMonth()]}function ee(_){return s[+(_.getUTCHours()>=12)]}function $(_){return 1+~~(_.getUTCMonth()/3)}return{format:function(_){var Q=w(_+="",y);return Q.toString=function(){return _},Q},parse:function(_){var Q=k(_+="",!1);return Q.toString=function(){return _},Q},utcFormat:function(_){var Q=w(_+="",N);return Q.toString=function(){return _},Q},utcParse:function(_){var Q=k(_+="",!0);return Q.toString=function(){return _},Q}}}var IN={"-":"",_:" ",0:"0"},zt=/^\s*\d+/,LU=/^%/,$U=/[\\^$*+?|[\]().{}]/g;function qe(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",i=s.length;return r+(i[t.toLowerCase(),n]))}function FU(e,t,n){var r=zt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function BU(e,t,n){var r=zt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function qU(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function VU(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function UU(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ON(e,t,n){var r=zt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function DN(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function GU(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function WU(e,t,n){var r=zt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function HU(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function RN(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function KU(e,t,n){var r=zt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function LN(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function XU(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function YU(e,t,n){var r=zt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function QU(e,t,n){var r=zt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ZU(e,t,n){var r=zt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function JU(e,t,n){var r=LU.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function eG(e,t,n){var r=zt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function tG(e,t,n){var r=zt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function $N(e,t){return qe(e.getDate(),t,2)}function nG(e,t){return qe(e.getHours(),t,2)}function rG(e,t){return qe(e.getHours()%12||12,t,2)}function aG(e,t){return qe(1+Zo.count(Dr(e),e),t,3)}function EP(e,t){return qe(e.getMilliseconds(),t,3)}function sG(e,t){return EP(e,t)+"000"}function iG(e,t){return qe(e.getMonth()+1,t,2)}function oG(e,t){return qe(e.getMinutes(),t,2)}function lG(e,t){return qe(e.getSeconds(),t,2)}function cG(e){var t=e.getDay();return t===0?7:t}function dG(e,t){return qe(Pd.count(Dr(e)-1,e),t,2)}function _P(e){var t=e.getDay();return t>=4||t===0?Fs(e):Fs.ceil(e)}function uG(e,t){return e=_P(e),qe(Fs.count(Dr(e),e)+(Dr(e).getDay()===4),t,2)}function fG(e){return e.getDay()}function mG(e,t){return qe(Sc.count(Dr(e)-1,e),t,2)}function hG(e,t){return qe(e.getFullYear()%100,t,2)}function pG(e,t){return e=_P(e),qe(e.getFullYear()%100,t,2)}function xG(e,t){return qe(e.getFullYear()%1e4,t,4)}function gG(e,t){var n=e.getDay();return e=n>=4||n===0?Fs(e):Fs.ceil(e),qe(e.getFullYear()%1e4,t,4)}function bG(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+qe(t/60|0,"0",2)+qe(t%60,"0",2)}function zN(e,t){return qe(e.getUTCDate(),t,2)}function yG(e,t){return qe(e.getUTCHours(),t,2)}function vG(e,t){return qe(e.getUTCHours()%12||12,t,2)}function wG(e,t){return qe(1+Td.count(Rr(e),e),t,3)}function IP(e,t){return qe(e.getUTCMilliseconds(),t,3)}function jG(e,t){return IP(e,t)+"000"}function NG(e,t){return qe(e.getUTCMonth()+1,t,2)}function SG(e,t){return qe(e.getUTCMinutes(),t,2)}function kG(e,t){return qe(e.getUTCSeconds(),t,2)}function AG(e){var t=e.getUTCDay();return t===0?7:t}function CG(e,t){return qe(Md.count(Rr(e)-1,e),t,2)}function OP(e){var t=e.getUTCDay();return t>=4||t===0?Bs(e):Bs.ceil(e)}function TG(e,t){return e=OP(e),qe(Bs.count(Rr(e),e)+(Rr(e).getUTCDay()===4),t,2)}function PG(e){return e.getUTCDay()}function MG(e,t){return qe(kc.count(Rr(e)-1,e),t,2)}function EG(e,t){return qe(e.getUTCFullYear()%100,t,2)}function _G(e,t){return e=OP(e),qe(e.getUTCFullYear()%100,t,2)}function IG(e,t){return qe(e.getUTCFullYear()%1e4,t,4)}function OG(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Bs(e):Bs.ceil(e),qe(e.getUTCFullYear()%1e4,t,4)}function DG(){return"+0000"}function FN(){return"%"}function BN(e){return+e}function qN(e){return Math.floor(+e/1e3)}var ds,DP,RP;RG({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function RG(e){return ds=RU(e),DP=ds.format,ds.parse,RP=ds.utcFormat,ds.utcParse,ds}function LG(e){return new Date(e)}function $G(e){return e instanceof Date?+e:+new Date(+e)}function xb(e,t,n,r,s,i,o,l,c,d){var f=nb(),u=f.invert,m=f.domain,h=d(".%L"),g=d(":%S"),x=d("%I:%M"),p=d("%I %p"),j=d("%a %d"),S=d("%b %d"),y=d("%B"),N=d("%Y");function b(w){return(c(w)t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,i)=>CV(e,i/r))},n.copy=function(){return FP(t).domain(e)},Fr.apply(n,arguments)}function _d(){var e=0,t=.5,n=1,r=1,s,i,o,l,c,d=ln,f,u=!1,m;function h(x){return isNaN(x=+x)?m:(x=.5+((x=+f(x))-i)*(r*xn}return Wh=e,Wh}var Hh,WN;function UG(){if(WN)return Hh;WN=1;var e=UP(),t=VG(),n=oi();function r(s){return s&&s.length?e(s,n,t):void 0}return Hh=r,Hh}var GG=UG();const Id=st(GG);var Kh,HN;function WG(){if(HN)return Kh;HN=1;function e(t,n){return te.e^i.s<0?1:-1;for(r=i.d.length,s=e.d.length,t=0,n=re.d[t]^i.s<0?1:-1;return r===s?0:r>s^i.s<0?1:-1};xe.decimalPlaces=xe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*it;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};xe.dividedBy=xe.div=function(e){return Mr(this,new this.constructor(e))};xe.dividedToIntegerBy=xe.idiv=function(e){var t=this,n=t.constructor;return et(Mr(t,new n(e),0,1),n.precision)};xe.equals=xe.eq=function(e){return!this.cmp(e)};xe.exponent=function(){return At(this)};xe.greaterThan=xe.gt=function(e){return this.cmp(e)>0};xe.greaterThanOrEqualTo=xe.gte=function(e){return this.cmp(e)>=0};xe.isInteger=xe.isint=function(){return this.e>this.d.length-2};xe.isNegative=xe.isneg=function(){return this.s<0};xe.isPositive=xe.ispos=function(){return this.s>0};xe.isZero=function(){return this.s===0};xe.lessThan=xe.lt=function(e){return this.cmp(e)<0};xe.lessThanOrEqualTo=xe.lte=function(e){return this.cmp(e)<1};xe.logarithm=xe.log=function(e){var t,n=this,r=n.constructor,s=r.precision,i=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(yn))throw Error(Dn+"NaN");if(n.s<1)throw Error(Dn+(n.s?"NaN":"-Infinity"));return n.eq(yn)?new r(0):(lt=!1,t=Mr(ho(n,i),ho(e,i),i),lt=!0,et(t,s))};xe.minus=xe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KP(t,e):WP(t,(e.s=-e.s,e))};xe.modulo=xe.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(Dn+"NaN");return n.s?(lt=!1,t=Mr(n,e,0,1).times(e),lt=!0,n.minus(t)):et(new r(n),s)};xe.naturalExponential=xe.exp=function(){return HP(this)};xe.naturalLogarithm=xe.ln=function(){return ho(this)};xe.negated=xe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};xe.plus=xe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?WP(t,e):KP(t,(e.s=-e.s,e))};xe.precision=xe.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(za+e);if(t=At(s)+1,r=s.d.length-1,n=r*it+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};xe.squareRoot=xe.sqrt=function(){var e,t,n,r,s,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Dn+"NaN")}for(e=At(l),lt=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=ir(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=di((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(i=r,r=i.plus(Mr(l,i,o+2)).times(.5),ir(i.d).slice(0,o)===(t=ir(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(et(i,n+1,0),i.times(i).eq(l)){r=i;break}}else if(t!="9999")break;o+=4}return lt=!0,et(r,n)};xe.times=xe.mul=function(e){var t,n,r,s,i,o,l,c,d,f=this,u=f.constructor,m=f.d,h=(e=new u(e)).d;if(!f.s||!e.s)return new u(0);for(e.s*=f.s,n=f.e+e.e,c=m.length,d=h.length,c=0;){for(t=0,s=c+r;s>r;)l=i[s]+h[r]*m[s-r-1]+t,i[s--]=l%Dt|0,t=l/Dt|0;i[s]=(i[s]+t)%Dt|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,lt?et(e,u.precision):e};xe.toDecimalPlaces=xe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(mr(e,0,ci),t===void 0?t=r.rounding:mr(t,0,8),et(n,e+At(n)+1,t))};xe.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=Ha(r,!0):(mr(e,0,ci),t===void 0?t=s.rounding:mr(t,0,8),r=et(new s(r),e+1,t),n=Ha(r,!0,e+1)),n};xe.toFixed=function(e,t){var n,r,s=this,i=s.constructor;return e===void 0?Ha(s):(mr(e,0,ci),t===void 0?t=i.rounding:mr(t,0,8),r=et(new i(s),e+At(s)+1,t),n=Ha(r.abs(),!1,e+At(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};xe.toInteger=xe.toint=function(){var e=this,t=e.constructor;return et(new t(e),At(e)+1,t.rounding)};xe.toNumber=function(){return+this};xe.toPower=xe.pow=function(e){var t,n,r,s,i,o,l=this,c=l.constructor,d=12,f=+(e=new c(e));if(!e.s)return new c(yn);if(l=new c(l),!l.s){if(e.s<1)throw Error(Dn+"Infinity");return l}if(l.eq(yn))return l;if(r=c.precision,e.eq(yn))return et(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=l.s,o){if((n=f<0?-f:f)<=GP){for(s=new c(yn),t=Math.ceil(r/it+4),lt=!1;n%2&&(s=s.times(l),JN(s.d,t)),n=di(n/2),n!==0;)l=l.times(l),JN(l.d,t);return lt=!0,e.s<0?new c(yn).div(s):et(s,r)}}else if(i<0)throw Error(Dn+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,lt=!1,s=e.times(ho(l,r+d)),lt=!0,s=HP(s),s.s=i,s};xe.toPrecision=function(e,t){var n,r,s=this,i=s.constructor;return e===void 0?(n=At(s),r=Ha(s,n<=i.toExpNeg||n>=i.toExpPos)):(mr(e,1,ci),t===void 0?t=i.rounding:mr(t,0,8),s=et(new i(s),e,t),n=At(s),r=Ha(s,e<=n||n<=i.toExpNeg,e)),r};xe.toSignificantDigits=xe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(mr(e,1,ci),t===void 0?t=r.rounding:mr(t,0,8)),et(new r(n),e,t)};xe.toString=xe.valueOf=xe.val=xe.toJSON=xe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=At(e),n=e.constructor;return Ha(e,t<=n.toExpNeg||t>=n.toExpPos)};function WP(e,t){var n,r,s,i,o,l,c,d,f=e.constructor,u=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),lt?et(t,u):t;if(c=e.d,d=t.d,o=e.e,s=t.e,c=c.slice(),i=o-s,i){for(i<0?(r=c,i=-i,l=d.length):(r=d,s=o,l=c.length),o=Math.ceil(u/it),l=o>l?o+1:l+1,i>l&&(i=l,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(l=c.length,i=d.length,l-i<0&&(i=l,r=d,d=c,c=r),n=0;i;)n=(c[--i]=c[i]+d[i]+n)/Dt|0,c[i]%=Dt;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,lt?et(t,u):t}function mr(e,t,n){if(e!==~~e||en)throw Error(za+e)}function ir(e){var t,n,r,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;to?1:-1;else for(l=c=0;ls[l]?1:-1;break}return c}function n(r,s,i){for(var o=0;i--;)r[i]-=o,o=r[i]1;)r.shift()}return function(r,s,i,o){var l,c,d,f,u,m,h,g,x,p,j,S,y,N,b,w,k,A,C=r.constructor,F=r.s==s.s?1:-1,D=r.d,L=s.d;if(!r.s)return new C(r);if(!s.s)throw Error(Dn+"Division by zero");for(c=r.e-s.e,k=L.length,b=D.length,h=new C(F),g=h.d=[],d=0;L[d]==(D[d]||0);)++d;if(L[d]>(D[d]||0)&&--c,i==null?S=i=C.precision:o?S=i+(At(r)-At(s))+1:S=i,S<0)return new C(0);if(S=S/it+2|0,d=0,k==1)for(f=0,L=L[0],S++;(d1&&(L=e(L,f),D=e(D,f),k=L.length,b=D.length),N=k,x=D.slice(0,k),p=x.length;p=Dt/2&&++w;do f=0,l=t(L,x,k,p),l<0?(j=x[0],k!=p&&(j=j*Dt+(x[1]||0)),f=j/w|0,f>1?(f>=Dt&&(f=Dt-1),u=e(L,f),m=u.length,p=x.length,l=t(u,x,m,p),l==1&&(f--,n(u,k16)throw Error(vb+At(e));if(!e.s)return new f(yn);for(lt=!1,l=u,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(r=Math.log(ja(2,d))/Math.LN10*2+5|0,l+=r,n=s=i=new f(yn),f.precision=l;;){if(s=et(s.times(e),l),n=n.times(++c),o=i.plus(Mr(s,n,l)),ir(o.d).slice(0,l)===ir(i.d).slice(0,l)){for(;d--;)i=et(i.times(i),l);return f.precision=u,t==null?(lt=!0,et(i,u)):i}i=o}}function At(e){for(var t=e.e*it,n=e.d[0];n>=10;n/=10)t++;return t}function Jh(e,t,n){if(t>e.LN10.sd())throw lt=!0,n&&(e.precision=n),Error(Dn+"LN10 precision limit exceeded");return et(new e(e.LN10),t)}function Gr(e){for(var t="";e--;)t+="0";return t}function ho(e,t){var n,r,s,i,o,l,c,d,f,u=1,m=10,h=e,g=h.d,x=h.constructor,p=x.precision;if(h.s<1)throw Error(Dn+(h.s?"NaN":"-Infinity"));if(h.eq(yn))return new x(0);if(t==null?(lt=!1,d=p):d=t,h.eq(10))return t==null&&(lt=!0),Jh(x,d);if(d+=m,x.precision=d,n=ir(g),r=n.charAt(0),i=At(h),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=ir(h.d),r=n.charAt(0),u++;i=At(h),r>1?(h=new x("0."+n),i++):h=new x(r+"."+n.slice(1))}else return c=Jh(x,d+2,p).times(i+""),h=ho(new x(r+"."+n.slice(1)),d-m).plus(c),x.precision=p,t==null?(lt=!0,et(h,p)):h;for(l=o=h=Mr(h.minus(yn),h.plus(yn),d),f=et(h.times(h),d),s=3;;){if(o=et(o.times(f),d),c=l.plus(Mr(o,new x(s),d)),ir(c.d).slice(0,d)===ir(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(Jh(x,d+2,p).times(i+""))),l=Mr(l,new x(u),d),x.precision=p,t==null?(lt=!0,et(l,p)):l;l=c,s+=2}}function ZN(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=di(n/it),e.d=[],r=(n+1)%it,n<0&&(r+=it),rAc||e.e<-Ac))throw Error(vb+n)}else e.s=0,e.e=0,e.d=[0];return e}function et(e,t,n){var r,s,i,o,l,c,d,f,u=e.d;for(o=1,i=u[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=it,s=t,d=u[f=0];else{if(f=Math.ceil((r+1)/it),i=u.length,f>=i)return e;for(d=i=u[f],o=1;i>=10;i/=10)o++;r%=it,s=r-it+o}if(n!==void 0&&(i=ja(10,o-s-1),l=d/i%10|0,c=t<0||u[f+1]!==void 0||d%i,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?d/ja(10,o-s):0:u[f-1])%10&1||n==(e.s<0?8:7))),t<1||!u[0])return c?(i=At(e),u.length=1,t=t-i-1,u[0]=ja(10,(it-t%it)%it),e.e=di(-t/it)||0):(u.length=1,u[0]=e.e=e.s=0),e;if(r==0?(u.length=f,i=1,f--):(u.length=f+1,i=ja(10,it-r),u[f]=s>0?(d/ja(10,o-s)%ja(10,s)|0)*i:0),c)for(;;)if(f==0){(u[0]+=i)==Dt&&(u[0]=1,++e.e);break}else{if(u[f]+=i,u[f]!=Dt)break;u[f--]=0,i=1}for(r=u.length;u[--r]===0;)u.pop();if(lt&&(e.e>Ac||e.e<-Ac))throw Error(vb+At(e));return e}function KP(e,t){var n,r,s,i,o,l,c,d,f,u,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),lt?et(t,h):t;if(c=e.d,u=t.d,r=t.e,d=e.e,c=c.slice(),o=d-r,o){for(f=o<0,f?(n=c,o=-o,l=u.length):(n=u,r=d,l=c.length),s=Math.max(Math.ceil(h/it),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=u.length,f=s0;--s)c[l++]=0;for(s=u.length;s>o;){if(c[--s]0?i=i.charAt(0)+"."+i.slice(1)+Gr(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Gr(-s-1)+i,n&&(r=n-o)>0&&(i+=Gr(r))):s>=o?(i+=Gr(s+1-o),n&&(r=n-s-1)>0&&(i=i+"."+Gr(r))):((r=s+1)0&&(s+1===o&&(i+="."),i+=Gr(r))),e.s<0?"-"+i:i}function JN(e,t){if(e.length>t)return e.length=t,!0}function XP(e){var t,n,r;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(za+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return ZN(o,i.toString())}else if(typeof i!="string")throw Error(za+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,nW.test(i))ZN(o,i);else throw Error(za+i)}if(s.prototype=xe,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=XP,s.config=s.set=rW,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(za+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(za+n+": "+r);return this}var wb=XP(tW);yn=new wb(1);const Ze=wb;function aW(e){return lW(e)||oW(e)||iW(e)||sW()}function sW(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iW(e,t){if(e){if(typeof e=="string")return Xx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xx(e,t)}}function oW(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function lW(e){if(Array.isArray(e))return Xx(e)}function Xx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,s):e(t-o,eS(function(){for(var l=arguments.length,c=new Array(l),d=0;de.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,i=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw i}}return n}}function NW(e){if(Array.isArray(e))return e}function e3(e){var t=po(e,2),n=t[0],r=t[1],s=n,i=r;return n>r&&(s=r,i=n),[s,i]}function t3(e,t,n){if(e.lte(0))return new Ze(0);var r=Rd.getDigitCount(e.toNumber()),s=new Ze(10).pow(r),i=e.div(s),o=r!==1?.05:.1,l=new Ze(Math.ceil(i.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new Ze(Math.ceil(c))}function SW(e,t,n){var r=1,s=new Ze(e);if(!s.isint()&&n){var i=Math.abs(e);i<1?(r=new Ze(10).pow(Rd.getDigitCount(e)-1),s=new Ze(Math.floor(s.div(r).toNumber())).mul(r)):i>1&&(s=new Ze(Math.floor(e)))}else e===0?s=new Ze(Math.floor((t-1)/2)):n||(s=new Ze(Math.floor(e)));var o=Math.floor((t-1)/2),l=fW(uW(function(c){return s.add(new Ze(c-o).mul(r)).toNumber()}),Yx);return l(0,t)}function n3(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ze(0),tickMin:new Ze(0),tickMax:new Ze(0)};var i=t3(new Ze(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new Ze(0):(o=new Ze(e).add(t).div(2),o=o.sub(new Ze(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new Ze(t).sub(o).div(i).toNumber()),d=l+c+1;return d>n?n3(e,t,n,r,s+1):(d0?c+(n-d):c,l=t>0?l:l+(n-d)),{step:i,tickMin:o.sub(new Ze(l).mul(i)),tickMax:o.add(new Ze(c).mul(i))})}function kW(e){var t=po(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=e3([n,r]),c=po(l,2),d=c[0],f=c[1];if(d===-1/0||f===1/0){var u=f===1/0?[d].concat(Zx(Yx(0,s-1).map(function(){return 1/0}))):[].concat(Zx(Yx(0,s-1).map(function(){return-1/0})),[f]);return n>r?Qx(u):u}if(d===f)return SW(d,s,i);var m=n3(d,f,o,i),h=m.step,g=m.tickMin,x=m.tickMax,p=Rd.rangeStep(g,x.add(new Ze(.1).mul(h)),h);return n>r?Qx(p):p}function AW(e,t){var n=po(e,2),r=n[0],s=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=e3([r,s]),l=po(o,2),c=l[0],d=l[1];if(c===-1/0||d===1/0)return[r,s];if(c===d)return[c];var f=Math.max(t,2),u=t3(new Ze(d).sub(c).div(f-1),i,0),m=[].concat(Zx(Rd.rangeStep(new Ze(c),new Ze(d).sub(new Ze(.99).mul(u)),u)),[d]);return r>s?Qx(m):m}var CW=ZP(kW),TW=ZP(AW),PW="Invariant failed";function Ka(e,t){throw new Error(PW)}var MW=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function Cc(){return Cc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $W(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zW(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r?.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,d=0;d0?s[d-1].coordinate:s[l-1].coordinate,u=s[d].coordinate,m=d>=l-1?s[0].coordinate:s[d+1].coordinate,h=void 0;if(Gn(u-f)!==Gn(m-u)){var g=[];if(Gn(m-u)===Gn(c[1]-c[0])){h=m;var x=u+c[1]-c[0];g[0]=Math.min(x,(x+f)/2),g[1]=Math.max(x,(x+f)/2)}else{h=f;var p=m+c[1]-c[0];g[0]=Math.min(u,(p+u)/2),g[1]=Math.max(u,(p+u)/2)}var j=[Math.min(u,(h+u)/2),Math.max(u,(h+u)/2)];if(t>j[0]&&t<=j[1]||t>=g[0]&&t<=g[1]){o=s[d].index;break}}else{var S=Math.min(f,m),y=Math.max(f,m);if(t>(S+u)/2&&t<=(y+u)/2){o=s[d].index;break}}}else for(var N=0;N0&&N(r[N].coordinate+r[N-1].coordinate)/2&&t<=(r[N].coordinate+r[N+1].coordinate)/2||N===l-1&&t>(r[N].coordinate+r[N-1].coordinate)/2){o=r[N].index;break}return o},jb=function(t){var n,r=t,s=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?gt(gt({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},nH=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,i=s===void 0?{}:s;if(!i)return{};for(var o={},l=Object.keys(i),c=0,d=l.length;c=0});if(j&&j.length){var S=j[0].type.defaultProps,y=S!==void 0?gt(gt({},S),j[0].props):j[0].props,N=y.barSize,b=y[p];o[b]||(o[b]=[]);var w=Ue(N)?n:N;o[b].push({item:j[0],stackList:j.slice(1),barSize:Ue(w)?void 0:Wa(w,r,0)})}}return o},rH=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var d=Wa(n,s,0,!0),f,u=[];if(o[0].barSize===+o[0].barSize){var m=!1,h=s/c,g=o.reduce(function(N,b){return N+b.barSize||0},0);g+=(c-1)*d,g>=s&&(g-=(c-1)*d,d=0),g>=s&&h>0&&(m=!0,h*=.9,g=c*h);var x=(s-g)/2>>0,p={offset:x-d,size:0};f=o.reduce(function(N,b){var w={item:b.item,position:{offset:p.offset+p.size+d,size:m?h:b.barSize}},k=[].concat(rS(N),[w]);return p=k[k.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(A){k.push({item:A,position:p})}),k},u)}else{var j=Wa(r,s,0,!0);s-2*j-(c-1)*d<=0&&(d=0);var S=(s-2*j-(c-1)*d)/c;S>1&&(S>>=0);var y=l===+l?Math.min(S,l):S;f=o.reduce(function(N,b,w){var k=[].concat(rS(N),[{item:b.item,position:{offset:j+(S+d)*w+(S-y)/2,size:y}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(A){k.push({item:A,position:k[k.length-1].position})}),k},u)}return f},aH=function(t,n,r,s){var i=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),d=i3({children:i,legendWidth:c});if(d){var f=s||{},u=f.width,m=f.height,h=d.align,g=d.verticalAlign,x=d.layout;if((x==="vertical"||x==="horizontal"&&g==="middle")&&h!=="center"&&he(t[h]))return gt(gt({},t),{},Ts({},h,t[h]+(u||0)));if((x==="horizontal"||x==="vertical"&&h==="center")&&g!=="middle"&&he(t[g]))return gt(gt({},t),{},Ts({},g,t[g]+(m||0)))}return t},sH=function(t,n,r){return Ue(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},o3=function(t,n,r,s,i){var o=n.props.children,l=Xn(o,Ld).filter(function(d){return sH(s,i,d.props.direction)});if(l&&l.length){var c=l.map(function(d){return d.props.dataKey});return t.reduce(function(d,f){var u=hr(f,r);if(Ue(u))return d;var m=Array.isArray(u)?[Od(u),Id(u)]:[u,u],h=c.reduce(function(g,x){var p=hr(f,x,0),j=m[0]-Math.abs(Array.isArray(p)?p[0]:p),S=m[1]+Math.abs(Array.isArray(p)?p[1]:p);return[Math.min(j,g[0]),Math.max(S,g[1])]},[1/0,-1/0]);return[Math.min(h[0],d[0]),Math.max(h[1],d[1])]},[1/0,-1/0])}return null},iH=function(t,n,r,s,i){var o=n.map(function(l){return o3(t,l,r,i,s)}).filter(function(l){return!Ue(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},l3=function(t,n,r,s,i){var o=n.map(function(c){var d=c.props.dataKey;return r==="number"&&d&&o3(t,c,d,s)||Ui(t,d,r,i)});if(r==="number")return o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,d){for(var f=0,u=d.length;f=2?Gn(l[0]-l[1])*2*d:d,n&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(u){var m=i?i.indexOf(u):u;return{coordinate:s(m)+d,value:u,offset:d}});return f.filter(function(u){return!Wo(u.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(u,m){return{coordinate:s(u)+d,value:u,index:m,offset:d}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(u){return{coordinate:s(u)+d,value:u,offset:d}}):s.domain().map(function(u,m){return{coordinate:s(u)+d,value:i?i[u]:u,index:m,offset:d}})},ep=new WeakMap,Nl=function(t,n){if(typeof n!="function")return t;ep.has(t)||ep.set(t,new WeakMap);var r=ep.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},oH=function(t,n,r){var s=t.scale,i=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:lo(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:jc(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Vi(),realScaleType:"point"}:i==="category"?{scale:lo(),realScaleType:"band"}:{scale:jc(),realScaleType:"linear"};if(Ga(s)){var c="scale".concat(vd(s));return{scale:(VN[c]||Vi)(),realScaleType:VN[c]?c:"point"}}return Le(s)?{scale:s}:{scale:Vi(),realScaleType:"point"}},sS=1e-4,lH=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),i=Math.min(s[0],s[1])-sS,o=Math.max(s[0],s[1])+sS,l=t(n[0]),c=t(n[r-1]);(lo||co)&&t.domain([n[0],n[r-1]])}},cH=function(t,n){if(!t)return null;for(var r=0,s=t.length;rs)&&(i[1]=s),i[0]>s&&(i[0]=s),i[1]=0?(t[l][r][0]=i,t[l][r][1]=i+c,i=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},fH=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r=0?(t[o][r][0]=i,t[o][r][1]=i+l,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},mH={sign:uH,expand:YF,none:Os,silhouette:QF,wiggle:ZF,positive:fH},hH=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),i=mH[r],o=XF().keys(s).value(function(l,c){return+hr(l,c,0)}).order(Ex).offset(i);return o(t)},pH=function(t,n,r,s,i,o){if(!t)return null;var l=o?n.reverse():n,c={},d=l.reduce(function(u,m){var h,g=(h=m.type)!==null&&h!==void 0&&h.defaultProps?gt(gt({},m.type.defaultProps),m.props):m.props,x=g.stackId,p=g.hide;if(p)return u;var j=g[r],S=u[j]||{hasStack:!1,stackGroups:{}};if(Et(x)){var y=S.stackGroups[x]||{numericAxisId:r,cateAxisId:s,items:[]};y.items.push(m),S.hasStack=!0,S.stackGroups[x]=y}else S.stackGroups[yd("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[m]};return gt(gt({},u),{},Ts({},j,S))},c),f={};return Object.keys(d).reduce(function(u,m){var h=d[m];if(h.hasStack){var g={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(x,p){var j=h.stackGroups[p];return gt(gt({},x),{},Ts({},p,{numericAxisId:r,cateAxisId:s,items:j.items,stackedData:hH(t,j.items,i)}))},g)}return gt(gt({},u),{},Ts({},m,h))},f)},xH=function(t,n){var r=n.realScaleType,s=n.type,i=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=t.domain();if(!d.length)return null;var f=CW(d,i,l);return t.domain([Od(f),Id(f)]),{niceTicks:f}}if(i&&s==="number"){var u=t.domain(),m=TW(u,i,l);return{niceTicks:m}}return null},iS=function(t){var n=t.axis,r=t.ticks,s=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=hr(o,n.dataKey,n.domain[l]);return Ue(c)?null:n.scale(c)-i/2+s},gH=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return s<=0&&i>=0?0:i<0?i:s}return r[0]},bH=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?gt(gt({},t.type.defaultProps),t.props):t.props,i=s.stackId;if(Et(i)){var o=n[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},yH=function(t){return t.reduce(function(n,r){return[Od(r.concat([n[0]]).filter(he)),Id(r.concat([n[1]]).filter(he))]},[1/0,-1/0])},u3=function(t,n,r){return Object.keys(t).reduce(function(s,i){var o=t[i],l=o.stackedData,c=l.reduce(function(d,f){var u=yH(f.slice(n,r+1));return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},oS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ng=function(t,n,r){if(Le(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(he(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(oS.test(t[0])){var i=+oS.exec(t[0])[1];s[0]=n[0]-i}else Le(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(he(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(lS.test(t[1])){var o=+lS.exec(t[1])[1];s[1]=n[1]+o}else Le(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},Pc=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var i=K0(n,function(u){return u.coordinate}),o=1/0,l=1,c=i.length;lo&&(d=2*Math.PI-d),{radius:l,angle:NH(d),angleInRadian:d}},AH=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(s,i);return{startAngle:n-o*360,endAngle:r-o*360}},CH=function(t,n){var r=n.startAngle,s=n.endAngle,i=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(i,o);return t+l*360},fS=function(t,n){var r=t.x,s=t.y,i=kH({x:r,y:s},n),o=i.radius,l=i.angle,c=n.innerRadius,d=n.outerRadius;if(od)return!1;if(o===0)return!0;var f=AH(n),u=f.startAngle,m=f.endAngle,h=l,g;if(u<=m){for(;h>m;)h-=360;for(;h=u&&h<=m}else{for(;h>u;)h-=360;for(;h=m&&h<=u}return g?uS(uS({},n),{},{radius:o,angle:CH(h,n)}):null};function yo(e){"@babel/helpers - typeof";return yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yo(e)}var TH=["offset"];function PH(e){return IH(e)||_H(e)||EH(e)||MH()}function MH(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EH(e,t){if(e){if(typeof e=="string")return rg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rg(e,t)}}function _H(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IH(e){if(Array.isArray(e))return rg(e)}function rg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t=0?1:-1,y,N;s==="insideStart"?(y=h+S*o,N=x):s==="insideEnd"?(y=g-S*o,N=!x):s==="end"&&(y=g+S*o,N=x),N=j<=0?N:!N;var b=Ut(d,f,p,y),w=Ut(d,f,p,y+(N?1:-1)*359),k="M".concat(b.x,",").concat(b.y,` + A`).concat(p,",").concat(p,",0,1,").concat(N?0:1,`, + `).concat(w.x,",").concat(w.y),A=Ue(t.id)?yd("recharts-radial-line-"):t.id;return U.createElement("text",vo({},r,{dominantBaseline:"central",className:Fe("recharts-radial-bar-label",l)}),U.createElement("defs",null,U.createElement("path",{id:A,d:k})),U.createElement("textPath",{xlinkHref:"#".concat(A)},n))},qH=function(t){var n=t.viewBox,r=t.offset,s=t.position,i=n,o=i.cx,l=i.cy,c=i.innerRadius,d=i.outerRadius,f=i.startAngle,u=i.endAngle,m=(f+u)/2;if(s==="outside"){var h=Ut(o,l,d+r,m),g=h.x,x=h.y;return{x:g,y:x,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var p=(c+d)/2,j=Ut(o,l,p,m),S=j.x,y=j.y;return{x:S,y,textAnchor:"middle",verticalAnchor:"middle"}},VH=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,i=t.position,o=n,l=o.x,c=o.y,d=o.width,f=o.height,u=f>=0?1:-1,m=u*s,h=u>0?"end":"start",g=u>0?"start":"end",x=d>=0?1:-1,p=x*s,j=x>0?"end":"start",S=x>0?"start":"end";if(i==="top"){var y={x:l+d/2,y:c-u*s,textAnchor:"middle",verticalAnchor:h};return Pt(Pt({},y),r?{height:Math.max(c-r.y,0),width:d}:{})}if(i==="bottom"){var N={x:l+d/2,y:c+f+m,textAnchor:"middle",verticalAnchor:g};return Pt(Pt({},N),r?{height:Math.max(r.y+r.height-(c+f),0),width:d}:{})}if(i==="left"){var b={x:l-p,y:c+f/2,textAnchor:j,verticalAnchor:"middle"};return Pt(Pt({},b),r?{width:Math.max(b.x-r.x,0),height:f}:{})}if(i==="right"){var w={x:l+d+p,y:c+f/2,textAnchor:S,verticalAnchor:"middle"};return Pt(Pt({},w),r?{width:Math.max(r.x+r.width-w.x,0),height:f}:{})}var k=r?{width:d,height:f}:{};return i==="insideLeft"?Pt({x:l+p,y:c+f/2,textAnchor:S,verticalAnchor:"middle"},k):i==="insideRight"?Pt({x:l+d-p,y:c+f/2,textAnchor:j,verticalAnchor:"middle"},k):i==="insideTop"?Pt({x:l+d/2,y:c+m,textAnchor:"middle",verticalAnchor:g},k):i==="insideBottom"?Pt({x:l+d/2,y:c+f-m,textAnchor:"middle",verticalAnchor:h},k):i==="insideTopLeft"?Pt({x:l+p,y:c+m,textAnchor:S,verticalAnchor:g},k):i==="insideTopRight"?Pt({x:l+d-p,y:c+m,textAnchor:j,verticalAnchor:g},k):i==="insideBottomLeft"?Pt({x:l+p,y:c+f-m,textAnchor:S,verticalAnchor:h},k):i==="insideBottomRight"?Pt({x:l+d-p,y:c+f-m,textAnchor:j,verticalAnchor:h},k):ii(i)&&(he(i.x)||Ca(i.x))&&(he(i.y)||Ca(i.y))?Pt({x:l+Wa(i.x,d),y:c+Wa(i.y,f),textAnchor:"end",verticalAnchor:"end"},k):Pt({x:l+d/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},k)},UH=function(t){return"cx"in t&&he(t.cx)};function Yt(e){var t=e.offset,n=t===void 0?5:t,r=OH(e,TH),s=Pt({offset:n},r),i=s.viewBox,o=s.position,l=s.value,c=s.children,d=s.content,f=s.className,u=f===void 0?"":f,m=s.textBreakAll;if(!i||Ue(l)&&Ue(c)&&!v.isValidElement(d)&&!Le(d))return null;if(v.isValidElement(d))return v.cloneElement(d,s);var h;if(Le(d)){if(h=v.createElement(d,s),v.isValidElement(h))return h}else h=zH(s);var g=UH(i),x=Ve(s,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return BH(s,h,x);var p=g?qH(s):VH(s);return U.createElement(hc,vo({className:Fe("recharts-label",u)},x,p,{breakAll:m}),h)}Yt.displayName="Label";var m3=function(t){var n=t.cx,r=t.cy,s=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,d=t.innerRadius,f=t.outerRadius,u=t.x,m=t.y,h=t.top,g=t.left,x=t.width,p=t.height,j=t.clockWise,S=t.labelViewBox;if(S)return S;if(he(x)&&he(p)){if(he(u)&&he(m))return{x:u,y:m,width:x,height:p};if(he(h)&&he(g))return{x:h,y:g,width:x,height:p}}return he(u)&&he(m)?{x:u,y:m,width:0,height:0}:he(n)&&he(r)?{cx:n,cy:r,startAngle:i||s||0,endAngle:o||s||0,innerRadius:d||0,outerRadius:f||c||l||0,clockWise:j}:t.viewBox?t.viewBox:{}},GH=function(t,n){return t?t===!0?U.createElement(Yt,{key:"label-implicit",viewBox:n}):Et(t)?U.createElement(Yt,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Yt?v.cloneElement(t,{key:"label-implicit",viewBox:n}):U.createElement(Yt,{key:"label-implicit",content:t,viewBox:n}):Le(t)?U.createElement(Yt,{key:"label-implicit",content:t,viewBox:n}):ii(t)?U.createElement(Yt,vo({viewBox:n},t,{key:"label-implicit"})):null:null},WH=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,i=m3(t),o=Xn(s,Yt).map(function(c,d){return v.cloneElement(c,{viewBox:n||i,key:"label-".concat(d)})});if(!r)return o;var l=GH(t.label,n||i);return[l].concat(PH(o))};Yt.parseViewBox=m3;Yt.renderCallByParent=WH;var tp,hS;function HH(){if(hS)return tp;hS=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return tp=e,tp}var KH=HH();const XH=st(KH);function wo(e){"@babel/helpers - typeof";return wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(e)}var YH=["valueAccessor"],QH=["data","dataKey","clockWise","id","textBreakAll"];function ZH(e){return nK(e)||tK(e)||eK(e)||JH()}function JH(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eK(e,t){if(e){if(typeof e=="string")return ag(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ag(e,t)}}function tK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nK(e){if(Array.isArray(e))return ag(e)}function ag(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function iK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var oK=function(t){return Array.isArray(t.value)?XH(t.value):t.value};function Fa(e){var t=e.valueAccessor,n=t===void 0?oK:t,r=gS(e,YH),s=r.data,i=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,d=gS(r,QH);return!s||!s.length?null:U.createElement(Rt,{className:"recharts-label-list"},s.map(function(f,u){var m=Ue(i)?n(f,u):hr(f&&f.payload,i),h=Ue(l)?{}:{id:"".concat(l,"-").concat(u)};return U.createElement(Yt,Ec({},Ve(f,!0),d,h,{parentViewBox:f.parentViewBox,value:m,textBreakAll:c,viewBox:Yt.parseViewBox(Ue(o)?f:xS(xS({},f),{},{clockWise:o})),key:"label-".concat(u),index:u}))}))}Fa.displayName="LabelList";function lK(e,t){return e?e===!0?U.createElement(Fa,{key:"labelList-implicit",data:t}):U.isValidElement(e)||Le(e)?U.createElement(Fa,{key:"labelList-implicit",data:t,content:e}):ii(e)?U.createElement(Fa,Ec({data:t},e,{key:"labelList-implicit"})):null:null}function cK(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,s=Xn(r,Fa).map(function(o,l){return v.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var i=lK(e.label,t);return[i].concat(ZH(s))}Fa.renderCallByParent=cK;function jo(e){"@babel/helpers - typeof";return jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jo(e)}function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>d),`, + `).concat(u.x,",").concat(u.y,` + `);if(s>0){var h=Ut(n,r,s,o),g=Ut(n,r,s,d);m+="L ".concat(g.x,",").concat(g.y,` + A `).concat(s,",").concat(s,`,0, + `).concat(+(Math.abs(c)>180),",").concat(+(o<=d),`, + `).concat(h.x,",").concat(h.y," Z")}else m+="L ".concat(n,",").concat(r," Z");return m},hK=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,d=t.startAngle,f=t.endAngle,u=Gn(f-d),m=Sl({cx:n,cy:r,radius:i,angle:d,sign:u,cornerRadius:o,cornerIsExternal:c}),h=m.circleTangency,g=m.lineTangency,x=m.theta,p=Sl({cx:n,cy:r,radius:i,angle:f,sign:-u,cornerRadius:o,cornerIsExternal:c}),j=p.circleTangency,S=p.lineTangency,y=p.theta,N=c?Math.abs(d-f):Math.abs(d-f)-x-y;if(N<0)return l?"M ".concat(g.x,",").concat(g.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):h3({cx:n,cy:r,innerRadius:s,outerRadius:i,startAngle:d,endAngle:f});var b="M ".concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(h.x,",").concat(h.y,` + A`).concat(i,",").concat(i,",0,").concat(+(N>180),",").concat(+(u<0),",").concat(j.x,",").concat(j.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(S.x,",").concat(S.y,` + `);if(s>0){var w=Sl({cx:n,cy:r,radius:s,angle:d,sign:u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),k=w.circleTangency,A=w.lineTangency,C=w.theta,F=Sl({cx:n,cy:r,radius:s,angle:f,sign:-u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),D=F.circleTangency,L=F.lineTangency,P=F.theta,H=c?Math.abs(d-f):Math.abs(d-f)-C-P;if(H<0&&o===0)return"".concat(b,"L").concat(n,",").concat(r,"Z");b+="L".concat(L.x,",").concat(L.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(D.x,",").concat(D.y,` + A`).concat(s,",").concat(s,",0,").concat(+(H>180),",").concat(+(u>0),",").concat(k.x,",").concat(k.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(A.x,",").concat(A.y,"Z")}else b+="L".concat(n,",").concat(r,"Z");return b},pK={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},p3=function(t){var n=yS(yS({},pK),t),r=n.cx,s=n.cy,i=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,d=n.cornerIsExternal,f=n.startAngle,u=n.endAngle,m=n.className;if(o0&&Math.abs(f-u)<360?p=hK({cx:r,cy:s,innerRadius:i,outerRadius:o,cornerRadius:Math.min(x,g/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:u}):p=h3({cx:r,cy:s,innerRadius:i,outerRadius:o,startAngle:f,endAngle:u}),U.createElement("path",sg({},Ve(n,!0),{className:h,d:p,role:"img"}))};function No(e){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}function ig(){return ig=Object.assign?Object.assign.bind():function(e){for(var t=1;tCK.call(e,t));function ts(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const MK="__v",EK="__o",_K="_owner",{getOwnPropertyDescriptor:TS,keys:PS}=Object;function IK(e,t){return e.byteLength===t.byteLength&&_c(new Uint8Array(e),new Uint8Array(t))}function OK(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function DK(e,t){return e.byteLength===t.byteLength&&_c(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function RK(e,t){return ts(e.getTime(),t.getTime())}function LK(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function $K(e,t){return e===t}function MS(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.entries();let o,l,c=0;for(;(o=i.next())&&!o.done;){const d=t.entries();let f=!1,u=0;for(;(l=d.next())&&!l.done;){if(s[u]){u++;continue}const m=o.value,h=l.value;if(n.equals(m[0],h[0],c,u,e,t,n)&&n.equals(m[1],h[1],m[0],h[0],e,t,n)){f=s[u]=!0;break}u++}if(!f)return!1;c++}return!0}const zK=ts;function FK(e,t,n){const r=PS(e);let s=r.length;if(PS(t).length!==s)return!1;for(;s-- >0;)if(!x3(e,t,n,r[s]))return!1;return!0}function Ti(e,t,n){const r=CS(e);let s=r.length;if(CS(t).length!==s)return!1;let i,o,l;for(;s-- >0;)if(i=r[s],!x3(e,t,n,i)||(o=TS(e,i),l=TS(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function BK(e,t){return ts(e.valueOf(),t.valueOf())}function qK(e,t){return e.source===t.source&&e.flags===t.flags}function ES(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.values();let o,l;for(;(o=i.next())&&!o.done;){const c=t.values();let d=!1,f=0;for(;(l=c.next())&&!l.done;){if(!s[f]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){d=s[f]=!0;break}f++}if(!d)return!1}return!0}function _c(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function VK(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function x3(e,t,n,r){return(r===_K||r===EK||r===MK)&&(e.$$typeof||t.$$typeof)?!0:PK(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const UK="[object ArrayBuffer]",GK="[object Arguments]",WK="[object Boolean]",HK="[object DataView]",KK="[object Date]",XK="[object Error]",YK="[object Map]",QK="[object Number]",ZK="[object Object]",JK="[object RegExp]",eX="[object Set]",tX="[object String]",nX={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},rX="[object URL]",aX=Object.prototype.toString;function sX({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:d,areRegExpsEqual:f,areSetsEqual:u,areTypedArraysEqual:m,areUrlsEqual:h,unknownTagComparators:g}){return function(p,j,S){if(p===j)return!0;if(p==null||j==null)return!1;const y=typeof p;if(y!==typeof j)return!1;if(y!=="object")return y==="number"?l(p,j,S):y==="function"?i(p,j,S):!1;const N=p.constructor;if(N!==j.constructor)return!1;if(N===Object)return c(p,j,S);if(Array.isArray(p))return t(p,j,S);if(N===Date)return r(p,j,S);if(N===RegExp)return f(p,j,S);if(N===Map)return o(p,j,S);if(N===Set)return u(p,j,S);const b=aX.call(p);if(b===KK)return r(p,j,S);if(b===JK)return f(p,j,S);if(b===YK)return o(p,j,S);if(b===eX)return u(p,j,S);if(b===ZK)return typeof p.then!="function"&&typeof j.then!="function"&&c(p,j,S);if(b===rX)return h(p,j,S);if(b===XK)return s(p,j,S);if(b===GK)return c(p,j,S);if(nX[b])return m(p,j,S);if(b===UK)return e(p,j,S);if(b===HK)return n(p,j,S);if(b===WK||b===QK||b===tX)return d(p,j,S);if(g){let w=g[b];if(!w){const k=TK(p);k&&(w=g[k])}if(w)return w(p,j,S)}return!1}}function iX({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:IK,areArraysEqual:n?Ti:OK,areDataViewsEqual:DK,areDatesEqual:RK,areErrorsEqual:LK,areFunctionsEqual:$K,areMapsEqual:n?sp(MS,Ti):MS,areNumbersEqual:zK,areObjectsEqual:n?Ti:FK,arePrimitiveWrappersEqual:BK,areRegExpsEqual:qK,areSetsEqual:n?sp(ES,Ti):ES,areTypedArraysEqual:n?sp(_c,Ti):_c,areUrlsEqual:VK,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const s=Al(r.areArraysEqual),i=Al(r.areMapsEqual),o=Al(r.areObjectsEqual),l=Al(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return r}function oX(e){return function(t,n,r,s,i,o,l){return e(t,n,l)}}function lX({circular:e,comparator:t,createState:n,equals:r,strict:s}){if(n)return function(l,c){const{cache:d=e?new WeakMap:void 0,meta:f}=n();return t(l,c,{cache:d,equals:r,meta:f,strict:s})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,c){return t(l,c,i)}}const cX=pa();pa({strict:!0});pa({circular:!0});pa({circular:!0,strict:!0});pa({createInternalComparator:()=>ts});pa({strict:!0,createInternalComparator:()=>ts});pa({circular:!0,createInternalComparator:()=>ts});pa({circular:!0,createInternalComparator:()=>ts,strict:!0});function pa(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:s=!1}=e,i=iX(e),o=sX(i),l=n?n(o):oX(o);return lX({circular:t,comparator:o,createState:r,equals:l,strict:s})}function dX(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function _S(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(i){n<0&&(n=i),i-n>t?(e(i),n=-1):dX(s)};requestAnimationFrame(r)}function og(e){"@babel/helpers - typeof";return og=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},og(e)}function uX(e){return pX(e)||hX(e)||mX(e)||fX()}function fX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mX(e,t){if(e){if(typeof e=="string")return IS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IS(e,t)}}function IS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:j<0?0:j},x=function(j){for(var S=j>1?1:j,y=S,N=0;N<8;++N){var b=u(y)-S,w=h(y);if(Math.abs(b-S)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,i=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(f,u,m){var h=-(f-u)*r,g=m*i,x=m+(h-g)*l/1e3,p=m*l/1e3+f;return Math.abs(p-u)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WX(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i=0)&&(n[s]=e[s]);return n}function ip(e){return YX(e)||XX(e)||KX(e)||HX()}function HX(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KX(e,t){if(e){if(typeof e=="string")return fg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fg(e,t)}}function XX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YX(e){if(Array.isArray(e))return fg(e)}function fg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Dc(e){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dc(e)}var oa=(function(e){tY(n,e);var t=nY(n);function n(r,s){var i;QX(this,n),i=t.call(this,r,s);var o=i.props,l=o.isActive,c=o.attributeName,d=o.from,f=o.to,u=o.steps,m=o.children,h=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(pg(i)),i.changeStyle=i.changeStyle.bind(pg(i)),!l||h<=0)return i.state={style:{}},typeof m=="function"&&(i.state={style:f}),hg(i);if(u&&u.length)i.state={style:u[0].style};else if(d){if(typeof m=="function")return i.state={style:d},hg(i);i.state={style:c?Ri({},c,d):d}}else i.state={style:{}};return i}return JX(n,[{key:"componentDidMount",value:function(){var s=this.props,i=s.isActive,o=s.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,d=i.shouldReAnimate,f=i.to,u=i.from,m=this.state.style;if(l){if(!o){var h={style:c?Ri({},c,f):f};this.state&&m&&(c&&m[c]!==f||!c&&m!==f)&&this.setState(h);return}if(!(cX(s.to,f)&&s.canBegin&&s.isActive)){var g=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var x=g||d?u:s.to;if(this.state&&m){var p={style:c?Ri({},c,x):x};(c&&m[c]!==x||!c&&m!==x)&&this.setState(p)}this.runAnimation(zn(zn({},this.props),{},{from:x,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var i=this,o=s.from,l=s.to,c=s.duration,d=s.easing,f=s.begin,u=s.onAnimationEnd,m=s.onAnimationStart,h=VX(o,l,_X(d),c,this.changeStyle),g=function(){i.stopJSAnimation=h()};this.manager.start([m,f,g,c,u])}},{key:"runStepAnimation",value:function(s){var i=this,o=s.steps,l=s.begin,c=s.onAnimationStart,d=o[0],f=d.style,u=d.duration,m=u===void 0?0:u,h=function(x,p,j){if(j===0)return x;var S=p.duration,y=p.easing,N=y===void 0?"ease":y,b=p.style,w=p.properties,k=p.onAnimationEnd,A=j>0?o[j-1]:p,C=w||Object.keys(b);if(typeof N=="function"||N==="spring")return[].concat(ip(x),[i.runJSAnimation.bind(i,{from:A.style,to:b,duration:S,easing:N}),S]);var F=RS(C,S,N),D=zn(zn(zn({},A.style),b),{},{transition:F});return[].concat(ip(x),[D,S,k]).filter(vX)};return this.manager.start([c].concat(ip(o.reduce(h,[f,Math.max(m,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=xX());var i=s.begin,o=s.duration,l=s.attributeName,c=s.to,d=s.easing,f=s.onAnimationStart,u=s.onAnimationEnd,m=s.steps,h=s.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof d=="function"||typeof h=="function"||d==="spring"){this.runJSAnimation(s);return}if(m.length>1){this.runStepAnimation(s);return}var x=l?Ri({},l,c):c,p=RS(Object.keys(x),o,d);g.start([f,i,zn(zn({},x),{},{transition:p}),o,u])}},{key:"render",value:function(){var s=this.props,i=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=GX(s,UX),d=v.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!l||d===0||o<=0)return i;var u=function(h){var g=h.props,x=g.style,p=x===void 0?{}:x,j=g.className,S=v.cloneElement(h,zn(zn({},c),{},{style:zn(zn({},p),f),className:j}));return S};return d===1?u(v.Children.only(i)):U.createElement("div",null,v.Children.map(i,function(m){return u(m)}))}}]),n})(v.PureComponent);oa.displayName="Animate";oa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};oa.propTypes={from:We.oneOfType([We.object,We.string]),to:We.oneOfType([We.object,We.string]),attributeName:We.string,duration:We.number,begin:We.number,easing:We.oneOfType([We.string,We.func]),steps:We.arrayOf(We.shape({duration:We.number.isRequired,style:We.object.isRequired,easing:We.oneOfType([We.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),We.func]),properties:We.arrayOf("string"),onAnimationEnd:We.func})),children:We.oneOfType([We.node,We.func]),isActive:We.bool,canBegin:We.bool,onAnimationEnd:We.func,shouldReAnimate:We.bool,onAnimationStart:We.func,onAnimationReStart:We.func};function Ao(e){"@babel/helpers - typeof";return Ao=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(e)}function Rc(){return Rc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,c=r>=0?1:-1,d=s>=0&&r>=0||s<0&&r<0?1:0,f;if(o>0&&i instanceof Array){for(var u=[0,0,0,0],m=0,h=4;mo?o:i[m];f="M".concat(t,",").concat(n+l*u[0]),u[0]>0&&(f+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(d,",").concat(t+c*u[0],",").concat(n)),f+="L ".concat(t+r-c*u[1],",").concat(n),u[1]>0&&(f+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(d,`, + `).concat(t+r,",").concat(n+l*u[1])),f+="L ".concat(t+r,",").concat(n+s-l*u[2]),u[2]>0&&(f+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(d,`, + `).concat(t+r-c*u[2],",").concat(n+s)),f+="L ".concat(t+c*u[3],",").concat(n+s),u[3]>0&&(f+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(d,`, + `).concat(t,",").concat(n+s-l*u[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var g=Math.min(o,i);f="M ".concat(t,",").concat(n+l*g,` + A `).concat(g,",").concat(g,",0,0,").concat(d,",").concat(t+c*g,",").concat(n,` + L `).concat(t+r-c*g,",").concat(n,` + A `).concat(g,",").concat(g,",0,0,").concat(d,",").concat(t+r,",").concat(n+l*g,` + L `).concat(t+r,",").concat(n+s-l*g,` + A `).concat(g,",").concat(g,",0,0,").concat(d,",").concat(t+r-c*g,",").concat(n+s,` + L `).concat(t+c*g,",").concat(n+s,` + A `).concat(g,",").concat(g,",0,0,").concat(d,",").concat(t,",").concat(n+s-l*g," Z")}else f="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return f},fY=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,i=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var d=Math.min(i,i+l),f=Math.max(i,i+l),u=Math.min(o,o+c),m=Math.max(o,o+c);return r>=d&&r<=f&&s>=u&&s<=m}return!1},mY={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Nb=function(t){var n=US(US({},mY),t),r=v.useRef(),s=v.useState(-1),i=aY(s,2),o=i[0],l=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&l(N)}catch{}},[]);var c=n.x,d=n.y,f=n.width,u=n.height,m=n.radius,h=n.className,g=n.animationEasing,x=n.animationDuration,p=n.animationBegin,j=n.isAnimationActive,S=n.isUpdateAnimationActive;if(c!==+c||d!==+d||f!==+f||u!==+u||f===0||u===0)return null;var y=Fe("recharts-rectangle",h);return S?U.createElement(oa,{canBegin:o>0,from:{width:f,height:u,x:c,y:d},to:{width:f,height:u,x:c,y:d},duration:x,animationEasing:g,isActive:S},function(N){var b=N.width,w=N.height,k=N.x,A=N.y;return U.createElement(oa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:x,isActive:j,easing:g},U.createElement("path",Rc({},Ve(n,!0),{className:y,d:GS(k,A,b,w,m),ref:r})))}):U.createElement("path",Rc({},Ve(n,!0),{className:y,d:GS(c,d,f,u,m)}))};function xg(){return xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var wY=function(t,n,r,s,i,o){return"M".concat(t,",").concat(i,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},jY=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,i=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,d=c===void 0?0:c,f=t.width,u=f===void 0?0:f,m=t.height,h=m===void 0?0:m,g=t.className,x=yY(t,hY),p=pY({x:r,y:i,top:l,left:d,width:u,height:h},x);return!he(r)||!he(i)||!he(u)||!he(h)||!he(l)||!he(d)?null:U.createElement("path",gg({},Ve(p,!0),{className:Fe("recharts-cross",g),d:wY(r,i,u,h,l,d)}))},op,HS;function NY(){if(HS)return op;HS=1;var e=UT(),t=e(Object.getPrototypeOf,Object);return op=t,op}var lp,KS;function SY(){if(KS)return lp;KS=1;var e=$r(),t=NY(),n=zr(),r="[object Object]",s=Function.prototype,i=Object.prototype,o=s.toString,l=i.hasOwnProperty,c=o.call(Object);function d(f){if(!n(f)||e(f)!=r)return!1;var u=t(f);if(u===null)return!0;var m=l.call(u,"constructor")&&u.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==c}return lp=d,lp}var kY=SY();const AY=st(kY);var cp,XS;function CY(){if(XS)return cp;XS=1;var e=$r(),t=zr(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return cp=r,cp}var TY=CY();const PY=st(TY);function To(e){"@babel/helpers - typeof";return To=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},To(e)}function Lc(){return Lc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:d},to:{upperWidth:f,lowerWidth:u,height:m,x:c,y:d},duration:x,animationEasing:g,isActive:j},function(y){var N=y.upperWidth,b=y.lowerWidth,w=y.height,k=y.x,A=y.y;return U.createElement(oa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:x,easing:g},U.createElement("path",Lc({},Ve(n,!0),{className:S,d:JS(k,A,N,b,w),ref:r})))}):U.createElement("g",null,U.createElement("path",Lc({},Ve(n,!0),{className:S,d:JS(c,d,f,u,m)})))},FY=["option","shapeType","propTransformer","activeClassName","isActive"];function Po(e){"@babel/helpers - typeof";return Po=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Po(e)}function BY(e,t){if(e==null)return{};var n=qY(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function $c(e){for(var t=1;t0&&r.handleDrag(s.changedTouches[0])}),gn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,i=s.endIndex,o=s.onDragEnd,l=s.startIndex;o?.({endIndex:i,startIndex:l})}),r.detachDragEndListener()}),gn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),gn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),gn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),gn(r,"handleSlideDragStart",function(s){var i=dk(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return xQ(t,e),fQ(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,i=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,d=l.data,f=d.length-1,u=Math.min(s,i),m=Math.max(s,i),h=t.getIndexInRange(o,u),g=t.getIndexInRange(o,m);return{startIndex:h-h%c,endIndex:g===f?f:g-g%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,i=s.data,o=s.tickFormatter,l=s.dataKey,c=hr(i[r],l,r);return Le(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var s=this.state,i=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,d=c.x,f=c.width,u=c.travellerWidth,m=c.startIndex,h=c.endIndex,g=c.onChange,x=r.pageX-i;x>0?x=Math.min(x,d+f-u-l,d+f-u-o):x<0&&(x=Math.max(x,d-o,d-l));var p=this.getIndex({startX:o+x,endX:l+x});(p.startIndex!==m||p.endIndex!==h)&&g&&g(p),this.setState({startX:o+x,endX:l+x,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var i=dk(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,i=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,d=this.state[o],f=this.props,u=f.x,m=f.width,h=f.travellerWidth,g=f.onChange,x=f.gap,p=f.data,j={startX:this.state.startX,endX:this.state.endX},S=r.pageX-i;S>0?S=Math.min(S,u+m-h-d):S<0&&(S=Math.max(S,u-d)),j[o]=d+S;var y=this.getIndex(j),N=y.startIndex,b=y.endIndex,w=function(){var A=p.length-1;return o==="startX"&&(l>c?N%x===0:b%x===0)||lc?b%x===0:N%x===0)||l>c&&b===A};this.setState(gn(gn({},o,d+S),"brushMoveStartX",r.pageX),function(){g&&w()&&g(y)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var i=this,o=this.state,l=o.scaleValues,c=o.startX,d=o.endX,f=this.state[s],u=l.indexOf(f);if(u!==-1){var m=u+r;if(!(m===-1||m>=l.length)){var h=l[m];s==="startX"&&h>=d||s==="endX"&&h<=c||this.setState(gn({},s,h),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,i=r.y,o=r.width,l=r.height,c=r.fill,d=r.stroke;return U.createElement("rect",{stroke:d,fill:c,x:s,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,i=r.y,o=r.width,l=r.height,c=r.data,d=r.children,f=r.padding,u=v.Children.only(d);return u?U.cloneElement(u,{x:s,y:i,width:o,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var i,o,l=this,c=this.props,d=c.y,f=c.travellerWidth,u=c.height,m=c.traveller,h=c.ariaLabel,g=c.data,x=c.startIndex,p=c.endIndex,j=Math.max(r,this.props.x),S=hp(hp({},Ve(this.props,!1)),{},{x:j,y:d,width:f,height:u}),y=h||"Min value: ".concat((i=g[x])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=g[p])===null||o===void 0?void 0:o.name);return U.createElement(Rt,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),l.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,S))}},{key:"renderSlide",value:function(r,s){var i=this.props,o=i.y,l=i.height,c=i.stroke,d=i.travellerWidth,f=Math.min(r,s)+d,u=Math.max(Math.abs(s-r)-d,0);return U.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:u,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,i=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,d=r.stroke,f=this.state,u=f.startX,m=f.endX,h=5,g={pointerEvents:"none",fill:d};return U.createElement(Rt,{className:"recharts-brush-texts"},U.createElement(hc,Fc({textAnchor:"end",verticalAnchor:"middle",x:Math.min(u,m)-h,y:o+l/2},g),this.getTextOfTick(s)),U.createElement(hc,Fc({textAnchor:"start",verticalAnchor:"middle",x:Math.max(u,m)+c+h,y:o+l/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,s=r.data,i=r.className,o=r.children,l=r.x,c=r.y,d=r.width,f=r.height,u=r.alwaysShowText,m=this.state,h=m.startX,g=m.endX,x=m.isTextActive,p=m.isSlideMoving,j=m.isTravellerMoving,S=m.isTravellerFocused;if(!s||!s.length||!he(l)||!he(c)||!he(d)||!he(f)||d<=0||f<=0)return null;var y=Fe("recharts-brush",i),N=U.Children.count(o)===1,b=dQ("userSelect","none");return U.createElement(Rt,{className:y,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(x||p||j||S||u)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,i=r.y,o=r.width,l=r.height,c=r.stroke,d=Math.floor(i+l/2)-1;return U.createElement(U.Fragment,null,U.createElement("rect",{x:s,y:i,width:o,height:l,fill:c,stroke:"none"}),U.createElement("line",{x1:s+1,y1:d,x2:s+o-1,y2:d,fill:"none",stroke:"#fff"}),U.createElement("line",{x1:s+1,y1:d+2,x2:s+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var i;return U.isValidElement(r)?i=U.cloneElement(r,s):Le(r)?i=r(s):i=t.renderDefaultTraveller(s),i}},{key:"getDerivedStateFromProps",value:function(r,s){var i=r.data,o=r.width,l=r.x,c=r.travellerWidth,d=r.updateId,f=r.startIndex,u=r.endIndex;if(i!==s.prevData||d!==s.prevUpdateId)return hp({prevData:i,prevTravellerWidth:c,prevUpdateId:d,prevX:l,prevWidth:o},i&&i.length?bQ({data:i,width:o,x:l,travellerWidth:c,startIndex:f,endIndex:u}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var m=s.scale.domain().map(function(h){return s.scale(h)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:d,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(r,s){for(var i=r.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}])})(v.PureComponent);gn(Gs,"displayName","Brush");gn(Gs,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var pp,uk;function yQ(){if(uk)return pp;uk=1;var e=H0();function t(n,r){var s;return e(n,function(i,o,l){return s=r(i,o,l),!s}),!!s}return pp=t,pp}var xp,fk;function vQ(){if(fk)return xp;fk=1;var e=LT(),t=fa(),n=yQ(),r=hn(),s=Ad();function i(o,l,c){var d=r(o)?e:n;return c&&s(o,l,c)&&(l=void 0),d(o,t(l,3))}return xp=i,xp}var wQ=vQ();const jQ=st(wQ);var dr=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},gp,mk;function NQ(){if(mk)return gp;mk=1;var e=tP();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return gp=t,gp}var bp,hk;function SQ(){if(hk)return bp;hk=1;var e=NQ(),t=JT(),n=fa();function r(s,i){var o={};return i=n(i,3),t(s,function(l,c,d){e(o,c,i(l,c,d))}),o}return bp=r,bp}var kQ=SQ();const AQ=st(kQ);var yp,pk;function CQ(){if(pk)return yp;pk=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function LQ(e,t){var n=e.x,r=e.y,s=DQ(e,EQ),i="".concat(n),o=parseInt(i,10),l="".concat(r),c=parseInt(l,10),d="".concat(t.height||s.height),f=parseInt(d,10),u="".concat(t.width||s.width),m=parseInt(u,10);return Pi(Pi(Pi(Pi(Pi({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:m,name:t.name,radius:t.radius})}function yk(e){return U.createElement(XY,yg({shapeType:"rectangle",propTransformer:LQ,activeClassName:"recharts-active-bar"},e))}var $Q=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var i=he(r)||G7(r);return i?t(r,s):(i||Ka(),n)}},zQ=["value","background"],P3;function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function FQ(e,t){if(e==null)return{};var n=BQ(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(Y)0&&Math.abs(H)0&&(P=Math.min((I||0)-(H[Z-1]||0),P))}),Number.isFinite(P)){var Y=P/L,V=x.layout==="vertical"?r.height:r.width;if(x.padding==="gap"&&(k=Y*V/2),x.padding==="no-gap"){var O=Wa(t.barCategoryGap,Y*V),E=Y*V/2;k=E-O-(E-O)/V*O}}}s==="xAxis"?A=[r.left+(y.left||0)+(k||0),r.left+r.width-(y.right||0)-(k||0)]:s==="yAxis"?A=c==="horizontal"?[r.top+r.height-(y.bottom||0),r.top+(y.top||0)]:[r.top+(y.top||0)+(k||0),r.top+r.height-(y.bottom||0)-(k||0)]:A=x.range,b&&(A=[A[1],A[0]]);var B=oH(x,i,m),T=B.scale,M=B.realScaleType;T.domain(j).range(A),lH(T);var K=xH(T,qn(qn({},x),{},{realScaleType:M}));s==="xAxis"?(D=p==="top"&&!N||p==="bottom"&&N,C=r.left,F=u[w]-D*x.height):s==="yAxis"&&(D=p==="left"&&!N||p==="right"&&N,C=u[w]-D*x.width,F=r.top);var X=qn(qn(qn({},x),K),{},{realScaleType:M,x:C,y:F,scale:T,width:s==="xAxis"?r.width:x.width,height:s==="yAxis"?r.height:x.height});return X.bandSize=Pc(X,K),!x.hide&&s==="xAxis"?u[w]+=(D?-1:1)*X.height:x.hide||(u[w]+=(D?-1:1)*X.width),qn(qn({},h),{},Fd({},g,X))},{})},I3=function(t,n){var r=t.x,s=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(s,o),width:Math.abs(i-r),height:Math.abs(o-s)}},JQ=function(t){var n=t.x1,r=t.y1,s=t.x2,i=t.y2;return I3({x:n,y:r},{x:s,y:i})},O3=(function(){function e(t){XQ(this,e),this.scale=t}return YQ(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],i=r[r.length-1];return s<=i?n>=s&&n<=i:n>=i&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])})();Fd(O3,"EPS",1e-4);var Sb=function(t){var n=Object.keys(t).reduce(function(r,s){return qn(qn({},r),{},Fd({},s,O3.create(t[s])))},{});return qn(qn({},n),{},{apply:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return AQ(s,function(c,d){return n[d].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return T3(s,function(i,o){return n[o].isInRange(i)})}})};function eZ(e){return(e%180+180)%180}var tZ=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=eZ(s),o=i*Math.PI/180,l=Math.atan(r/n),c=o>l&&o-1?c[d?i[f]:f]:void 0}}return jp=r,jp}var Np,kk;function rZ(){if(kk)return Np;kk=1;var e=S3();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return Np=t,Np}var Sp,Ak;function aZ(){if(Ak)return Sp;Ak=1;var e=KT(),t=fa(),n=rZ(),r=Math.max;function s(i,o,l){var c=i==null?0:i.length;if(!c)return-1;var d=l==null?0:n(l);return d<0&&(d=r(c+d,0)),e(i,t(o,3),d)}return Sp=s,Sp}var kp,Ck;function sZ(){if(Ck)return kp;Ck=1;var e=nZ(),t=aZ(),n=e(t);return kp=n,kp}var iZ=sZ();const oZ=st(iZ);var lZ=dT();const cZ=st(lZ);var dZ=cZ(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),kb=v.createContext(void 0),Ab=v.createContext(void 0),D3=v.createContext(void 0),R3=v.createContext({}),L3=v.createContext(void 0),$3=v.createContext(0),z3=v.createContext(0),Tk=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,i=n.offset,o=t.clipPathId,l=t.children,c=t.width,d=t.height,f=dZ(i);return U.createElement(kb.Provider,{value:r},U.createElement(Ab.Provider,{value:s},U.createElement(R3.Provider,{value:i},U.createElement(D3.Provider,{value:f},U.createElement(L3.Provider,{value:o},U.createElement($3.Provider,{value:d},U.createElement(z3.Provider,{value:c},l)))))))},uZ=function(){return v.useContext(L3)},F3=function(t){var n=v.useContext(kb);n==null&&Ka();var r=n[t];return r==null&&Ka(),r},fZ=function(){var t=v.useContext(kb);return Wr(t)},mZ=function(){var t=v.useContext(Ab),n=oZ(t,function(r){return T3(r.domain,Number.isFinite)});return n||Wr(t)},B3=function(t){var n=v.useContext(Ab);n==null&&Ka();var r=n[t];return r==null&&Ka(),r},hZ=function(){var t=v.useContext(D3);return t},pZ=function(){return v.useContext(R3)},Cb=function(){return v.useContext(z3)},Tb=function(){return v.useContext($3)};function Hs(e){"@babel/helpers - typeof";return Hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hs(e)}function xZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gZ(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*s)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-s)<=0}function ZZ(e,t){return K3(e,t+1)}function JZ(e,t,n,r,s){for(var i=(r||[]).slice(),o=t.start,l=t.end,c=0,d=1,f=o,u=function(){var g=r?.[c];if(g===void 0)return{v:K3(r,d)};var x=c,p,j=function(){return p===void 0&&(p=n(g,x)),p},S=g.coordinate,y=c===0||Hc(e,S,j,f,l);y||(c=0,f=o,d+=1),y&&(f=S+e*(j()/2+s),c+=d)},m;d<=i.length;)if(m=u(),m)return m.v;return[]}function Oo(e){"@babel/helpers - typeof";return Oo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oo(e)}function Rk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t0?h.coordinate-p*e:h.coordinate})}else i[m]=h=Xt(Xt({},h),{},{tickCoord:h.coordinate});var j=Hc(e,h.tickCoord,x,l,c);j&&(c=h.tickCoord-e*(x()/2+s),i[m]=Xt(Xt({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)d(f);return i}function aJ(e,t,n,r,s,i){var o=(r||[]).slice(),l=o.length,c=t.start,d=t.end;if(i){var f=r[l-1],u=n(f,l-1),m=e*(f.coordinate+e*u/2-d);o[l-1]=f=Xt(Xt({},f),{},{tickCoord:m>0?f.coordinate-m*e:f.coordinate});var h=Hc(e,f.tickCoord,function(){return u},c,d);h&&(d=f.tickCoord-e*(u/2+s),o[l-1]=Xt(Xt({},f),{},{isShow:!0}))}for(var g=i?l-1:l,x=function(S){var y=o[S],N,b=function(){return N===void 0&&(N=n(y,S)),N};if(S===0){var w=e*(y.coordinate-e*b()/2-c);o[S]=y=Xt(Xt({},y),{},{tickCoord:w<0?y.coordinate-w*e:y.coordinate})}else o[S]=y=Xt(Xt({},y),{},{tickCoord:y.coordinate});var k=Hc(e,y.tickCoord,b,c,d);k&&(c=y.tickCoord+e*(b()/2+s),o[S]=Xt(Xt({},y),{},{isShow:!0}))},p=0;p=2?Gn(s[1].coordinate-s[0].coordinate):1,j=QZ(i,p,h);return c==="equidistantPreserveStart"?JZ(p,j,x,s,o):(c==="preserveStart"||c==="preserveStartEnd"?m=aJ(p,j,x,s,o,c==="preserveStartEnd"):m=rJ(p,j,x,s,o),m.filter(function(S){return S.isShow}))}var sJ=["viewBox"],iJ=["viewBox"],oJ=["ticks"];function Ys(e){"@babel/helpers - typeof";return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ys(e)}function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $k(e,t){for(var n=0;n0?c(this.props):c(h)),o<=0||l<=0||!g||!g.length?null:U.createElement(Rt,{className:Fe("recharts-cartesian-axis",d),ref:function(p){r.layerReference=p}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Yt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,i){var o,l=Fe(s.className,"recharts-cartesian-axis-tick-value");return U.isValidElement(r)?o=U.cloneElement(r,Tt(Tt({},s),{},{className:l})):Le(r)?o=r(Tt(Tt({},s),{},{className:l})):o=U.createElement(hc,ws({},s,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);_b(ui,"displayName","CartesianAxis");_b(ui,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var xJ=["x1","y1","x2","y2","key"],gJ=["offset"];function Xa(e){"@babel/helpers - typeof";return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xa(e)}function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var jJ=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,i=t.y,o=t.width,l=t.height,c=t.ry;return U.createElement("rect",{x:s,y:i,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Q3(e,t){var n;if(U.isValidElement(e))n=U.cloneElement(e,t);else if(Le(e))n=e(t);else{var r=t.x1,s=t.y1,i=t.x2,o=t.y2,l=t.key,c=Fk(t,xJ),d=Ve(c,!1);d.offset;var f=Fk(d,gJ);n=U.createElement("line",Ma({},f,{x1:r,y1:s,x2:i,y2:o,fill:"none",key:l}))}return n}function NJ(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,i=e.horizontalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(l,c){var d=Qt(Qt({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return Q3(s,d)});return U.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function SJ(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,i=e.verticalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(l,c){var d=Qt(Qt({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return Q3(s,d)});return U.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function kJ(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,i=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,d=c===void 0?!0:c;if(!d||!t||!t.length)return null;var f=l.map(function(m){return Math.round(m+s-s)}).sort(function(m,h){return m-h});s!==f[0]&&f.unshift(0);var u=f.map(function(m,h){var g=!f[h+1],x=g?s+o-m:f[h+1]-m;if(x<=0)return null;var p=h%t.length;return U.createElement("rect",{key:"react-".concat(h),y:m,x:r,height:x,width:i,stroke:"none",fill:t[p],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return U.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function AJ(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,i=e.x,o=e.y,l=e.width,c=e.height,d=e.verticalPoints;if(!n||!r||!r.length)return null;var f=d.map(function(m){return Math.round(m+i-i)}).sort(function(m,h){return m-h});i!==f[0]&&f.unshift(0);var u=f.map(function(m,h){var g=!f[h+1],x=g?i+l-m:f[h+1]-m;if(x<=0)return null;var p=h%r.length;return U.createElement("rect",{key:"react-".concat(h),x:m,y:o,width:x,height:c,stroke:"none",fill:r[p],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return U.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var CJ=function(t,n){var r=t.xAxis,s=t.width,i=t.height,o=t.offset;return d3(Eb(Qt(Qt(Qt({},ui.defaultProps),r),{},{ticks:kr(r,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.left,o.left+o.width,n)},TJ=function(t,n){var r=t.yAxis,s=t.width,i=t.height,o=t.offset;return d3(Eb(Qt(Qt(Qt({},ui.defaultProps),r),{},{ticks:kr(r,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.top,o.top+o.height,n)},us={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Tg(e){var t,n,r,s,i,o,l=Cb(),c=Tb(),d=pZ(),f=Qt(Qt({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:us.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:us.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:us.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:us.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:us.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:us.verticalFill,x:he(e.x)?e.x:d.left,y:he(e.y)?e.y:d.top,width:he(e.width)?e.width:d.width,height:he(e.height)?e.height:d.height}),u=f.x,m=f.y,h=f.width,g=f.height,x=f.syncWithTicks,p=f.horizontalValues,j=f.verticalValues,S=fZ(),y=mZ();if(!he(h)||h<=0||!he(g)||g<=0||!he(u)||u!==+u||!he(m)||m!==+m)return null;var N=f.verticalCoordinatesGenerator||CJ,b=f.horizontalCoordinatesGenerator||TJ,w=f.horizontalPoints,k=f.verticalPoints;if((!w||!w.length)&&Le(b)){var A=p&&p.length,C=b({yAxis:y?Qt(Qt({},y),{},{ticks:A?p:y.ticks}):void 0,width:l,height:c,offset:d},A?!0:x);Pr(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Xa(C),"]")),Array.isArray(C)&&(w=C)}if((!k||!k.length)&&Le(N)){var F=j&&j.length,D=N({xAxis:S?Qt(Qt({},S),{},{ticks:F?j:S.ticks}):void 0,width:l,height:c,offset:d},F?!0:x);Pr(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Xa(D),"]")),Array.isArray(D)&&(k=D)}return U.createElement("g",{className:"recharts-cartesian-grid"},U.createElement(jJ,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),U.createElement(NJ,Ma({},f,{offset:d,horizontalPoints:w,xAxis:S,yAxis:y})),U.createElement(SJ,Ma({},f,{offset:d,verticalPoints:k,xAxis:S,yAxis:y})),U.createElement(kJ,Ma({},f,{horizontalPoints:w})),U.createElement(AJ,Ma({},f,{verticalPoints:k})))}Tg.displayName="CartesianGrid";function Qs(e){"@babel/helpers - typeof";return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function PJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MJ(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yee(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?o:t&&t.length&&he(s)&&he(i)?t.slice(s,i+1):[]};function dM(e){return e==="number"?[0,"auto"]:void 0}var Lg=function(t,n,r,s){var i=t.graphicalItems,o=t.tooltipAxis,l=Gd(n,t);return r<0||!i||!i.length||r>=l.length?null:i.reduce(function(c,d){var f,u=(f=d.props.data)!==null&&f!==void 0?f:n;u&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(u=u.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var h=u===void 0?l:u;m=jx(h,o.dataKey,s)}else m=u&&u[r]||l[r];return m?[].concat(ei(c),[f3(d,m)]):c},[])},Hk=function(t,n,r,s){var i=s||{x:t.chartX,y:t.chartY},o=Eee(i,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,d=t.tooltipTicks,f=tH(o,l,d,c);if(f>=0&&d){var u=d[f]&&d[f].value,m=Lg(t,n,f,u),h=_ee(r,l,f,i);return{activeTooltipIndex:f,activeLabel:u,activePayload:m,activeCoordinate:h}}return null},Iee=function(t,n){var r=n.axes,s=n.graphicalItems,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,f=t.layout,u=t.children,m=t.stackOffset,h=c3(f,i);return r.reduce(function(g,x){var p,j=x.type.defaultProps!==void 0?le(le({},x.type.defaultProps),x.props):x.props,S=j.type,y=j.dataKey,N=j.allowDataOverflow,b=j.allowDuplicatedCategory,w=j.scale,k=j.ticks,A=j.includeHidden,C=j[o];if(g[C])return g;var F=Gd(t.data,{graphicalItems:s.filter(function(K){var X,I=o in K.props?K.props[o]:(X=K.type.defaultProps)===null||X===void 0?void 0:X[o];return I===C}),dataStartIndex:c,dataEndIndex:d}),D=F.length,L,P,H;see(j.domain,N,S)&&(L=ng(j.domain,null,N),h&&(S==="number"||w!=="auto")&&(H=Ui(F,y,"category")));var Y=dM(S);if(!L||L.length===0){var V,O=(V=j.domain)!==null&&V!==void 0?V:Y;if(y){if(L=Ui(F,y,S),S==="category"&&h){var E=H7(L);b&&E?(P=L,L=zc(0,D)):b||(L=cS(O,L,x).reduce(function(K,X){return K.indexOf(X)>=0?K:[].concat(ei(K),[X])},[]))}else if(S==="category")b?L=L.filter(function(K){return K!==""&&!Ue(K)}):L=cS(O,L,x).reduce(function(K,X){return K.indexOf(X)>=0||X===""||Ue(X)?K:[].concat(ei(K),[X])},[]);else if(S==="number"){var B=iH(F,s.filter(function(K){var X,I,Z=o in K.props?K.props[o]:(X=K.type.defaultProps)===null||X===void 0?void 0:X[o],ne="hide"in K.props?K.props.hide:(I=K.type.defaultProps)===null||I===void 0?void 0:I.hide;return Z===C&&(A||!ne)}),y,i,f);B&&(L=B)}h&&(S==="number"||w!=="auto")&&(H=Ui(F,y,"category"))}else h?L=zc(0,D):l&&l[C]&&l[C].hasStack&&S==="number"?L=m==="expand"?[0,1]:u3(l[C].stackGroups,c,d):L=l3(F,s.filter(function(K){var X=o in K.props?K.props[o]:K.type.defaultProps[o],I="hide"in K.props?K.props.hide:K.type.defaultProps.hide;return X===C&&(A||!I)}),S,f,!0);if(S==="number")L=Og(u,L,C,i,k),O&&(L=ng(O,L,N));else if(S==="category"&&O){var T=O,M=L.every(function(K){return T.indexOf(K)>=0});M&&(L=T)}}return le(le({},g),{},Pe({},C,le(le({},j),{},{axisType:i,domain:L,categoricalDomain:H,duplicateDomain:P,originalDomain:(p=j.domain)!==null&&p!==void 0?p:Y,isCategorical:h,layout:f})))},{})},Oee=function(t,n){var r=n.graphicalItems,s=n.Axis,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,f=t.layout,u=t.children,m=Gd(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:d}),h=m.length,g=c3(f,i),x=-1;return r.reduce(function(p,j){var S=j.type.defaultProps!==void 0?le(le({},j.type.defaultProps),j.props):j.props,y=S[o],N=dM("number");if(!p[y]){x++;var b;return g?b=zc(0,h):l&&l[y]&&l[y].hasStack?(b=u3(l[y].stackGroups,c,d),b=Og(u,b,y,i)):(b=ng(N,l3(m,r.filter(function(w){var k,A,C=o in w.props?w.props[o]:(k=w.type.defaultProps)===null||k===void 0?void 0:k[o],F="hide"in w.props?w.props.hide:(A=w.type.defaultProps)===null||A===void 0?void 0:A.hide;return C===y&&!F}),"number",f),s.defaultProps.allowDataOverflow),b=Og(u,b,y,i)),le(le({},p),{},Pe({},y,le(le({axisType:i},s.defaultProps),{},{hide:!0,orientation:In(Pee,"".concat(i,".").concat(x%2),null),domain:b,originalDomain:N,isCategorical:g,layout:f})))}return p},{})},Dee=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,f=t.children,u="".concat(s,"Id"),m=Xn(f,i),h={};return m&&m.length?h=Iee(t,{axes:m,graphicalItems:o,axisType:s,axisIdKey:u,stackGroups:l,dataStartIndex:c,dataEndIndex:d}):o&&o.length&&(h=Oee(t,{Axis:i,graphicalItems:o,axisType:s,axisIdKey:u,stackGroups:l,dataStartIndex:c,dataEndIndex:d})),h},Ree=function(t){var n=Wr(t),r=kr(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:K0(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Pc(n,r)}},Kk=function(t){var n=t.children,r=t.defaultShowTooltip,s=bn(n,Gs),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(i=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},Lee=function(t){return!t||!t.length?!1:t.some(function(n){var r=Tr(n&&n.type);return r&&r.indexOf("Bar")>=0})},Xk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},$ee=function(t,n){var r=t.props,s=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,d=r.width,f=r.height,u=r.children,m=r.margin||{},h=bn(u,Gs),g=bn(u,As),x=Object.keys(c).reduce(function(b,w){var k=c[w],A=k.orientation;return!k.mirror&&!k.hide?le(le({},b),{},Pe({},A,b[A]+k.width)):b},{left:m.left||0,right:m.right||0}),p=Object.keys(o).reduce(function(b,w){var k=o[w],A=k.orientation;return!k.mirror&&!k.hide?le(le({},b),{},Pe({},A,In(b,"".concat(A))+k.height)):b},{top:m.top||0,bottom:m.bottom||0}),j=le(le({},p),x),S=j.bottom;h&&(j.bottom+=h.props.height||Gs.defaultProps.height),g&&n&&(j=aH(j,s,r,n));var y=d-j.left-j.right,N=f-j.top-j.bottom;return le(le({brushBottom:S},j),{},{width:Math.max(y,0),height:Math.max(N,0)})},zee=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Fee=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,i=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,d=t.legendContent,f=t.formatAxisMap,u=t.defaultProps,m=function(j,S){var y=S.graphicalItems,N=S.stackGroups,b=S.offset,w=S.updateId,k=S.dataStartIndex,A=S.dataEndIndex,C=j.barSize,F=j.layout,D=j.barGap,L=j.barCategoryGap,P=j.maxBarSize,H=Xk(F),Y=H.numericAxisName,V=H.cateAxisName,O=Lee(y),E=[];return y.forEach(function(B,T){var M=Gd(j.data,{graphicalItems:[B],dataStartIndex:k,dataEndIndex:A}),K=B.type.defaultProps!==void 0?le(le({},B.type.defaultProps),B.props):B.props,X=K.dataKey,I=K.maxBarSize,Z=K["".concat(Y,"Id")],ne=K["".concat(V,"Id")],ee={},$=c.reduce(function(we,Ce){var Se=S["".concat(Ce.axisType,"Map")],ct=K["".concat(Ce.axisType,"Id")];Se&&Se[ct]||Ce.axisType==="zAxis"||Ka();var Qe=Se[ct];return le(le({},we),{},Pe(Pe({},Ce.axisType,Qe),"".concat(Ce.axisType,"Ticks"),kr(Qe)))},ee),_=$[V],Q=$["".concat(V,"Ticks")],R=N&&N[Z]&&N[Z].hasStack&&bH(B,N[Z].stackGroups),G=Tr(B.type).indexOf("Bar")>=0,ae=Pc(_,Q),re=[],te=O&&nH({barSize:C,stackGroups:N,totalSize:zee($,V)});if(G){var se,q,W=Ue(I)?P:I,de=(se=(q=Pc(_,Q,!0))!==null&&q!==void 0?q:W)!==null&&se!==void 0?se:0;re=rH({barGap:D,barCategoryGap:L,bandSize:de!==ae?de:ae,sizeList:te[ne],maxBarSize:W}),de!==ae&&(re=re.map(function(we){return le(le({},we),{},{position:le(le({},we.position),{},{offset:we.position.offset-de/2})})}))}var Ae=B&&B.type&&B.type.getComposedData;Ae&&E.push({props:le(le({},Ae(le(le({},$),{},{displayedData:M,props:j,dataKey:X,item:B,bandSize:ae,barPosition:re,offset:b,stackedData:R,layout:F,dataStartIndex:k,dataEndIndex:A}))),{},Pe(Pe(Pe({key:B.key||"item-".concat(T)},Y,$[Y]),V,$[V]),"animationId",w)),childIndex:sF(B,j.children),item:B})}),E},h=function(j,S){var y=j.props,N=j.dataStartIndex,b=j.dataEndIndex,w=j.updateId;if(!Nw({props:y}))return null;var k=y.children,A=y.layout,C=y.stackOffset,F=y.data,D=y.reverseStackOrder,L=Xk(A),P=L.numericAxisName,H=L.cateAxisName,Y=Xn(k,r),V=pH(F,Y,"".concat(P,"Id"),"".concat(H,"Id"),C,D),O=c.reduce(function(K,X){var I="".concat(X.axisType,"Map");return le(le({},K),{},Pe({},I,Dee(y,le(le({},X),{},{graphicalItems:Y,stackGroups:X.axisType===P&&V,dataStartIndex:N,dataEndIndex:b}))))},{}),E=$ee(le(le({},O),{},{props:y,graphicalItems:Y}),S?.legendBBox);Object.keys(O).forEach(function(K){O[K]=f(y,O[K],E,K.replace("Map",""),n)});var B=O["".concat(H,"Map")],T=Ree(B),M=m(y,le(le({},O),{},{dataStartIndex:N,dataEndIndex:b,updateId:w,graphicalItems:Y,stackGroups:V,offset:E}));return le(le({formattedGraphicalItems:M,graphicalItems:Y,offset:E,stackGroups:V},T),O)},g=(function(p){function j(S){var y,N,b;return bee(this,j),b=wee(this,j,[S]),Pe(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pe(b,"accessibilityManager",new aee),Pe(b,"handleLegendBBoxUpdate",function(w){if(w){var k=b.state,A=k.dataStartIndex,C=k.dataEndIndex,F=k.updateId;b.setState(le({legendBBox:w},h({props:b.props,dataStartIndex:A,dataEndIndex:C,updateId:F},le(le({},b.state),{},{legendBBox:w}))))}}),Pe(b,"handleReceiveSyncEvent",function(w,k,A){if(b.props.syncId===w){if(A===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(k)}}),Pe(b,"handleBrushChange",function(w){var k=w.startIndex,A=w.endIndex;if(k!==b.state.dataStartIndex||A!==b.state.dataEndIndex){var C=b.state.updateId;b.setState(function(){return le({dataStartIndex:k,dataEndIndex:A},h({props:b.props,dataStartIndex:k,dataEndIndex:A,updateId:C},b.state))}),b.triggerSyncEvent({dataStartIndex:k,dataEndIndex:A})}}),Pe(b,"handleMouseEnter",function(w){var k=b.getMouseInfo(w);if(k){var A=le(le({},k),{},{isTooltipActive:!0});b.setState(A),b.triggerSyncEvent(A);var C=b.props.onMouseEnter;Le(C)&&C(A,w)}}),Pe(b,"triggeredAfterMouseMove",function(w){var k=b.getMouseInfo(w),A=k?le(le({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(A),b.triggerSyncEvent(A);var C=b.props.onMouseMove;Le(C)&&C(A,w)}),Pe(b,"handleItemMouseEnter",function(w){b.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Pe(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Pe(b,"handleMouseMove",function(w){w.persist(),b.throttleTriggeredAfterMouseMove(w)}),Pe(b,"handleMouseLeave",function(w){b.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};b.setState(k),b.triggerSyncEvent(k);var A=b.props.onMouseLeave;Le(A)&&A(k,w)}),Pe(b,"handleOuterEvent",function(w){var k=aF(w),A=In(b.props,"".concat(k));if(k&&Le(A)){var C,F;/.*touch.*/i.test(k)?F=b.getMouseInfo(w.changedTouches[0]):F=b.getMouseInfo(w),A((C=F)!==null&&C!==void 0?C:{},w)}}),Pe(b,"handleClick",function(w){var k=b.getMouseInfo(w);if(k){var A=le(le({},k),{},{isTooltipActive:!0});b.setState(A),b.triggerSyncEvent(A);var C=b.props.onClick;Le(C)&&C(A,w)}}),Pe(b,"handleMouseDown",function(w){var k=b.props.onMouseDown;if(Le(k)){var A=b.getMouseInfo(w);k(A,w)}}),Pe(b,"handleMouseUp",function(w){var k=b.props.onMouseUp;if(Le(k)){var A=b.getMouseInfo(w);k(A,w)}}),Pe(b,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Pe(b,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseDown(w.changedTouches[0])}),Pe(b,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseUp(w.changedTouches[0])}),Pe(b,"handleDoubleClick",function(w){var k=b.props.onDoubleClick;if(Le(k)){var A=b.getMouseInfo(w);k(A,w)}}),Pe(b,"handleContextMenu",function(w){var k=b.props.onContextMenu;if(Le(k)){var A=b.getMouseInfo(w);k(A,w)}}),Pe(b,"triggerSyncEvent",function(w){b.props.syncId!==void 0&&Tp.emit(Pp,b.props.syncId,w,b.eventEmitterSymbol)}),Pe(b,"applySyncEvent",function(w){var k=b.props,A=k.layout,C=k.syncMethod,F=b.state.updateId,D=w.dataStartIndex,L=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)b.setState(le({dataStartIndex:D,dataEndIndex:L},h({props:b.props,dataStartIndex:D,dataEndIndex:L,updateId:F},b.state)));else if(w.activeTooltipIndex!==void 0){var P=w.chartX,H=w.chartY,Y=w.activeTooltipIndex,V=b.state,O=V.offset,E=V.tooltipTicks;if(!O)return;if(typeof C=="function")Y=C(E,w);else if(C==="value"){Y=-1;for(var B=0;B=0){var R,G;if(P.dataKey&&!P.allowDuplicatedCategory){var ae=typeof P.dataKey=="function"?Q:"payload.".concat(P.dataKey.toString());R=jx(B,ae,Y),G=T&&M&&jx(M,ae,Y)}else R=B?.[H],G=T&&M&&M[H];if(ne||Z){var re=w.props.activeIndex!==void 0?w.props.activeIndex:H;return[v.cloneElement(w,le(le(le({},C.props),$),{},{activeIndex:re})),null,null]}if(!Ue(R))return[_].concat(ei(b.renderActivePoints({item:C,activePoint:R,basePoint:G,childIndex:H,isRange:T})))}else{var te,se=(te=b.getItemByXY(b.state.activeCoordinate))!==null&&te!==void 0?te:{graphicalItem:_},q=se.graphicalItem,W=q.item,de=W===void 0?w:W,Ae=q.childIndex,we=le(le(le({},C.props),$),{},{activeIndex:Ae});return[v.cloneElement(de,we),null,null]}return T?[_,null,null]:[_,null]}),Pe(b,"renderCustomized",function(w,k,A){return v.cloneElement(w,le(le({key:"recharts-customized-".concat(A)},b.props),b.state))}),Pe(b,"renderMap",{CartesianGrid:{handler:Tl,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:Tl},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:Tl},YAxis:{handler:Tl},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((y=S.id)!==null&&y!==void 0?y:yd("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=oP(b.triggeredAfterMouseMove,(N=S.throttleDelay)!==null&&N!==void 0?N:1e3/60),b.state={},b}return See(j,p),vee(j,[{key:"componentDidMount",value:function(){var y,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,N=y.children,b=y.data,w=y.height,k=y.layout,A=bn(N,Bn);if(A){var C=A.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length-1)){var F=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,D=Lg(this.state,b,C,F),L=this.state.tooltipTicks[C].coordinate,P=(this.state.offset.top+w)/2,H=k==="horizontal",Y=H?{x:L,y:P}:{y:L,x:P},V=this.state.formattedGraphicalItems.find(function(E){var B=E.item;return B.type.name==="Scatter"});V&&(Y=le(le({},Y),V.props.points[C].tooltipPosition),D=V.props.points[C].tooltipPayload);var O={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:F,activePayload:D,activeCoordinate:Y};this.setState(O),this.renderCursor(A),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var b,w;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(y){Sx([bn(y.children,Bn)],[bn(this.props.children,Bn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=bn(this.props.children,Bn);if(y&&typeof y.props.shared=="boolean"){var N=y.props.shared?"axis":"item";return l.indexOf(N)>=0?N:i}return i}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var N=this.container,b=N.getBoundingClientRect(),w=G9(b),k={chartX:Math.round(y.pageX-w.left),chartY:Math.round(y.pageY-w.top)},A=b.width/N.offsetWidth||1,C=this.inRange(k.chartX,k.chartY,A);if(!C)return null;var F=this.state,D=F.xAxisMap,L=F.yAxisMap,P=this.getTooltipEventType(),H=Hk(this.state,this.props.data,this.props.layout,C);if(P!=="axis"&&D&&L){var Y=Wr(D).scale,V=Wr(L).scale,O=Y&&Y.invert?Y.invert(k.chartX):null,E=V&&V.invert?V.invert(k.chartY):null;return le(le({},k),{},{xValue:O,yValue:E},H)}return H?le(le({},k),H):null}},{key:"inRange",value:function(y,N){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,k=y/b,A=N/b;if(w==="horizontal"||w==="vertical"){var C=this.state.offset,F=k>=C.left&&k<=C.left+C.width&&A>=C.top&&A<=C.top+C.height;return F?{x:k,y:A}:null}var D=this.state,L=D.angleAxisMap,P=D.radiusAxisMap;if(L&&P){var H=Wr(L);return fS({x:k,y:A},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,N=this.getTooltipEventType(),b=bn(y,Bn),w={};b&&N==="axis"&&(b.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=nc(this.props,this.handleOuterEvent);return le(le({},k),w)}},{key:"addListener",value:function(){Tp.on(Pp,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Tp.removeListener(Pp,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,N,b){for(var w=this.state.formattedGraphicalItems,k=0,A=w.length;k({id:c.id,...c.data()})).sort((c,d)=>String(c.name||"").localeCompare(String(d.name||"")))}catch{}const r=(await fM(e)).map(i=>i.id);if(r.length===0)return[];const s=new Map;for(let i=0;i{s.set(d.id,{id:d.id,...d.data()})})}return Array.from(s.values()).sort((i,o)=>String(i.name||"").localeCompare(String(o.name||"")))}async function Bee(e,t,n){const r=Me(fe,"managedStudents",e);await vt(r,{riskLevel:t,...n!==void 0?{riskConfidence:n}:{},updatedAt:ke()})}async function uM(e,t,n){const r=Yn(t,n),s=Me(fe,"managedStudents",e);await vt(s,{grade:t,section:n,classSectionId:r,updatedAt:ke()})}function Yn(e,t){return[e,t].filter(Boolean).join("_").replace(/\s+/g,"_").toLowerCase()}function $g(e){const t=Object.entries(e).filter(([,n])=>n!==void 0);return Object.fromEntries(t)}function ns(e){const t=(e||"").trim();if(!t)return null;const n=t.match(/(\d{1,2})/);return n?`Grade ${n[1]}`:/^grade\s+/i.test(t)?t.replace(/\s+/g," ").trim().replace(/^grade/i,"Grade"):t}function fi(e){const n=ns(e)?.match(/(\d{1,2})/),r=n?Number.parseInt(n[1],10):Number.NaN;return Number.isFinite(r)?r>=11?"Senior High School":"Junior High School":null}function mi(e,t){const n=`${e||""} ${t||""}`.toUpperCase();if(!n.trim())return null;const r=["STEM","ABM","HUMSS","GAS","TVL","ICT"];for(const s of r)if(new RegExp(`\\b${s}\\b`).test(n))return s;return null}function Qn(e){const t=(e||"").trim();if(!t)return{grade:"Grade 11",section:"Section A"};const[n="Grade 11",r="Section A"]=t.split(" - ").map(s=>s.trim());return{grade:n||"Grade 11",section:r||"Section A"}}function Vt(e){const t=e.metadata||{},n=e.className||t.className,r=Qn(n),s=(e.grade||t.grade||r.grade||"").trim()||null,i=(e.section||t.section||r.section||"").trim()||null,o=(e.classSectionId||t.classSectionId||"").trim()||(s&&i?Yn(s,i):"")||null,l=(n||"").trim()||(s&&i?`${s} - ${i}`:"")||null,c=ns(e.gradeLevel||t.gradeLevel||s),d=(e.classification||t.classification||"").trim()||fi(c)||null,f=(e.strand||t.strand||"").trim()||mi(l,i)||null;return{classSectionId:o,className:l,grade:s,section:i,gradeLevel:c,classification:d,strand:f,schoolYear:(e.schoolYear||t.schoolYear||"").trim()||null,ownerTeacherId:(e.ownerTeacherId||t.ownerTeacherId||"").trim()||null,ownerTeacherName:(e.ownerTeacherName||t.ownerTeacherName||"").trim()||null,adviserTeacherId:(e.adviserTeacherId||t.adviserTeacherId||"").trim()||null,adviserTeacherName:(e.adviserTeacherName||t.adviserTeacherName||"").trim()||null,managerId:(e.managerId||t.managerId||"").trim()||null,managerName:(e.managerName||t.managerName||"").trim()||null}}function qee(e){const t=(e.className||"").trim(),[n="",r=""]=t.split(" - "),s=(e.grade||n||"").trim()||null,i=(e.section||r||"").trim()||null,o=(e.classSectionId||"").trim()||(s&&i?Yn(s,i):"")||null,l=t||(s&&i?`${s} - ${i}`:null),c=ns(e.gradeLevel||s),d=(e.classification||"").trim()||fi(c),f=(e.strand||"").trim()||mi(l,i);return{classSectionId:o,className:l,grade:s,section:i,gradeLevel:c,classification:d,strand:f,schoolYear:(e.schoolYear||"").trim()||null,ownerTeacherId:(e.ownerTeacherId||"").trim()||null,ownerTeacherName:(e.ownerTeacherName||"").trim()||null,adviserTeacherId:(e.adviserTeacherId||"").trim()||null,adviserTeacherName:(e.adviserTeacherName||"").trim()||null,managerId:(e.managerId||"").trim()||null,managerName:(e.managerName||"").trim()||null}}async function fM(e){const t=_e(fe,"classrooms"),n=new Map,r=at(t,Je("teacherId","==",e));(await Ye(r)).docs.forEach(l=>{n.set(l.id,{id:l.id,...l.data()})});const i=at(t,Je("managerId","==",e));return(await Ye(i)).docs.forEach(l=>{n.set(l.id,{id:l.id,...l.data()})}),Array.from(n.values()).sort((l,c)=>String(l.name||"").localeCompare(String(c.name||"")))}async function mM(e){const t=e.classSectionId||Yn(e.grade,e.section),n=Me(fe,"classSectionOwnership",t),r=await Lt(n),s=r.exists()?r.data().studentUids||[]:[],i=Array.from(new Set([...e.studentUids||[],...s])),o=$g(e);return r.exists()?await vt(n,{...o,classSectionId:t,studentUids:i,updatedAt:ke()}):await rt(n,{...o,classSectionId:t,studentUids:i,createdAt:ke(),updatedAt:ke()}),t}async function Vee(e){const t=(e.classSectionId||"").trim()||Yn(e.grade,e.section),n=(e.className||"").trim()||`${e.grade} - ${e.section}`,r=qee({classSectionId:t,className:n,grade:e.grade,section:e.section,schoolYear:e.schoolYear,ownerTeacherId:e.ownerTeacherId,ownerTeacherName:e.ownerTeacherName,adviserTeacherId:e.ownerTeacherId,adviserTeacherName:e.ownerTeacherName,managerId:e.managerId,managerName:e.managerName,classification:e.classification,strand:e.strand,gradeLevel:e.gradeLevel});await mM({classSectionId:t,className:n,grade:r.grade||e.grade,gradeLevel:r.gradeLevel||e.gradeLevel||e.grade,classification:r.classification||e.classification,strand:r.strand||e.strand,section:r.section||e.section,schoolYear:e.schoolYear,ownerTeacherId:e.ownerTeacherId,ownerTeacherName:e.ownerTeacherName,managerId:e.managerId,managerName:e.managerName,studentUids:[]});const s=_e(fe,"classrooms"),i=at(s,Je("classSectionId","==",t)),o=await Ye(i);if(o.empty){const l=$g({name:n,teacherId:e.ownerTeacherId,grade:r.grade,gradeLevel:r.gradeLevel,classification:r.classification,strand:r.strand,section:r.section,classSectionId:t,schoolYear:e.schoolYear,ownerTeacherId:e.ownerTeacherId,ownerTeacherName:e.ownerTeacherName||"",adviserTeacherId:e.ownerTeacherId,adviserTeacherName:e.ownerTeacherName||"",managerId:e.managerId,managerName:e.managerName||"",classMetadata:r,schedule:"Mon-Fri",studentCount:0,avgScore:0,atRiskCount:0,createdAt:ke(),updatedAt:ke()});await rt(Me(fe,"classrooms",t),l,{merge:!0})}else for(const l of o.docs){const c=$g({name:n,grade:r.grade,gradeLevel:r.gradeLevel,classification:r.classification,strand:r.strand,section:r.section,schoolYear:e.schoolYear,ownerTeacherId:e.ownerTeacherId,ownerTeacherName:e.ownerTeacherName||"",adviserTeacherId:e.ownerTeacherId,adviserTeacherName:e.ownerTeacherName||"",managerId:e.managerId,managerName:e.managerName||"",classMetadata:r,updatedAt:ke()});await vt(l.ref,c)}return t}async function hM(e,t,n,r,s,i){const o=Yn(t,n);await mM({classSectionId:o,grade:t,section:n,schoolYear:s,ownerTeacherId:r,ownerTeacherName:i,studentUids:[e]}),await rt(Me(fe,"users",e),{grade:t,section:n,classSectionId:o,adviserTeacherId:r,adviserTeacherName:i||"",updatedAt:ke()},{merge:!0})}async function Uee(e){const t=_e(fe,"classSectionOwnership"),n=new Map,r=at(t,Je("ownerTeacherId","==",e));(await Ye(r)).docs.forEach(l=>{n.set(l.id,{id:l.id,...l.data()})});const i=at(t,Je("managerId","==",e));return(await Ye(i)).docs.forEach(l=>{n.set(l.id,{id:l.id,...l.data()})}),Array.from(n.values()).sort((l,c)=>String(l.classSectionId||"").localeCompare(String(c.classSectionId||"")))}async function Gee(e="",t=25){const n=_e(fe,"users"),r=Math.max(1,Math.min(100,t)),s=at(n,Je("role","==","teacher"),Er(r*4)),i=await Ye(s),o=e.trim().toLowerCase();return i.docs.map(c=>{const d=c.data(),f=String(d.name||"").trim(),u=String(d.email||"").trim();return{uid:c.id,name:f||"Teacher",email:u,photo:String(d.photo||d.photoURL||"").trim()||void 0}}).filter(c=>o?c.name.toLowerCase().includes(o)||c.email.toLowerCase().includes(o):!0).sort((c,d)=>c.name.localeCompare(d.name)).slice(0,r)}function Wee(e,t,n=20){if(e.length===0)return t([]),()=>{};const r=_e(fe,"activities"),s=at(r,Je("classroomId","in",e),Zn("timestamp","desc"));return Zc(s,i=>{const o=i.docs.slice(0,n).map(l=>({id:l.id,...l.data()}));t(o)})}async function Hee(e,t,n){const r=Me(_e(fe,"generatedLessonPlans"));return await rt(r,{...e,teacherId:t,teacherName:n?.teacherName||null,studentId:n?.studentId||null,studentName:n?.studentName||null,status:"draft",createdAt:ke(),updatedAt:ke()}),r.id}async function Kee(e){const t=Me(fe,"generatedLessonPlans",e),n=await Lt(t);if(!n.exists())throw new Error("Lesson draft not found. Save draft before publishing.");if(!n.data().publishReady)throw new Error("Lesson is not publish-ready. Resolve source legitimacy and validation issues first.");await vt(t,{status:"published",publishedAt:ke(),updatedAt:ke()})}function Xee(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Yee=e=>{switch(e){case"success":return Jee;case"info":return tte;case"warning":return ete;case"error":return nte;default:return null}},Qee=Array(12).fill(0),Zee=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},Qee.map((n,r)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Jee=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ete=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tte=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nte=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),rte=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ate=()=>{const[e,t]=U.useState(document.hidden);return U.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let zg=1;class ste{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,i=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:zg++,o=this.toasts.find(c=>c.id===i),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:r}),{...c,...t,id:i,dismissible:l,title:r}):c):this.addToast({title:r,...s,dismissible:l,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],U.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(ote(d)&&!d.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,g=typeof u=="object"&&!U.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:m,...g})}else if(d instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,g=typeof u=="object"&&!U.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:m,...g})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,g=typeof u=="object"&&!U.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:m,...g})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,u=typeof n.description=="function"?await n.description(d):n.description,h=typeof f=="object"&&!U.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:u,...h})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||zg++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const fn=new ste,ite=(e,t)=>{const n=t?.id||zg++;return fn.addToast({title:e,...t,id:n}),n},ote=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lte=ite,cte=()=>fn.toasts,dte=()=>fn.getActiveToasts(),ue=Object.assign(lte,{success:fn.success,info:fn.info,warning:fn.warning,error:fn.error,custom:fn.custom,message:fn.message,promise:fn.promise,dismiss:fn.dismiss,loading:fn.loading},{getHistory:cte,getToasts:dte});Xee("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Pl(e){return e.label!==void 0}const ute=3,fte="24px",mte="16px",Qk=4e3,hte=356,pte=14,xte=45,gte=200;function nr(...e){return e.filter(Boolean).join(" ")}function bte(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const yte=e=>{var t,n,r,s,i,o,l,c,d;const{invert:f,toast:u,unstyled:m,interacting:h,setHeights:g,visibleToasts:x,heights:p,index:j,toasts:S,expanded:y,removeToast:N,defaultRichColors:b,closeButton:w,style:k,cancelButtonStyle:A,actionButtonStyle:C,className:F="",descriptionClassName:D="",duration:L,position:P,gap:H,expandByDefault:Y,classNames:V,icons:O,closeButtonAriaLabel:E="Close toast"}=e,[B,T]=U.useState(null),[M,K]=U.useState(null),[X,I]=U.useState(!1),[Z,ne]=U.useState(!1),[ee,$]=U.useState(!1),[_,Q]=U.useState(!1),[R,G]=U.useState(!1),[ae,re]=U.useState(0),[te,se]=U.useState(0),q=U.useRef(u.duration||L||Qk),W=U.useRef(null),de=U.useRef(null),Ae=j===0,we=j+1<=x,Ce=u.type,Se=u.dismissible!==!1,ct=u.className||"",Qe=u.descriptionClassName||"",Te=U.useMemo(()=>p.findIndex(Ie=>Ie.toastId===u.id)||0,[p,u.id]),en=U.useMemo(()=>{var Ie;return(Ie=u.closeButton)!=null?Ie:w},[u.closeButton,w]),tn=U.useMemo(()=>u.duration||L||Qk,[u.duration,L]),pn=U.useRef(0),Ft=U.useRef(0),me=U.useRef(0),je=U.useRef(null),[dt,Ee]=P.split("-"),mt=U.useMemo(()=>p.reduce((Ie,bt,wt)=>wt>=Te?Ie:Ie+bt.height,0),[p,Te]),Wt=ate(),Jo=u.invert||f,hi=Ce==="loading";Ft.current=U.useMemo(()=>Te*H+mt,[Te,mt]),U.useEffect(()=>{q.current=tn},[tn]),U.useEffect(()=>{I(!0)},[]),U.useEffect(()=>{const Ie=de.current;if(Ie){const bt=Ie.getBoundingClientRect().height;return se(bt),g(wt=>[{toastId:u.id,height:bt,position:u.position},...wt]),()=>g(wt=>wt.filter(Ht=>Ht.toastId!==u.id))}},[g,u.id]),U.useLayoutEffect(()=>{if(!X)return;const Ie=de.current,bt=Ie.style.height;Ie.style.height="auto";const wt=Ie.getBoundingClientRect().height;Ie.style.height=bt,se(wt),g(Ht=>Ht.find(jt=>jt.toastId===u.id)?Ht.map(jt=>jt.toastId===u.id?{...jt,height:wt}:jt):[{toastId:u.id,height:wt,position:u.position},...Ht])},[X,u.title,u.description,g,u.id,u.jsx,u.action,u.cancel]);const dn=U.useCallback(()=>{ne(!0),re(Ft.current),g(Ie=>Ie.filter(bt=>bt.toastId!==u.id)),setTimeout(()=>{N(u)},gte)},[u,N,g,Ft]);U.useEffect(()=>{if(u.promise&&Ce==="loading"||u.duration===1/0||u.type==="loading")return;let Ie;return y||h||Wt?(()=>{if(me.current{q.current!==1/0&&(pn.current=new Date().getTime(),Ie=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),dn()},q.current))})(),()=>clearTimeout(Ie)},[y,h,u,Ce,Wt,dn]),U.useEffect(()=>{u.delete&&(dn(),u.onDismiss==null||u.onDismiss.call(u,u))},[dn,u.delete]);function pi(){var Ie;if(O?.loading){var bt;return U.createElement("div",{className:nr(V?.loader,u==null||(bt=u.classNames)==null?void 0:bt.loader,"sonner-loader"),"data-visible":Ce==="loading"},O.loading)}return U.createElement(Zee,{className:nr(V?.loader,u==null||(Ie=u.classNames)==null?void 0:Ie.loader),visible:Ce==="loading"})}const el=u.icon||O?.[Ce]||Yee(Ce);var xi,tl;return U.createElement("li",{tabIndex:0,ref:de,className:nr(F,ct,V?.toast,u==null||(t=u.classNames)==null?void 0:t.toast,V?.default,V?.[Ce],u==null||(n=u.classNames)==null?void 0:n[Ce]),"data-sonner-toast":"","data-rich-colors":(xi=u.richColors)!=null?xi:b,"data-styled":!(u.jsx||u.unstyled||m),"data-mounted":X,"data-promise":!!u.promise,"data-swiped":R,"data-removed":Z,"data-visible":we,"data-y-position":dt,"data-x-position":Ee,"data-index":j,"data-front":Ae,"data-swiping":ee,"data-dismissible":Se,"data-type":Ce,"data-invert":Jo,"data-swipe-out":_,"data-swipe-direction":M,"data-expanded":!!(y||Y&&X),"data-testid":u.testId,style:{"--index":j,"--toasts-before":j,"--z-index":S.length-j,"--offset":`${Z?ae:Ft.current}px`,"--initial-height":Y?"auto":`${te}px`,...k,...u.style},onDragEnd:()=>{$(!1),T(null),je.current=null},onPointerDown:Ie=>{Ie.button!==2&&(hi||!Se||(W.current=new Date,re(Ft.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&($(!0),je.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,bt,wt;if(_||!Se)return;je.current=null;const Ht=Number(((Ie=de.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Sn=Number(((bt=de.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),jt=new Date().getTime()-((wt=W.current)==null?void 0:wt.getTime()),nn=B==="x"?Ht:Sn,tr=Math.abs(nn)/jt;if(Math.abs(nn)>=xte||tr>.11){re(Ft.current),u.onDismiss==null||u.onDismiss.call(u,u),K(B==="x"?Ht>0?"right":"left":Sn>0?"down":"up"),dn(),Q(!0);return}else{var xn,un;(xn=de.current)==null||xn.style.setProperty("--swipe-amount-x","0px"),(un=de.current)==null||un.style.setProperty("--swipe-amount-y","0px")}G(!1),$(!1),T(null)},onPointerMove:Ie=>{var bt,wt,Ht;if(!je.current||!Se||((bt=window.getSelection())==null?void 0:bt.toString().length)>0)return;const jt=Ie.clientY-je.current.y,nn=Ie.clientX-je.current.x;var tr;const xn=(tr=e.swipeDirections)!=null?tr:bte(P);!B&&(Math.abs(nn)>1||Math.abs(jt)>1)&&T(Math.abs(nn)>Math.abs(jt)?"x":"y");let un={x:0,y:0};const rs=xr=>1/(1.5+Math.abs(xr)/20);if(B==="y"){if(xn.includes("top")||xn.includes("bottom"))if(xn.includes("top")&&jt<0||xn.includes("bottom")&&jt>0)un.y=jt;else{const xr=jt*rs(jt);un.y=Math.abs(xr)0)un.x=nn;else{const xr=nn*rs(nn);un.x=Math.abs(xr)0||Math.abs(un.y)>0)&&G(!0),(wt=de.current)==null||wt.style.setProperty("--swipe-amount-x",`${un.x}px`),(Ht=de.current)==null||Ht.style.setProperty("--swipe-amount-y",`${un.y}px`)}},en&&!u.jsx&&Ce!=="loading"?U.createElement("button",{"aria-label":E,"data-disabled":hi,"data-close-button":!0,onClick:hi||!Se?()=>{}:()=>{dn(),u.onDismiss==null||u.onDismiss.call(u,u)},className:nr(V?.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(tl=O?.close)!=null?tl:rte):null,(Ce||u.icon||u.promise)&&u.icon!==null&&(O?.[Ce]!==null||u.icon)?U.createElement("div",{"data-icon":"",className:nr(V?.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||pi():null,u.type!=="loading"?el:null):null,U.createElement("div",{"data-content":"",className:nr(V?.content,u==null||(i=u.classNames)==null?void 0:i.content)},U.createElement("div",{"data-title":"",className:nr(V?.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?U.createElement("div",{"data-description":"",className:nr(D,Qe,V?.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),U.isValidElement(u.cancel)?u.cancel:u.cancel&&Pl(u.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:Ie=>{Pl(u.cancel)&&Se&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ie),dn())},className:nr(V?.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,U.isValidElement(u.action)?u.action:u.action&&Pl(u.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||C,onClick:Ie=>{Pl(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ie),!Ie.defaultPrevented&&dn())},className:nr(V?.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function Zk(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function vte(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?mte:fte;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const Ep=U.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:f,mobileOffset:u,theme:m="light",richColors:h,duration:g,style:x,visibleToasts:p=ute,toastOptions:j,dir:S=Zk(),gap:y=pte,icons:N,containerAriaLabel:b="Notifications"}=t,[w,k]=U.useState([]),A=U.useMemo(()=>r?w.filter(X=>X.toasterId===r):w.filter(X=>!X.toasterId),[w,r]),C=U.useMemo(()=>Array.from(new Set([i].concat(A.filter(X=>X.position).map(X=>X.position)))),[A,i]),[F,D]=U.useState([]),[L,P]=U.useState(!1),[H,Y]=U.useState(!1),[V,O]=U.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),E=U.useRef(null),B=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=U.useRef(null),M=U.useRef(!1),K=U.useCallback(X=>{k(I=>{var Z;return(Z=I.find(ne=>ne.id===X.id))!=null&&Z.delete||fn.dismiss(X.id),I.filter(({id:ne})=>ne!==X.id)})},[]);return U.useEffect(()=>fn.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{k(I=>I.map(Z=>Z.id===X.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{VM.flushSync(()=>{k(I=>{const Z=I.findIndex(ne=>ne.id===X.id);return Z!==-1?[...I.slice(0,Z),{...I[Z],...X},...I.slice(Z+1)]:[X,...I]})})})}),[w]),U.useEffect(()=>{if(m!=="system"){O(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:I})=>{O(I?"dark":"light")})}catch{X.addListener(({matches:Z})=>{try{O(Z?"dark":"light")}catch(ne){console.error(ne)}})}},[m]),U.useEffect(()=>{w.length<=1&&P(!1)},[w]),U.useEffect(()=>{const X=I=>{var Z;if(o.every($=>I[$]||I.code===$)){var ee;P(!0),(ee=E.current)==null||ee.focus()}I.code==="Escape"&&(document.activeElement===E.current||(Z=E.current)!=null&&Z.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[o]),U.useEffect(()=>{if(E.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,M.current=!1)}},[E.current]),U.createElement("section",{ref:n,"aria-label":`${b} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((X,I)=>{var Z;const[ne,ee]=X.split("-");return A.length?U.createElement("ol",{key:X,dir:S==="auto"?Zk():S,tabIndex:-1,ref:E,className:d,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":ne,"data-x-position":ee,style:{"--front-toast-height":`${((Z=F[0])==null?void 0:Z.height)||0}px`,"--width":`${hte}px`,"--gap":`${y}px`,...x,...vte(f,u)},onBlur:$=>{M.current&&!$.currentTarget.contains($.relatedTarget)&&(M.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||M.current||(M.current=!0,T.current=$.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{H||P(!1)},onDragEnd:()=>P(!1),onPointerDown:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},A.filter($=>!$.position&&I===0||$.position===X).map(($,_)=>{var Q,R;return U.createElement(yte,{key:$.id,icons:N,index:_,toast:$,defaultRichColors:h,duration:(Q=j?.duration)!=null?Q:g,className:j?.className,descriptionClassName:j?.descriptionClassName,invert:s,visibleToasts:p,closeButton:(R=j?.closeButton)!=null?R:c,interacting:H,position:X,style:j?.style,unstyled:j?.unstyled,classNames:j?.classNames,cancelButtonStyle:j?.cancelButtonStyle,actionButtonStyle:j?.actionButtonStyle,closeButtonAriaLabel:j?.closeButtonAriaLabel,removeToast:K,toasts:A.filter(G=>G.position==$.position),heights:F.filter(G=>G.position==$.position),setHeights:D,expandByDefault:l,gap:y,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),wte=[{level:"Remember",icon:lr,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Recall facts, formulas, definitions, and basic procedures.",mathExample:"State the quadratic formula.",mapsTo:"Identification, Enumeration",defaultWeight:"Included by default"},{level:"Understand",icon:De,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Explain concepts, interpret graphs, classify mathematical objects.",mathExample:"Explain why the discriminant determines the number of roots.",mapsTo:"Multiple Choice, Identification",defaultWeight:"Included by default"},{level:"Apply",icon:Jn,bgColor:"bg-green-500/20",borderColor:"border-green-500/40",textColor:"text-green-400",description:"Use formulas and procedures to solve routine problems.",mathExample:"Solve: 2x² + 5x - 3 = 0 using the quadratic formula.",mapsTo:"Equation-Based, Word Problem",defaultWeight:"Included by default"},{level:"Analyze",icon:v8,bgColor:"bg-orange-500/20",borderColor:"border-orange-500/40",textColor:"text-orange-400",description:"Break down problems, compare solution methods, identify patterns.",mathExample:"Given f(x) = x³ - 3x, find and classify all critical points.",mapsTo:"Word Problem, Equation-Based",defaultWeight:"Included by default"}],jte=({isOpen:e,onClose:t})=>e?a.jsx(Ke,{children:e&&a.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[70] flex items-center justify-center p-4",onClick:t,children:a.jsxs(J.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-white border border-slate-200 rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col overflow-hidden",onClick:n=>n.stopPropagation(),children:[a.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 px-6 py-4 flex items-center justify-between flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:a.jsx(fr,{size:22,className:"text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-white",children:"Bloom's Taxonomy in MathPulse AI"}),a.jsx("p",{className:"text-cyan-200 text-xs",children:"Understanding cognitive levels in assessments"})]})]}),a.jsx("button",{onClick:t,className:"w-8 h-8 bg-white/20 hover:bg-white/30 rounded-lg flex items-center justify-center transition-colors",children:a.jsx(Xe,{size:16,className:"text-white"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"What is Bloom's Taxonomy?"}),a.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Bloom's Taxonomy is an educational framework developed by Benjamin Bloom in 1956 and revised in 2001. It classifies learning objectives into six cognitive levels, from basic recall of facts up to complex evaluation and creation. MathPulse AI uses the first four levels most relevant to Senior High School mathematics."})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"Why MathPulse AI Uses It"}),a.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Using Bloom's Taxonomy ensures that assessments do not only test memorization. A well-balanced math quiz should challenge students at multiple cognitive levels: remembering formulas, understanding concepts, applying procedures, and analyzing relationships. This mirrors the DepEd K-12 competency framework which requires higher-order thinking skills (HOTS) alongside foundational knowledge."})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-3",children:"Level-by-Level Breakdown"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:wte.map(n=>{const r=n.icon;return a.jsxs("div",{className:`${n.bgColor} border ${n.borderColor} rounded-xl p-4 space-y-2`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(r,{size:18,className:n.textColor}),a.jsx("span",{className:`font-bold text-sm ${n.textColor}`,children:n.level})]}),a.jsx("p",{className:"text-xs text-slate-500",children:n.description}),a.jsxs("div",{className:"bg-black/20 rounded-lg p-2",children:[a.jsx("p",{className:"text-[10px] font-semibold text-slate-500 uppercase tracking-wide mb-0.5",children:"Math Example"}),a.jsx("p",{className:"text-xs text-[#dde3eb] italic",children:n.mathExample})]}),a.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[a.jsxs("span",{className:"text-slate-500",children:["Maps to: ",a.jsx("span",{className:"text-slate-500 font-medium",children:n.mapsTo})]}),a.jsx("span",{className:"text-green-400 font-medium",children:n.defaultWeight})]})]},n.level)})})]}),a.jsx("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4",children:a.jsxs("p",{className:"text-xs text-slate-500 leading-relaxed",children:[a.jsx("span",{className:"font-semibold text-slate-600",children:"Note:"})," ","All four levels are selected by default to produce a balanced, HOTS-aligned assessment. Deselecting a level will remove questions of that cognitive depth from the generated quiz."]})})]}),a.jsxs("div",{className:"border-t border-slate-200 px-6 py-3 flex items-center justify-between flex-shrink-0 bg-slate-50",children:[a.jsxs("a",{href:"https://cft.vanderbilt.edu/guides-sub-pages/blooms-taxonomy/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-rose-400 hover:text-rose-300 font-medium transition-colors",children:[a.jsx(G8,{size:12}),"Learn More"]}),a.jsx("button",{onClick:t,className:"px-5 py-2 bg-sky-600 hover:bg-rose-500 text-white text-sm font-bold rounded-xl transition-colors",children:"Got it"})]})]})})}):null,Nte={draft:"bg-[#edf1f7] text-[#5a6578]",published:"bg-green-100 text-green-700",assigned:"bg-sky-100 text-sky-700",completed:"bg-rose-100 text-rose-700"},_p={identification:{label:"Identification",icon:a.jsx(ad,{size:16}),description:"Define or identify concepts"},enumeration:{label:"Enumeration",icon:a.jsx(fC,{size:16}),description:"List steps or properties"},multiple_choice:{label:"Multiple Choice",icon:a.jsx(jr,{size:16}),description:"Choose from 4 options"},word_problem:{label:"Word Problem",icon:a.jsx(De,{size:16}),description:"Real-world scenarios"},equation_based:{label:"Equation-Based",icon:a.jsx(Un,{size:16}),description:"Solve equations"}},Jk={remember:{label:"Remember",color:"bg-sky-100 text-sky-700 border-sky-300",description:"Recall facts & formulas"},understand:{label:"Understand",color:"bg-emerald-100 text-emerald-700 border-emerald-300",description:"Explain concepts"},apply:{label:"Apply",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Use in new contexts"},analyze:{label:"Analyze",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Examine & compare"}},Ste=["Grade 11","Grade 12"],Ip=e=>{const t=(e||"").trim().toLowerCase();return t==="grade 12"||t==="12"||t.includes("12")?"Grade 12":"Grade 11"},kte={"Grade 11":{"General Mathematics - Patterns, Relations, and Functions":["Patterns and Real-Life Relationships","Functions as Mathematical Models","Function Notation and Evaluation","Domain and Range of Functions","Operations on Functions","Composite Functions","Inverse Functions","Graphs of Rational Functions","Graphs of Exponential Functions","Graphs of Logarithmic Functions"],"General Mathematics - Financial Mathematics":["Simple and Compound Interest","Simple and General Annuities","Present and Future Value","Loans, Amortization, and Sinking Funds","Stocks, Bonds, and Market Indices","Business Decision-Making with Mathematical Models"],"General Mathematics - Logic and Mathematical Reasoning":["Propositions and Logical Connectives","Truth Values and Truth Tables","Logical Equivalence and Implication","Quantifiers and Negation","Validity of Arguments"]},"Grade 12":{"Pre-Calculus - Analytic Geometry":["Conic Sections - Parabola","Conic Sections - Ellipse","Conic Sections - Hyperbola","Conic Sections - Circle","Systems of Nonlinear Equations"],"Pre-Calculus - Series and Induction":["Sequences and Series","Arithmetic Sequences","Geometric Sequences","Mathematical Induction","Binomial Theorem"],"Pre-Calculus - Trigonometry":["Angles and Unit Circle","Trigonometric Functions","Trigonometric Identities","Sum and Difference Formulas","Inverse Trigonometric Functions","Polar Coordinates"],"Basic Calculus - Limits":["Limits of Functions","Limit Theorems","One-Sided Limits","Infinite Limits and Limits at Infinity","Continuity of Functions"],"Basic Calculus - Derivatives":["Definition of the Derivative","Differentiation Rules","Chain Rule","Implicit Differentiation","Higher-Order Derivatives","Related Rates","Extrema and the First Derivative Test","Concavity and the Second Derivative Test","Optimization Problems"],"Basic Calculus - Integration":["Antiderivatives and Indefinite Integrals","Definite Integrals and the FTC","Integration by Substitution","Area Under a Curve"]}},Ate={"Grade 11":["General Mathematics - "],"Grade 12":["Pre-Calculus - ","Basic Calculus - "]},e5=(e,t)=>{const n=Ate[t];return Object.fromEntries(Object.entries(e).filter(([r])=>n.some(s=>r.startsWith(s))))},Mi=30,fs=12,Op="mathpulse:quiz-maker:active-task",Dp={easy:"text-green-600",medium:"text-rose-600",hard:"text-red-600"},Cte=({onBack:e,gradeLevel:t,selectedClassId:n,selectedClassName:r})=>{const{currentUser:s,loading:i}=$t(),o=v.useMemo(()=>$e.getImportGroundedRolloutFlags(),[]),[l,c]=v.useState("create"),[d,f]=v.useState("configure"),[u,m]=v.useState(Ip(t)),[h,g]=v.useState(10),[x,p]=v.useState([]),[j,S]=v.useState([]),[y,N]=v.useState(["multiple_choice","word_problem","identification"]),[b,w]=v.useState(["remember","understand","apply","analyze"]),[k,A]=v.useState(!1),[C,F]=v.useState({easy:30,medium:50,hard:20}),[D,L]=v.useState({}),[P,H]=v.useState(!1),[Y,V]=v.useState([]),[O,E]=v.useState(!1),[B,T]=v.useState(""),[M,K]=v.useState(!1),[X,I]=v.useState(!1),[Z,ne]=v.useState(null),[ee,$]=v.useState(0),[_,Q]=v.useState("queued"),[R,G]=v.useState("Waiting to start generation..."),[ae,re]=v.useState(null),[te,se]=v.useState(null),[q,W]=v.useState(""),[de,Ae]=v.useState(!1),we=v.useRef(!1),[Ce,Se]=v.useState("topics"),[ct,Qe]=v.useState(null),[Te,en]=v.useState(!1),[tn,pn]=v.useState("all"),[Ft,me]=v.useState("all"),[je,dt]=v.useState(!1),[Ee,mt]=v.useState(null),[Wt,Jo]=v.useState(!1),[hi,dn]=v.useState(!1),[pi,el]=v.useState(!1),[xi,tl]=v.useState([]),[Ie,bt]=v.useState(!1),[wt,Ht]=v.useState(""),[Sn,jt]=v.useState(null),[nn,tr]=v.useState([]),[xn,un]=v.useState(!1),[rs,xr]=v.useState("all"),[Bb,qb]=v.useState(null),[Vb,nl]=v.useState(null),Ub=v.useCallback(async()=>{H(!0);const z=Ip(u);try{const ie=await $e.getQuizTopics(z);ie.topics&&L(e5(ie.topics,z))}catch{L(e5(kte[z],z))}finally{H(!1)}},[u]),Gb=v.useCallback(async()=>{if(!o.quizEnabled){V([]),T("Import-grounded quiz generation is disabled by rollout flag; using curriculum defaults."),E(!1);return}E(!0),T("");try{const z=await $e.getCourseMaterialTopics({classSectionId:n,limit:20}),ie=(z.topics||[]).filter(oe=>oe.title?.trim());V(ie),z.warnings&&z.warnings.length>0&&T(z.warnings.join(" "))}catch{V([]),T("Imported topics are currently unavailable; quiz generation will use curriculum defaults.")}finally{E(!1)}},[n,o.quizEnabled]);v.useEffect(()=>{Ub(),p([]),S([])},[Ub]),v.useEffect(()=>{Gb()},[Gb]);const Hd=v.useMemo(()=>{const z=Array.from(new Set(Y.map(ie=>ie.title.trim()).filter(Boolean)));return z.length===0?D:{"Imported Course Materials":z,...D}},[D,Y]);v.useEffect(()=>{pn("all"),me("all")},[ae]);const Wb=v.useMemo(()=>{if(!ae)return[];const z=ae.questions.map(oe=>oe.provenance?.sourceFile?.trim()).filter(oe=>!!oe),ie=(ae.metadata.topicProvenance||[]).map(oe=>oe.sourceFile?.trim()).filter(oe=>!!oe);return Array.from(new Set([...z,...ie])).sort((oe,Oe)=>oe.localeCompare(Oe))},[ae]),Hb=v.useMemo(()=>{if(!ae)return[];const z=ae.questions.map(oe=>oe.provenance?.materialId?.trim()).filter(oe=>!!oe),ie=(ae.metadata.topicProvenance||[]).map(oe=>oe.materialId?.trim()).filter(oe=>!!oe);return Array.from(new Set([...z,...ie])).sort((oe,Oe)=>oe.localeCompare(Oe))},[ae]),Kd=v.useMemo(()=>ae?ae.questions.filter(z=>{const ie=tn==="all"||(z.provenance?.sourceFile||"").trim()===tn,oe=Ft==="all"||(z.provenance?.materialId||"").trim()===Ft;return ie&&oe}):[],[ae,tn,Ft]),Kb=(z,ie)=>{const oe={...C},Oe=Math.max(0,Math.min(100,oe[z]+ie)),ut=Oe-oe[z];oe[z]=Oe;const ht=Object.keys(oe).filter(Ln=>Ln!==z),br=ht.reduce((Ln,as)=>Ln+oe[as],0);if(br>0)for(const Ln of ht)oe[Ln]=Math.max(0,Math.round(oe[Ln]-ut*oe[Ln]/br));const ry=Object.values(oe).reduce((Ln,as)=>Ln+as,0);if(ry!==100){const Ln=ht.reduce((as,ay)=>oe[as]>=oe[ay]?as:ay);oe[Ln]+=100-ry}F(oe)},PM=z=>{p(ie=>ie.includes(z)?ie.filter(oe=>oe!==z):[...ie,z]),S(ie=>ie.filter(oe=>oe!==z))},MM=z=>{S(ie=>ie.includes(z)?ie.filter(oe=>oe!==z):[...ie,z]),p(ie=>ie.filter(oe=>oe!==z))},EM=z=>{N(ie=>ie.includes(z)?ie.length>1?ie.filter(oe=>oe!==z):ie:[...ie,z])},_M=z=>{w(ie=>ie.includes(z)?ie.length>1?ie.filter(oe=>oe!==z):ie:[...ie,z])},Xb=()=>{let z=x.length>0?x.filter(oe=>!j.includes(oe)):Object.values(Hd).flat().filter(oe=>!j.includes(oe)).slice(0,3);z.length>fs&&(z=z.slice(0,fs));const ie=Math.min(h,Mi);return{topics:z,gradeLevel:u,numQuestions:ie,questionTypes:y,includeGraphs:k,difficultyDistribution:C,bloomLevels:b,excludeTopics:j,classSectionId:n,className:r,preferImportedTopics:o.quizEnabled}},IM=v.useCallback((z,ie)=>{const oe={taskId:z,request:ie,createdAt:new Date().toISOString(),ownerUid:s?.uid};try{sessionStorage.setItem(Op,JSON.stringify(oe))}catch{}},[s]),gr=v.useCallback(()=>{try{sessionStorage.removeItem(Op)}catch{}},[]),Xd=v.useCallback(z=>{const ie=Math.max(0,Math.min(100,Math.round(typeof z.progressPercent=="number"?z.progressPercent:z.status==="queued"?10:z.status==="running"?65:z.status==="completed"?100:z.status==="cancelling"?95:100)));$(oe=>{let Oe=Math.max(oe,ie);if(z.status==="running"&&ie<=oe){const ut=String(z.progressStage||"").toLowerCase(),ht=ut.includes("assembling")||ut.includes("final")?97:ut.includes("generating")?89:95;Oe=Math.min(ht,oe+1)}return Oe}),Q(z.progressStage||z.status),G(z.progressMessage||(z.status==="queued"?"Task queued for generation.":z.status==="running"?"Generating quiz in the background...":z.status==="completed"?"Generation complete.":z.status==="cancelling"?"Cancelling generation...":"Generation finished with an error."))},[]);v.useEffect(()=>{if(i||we.current)return;if(we.current=!0,!s){gr();return}let z=!1;const ie=sessionStorage.getItem(Op);if(!ie)return;let oe=null;try{oe=JSON.parse(ie)}catch{gr();return}if(!oe?.taskId){gr();return}if(oe.ownerUid&&oe.ownerUid!==s.uid){gr();return}return K(!0),ne(oe.taskId),W(""),$e.waitForTaskResult(oe.taskId,{timeoutMs:24e4,pollIntervalMs:1500,onProgress:Xd}).then(async Oe=>{if(z)return;const ut=Oe.result;if(!ut||typeof ut!="object")throw new Error("Quiz generation completed without a valid result payload.");const ht=ut;re(ht),f("results"),$(100),Q("completed"),G("Generation complete."),ne(null),gr();try{await Jb(ht,oe.request),ue.success("Quiz auto-saved to your library as draft.")}catch(br){ue.error(br instanceof Error?br.message:"Quiz generated but failed to save to library")}}).catch(Oe=>{if(!z){if(Oe instanceof vn&&(Oe.status===401||Oe.status===403)){we.current=!1,K(!1);return}W(Oe instanceof Error?Oe.message:"Failed to resume quiz generation"),ne(null),gr()}}).finally(()=>{z||K(!1)}),()=>{z=!0}},[Xd,i,gr,s]);const Yd=()=>{if(M){window.confirm("Quiz generation is in progress. Are you sure you want to leave?")&&(f("configure"),re(null),W(""),e());return}f("configure"),re(null),W(""),e()},OM=async()=>{W(""),I(!0),se(null);try{const z=await $e.previewQuiz(Xb());se(z),f("preview")}catch(z){W(z instanceof Error?z.message:"Preview generation failed")}finally{I(!1)}},Yb=async()=>{W(""),K(!0),nl(null),$(8),Q("queued"),G("Submitting quiz generation task..."),re(null);const z=Xb();try{const ie=await $e.generateQuiz(z,{onTaskCreated:oe=>{ne(oe),IM(oe,z),$(Oe=>Math.max(Oe,12)),Q("queued"),G("Task queued. Generation is running in the background.")},onProgress:oe=>{Xd(oe),oe.taskId&&oe.taskId!==Z&&ne(oe.taskId)}});re(ie),f("results"),$(100),Q("completed"),G("Generation complete."),ne(null),gr();try{await Jb(ie,z),ue.success("Quiz auto-saved to your library as draft.")}catch(oe){ue.error(oe instanceof Error?oe.message:"Quiz generated but failed to save to library")}$e.reportImportGroundedFeedback({flow:"quiz",status:"success",classSectionId:z.classSectionId,className:z.className,metadata:{totalQuestions:ie.metadata.totalQuestions,usedImportedTopics:!!ie.metadata.usedImportedTopics,importedTopicCount:ie.metadata.importedTopicCount??0,importGroundingEnabled:o.quizEnabled}})}catch(ie){W(ie instanceof Error?ie.message:"Quiz generation failed"),$(100),Q("failed"),G("Generation failed."),ne(null),gr(),$e.reportImportGroundedFeedback({flow:"quiz",status:"failed",classSectionId:z.classSectionId,className:z.className,metadata:{error:ie instanceof Error?ie.message:"Quiz generation failed",importGroundingEnabled:o.quizEnabled}})}finally{K(!1)}},DM=()=>{if(!ae)return;const z=ae.questions.map((ie,oe)=>{let Oe=`${oe+1}. [${ie.difficulty.toUpperCase()}] [${ie.bloomLevel}] (${ie.points} pts) +`;return Oe+=` ${ie.question} +`,ie.options&&(Oe+=ie.options.map(ut=>` ${ut}`).join(` +`)+` +`),Oe+=` Answer: ${ie.correctAnswer} +`,Oe+=` Explanation: ${ie.explanation} +`,Oe}).join(` +`);navigator.clipboard.writeText(z),Ae(!0),setTimeout(()=>Ae(!1),2e3)},RM=()=>{if(!ae)return;const z=new Blob([JSON.stringify(ae,null,2)],{type:"application/json"}),ie=URL.createObjectURL(z),oe=document.createElement("a");oe.href=ie,oe.download=`quiz_${u.replace(/\s/g,"_")}_${Date.now()}.json`,oe.click(),URL.revokeObjectURL(ie)},rl=x.length>0||Object.values(Hd).flat().length>0,Qb=(z,ie)=>{const oe=ie?.gradeLevel||u,Oe=ie?.topics||x,ut=z.questions.map((ht,br)=>({id:`q_${Date.now()}_${br}`,questionType:ht.questionType||"identification",question:ht.question,...ht.options?{options:ht.options}:{},correctAnswer:ht.correctAnswer,bloomLevel:ht.bloomLevel||"understand",difficulty:ht.difficulty||"medium",topic:ht.topic,subject:oe,points:ht.points,explanation:ht.explanation}));return{title:`${oe} Quiz – ${Oe.length>0?Oe.slice(0,2).join(", "):"Mixed Topics"}`,gradeLevel:oe,questions:ut,totalPoints:z.totalPoints,metadata:{topicsCovered:Object.keys(z.metadata.topicsCovered),difficultyBreakdown:{easy:z.metadata.difficultyBreakdown.easy??0,medium:z.metadata.difficultyBreakdown.medium??0,hard:z.metadata.difficultyBreakdown.hard??0},bloomDistribution:z.metadata.bloomTaxonomyDistribution,questionTypeBreakdown:z.metadata.questionTypeBreakdown,supplementalPurpose:z.metadata.supplementalPurpose,recommendedTeacherActions:z.metadata.recommendedTeacherActions??[],generatedAt:new Date().toISOString(),generatedBy:"teacher_generated"},status:"draft",source:"teacher_generated"}},Zb=v.useCallback(z=>{tr(ie=>[z,...ie.filter(oe=>oe.id!==z.id)])},[]);async function Jb(z,ie){if(!s)return null;const oe=Qb(z,ie),Oe=await Kv(oe,s.uid,Ee?{documentId:Ee}:void 0);return mt(Oe),Zb({id:Oe,...oe,teacherId:s.uid}),Oe}const LM=async()=>{if(!ae){ue.error("No quiz to save. Generate a quiz first.");return}if(!s){ue.error("You must be signed in to save quizzes.");return}dt(!0);try{const z=Qb(ae),ie=await Kv(z,s.uid,Ee?{documentId:Ee}:void 0);mt(ie),Zb({id:ie,...z,teacherId:s.uid}),ue.success("Quiz saved to your library!")}catch(z){ue.error(z instanceof Error?z.message:"Failed to save quiz")}finally{dt(!1)}},$M=async()=>{if(Ee){Jo(!0);try{await c$(Ee),tr(z=>z.map(ie=>ie.id===Ee?{...ie,status:"published"}:ie)),ue.success("Quiz published to Quiz Bank!")}catch(z){ue.error(z instanceof Error?z.message:"Failed to publish quiz")}finally{Jo(!1)}}},Qd=async z=>{const ie=z??Ee;if(!ie){ue.error("Save the quiz first before assigning.");return}if(qb(ie),dn(!0),jt(null),Ht(""),xi.length===0&&s){bt(!0);try{const oe=await Ib(s.uid);tl(oe)}catch{ue.error("Failed to load students")}finally{bt(!1)}}},zM=async()=>{const z=Bb??Ee;if(!(!Sn||!z||!s)){el(!0);try{await u$(z,Sn,s.uid),tr(ie=>ie.map(oe=>oe.id===z?{...oe,status:"assigned",metadata:{...oe.metadata,assignedTo:Sn}}:oe)),ue.success("Quiz assigned to student!"),dn(!1),qb(null),l==="bank"&&Zd()}catch(ie){ue.error(ie instanceof Error?ie.message:"Failed to assign quiz")}finally{el(!1)}}},Zd=v.useCallback(async()=>{if(s){un(!0);try{const z=await f$(s.uid);tr(z)}catch{ue.error("Failed to load quiz bank")}finally{un(!1)}}},[s]);v.useEffect(()=>{l==="bank"&&Zd()},[l,Zd]);const FM=async z=>{try{await d$(z),tr(ie=>ie.filter(oe=>oe.id!==z)),ue.success("Quiz deleted")}catch{ue.error("Failed to delete quiz")}},ey=xi.filter(z=>z.name.toLowerCase().includes(wt.toLowerCase())||z.email.toLowerCase().includes(wt.toLowerCase())),ty=rs==="all"?nn:nn.filter(z=>z.status===rs),BM=z=>{const ie=(z.metadata.topicsCovered||[]).reduce((oe,Oe)=>(oe[Oe]=(oe[Oe]||0)+1,oe),{});return{questions:z.questions.map(oe=>({questionType:oe.questionType,question:oe.question,correctAnswer:oe.correctAnswer,options:oe.options??null,bloomLevel:oe.bloomLevel,difficulty:oe.difficulty,topic:oe.topic,points:oe.points,explanation:oe.explanation})),totalPoints:z.totalPoints,metadata:{topicsCovered:ie,difficultyBreakdown:z.metadata.difficultyBreakdown,bloomTaxonomyDistribution:z.metadata.bloomDistribution,questionTypeBreakdown:z.metadata.questionTypeBreakdown,gradeLevel:z.gradeLevel,totalQuestions:z.questions.length,includesGraphQuestions:!1,supplementalPurpose:z.metadata.supplementalPurpose,bloomTaxonomyRationale:"Loaded from saved quiz bank entry.",recommendedTeacherActions:z.metadata.recommendedTeacherActions||[]}}},Jd=z=>{mt(z.id),re(BM(z)),se(null),nl(z.id),pn("all"),me("all"),Qe(null),f("results"),c("create")},al=(z,ie,oe,Oe)=>{const ut=Ce===z;return a.jsxs("div",{className:"border border-[#dde3eb] rounded-xl overflow-hidden",children:[a.jsxs("button",{onClick:()=>Se(ut?null:z),className:"w-full flex items-center justify-between px-4 py-3 bg-[#edf1f7] hover:bg-[#dde3eb] transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-[#0a1628]",children:[oe,ie]}),ut?a.jsx(Es,{size:18,className:"text-slate-500"}):a.jsx(Hn,{size:18,className:"text-slate-500"})]}),a.jsx(Ke,{children:ut&&a.jsx(J.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:a.jsx("div",{className:"p-4",children:Oe})})})]})},qM={remember:"bg-sky-100 text-sky-700 border-sky-300",understand:"bg-rose-100 text-rose-700 border-rose-300",apply:"bg-emerald-100 text-emerald-700 border-emerald-300",analyze:"bg-rose-100 text-rose-700 border-rose-300"},ny=(z,ie,oe)=>{const Oe=ct===ie,ut=qM[z.bloomLevel]||"bg-[#edf1f7] text-[#5a6578] border-[#dde3eb]";return a.jsxs(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:ie*.05},className:"border border-[#dde3eb] rounded-xl overflow-hidden relative",children:[a.jsx("div",{className:`absolute top-2 right-2 text-[10px] font-bold uppercase px-2 py-0.5 rounded border ${ut} z-10`,children:z.bloomLevel}),a.jsx("div",{className:"p-4 cursor-pointer hover:bg-[#edf1f7] transition-colors",onClick:()=>Qe(Oe?null:ie),children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[a.jsxs("span",{className:"text-xs font-bold text-white bg-sky-600 px-2 py-0.5 rounded",children:["Q",ie+1]}),a.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${Jk[z.bloomLevel]?.color||"bg-[#edf1f7] text-[#5a6578]"}`,children:z.bloomLevel}),a.jsx("span",{className:`text-xs font-medium ${Dp[z.difficulty]||"text-[#5a6578]"}`,children:z.difficulty}),a.jsxs("span",{className:"text-xs text-slate-500",children:[z.points," pts"]}),a.jsx("span",{className:"text-xs bg-[#edf1f7] text-[#5a6578] px-2 py-0.5 rounded",children:z.topic})]}),a.jsx("p",{className:"text-sm text-[#0a1628] font-medium",children:z.question})]}),a.jsx("div",{className:"flex-shrink-0 mt-1",children:Oe?a.jsx(Es,{size:16,className:"text-slate-500"}):a.jsx(Hn,{size:16,className:"text-slate-500"})})]})}),a.jsx(Ke,{children:Oe&&a.jsx(J.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-t border-[#dde3eb] overflow-hidden",children:a.jsxs("div",{className:"p-4 space-y-3 bg-[#edf1f7]/50",children:[z.options&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-1",children:"Options:"}),a.jsx("div",{className:"space-y-1",children:z.options.map((ht,br)=>a.jsx("div",{className:`text-sm px-3 py-1.5 rounded-lg ${ht.includes(z.correctAnswer)?"bg-green-100 text-green-800 font-medium":"bg-white text-[#0a1628]"}`,children:ht},br))})]}),a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-green-700 mb-1",children:"Correct Answer:"}),a.jsx("p",{className:"text-sm text-green-800 font-medium",children:z.correctAnswer})]}),a.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-lg p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-sky-700 mb-1",children:"Explanation:"}),a.jsx("p",{className:"text-sm text-sky-800",children:z.explanation})]})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-500",children:[a.jsxs("span",{children:["Type: ",_p[z.questionType]?.label||z.questionType]}),a.jsxs("span",{children:["Bloom: ",z.bloomLevel]})]}),z.provenance&&a.jsxs("div",{className:"bg-[#f7fbff] border border-sky-100 rounded-lg p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-sky-700 mb-1",children:"Item Provenance"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-1 text-xs text-[#5a6578]",children:[z.provenance.title&&a.jsxs("p",{children:["Topic: ",z.provenance.title]}),z.provenance.topicId&&a.jsxs("p",{children:["Topic ID: ",z.provenance.topicId]}),z.provenance.materialId&&a.jsxs("p",{children:["Material ID: ",z.provenance.materialId]}),z.provenance.sourceFile&&a.jsxs("p",{children:["Source File: ",z.provenance.sourceFile]}),z.provenance.sectionId&&a.jsxs("p",{children:["Section ID: ",z.provenance.sectionId]})]})]})]})})})]},ie)};return a.jsxs("div",{className:"w-full flex flex-col bg-[#f7f9fc] min-h-screen",children:[a.jsxs("div",{className:"bg-white border-b border-[#dde3eb] px-6 py-4 flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("button",{onClick:Yd,className:"p-2 hover:bg-[#edf1f7] rounded-lg transition-colors text-slate-500",children:a.jsx(Ya,{size:20})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628]",children:"AI Quiz Maker"}),a.jsx("p",{className:"text-[#5a6578] text-sm mt-1",children:"Generate AI-powered assessments with Bloom's Taxonomy"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>c("create"),className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-semibold transition-colors ${l==="create"?"bg-sky-100 text-sky-700 border border-sky-300":"bg-[#edf1f7] text-[#5a6578] hover:bg-[#dde3eb]"}`,children:[a.jsx(yu,{size:16})," Create Quiz"]}),a.jsxs("button",{onClick:()=>c("bank"),className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-semibold transition-colors ${l==="bank"?"bg-sky-100 text-sky-700 border border-sky-300":"bg-[#edf1f7] text-[#5a6578] hover:bg-[#dde3eb]"}`,children:[a.jsx(Tv,{size:16})," Quiz Bank"]})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-6 sm:px-8 xl:px-10 py-8",children:[l==="bank"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:["all","draft","published","assigned","completed"].map(z=>a.jsx("button",{onClick:()=>xr(z),className:`px-3 py-1.5 rounded-full text-xs font-semibold capitalize transition-colors ${rs===z?"bg-sky-100 text-sky-700 border border-sky-300":"bg-[#edf1f7] text-[#5a6578] hover:bg-[#dde3eb]"}`,children:z},z))}),xn?a.jsxs("div",{className:"flex items-center justify-center py-16",children:[a.jsx(He,{size:24,className:"animate-spin text-sky-500"}),a.jsx("span",{className:"ml-2 text-sm text-[#5a6578]",children:"Loading quiz bank…"})]}):ty.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-slate-500",children:[a.jsx(Tv,{size:40,className:"mb-3"}),a.jsx("p",{className:"font-medium",children:"No quizzes found"}),a.jsx("p",{className:"text-xs mt-1",children:"Generate your first quiz in the Create tab"})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ty.map(z=>a.jsxs(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},onClick:()=>Jd(z),role:"button",tabIndex:0,onKeyDown:ie=>{(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),Jd(z))},className:"border border-[#dde3eb] rounded-xl p-4 hover:shadow-md transition-shadow cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] leading-tight",children:z.title}),a.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded-full capitalize ${Nte[z.status]}`,children:z.status})]}),a.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:z.metadata.topicsCovered.slice(0,3).map(ie=>a.jsx("span",{className:"text-[10px] bg-[#edf1f7] text-[#5a6578] px-2 py-0.5 rounded",children:ie},ie))}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#5a6578] mb-3",children:[a.jsxs("span",{children:[z.questions.length," questions"]}),a.jsxs("span",{children:[z.totalPoints," pts"]}),a.jsx("span",{children:z.gradeLevel})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),Jd(z)},className:"flex items-center gap-1 px-3 py-1.5 text-xs font-semibold bg-[#edf1f7] text-[#5a6578] rounded-lg hover:bg-[#dde3eb] transition-colors",children:[a.jsx(Bi,{size:12})," View"]}),a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),Qd(z.id)},className:"flex items-center gap-1 px-3 py-1.5 text-xs font-semibold bg-sky-50 text-sky-700 rounded-lg hover:bg-sky-100 transition-colors",children:[a.jsx(Aa,{size:12})," Assign"]}),a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),FM(z.id)},className:"flex items-center gap-1 px-3 py-1.5 text-xs font-semibold bg-red-50 text-red-600 rounded-lg hover:bg-red-100 transition-colors",children:[a.jsx(sa,{size:12})," Delete"]})]})]},z.id))})]}),l==="create"&&a.jsxs(a.Fragment,{children:[q&&a.jsxs(J.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-4 bg-red-50 border border-red-200 rounded-xl p-4 flex items-start gap-3",children:[a.jsx(Xr,{size:18,className:"text-red-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-red-800 font-medium",children:"Error"}),a.jsx("p",{className:"text-sm text-red-600",children:q})]}),a.jsx("button",{onClick:()=>W(""),className:"ml-auto",children:a.jsx(Xe,{size:14,className:"text-red-400"})})]}),M&&a.jsxs(J.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4 bg-white border border-sky-200 rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(He,{size:16,className:"animate-spin text-sky-600"}),a.jsx("p",{className:"text-sm font-semibold text-[#0a1628]",children:"Generating Quiz in Background"})]}),a.jsxs("span",{className:"text-xs font-bold text-sky-700",children:[ee,"%"]})]}),a.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:a.jsx(J.div,{animate:{width:`${ee}%`},transition:{duration:.35,ease:"easeOut"},className:"h-full bg-gradient-to-r from-sky-600 to-cyan-500"})}),a.jsxs("p",{className:"mt-2 text-xs text-[#5a6578] capitalize",children:["Stage: ",_.replace(/_/g," ")]}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:R}),Z&&a.jsxs("p",{className:"text-[11px] text-[#7b8798] mt-1",children:["Task ID: ",Z]})]}),d==="configure"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-4 flex items-start gap-3",children:[a.jsx(dx,{size:18,className:"text-sky-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-sky-800",children:"Supplemental Assessment Tool"}),a.jsx("p",{className:"text-xs text-sky-600",children:"This quiz maker generates supplemental assessments to support your classroom instruction — it does not replace teacher-led learning. Questions follow Bloom's Taxonomy for comprehensive skill evaluation."}),a.jsxs("p",{className:"text-[11px] text-sky-400 mt-1 flex items-center gap-1",children:[a.jsx(Xr,{size:11}),"Generation limit: up to ",Mi," questions and ",fs," topics per quiz."]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"quiz-grade-level",className:"text-sm font-semibold text-[#0a1628] mb-1.5 block",children:"Grade Level"}),a.jsx("select",{id:"quiz-grade-level",value:u,onChange:z=>m(Ip(z.target.value)),className:"w-full border border-[#dde3eb] rounded-xl px-4 py-2.5 text-sm focus:ring-2 focus:ring-sky-500 focus:border-sky-500 outline-none bg-white",children:Ste.map(z=>a.jsx("option",{value:z,children:z},z))})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"quiz-num-questions",className:"text-sm font-semibold text-[#0a1628] mb-1.5 block",children:"Number of Questions"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:()=>g(Math.max(1,h-1)),className:"w-9 h-9 border border-[#dde3eb] rounded-lg flex items-center justify-center hover:bg-[#edf1f7] transition-colors",children:a.jsx(Qi,{size:14})}),a.jsx("input",{id:"quiz-num-questions",type:"number",min:1,max:Mi,value:h,onChange:z=>g(Math.min(Mi,Math.max(1,parseInt(z.target.value)||1))),className:"w-20 text-center border border-[#dde3eb] rounded-xl px-3 py-2.5 text-sm font-semibold focus:ring-2 focus:ring-sky-500 outline-none bg-white"}),a.jsx("button",{onClick:()=>g(Math.min(Mi,h+1)),className:"w-9 h-9 border border-[#dde3eb] rounded-lg flex items-center justify-center hover:bg-[#edf1f7] transition-colors",children:a.jsx(Qr,{size:14})})]})]})]}),al("topics","Topics",a.jsx(De,{size:16}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"bg-[#f6f9ff] border border-[#dde3eb] rounded-lg p-3",children:[a.jsxs("p",{className:"text-xs font-semibold text-[#0a1628]",children:["Imported topic context",r?` for ${r}`:""]}),a.jsx("p",{className:"text-xs text-[#5a6578] mt-1",children:O?"Loading imported topics...":Y.length>0?`${Y.length} imported topic${Y.length!==1?"s":""} available and prioritized during generation`:"No imported topics found for the current class context"}),B&&a.jsx("p",{className:"text-[11px] text-amber-700 mt-1",children:B})]}),P?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#5a6578]",children:[a.jsx(He,{size:14,className:"animate-spin"})," Loading topics..."]}):Object.entries(Hd).map(([z,ie])=>a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-[#5a6578] uppercase tracking-wide mb-2",children:z}),a.jsx("div",{className:"flex flex-wrap gap-2",children:ie.map(oe=>{const Oe=x.includes(oe),ut=j.includes(oe);return a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>PM(oe),className:`text-xs px-3 py-1.5 rounded-full border transition-all ${Oe?"bg-sky-100 border-sky-400 text-sky-700 font-medium":ut?"bg-red-50 border-red-200 text-red-400 line-through":"bg-white border-[#dde3eb] text-[#5a6578] hover:border-sky-300"}`,children:oe}),a.jsx("button",{onClick:()=>MM(oe),title:ut?"Include this topic":"Exclude this topic",className:`w-5 h-5 rounded-full flex items-center justify-center text-[10px] transition-colors ${ut?"bg-red-500 text-white":"bg-[#edf1f7] text-slate-500 hover:bg-red-100 hover:text-red-500"}`,children:a.jsx(Xe,{size:10})})]},oe)})})]},z)),x.length>0&&a.jsxs("p",{className:`text-xs mt-2 ${x.filter(z=>!j.includes(z)).length>fs?"text-rose-600 font-medium":"text-sky-600"}`,children:[x.filter(z=>!j.includes(z)).length," topic",x.filter(z=>!j.includes(z)).length!==1?"s":""," selected",x.filter(z=>!j.includes(z)).length>fs&&` (only first ${fs} will be used)`]}),j.length>0&&a.jsxs("p",{className:"text-xs text-red-500 mt-1",children:[j.length," topic",j.length!==1?"s":""," excluded (class already competent)"]})]})),al("types","Question Types",a.jsx(ad,{size:16}),a.jsxs("div",{className:"space-y-2",children:[Object.entries(_p).map(([z,ie])=>a.jsxs("button",{onClick:()=>EM(z),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left ${y.includes(z)?"bg-sky-50 border-sky-300 text-sky-700":"bg-white border-[#dde3eb] text-[#5a6578] hover:border-sky-200"}`,children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${y.includes(z)?"bg-sky-200":"bg-[#edf1f7]"}`,children:ie.icon}),a.jsxs("div",{className:"flex-1",children:[a.jsx("span",{className:"text-sm font-medium",children:ie.label}),a.jsx("p",{className:"text-xs text-slate-500",children:ie.description})]}),y.includes(z)&&a.jsx(jr,{size:16,className:"text-sky-600"})]},z)),a.jsxs("label",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-[#dde3eb] cursor-pointer hover:bg-[#edf1f7] transition-colors mt-3",children:[a.jsx("input",{type:"checkbox",checked:k,onChange:z=>A(z.target.checked),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("span",{className:"text-sm font-medium text-[#0a1628]",children:"Include Graph Questions"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Generates identification-type questions about graphs (text-described, as graphing is challenging for students)"})]})]})]})),al("bloom",a.jsxs("span",{className:"flex items-center gap-2",children:["Bloom's Taxonomy Levels",a.jsx("span",{role:"button",tabIndex:0,onClick:z=>{z.stopPropagation(),en(!0)},onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.stopPropagation(),en(!0))},className:"w-5 h-5 rounded-full bg-cyan-100 hover:bg-cyan-200 flex items-center justify-center transition-colors cursor-pointer",title:"What is Bloom's Taxonomy?",children:a.jsx(Yr,{size:12,className:"text-sky-600"})})]}),a.jsx(fr,{size:16}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"bg-[#edf1f7] rounded-lg p-3 mb-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Yr,{size:14,className:"text-slate-500 flex-shrink-0 mt-0.5"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Bloom's Taxonomy ensures questions assess different cognitive levels — from basic fact recall to complex analysis — providing comprehensive skill evaluation."})]})}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(Jk).map(([z,ie])=>a.jsxs("button",{onClick:()=>_M(z),className:`flex items-center gap-2 px-3 py-2.5 rounded-xl border transition-all ${b.includes(z)?ie.color+" font-medium":"bg-white border-[#dde3eb] text-[#5a6578]"}`,children:[a.jsx("span",{className:"text-sm",children:ie.label}),a.jsx("span",{className:"text-[10px] text-slate-500 ml-auto",children:ie.description})]},z))})]})),al("difficulty","Difficulty Distribution",a.jsx(wn,{size:16}),a.jsxs("div",{className:"space-y-4",children:[Object.entries(C).map(([z,ie])=>a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("span",{className:`text-sm font-medium w-16 capitalize ${Dp[z]}`,children:z}),a.jsx("div",{className:"flex-1 h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:a.jsx(J.div,{animate:{width:`${ie}%`},className:`h-full rounded-full ${z==="easy"?"bg-green-500":z==="medium"?"bg-rose-500":"bg-red-500"}`})}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>Kb(z,-5),className:"w-6 h-6 rounded border border-[#dde3eb] flex items-center justify-center hover:bg-[#edf1f7] text-slate-500",children:a.jsx(Qi,{size:10})}),a.jsxs("span",{className:"text-sm font-bold w-10 text-center",children:[ie,"%"]}),a.jsx("button",{onClick:()=>Kb(z,5),className:"w-6 h-6 rounded border border-[#dde3eb] flex items-center justify-center hover:bg-[#edf1f7] text-slate-500",children:a.jsx(Qr,{size:10})})]})]},z)),a.jsxs("p",{className:"text-xs text-slate-500 text-center",children:["Total: ",Object.values(C).reduce((z,ie)=>z+ie,0),"%"]})]}))]}),d==="preview"&&te&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4 flex items-start gap-3",children:[a.jsx(Bi,{size:18,className:"text-rose-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-rose-800",children:"Preview Mode"}),a.jsxs("p",{className:"text-xs text-rose-600",children:["Showing ",te.questions.length," sample questions. Click each question to reveal its answer and explanation. Review quality before generating the full quiz."]})]})]}),te.questions.map((z,ie)=>ny(z,ie)),a.jsxs("div",{className:"bg-[#edf1f7] rounded-xl p-4",children:[a.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Preview Metadata"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs text-[#5a6578]",children:[a.jsxs("span",{children:["Topics: ",Object.keys(te.metadata.topicsCovered).join(", ")]}),a.jsxs("span",{children:["Total Points: ",te.totalPoints]})]})]})]}),d==="results"&&ae&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-gradient-to-br from-sky-50 to-cyan-50 border border-sky-200 rounded-xl p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-bold font-display text-[#0a1628]",children:"Quiz Generated"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:DM,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[de?a.jsx(jr,{size:14,className:"text-green-500"}):a.jsx(z8,{size:14}),de?"Copied!":"Copy All"]}),a.jsxs("button",{onClick:RM,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[a.jsx(qa,{size:14}),"Export JSON"]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[a.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-sky-600",children:ae.questions.length}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Questions"})]}),a.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-rose-600",children:ae.totalPoints}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Total Points"})]}),a.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-rose-600",children:Object.keys(ae.metadata.topicsCovered).length}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Topics"})]}),a.jsxs("div",{className:"bg-white rounded-xl p-3 text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-emerald-600",children:Object.keys(ae.metadata.bloomTaxonomyDistribution).length}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Bloom Levels"})]})]}),(ae.metadata.usedImportedTopics||(ae.metadata.topicProvenance||[]).length>0)&&a.jsxs("div",{className:"mt-4 bg-white rounded-lg p-3 border border-[#dde3eb]",children:[a.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Imported Topic Provenance"}),a.jsxs("p",{className:"text-xs text-[#5a6578] mb-2",children:["Imported topics used: ",ae.metadata.usedImportedTopics?"Yes":"No"," • ","Materials: ",ae.metadata.importedMaterialsCount??0," • ","Topics: ",ae.metadata.importedTopicCount??0]}),(ae.metadata.topicProvenance||[]).slice(0,5).map((z,ie)=>a.jsxs("div",{className:"text-xs text-[#5a6578]",children:[z.title||"Untitled topic",z.sourceFile?` • ${z.sourceFile}`:""]},`${z.topicId||z.title||"topic"}_${ie}`)),(Wb.length>0||Hb.length>0)&&a.jsxs("div",{className:"mt-3 grid grid-cols-1 md:grid-cols-2 gap-2",children:[a.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[a.jsx("span",{className:"font-semibold",children:"Filter by Source File"}),a.jsxs("select",{value:tn,onChange:z=>pn(z.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[a.jsx("option",{value:"all",children:"All sources"}),Wb.map(z=>a.jsx("option",{value:z,children:z},z))]})]}),a.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[a.jsx("span",{className:"font-semibold",children:"Filter by Material ID"}),a.jsxs("select",{value:Ft,onChange:z=>me(z.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[a.jsx("option",{value:"all",children:"All materials"}),Hb.map(z=>a.jsx("option",{value:z,children:z},z))]})]})]}),a.jsxs("p",{className:"text-[11px] text-[#5a6578] mt-2",children:["Showing ",Kd.length," of ",ae.questions.length," questions after provenance filters."]})]}),a.jsxs("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-3",children:[a.jsxs("div",{className:"bg-white rounded-lg p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Difficulty"}),Object.entries(ae.metadata.difficultyBreakdown).map(([z,ie])=>a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:`capitalize ${Dp[z]||"text-[#5a6578]"}`,children:z}),a.jsx("span",{className:"font-medium",children:ie})]},z))]}),a.jsxs("div",{className:"bg-white rounded-lg p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Bloom's Taxonomy"}),Object.entries(ae.metadata.bloomTaxonomyDistribution).map(([z,ie])=>a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"capitalize",children:z}),a.jsx("span",{className:"font-medium",children:ie})]},z))]}),a.jsxs("div",{className:"bg-white rounded-lg p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Question Types"}),Object.entries(ae.metadata.questionTypeBreakdown).map(([z,ie])=>a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{children:_p[z]?.label||z}),a.jsx("span",{className:"font-medium",children:ie})]},z))]})]}),a.jsxs("div",{className:"mt-3 bg-sky-50 rounded-lg p-3 flex items-start gap-2",children:[a.jsx(Yr,{size:14,className:"text-sky-400 flex-shrink-0 mt-0.5"}),a.jsx("p",{className:"text-xs text-sky-600",children:ae.metadata.supplementalPurpose})]}),ae.metadata.recommendedTeacherActions&&a.jsxs("div",{className:"mt-3",children:[a.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-1",children:"Recommended Actions:"}),a.jsx("ul",{className:"list-disc list-inside text-xs text-[#5a6578] space-y-0.5",children:ae.metadata.recommendedTeacherActions.map((z,ie)=>a.jsx("li",{children:z},ie))})]})]}),a.jsx("div",{className:"space-y-3",children:Kd.length>0?Kd.map((z,ie)=>ny(z,ie)):a.jsx("div",{className:"border border-[#dde3eb] rounded-xl p-4 bg-white text-sm text-[#5a6578]",children:"No questions match the selected provenance filters. Clear one or both filters to view all questions."})})]})]})]}),l==="create"&&a.jsxs("div",{className:"border-t border-[#dde3eb] px-6 sm:px-6 xl:px-10 py-4 bg-white flex items-center justify-between flex-shrink-0",children:[a.jsxs("div",{className:"text-xs text-slate-500",children:[d==="configure"&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ra,{size:12})," Powered by Qwen/Qwen3.5-9B"]}),d==="preview"&&a.jsxs("span",{children:["Preview: ",te?.questions.length||0," sample questions"]}),d==="results"&&a.jsxs("span",{children:[ae?.questions.length||0," questions • ",ae?.totalPoints||0," points"]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[d==="configure"&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:OM,disabled:!rl||X,className:`flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${rl&&!X?"bg-white border border-sky-300 text-sky-700 hover:bg-sky-50":"bg-[#edf1f7] text-slate-500 cursor-not-allowed"}`,children:[X?a.jsx(He,{size:16,className:"animate-spin"}):a.jsx(Bi,{size:16}),"Preview (3 Qs)"]}),a.jsxs("button",{onClick:Yb,disabled:!rl||M,className:`flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-bold transition-all ${rl&&!M?"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white shadow-lg shadow-sky-200":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[M?a.jsx(He,{size:16,className:"animate-spin"}):a.jsx(yu,{size:16}),M?`Generating... ${ee}%`:"Generate Quiz"]})]}),d==="preview"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>f("configure"),className:"px-4 py-2.5 rounded-xl text-sm font-medium bg-white border border-[#dde3eb] text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:"Back to Configure"}),a.jsxs("button",{onClick:Yb,disabled:M,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-bold bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white shadow-lg shadow-sky-200 transition-all",children:[M?a.jsx(He,{size:16,className:"animate-spin"}):a.jsx(yu,{size:16}),M?`Generating... ${ee}%`:`Generate Full Quiz (${h} Qs)`]})]}),d==="results"&&(Vb?a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>{c("bank"),nl(null)},className:"px-4 py-2.5 rounded-xl text-sm font-medium bg-white border border-[#dde3eb] text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:"Back to Quiz Bank"}),a.jsxs("button",{onClick:()=>Qd(Vb),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-sky-50 border border-sky-300 text-sky-700 hover:bg-sky-100 transition-colors",children:[a.jsx(Aa,{size:16})," Assign"]}),a.jsx("button",{onClick:Yd,className:"px-5 py-2.5 rounded-xl text-sm font-bold bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white transition-all",children:"Done"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>{f("configure"),re(null),se(null),mt(null),nl(null)},className:"px-4 py-2.5 rounded-xl text-sm font-medium bg-white border border-[#dde3eb] text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:"Create Another"}),Ee?a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:$M,disabled:Wt,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-green-50 border border-green-300 text-green-700 hover:bg-green-100 transition-colors",children:[Wt?a.jsx(He,{size:16,className:"animate-spin"}):a.jsx(ot,{size:16}),"Publish"]}),a.jsxs("button",{onClick:()=>Qd(),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-sky-50 border border-sky-300 text-sky-700 hover:bg-sky-100 transition-colors",children:[a.jsx(Aa,{size:16})," Assign"]})]}):a.jsxs("button",{onClick:LM,disabled:je,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-semibold bg-emerald-50 border border-emerald-300 text-emerald-700 hover:bg-emerald-100 transition-colors",children:[je?a.jsx(He,{size:16,className:"animate-spin"}):a.jsx(id,{size:16}),"Save to Library"]}),a.jsx("button",{onClick:Yd,className:"px-5 py-2.5 rounded-xl text-sm font-bold bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white transition-all",children:"Done"})]}))]})]}),a.jsx(jte,{isOpen:Te,onClose:()=>en(!1)}),a.jsx(Ke,{children:hi&&a.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/40 z-[60] flex items-center justify-center p-4",onClick:()=>dn(!1),children:a.jsxs(J.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-[#f7f9fc] rounded-2xl shadow-2xl w-full max-w-md max-h-[70vh] flex flex-col overflow-hidden border border-[#dde3eb]",onClick:z=>z.stopPropagation(),children:[a.jsxs("div",{className:"px-5 py-4 border-b border-[#dde3eb] flex items-center justify-between",children:[a.jsxs("h3",{className:"text-base font-bold font-display text-[#0a1628] flex items-center gap-2",children:[a.jsx(kt,{size:18,className:"text-sky-600"}),"Assign to Student"]}),a.jsx("button",{onClick:()=>dn(!1),className:"p-1 hover:bg-[#edf1f7] rounded-lg transition-colors",children:a.jsx(Xe,{size:16,className:"text-slate-500"})})]}),a.jsx("div",{className:"px-5 py-3 border-b border-[#dde3eb]",children:a.jsxs("div",{className:"flex items-center gap-2 bg-[#edf1f7] rounded-xl px-3 py-2",children:[a.jsx(_n,{size:14,className:"text-slate-500"}),a.jsx("input",{type:"text",placeholder:"Search students…",value:wt,onChange:z=>Ht(z.target.value),className:"flex-1 bg-transparent text-sm outline-none placeholder:text-slate-500"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:Ie?a.jsx("div",{className:"flex items-center justify-center py-10",children:a.jsx(He,{size:20,className:"animate-spin text-sky-500"})}):ey.length===0?a.jsx("p",{className:"text-center text-sm text-slate-500 py-10",children:"No students found"}):ey.map(z=>a.jsxs("button",{onClick:()=>jt(z.id),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-left transition-colors ${Sn===z.id?"bg-sky-50 border border-sky-300":"hover:bg-[#edf1f7] border border-transparent"}`,children:[a.jsx("img",{src:z.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(z.name)}&background=random&size=32`,alt:z.name,className:"w-8 h-8 rounded-lg object-cover"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-semibold text-[#0a1628] truncate",children:z.name}),a.jsx("p",{className:"text-xs text-slate-500 truncate",children:z.email})]}),Sn===z.id&&a.jsx(jr,{size:16,className:"text-sky-600 flex-shrink-0"})]},z.id))}),a.jsxs("div",{className:"px-5 py-3 border-t border-[#dde3eb] flex justify-end gap-2",children:[a.jsx("button",{onClick:()=>dn(!1),className:"px-4 py-2 text-sm font-medium text-[#5a6578] hover:bg-[#edf1f7] rounded-xl transition-colors",children:"Cancel"}),a.jsxs("button",{onClick:zM,disabled:!Sn||pi,className:`flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-bold transition-all ${Sn&&!pi?"bg-gradient-to-r from-sky-600 to-sky-500 text-white shadow-sm":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[pi?a.jsx(He,{size:14,className:"animate-spin"}):a.jsx(Aa,{size:14}),"Assign"]})]})]})})})]})},Tte={"gen-math":{label:"GEN MATH",color:"bg-sky-100 text-sky-700"},"stats-prob":{label:"STAT&PROB",color:"bg-sky-100 text-sky-700"},"pre-calc":{label:"PRE-CALC",color:"bg-orange-100 text-orange-700"},"basic-calc":{label:"BASIC CALC",color:"bg-red-100 text-red-700"}},Pte={mastered:{label:"MASTERED BY CLASS",color:"bg-green-100 text-green-700 border-green-300"},on_track:{label:"ON TRACK",color:"bg-sky-100 text-sky-700 border-sky-300"},needs_attention:{label:"NEEDS ATTENTION",color:"bg-red-100 text-red-700 border-red-300"},no_data:{label:"NO DATA YET",color:"bg-[#edf1f7] text-[#5a6578] border-[#dde3eb]"}},t5={needs_attention:0,on_track:1,no_data:2,mastered:3},Mte=({classSectionId:e})=>{const{currentUser:t}=$t(),[n,r]=v.useState([]),[s,i]=v.useState({totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0}),[o,l]=v.useState(!0),[c,d]=v.useState("all"),[f,u]=v.useState("all"),[m,h]=v.useState(""),[g,x]=v.useState("classAverage"),[p,j]=v.useState("asc"),S=Va.map(O=>O.id),y=Va.reduce((O,E)=>(O[E.id]=E.name,O),{}),[N,b]=v.useState(new Set),[w,k]=v.useState([]),A=v.useCallback(async()=>{if(t){l(!0);try{const O=Me(fe,"teachers",t.uid,"settings","quizSettings"),E=await Lt(O),B=E.exists()?E.data()?.excludedTopics||[]:[];k(B);const T="https://deign86-mathpulse-api-v3test.hf.space",M=new URLSearchParams({teacherId:t.uid});e&&M.set("classSectionId",e);const K=await t.getIdToken(),X=await fetch(`${T}/api/analytics/topic-mastery?${M.toString()}`,{headers:{Authorization:`Bearer ${K}`}});if(X.ok){const I=await X.json(),Z=(I.topics||[]).map(ne=>({...ne,isExcluded:B.includes(ne.topicName)}));r(Z),i(I.summary||{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:B.length})}else r([]),i({totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:B.length})}catch{r([]),i({totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:w.length})}finally{l(!1)}}},[e,t]);v.useEffect(()=>{A()},[A]);const C=async O=>{if(!t)return;const E=w.includes(O)?w.filter(B=>B!==O):[...w,O];k(E),r(B=>B.map(T=>T.topicName===O?{...T,isExcluded:!T.isExcluded}:T)),i(B=>({...B,excludedCount:E.length}));try{const B=Me(fe,"teachers",t.uid,"settings","quizSettings");(await Lt(B)).exists()?await vt(B,{excludedTopics:E}):await rt(B,{excludedTopics:E})}catch{ue.error("Failed to update excluded topics")}},F=async()=>{if(!t)return;const O=[...new Set([...w,...N])];k(O),r(E=>E.map(B=>N.has(B.topicName)?{...B,isExcluded:!0}:B)),i(E=>({...E,excludedCount:O.length})),b(new Set);try{const E=Me(fe,"teachers",t.uid,"settings","quizSettings");(await Lt(E)).exists()?await vt(E,{excludedTopics:O}):await rt(E,{excludedTopics:O}),ue.success(`${N.size} topics excluded from quizzes`)}catch{ue.error("Failed to update")}},D=async()=>{if(!t)return;const O=w.filter(E=>!N.has(E));k(O),r(E=>E.map(B=>N.has(B.topicName)?{...B,isExcluded:!1}:B)),i(E=>({...E,excludedCount:O.length})),b(new Set);try{const E=Me(fe,"teachers",t.uid,"settings","quizSettings");(await Lt(E)).exists()?await vt(E,{excludedTopics:O}):await rt(E,{excludedTopics:O}),ue.success(`${N.size} topics re-included in quizzes`)}catch{ue.error("Failed to update")}},L=O=>{g===O?j(E=>E==="asc"?"desc":"asc"):(x(O),j("asc"))},P=f==="all"?S:ld(f);v.useEffect(()=>{c!=="all"&&(P.includes(c)||d("all"))},[P,c]);const H=n.filter(O=>!(c!=="all"&&O.subjectId!==c||!P.includes(O.subjectId)||m&&!O.topicName.toLowerCase().includes(m.toLowerCase()))).sort((O,E)=>{const B=p==="asc"?1:-1;switch(g){case"topicName":return B*O.topicName.localeCompare(E.topicName);case"classAverage":return B*(O.classAverage-E.classAverage);case"studentsAttempted":return B*(O.studentsAttempted-E.studentsAttempted);case"masteryStatus":return B*((t5[O.masteryStatus]||0)-(t5[E.masteryStatus]||0));default:return 0}}),Y=()=>{N.size===H.length?b(new Set):b(new Set(H.map(O=>O.topicName)))},V=({field:O})=>g!==O?a.jsx(Hn,{size:12,className:"text-slate-500"}):p==="asc"?a.jsx(Es,{size:12,className:"text-sky-600"}):a.jsx(Hn,{size:12,className:"text-sky-600"});return o?a.jsxs("div",{className:"flex items-center justify-center py-20",children:[a.jsx(He,{size:24,className:"animate-spin text-sky-500"}),a.jsx("span",{className:"ml-2 text-[#5a6578]",children:"Loading topic mastery data..."})]}):a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:"Class Topic Mastery"}),a.jsx("p",{className:"text-sm text-[#5a6578] mt-1",children:"Topics where 75% or more of the class scored 85%+ are marked as mastered and can be excluded from future quiz generation."})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb]",children:[a.jsx("div",{className:"flex items-center gap-3 mb-2",children:a.jsx("div",{className:"w-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center",children:a.jsx(wn,{size:20,className:"text-sky-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:s.totalTopicsTracked}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Total Topics Tracked"})]}),a.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-green-200",children:[a.jsx("div",{className:"flex items-center gap-3 mb-2",children:a.jsx("div",{className:"w-10 h-10 bg-green-100 rounded-xl flex items-center justify-center",children:a.jsx(Kn,{size:20,className:"text-green-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-green-600",children:s.masteredCount}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Mastered by Class"})]}),a.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-red-200",children:[a.jsx("div",{className:"flex items-center gap-3 mb-2",children:a.jsx("div",{className:"w-10 h-10 bg-red-100 rounded-xl flex items-center justify-center",children:a.jsx(Gt,{size:20,className:"text-red-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-red-600",children:s.needsAttentionCount}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Needs Work"})]}),a.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb]",children:[a.jsx("div",{className:"flex items-center gap-3 mb-2",children:a.jsx("div",{className:"w-10 h-10 bg-[#edf1f7] rounded-xl flex items-center justify-center",children:a.jsx(dC,{size:20,className:"text-[#5a6578]"})})}),a.jsx("p",{className:"text-2xl font-bold text-[#5a6578]",children:s.excludedCount}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Excluded Topics"})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2 bg-white rounded-xl px-3 py-2 border border-[#dde3eb]",children:[a.jsx(_n,{size:14,className:"text-slate-500"}),a.jsx("input",{type:"text",placeholder:"Search topics...",value:m,onChange:O=>h(O.target.value),className:"bg-transparent text-sm outline-none w-40 placeholder:text-slate-500"})]}),a.jsxs("select",{value:c,onChange:O=>d(O.target.value),className:"bg-white border border-[#dde3eb] rounded-xl px-3 py-2 text-sm outline-none",children:[a.jsx("option",{value:"all",children:"All Subjects"}),P.map(O=>a.jsx("option",{value:O,children:y[O]||O},O))]}),a.jsxs("select",{value:f,onChange:O=>u(O.target.value),className:"bg-white border border-[#dde3eb] rounded-xl px-3 py-2 text-sm outline-none",children:[a.jsx("option",{value:"all",children:"All Grades"}),OL.map(O=>a.jsx("option",{value:O,children:O},O))]})]}),a.jsx(Ke,{children:N.size>0&&a.jsxs(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-sky-50 border border-sky-200 rounded-xl p-3 flex items-center gap-3 flex-wrap overflow-hidden",children:[a.jsxs("span",{className:"text-sm font-semibold text-sky-700",children:[N.size," topics selected"]}),a.jsx("button",{onClick:F,className:"px-3 py-1.5 bg-[#5a6578] text-white text-xs font-bold rounded-lg hover:bg-sky-600 transition-colors",children:"Exclude Selected Topics"}),a.jsx("button",{onClick:D,className:"px-3 py-1.5 bg-green-600 text-white text-xs font-bold rounded-lg hover:bg-green-700 transition-colors",children:"Include Selected Topics"}),a.jsx("button",{onClick:()=>b(new Set),className:"px-3 py-1.5 bg-white border border-[#dde3eb] text-[#5a6578] text-xs font-bold rounded-lg hover:bg-[#edf1f7] transition-colors",children:"Clear Selection"})]})}),a.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-[#dde3eb] overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[a.jsx("th",{className:"px-4 py-3 w-10",children:a.jsx("input",{type:"checkbox",checked:N.size===H.length&&H.length>0,onChange:Y,className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),a.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>L("topicName"),children:a.jsxs("span",{className:"flex items-center gap-1",children:["Topic Name ",a.jsx(V,{field:"topicName"})]})}),a.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide",children:"Unit"}),a.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>L("classAverage"),children:a.jsxs("span",{className:"flex items-center gap-1",children:["Class Avg % ",a.jsx(V,{field:"classAverage"})]})}),a.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>L("studentsAttempted"),children:a.jsxs("span",{className:"flex items-center gap-1",children:["Students ",a.jsx(V,{field:"studentsAttempted"})]})}),a.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide cursor-pointer hover:text-sky-600",onClick:()=>L("masteryStatus"),children:a.jsxs("span",{className:"flex items-center gap-1",children:["Status ",a.jsx(V,{field:"masteryStatus"})]})}),a.jsx("th",{className:"px-4 py-3 text-xs font-bold text-[#5a6578] uppercase tracking-wide",children:"Exclude"})]})}),a.jsx("tbody",{children:H.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:7,className:"px-4 py-16 text-center",children:n.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a.jsx(wn,{size:32,className:"text-[#dde3eb]"}),a.jsx("p",{className:"text-sm font-medium text-[#5a6578]",children:"No topic data available yet"}),a.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Import student quiz data to see class topic mastery analytics."})]}):a.jsx("span",{className:"text-sm text-slate-500",children:"No topics match the current filters."})})}):H.map(O=>{const E=N.has(O.topicName),B=Pte[O.masteryStatus],T=Tte[O.subjectId]||{label:O.subjectId.toUpperCase(),color:"bg-[#edf1f7] text-[#5a6578]"},M=O.classAverage<60?"bg-red-500":O.classAverage<85?"bg-rose-500":"bg-green-500",K=O.isExcluded?"bg-[#edf1f7] opacity-60":O.masteryStatus==="needs_attention"?"bg-red-50/30":O.masteryStatus==="mastered"?"bg-green-50/30":"";return a.jsxs("tr",{className:`border-b border-[#dde3eb] hover:bg-[#edf1f7] transition-colors ${K} ${O.isExcluded?"line-through decoration-slate-400":""}`,children:[a.jsx("td",{className:"px-4 py-3",children:a.jsx("input",{type:"checkbox",checked:E,onChange:()=>{const X=new Set(N);E?X.delete(O.topicName):X.add(O.topicName),b(X)},className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-[#0a1628]",children:O.topicName}),a.jsx("span",{className:`text-[10px] font-bold px-1.5 py-0.5 rounded ${T.color}`,children:T.label})]})}),a.jsx("td",{className:"px-4 py-3 text-xs text-[#5a6578]",children:O.unit}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1 h-2 bg-[#edf1f7] rounded-full overflow-hidden max-w-20",children:a.jsx("div",{className:`h-full rounded-full ${M}`,style:{width:`${O.classAverage}%`}})}),a.jsxs("span",{className:"text-xs font-bold text-[#0a1628] w-8 text-right",children:[O.classAverage,"%"]})]})}),a.jsxs("td",{className:"px-4 py-3 text-xs text-[#5a6578]",children:[O.studentsAttempted,"/",O.totalStudents]}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded border ${B.color}`,children:B.label})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"group relative",children:[a.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:O.isExcluded,onChange:()=>C(O.topicName),className:"sr-only peer"}),a.jsx("div",{className:"w-9 h-5 bg-[#dde3eb] peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-[#dde3eb] after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#5a6578]"})]}),a.jsx("div",{className:"hidden group-hover:block absolute z-20 bottom-full left-0 mb-1 px-2 py-1 bg-slate-800 text-white text-[10px] rounded whitespace-nowrap",children:"Excluded topics will not appear in AI-generated quizzes for your class"})]})})]},O.topicName)})})]})})})]})};function pM(e){return(e||"").trim().toLowerCase()}function n5(e){const t=(e.lrn||"").trim().toLowerCase();if(t)return`lrn:${t}`;const n=(e.email||"").trim().toLowerCase();if(n)return`email:${n}`;const r=e.name.trim().toLowerCase();if(r)return`name:${r}`;const s=pM(e.classSectionId),i=(e.id||"").trim().toLowerCase();return s&&i?`${s}|id:${i}`:i?`id:${i}`:`${s}|anonymous`}function Ete(e,t){const n=[],r=(e.lrn||"").trim().toLowerCase(),s=(e.email||"").trim().toLowerCase(),i=e.name.trim().toLowerCase(),o=(e.id||"").trim().toLowerCase();return r&&n.push(`${t}|lrn:${r}`),s&&n.push(`${t}|email:${s}`),i&&n.push(`${t}|name:${i}`),o&&n.push(`${t}|id:${o}`),n.length===0&&n.push(`${t}|anonymous`),n}function _te(e,t){const n=[e.riskLevel,t.riskLevel].includes("High")?"High":[e.riskLevel,t.riskLevel].includes("Medium")?"Medium":"Low";return{...e,lrn:e.lrn||t.lrn,classSectionId:e.classSectionId??t.classSectionId,avgQuizScore:t.avgQuizScore>0?t.avgQuizScore:e.avgQuizScore,engagementScore:t.engagementScore>0?t.engagementScore:e.engagementScore,weakestTopic:e.weakestTopic&&e.weakestTopic!=="Foundational Skills"?e.weakestTopic:t.weakestTopic,riskLevel:n}}function xM(e,t){const n=new Map,r=new Map,s=t?pM(t):"all";return e.forEach(i=>{const o=Ete(i,s),l=o.map(f=>r.get(f)).find(Boolean)||o[0],c=n.get(l),d=c?_te(c,i):i;n.set(l,d),o.forEach(f=>r.set(f,l))}),Array.from(n.values())}function r5(e,t){return xM([...e,...t])}function Na(e){return Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Ite(e){if(!e)return null;const t="gen-math",n=ia.find(o=>o.id===t)?.modules||[];if(n.length===0)return null;const r={mastery:0,concept:0,application:0,engagement:0,consistency:0},s=e.lessons??{};n.forEach(o=>{const l=ia.find(p=>p.modules.some(j=>j.id===o.id)),c=l?e?.subjects?.[l.id]?.modulesProgress?.[o.id]:null,d=Na(c?.progress||0),f=o.lessons.length?o.lessons.reduce((p,j)=>{const S=s?.[j.id]?.score;if(typeof S=="number"&&Number.isFinite(S))return p+Na(S);const y=!!c?.lessonsCompleted?.includes?.(j.id);return p+(y?100:0)},0)/o.lessons.length:0,u=o.quizzes.length?(c?.quizzesCompleted?.length||0)/o.quizzes.length*100:0,m=Na(f),h=Na(u),g=Na(Math.min(100,(m+h*2)/1.5)),x=Na(Math.min(100,40+d*.6));r.mastery+=d,r.concept+=m,r.application+=h,r.engagement+=g,r.consistency+=x});const i=n.length;return{mastery:Math.round(r.mastery/i),concept:Math.round(r.concept/i),application:Math.round(r.application/i),engagement:Math.round(r.engagement/i),consistency:Math.round(r.consistency/i)}}const Rp={High:{bg:"bg-red-100",text:"text-red-700",ring:"ring-red-300"},Medium:{bg:"bg-rose-100",text:"text-rose-700",ring:"ring-rose-300"},Low:{bg:"bg-green-100",text:"text-green-700",ring:"ring-green-300"}},a5={advanced:{bg:"bg-emerald-100",text:"text-emerald-700",bar:"bg-emerald-500"},proficient:{bg:"bg-sky-100",text:"text-sky-700",bar:"bg-sky-500"},developing:{bg:"bg-rose-100",text:"text-rose-700",bar:"bg-rose-500"},beginner:{bg:"bg-red-100",text:"text-red-700",bar:"bg-red-500"}},s5=[{key:"mastery",short:"M",label:"Overall Mastery",header:"Mastery"},{key:"concept",short:"C",label:"Concept Grasp",header:"Concept"},{key:"application",short:"A",label:"Application",header:"Application"},{key:"engagement",short:"E",label:"Engagement",header:"Engagement"},{key:"consistency",short:"S",label:"Consistency",header:"Consistency"}];function Ote(e){const t=Na(e);return t>=80?{bg:"bg-[color-mix(in_srgb,var(--chart-3)_14%,transparent)]",text:"text-[var(--chart-3)]",ring:"ring-[color-mix(in_srgb,var(--chart-3)_40%,transparent)]"}:t>=60?{bg:"bg-[color-mix(in_srgb,var(--chart-4)_14%,transparent)]",text:"text-[var(--chart-4)]",ring:"ring-[color-mix(in_srgb,var(--chart-4)_40%,transparent)]"}:{bg:"bg-[color-mix(in_srgb,var(--chart-2)_14%,transparent)]",text:"text-[var(--chart-2)]",ring:"ring-[color-mix(in_srgb,var(--chart-2)_40%,transparent)]"}}const Dte=({classSectionId:e,className:t,fallbackStudents:n=[]})=>{const{currentUser:r}=$t(),s=v.useRef(0),[i,o]=v.useState([]),[l,c]=v.useState(!0),[d,f]=v.useState(""),[u,m]=v.useState("riskLevel"),[h,g]=v.useState("desc"),[x,p]=v.useState("all"),[j,S]=v.useState([]),[y,N]=v.useState(!1),[b,w]=v.useState(""),[k,A]=v.useState(""),C=v.useCallback(I=>({id:I.id,lrn:I.lrn||void 0,name:I.name,email:I.email||"",avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(I.name)}&background=random`,classSectionId:I.classSectionId??null,riskLevel:I.riskLevel||"Low",engagementScore:I.engagementScore,avgQuizScore:I.avgQuizScore,weakestTopic:I.weakestTopic||"Foundational Skills"}),[]),F=v.useCallback(I=>({id:I.id,lrn:I.lrn,name:I.name,email:I.email||"",avatar:I.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(I.name)}&background=random`,classSectionId:I.classSectionId??null,riskLevel:String(I.riskLevel).charAt(0).toUpperCase()+String(I.riskLevel).slice(1).toLowerCase(),engagementScore:I.engagementScore,avgQuizScore:Number(I.avgQuizScore??I.avgScore??0),weakestTopic:I.weakestTopic||"Foundational Skills"}),[]),D=v.useCallback(async(I,Z)=>{const ne=new Map;I.forEach($=>ne.set($.id,null));const ee=25;for(let $=0;${try{const G=await Is(R.id);return{studentId:R.id,summary:Ite(G)}}catch{return{studentId:R.id,summary:null}}}))).forEach((R,G)=>{const ae=_[G]?.id;ae&&(R.status==="fulfilled"?ne.set(ae,R.value.summary):ne.set(ae,null))})}s.current===Z&&o($=>$.map(_=>ne.has(_.student.id)?{..._,competencyMatrix:ne.get(_.student.id)??null,competencyMatrixLoading:!1}:_))},[]),L=v.useCallback(async()=>{if(r?.uid){c(!0),A("");try{let Z=(await Ib(r.uid)).map(_=>({id:_.id,name:_.name,email:_.email||"",avatar:_.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(_.name)}&background=random`,classSectionId:_.classSectionId??null,riskLevel:_.riskLevel,engagementScore:_.engagementScore,avgQuizScore:_.avgQuizScore,weakestTopic:_.weakestTopic||"Foundational Skills"}));n.length>0&&(Z=r5(Z,n.map(F))),e&&(Z=Z.filter(_=>_.classSectionId===e));const ne=await $e.getImportedClassOverview({classSectionId:e,limit:3e3});ne.warnings.length>0&&A(ne.warnings.join(" ")),Z=r5(Z,ne.students.map(C));const ee=xM(Z,e),$=s.current+=1;o(ee.map((_,Q)=>({rowKey:`${n5(_)}|row:${Q}`,student:_,competency:null,competencyMatrix:null,competencyMatrixLoading:!0,loading:!1,expanded:!1}))),D(ee,$)}catch(I){if(console.error("Failed to load students:",I),n.length>0){const Z=n.map(F).filter(ne=>!e||ne.classSectionId===e).map((ne,ee)=>({rowKey:`${n5(ne)}|row:${ee}`,student:ne,competency:null,competencyMatrix:null,competencyMatrixLoading:!1,loading:!1,expanded:!1}));o(Z),A("Showing recently imported students while backend roster sync catches up.")}else o([]),A("Student competency roster is unavailable right now.")}finally{c(!1)}}},[e,r?.uid,n,D,F,C]);v.useEffect(()=>{L()},[L]),v.useEffect(()=>{(async()=>{if(!e){S([]),w("");return}N(!0),w("");try{const Z=await $e.getCourseMaterialTopics({classSectionId:e,limit:20}),ne=(Z.topics||[]).filter(ee=>ee.title?.trim());S(ne),Z.warnings.length>0&&w(Z.warnings.join(" "))}catch{S([]),w("Imported topic context is unavailable right now.")}finally{N(!1)}})()},[e]);const P=async I=>{o(Z=>Z.map(ne=>{if(ne.rowKey!==I)return ne;const ee=!ne.expanded,$=ne.student.id,_={weakestTopic:ne.student.weakestTopic,avgQuizScore:ne.student.avgQuizScore};return ee&&!ne.competency&&!ne.loading?(H(I,$,_),{...ne,expanded:!0,loading:!0}):{...ne,expanded:ee}}))},H=async(I,Z,ne)=>{try{const $=((await Is(Z))?.quizAttempts??[]).map(Q=>({topic:Q.quizId,score:Q.score,total:100,timeTaken:Q.timeSpent})),_=await $e.getStudentCompetency(Z,$.length>0?$:void 0);o(Q=>Q.map(R=>R.rowKey===I?{...R,competency:_,loading:!1}:R))}catch{const $=ne.avgQuizScore||50,_={studentId:Z,competencies:[{topic:ne.weakestTopic||"Unknown",efficiencyScore:Math.max(15,$-20),competencyLevel:$<50?"beginner":"developing",perspective:`Student needs focused practice in ${ne.weakestTopic}.`},{topic:"Functions and Relations",efficiencyScore:Math.min(95,$+10),competencyLevel:$>70?"proficient":"developing",perspective:"Shows solid understanding of function concepts."},{topic:"Problem Solving",efficiencyScore:$,competencyLevel:$>80?"advanced":$>60?"proficient":"developing",perspective:"Applies mathematical reasoning consistently."}],recommendedTopics:[ne.weakestTopic||"Review fundamentals"],excludeTopics:[]};o(Q=>Q.map(R=>R.rowKey===I?{...R,competency:_,loading:!1}:R))}},Y=I=>{u===I?g(Z=>Z==="asc"?"desc":"asc"):(m(I),g("asc"))},V={High:0,Medium:1,Low:2},O=i.filter(I=>{if(x!=="all"&&I.student.riskLevel!==x)return!1;if(d){const Z=d.toLowerCase();return I.student.name.toLowerCase().includes(Z)||I.student.email.toLowerCase().includes(Z)}return!0}).sort((I,Z)=>{let ne=0;switch(u){case"name":ne=I.student.name.localeCompare(Z.student.name);break;case"avgQuizScore":ne=I.student.avgQuizScore-Z.student.avgQuizScore;break;case"riskLevel":ne=V[I.student.riskLevel]-V[Z.student.riskLevel];break;case"engagementScore":ne=I.student.engagementScore-Z.student.engagementScore;break}return h==="asc"?ne:-ne}),E=i.length,B=i.filter(I=>I.student.riskLevel==="High").length,T=E>0?Math.round(i.reduce((I,Z)=>I+Z.student.avgQuizScore,0)/E):0,M=E>0?Math.round(i.reduce((I,Z)=>I+Z.student.engagementScore,0)/E):0,K=Array.from(new Set(j.map(I=>I.title).filter(Boolean))).slice(0,10),X=({field:I})=>u!==I?a.jsx(Hn,{size:14,className:"text-slate-500"}):h==="asc"?a.jsx(Es,{size:14,className:"text-sky-600"}):a.jsx(Hn,{size:14,className:"text-sky-600"});return l?a.jsxs("div",{className:"flex items-center justify-center py-20 p-6",children:[a.jsx(He,{size:32,className:"animate-spin text-[var(--primary)]"}),a.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading student data..."})]}):a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6 space-y-6",children:[a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:[{label:"Total Students",value:E,icon:a.jsx(Ji,{size:20}),color:"bg-[color-mix(in_srgb,var(--primary)_10%,transparent)] text-[var(--primary)]"},{label:"At-Risk Students",value:B,icon:a.jsx(Gt,{size:20}),color:"bg-[color-mix(in_srgb,var(--chart-2)_10%,transparent)] text-[var(--chart-2)]"},{label:"Class Average",value:`${T}%`,icon:a.jsx(wn,{size:20}),color:"bg-[color-mix(in_srgb,var(--chart-3)_10%,transparent)] text-[var(--chart-3)]"},{label:"Avg. Engagement",value:`${M}%`,icon:a.jsx(ot,{size:20}),color:"bg-[color-mix(in_srgb,var(--chart-1)_10%,transparent)] text-[var(--chart-1)]"}].map((I,Z)=>a.jsxs("div",{className:"bg-card rounded-xl border border-border p-4 flex items-center gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${I.color}`,children:I.icon}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-foreground",children:I.value}),a.jsx("p",{className:"text-xs text-muted-foreground",children:I.label})]})]},Z))}),a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[a.jsxs("div",{className:"relative flex-1 w-full sm:max-w-xs",children:[a.jsx("label",{htmlFor:"student-search",className:"sr-only",children:"Search for students by name or email"}),a.jsx(_n,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx("input",{id:"student-search",type:"text",placeholder:"Search students...",value:d,onChange:I=>f(I.target.value),className:"w-full pl-9 pr-4 py-2 border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-sky-500/20 focus:border-sky-400"})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:["all","High","Medium","Low"].map(I=>a.jsx("button",{onClick:()=>p(I),className:`px-3 py-1.5 rounded-lg text-xs font-semibold transition-all ${x===I?"bg-[var(--primary)] text-white":"bg-muted text-muted-foreground hover:bg-accent"}`,children:I==="all"?"All":`${I} Risk`},I))}),a.jsxs("button",{onClick:L,className:"sm:ml-auto w-full sm:w-auto flex items-center justify-center gap-1.5 px-3 py-1.5 bg-muted hover:bg-accent rounded-lg text-xs font-semibold text-muted-foreground transition-colors",children:[a.jsx(sd,{size:14}),"Refresh"]})]}),a.jsxs("div",{className:"bg-[color-mix(in_srgb,var(--primary)_10%,transparent)] border border-[color-mix(in_srgb,var(--primary)_30%,transparent)] rounded-xl p-4",children:[a.jsxs("p",{className:"text-sm font-semibold text-[var(--primary)]",children:["Imported Topic Context",t?` for ${t}`:""]}),a.jsx("p",{className:"text-xs text-[var(--primary)] mt-1 opacity-80",children:y?"Loading class-scoped imported topics...":K.length>0?`${K.length} imported topics loaded for competency guidance`:"No imported topics found for this class context"}),b&&a.jsx("p",{className:"text-[11px] text-[var(--chart-4)] mt-1",children:b}),k&&a.jsx("p",{className:"text-[11px] text-[var(--chart-4)] mt-1",children:k}),K.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:K.map(I=>a.jsx("span",{className:"text-[11px] bg-[color-mix(in_srgb,var(--primary)_10%,transparent)] text-[var(--primary)] px-2 py-0.5 rounded",children:I},I))})]}),a.jsx("div",{className:"bg-card rounded-xl border border-border",children:a.jsx("div",{className:"overflow-x-auto pb-2",children:a.jsxs("div",{className:"min-w-[1920px]",children:[a.jsxs("div",{className:"grid grid-cols-[48px_280px_120px_120px_120px_120px_120px_140px_170px_170px_220px] items-center gap-6 px-6 py-4 bg-muted/60 border-b border-border text-xs font-semibold text-muted-foreground tracking-normal",children:[a.jsx("div",{}),a.jsxs("button",{className:"flex items-center gap-1 hover:text-foreground",onClick:()=>Y("name"),children:["Student ",a.jsx(X,{field:"name"})]}),s5.map(I=>a.jsx("div",{className:"text-center leading-none whitespace-nowrap tracking-normal",children:I.header},I.key)),a.jsxs("button",{className:"flex items-center gap-1 hover:text-foreground",onClick:()=>Y("riskLevel"),children:["Risk Level ",a.jsx(X,{field:"riskLevel"})]}),a.jsxs("button",{className:"flex items-center gap-1 hover:text-foreground",onClick:()=>Y("avgQuizScore"),children:["Avg. Score ",a.jsx(X,{field:"avgQuizScore"})]}),a.jsxs("button",{className:"flex items-center gap-1 hover:text-foreground",onClick:()=>Y("engagementScore"),children:["Engagement ",a.jsx(X,{field:"engagementScore"})]}),a.jsx("div",{className:"flex justify-end pr-2",children:"Weakest Topic"})]}),O.length===0?a.jsxs("div",{className:"py-12 text-center text-slate-500",children:[a.jsx(Ji,{size:32,className:"mx-auto mb-2 opacity-50"}),a.jsx("p",{className:"text-sm",children:"No students match the current filters"})]}):a.jsx("div",{className:"divide-y divide-border",children:O.map(I=>{const Z=I.student.riskLevel==="High"?{card:"bg-rose-50 border-rose-200",title:"text-rose-800",chip:"bg-rose-100 text-rose-700"}:I.student.riskLevel==="Medium"?{card:"bg-amber-50 border-amber-200",title:"text-amber-800",chip:"bg-amber-100 text-amber-700"}:{card:"bg-sky-50 border-sky-200",title:"text-sky-800",chip:"bg-sky-100 text-sky-700"};return a.jsxs("div",{className:"border-b border-border last:border-0",children:[a.jsxs("button",{onClick:()=>void P(I.rowKey),className:"w-full grid grid-cols-[48px_280px_120px_120px_120px_120px_120px_140px_170px_170px_220px] gap-6 px-6 py-5 items-center hover:bg-muted transition-colors text-left",children:[a.jsx("div",{className:"flex items-center",children:a.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-slate-500",children:I.expanded?a.jsx(Hn,{size:16}):a.jsx(jn,{size:16})})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("img",{src:I.student.avatar,alt:I.student.name,className:"w-8 h-8 rounded-full bg-border object-cover"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-foreground",children:I.student.name}),a.jsx("p",{className:"text-xs text-slate-500",children:I.student.email})]})]}),s5.map(ne=>{const ee=I.competencyMatrix?.[ne.key]??0,$=Ote(ee);return a.jsx("div",{className:"flex items-center justify-center",children:I.competencyMatrixLoading?a.jsx(He,{size:14,className:"animate-spin text-muted-foreground"}):I.competencyMatrix?a.jsxs("span",{title:`${ne.label}: ${ee}%`,className:`inline-flex items-center justify-center rounded-md px-2 py-1 text-xs font-semibold ring-1 ${$.bg} ${$.text} ${$.ring}`,children:[ee,"%"]}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ne.key)}),a.jsx("div",{children:a.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-bold ring-1 ${Rp[I.student.riskLevel]?.bg} ${Rp[I.student.riskLevel]?.text} ${Rp[I.student.riskLevel]?.ring}`,children:[I.student.riskLevel==="High"&&a.jsx(Gt,{size:10}),I.student.riskLevel]})}),a.jsx("div",{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full ${I.student.avgQuizScore>=80?"bg-[var(--chart-3)]":I.student.avgQuizScore>=60?"bg-[var(--chart-4)]":"bg-[var(--chart-2)]"}`,style:{width:`${I.student.avgQuizScore}%`}})}),a.jsxs("span",{className:"text-xs font-bold text-muted-foreground w-8 text-right",children:[I.student.avgQuizScore,"%"]})]})}),a.jsx("div",{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full ${I.student.engagementScore>=75?"bg-[var(--primary)]":I.student.engagementScore>=50?"bg-[var(--primary)]/60":"bg-muted-foreground"}`,style:{width:`${I.student.engagementScore}%`}})}),a.jsxs("span",{className:"text-xs font-bold text-muted-foreground w-8 text-right",children:[I.student.engagementScore,"%"]})]})}),a.jsx("div",{className:"flex justify-end pr-2",children:a.jsx("span",{className:"text-xs font-medium text-muted-foreground bg-muted px-2 py-1 rounded-md",children:I.student.weakestTopic})})]}),a.jsx(Ke,{children:I.expanded&&a.jsx(J.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:a.jsx("div",{className:"px-6 py-4 bg-muted border-t border-border",children:I.loading?a.jsxs("div",{className:"flex items-center justify-center py-6",children:[a.jsx(He,{size:20,className:"animate-spin text-sky-500"}),a.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Analyzing competency data..."})]}):I.competency?a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:I.competency.competencies.map((ne,ee)=>a.jsx(Rte,{competency:ne},ee))}),I.competency.recommendedTopics.length>0&&a.jsxs("div",{className:`border rounded-lg p-3 ${Z.card}`,children:[a.jsxs("h5",{className:`text-xs font-bold mb-1.5 flex items-center gap-1 ${Z.title}`,children:[a.jsx(De,{size:12}),"Recommended Focus Areas"]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:I.competency.recommendedTopics.map((ne,ee)=>a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Z.chip}`,children:ne},ee))})]}),K.length>0&&a.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-lg p-3",children:[a.jsxs("h5",{className:"text-xs font-bold text-sky-800 mb-1.5 flex items-center gap-1",children:[a.jsx(lr,{size:12}),"Class Imported Topics"]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:K.slice(0,8).map((ne,ee)=>a.jsx("span",{className:"inline-flex items-center bg-sky-100 text-sky-700 px-2 py-0.5 rounded text-xs font-medium",children:ne},`${ne}_${ee}`))})]}),I.competency.excludeTopics.length>0&&a.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded-lg p-3",children:[a.jsxs("h5",{className:"text-xs font-bold text-emerald-800 mb-1.5 flex items-center gap-1",children:[a.jsx(yt,{size:12}),"Mastered Topics (can exclude from quizzes)"]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:I.competency.excludeTopics.map((ne,ee)=>a.jsx("span",{className:"inline-flex items-center bg-emerald-100 text-emerald-700 px-2 py-0.5 rounded text-xs font-medium",children:ne},ee))})]})]}):a.jsx("p",{className:"text-sm text-slate-500 text-center py-4",children:"No competency data available. Student needs to complete quizzes first."})})})})]},I.rowKey)})})]})})})]})},Rte=({competency:e})=>{const t=a5[e.competencyLevel]||a5.developing;return a.jsxs("div",{className:"bg-card rounded-lg border border-border p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h6",{className:"text-xs font-bold text-foreground truncate flex-1",children:e.topic}),a.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-[10px] font-bold uppercase ${t.bg} ${t.text}`,children:e.competencyLevel})]}),a.jsxs("div",{className:"mb-2",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[a.jsx("span",{className:"text-slate-500",children:"Efficiency"}),a.jsxs("span",{className:"font-bold text-muted-foreground",children:[e.efficiencyScore,"%"]})]}),a.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:a.jsx(J.div,{initial:{width:0},animate:{width:`${e.efficiencyScore}%`},transition:{duration:.6,delay:.1},className:`h-full rounded-full ${t.bar}`})})]}),a.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug line-clamp-2",children:e.perspective})]})},Lte=e=>{const t=Date.now()-e.getTime(),n=Math.floor(t/6e4);if(n<1)return"Just now";if(n<60)return`${n} min ago`;const r=Math.floor(n/60);if(r<24)return`${r} hour${r===1?"":"s"} ago`;const s=Math.floor(r/24);return`${s} day${s===1?"":"s"} ago`},$te=e=>{switch(e){case"achievement":return Jt;case"message":return v0;case"grade":return fr;case"reminder":return On;case"risk_alert":return Gt;case"automation":return iC;default:return Ar}},zte=e=>{switch(e){case"risk_alert":return"bg-destructive/10 text-destructive";case"achievement":return"bg-rose-500/10 text-rose-600 dark:text-rose-400";case"message":return"bg-sky-500/10 text-sky-700 dark:text-sky-400";case"grade":return"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400";case"reminder":return"bg-amber-500/10 text-amber-700 dark:text-amber-400";case"automation":return"bg-violet-500/10 text-violet-700 dark:text-violet-400";default:return"bg-muted text-muted-foreground"}},Fte=({userId:e})=>{const[t,n]=v.useState([]),[r,s]=v.useState(!0),[i,o]=v.useState("");v.useEffect(()=>{o(""),s(!0);const f=n$(e,{limitCount:50},u=>{n(u),s(!1)},u=>{console.error(u),o("Unable to load notifications right now."),s(!1)});return()=>f()},[e]);const l=v.useMemo(()=>t.filter(f=>!f.read).length,[t]),c=async()=>{if(e){n(f=>f.map(u=>({...u,read:!0})));try{await GC(e)}catch(f){console.error(f),o("Failed to mark all as read.")}}},d=async f=>{f.read||(n(u=>u.map(m=>m.id===f.id?{...m,read:!0}:m)),UC(f.id).catch(u=>console.error(u))),f.actionUrl&&window.open(f.actionUrl,"_blank","noopener,noreferrer")};return a.jsxs(J.div,{initial:{opacity:0,y:18},animate:{opacity:1,y:0},exit:{opacity:0,y:-18},className:"p-4 sm:p-6 space-y-4",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsx("div",{className:"min-w-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-sky-100 text-sky-700 dark:bg-sky-500/15 dark:text-sky-300 flex items-center justify-center flex-shrink-0",children:a.jsx(Ar,{size:20})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{className:"text-2xl font-display font-bold text-foreground",children:"Notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground font-body",children:"Classroom alerts and updates"})]})]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-xs text-muted-foreground font-body",children:l>0?`${l} unread`:"All caught up"}),l>0&&a.jsxs(pe,{variant:"outline",size:"sm",onClick:c,children:[a.jsx(oC,{}),"Mark all as read"]})]})]}),a.jsx("div",{className:"bg-card border border-border rounded-2xl shadow-sm overflow-hidden",children:r?a.jsxs("div",{className:"p-8 flex items-center justify-center gap-2 text-muted-foreground",children:[a.jsx(He,{size:18,className:"animate-spin"}),a.jsx("span",{className:"text-sm font-body",children:"Loading notifications…"})]}):t.length===0?a.jsx("div",{className:"p-10",children:a.jsxs("div",{className:"max-w-xl",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-muted text-muted-foreground flex items-center justify-center mb-4",children:a.jsx(Ar,{size:22})}),a.jsx("h3",{className:"text-lg font-display font-bold text-foreground mb-1",children:"No notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground font-body",children:"Teacher alerts and classroom updates will appear here."})]})}):a.jsxs("div",{children:[i&&a.jsx("div",{className:"px-4 py-3 border-b border-border bg-destructive/5 text-destructive text-sm font-body",children:i}),t.map(f=>{const u=$te(f.type),m=zte(f.type),h=Lte(f.createdAt);return a.jsx("button",{onClick:()=>d(f),className:`w-full text-left px-4 py-4 border-b border-border last:border-b-0 transition-colors hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 ${f.read?"":"bg-sky-50/40 dark:bg-sky-500/5"}`,children:a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${m}`,children:a.jsx(u,{size:18})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h4",{className:"text-sm font-body font-bold text-foreground line-clamp-1",children:f.title}),!f.read&&a.jsx("span",{className:"w-2 h-2 rounded-full bg-sky-500 flex-shrink-0"})]}),a.jsx("p",{className:"mt-1 text-xs text-muted-foreground font-body leading-relaxed line-clamp-2",children:f.message})]}),a.jsx("div",{className:"text-xs text-muted-foreground font-body flex-shrink-0",children:h})]}),f.actionUrl&&a.jsx("div",{className:"mt-2 text-xs text-sky-600 dark:text-sky-400 font-body",children:"Opens link"})]})]})},f.id)})]})})]})},Bte=e=>{const t=e.data(),n=t.startTime,r=t.endTime,s=t.createdAt,i=t.updatedAt,o=l=>{if(l){if(typeof l?.toDate=="function")return l.toDate();if(l instanceof Date)return l}};return{...t,id:e.id,startTime:o(n)||new Date,endTime:o(r),createdAt:o(s)||new Date,updatedAt:o(i)}},qte=async(e,t)=>{const n=Me(_e(fe,"calendarEvents")),r={id:n.id,userId:e,title:t.title,description:t.description,startTime:t.startTime,endTime:t.endTime,createdAt:new Date};return await rt(n,{...r,createdAt:ke(),updatedAt:ke()}),r},Vte=async e=>{await Jc(Me(fe,"calendarEvents",e))},Ute=(e,t={},n,r)=>{if(!e)return n([]),()=>{};const{limitCount:s=500}=t,i=at(_e(fe,"calendarEvents"),Je("userId","==",e),Er(s));return Zc(i,o=>{n(o.docs.map(l=>Bte(l)))},o=>{console.error("Error subscribing to calendar events:",o),r?.(o)})};function Gte({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:Be("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function Ob({...e}){return a.jsx(h6,{"data-slot":"dialog",...e})}function Wte({...e}){return a.jsx(y6,{"data-slot":"dialog-portal",...e})}function Hte({className:e,...t}){return a.jsx(v6,{"data-slot":"dialog-overlay",className:Be("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),...t})}function Db({className:e,children:t,...n}){return a.jsxs(Wte,{"data-slot":"dialog-portal",children:[a.jsx(Hte,{}),a.jsxs(p6,{"data-slot":"dialog-content",className:Be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,a.jsxs(x6,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[a.jsx(Xe,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Rb({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:Be("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Lb({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:Be("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function $b({className:e,...t}){return a.jsx(g6,{"data-slot":"dialog-title",className:Be("text-lg leading-none font-semibold",e),...t})}function zb({className:e,...t}){return a.jsx(b6,{"data-slot":"dialog-description",className:Be("text-muted-foreground text-sm",e),...t})}const i5=e=>String(e).padStart(2,"0"),Ei=e=>`${e.getFullYear()}-${i5(e.getMonth()+1)}-${i5(e.getDate())}`,gM=e=>new Date(e.getFullYear(),e.getMonth(),1),Kte=e=>new Date(e.getFullYear(),e.getMonth()+1,0),Xte=e=>{const t=gM(e),n=t.getDay(),r=new Date(t);return r.setDate(t.getDate()-n),r.setHours(0,0,0,0),r},Yte=(e,t)=>{const n=new Date(e);return n.setDate(n.getDate()+t),n},o5=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Qte=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth(),Zte=e=>e.toLocaleDateString(void 0,{month:"long",year:"numeric"}),l5=e=>e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),c5=(e,t)=>{const[n,r,s]=e.split("-").map(l=>parseInt(l,10)),[i,o]=t.split(":").map(l=>parseInt(l,10));return new Date(n,(r||1)-1,s||1,i||0,o||0,0,0)},Jte=()=>{const{currentUser:e}=$t(),[t,n]=v.useState([]),[r,s]=v.useState(!0),[i,o]=v.useState(""),[l,c]=v.useState(()=>{const B=new Date;return B.setHours(0,0,0,0),B}),[d,f]=v.useState(()=>{const B=new Date;return B.setHours(0,0,0,0),B}),[u,m]=v.useState(!1),[h,g]=v.useState(!1),[x,p]=v.useState(""),[j,S]=v.useState(""),[y,N]=v.useState(()=>Ei(new Date)),[b,w]=v.useState("09:00"),[k,A]=v.useState("");v.useEffect(()=>{if(!e?.uid){n([]),s(!1);return}o(""),s(!0);const B=Ute(e.uid,{limitCount:500},T=>{n(T),s(!1)},()=>{o("Unable to load calendar events right now."),s(!1)});return()=>B()},[e?.uid]);const C=v.useMemo(()=>{const B=gM(l);return B.setHours(0,0,0,0),B},[l]),F=v.useMemo(()=>{const B=Kte(l);return B.setHours(23,59,59,999),B},[l]),D=v.useMemo(()=>t.filter(B=>B.startTime>=C&&B.startTime<=F).sort((B,T)=>B.startTime.getTime()-T.startTime.getTime()),[t,C,F]),L=v.useMemo(()=>{const B=new Map;for(const T of D){const M=Ei(T.startTime),K=B.get(M)||[];K.push(T),B.set(M,K)}return B},[D]),P=v.useMemo(()=>Ei(d),[d]),H=v.useMemo(()=>[...L.get(P)||[]].sort((T,M)=>T.startTime.getTime()-M.startTime.getTime()),[L,P]),Y=v.useMemo(()=>{const B=Xte(l);return Array.from({length:42}).map((T,M)=>Yte(B,M))},[l]),V=B=>{const T=Ei(B);p(""),S(""),N(T),w("09:00"),A(""),m(!0)},O=async()=>{if(e?.uid){if(!x.trim()){o("Event title is required.");return}g(!0),o("");try{const B=c5(y,b),T=k?c5(y,k):void 0;await qte(e.uid,{title:x.trim(),description:j.trim()?j.trim():void 0,startTime:B,endTime:T&&T.getTime()>B.getTime()?T:void 0}),m(!1)}catch(B){console.error(B),o("Failed to create event.")}finally{g(!1)}}},E=async B=>{o("");try{await Vte(B)}catch(T){console.error(T),o("Failed to delete event.")}};return a.jsxs(J.div,{initial:{opacity:0,y:18},animate:{opacity:1,y:0},exit:{opacity:0,y:-18},className:"p-4 sm:p-6 space-y-4",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsx("div",{className:"min-w-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-secondary text-secondary-foreground flex items-center justify-center flex-shrink-0",children:a.jsx(h8,{size:20})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{className:"text-2xl font-display font-bold text-foreground",children:"Calendar"}),a.jsx("p",{className:"text-sm text-muted-foreground font-body",children:"Check upcoming class events and schedule"})]})]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(pe,{variant:"outline",size:"sm",onClick:()=>{const B=new Date;B.setHours(0,0,0,0),c(B),f(B)},children:"Today"}),a.jsxs(pe,{size:"sm",onClick:()=>V(d),children:[a.jsx(Qr,{}),"Add event"]})]})]}),i&&a.jsx("div",{className:"bg-destructive/10 text-destructive border border-destructive/20 rounded-xl px-4 py-3 text-sm font-body",children:i}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-4",children:[a.jsxs("div",{className:"lg:col-span-8 bg-card border border-border rounded-2xl shadow-sm overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(pe,{variant:"ghost",size:"icon",onClick:()=>{const B=new Date(l.getFullYear(),l.getMonth()-1,1);c(B)},"aria-label":"Previous month",children:a.jsx(Ya,{})}),a.jsx("div",{className:"text-sm sm:text-base font-display font-bold text-foreground",children:Zte(l)}),a.jsx(pe,{variant:"ghost",size:"icon",onClick:()=>{const B=new Date(l.getFullYear(),l.getMonth()+1,1);c(B)},"aria-label":"Next month",children:a.jsx(jn,{})})]}),a.jsxs("div",{className:"text-xs text-muted-foreground font-body",children:[D.length," event",D.length===1?"":"s"]})]}),a.jsxs("div",{className:"grid grid-cols-7 gap-px bg-border",children:[["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(B=>a.jsx("div",{className:"bg-card px-3 py-2 text-xs font-body font-bold text-muted-foreground",children:B},B)),Y.map(B=>{const T=Ei(B),M=L.get(T)?.length||0,K=o5(B,d),X=o5(B,new Date),I=Qte(B,l);return a.jsxs("button",{onClick:()=>{const Z=new Date(B);Z.setHours(0,0,0,0),f(Z)},className:"bg-card px-3 py-3 min-h-[78px] text-left transition-colors hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 "+(K?"ring-2 ring-primary/40 ":"")+(I?"":"opacity-50 "),children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-sm font-body font-bold "+(X?"bg-primary text-primary-foreground ":"text-foreground ")+(K&&!X?"bg-secondary text-secondary-foreground ":""),children:B.getDate()}),M>0&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),a.jsx("span",{className:"text-xs font-body text-muted-foreground",children:M})]})]}),M>0&&a.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[(L.get(T)||[]).slice(0,3).map(Z=>a.jsx("span",{className:"inline-flex items-center rounded-md bg-secondary text-secondary-foreground px-2 py-0.5 text-[10px] font-body font-bold truncate max-w-full",title:Z.title,children:Z.title},Z.id)),(L.get(T)?.length||0)>3&&a.jsxs("span",{className:"text-[10px] font-body text-muted-foreground",children:["+",(L.get(T)?.length||0)-3," more"]})]})]},T)})]}),r&&a.jsxs("div",{className:"px-4 py-4 border-t border-border flex items-center gap-2 text-muted-foreground",children:[a.jsx(He,{size:18,className:"animate-spin"}),a.jsx("span",{className:"text-sm font-body",children:"Syncing events…"})]})]}),a.jsxs("div",{className:"lg:col-span-4 bg-card border border-border rounded-2xl shadow-sm overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-display font-bold text-foreground",children:d.toLocaleDateString(void 0,{weekday:"long"})}),a.jsx("div",{className:"text-xs text-muted-foreground font-body",children:d.toLocaleDateString()})]}),a.jsxs(pe,{variant:"outline",size:"sm",onClick:()=>V(d),children:[a.jsx(Qr,{}),"Add"]})]}),a.jsx("div",{className:"p-4",children:H.length===0?a.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-4",children:[a.jsx("div",{className:"text-sm font-body font-bold text-foreground",children:"No events"}),a.jsx("div",{className:"text-xs text-muted-foreground font-body mt-1",children:"Add reminders for quizzes, meetings, or deadlines."})]}):a.jsx("div",{className:"space-y-2",children:H.map(B=>a.jsxs("div",{className:"rounded-xl border border-border bg-background p-3 flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-primary flex-shrink-0"}),a.jsx("div",{className:"text-sm font-body font-bold text-foreground truncate",children:B.title})]}),a.jsxs("div",{className:"text-xs text-muted-foreground font-body mt-1",children:[l5(B.startTime),B.endTime?` – ${l5(B.endTime)}`:""]}),B.description&&a.jsx("div",{className:"text-xs text-muted-foreground font-body mt-2 line-clamp-2",children:B.description})]}),a.jsx(pe,{variant:"ghost",size:"icon",onClick:()=>E(B.id),"aria-label":"Delete event",children:a.jsx(sa,{})})]},B.id))})})]})]}),a.jsx(Ob,{open:u,onOpenChange:m,children:a.jsxs(Db,{className:"sm:max-w-xl",children:[a.jsxs(Rb,{children:[a.jsx($b,{className:"font-display",children:"Add event"}),a.jsx(zb,{className:"font-body",children:"Create a reminder for your class schedule."})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[a.jsxs("div",{className:"sm:col-span-2",children:[a.jsx("label",{className:"text-xs font-body font-bold text-muted-foreground",children:"Title"}),a.jsx(ve,{value:x,onChange:B=>p(B.target.value),placeholder:"e.g., Quiz review session"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-body font-bold text-muted-foreground",children:"Date"}),a.jsx(ve,{type:"date",value:y,onChange:B=>N(B.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-body font-bold text-muted-foreground",children:"Start time"}),a.jsx(ve,{type:"time",value:b,onChange:B=>w(B.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-body font-bold text-muted-foreground",children:"End time (optional)"}),a.jsx(ve,{type:"time",value:k,onChange:B=>A(B.target.value)})]}),a.jsxs("div",{className:"sm:col-span-2",children:[a.jsx("label",{className:"text-xs font-body font-bold text-muted-foreground",children:"Notes (optional)"}),a.jsx(Gte,{value:j,onChange:B=>S(B.target.value),placeholder:"Add context: class, room, agenda…",className:"min-h-24"})]})]}),a.jsxs(Lb,{children:[a.jsx(pe,{variant:"outline",onClick:()=>m(!1),disabled:h,children:"Cancel"}),a.jsx(pe,{onClick:O,disabled:h,children:h?a.jsxs(a.Fragment,{children:[a.jsx(He,{className:"animate-spin"}),"Saving…"]}):a.jsxs(a.Fragment,{children:[a.jsx(Qr,{}),"Create event"]})})]})]})})]})};function Ne({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:Be("bg-accent animate-pulse rounded-md",e),...t})}function ene(e){const t=e.atRiskCount>=5?"high":e.atRiskCount>=2?"medium":"low",n=Vt({metadata:e.classMetadata,classSectionId:e.classSectionId,className:e.name,grade:e.grade,gradeLevel:e.gradeLevel,classification:e.classification,strand:e.strand,section:e.section,schoolYear:e.schoolYear,ownerTeacherId:e.ownerTeacherId||e.teacherId,ownerTeacherName:e.ownerTeacherName,adviserTeacherId:e.adviserTeacherId||e.teacherId,adviserTeacherName:e.adviserTeacherName||e.ownerTeacherName,managerId:e.managerId,managerName:e.managerName});return{id:e.id,name:n.className||e.name,classSectionId:n.classSectionId||e.classSectionId,classMetadata:n,gradeLevel:n.gradeLevel||void 0,classification:n.classification||void 0,strand:n.strand||void 0,managerId:n.managerId||void 0,managerName:n.managerName||void 0,schedule:e.schedule,studentCount:e.studentCount,avgScore:e.avgScore,atRiskCount:e.atRiskCount,riskLevel:t}}function tne(e,t){const n=e.riskLevel.toLowerCase(),r=e.lastActive?bM(e.lastActive.toDate()):"Unknown",s=e.className||t||"Imported Class",i=Qn(s),o=e.grade||i.grade,l=e.section||i.section,c=Vt({metadata:e.classMetadata,classSectionId:e.classSectionId||e.classroomId,className:[o,l].filter(Boolean).join(" - ")||s,grade:o,gradeLevel:e.gradeLevel,classification:e.classification,strand:e.strand,section:l,adviserTeacherId:e.teacherId,ownerTeacherId:e.teacherId,managerId:e.classMetadata?.managerId||e.managerId,managerName:e.classMetadata?.managerName||e.managerName});return{id:e.id,lrn:e.lrn,name:e.name,avatar:e.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(e.name)}&background=random`,avgScore:e.avgQuizScore,riskLevel:n,weakestTopic:e.weakestTopic||"N/A",classroomId:e.classroomId||c.classSectionId||s,className:c.className||[o,l].filter(Boolean).join(" - ")||s,grade:o,gradeLevel:c.gradeLevel||ns(o)||void 0,classification:c.classification||fi(c.gradeLevel||o)||void 0,strand:c.strand||mi(c.className,l)||void 0,section:l,classSectionId:c.classSectionId||e.classSectionId,classMetadata:c,managerId:c.managerId||void 0,managerName:c.managerName||void 0,lastActive:r,struggles:e.struggles||[],engagementScore:e.engagementScore,attendance:e.attendance,assignmentCompletion:e.assignmentCompletion}}function nne(e){const t=e.atRiskCount>=5?"high":e.atRiskCount>=2?"medium":"low",n=Vt({metadata:e.classMetadata,classSectionId:e.classSectionId,className:e.name,grade:e.grade,gradeLevel:e.gradeLevel||e.classMetadata?.gradeLevel,classification:e.classification||e.classMetadata?.classification,strand:e.strand||e.classMetadata?.strand,section:e.section,managerId:e.managerId||e.classMetadata?.managerId,managerName:e.managerName||e.classMetadata?.managerName});return{id:e.id,name:n.className||e.name,classSectionId:n.classSectionId||e.classSectionId||void 0,classMetadata:n,gradeLevel:n.gradeLevel||void 0,classification:n.classification||void 0,strand:n.strand||void 0,managerId:n.managerId||void 0,managerName:n.managerName||void 0,schedule:e.schedule||"Mon-Fri",studentCount:e.studentCount,avgScore:e.avgScore,atRiskCount:e.atRiskCount,riskLevel:t}}function rne(e){const t=(e.riskLevel||"Low").toLowerCase(),n=Vt({metadata:e.classMetadata,classSectionId:e.classSectionId,className:e.className||[e.grade,e.section].filter(Boolean).join(" - ")||"Imported Class",grade:e.grade,gradeLevel:e.gradeLevel||e.classMetadata?.gradeLevel,classification:e.classification||e.classMetadata?.classification,strand:e.strand||e.classMetadata?.strand,section:e.section,managerId:e.managerId||e.classMetadata?.managerId,managerName:e.managerName||e.classMetadata?.managerName}),r=n.className||"Imported Class";return{id:e.id,lrn:e.lrn||void 0,name:e.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(e.name)}&background=random`,avgScore:e.avgQuizScore,riskLevel:t,weakestTopic:e.weakestTopic||"Foundational Skills",classroomId:n.classSectionId||e.classSectionId||r,className:r,grade:n.grade||Qn(r).grade,gradeLevel:n.gradeLevel||ns(n.grade||Qn(r).grade)||void 0,classification:n.classification||fi(n.gradeLevel||n.grade)||void 0,strand:n.strand||mi(r,n.section||e.section)||void 0,section:n.section||Qn(r).section,classSectionId:n.classSectionId||e.classSectionId||void 0,classMetadata:n,managerId:n.managerId||void 0,managerName:n.managerName||void 0,lastActive:"Recently imported",struggles:[e.weakestTopic||"Foundational Skills"],engagementScore:e.engagementScore,attendance:e.attendance,assignmentCompletion:e.assignmentCompletion}}function ane(e,t,n){return e<60||t<75||n<55?"high":e<75||t<85||n<70?"medium":"low"}function sne(e,t,n,r){const s=Vt({metadata:r,classSectionId:t,className:n}),i=s.className||"Imported Class",o=s.classSectionId||"imported_class",l=Number(e.avgQuizScore||0),c=Number(e.attendance||0),d=Number(e.engagementScore||0),f=Number(e.assignmentCompletion||0),u=e.unknownFields?.weakestTopic||e.unknownFields?.topic||"Foundational Skills",m=ane(l,c,d),h=e.studentId||e.lrn||e.email||e.name||Math.random().toString(36).slice(2);return{id:`upload-${o}-${h}`,lrn:e.lrn,name:e.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(e.name)}&background=random`,avgScore:l,riskLevel:m,weakestTopic:u,classroomId:o,className:i,grade:s.grade||Qn(i).grade,gradeLevel:s.gradeLevel||ns(s.grade||Qn(i).grade)||void 0,classification:s.classification||fi(s.gradeLevel||s.grade)||void 0,strand:s.strand||mi(i,s.section)||void 0,section:s.section||Qn(i).section,classSectionId:o,classMetadata:s,managerId:s.managerId||void 0,managerName:s.managerName||void 0,lastActive:"Recently imported",struggles:[u],engagementScore:d,attendance:c,assignmentCompletion:f}}function ine(e,t,n,r){const s=Vt({metadata:e.dashboardSync?.classMetadata||e.classMetadata||r,classSectionId:e.dashboardSync?.classSectionId||t,className:e.dashboardSync?.className||n}),i=s.classSectionId||"imported_class",o=s.className||"Imported Class";return{classSectionId:i,className:o,classMetadata:{...s,classSectionId:i,className:o}}}function bM(e){const t=Date.now()-e.getTime(),n=Math.floor(t/6e4);if(n<1)return"Just now";if(n<60)return`${n} min${n>1?"s":""} ago`;const r=Math.floor(n/60);if(r<24)return`${r} hour${r>1?"s":""} ago`;const s=Math.floor(r/24);return`${s} day${s>1?"s":""} ago`}function It(e){return(e||"").trim().toLowerCase()}function d5(e){const t=It(e.classSectionId);if(t)return`section:${t}`;const n=(e.id||"").trim().toLowerCase();return n?`id:${n}`:`name:${(e.name||"").trim().toLowerCase()}`}function u5(e,t){const n=new Map;return e.forEach(r=>{n.set(d5(r),r)}),t.forEach(r=>{const s=d5(r),i=n.get(s);if(!i){n.set(s,r);return}const o=Math.max(i.atRiskCount||0,r.atRiskCount||0),l=Math.max(i.studentCount||0,r.studentCount||0),c=r.avgScore>0?r.avgScore:i.avgScore,d=o>=5?"high":o>=2?"medium":"low",f=Vt({metadata:i.classMetadata,classSectionId:i.classSectionId||r.classSectionId,className:i.name||r.name,grade:i.classMetadata?.grade||r.classMetadata?.grade,gradeLevel:i.classMetadata?.gradeLevel||r.classMetadata?.gradeLevel,classification:i.classMetadata?.classification||r.classMetadata?.classification,strand:i.classMetadata?.strand||r.classMetadata?.strand,section:i.classMetadata?.section||r.classMetadata?.section,schoolYear:i.classMetadata?.schoolYear||r.classMetadata?.schoolYear,ownerTeacherId:i.classMetadata?.ownerTeacherId||r.classMetadata?.ownerTeacherId,ownerTeacherName:i.classMetadata?.ownerTeacherName||r.classMetadata?.ownerTeacherName,adviserTeacherId:i.classMetadata?.adviserTeacherId||r.classMetadata?.adviserTeacherId,adviserTeacherName:i.classMetadata?.adviserTeacherName||r.classMetadata?.adviserTeacherName,managerId:i.classMetadata?.managerId||r.classMetadata?.managerId,managerName:i.classMetadata?.managerName||r.classMetadata?.managerName});n.set(s,{...i,classSectionId:f.classSectionId||i.classSectionId||r.classSectionId,name:f.className||i.name||r.name,classMetadata:f,gradeLevel:f.gradeLevel||void 0,classification:f.classification||void 0,strand:f.strand||void 0,managerId:f.managerId||void 0,managerName:f.managerName||void 0,schedule:i.schedule||r.schedule,studentCount:l,atRiskCount:o,avgScore:c,riskLevel:d})}),Array.from(n.values())}function f5(e){const t=(e.lrn||"").trim().toLowerCase();if(t)return`lrn:${t}`;const n=e.name.trim().toLowerCase();if(n)return`name:${n}`;const r=It(e.classSectionId)||It(e.classroomId),s=(e.id||"").trim().toLowerCase();return r&&s?`${r}|id:${s}`:`${r}|anonymous`}function Ps(e){const t=It(e.classSectionId)||It(e.classroomId),n=(e.lrn||"").trim().toLowerCase(),r=(e.id||"").trim().toLowerCase(),s=e.name.trim().toLowerCase().replace(/\s+/g,"_");return t&&n?`${t}|lrn:${n}`:t&&r?`${t}|id:${r}`:n?`lrn:${n}`:r&&s?`id:${r}|name:${s}`:r?`id:${r}`:t&&s?`${t}|name:${s}`:`name:${s||"unknown"}`}function m5(e,t){const n=new Map;return e.forEach(r=>{n.set(f5(r),r)}),t.forEach(r=>{const s=f5(r),i=n.get(s);if(!i){n.set(s,r);return}const o=[i.riskLevel,r.riskLevel].includes("high")?"high":[i.riskLevel,r.riskLevel].includes("medium")?"medium":"low",l=Vt({metadata:i.classMetadata,classSectionId:i.classSectionId||r.classSectionId,className:i.className||r.className,grade:i.grade||r.grade,gradeLevel:i.gradeLevel||r.gradeLevel,classification:i.classification||r.classification,strand:i.strand||r.strand,section:i.section||r.section,managerId:i.managerId||r.managerId,managerName:i.managerName||r.managerName});n.set(s,{...i,lrn:i.lrn||r.lrn,classSectionId:l.classSectionId||i.classSectionId||r.classSectionId,classroomId:i.classroomId||r.classroomId,className:l.className||i.className||r.className,grade:l.grade||i.grade||r.grade,gradeLevel:l.gradeLevel||i.gradeLevel||r.gradeLevel,classification:l.classification||i.classification||r.classification,strand:l.strand||i.strand||r.strand,section:l.section||i.section||r.section,managerId:l.managerId||i.managerId||r.managerId,managerName:l.managerName||i.managerName||r.managerName,classMetadata:l,avgScore:r.avgScore>0?r.avgScore:i.avgScore,attendance:r.attendance>0?r.attendance:i.attendance,engagementScore:r.engagementScore>0?r.engagementScore:i.engagementScore,assignmentCompletion:r.assignmentCompletion>0?r.assignmentCompletion:i.assignmentCompletion,weakestTopic:i.weakestTopic&&i.weakestTopic!=="N/A"?i.weakestTopic:r.weakestTopic,riskLevel:o,struggles:i.struggles.length>0?i.struggles:r.struggles})}),Array.from(n.values())}const one=({onLogout:e,onOpenProfile:t,onOpenSettings:n})=>{const{currentUser:r,userProfile:s}=$t(),[i,o]=v.useState("dashboard"),[l,c]=v.useState(!1),[d,f]=v.useState(!1),[u,m]=v.useState(!1),[h,g]=v.useState(!1),[x,p]=v.useState(!1),[j,S]=v.useState(null),[y,N]=v.useState(null),[b,w]=v.useState([]),[k,A]=v.useState([]),[C,F]=v.useState([]),[D,L]=v.useState(""),[P,H]=v.useState(!0),[Y,V]=v.useState(!1),[O,E]=v.useState(0),[B,T]=v.useState([]),[M,K]=v.useState(!1);v.useEffect(()=>{if(!r)return;const W=r.uid;let de=!0,Ae;return(async()=>{H(!0);try{const Ce=await fM(W);let Se=Ce.map(ene);const ct=await Uee(W).catch(()=>[]),Qe=new Map;ct.forEach(me=>{const je=It(me.classSectionId);je&&Qe.set(je,me)}),Se=Se.map(me=>{const je=Qe.get(It(me.classSectionId));if(!je)return me;const dt=Vt({metadata:me.classMetadata,classSectionId:je.classSectionId||me.classSectionId,className:je.className||me.name,grade:je.grade||me.classMetadata?.grade,gradeLevel:je.gradeLevel||me.classMetadata?.gradeLevel,classification:je.classification||me.classMetadata?.classification,strand:je.strand||me.classMetadata?.strand,section:je.section||me.classMetadata?.section,schoolYear:je.schoolYear||me.classMetadata?.schoolYear,ownerTeacherId:je.ownerTeacherId||me.classMetadata?.ownerTeacherId,ownerTeacherName:je.ownerTeacherName||me.classMetadata?.ownerTeacherName,managerId:je.managerId||me.classMetadata?.managerId,managerName:je.managerName||me.classMetadata?.managerName});return{...me,name:dt.className||me.name,classSectionId:dt.classSectionId||me.classSectionId,classMetadata:dt,gradeLevel:dt.gradeLevel||me.gradeLevel,classification:dt.classification||me.classification,strand:dt.strand||me.strand,managerId:dt.managerId||me.managerId,managerName:dt.managerName||me.managerName}});const Te=new Map,en=new Map;Ce.forEach(me=>{const je=Vt({metadata:me.classMetadata,classSectionId:me.classSectionId,className:me.name,grade:me.grade,gradeLevel:me.gradeLevel,classification:me.classification,strand:me.strand,section:me.section,schoolYear:me.schoolYear,ownerTeacherId:me.ownerTeacherId||me.teacherId,ownerTeacherName:me.ownerTeacherName,adviserTeacherId:me.adviserTeacherId||me.teacherId,adviserTeacherName:me.adviserTeacherName,managerId:me.managerId,managerName:me.managerName});Te.set(me.id,je.className||me.name),en.set(me.id,je);const dt=It(me.classSectionId);if(dt){const Ee=Qe.get(dt),mt=Vt({metadata:je,classSectionId:Ee?.classSectionId||dt,className:Ee?.className||je.className,grade:Ee?.grade||je.grade,gradeLevel:Ee?.gradeLevel||je.gradeLevel,classification:Ee?.classification||je.classification,strand:Ee?.strand||je.strand,section:Ee?.section||je.section,schoolYear:Ee?.schoolYear||je.schoolYear,ownerTeacherId:Ee?.ownerTeacherId||je.ownerTeacherId,ownerTeacherName:Ee?.ownerTeacherName||je.ownerTeacherName,managerId:Ee?.managerId||je.managerId,managerName:Ee?.managerName||je.managerName});Te.set(dt,mt.className||me.name),en.set(dt,mt)}});let pn=(await Ib(W)).map(me=>{const je=It(me.classSectionId||me.classroomId),dt=Te.get(me.classroomId)||(je?Te.get(je):void 0)||me.className||"Unknown",Ee=tne(me,dt);if(!je)return Ee;const mt=en.get(je);if(!mt)return Ee;const Wt=Vt({metadata:mt,classSectionId:Ee.classSectionId||mt.classSectionId,className:Ee.className||mt.className,grade:Ee.grade||mt.grade,gradeLevel:Ee.gradeLevel||mt.gradeLevel,classification:Ee.classification||mt.classification,strand:Ee.strand||mt.strand,section:Ee.section||mt.section,managerId:Ee.managerId||mt.managerId,managerName:Ee.managerName||mt.managerName});return{...Ee,className:Wt.className||Ee.className,grade:Wt.grade||Ee.grade,gradeLevel:Wt.gradeLevel||Ee.gradeLevel,classification:Wt.classification||Ee.classification,strand:Wt.strand||Ee.strand,section:Wt.section||Ee.section,classSectionId:Wt.classSectionId||Ee.classSectionId,classMetadata:Wt,managerId:Wt.managerId||Ee.managerId,managerName:Wt.managerName||Ee.managerName}});if(!de)return;w(me=>Se.length===0&&me.length>0?me:Se),A(me=>pn.length===0&&me.length>0?me:pn),$e.getImportedClassOverview({limit:3e3,forceRefresh:O>0}).then(me=>{de&&(me.warnings.length>0&&console.warn("Imported class overview warnings:",me.warnings.join(" ")),w(je=>u5(je,me.classrooms.map(nne))),A(je=>m5(je,me.students.map(rne))))}).catch(me=>{console.warn("Imported class overview merge unavailable:",me)});const Ft=Ce.map(me=>me.id);Ft.length>0&&(Ae=Wee(Ft,me=>{de&&F(me.map(je=>({id:je.id,student:je.studentName,action:je.action,topic:je.topic,time:bM(je.timestamp.toDate()),type:je.type})))}))}catch(Ce){console.error("Failed to load teacher data:",Ce),ue.error("Failed to load dashboard data")}finally{H(!1)}})(),()=>{de=!1,Ae&&Ae()}},[r,O]),v.useEffect(()=>{if(!r)return;let W=!0;return Gee("",80).then(de=>{W&&T(de)}).catch(de=>{console.warn("Failed to load teacher directory options:",de)}),()=>{W=!1}},[r]),v.useEffect(()=>{if(k.length===0)return;(async()=>{V(!0);try{const de=k.map(we=>({name:we.name,engagementScore:we.engagementScore,avgQuizScore:we.avgScore,attendance:we.attendance,riskLevel:we.riskLevel})),Ae=await $e.getDailyInsight({students:de});L(Ae.insight)}catch{L(`${k.filter(de=>de.riskLevel==="high").length} students are at high risk of falling behind. Review their progress in the analytics view.`)}finally{V(!1)}})()},[k]);const X=b.reduce((W,de)=>W+de.studentCount,0),I=b.reduce((W,de)=>W+de.atRiskCount,0),Z=b.length>0?Math.round(b.reduce((W,de)=>W+de.avgScore,0)/b.length):0,ne=[{name:"High Risk",value:k.filter(W=>W.riskLevel==="high").length,color:"#FF8B8B"},{name:"Medium Risk",value:k.filter(W=>W.riskLevel==="medium").length,color:"#F08386"},{name:"Low Risk",value:k.filter(W=>W.riskLevel==="low").length,color:"#75D06A"}],ee={};k.forEach(W=>{W.weakestTopic&&W.weakestTopic!=="N/A"&&(ee[W.weakestTopic]||(ee[W.weakestTopic]={total:0,sum:0}),ee[W.weakestTopic].total+=1,ee[W.weakestTopic].sum+=W.avgScore)});const $=Object.entries(ee).map(([W,de])=>({topic:W,score:Math.round(de.sum/de.total)})).sort((W,de)=>W.score-de.score).slice(0,6),_=W=>{S(W),o("analytics")},Q=W=>{N(W),o("intervention")},R=()=>{N(null),o("analytics")},G=()=>{S(null),N(null),o("dashboard")},ae=async(W,de)=>{if(!r){ue.error("Unable to assign manager: teacher context is missing.");return}const Ae=Qn(W.classMetadata?.className||W.name),we=Vt({metadata:W.classMetadata,classSectionId:W.classSectionId,className:W.name,grade:W.classMetadata?.grade||Ae.grade,gradeLevel:W.classMetadata?.gradeLevel,classification:W.classMetadata?.classification,strand:W.classMetadata?.strand,section:W.classMetadata?.section||Ae.section,schoolYear:W.classMetadata?.schoolYear||String(new Date().getFullYear()),ownerTeacherId:W.classMetadata?.ownerTeacherId||r.uid,ownerTeacherName:W.classMetadata?.ownerTeacherName||re,adviserTeacherId:W.classMetadata?.adviserTeacherId||r.uid,adviserTeacherName:W.classMetadata?.adviserTeacherName||re,managerId:de.uid,managerName:de.name}),Ce=we.classSectionId||Yn(we.grade||Ae.grade,we.section||Ae.section);if(!Ce){ue.error("Unable to assign manager: missing class section ID.");return}K(!0);try{await Vee({classSectionId:Ce,className:we.className||W.name,grade:we.grade||Ae.grade,gradeLevel:we.gradeLevel||ns(we.grade||Ae.grade)||we.grade||Ae.grade,classification:we.classification||fi(we.gradeLevel||we.grade)||void 0,strand:we.strand||mi(we.className,we.section)||void 0,section:we.section||Ae.section,schoolYear:we.schoolYear||String(new Date().getFullYear()),ownerTeacherId:we.ownerTeacherId||r.uid,ownerTeacherName:we.ownerTeacherName||re,managerId:de.uid,managerName:de.name});const Se=Vt({metadata:we,classSectionId:Ce,managerId:de.uid,managerName:de.name}),ct=It(Ce);w(Qe=>Qe.map(Te=>It(Te.classSectionId)!==ct?Te:{...Te,name:Se.className||Te.name,classSectionId:Se.classSectionId||Te.classSectionId,classMetadata:Se,gradeLevel:Se.gradeLevel||Te.gradeLevel,classification:Se.classification||Te.classification,strand:Se.strand||Te.strand,managerId:de.uid,managerName:de.name})),A(Qe=>Qe.map(Te=>{if(It(Te.classSectionId||Te.classroomId)!==ct)return Te;const tn=Vt({metadata:Te.classMetadata,classSectionId:Se.classSectionId||Te.classSectionId,className:Te.className||Se.className,grade:Te.grade||Se.grade,gradeLevel:Te.gradeLevel||Se.gradeLevel,classification:Te.classification||Se.classification,strand:Te.strand||Se.strand,section:Te.section||Se.section,managerId:de.uid,managerName:de.name});return{...Te,classMetadata:tn,gradeLevel:tn.gradeLevel||Te.gradeLevel,classification:tn.classification||Te.classification,strand:tn.strand||Te.strand,managerId:de.uid,managerName:de.name}})),S(Qe=>!Qe||It(Qe.classSectionId)!==ct?Qe:{...Qe,classMetadata:Se,managerId:de.uid,managerName:de.name,gradeLevel:Se.gradeLevel||Qe.gradeLevel,classification:Se.classification||Qe.classification,strand:Se.strand||Qe.strand}),ue.success(`Assigned ${de.name} as section manager.`)}catch(Se){console.error("Failed to assign class manager:",Se),ue.error(Se instanceof Error?Se.message:"Failed to assign class manager")}finally{K(!1)}};v.useEffect(()=>{const W=()=>{const de=window.innerWidth<1024;g(de),de?c(!1):m(!1)};return W(),window.addEventListener("resize",W),()=>window.removeEventListener("resize",W)},[]),v.useEffect(()=>{h&&m(!1)},[i,h]);const re=s?.name||"Teacher",te=v.useMemo(()=>{if(!j)return;if(j.classMetadata?.classSectionId)return j.classMetadata.classSectionId||void 0;if(j.classSectionId)return j.classSectionId;const W=Qn(j.classMetadata?.className||j.name);return Yn(W.grade,W.section)||void 0},[j]),se=v.useMemo(()=>j||b[0]||null,[j,b]),q=v.useMemo(()=>{if(!se)return k;const W=(se.id||"").trim().toLowerCase(),de=It(se.classSectionId),Ae=(se.name||"").trim().toLowerCase();return k.filter(we=>{const Ce=It(we.classroomId),Se=It(we.classSectionId),ct=(we.className||"").trim().toLowerCase();return de&&(Se===de||Ce===de)||W&&(Ce===W||Se===W)||Ae&&ct===Ae})},[se,k]);return P?a.jsxs("div",{className:"flex h-screen w-full bg-background p-6",children:[a.jsx("div",{className:"hidden lg:flex w-[280px] shrink-0 rounded-3xl border border-border bg-card p-5",children:a.jsxs("div",{className:"w-full space-y-4",children:[a.jsx(Ne,{className:"h-12 w-40"}),a.jsx(Ne,{className:"h-10 w-full"}),a.jsx(Ne,{className:"h-10 w-full"}),a.jsx(Ne,{className:"h-10 w-full"}),a.jsx(Ne,{className:"h-10 w-full"})]})}),a.jsxs("div",{className:"flex-1 space-y-4 lg:pl-6",children:[a.jsx(Ne,{className:"h-20 w-full rounded-2xl"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx(Ne,{className:"h-28 w-full rounded-2xl"}),a.jsx(Ne,{className:"h-28 w-full rounded-2xl"}),a.jsx(Ne,{className:"h-28 w-full rounded-2xl"})]}),a.jsx(Ne,{className:"h-[420px] w-full rounded-2xl"})]})]}):a.jsxs("div",{className:"relative flex h-screen w-full bg-background overflow-hidden",children:[h&&u&&a.jsx("button",{"aria-label":"Close navigation",className:"fixed inset-0 z-30 bg-slate-900/40 backdrop-blur-[1px]",onClick:()=>m(!1)}),a.jsxs(J.aside,{initial:!1,animate:{width:h?280:l&&!d?80:280,x:h?u?0:-300:0},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>!h&&l&&f(!0),onMouseLeave:()=>f(!1),className:"fixed inset-y-0 left-0 z-40 bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] flex flex-col shadow-sm lg:static lg:z-auto p-5",children:[a.jsxs("div",{className:`mb-8 flex items-center ${l&&!d?"justify-center":"justify-between"}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-[#7274ED] to-[#9956DE] rounded-2xl flex items-center justify-center shadow-md flex-shrink-0",children:a.jsx("img",{src:"/avatar/avatar_icon.png",alt:"MathPulse AI",className:"w-10 h-10 object-contain drop-shadow-md"})}),(!l||d)&&a.jsx("div",{children:a.jsx("h1",{className:"text-base font-bold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),!h&&(!l||d)&&a.jsx(J.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>c(!l),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":l?"Expand sidebar":"Collapse sidebar",children:l?a.jsx(jn,{size:20}):a.jsx(Ya,{size:20})}),h&&a.jsx("button",{onClick:()=>m(!1),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:a.jsx(Xe,{size:20})})]}),a.jsxs("nav",{className:"flex-1 space-y-5",children:[a.jsxs("div",{children:[l&&!d?a.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:a.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):a.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:"Overview"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(qr,{icon:Fl,label:"Dashboard",active:i==="dashboard",collapsed:l&&!d,onClick:G,forceExpanded:h}),a.jsx(qr,{icon:wn,label:"Class Analytics",active:i==="analytics",collapsed:l&&!d,onClick:()=>o("analytics"),forceExpanded:h})]})]}),a.jsxs("div",{children:[l&&!d?a.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:a.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):a.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:"Students"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(qr,{icon:cn,label:"Topic Mastery",active:i==="topic_mastery",collapsed:l&&!d,onClick:()=>o("topic_mastery"),forceExpanded:h}),a.jsx(qr,{icon:kt,label:"Competency",active:i==="competency",collapsed:l&&!d,onClick:()=>o("competency"),forceExpanded:h})]})]}),a.jsxs("div",{children:[l&&!d?a.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:a.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):a.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:"Tools"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(qr,{icon:ys,label:"Data Import",active:i==="import",collapsed:l&&!d,onClick:()=>o("import"),forceExpanded:h}),a.jsx(qr,{icon:cC,label:"AI Quiz Maker",active:i==="quiz_maker",collapsed:l&&!d,onClick:()=>o("quiz_maker"),forceExpanded:h}),a.jsx(qr,{icon:Ar,label:"Notifications",active:i==="notifications",collapsed:l&&!d,onClick:()=>o("notifications"),forceExpanded:h}),a.jsx(qr,{icon:ta,label:"Calendar",active:i==="calendar",collapsed:l&&!d,onClick:()=>o("calendar"),forceExpanded:h})]})]})]}),a.jsxs("div",{className:"space-y-2 border-t border-[#dde3eb] pt-4",children:[a.jsxs(J.button,{whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-bold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap ${l&&!d?"justify-center":""}`,onClick:n,title:l&&!d?"Settings":"",children:[a.jsx(w0,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!l||d)&&a.jsx("span",{className:"font-body text-xs",children:"Settings"})]}),a.jsx("div",{className:"text-[#5a6578]",children:a.jsx(OC,{onClick:()=>p(!0),collapsed:l&&!d})})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a.jsx("header",{className:"bg-card/80 backdrop-blur-md border-b border-border px-6 py-3 sticky top-0 z-30",children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[h&&a.jsx("button",{onClick:()=>m(!0),className:"mt-1 p-2 rounded-lg border border-border text-muted-foreground hover:text-[#9956DE] hover:border-[#9956DE]/30 hover:bg-[#9956DE]/12 transition-colors","aria-label":"Open navigation",children:a.jsx(CD,{size:18})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-xl font-display font-bold text-foreground leading-tight",children:[i==="dashboard"&&"Teacher Dashboard",i==="analytics"&&(j?j.name:"Class Analytics"),i==="intervention"&&"Student Intervention",i==="topic_mastery"&&"Topic Mastery",i==="competency"&&"Student Competency",i==="import"&&"Data Import",i==="notifications"&&"Notifications",i==="calendar"&&"Calendar",i==="quiz_maker"&&"AI Quiz Maker"]}),a.jsxs("p",{className:"text-xs text-muted-foreground font-body",children:[i==="dashboard"&&`Welcome back, ${re}`,i==="analytics"&&"Deep dive into class performance",i==="intervention"&&y?.name,i==="topic_mastery"&&"Monitor class-wide topic mastery",i==="competency"&&"Per-student topic-level breakdown",i==="import"&&"Upload class records and materials",i==="quiz_maker"&&"Create and manage AI-powered quizzes",i==="notifications"&&"View classroom alerts and updates",i==="calendar"&&"Check upcoming class events and schedule"]})]}),i==="dashboard"&&a.jsxs("div",{className:"hidden xl:flex items-center gap-2 ml-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-lg",children:[a.jsx(kt,{size:13,className:"text-[#9956DE]"}),a.jsxs("span",{className:"text-xs font-display font-bold text-[#9956DE]",children:[X," students"]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#F08386]/12 border border-[#F08386]/30 rounded-lg",children:[a.jsx(Gt,{size:13,className:"text-[#F08386]"}),a.jsxs("span",{className:"text-xs font-display font-bold text-[#C65E63]",children:[I," at risk"]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#75D06A]/14 border border-[#75D06A]/35 rounded-lg",children:[a.jsx(ot,{size:13,className:"text-[#75D06A]"}),a.jsxs("span",{className:"text-xs font-display font-bold text-[#4D9F46]",children:[Z,"% avg"]})]})]})]}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("button",{onClick:t,className:"flex items-center gap-2.5 bg-muted p-1.5 pr-3 rounded-lg cursor-pointer hover:bg-accent transition-all group max-w-[220px]",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg overflow-hidden ring-1 ring-[#9956DE]/45 bg-card flex items-center justify-center",children:a.jsx("img",{src:s?.photo||`https://ui-avatars.com/api/?name=${encodeURIComponent(re)}&background=random`,alt:re,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"hidden md:block min-w-0 text-left",children:[a.jsx("p",{className:"text-sm font-semibold text-foreground leading-none group-hover:text-[#9956DE] transition-colors truncate",children:re}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-none",children:"Teacher"})]})]})})]})}),a.jsx("main",{className:"flex-1 overflow-y-auto",children:a.jsxs(Ke,{mode:"wait",children:[i==="dashboard"&&a.jsx(cne,{classes:b,liveActivity:C,onViewClass:_,onViewAllClasses:()=>o("analytics"),dailyInsight:D,insightLoading:Y,totalStudents:X,totalAtRisk:I,avgPerformance:Z}),i==="analytics"&&se&&a.jsx(dne,{selectedClass:se,students:q,riskDistribution:ne,topicPerformance:$,onViewStudent:Q,onBack:G,teacherOptions:B,managerUpdating:M,onAssignManager:W=>ae(se,W)}),i==="analytics"&&!se&&a.jsx(lne,{icon:wn,title:"Class Analytics",description:"No classes available yet. Import class records to unlock analytics views."}),i==="intervention"&&y&&a.jsx(une,{student:y,teacherId:r?.uid||"",teacherName:re,onStudentUpdated:W=>{const de=y?Ps(y):null;N(W),A(Ae=>Ae.map(we=>{const Ce=Ps(we),Se=de?Ce===de:!1,ct=we.id===W.id&&It(we.classSectionId)===It(W.classSectionId);return Se||ct?W:we}))},onBack:R}),i==="topic_mastery"&&a.jsx(Mte,{classSectionId:te}),i==="competency"&&a.jsx(Dte,{classSectionId:te,className:j?.name,fallbackStudents:k}),i==="import"&&a.jsx(fne,{onEditRecords:()=>o("edit_records"),classSectionId:te,className:j?.name,classMetadata:j?.classMetadata,onImportedClassRecords:W=>{const de=W.students.map(Te=>sne(Te,W.classSectionId,W.className,W.classMetadata)),Ae=Vt({metadata:W.classMetadata,classSectionId:W.classSectionId,className:W.className}),we=Ae.classSectionId||"imported_class",Ce=Ae.className||"Imported Class",Se=de.filter(Te=>Te.riskLevel==="high").length,ct=de.length>0?Math.round(de.reduce((Te,en)=>Te+en.avgScore,0)/de.length):0,Qe={id:we,name:Ce,classSectionId:we,classMetadata:{...Ae,classSectionId:we,className:Ce},schedule:"Mon-Fri",studentCount:de.length,avgScore:ct,atRiskCount:Se,riskLevel:Se>=5?"high":Se>=2?"medium":"low"};A(Te=>m5(Te,de)),w(Te=>u5(Te,[Qe]))},onDataChanged:()=>E(W=>W+1)}),i==="notifications"&&a.jsx(Fte,{userId:r?.uid||""}),i==="calendar"&&a.jsx(Jte,{}),i==="edit_records"&&a.jsx(mne,{students:k,teacherId:r?.uid||"",teacherName:re,onBack:()=>o("import")}),i==="quiz_maker"&&a.jsx(Cte,{onBack:()=>o("dashboard")})]})})]}),a.jsx(Ua,{isOpen:x,onClose:()=>p(!1),onConfirm:e,title:"Logout",message:"Are you sure you want to logout?",confirmText:"Logout",cancelText:"Cancel"})]})},qr=({icon:e,label:t,active:n,collapsed:r,forceExpanded:s=!1,onClick:i})=>a.jsxs(J.button,{onClick:i,whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${r&&!s?"justify-center":""} ${n?"bg-[#9956DE]/12 border-[#9956DE]/30 shadow-sm text-[#9956DE]":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[a.jsx(e,{size:18,strokeWidth:n?2.5:2,className:"flex-shrink-0"}),(!r||s)&&a.jsx("span",{className:"font-body font-bold text-xs",children:t}),n&&!r&&a.jsx(J.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-[#9956DE]",transition:{type:"spring",duration:.4}})]}),lne=({icon:e,title:t,description:n})=>a.jsx(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:a.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm max-w-2xl",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#9956DE]/20 text-[#9956DE] flex items-center justify-center mb-4",children:a.jsx(e,{size:24})}),a.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mb-2",children:t}),a.jsx("p",{className:"text-sm text-muted-foreground font-body leading-relaxed",children:n})]})}),cne=({classes:e,liveActivity:t,onViewClass:n,onViewAllClasses:r,dailyInsight:s,insightLoading:i,totalStudents:o,totalAtRisk:l,avgPerformance:c})=>{const d=o>0?Math.round(l/o*100):0,f=o>0?Math.round((o-l)/o*100):0;return a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6 space-y-6",children:[a.jsx("div",{className:"bg-gradient-to-r from-[#7274ED] to-[#9956DE] rounded-2xl p-5 text-white shadow-md",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-card/20 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(Gt,{size:20})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h2",{className:"text-base font-display font-bold mb-1",children:"AI Insight"}),a.jsx(Bl,{name:"teacher-dashboard-ai-insight",loading:i,fixture:a.jsxs("div",{className:"space-y-2 pt-1",children:[a.jsx(Ne,{className:"h-3.5 w-11/12 bg-white/25"}),a.jsx(Ne,{className:"h-3.5 w-10/12 bg-white/20"}),a.jsx(Ne,{className:"h-3.5 w-8/12 bg-white/15"})]}),fallback:a.jsxs("div",{className:"space-y-2 pt-1",children:[a.jsx(Ne,{className:"h-3.5 w-11/12 bg-white/25"}),a.jsx(Ne,{className:"h-3.5 w-10/12 bg-white/20"}),a.jsx(Ne,{className:"h-3.5 w-8/12 bg-white/15"})]}),children:a.jsx("div",{className:"text-[#F1E4FF] text-sm leading-relaxed [&_p]:m-0 [&_strong]:font-semibold",children:a.jsx(md,{children:s||`${l} students (${d}%) are at high risk of falling behind`})})})]})]})}),a.jsxs("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"Total Students"}),a.jsx("p",{className:"text-2xl font-display font-bold text-foreground",children:o})]}),a.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"Class Average"}),a.jsxs("p",{className:"text-2xl font-display font-bold text-[#9956DE]",children:[c,"%"]})]}),a.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"Engagement Rate"}),a.jsxs("p",{className:"text-2xl font-display font-bold text-[#75D06A]",children:[f,"%"]})]}),a.jsxs("div",{className:"bg-card rounded-xl p-4 border border-[#FF8B8B]/35 shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground font-body mb-1",children:"At Risk"}),a.jsx("p",{className:"text-2xl font-display font-bold text-[#FF8B8B]",children:l})]})]}),a.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"xl:col-span-2 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"My Classes"}),a.jsxs("button",{onClick:r,className:"text-sm font-bold text-[#9956DE] hover:text-[#9956DE] flex items-center gap-1 group",children:["View All",a.jsx(jn,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]}),a.jsx("div",{className:"space-y-4",children:e.map(u=>a.jsxs(J.div,{whileHover:{scale:1.01},className:"bg-card border border-border rounded-2xl p-6 shadow-sm hover:shadow-md transition-all cursor-pointer",onClick:()=>n(u),children:[a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:u.name}),a.jsx("span",{className:`px-3 py-1 rounded-lg text-xs font-bold border ${Wd(u.riskLevel)}`,children:u.riskLevel==="high"?"High Risk":u.riskLevel==="medium"?"Medium Risk":"Low Risk"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(On,{size:14}),a.jsx("span",{children:u.schedule})]}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:[u.gradeLevel,u.classification,u.strand].filter(Boolean).map(m=>a.jsx("span",{className:"px-2 py-0.5 rounded-md bg-[#9956DE]/12 border border-[#9956DE]/30 text-[#9956DE] text-[11px] font-semibold",children:m},`${u.id}-${m}`))}),a.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Manager: ",u.managerName||u.classMetadata?.managerName||"Not assigned"]})]}),a.jsx(pe,{className:"bg-[#9956DE] hover:bg-[#7A44B3] text-white font-bold px-6 py-2 rounded-xl",children:"View Class"})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Total Students"}),a.jsx("p",{className:"text-xl font-bold text-foreground",children:u.studentCount})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"At Risk"}),a.jsx("p",{className:"text-xl font-bold text-[#FF8B8B]",children:u.atRiskCount})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Avg Score"}),a.jsxs("p",{className:"text-xl font-bold text-[#9956DE]",children:[u.avgScore,"%"]})]})]})]},u.id))})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-10 h-10 bg-[#F08386]/20 rounded-xl flex items-center justify-center",children:a.jsx(Jn,{size:20,className:"text-[#F08386]"})}),a.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"Live Classroom Pulse"})]}),a.jsxs("div",{className:"bg-card rounded-2xl p-5 shadow-sm border border-border space-y-3 max-h-[600px] overflow-y-auto",children:[t.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No live classroom events yet. Activity appears here in real time."}),t.map(u=>a.jsxs("div",{className:`p-4 rounded-xl border-l-4 ${u.type==="success"?"bg-[#75D06A]/14 border-[#75D06A]":u.type==="warning"?"bg-[#F08386]/12 border-[#F08386]":"bg-[#9956DE]/12 border-[#9956DE]"}`,children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsx("p",{className:"font-bold text-foreground text-sm",children:u.student}),a.jsx("span",{className:"text-xs text-slate-500",children:u.time})]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[u.action," ",a.jsx("span",{className:"font-bold text-foreground",children:u.topic})]})]},u.id))]})]})]})]})},dne=({selectedClass:e,students:t,riskDistribution:n,topicPerformance:r,onViewStudent:s,onBack:i,teacherOptions:o,managerUpdating:l,onAssignManager:c})=>{const[d,f]=v.useState(""),[u,m]=v.useState("");v.useEffect(()=>{m(e.classMetadata?.managerId||e.managerId||"")},[e]);const h=v.useMemo(()=>{const b=d.trim().toLowerCase();return b?t.filter(w=>w.name.toLowerCase().includes(b)||(w.lrn||"").toLowerCase().includes(b)||(w.weakestTopic||"").toLowerCase().includes(b)):t},[d,t]),g=v.useMemo(()=>{if(t.length===0)return 0;const b=t.reduce((w,k)=>w+(k.assignmentCompletion||0),0);return Math.round(b/t.length)},[t]),x=v.useMemo(()=>{if(t.length===0)return 0;const b=t.reduce((k,A)=>k+(A.attendance||0),0)/t.length,w=t.reduce((k,A)=>k+(A.engagementScore||0),0)/t.length;return Math.round(b*.6+w*.4)},[t]),p=v.useMemo(()=>[...t].sort((b,w)=>w.avgScore-b.avgScore).slice(0,5),[t]),j=v.useMemo(()=>[...t].filter(b=>b.riskLevel==="high"||b.avgScore<70||b.assignmentCompletion<65).sort((b,w)=>{if(b.riskLevel!==w.riskLevel){const k={high:3,medium:2,low:1};return k[w.riskLevel]-k[b.riskLevel]}return b.avgScore-w.avgScore}).slice(0,6),[t]),S=v.useMemo(()=>o.find(b=>b.uid===u),[o,u]),y=()=>{if(!S){ue.error("Select a teacher manager first.");return}c(S)},N=[e.classMetadata?.gradeLevel||e.gradeLevel,e.classMetadata?.classification||e.classification,e.classMetadata?.strand||e.strand].filter(Boolean);return a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:[a.jsxs("button",{onClick:i,className:"flex items-center gap-2 text-muted-foreground hover:text-[#9956DE] font-bold mb-6 transition-colors group",children:[a.jsx(Ya,{size:20,className:"group-hover:-translate-x-1 transition-transform"}),"Back to Dashboard"]}),a.jsx("div",{className:"bg-card rounded-2xl border border-border p-5 shadow-sm mb-6",children:a.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h2",{className:"text-2xl font-display font-bold text-foreground",children:e.name}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:`px-3 py-1 rounded-lg text-xs font-bold border ${Wd(e.riskLevel)}`,children:e.riskLevel==="high"?"High Risk Cohort":e.riskLevel==="medium"?"Medium Risk Cohort":"Low Risk Cohort"}),N.map(b=>a.jsx("span",{className:"px-3 py-1 rounded-lg text-xs font-semibold border bg-[#9956DE]/12 border-[#9956DE]/30 text-[#9956DE]",children:b},b))]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Manager: ",e.classMetadata?.managerName||e.managerName||"Not assigned"]})]}),a.jsxs("div",{className:"min-w-[260px] bg-muted rounded-xl p-3 border border-border",children:[a.jsx("p",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase tracking-wide",children:"Section Manager"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("select",{id:"analytics-section-manager-select",name:"analytics-section-manager-select","aria-label":"Select section manager",value:u||"",onChange:b=>m(b.target.value),className:"h-10 flex-1 rounded-lg border border-border bg-card px-3 text-sm",children:[a.jsx("option",{value:"",children:"Select teacher"}),o.map(b=>a.jsxs("option",{value:b.uid,children:[b.name," (",b.email,")"]},b.uid))]}),a.jsx(pe,{onClick:y,disabled:!u||l,className:"bg-[#9956DE] hover:bg-[#7A44B3] text-white",children:l?a.jsx(Ne,{className:"h-4 w-12 bg-white/35"}):"Assign"})]})]})]})}),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[a.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Class Average"}),a.jsxs("p",{className:"text-2xl font-display font-bold text-[#9956DE]",children:[e.avgScore,"%"]})]}),a.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Completion Rate"}),a.jsxs("p",{className:"text-2xl font-display font-bold text-[#75D06A]",children:[g,"%"]})]}),a.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Participation"}),a.jsxs("p",{className:"text-2xl font-display font-bold text-[#9956DE]",children:[x,"%"]})]}),a.jsxs("div",{className:"bg-card border border-[#FF8B8B]/35 rounded-xl p-4 shadow-sm",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Needs Attention"}),a.jsx("p",{className:"text-2xl font-display font-bold text-[#FF8B8B]",children:j.length})]})]}),a.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-5 gap-6",children:[a.jsxs("div",{className:"xl:col-span-2 bg-card rounded-2xl p-6 shadow-sm border border-border",children:[a.jsxs("div",{className:"flex items-center justify-between mb-5",children:[a.jsxs("h2",{className:"text-lg font-display font-bold text-foreground",children:["Students (",h.length,")"]}),a.jsxs("div",{className:"relative",children:[a.jsx(_n,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:16}),a.jsx(ve,{id:"analytics-student-search",name:"analytics-student-search","aria-label":"Search students",type:"text",placeholder:"Search...",value:d,onChange:b=>f(b.target.value),className:"w-40 pl-9 pr-4 py-2 rounded-xl border-border text-sm"})]})]}),a.jsxs("div",{className:"space-y-3 max-h-[700px] overflow-y-auto",children:[h.map(b=>a.jsxs(J.div,{whileHover:{scale:1.02},onClick:()=>s(b),className:`p-4 rounded-2xl border-2 cursor-pointer hover:shadow-md transition-all ${hne(b.riskLevel)}`,children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsx("img",{src:b.avatar,alt:b.name,className:"w-12 h-12 rounded-xl object-cover border-2 border-current"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"font-bold text-foreground",children:b.name}),a.jsx("p",{className:"text-xs text-muted-foreground",children:b.lastActive})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-xs font-bold text-muted-foreground",children:"Avg Score"}),a.jsxs("span",{className:"text-xs font-bold text-foreground",children:[b.avgScore,"%"]})]}),a.jsx("div",{className:"h-2 bg-card rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full ${b.riskLevel==="high"?"bg-[#FF8B8B]":b.riskLevel==="medium"?"bg-[#F08386]":"bg-[#75D06A]"}`,style:{width:`${b.avgScore}%`}})})]})]},Ps(b))),h.length===0&&a.jsx("div",{className:"border border-dashed border-border rounded-xl p-4 text-sm text-muted-foreground",children:"No students match your search."})]})]}),a.jsxs("div",{className:"xl:col-span-3 space-y-6",children:[a.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[a.jsx("h2",{className:"text-lg font-display font-bold text-foreground mb-5",children:"Risk Distribution"}),a.jsx(H2,{width:"100%",height:250,children:a.jsxs(Yk,{data:n,children:[a.jsx(Tg,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),a.jsx(Do,{dataKey:"name",tick:{fontSize:12}}),a.jsx(Ro,{tick:{fontSize:12}}),a.jsx(Bn,{}),a.jsx(la,{dataKey:"value",radius:[8,8,0,0],children:n.map((b,w)=>a.jsx(Y0,{fill:b.color},`cell-${w}`))})]})})]}),a.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[a.jsx("h2",{className:"text-lg font-display font-bold text-foreground mb-5",children:"Topic Performance"}),a.jsx(H2,{width:"100%",height:250,children:a.jsxs(Yk,{data:r,children:[a.jsx(Tg,{strokeDasharray:"3 3",stroke:"var(--border)"}),a.jsx(Do,{dataKey:"topic",tick:{fontSize:12}}),a.jsx(Ro,{tick:{fontSize:12},domain:[0,100]}),a.jsx(Bn,{}),a.jsx(la,{dataKey:"score",fill:"#9956DE",radius:[8,8,0,0]})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-card border border-border rounded-2xl p-4",children:[a.jsx("h3",{className:"text-sm font-display font-bold text-foreground mb-3",children:"Top Performers"}),a.jsxs("div",{className:"space-y-2",children:[p.slice(0,4).map(b=>a.jsxs("button",{onClick:()=>s(b),className:"w-full flex items-center justify-between rounded-lg border border-border px-3 py-2 hover:bg-[#9956DE]/12 transition-colors",children:[a.jsx("span",{className:"text-sm font-semibold text-foreground",children:b.name}),a.jsxs("span",{className:"text-xs font-bold text-[#75D06A]",children:[b.avgScore,"%"]})]},`top-${Ps(b)}`)),p.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No students available yet."})]})]}),a.jsxs("div",{className:"bg-card border border-border rounded-2xl p-4",children:[a.jsx("h3",{className:"text-sm font-display font-bold text-foreground mb-3",children:"Students Needing Attention"}),a.jsxs("div",{className:"space-y-2",children:[j.slice(0,4).map(b=>a.jsxs("button",{onClick:()=>s(b),className:"w-full flex items-center justify-between rounded-lg border border-[#FF8B8B]/35 bg-[#FF8B8B]/14 px-3 py-2 hover:bg-[#FF8B8B]/20 transition-colors",children:[a.jsx("span",{className:"text-sm font-semibold text-foreground",children:b.name}),a.jsx("span",{className:"text-xs font-bold text-[#FF8B8B]",children:b.riskLevel.toUpperCase()})]},`attention-${Ps(b)}`)),j.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No urgent students in this class right now."})]})]})]})]})]})]})},une=({student:e,teacherId:t,teacherName:n,onStudentUpdated:r,onBack:s})=>{const i=(e.riskLevel||"low").toLowerCase(),o=i==="high"||i==="medium",l=o?{card:"bg-[#FF8B8B]/14 border-[#FF8B8B]/35",icon:"bg-red-600",bullet:"text-[#FF8B8B]"}:{card:"bg-[#9956DE]/12 border-[#9956DE]/30",icon:"bg-[#9956DE]",bullet:"text-[#9956DE]"},c=v.useMemo(()=>$e.getImportGroundedRolloutFlags(),[]),[d,f]=v.useState(""),[u,m]=v.useState(!0),[h,g]=v.useState(e.grade||"Grade 11"),[x,p]=v.useState(e.section||"Section A"),[j,S]=v.useState(!1),[y,N]=v.useState(null),[b,w]=v.useState(!1),[k,A]=v.useState(""),[C,F]=v.useState("all"),[D,L]=v.useState("all"),[P,H]=v.useState(!1),[Y,V]=v.useState(!1),[O,E]=v.useState(null),[B,T]=v.useState(!1),[M,K]=v.useState(!1);v.useEffect(()=>{g(e.grade||"Grade 11"),p(e.section||"Section A")},[e.grade,e.section]),v.useEffect(()=>{(async()=>{m(!0);try{const G=await $e.getLearningPath({weaknesses:e.struggles.length>0?e.struggles:[e.weakestTopic],gradeLevel:"High School"});f(G.learningPath)}catch{f("Unable to generate learning path. Please try again later.")}finally{m(!1)}})()},[e]);const X=v.useCallback(async()=>{w(!0),A("");try{const R=e.classSectionId||Yn(h||"Grade 11",x||"Section A"),G=await $e.generateLessonPlan({gradeLevel:h||e.grade||"Grade 11",classSectionId:R,className:[h,x].filter(Boolean).join(" - ")||e.className,focusTopics:e.struggles.length>0?e.struggles:[e.weakestTopic],topicCount:5,preferImportedTopics:c.lessonEnabled,allowReviewSources:P,allowUnverifiedLesson:Y});N(G),E(null),$e.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:R,className:[h,x].filter(Boolean).join(" - ")||e.className,metadata:{usedImportedTopics:G.usedImportedTopics,importedTopicCount:G.importedTopicCount,blockCount:G.blocks.length,publishReady:G.publishReady,sourceLegitimacyStatus:G.sourceLegitimacy.status,selfValidationPassed:G.selfValidation.passed,importGroundingEnabled:c.lessonEnabled}})}catch(R){let G=R instanceof Error?R.message:"Unable to generate lesson plan at this time.";if(R instanceof vn&&R.status===422)try{const re=JSON.parse(R.responseBody)?.detail;re?.message&&(G=re.message);const te=re?.sourceLegitimacy?.issues||[],se=re?.selfValidation?.issues||[],q=[...te,...se].filter(Boolean).slice(0,3);q.length>0&&(G=`${G} ${q.join(" ")}`)}catch{}A(G),N(null),$e.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:e.classSectionId||Yn(h||"Grade 11",x||"Section A"),className:[h,x].filter(Boolean).join(" - ")||e.className,metadata:{error:G,allowReviewSources:P,allowUnverifiedLesson:Y,importGroundingEnabled:c.lessonEnabled}})}finally{w(!1)}},[e,h,x,c.lessonEnabled,P,Y]),I=v.useCallback(async()=>{if(!y)return ue.error("Generate a lesson plan first."),null;T(!0);try{const R=await Hee(y,t,{teacherName:n,studentId:e.id,studentName:e.name});return E(R),ue.success("Lesson plan saved as draft."),R}catch(R){return console.error("Failed to save lesson draft:",R),ue.error(R instanceof Error?R.message:"Failed to save lesson draft."),null}finally{T(!1)}},[y,t,n,e.id,e.name]),Z=v.useCallback(async()=>{if(!y){ue.error("Generate a lesson plan first.");return}if(!y.publishReady){const R=[...y.sourceLegitimacy.issues,...y.selfValidation.issues].filter(Boolean).slice(0,2).join(" ");ue.error(R||"Lesson is not publish-ready. Resolve legitimacy and validation checks first.");return}K(!0);try{let R=O;if(R||(R=await I()),!R)return;await Kee(R),ue.success("Lesson plan published to class content."),$e.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:y.classSectionId||e.classSectionId,className:y.className||e.className,metadata:{action:"publish_lesson_plan",lessonPlanId:R,publishReady:y.publishReady,sourceLegitimacyStatus:y.sourceLegitimacy.status,selfValidationPassed:y.selfValidation.passed}})}catch(R){console.error("Failed to publish lesson plan:",R),ue.error(R instanceof Error?R.message:"Failed to publish lesson plan."),$e.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:y.classSectionId||e.classSectionId,className:y.className||e.className,metadata:{action:"publish_lesson_plan",error:R instanceof Error?R.message:"Failed to publish lesson plan."}})}finally{K(!1)}},[y,O,I,e.className,e.classSectionId]);v.useEffect(()=>{X()},[X]),v.useEffect(()=>{F("all"),L("all")},[y]);const ne=v.useMemo(()=>y?Array.from(new Set(y.blocks.map(R=>R.provenance?.sourceFile?.trim()).filter(R=>!!R))).sort((R,G)=>R.localeCompare(G)):[],[y]),ee=v.useMemo(()=>y?Array.from(new Set(y.blocks.map(R=>R.provenance?.materialId?.trim()).filter(R=>!!R))).sort((R,G)=>R.localeCompare(G)):[],[y]),$=v.useMemo(()=>y?y.blocks.filter(R=>{const G=C==="all"||(R.provenance?.sourceFile||"").trim()===C,ae=D==="all"||(R.provenance?.materialId||"").trim()===D;return G&&ae}):[],[y,C,D]),_=[{id:1,type:"video",title:`${e.weakestTopic} Fundamentals`,duration:"8 mins",icon:bC},{id:2,type:"quiz",title:`${e.weakestTopic} Practice`,questions:10,icon:cC},{id:3,type:"assessment",title:"Final Check",questions:5,icon:Kn}],Q=async()=>{if(!t){ue.error("Unable to update section: teacher context missing");return}S(!0);try{await hM(e.id,h,x,t,new Date().getFullYear().toString(),n),await uM(e.id,h,x);const R={...e,grade:h,section:x,className:[h,x].filter(Boolean).join(" - "),classSectionId:Yn(h,x)};r(R),ue.success("Student section assignment updated")}catch(R){console.error("Failed to update student section assignment:",R),ue.error("Failed to update section assignment")}finally{S(!1)}};return a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:[a.jsxs("button",{onClick:s,className:"flex items-center gap-2 text-muted-foreground hover:text-[#9956DE] font-bold mb-6 transition-colors group",children:[a.jsx(Ya,{size:20,className:"group-hover:-translate-x-1 transition-transform"}),"Back to Analytics"]}),a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsx("div",{className:"bg-card rounded-2xl p-8 shadow-sm border border-border",children:a.jsxs("div",{className:"flex items-start gap-6",children:[a.jsx("img",{src:e.avatar,alt:e.name,className:"w-24 h-24 rounded-2xl object-cover"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("h1",{className:"text-3xl font-display font-bold text-foreground",children:e.name}),a.jsx("span",{className:`px-4 py-1.5 rounded-xl text-sm font-bold border-2 ${Wd(e.riskLevel)}`,children:e.riskLevel==="high"?"High Risk":e.riskLevel==="medium"?"Medium Risk":"Low Risk"})]}),a.jsx("p",{className:"text-muted-foreground mb-4",children:e.className}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-muted rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Avg Score"}),a.jsxs("p",{className:"text-2xl font-bold text-foreground",children:[e.avgScore,"%"]})]}),a.jsxs("div",{className:"bg-muted rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Last Active"}),a.jsx("p",{className:"text-sm font-bold text-foreground",children:e.lastActive})]}),a.jsxs("div",{className:"bg-muted rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Weakest Topic"}),a.jsx("p",{className:"text-sm font-bold text-[#FF8B8B]",children:e.weakestTopic})]})]}),a.jsxs("div",{className:"mt-5 p-4 bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-xl",children:[a.jsx("p",{className:"text-xs font-semibold text-[#9956DE] mb-3 uppercase tracking-wider",children:"Section Assignment"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[a.jsx(ve,{value:h,onChange:R=>g(R.target.value),placeholder:"Grade",className:"h-10"}),a.jsx(ve,{value:x,onChange:R=>p(R.target.value),placeholder:"Section",className:"h-10"}),a.jsx(pe,{onClick:Q,disabled:j||!h.trim()||!x.trim(),className:"bg-[#9956DE] hover:bg-[#7A44B3] text-white h-10",children:j?a.jsx(Ne,{className:"h-4 w-20 bg-white/35"}):"Save Section"})]})]})]})]})}),a.jsx("div",{className:`${l.card} border-2 rounded-2xl p-6`,children:a.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[a.jsx("div",{className:`w-12 h-12 ${l.icon} rounded-xl flex items-center justify-center flex-shrink-0`,children:a.jsx(Xr,{size:24,className:"text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-display font-bold text-foreground mb-2",children:o?"AI Analysis - Learning Barriers":"AI Analysis - Learning Strengths & Next Steps"}),a.jsx(Bl,{name:"teacher-intervention-analysis",loading:u,fixture:a.jsxs("div",{className:"space-y-2 pt-1",children:[a.jsx(Ne,{className:"h-3.5 w-64"}),a.jsx(Ne,{className:"h-3.5 w-56"}),a.jsx(Ne,{className:"h-3.5 w-44"})]}),fallback:a.jsxs("div",{className:"space-y-2 pt-1",children:[a.jsx(Ne,{className:"h-3.5 w-64"}),a.jsx(Ne,{className:"h-3.5 w-56"}),a.jsx(Ne,{className:"h-3.5 w-44"})]}),children:a.jsx("ul",{className:"space-y-2 text-foreground",children:e.struggles.length>0?e.struggles.map((R,G)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:`${l.bullet} inline-flex h-5 items-center`,children:"•"}),a.jsxs("span",{children:[o?"Struggles with ":"Continue strengthening ",a.jsx("strong",{children:R})]})]},G)):a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:`${l.bullet} inline-flex h-5 items-center`,children:"•"}),a.jsxs("span",{children:[o?"Needs support in ":"Maintain momentum in ",a.jsx("strong",{children:e.weakestTopic})]})]})})})]})]})}),a.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-sm border border-border",children:[a.jsx("h2",{className:"text-xl font-display font-bold text-foreground mb-6",children:"AI-Generated Learning Path"}),a.jsxs(Bl,{name:"teacher-intervention-learning-path",loading:u,fixture:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ne,{className:"h-24 w-full rounded-xl"}),a.jsx(Ne,{className:"h-20 w-full rounded-2xl"}),a.jsx(Ne,{className:"h-20 w-full rounded-2xl"}),a.jsx(Ne,{className:"h-20 w-full rounded-2xl"})]}),fallback:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ne,{className:"h-24 w-full rounded-xl"}),a.jsx(Ne,{className:"h-20 w-full rounded-2xl"}),a.jsx(Ne,{className:"h-20 w-full rounded-2xl"}),a.jsx(Ne,{className:"h-20 w-full rounded-2xl"})]}),children:[d?a.jsx("div",{className:"bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-xl p-5 mb-6 text-sm text-foreground",children:a.jsx(md,{children:d})}):null,a.jsxs("div",{className:"space-y-4 relative",children:[a.jsx("div",{className:"absolute left-6 top-8 bottom-8 w-0.5 bg-border"}),_.map((R,G)=>{const ae=R.icon;return a.jsxs(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:G*.1},className:"relative pl-16",children:[a.jsx("div",{className:"absolute left-0 w-12 h-12 bg-gradient-to-br from-[#7274ED] to-[#9956DE] rounded-xl flex items-center justify-center shadow-md",children:a.jsx(ae,{size:24,className:"text-white"})}),a.jsx("div",{className:"bg-gradient-to-br from-[#9956DE]/12 to-[#6ED1CF]/18 border border-[#9956DE]/30 rounded-2xl p-5 hover:shadow-md transition-all",children:a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-display font-bold text-foreground mb-1",children:R.title}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[R.type==="video"&&`${R.duration} video lesson`,R.type==="quiz"&&`${R.questions} practice questions`,R.type==="assessment"&&`${R.questions} assessment questions`]})]}),a.jsx("span",{className:`px-3 py-1 rounded-lg text-xs font-bold ${R.type==="video"?"bg-[#F08386]/20 text-[#C65E63]":R.type==="quiz"?"bg-[#9956DE]/20 text-[#9956DE]":"bg-[#75D06A]/22 text-[#4D9F46]"}`,children:R.type==="video"?"Video":R.type==="quiz"?"Quiz":"Assessment"})]})})]},R.id)})]})]})]}),a.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-sm border border-border",children:[a.jsxs("div",{className:"flex items-center justify-between mb-5",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"Targeted Lesson Plan"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Class records drive risk signals. Import-grounded lesson generation needs uploaded course materials for topic context."})]}),a.jsx(pe,{onClick:()=>void X(),disabled:b,className:"bg-[#9956DE] hover:bg-[#7A44B3] text-white",children:b?a.jsx(Ne,{className:"h-4 w-20 bg-white/35"}):"Regenerate"})]}),a.jsx("p",{className:"mb-4 text-xs text-muted-foreground bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-lg px-3 py-2",children:"Class records alone are not enough for import-grounded lesson plans. Upload course materials in Data Import to provide lesson topic grounding."}),a.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-2 gap-2",children:[a.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-[#f8fafc] border border-border rounded-lg px-3 py-2",children:[a.jsx("input",{type:"checkbox",checked:P,onChange:R=>H(R.target.checked)}),"Allow sources requiring manual review"]}),a.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-[#f8fafc] border border-border rounded-lg px-3 py-2",children:[a.jsx("input",{type:"checkbox",checked:Y,onChange:R=>V(R.target.checked)}),"Allow unverified lesson draft (publish remains blocked)"]})]}),a.jsxs(Bl,{name:"teacher-intervention-lesson-plan",loading:b,fixture:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ne,{className:"h-20 w-full rounded-xl"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[a.jsx(Ne,{className:"h-24 w-full rounded-xl"}),a.jsx(Ne,{className:"h-24 w-full rounded-xl"})]}),a.jsx(Ne,{className:"h-28 w-full rounded-xl"}),a.jsx(Ne,{className:"h-28 w-full rounded-xl"})]}),fallback:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ne,{className:"h-20 w-full rounded-xl"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[a.jsx(Ne,{className:"h-24 w-full rounded-xl"}),a.jsx(Ne,{className:"h-24 w-full rounded-xl"})]}),a.jsx(Ne,{className:"h-28 w-full rounded-xl"}),a.jsx(Ne,{className:"h-28 w-full rounded-xl"})]}),children:[k&&a.jsx("div",{className:"bg-[#FF8B8B]/14 border border-[#FF8B8B]/35 rounded-xl p-3 text-sm text-[#D66A6A]",children:k}),y&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-secondary border border-border rounded-xl p-4",children:[a.jsx("p",{className:"text-sm font-semibold text-foreground",children:y.lessonTitle}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Imported topics used: ",y.usedImportedTopics?"Yes":"No"," • ","Imported topic count: ",y.importedTopicCount]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Publish readiness: ",y.publishReady?"Ready":"Blocked"]}),y.warnings.length>0&&a.jsx("p",{className:"text-xs text-[#CC8A37] mt-1",children:y.warnings.join(" ")})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[a.jsxs("div",{className:"bg-card border border-border rounded-xl p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Source Legitimacy"}),a.jsxs("p",{className:"text-sm font-bold text-foreground mt-1",children:[y.sourceLegitimacy.status," (",Math.round(y.sourceLegitimacy.score*100),"%)"]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Verified: ",y.sourceLegitimacy.verifiedMaterials," "," • ","Review: ",y.sourceLegitimacy.reviewMaterials," "," • ","Rejected: ",y.sourceLegitimacy.rejectedMaterials]}),y.sourceLegitimacy.issues.length>0&&a.jsx("p",{className:"text-xs text-[#CC8A37] mt-1",children:y.sourceLegitimacy.issues.slice(0,2).join(" ")})]}),a.jsxs("div",{className:"bg-card border border-border rounded-xl p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Self Validation"}),a.jsxs("p",{className:"text-sm font-bold text-foreground mt-1",children:[y.selfValidation.passed?"Passed":"Failed"," (",Math.round(y.selfValidation.score*100),"%)"]}),y.selfValidation.issues.length>0&&a.jsx("p",{className:"text-xs text-[#CC8A37] mt-1",children:y.selfValidation.issues.slice(0,2).join(" ")})]})]}),(ne.length>0||ee.length>0)&&a.jsxs("div",{className:"bg-card border border-border rounded-xl p-3",children:[a.jsx("p",{className:"text-xs font-semibold text-muted-foreground mb-2",children:"Provenance Filters"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[a.jsxs("label",{className:"text-xs text-muted-foreground flex flex-col gap-1",children:[a.jsx("span",{className:"font-semibold",children:"Source File"}),a.jsxs("select",{value:C,onChange:R=>F(R.target.value),className:"bg-card border border-border rounded-md px-2 py-1.5 text-xs",children:[a.jsx("option",{value:"all",children:"All sources"}),ne.map(R=>a.jsx("option",{value:R,children:R},R))]})]}),a.jsxs("label",{className:"text-xs text-muted-foreground flex flex-col gap-1",children:[a.jsx("span",{className:"font-semibold",children:"Material ID"}),a.jsxs("select",{value:D,onChange:R=>L(R.target.value),className:"bg-card border border-border rounded-md px-2 py-1.5 text-xs",children:[a.jsx("option",{value:"all",children:"All materials"}),ee.map(R=>a.jsx("option",{value:R,children:R},R))]})]})]}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-2",children:["Showing ",$.length," of ",y.blocks.length," lesson blocks after provenance filters."]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:$.map(R=>a.jsxs("div",{className:"border border-border rounded-xl p-4 bg-[#fcfdff]",children:[a.jsx("h3",{className:"text-sm font-bold text-foreground",children:R.title}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[R.estimatedMinutes," mins "," • "," ",R.strategy]}),a.jsx("p",{className:"text-sm text-foreground mt-2",children:R.objective}),a.jsxs("div",{className:"mt-3",children:[a.jsx("p",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"Activities"}),R.activities.slice(0,2).map((G,ae)=>a.jsxs("p",{className:"text-xs text-muted-foreground",children:["•"," ",G]},ae))]}),R.provenance&&a.jsxs("div",{className:"mt-3 bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-lg p-2",children:[a.jsx("p",{className:"text-[11px] font-semibold text-[#9956DE]",children:"Provenance"}),R.provenance.sourceFile&&a.jsxs("p",{className:"text-[11px] text-[#5E3388]",children:["Source: ",R.provenance.sourceFile]}),R.provenance.materialId&&a.jsxs("p",{className:"text-[11px] text-[#5E3388]",children:["Material: ",R.provenance.materialId]})]})]},R.blockId))}),$.length===0&&a.jsx("div",{className:"border border-border rounded-xl p-4 bg-card text-sm text-muted-foreground",children:"No lesson blocks match the selected provenance filters. Clear one or both filters to view all blocks."}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(pe,{variant:"outline",onClick:()=>void I(),disabled:B||!y,className:"border-[#9956DE]/45 text-[#9956DE]",children:B?a.jsx(Ne,{className:"h-4 w-16"}):"Save Draft"}),a.jsx(pe,{onClick:()=>void Z(),disabled:M||!y||!y.publishReady,className:"bg-[#75D06A] hover:bg-[#5AB84E] text-white",children:M?a.jsx(Ne,{className:"h-4 w-24 bg-white/35"}):"Publish Lesson Plan"}),O&&a.jsxs("p",{className:"text-xs text-muted-foreground self-center",children:["Draft ID: ",O]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs(pe,{className:"bg-[#9956DE] hover:bg-[#7A44B3] text-white font-bold py-4 rounded-xl flex items-center justify-center gap-2",children:[a.jsx(Aa,{size:20}),"Schedule One-on-One Session"]}),a.jsxs(pe,{variant:"outline",className:"border-2 border-[#9956DE] text-[#9956DE] hover:bg-[#9956DE]/12 font-bold py-4 rounded-xl flex items-center justify-center gap-2",children:[a.jsx(qa,{size:20}),"Export Printed Materials"]})]})]})]})]})},fne=({onEditRecords:e,classSectionId:t,className:n,classMetadata:r,onImportedClassRecords:s,onDataChanged:i})=>{const[o,l]=v.useState(!1),[c,d]=v.useState(!1),[f,u]=v.useState(!1),[m,h]=v.useState(!1),[g,x]=v.useState(!1),[p,j]=v.useState(!1),[S,y]=v.useState(!1),[N,b]=v.useState(""),[w,k]=v.useState(null),[A,C]=v.useState(null),[F,D]=v.useState(""),[L,P]=v.useState(null),H=v.useRef(null),Y=v.useRef(null),V=v.useRef(null),O=async $=>{h(!0),b(""),P(null);try{const _=await $e.uploadClassRecords($,{classSectionId:t,className:n,datasetIntent:"synthetic_student_records"}),Q=_.students.length,R=_.warnings&&_.warnings.length>0?_.warnings.slice(0,3).join(" "):"",G=_.dashboardSync?` Dashboard sync: ${_.dashboardSync.synced?"ok":"pending"} (created ${_.dashboardSync.createdStudents}, updated ${_.dashboardSync.updatedStudents}).`:"",ae=ine(_,t,n,r);if(Q>0&&s?.({students:_.students,classSectionId:ae.classSectionId,className:ae.className,classMetadata:ae.classMetadata}),_.success){ue.success(`Successfully imported ${Q} student records. Next step: upload course materials for AI lesson-plan grounding.`);const re=_.riskRefresh?.queued?` Risk refresh queued for ${_.riskRefresh.studentsQueued} students (job ${_.riskRefresh.refreshId||"n/a"}).`:` Risk refresh not queued${_.riskRefresh?.reason?`: ${_.riskRefresh.reason}`:""}.`,te=_.interpretationSummary,se=te?` Interpreted columns - scoring: ${te.scoringColumns}, display: ${te.displayColumns}, storage-only: ${te.storageOnlyColumns}, low-confidence: ${te.lowConfidenceColumns}.`:"",q=R?` Warnings: ${R}`:"";b(`Imported ${Q} students. Next step: upload course materials to give AI lesson generation topic context.${re}${G}${se}${q} Column mapping: ${JSON.stringify(_.columnMapping)}`),P({datasetIntent:_.datasetIntent,summary:_.interpretationSummary,columns:_.columnInterpretations?.map(W=>({columnName:W.columnName,mappedField:W.mappedField,usagePolicy:W.usagePolicy,confidenceBand:W.confidenceBand,domainSignals:W.domainSignals}))||[]}),i?.()}else{const te=(_.files||[]).flatMap(se=>se.warnings||[]).slice(0,3).join(" ")||R||"Import completed but no usable student rows were detected. Check required columns and retry.";b(te),ue.error(te)}}catch(_){let Q=_ instanceof Error?_.message:"Upload failed";const R=Q.toLowerCase();_ instanceof vn&&R.includes("missing required educational columns after mapping")&&R.includes("assignmentcompletion")&&(Q="Your file matches the minimal import schema, but the connected backend is running an older validator that still requires assignmentCompletion. Update/redeploy the backend or point VITE_API_URL to this updated backend."),ue.error(Q),b(Q),P(null)}finally{h(!1)}},E=async $=>{x(!0),b("");try{const _=await $e.uploadCourseMaterials($,{classSectionId:t,className:n});if(_.success){const Q=_.topics?.length??0;ue.success(`Course material imported (${Q} topics extracted). Lesson generation now has material context.`),b(`Imported course material ${_.fileName} with ${Q} topics and ${_.sections.length} section(s). Lesson generation is now ready with material context.`),i?.()}}catch(_){ue.error(_ instanceof Error?_.message:"Course material upload failed"),b("Course material upload failed. Please check the file format and try again.")}finally{x(!1)}},B=$=>{$.preventDefault(),l(!1);const _=$.dataTransfer.files[0];_&&O(_)},T=$=>{const _=$.target.files?.[0];_&&O(_)},M=$=>{$.preventDefault(),d(!1);const _=$.dataTransfer.files[0];_&&E(_)},K=$=>{const _=$.target.files?.[0];_&&E(_)},X=$=>{const _=$.rows||[];if(_.length===0){ue.error("No provisioning rows to export.");return}const Q=se=>{const q=String(se??"");return/[,"\n]/.test(q)?`"${q.replace(/"/g,'""')}"`:q},G=[["rowNumber","studentId","fullName","email","uid","classSectionId","status","message","temporaryPassword"].join(","),..._.map(se=>[se.rowNumber,se.studentId,se.fullName,se.email,se.uid||"",se.classSectionId,se.status,se.message,se.temporaryPassword||""].map(Q).join(","))],ae=new Blob([G.join(` +`)],{type:"text/csv;charset=utf-8;"}),re=URL.createObjectURL(ae),te=document.createElement("a");te.href=re,te.download=`student-account-provisioning-${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(te),te.click(),document.body.removeChild(te),URL.revokeObjectURL(re)},I=async $=>{j(!0),C(null),b("");try{const _=Qn(n||r?.className||"Grade 11 - Section A"),Q=await $e.previewStudentAccountImport($,{classSectionId:t,className:n,defaultGrade:r?.grade||_.grade,defaultSection:r?.section||_.section});k(Q);const R=Q.summary;ue.success(`Preview ready: ${R.validRows} valid, ${R.invalidRows} invalid, ${R.duplicateRows} duplicate rows.`)}catch(_){const Q=_ instanceof Error?_.message:"Failed to preview student-account import.";ue.error(Q),k(null)}finally{j(!1)}},Z=$=>{$.preventDefault(),u(!1);const _=$.dataTransfer.files?.[0];_&&I(_)},ne=$=>{const _=$.target.files?.[0];_&&I(_)},ee=async()=>{if(!w?.previewToken){ue.error("Run preview before committing student account provisioning.");return}y(!0);try{const $=await $e.commitStudentAccountImport({previewToken:w.previewToken,defaultPassword:F.trim()||void 0,forcePasswordChange:!0,createAuthUsers:!0});C($);const{createdRows:_,updatedRows:Q,blockedRows:R,failedRows:G}=$.summary;G>0?ue.error(`Provisioning completed with ${G} failed row(s).`):ue.success(`Provisioned accounts: ${_} created, ${Q} updated, ${R} blocked.`),i?.()}catch($){ue.error($ instanceof Error?$.message:"Failed to commit student account provisioning.")}finally{y(!1)}};return a.jsx(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:a.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[a.jsxs("div",{className:"mb-2",children:[a.jsx("h2",{className:"text-xl font-display font-bold text-foreground",children:"Import Data"}),a.jsx("p",{className:"text-muted-foreground",children:"Class records drive analytics and at-risk signals. Course materials provide topic grounding for AI lesson plans."}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 items-center text-xs text-muted-foreground",children:[a.jsxs("span",{className:"px-2 py-1 rounded-md bg-muted border border-border",children:["Class scope: ",n||t||"All classes"]}),[r?.gradeLevel,r?.classification,r?.strand].filter(Boolean).map($=>a.jsx("span",{className:"px-2 py-1 rounded-md bg-[#9956DE]/12 border border-[#9956DE]/30 text-[#9956DE] font-medium",children:$},`import-meta-${$}`))]})]}),a.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6",children:[a.jsxs("div",{onDragOver:$=>{$.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:B,onClick:()=>H.current?.click(),className:`bg-card border-4 border-dashed rounded-3xl p-12 text-center transition-all cursor-pointer hover:border-[#9956DE]/60 hover:bg-[#9956DE]/12 ${o?"border-[#9956DE] bg-[#9956DE]/12 scale-105":"border-border"}`,children:[a.jsx("input",{ref:H,type:"file",accept:".csv,.xlsx,.pdf",onChange:T,className:"hidden"}),a.jsx("div",{className:"w-20 h-20 bg-[#9956DE]/20 rounded-2xl flex items-center justify-center mx-auto mb-6",children:m?a.jsx(Ne,{className:"h-10 w-10 rounded-2xl bg-[#9956DE]/32"}):a.jsx(X8,{size:40,className:"text-[#9956DE]"})}),a.jsx("h3",{className:"text-xl font-display font-bold text-foreground mb-2",children:"Class Records"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:m?a.jsxs("span",{className:"inline-flex flex-col items-center gap-2",children:[a.jsx(Ne,{className:"h-4 w-44 bg-[#9956DE]/32"}),a.jsx(Ne,{className:"h-4 w-36 bg-[#9956DE]/20"})]}):"Upload student grades, attendance, and quiz scores"}),a.jsxs("p",{className:"text-xs text-muted-foreground mb-4 flex items-center justify-center gap-2",children:[a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".csv"}),a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".xlsx"}),a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".pdf"})]}),a.jsx(pe,{className:"bg-card border-2 border-border text-muted-foreground hover:border-[#9956DE] hover:text-[#9956DE] font-bold px-6 py-3 rounded-xl w-full transition-colors",children:"Click or drag & drop"})]}),a.jsxs("div",{onDragOver:$=>{$.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:M,onClick:()=>Y.current?.click(),className:`bg-card border-4 border-dashed rounded-3xl p-12 text-center transition-all cursor-pointer hover:border-[#F08386]/60 hover:bg-[#F08386]/12 ${c?"border-[#F08386] bg-[#F08386]/12 scale-105":"border-border"}`,children:[a.jsx("input",{ref:Y,type:"file",accept:".pdf,.docx,.txt",onChange:K,className:"hidden"}),a.jsx("div",{className:"w-20 h-20 bg-[#F08386]/20 rounded-2xl flex items-center justify-center mx-auto mb-6",children:g?a.jsx(Ne,{className:"h-10 w-10 rounded-2xl bg-rose-200"}):a.jsx(ad,{size:40,className:"text-[#F08386]"})}),a.jsx("h3",{className:"text-xl font-display font-bold text-foreground mb-2",children:"Course Materials"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:g?a.jsxs("span",{className:"inline-flex flex-col items-center gap-2",children:[a.jsx(Ne,{className:"h-4 w-48 bg-rose-200"}),a.jsx(Ne,{className:"h-4 w-40 bg-[#F08386]/20"})]}):"Upload syllabus, lesson plans, and curriculum documents"}),a.jsxs("p",{className:"text-xs text-slate-500 mb-4 flex items-center justify-center gap-2",children:[a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".pdf"}),a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".docx"}),a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".txt"})]}),a.jsx(pe,{className:"bg-card border-2 border-border text-muted-foreground hover:border-[#F08386] hover:text-[#F08386] font-bold px-6 py-3 rounded-xl w-full transition-colors",children:"Click or drag & drop"})]}),a.jsxs("div",{onDragOver:$=>{$.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:Z,onClick:()=>V.current?.click(),className:`bg-card border-4 border-dashed rounded-3xl p-12 text-center transition-all cursor-pointer hover:border-[#75D06A]/60 hover:bg-[#75D06A]/14 ${f?"border-[#75D06A] bg-[#75D06A]/14 scale-105":"border-border"}`,children:[a.jsx("input",{ref:V,type:"file",accept:".csv,.xlsx,.xls",onChange:ne,className:"hidden"}),a.jsx("div",{className:"w-20 h-20 bg-[#75D06A]/22 rounded-2xl flex items-center justify-center mx-auto mb-6",children:p?a.jsx(Ne,{className:"h-10 w-10 rounded-2xl bg-emerald-200"}):a.jsx(kt,{size:40,className:"text-[#75D06A]"})}),a.jsx("h3",{className:"text-xl font-display font-bold text-foreground mb-2",children:"Student Accounts"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:p?a.jsxs("span",{className:"inline-flex flex-col items-center gap-2",children:[a.jsx(Ne,{className:"h-4 w-52 bg-emerald-200"}),a.jsx(Ne,{className:"h-4 w-44 bg-[#75D06A]/22"})]}):"Preview and securely provision student Auth + profile accounts"}),a.jsxs("p",{className:"text-xs text-slate-500 mb-4 flex items-center justify-center gap-2",children:[a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".csv"}),a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".xlsx"}),a.jsx("span",{className:"bg-muted px-2 py-1 rounded text-muted-foreground font-medium",children:".xls"})]}),a.jsx(pe,{className:"bg-card border-2 border-border text-muted-foreground hover:border-[#75D06A] hover:text-[#75D06A] font-bold px-6 py-3 rounded-xl w-full transition-colors",children:"Click or drag & drop"})]})]}),a.jsxs("div",{className:"bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-2xl p-6",children:[a.jsx("h3",{className:"text-lg font-display font-bold text-[#7A44B3] mb-3",children:"How AI Uses Your Data"}),a.jsxs("div",{className:"space-y-2 text-[#5E3388]/80 text-sm",children:[a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-[#9956DE] font-bold",children:"•"}),a.jsxs("span",{children:[a.jsx("strong",{className:"text-[#7A44B3]",children:"Smart Format Detection:"})," AI understands various spreadsheet formats and column names"]})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-[#9956DE] font-bold",children:"•"}),a.jsx("span",{children:"Analyzes historical performance patterns to predict at-risk students"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-[#9956DE] font-bold",children:"•"}),a.jsx("span",{children:"Maps curriculum topics to student knowledge gaps"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-[#9956DE] font-bold",children:"•"}),a.jsx("span",{children:"Generates personalized remedial learning paths"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-[#9956DE] font-bold",children:"•"}),a.jsx("span",{children:"All data is processed securely and never shared"})]})]})]}),N&&a.jsx("div",{className:"bg-[#75D06A]/14 border border-[#75D06A]/35 rounded-2xl p-4 text-sm text-[#3E8538]",children:N}),L&&a.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:"Import Interpretation"}),a.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-muted text-[#334155]",children:["Intent: ",L.datasetIntent||"synthetic_student_records"]})]}),L.summary&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-3 mb-4",children:[a.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Scoring"}),a.jsx("p",{className:"text-lg font-bold text-foreground",children:L.summary.scoringColumns})]}),a.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Display"}),a.jsx("p",{className:"text-lg font-bold text-foreground",children:L.summary.displayColumns})]}),a.jsxs("div",{className:"bg-[#FFB356]/16 border border-[#FFB356]/38 rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-[#CC8A37]",children:"Storage-only"}),a.jsx("p",{className:"text-lg font-bold text-[#A56D29]",children:L.summary.storageOnlyColumns})]}),a.jsxs("div",{className:"bg-[#F08386]/12 border border-[#F08386]/30 rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-[#C65E63]",children:"Low confidence"}),a.jsx("p",{className:"text-lg font-bold text-[#A74B50]",children:L.summary.lowConfidenceColumns})]}),a.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Domain warnings"}),a.jsx("p",{className:"text-lg font-bold text-foreground",children:L.summary.domainMismatchWarnings})]})]}),L.columns.length>0?a.jsx("div",{className:"space-y-2 max-h-64 overflow-auto pr-1",children:L.columns.slice(0,40).map($=>a.jsxs("div",{className:"bg-[#f8fafc] border border-border rounded-lg px-3 py-2",children:[a.jsx("p",{className:"text-sm font-semibold text-foreground",children:$.columnName}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["mapped: ",$.mappedField||"none"," • ","usage: ",$.usagePolicy," • ","confidence: ",$.confidenceBand]}),$.domainSignals&&$.domainSignals.length>0&&a.jsxs("p",{className:"text-xs text-[#CC8A37] mt-1",children:["domain signals: ",$.domainSignals.join(", ")]})]},$.columnName))}):a.jsx("p",{className:"text-sm text-muted-foreground",children:"No per-column interpretation data was returned for this upload."})]}),w&&a.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border space-y-4",children:[a.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:"Student Account Provisioning Preview"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Validate duplicates and section mappings before creating Auth and Firestore student accounts."})]}),a.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-muted text-muted-foreground font-medium",children:["Token: ",w.previewToken?`${w.previewToken.slice(0,10)}...`:"n/a"]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[a.jsxs("div",{className:"bg-[#f8fbff] border border-border rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Rows"}),a.jsx("p",{className:"text-xl font-bold text-foreground",children:w.summary.totalRows})]}),a.jsxs("div",{className:"bg-[#75D06A]/14 border border-[#75D06A]/35 rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-[#4D9F46]",children:"Valid"}),a.jsx("p",{className:"text-xl font-bold text-[#4D9F46]",children:w.summary.validRows})]}),a.jsxs("div",{className:"bg-[#F08386]/12 border border-[#F08386]/30 rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-[#C65E63]",children:"Invalid"}),a.jsx("p",{className:"text-xl font-bold text-[#C65E63]",children:w.summary.invalidRows})]}),a.jsxs("div",{className:"bg-[#FFB356]/16 border border-[#FFB356]/38 rounded-xl p-3",children:[a.jsx("p",{className:"text-xs text-[#CC8A37]",children:"Duplicates"}),a.jsx("p",{className:"text-xl font-bold text-[#CC8A37]",children:w.summary.duplicateRows})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_auto] gap-3 items-end",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Default Temporary Password (optional)"}),a.jsx(ve,{value:F,onChange:$=>D($.target.value),placeholder:"Leave blank to auto-generate per account",className:"h-10"})]}),a.jsx(pe,{onClick:()=>void ee(),disabled:S||w.summary.validRows===0,className:"bg-[#75D06A] hover:bg-[#5AB84E] text-white h-10",children:S?a.jsx(Ne,{className:"h-4 w-24 bg-white/35"}):"Commit Provisioning"})]}),a.jsx("div",{className:"max-h-72 overflow-auto border border-border rounded-xl",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"bg-muted sticky top-0",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Row"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Name"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Student ID"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Email"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Class Section"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Status"})]})}),a.jsx("tbody",{children:w.rows.slice(0,60).map($=>a.jsxs("tr",{className:"border-t border-border",children:[a.jsx("td",{className:"px-3 py-2",children:$.rowNumber}),a.jsxs("td",{className:"px-3 py-2",children:[a.jsx("p",{className:"font-medium text-foreground",children:$.fullName}),$.issues.length>0&&a.jsx("p",{className:"text-[11px] text-[#C65E63]",children:$.issues.slice(0,2).join("; ")})]}),a.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:$.studentId||"-"}),a.jsx("td",{className:"px-3 py-2 text-xs",children:$.email||"-"}),a.jsx("td",{className:"px-3 py-2 text-xs",children:$.classSectionId||"-"}),a.jsx("td",{className:"px-3 py-2",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold ${$.status==="valid"?"bg-[#75D06A]/22 text-[#4D9F46]":$.status==="duplicate"?"bg-[#FFB356]/24 text-[#CC8A37]":"bg-[#F08386]/20 text-[#C65E63]"}`,children:$.status})})]},`preview-row-${$.rowNumber}-${$.studentId}`))})]})}),w.warnings.length>0&&a.jsx("div",{className:"bg-[#FFB356]/16 border border-[#FFB356]/38 rounded-xl p-3 text-xs text-[#A56D29]",children:w.warnings.slice(0,5).join(" ")})]}),A&&a.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border space-y-3",children:[a.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-display font-bold text-foreground",children:"Provisioning Result"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Created: ",A.summary.createdRows," | Updated: ",A.summary.updatedRows," | Blocked: ",A.summary.blockedRows," | Failed: ",A.summary.failedRows]})]}),a.jsxs(pe,{variant:"outline",onClick:()=>X(A),className:"border-emerald-300 text-[#4D9F46]",children:[a.jsx(qa,{size:14,className:"mr-2"}),"Download Credential CSV"]})]}),a.jsx("div",{className:"max-h-64 overflow-auto border border-border rounded-xl",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"bg-muted sticky top-0",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Row"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Student"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Status"}),a.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground",children:"Message"})]})}),a.jsx("tbody",{children:A.rows.map($=>a.jsxs("tr",{className:"border-t border-border",children:[a.jsx("td",{className:"px-3 py-2",children:$.rowNumber}),a.jsxs("td",{className:"px-3 py-2",children:[a.jsx("p",{className:"font-medium text-foreground",children:$.fullName}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:$.email})]}),a.jsx("td",{className:"px-3 py-2",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold ${$.status==="created"?"bg-[#75D06A]/22 text-[#4D9F46]":$.status==="updated"?"bg-[#9956DE]/20 text-[#9956DE]":$.status==="blocked"?"bg-[#FFB356]/24 text-[#CC8A37]":$.status==="failed"?"bg-[#F08386]/20 text-[#C65E63]":"bg-muted text-muted-foreground"}`,children:$.status})}),a.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:$.message})]},`commit-row-${$.rowNumber}-${$.studentId}`))})]})})]}),a.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-sm border border-border",children:[a.jsx("h3",{className:"text-lg font-display font-bold text-foreground mb-4",children:"Manage Imported Data"}),a.jsxs("button",{onClick:e,className:"w-full bg-[#00a86b] hover:bg-[#008f5d] text-white rounded-xl p-5 flex items-center justify-between transition-all shadow-sm hover:shadow-md group",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-card/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:a.jsx(Zi,{size:24,className:"text-white"})}),a.jsxs("div",{className:"text-left",children:[a.jsx("h4",{className:"font-bold text-lg",children:"Edit Class Records"}),a.jsx("p",{className:"text-white/90 text-sm",children:"Review and correct AI-analyzed student data"})]})]}),a.jsx(jn,{size:24,className:"text-white/80 group-hover:text-[#9956DE] group-hover:translate-x-1 transition-all"})]})]})]})})},mne=({students:e,teacherId:t,teacherName:n,onBack:r})=>{const[s,i]=v.useState(e),[o,l]=v.useState(!1),c=v.useCallback(m=>Ps(m),[]),[d,f]=v.useState(()=>Object.fromEntries(e.map(m=>[c(m),{grade:m.grade||"Grade 11",section:m.section||"Section A"}])));v.useEffect(()=>{i(e),f(Object.fromEntries(e.map(m=>[c(m),{grade:m.grade||"Grade 11",section:m.section||"Section A"}])))},[c,e]);const u=async()=>{l(!0);try{for(const m of s){const h=d[c(m)],g=h?.grade||m.grade,x=h?.section||m.section;t&&(g!==m.grade||x!==m.section)&&(await hM(m.id,g,x,t,new Date().getFullYear().toString(),n),await uM(m.id,g,x));try{const p=await $e.predictRisk({engagementScore:m.engagementScore,avgQuizScore:m.avgScore,attendance:m.attendance,assignmentCompletion:m.assignmentCompletion});await Bee(m.id,p.riskLevel,p.confidence)}catch{}}i(m=>m.map(h=>{const g=d[c(h)];if(!g)return h;const x=Vt({metadata:h.classMetadata,classSectionId:h.classSectionId,className:[g.grade,g.section].filter(Boolean).join(" - "),grade:g.grade,section:g.section});return{...h,grade:g.grade,section:g.section,className:x.className||[g.grade,g.section].filter(Boolean).join(" - "),classSectionId:x.classSectionId||h.classSectionId,classMetadata:x}})),ue.success("Records saved and risk levels updated"),r()}catch{ue.error("Failed to save changes")}finally{l(!1)}};return a.jsxs(J.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"p-6 h-full flex flex-col",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:r,className:"p-2 hover:bg-muted rounded-lg transition-colors text-muted-foreground",children:a.jsx(Ya,{size:24})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-display font-bold text-foreground",children:"Edit Class Records"}),a.jsx("p",{className:"text-muted-foreground",children:"Review and modify student data manually"})]})]}),a.jsxs("div",{className:"flex gap-3 justify-end",children:[a.jsx(pe,{variant:"outline",onClick:r,className:"border-border",children:"Cancel"}),a.jsxs(pe,{onClick:u,disabled:o,className:"bg-[#75D06A] hover:bg-[#5AB84E] text-white gap-2",children:[o?a.jsx(Ne,{className:"h-5 w-5 rounded-full bg-white/35"}):a.jsx(id,{size:18}),o?"Saving...":"Save Changes"]})]})]}),a.jsxs("div",{className:"bg-card border border-border rounded-2xl shadow-sm flex-1 overflow-hidden flex flex-col",children:[a.jsxs("div",{className:"p-4 border-b border-border bg-background flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(Yr,{size:18}),a.jsx("span",{className:"text-sm",children:"Click on any field to edit"})]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",s.length," records"]})]}),a.jsx("div",{className:"overflow-auto flex-1",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{className:"bg-background sticky top-0 z-10",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Student Name"}),a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"LRN"}),a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Grade"}),a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Section"}),a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Avg Score"}),a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Risk Level"}),a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Weakest Topic"}),a.jsx("th",{className:"p-4 font-bold text-muted-foreground border-b border-border bg-background",children:"Actions"})]})}),a.jsx("tbody",{children:s.map(m=>{const h=c(m);return a.jsxs("tr",{className:"border-b border-border hover:bg-[#9956DE]/12 group transition-colors",children:[a.jsx("td",{className:"p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("img",{src:m.avatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}),a.jsx("span",{className:"font-medium text-foreground",children:m.name})]})}),a.jsx("td",{className:"p-4 text-muted-foreground font-mono text-sm",children:m.lrn||"Not set"}),a.jsx("td",{className:"p-4 min-w-[140px]",children:a.jsx(ve,{id:`edit-record-grade-${h}`,name:`edit-record-grade-${h}`,"aria-label":`Edit grade for ${m.name}`,value:d[h]?.grade||m.grade,onChange:g=>f(x=>({...x,[h]:{...x[h],grade:g.target.value}})),className:"h-9 text-sm"})}),a.jsx("td",{className:"p-4 min-w-[140px]",children:a.jsx(ve,{id:`edit-record-section-${h}`,name:`edit-record-section-${h}`,"aria-label":`Edit section for ${m.name}`,value:d[h]?.section||m.section,onChange:g=>f(x=>({...x,[h]:{...x[h],section:g.target.value}})),className:"h-9 text-sm"})}),a.jsx("td",{className:"p-4",children:a.jsxs("span",{className:`font-bold ${m.avgScore<60?"text-[#FF8B8B]":m.avgScore<80?"text-[#F08386]":"text-green-600"}`,children:[m.avgScore,"%"]})}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${Wd(m.riskLevel)}`,children:m.riskLevel.toUpperCase()})}),a.jsx("td",{className:"p-4 text-muted-foreground",children:m.weakestTopic}),a.jsx("td",{className:"p-4",children:a.jsx("button",{className:"p-2 hover:bg-muted rounded-lg text-slate-500 hover:text-[#9956DE] transition-colors",children:a.jsx(Zi,{size:16})})})]},h)})})]})})]})]})};function Wd(e){switch(e){case"high":return"bg-[#FF8B8B]/22 text-[#D66A6A] border-[#FF8B8B]/35";case"medium":return"bg-[#F08386]/20 text-[#C65E63] border-[#F08386]/30";case"low":return"bg-[#75D06A]/22 text-[#4D9F46] border-[#75D06A]/35"}}function hne(e){switch(e){case"high":return"border-red-500 bg-[#FF8B8B]/14";case"medium":return"border-[#F08386] bg-[#F08386]/12";case"low":return"border-[#75D06A] bg-[#75D06A]/14"}}function Ea({...e}){return a.jsx(w6,{"data-slot":"select",...e})}function _a({...e}){return a.jsx(S6,{"data-slot":"select-value",...e})}function Ia({className:e,size:t="default",children:n,...r}){return a.jsxs(j6,{"data-slot":"select-trigger","data-size":t,className:Be("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,a.jsx(N6,{asChild:!0,children:a.jsx(Hn,{className:"size-4 opacity-50"})})]})}function Oa({className:e,children:t,position:n="popper",...r}){return a.jsx(k6,{children:a.jsxs(A6,{"data-slot":"select-content",className:Be("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(pne,{}),a.jsx(C6,{className:Be("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),a.jsx(xne,{})]})})}function pt({className:e,children:t,...n}){return a.jsxs(T6,{"data-slot":"select-item",className:Be("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(P6,{children:a.jsx(jr,{className:"size-4"})})}),a.jsx(M6,{children:t})]})}function pne({className:e,...t}){return a.jsx(E6,{"data-slot":"select-scroll-up-button",className:Be("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Es,{className:"size-4"})})}function xne({className:e,...t}){return a.jsx(_6,{"data-slot":"select-scroll-down-button",className:Be("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Hn,{className:"size-4"})})}function gne(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Student"}function bne(e){if(e.role==="student"){const t=e.grade||"",n=e.section||"";return[t,n].filter(Boolean).join(" - ")||"Student"}return e.role==="teacher"?e.department||"Mathematics":e.role==="admin"?e.department||"System":""}function yne(e){if(!e||!e.toDate)return"Never";const t=e.toDate(),r=new Date().getTime()-t.getTime(),s=Math.floor(r/6e4);if(s<1)return"Just now";if(s<60)return`${s} minute${s!==1?"s":""} ago`;const i=Math.floor(s/60);if(i<24)return`${i} hour${i!==1?"s":""} ago`;const o=Math.floor(i/24);return o<7?`${o} day${o!==1?"s":""} ago`:t.toLocaleDateString()}function yM(e){if(!e||!e.toDate)return new Date().toISOString().replace("T"," ").slice(0,19);const t=e.toDate();return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`}function vne(){return yM({toDate:()=>new Date})}async function wne(){try{const e=at(_e(fe,"users"),Zn("createdAt","desc"));return(await Ye(e)).docs.map(n=>{const r=n.data();return{id:n.id,name:r.name||"Unknown",email:r.email||"",role:gne(r.role),status:r.status||"Active",department:bne(r),grade:r.grade||"",section:r.section||"",classSection:[r.grade||"",r.section||""].filter(Boolean).join(" - "),lrn:r.lrn||"",photo:r.photo||r.photoURL||"",lastLogin:yne(r.lastLogin)}})}catch(e){return console.error("[adminService] getAllUsers error:",e),[]}}async function h5(e,t){const n=Me(fe,"users",e),r={updatedAt:ke()};if(t.name!==void 0&&(r.name=t.name),t.email!==void 0&&(r.email=t.email),t.status!==void 0&&(r.status=t.status),t.role!==void 0&&(r.role=t.role.toLowerCase()),t.department!==void 0&&(r.department=t.department,t.role?.toLowerCase()==="student"&&(r.grade=t.department)),t.grade!==void 0&&(r.grade=t.grade),t.section!==void 0&&(r.section=t.section),t.lrn!==void 0&&(r.lrn=t.lrn),r.grade||r.section){const s=r.grade||"",i=r.section||"";r.classSectionId=[s,i].filter(Boolean).join("_").replace(/\s+/g,"_").toLowerCase()}await vt(n,r)}async function jne(e){await Jc(Me(fe,"users",e))}async function Nne(e,t,n,r,s){const i=n.toLowerCase(),o={email:e,name:t,role:i,status:"Active",department:r,photo:`https://ui-avatars.com/api/?name=${encodeURIComponent(t)}&background=0d9488&color=fff`,createdAt:ke(),updatedAt:ke()};if(i==="student"){const c=s?.grade||r||"Grade 11",d=s?.section||"Section A";Object.assign(o,{lrn:s?.lrn||`${Date.now()}`.slice(-12).padStart(12,"0"),grade:c,section:d,classSectionId:[c,d].join("_").replace(/\s+/g,"_").toLowerCase(),level:1,currentXP:0,totalXP:0,streak:0,atRiskSubjects:[],hasTakenDiagnostic:!1})}else i==="teacher"?Object.assign(o,{teacherId:`TCH-${Date.now()}`,subject:"Mathematics",yearsOfExperience:"0",qualification:"",students:[]}):i==="admin"&&Object.assign(o,{adminId:`ADM-${Date.now()}`,position:"Administrator"});return(await zo(_e(fe,"users"),o)).id}async function vM(){try{const e=at(_e(fe,"auditLogs"),Zn("timestampRaw","desc"),Er(100));return(await Ye(e)).docs.map(n=>{const r=n.data();return{id:n.id,severity:r.severity||"Info",timestamp:r.timestamp||yM(r.timestampRaw),user:r.user||{name:"System",role:"Admin",avatar:null},action:r.action||"",category:r.category||"System",details:r.details||""}})}catch(e){return console.error("[adminService] getAuditLogs error:",e),[]}}async function Da(e,t,n,r,s){await zo(_e(fe,"auditLogs"),{severity:n,timestamp:vne(),timestampRaw:ke(),user:s,action:e,category:t,details:r})}async function Sne(){try{const e=at(_e(fe,"modules"),Zn("createdAt","desc"));return(await Ye(e)).docs.map(n=>{const r=n.data(),s=r.createdAt;return{id:n.id,title:r.title||"",subject:r.subject||"",type:r.type||"Video",difficulty:r.difficulty||"Beginner",status:r.status||"Draft",assigned:r.assigned||0,created:r.created||(s?.toDate?.()?.toLocaleDateString()??"")}})}catch(e){return console.error("[adminService] getModules error:",e),[]}}async function kne(e){return(await zo(_e(fe,"modules"),{...e,createdAt:ke(),updatedAt:ke()})).id}async function Ane(e,t){await vt(Me(fe,"modules",e),{...t,updatedAt:ke()})}async function Cne(e){await Jc(Me(fe,"modules",e))}async function Tne(){try{const e=await Ye(_e(fe,"users"));let t=0,n=0,r=0;e.docs.forEach(l=>{const c=l.data();c.role==="student"&&(t++,c.overallRisk==="High"&&r++),c.role==="teacher"&&c.status!=="Inactive"&&n++});let s=0;try{s=(await Ye(_e(fe,"classrooms"))).size}catch{}let i=0;try{i=(await Ye(_e(fe,"xpActivities"))).size}catch{}let o=0;try{const l=await Ye(_e(fe,"progress")),c=[];l.docs.forEach(d=>{const f=d.data();typeof f.averageScore=="number"&&c.push(f.averageScore)}),o=c.length>0?Math.round(c.reduce((d,f)=>d+f,0)/c.length):0}catch{}return{totalStudents:t,activeTeachers:n,totalClasses:s,atRiskStudents:r,avgPerformance:o,aiPredictions:i}}catch(e){return console.error("[adminService] getDashboardStats error:",e),{totalStudents:0,activeTeachers:0,totalClasses:0,atRiskStudents:0,avgPerformance:0,aiPredictions:0}}}async function Pne(e=3){try{const t=at(_e(fe,"users"),Je("role","==","student"),Zn("level","desc"),Er(e));return(await Ye(t)).docs.map(r=>{const s=r.data(),i=s.level||1,o=s.currentXP||0,l=Math.min(100,i*8+Math.round(o/100));return{id:r.id,name:s.name||"Student",avatar:s.photo||s.photoURL||`https://ui-avatars.com/api/?name=${encodeURIComponent(s.name||"S")}&background=0d9488&color=fff`,class:s.grade||"Math",performance:l,level:i}})}catch(t){return console.error("[adminService] getTopPerformers error:",t),[]}}async function Mne(){try{const e=await Ye(_e(fe,"users"));let t=0,n=0,r=0,s=0,i=0;e.docs.forEach(c=>{const d=c.data();d.role==="student"&&(t++,d.overallRisk==="High"&&r++,d.streak>0&&i++,s+=d.totalXP||0),d.role==="teacher"&&n++});let o=0;try{o=(await Ye(_e(fe,"achievements"))).size}catch{}let l=0;try{l=(await Ye(_e(fe,"chatSessions"))).size}catch{}return{totalActiveUsers:t+n,totalStudents:t,totalTeachers:n,atRiskStudents:r,achievementsUnlocked:o,totalXPEarned:s,activeStreaks:i,aiTutorSessions:l}}catch(e){return console.error("[adminService] getAnalyticsSummary error:",e),{totalActiveUsers:0,totalStudents:0,totalTeachers:0,atRiskStudents:0,achievementsUnlocked:0,totalXPEarned:0,activeStreaks:0,aiTutorSessions:0}}}const Ene=()=>{const{userProfile:e}=$t(),[t,n]=v.useState([]),[r,s]=v.useState(!0),[i,o]=v.useState(!1),[l,c]=v.useState(!1),[d,f]=v.useState(""),[u,m]=v.useState("All Types"),[h,g]=v.useState("All Status"),[x,p]=v.useState(!1),[j,S]=v.useState(!1),[y,N]=v.useState(null),[b,w]=v.useState(null),[k,A]=v.useState({title:"",subject:"",type:"Video",difficulty:"Beginner",status:"Draft",assigned:0,created:new Date().toLocaleDateString()}),C=v.useCallback(async()=>{s(!0);try{const I=await Sne();n(I)}catch{ue.error("Failed to load modules")}finally{s(!1)}},[]);v.useEffect(()=>{C()},[C]);const F=()=>{w(null),A({title:"",subject:"",type:"Video",difficulty:"Beginner",status:"Draft",assigned:0,created:new Date().toLocaleDateString()}),p(!0)},D=I=>{w(I),A({title:I.title,subject:I.subject,type:I.type,difficulty:I.difficulty,status:I.status,assigned:I.assigned,created:I.created}),p(!0)},L=async()=>{if(!k.title.trim()||!k.subject.trim()){ue.error("Title and subject are required");return}o(!0);try{b?(await Ane(b.id,k),await Da("Module Updated","Content","Info",`Updated module: "${k.title}"`,{name:e?.name||"Admin",role:"Admin",avatar:e?.photo||null}),ue.success("Module updated")):(await kne(k),await Da("Module Created","Content","Info",`Created new module: "${k.title}" (${k.subject})`,{name:e?.name||"Admin",role:"Admin",avatar:e?.photo||null}),ue.success("Module created")),await C(),p(!1)}catch{ue.error("Failed to save module")}finally{o(!1)}},P=I=>{N(I),S(!0)},H=async()=>{if(!(!y||l)){c(!0);try{await Cne(y.id),await Da("Module Deleted","Content","Warning",`Deleted module: "${y.title}"`,{name:e?.name||"Admin",role:"Admin",avatar:e?.photo||null}),ue.success("Module deleted"),n(I=>I.filter(Z=>Z.id!==y.id)),S(!1),N(null)}catch{ue.error("Failed to delete module")}finally{c(!1)}}},Y=t.length,V=t.filter(I=>I.status==="Published").length,O=t.filter(I=>I.status==="Draft").length,E=t.filter(I=>I.status==="Archived").length,B=I=>{switch(I){case"Published":return"bg-green-100 text-green-700 border-green-200";case"Draft":return"bg-rose-100 text-rose-700 border-rose-200";case"Archived":return"bg-[#edf1f7] text-[#0a1628] border-[#dde3eb]";default:return"bg-[#edf1f7] text-[#0a1628]"}},T=I=>{switch(I){case"Beginner":return"bg-sky-50 text-sky-700";case"Intermediate":return"bg-sky-50 text-sky-700";case"Advanced":return"bg-sky-50 text-sky-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},M=I=>{switch(I){case"Video":return a.jsx(bC,{size:16,className:"text-sky-600"});case"Quiz":return a.jsx(lC,{size:16,className:"text-teal-600"});default:return a.jsx(ad,{size:16,className:"text-[#5a6578]"})}},K=I=>{switch(I){case"Video":return"bg-sky-100 text-sky-700";case"Quiz":return"bg-teal-100 text-teal-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},X=t.filter(I=>{const Z=I.title.toLowerCase().includes(d.toLowerCase())||I.subject.toLowerCase().includes(d.toLowerCase()),ne=u==="All Types"||I.type===u,ee=h==="All Status"||I.status===h;return Z&&ne&&ee});return a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Content Management"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Manage learning modules, templates, and educational content"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(pe,{variant:"outline",className:"gap-2 border-[#dde3eb] hover:bg-[#edf1f7]",onClick:C,children:[a.jsx(sd,{size:16}),"Refresh"]}),a.jsxs(pe,{className:"gap-2 bg-sky-600 hover:bg-sky-700 text-white",onClick:F,children:[a.jsx(Qr,{size:16}),"Create Module"]})]}),r?a.jsx("div",{className:"flex items-center justify-center h-24",children:a.jsx(He,{size:24,className:"animate-spin text-sky-500"})}):null,a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[a.jsx("p",{className:"text-xs font-bold text-[#5a6578] mb-1",children:"Total Modules"}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:Y})]}),a.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Kn,{size:14,className:"text-green-500"}),a.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Published"})]}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:V})]})}),a.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Zi,{size:14,className:"text-rose-500"}),a.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Drafts"})]}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:O})]})}),a.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(sa,{size:14,className:"text-slate-500"}),a.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Archived"})]}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:E})]})})]}),a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(_n,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),a.jsx(ve,{type:"text",placeholder:"Search modules by title or topic...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:d,onChange:I=>f(I.target.value)})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:u,onChange:I=>m(I.target.value),children:[a.jsx("option",{children:"All Types"}),a.jsx("option",{children:"Video"}),a.jsx("option",{children:"Quiz"}),a.jsx("option",{children:"Document"})]}),a.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:h,onChange:I=>g(I.target.value),children:[a.jsx("option",{children:"All Status"}),a.jsx("option",{children:"Published"}),a.jsx("option",{children:"Draft"}),a.jsx("option",{children:"Archived"})]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:[a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[a.jsx("th",{className:"p-4 w-10",children:a.jsx("input",{type:"checkbox",className:"rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Module"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Type"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Difficulty"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Status"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Assigned"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Created"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider text-right",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:X.map(I=>a.jsxs("tr",{className:"hover:bg-[#edf1f7] transition-colors group",children:[a.jsx("td",{className:"p-4",children:a.jsx("input",{type:"checkbox",className:"rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),a.jsx("td",{className:"p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${I.type==="Video"?"bg-sky-100 text-sky-600":I.type==="Quiz"?"bg-teal-100 text-teal-600":"bg-[#edf1f7] text-[#5a6578]"}`,children:M(I.type)}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:I.title}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:I.subject})]})]})}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${K(I.type)}`,children:I.type})}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${T(I.difficulty)}`,children:I.difficulty})}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-bold border ${B(I.status)}`,children:I.status})}),a.jsx("td",{className:"p-4",children:a.jsxs("div",{className:"flex items-center gap-1 text-[#5a6578] text-sm",children:[a.jsx(kt,{size:14}),a.jsx("span",{children:I.assigned})]})}),a.jsx("td",{className:"p-4 text-sm text-[#5a6578]",children:I.created}),a.jsx("td",{className:"p-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[a.jsx("button",{onClick:()=>D(I),className:"p-2 hover:bg-[#dde3eb] rounded-lg text-[#5a6578] hover:text-sky-600 transition-colors",children:a.jsx(Zi,{size:16})}),a.jsx("button",{onClick:()=>P(I),className:"p-2 hover:bg-red-50 rounded-lg text-[#5a6578] hover:text-red-600 transition-colors",children:a.jsx(sa,{size:16})})]})})]},I.id))})]}),X.length===0&&!r&&a.jsxs("div",{className:"p-12 text-center text-[#5a6578]",children:[a.jsx(De,{size:48,className:"mx-auto mb-4 text-slate-500"}),a.jsx("p",{className:"font-medium",children:"No modules found"}),a.jsx("p",{className:"text-sm",children:t.length===0?"Create your first module to get started":"Try adjusting your search or filters"})]})]}),a.jsx(Ob,{open:x,onOpenChange:p,children:a.jsxs(Db,{className:"sm:max-w-[480px]",children:[a.jsxs(Rb,{children:[a.jsx($b,{children:b?"Edit Module":"Create New Module"}),a.jsx(zb,{children:b?"Update module details below.":"Fill in the details to create a new learning module."})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Title"}),a.jsx(ve,{value:k.title,onChange:I=>A({...k,title:I.target.value}),placeholder:"Module title",className:"col-span-3"})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Subject"}),a.jsx(ve,{value:k.subject,onChange:I=>A({...k,subject:I.target.value}),placeholder:"e.g. Algebra, Calculus",className:"col-span-3"})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Type"}),a.jsx("div",{className:"col-span-3",children:a.jsxs(Ea,{value:k.type,onValueChange:I=>A({...k,type:I}),children:[a.jsx(Ia,{children:a.jsx(_a,{})}),a.jsxs(Oa,{children:[a.jsx(pt,{value:"Video",children:"Video"}),a.jsx(pt,{value:"Quiz",children:"Quiz"}),a.jsx(pt,{value:"Document",children:"Document"})]})]})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Difficulty"}),a.jsx("div",{className:"col-span-3",children:a.jsxs(Ea,{value:k.difficulty,onValueChange:I=>A({...k,difficulty:I}),children:[a.jsx(Ia,{children:a.jsx(_a,{})}),a.jsxs(Oa,{children:[a.jsx(pt,{value:"Beginner",children:"Beginner"}),a.jsx(pt,{value:"Intermediate",children:"Intermediate"}),a.jsx(pt,{value:"Advanced",children:"Advanced"}),a.jsx(pt,{value:"N/A",children:"N/A"})]})]})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Status"}),a.jsx("div",{className:"col-span-3",children:a.jsxs(Ea,{value:k.status,onValueChange:I=>A({...k,status:I}),children:[a.jsx(Ia,{children:a.jsx(_a,{})}),a.jsxs(Oa,{children:[a.jsx(pt,{value:"Draft",children:"Draft"}),a.jsx(pt,{value:"Published",children:"Published"}),a.jsx(pt,{value:"Archived",children:"Archived"})]})]})})]})]}),a.jsxs(Lb,{children:[a.jsx(pe,{variant:"outline",onClick:()=>p(!1),disabled:i,children:"Cancel"}),a.jsxs(pe,{onClick:L,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:i,children:[i?a.jsx(He,{size:16,className:"animate-spin mr-2"}):null,b?"Save Changes":"Create Module"]})]})]})}),a.jsx(Ua,{isOpen:j,onClose:()=>{l||(S(!1),N(null))},onConfirm:H,title:"Delete Module?",message:y?`Delete "${y.title}"? This cannot be undone.`:"Delete this module? This cannot be undone.",confirmText:l?"Deleting...":"Delete",cancelText:"Cancel",type:"danger",icon:"delete"})]})},_ne=()=>{const[e,t]=v.useState([]),[n,r]=v.useState(!0),[s,i]=v.useState(""),[o,l]=v.useState("All Categories"),[c,d]=v.useState("All Severity"),[f,u]=v.useState("All Roles"),m=v.useCallback(async()=>{r(!0);try{const N=await vM();t(N)}catch{ue.error("Failed to load audit logs")}finally{r(!1)}},[]);v.useEffect(()=>{m()},[m]);const h=e.filter(N=>N.severity==="Info").length,g=e.filter(N=>N.severity==="Warning").length,x=e.filter(N=>N.severity==="Error"||N.severity==="Critical").length,p=N=>{switch(N){case"Info":return a.jsx(Yr,{size:16,className:"text-sky-600"});case"Warning":return a.jsx(Gt,{size:16,className:"text-rose-600"});case"Error":return a.jsx(Xr,{size:16,className:"text-red-600"});case"Critical":return a.jsx(Xr,{size:16,className:"text-red-600"});default:return a.jsx(Yr,{size:16,className:"text-[#5a6578]"})}},j=N=>{switch(N){case"Info":return"bg-sky-100 text-sky-700 border-sky-200";case"Warning":return"bg-rose-100 text-rose-700 border-rose-200";case"Error":return"bg-red-100 text-red-700 border-red-200";case"Critical":return"bg-red-100 text-red-700 border-red-200 ring-2 ring-red-500";default:return"bg-[#edf1f7] text-[#0a1628] border-[#dde3eb]"}},S=N=>{switch(N){case"Auth":return"bg-sky-100 text-sky-700";case"Data":return"bg-rose-100 text-rose-700";case"User":return"bg-sky-100 text-sky-700";case"System":return"bg-[#edf1f7] text-[#0a1628]";case"Content":return"bg-green-100 text-green-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},y=e.filter(N=>{const b=N.action.toLowerCase().includes(s.toLowerCase())||N.details.toLowerCase().includes(s.toLowerCase())||N.user.name.toLowerCase().includes(s.toLowerCase()),w=o==="All Categories"||N.category===o,k=c==="All Severity"||N.severity===c,A=f==="All Roles"||N.user.role===f;return b&&w&&k&&A});return a.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Audit Log"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"System activity monitoring and security events"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"bg-white px-3 py-2 rounded-xl border border-[#dde3eb] flex items-center gap-2 text-[#5a6578] text-sm font-medium",children:[a.jsx(ta,{size:16}),a.jsx("span",{children:"Last 100 events"})]}),a.jsxs(pe,{variant:"outline",className:"gap-2 border-[#dde3eb] hover:bg-[#edf1f7]",onClick:m,children:[a.jsx(sd,{size:16}),"Refresh"]})]}),n?a.jsx("div",{className:"flex items-center justify-center h-24",children:a.jsx(He,{size:24,className:"animate-spin text-sky-500"})}):null,a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[a.jsx("p",{className:"text-xs font-bold text-[#5a6578] mb-1",children:"Total Events"}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:e.length})]}),a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-sky-200 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Yr,{size:14,className:"text-sky-600"}),a.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Info"})]}),a.jsx("p",{className:"text-2xl font-bold text-sky-600",children:h})]}),a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-rose-200 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Gt,{size:14,className:"text-rose-600"}),a.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Warnings"})]}),a.jsx("p",{className:"text-2xl font-bold text-rose-600",children:g})]}),a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-red-200 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Xr,{size:14,className:"text-red-600"}),a.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Errors"})]}),a.jsx("p",{className:"text-2xl font-bold text-red-600",children:x})]})]}),a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(_n,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),a.jsx(ve,{type:"text",placeholder:"Search by user, action, or details...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:s,onChange:N=>i(N.target.value)})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:o,onChange:N=>l(N.target.value),children:[a.jsx("option",{children:"All Categories"}),a.jsx("option",{children:"Auth"}),a.jsx("option",{children:"Data"}),a.jsx("option",{children:"User"}),a.jsx("option",{children:"System"}),a.jsx("option",{children:"Content"})]}),a.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:c,onChange:N=>d(N.target.value),children:[a.jsx("option",{children:"All Severity"}),a.jsx("option",{children:"Info"}),a.jsx("option",{children:"Warning"}),a.jsx("option",{children:"Error"}),a.jsx("option",{children:"Critical"})]}),a.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:f,onChange:N=>u(N.target.value),children:[a.jsx("option",{children:"All Roles"}),a.jsx("option",{children:"Admin"}),a.jsx("option",{children:"Teacher"}),a.jsx("option",{children:"Student"})]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:[a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Severity"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Timestamp"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"User"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Action"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Category"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Details"}),a.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider text-right",children:"View"})]})}),a.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:y.map(N=>a.jsxs("tr",{className:"hover:bg-[#edf1f7] transition-colors",children:[a.jsx("td",{className:"p-4",children:a.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold border ${j(N.severity)}`,children:[p(N.severity),N.severity]})}),a.jsx("td",{className:"p-4",children:a.jsxs("div",{className:"flex items-center gap-2 text-[#5a6578] text-sm",children:[a.jsx("div",{className:"p-1 bg-[#edf1f7] rounded",children:a.jsx(ta,{size:12})}),N.timestamp]})}),a.jsx("td",{className:"p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[N.user.avatar?a.jsx("img",{src:N.user.avatar,alt:N.user.name,className:"w-8 h-8 rounded-full object-cover"}):a.jsx("div",{className:"w-8 h-8 bg-sky-100 rounded-full flex items-center justify-center",children:a.jsx(na,{size:16,className:"text-sky-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:N.user.name}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:N.user.role})]})]})}),a.jsx("td",{className:"p-4",children:a.jsx("p",{className:"font-medium text-[#0a1628] text-sm",children:N.action})}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${S(N.category)}`,children:N.category})}),a.jsx("td",{className:"p-4 text-sm text-[#5a6578] max-w-xs truncate",title:N.details,children:N.details}),a.jsx("td",{className:"p-4 text-right",children:a.jsx("button",{className:"p-2 hover:bg-[#dde3eb] rounded-lg text-slate-500 hover:text-sky-600 transition-colors",children:a.jsx(Bi,{size:16})})})]},N.id))})]}),y.length===0&&!n&&a.jsxs("div",{className:"p-12 text-center text-[#5a6578]",children:[a.jsx(na,{size:48,className:"mx-auto mb-4 text-slate-500"}),a.jsx("p",{className:"font-medium",children:"No logs found"}),a.jsx("p",{className:"text-sm",children:e.length===0?"Audit events will appear here as actions are performed":"Try adjusting your search or filters"})]})]})]})},Fb={notifications:{emailNotifications:!0,pushNotifications:!0,soundEnabled:!0,notificationTypes:{quizReminders:!0,newContent:!0,achievements:!0,streakAlerts:!0,weeklySummary:!0},quietHours:{start:"22:00",end:"08:00"}},appearance:{darkMode:!1,fontSize:16,compactView:!1,reduceAnimations:!1},privacy:{profileVisibility:"everyone",showActivityStatus:!0,dataSharing:!0},learning:{dailyXpGoal:100,preferredStudyTime:"evening",autoPlayLessons:!1,showHints:!0,quizDifficultyPreference:"adaptive",studyReminderTime:"18:00"},adminPanel:{siteName:"MathPulse AI",siteDescription:"AI-Powered Mathematics Learning Platform",defaultLanguage:"English",maintenanceMode:!1,enforceStrongPasswords:!0,sessionTimeoutMinutes:60,aiTutorEnabled:!0,aiAutoRecommendations:!0,aiRiskAlertsEnabled:!0,gradingScale:"percentage",passingGrade:75,parentSummaryEmails:!0,teacherDigestEmails:!0,weeklyPlatformReport:!0,autoBackupEnabled:!1,backupFrequency:"weekly"}},Ine="preferences",wM=()=>JSON.parse(JSON.stringify(Fb)),jM=e=>{const t=wM();return e?{...t,...e,notifications:{...t.notifications,...e.notifications,notificationTypes:{...t.notifications.notificationTypes,...e.notifications?.notificationTypes},quietHours:{...t.notifications.quietHours,...e.notifications?.quietHours}},appearance:{...t.appearance,...e.appearance},privacy:{...t.privacy,...e.privacy},learning:{...t.learning,...e.learning},adminPanel:{...t.adminPanel,...e.adminPanel}}:t},NM=e=>Me(fe,"users",e,"settings",Ine),SM=async e=>{const t=NM(e),n=await Lt(t);if(!n.exists()){const r=wM();return await rt(t,{...r,createdAt:ke(),updatedAt:ke()}),r}return jM(n.data())},One=async(e,t)=>{const n=await SM(e),r=jM({...n,...t});return await rt(NM(e),{...r,updatedAt:ke()},{merge:!0}),r},Dne=()=>JSON.parse(JSON.stringify(Fb)),Rne=()=>{const{userProfile:e}=$t(),[t,n]=v.useState("General"),[r,s]=v.useState(Dne()),[i,o]=v.useState(!1),[l,c]=v.useState(!1),d=[{id:"General",label:"General",icon:w0},{id:"Security",label:"Security",icon:na},{id:"AI Features",label:"AI Features",icon:Jn},{id:"Academic",label:"Academic",icon:De},{id:"Notifications",label:"Notifications",icon:Ar},{id:"Backup & Data",label:"Backup & Data",icon:ys}];v.useEffect(()=>{(async()=>{if(e?.uid){o(!0);try{const h=await SM(e.uid);s(h)}catch(h){console.error("Failed loading admin settings:",h),ue.error("Failed to load admin settings")}finally{o(!1)}}})()},[e?.uid]);const f=m=>{s(h=>({...h,adminPanel:{...h.adminPanel,...m}}))},u=async()=>{if(e?.uid){c(!0);try{const m=await One(e.uid,r);s(m),ue.success("Admin settings updated")}catch(m){console.error("Failed saving admin settings:",m),ue.error("Failed to save admin settings")}finally{c(!1)}}};return a.jsx(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:a.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[a.jsx("div",{className:"col-span-12 md:col-span-3",children:a.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-[#dde3eb] overflow-hidden",children:a.jsx("nav",{className:"flex flex-col py-2",children:d.map(m=>{const h=m.icon,g=t===m.id;return a.jsxs("button",{onClick:()=>n(m.id),className:`flex items-center gap-3 px-4 py-3 text-sm font-medium transition-all relative ${g?"text-sky-600 bg-sky-50/50":"text-[#5a6578] hover:bg-[#edf1f7] hover:text-[#0a1628]"}`,children:[g&&a.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-sky-600 rounded-r-full"}),a.jsx(h,{size:18,className:g?"text-sky-600":"text-slate-500"}),m.label]},m.id)})})})}),a.jsx("div",{className:"col-span-12 md:col-span-9",children:a.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-6",children:a.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-[#dde3eb] p-6",children:i?a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Loading settings..."}):a.jsxs(a.Fragment,{children:[t==="General"&&a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Site Name"}),a.jsx(ve,{value:r.adminPanel.siteName,onChange:m=>f({siteName:m.target.value}),className:"bg-white"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Site Description"}),a.jsx("textarea",{className:"w-full min-h-[80px] px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm focus:outline-none focus:ring-2 focus:ring-sky-500/20 placeholder:text-slate-500 resize-none",value:r.adminPanel.siteDescription,onChange:m=>f({siteDescription:m.target.value})})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Default Language"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{value:r.adminPanel.defaultLanguage,onChange:m=>f({defaultLanguage:m.target.value}),className:"w-full px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[a.jsx("option",{children:"English"}),a.jsx("option",{children:"Spanish"}),a.jsx("option",{children:"French"}),a.jsx("option",{children:"German"})]}),a.jsx(y0,{size:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),a.jsxs("div",{className:"mt-6 p-4 bg-red-50 border border-red-100 rounded-xl flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"p-2 bg-white rounded-lg text-red-600 shadow-sm border border-red-100",children:a.jsx(ZD,{size:18})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-red-900",children:"Maintenance Mode"}),a.jsx("p",{className:"text-xs text-red-700 mt-0.5",children:"Temporarily disable access for non-admins"})]})]}),a.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[a.jsx("input",{type:"checkbox",className:"sr-only peer",checked:r.adminPanel.maintenanceMode,onChange:()=>f({maintenanceMode:!r.adminPanel.maintenanceMode})}),a.jsx("div",{className:"w-11 h-6 bg-[#dde3eb] peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-red-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-[#dde3eb] after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-red-600"})]})]})]}),t==="Security"&&a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"Enforce Strong Passwords"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Require stronger passwords for all users"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.enforceStrongPasswords,onChange:()=>f({enforceStrongPasswords:!r.adminPanel.enforceStrongPasswords})})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Session Timeout (minutes)"}),a.jsx(ve,{type:"number",value:r.adminPanel.sessionTimeoutMinutes,onChange:m=>f({sessionTimeoutMinutes:Number(m.target.value||0)}),className:"max-w-xs"})]})]}),t==="AI Features"&&a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"AI Tutor"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Enable AI tutoring experience"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.aiTutorEnabled,onChange:()=>f({aiTutorEnabled:!r.adminPanel.aiTutorEnabled})})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"Auto Recommendations"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Enable AI-generated recommendations"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.aiAutoRecommendations,onChange:()=>f({aiAutoRecommendations:!r.adminPanel.aiAutoRecommendations})})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"Risk Alerts"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Send proactive risk alerts for at-risk learners"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.aiRiskAlertsEnabled,onChange:()=>f({aiRiskAlertsEnabled:!r.adminPanel.aiRiskAlertsEnabled})})]})]}),t==="Academic"&&a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Grading Scale"}),a.jsxs("div",{className:"relative max-w-xs",children:[a.jsxs("select",{value:r.adminPanel.gradingScale,onChange:m=>f({gradingScale:m.target.value}),className:"w-full px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[a.jsx("option",{value:"percentage",children:"Percentage"}),a.jsx("option",{value:"gpa",children:"GPA"})]}),a.jsx(wR,{size:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Passing Grade"}),a.jsx(ve,{type:"number",value:r.adminPanel.passingGrade,onChange:m=>f({passingGrade:Number(m.target.value||0)}),className:"max-w-xs"})]})]}),t==="Notifications"&&a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"Parent Summary Emails"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Weekly summaries for guardians"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.parentSummaryEmails,onChange:()=>f({parentSummaryEmails:!r.adminPanel.parentSummaryEmails})})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"Teacher Digest Emails"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Daily teacher performance digest"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.teacherDigestEmails,onChange:()=>f({teacherDigestEmails:!r.adminPanel.teacherDigestEmails})})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"Weekly Platform Report"}),a.jsx("p",{className:"text-xs text-slate-500",children:"System report for administrators"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.weeklyPlatformReport,onChange:()=>f({weeklyPlatformReport:!r.adminPanel.weeklyPlatformReport})})]})]}),t==="Backup & Data"&&a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:"Automatic Backups"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Create scheduled backups of platform data"})]}),a.jsx("input",{type:"checkbox",checked:r.adminPanel.autoBackupEnabled,onChange:()=>f({autoBackupEnabled:!r.adminPanel.autoBackupEnabled})})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Backup Frequency"}),a.jsxs("select",{value:r.adminPanel.backupFrequency,onChange:m=>f({backupFrequency:m.target.value}),className:"w-full max-w-xs px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[a.jsx("option",{value:"daily",children:"Daily"}),a.jsx("option",{value:"weekly",children:"Weekly"}),a.jsx("option",{value:"monthly",children:"Monthly"})]})]})]}),a.jsx("div",{className:"mt-8 pt-6 border-t border-[#dde3eb] flex justify-end",children:a.jsxs(pe,{className:"bg-sky-600 hover:bg-sky-700 text-white gap-2",onClick:u,disabled:l,children:[a.jsx(id,{size:16}),l?"Saving...":"Save Changes"]})})]})})})})]})})};function Lne({className:e,...t}){return a.jsx(I6,{"data-slot":"avatar",className:Be("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function $ne({className:e,...t}){return a.jsx(O6,{"data-slot":"avatar-image",className:Be("aspect-square size-full",e),...t})}function zne({className:e,...t}){return a.jsx(D6,{"data-slot":"avatar-fallback",className:Be("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}const Fne=()=>{const{userProfile:e}=$t(),[t,n]=v.useState([]),[r,s]=v.useState(!0),[i,o]=v.useState(!1),[l,c]=v.useState(!1),[d,f]=v.useState(""),[u,m]=v.useState("All Roles"),[h,g]=v.useState("All Status"),[x,p]=v.useState(!1),[j,S]=v.useState(!1),[y,N]=v.useState(null),[b,w]=v.useState(null),[k,A]=v.useState({name:"",email:"",role:"Student",status:"Active",department:"",grade:"Grade 11",section:"Section A",lrn:""}),C=v.useCallback(async()=>{s(!0);try{const E=await wne();n(E)}catch{ue.error("Failed to load users")}finally{s(!1)}},[]);v.useEffect(()=>{C()},[C]);const F=()=>{w(null),A({name:"",email:"",role:"Student",status:"Active",department:"",grade:"Grade 11",section:"Section A",lrn:""}),p(!0)},D=E=>{w(E),A({name:E.name,email:E.email,role:E.role,status:E.status,department:E.department,grade:E.grade||"Grade 11",section:E.section||"Section A",lrn:E.lrn||""}),p(!0)},L=async()=>{if(!k.name.trim()||!k.email.trim()){ue.error("Name and email are required");return}o(!0);try{b?(await h5(b.id,k),await Da("User Updated","User","Info",`Updated user: ${k.name} (${k.email})`,{name:e?.name||"Admin",role:"Admin",avatar:e?.photo||null}),ue.success("User updated successfully")):(await Nne(k.email,k.name,k.role,k.role==="Student"?k.grade:k.department,k.role==="Student"?{grade:k.grade,section:k.section,lrn:k.lrn}:void 0),await Da("Created New User","User","Info",`Created new ${k.role.toLowerCase()} account: ${k.name} (${k.email})`,{name:e?.name||"Admin",role:"Admin",avatar:e?.photo||null}),ue.success("User created successfully")),await C(),p(!1)}catch(E){ue.error(E instanceof Error?E.message:"Failed to save user")}finally{o(!1)}},P=(E,B)=>{N({id:E,name:B}),S(!0)},H=async()=>{if(!(!y||l)){c(!0);try{await jne(y.id),await Da("User Deleted","User","Warning",`Deleted user account: ${y.name}`,{name:e?.name||"Admin",role:"Admin",avatar:e?.photo||null}),ue.success("User deleted"),n(E=>E.filter(B=>B.id!==y.id)),S(!1),N(null)}catch{ue.error("Failed to delete user")}finally{c(!1)}}},Y=async E=>{const B=E.status==="Active"?"Inactive":"Active";try{await h5(E.id,{status:B}),await Da("User Status Changed","User","Warning",`${B==="Active"?"Activated":"Deactivated"} user: ${E.email}`,{name:e?.name||"Admin",role:"Admin",avatar:e?.photo||null}),ue.success(`User ${B==="Active"?"activated":"deactivated"}`),n(T=>T.map(M=>M.id===E.id?{...M,status:B}:M))}catch{ue.error("Failed to update user status")}},V=t.filter(E=>{const B=E.name.toLowerCase().includes(d.toLowerCase())||E.email.toLowerCase().includes(d.toLowerCase()),T=u==="All Roles"||E.role===u,M=h==="All Status"||E.status===h;return B&&T&&M}),O=[{label:"Total Users",value:t.length,color:"text-[#0a1628]"},{label:"Active",value:t.filter(E=>E.status==="Active").length,color:"text-green-600"},{label:"Admins",value:t.filter(E=>E.role==="Admin").length,color:"text-sky-600"},{label:"Teachers",value:t.filter(E=>E.role==="Teacher").length,color:"text-sky-600"},{label:"Students",value:t.filter(E=>E.role==="Student").length,color:"text-emerald-600"}];return a.jsxs("div",{className:"space-y-6",children:[r?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsx(He,{size:28,className:"animate-spin text-sky-500"})}):null,a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:O.map((E,B)=>a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[a.jsx("h3",{className:`text-2xl font-bold ${E.color}`,children:E.value}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:E.label})]},B))}),a.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(_n,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),a.jsx(ve,{placeholder:"Search users by name or email...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:d,onChange:E=>f(E.target.value)})]}),a.jsxs("div",{className:"flex flex-col md:flex-row justify-between gap-4",children:[a.jsxs("div",{className:"flex gap-3",children:[a.jsxs(Ea,{value:u,onValueChange:m,children:[a.jsx(Ia,{className:"w-[140px] bg-[#edf1f7] border-[#dde3eb]",children:a.jsx(_a,{placeholder:"All Roles"})}),a.jsxs(Oa,{children:[a.jsx(pt,{value:"All Roles",children:"All Roles"}),a.jsx(pt,{value:"Admin",children:"Admin"}),a.jsx(pt,{value:"Teacher",children:"Teacher"}),a.jsx(pt,{value:"Student",children:"Student"})]})]}),a.jsxs(Ea,{value:h,onValueChange:g,children:[a.jsx(Ia,{className:"w-[140px] bg-[#edf1f7] border-[#dde3eb]",children:a.jsx(_a,{placeholder:"All Status"})}),a.jsxs(Oa,{children:[a.jsx(pt,{value:"All Status",children:"All Status"}),a.jsx(pt,{value:"Active",children:"Active"}),a.jsx(pt,{value:"Inactive",children:"Inactive"})]})]})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs(pe,{variant:"outline",className:"gap-2 border-[#dde3eb] text-[#5a6578]",onClick:C,children:[a.jsx(sd,{size:16}),"Refresh"]}),a.jsxs(pe,{className:"gap-2 bg-sky-500 hover:bg-sky-600 text-white",onClick:F,children:[a.jsx(Qr,{size:16}),"Add User"]})]})]})]}),a.jsx("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-left",children:[a.jsx("thead",{className:"text-xs text-[#5a6578] uppercase bg-[#edf1f7] border-b border-[#dde3eb]",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-4 font-semibold",children:"User"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Role"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Status"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Class/Department"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Last Login"}),a.jsx("th",{className:"px-6 py-4 font-semibold text-right",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:V.length>0?V.map(E=>a.jsxs("tr",{className:"hover:bg-[#edf1f7]/50 transition-colors",children:[a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(Lne,{children:[a.jsx($ne,{src:E.photo}),a.jsx(zne,{children:E.name.charAt(0)})]}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-[#0a1628]",children:E.name}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:E.email})]})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[E.role==="Admin"&&a.jsx(na,{size:14,className:"text-sky-600"}),E.role==="Teacher"&&a.jsx(fr,{size:14,className:"text-sky-600"}),E.role==="Student"&&a.jsx(WD,{size:14,className:"text-emerald-600"}),a.jsx("span",{className:` + font-medium text-xs px-2 py-0.5 rounded-full + ${E.role==="Admin"?"bg-sky-100 text-sky-700":""} + ${E.role==="Teacher"?"bg-sky-100 text-sky-700":""} + ${E.role==="Student"?"bg-emerald-100 text-emerald-700":""} + `,children:E.role})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("span",{className:` + inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border + ${E.status==="Active"?"bg-green-50 text-green-700 border-green-200":"bg-[#edf1f7] text-[#5a6578] border-[#dde3eb]"} + `,children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${E.status==="Active"?"bg-green-500":"bg-[#a8a5b3]"}`}),E.status]})}),a.jsx("td",{className:"px-6 py-4 text-[#5a6578]",children:E.role==="Student"&&E.classSection||E.department}),a.jsx("td",{className:"px-6 py-4 text-[#5a6578]",children:E.lastLogin}),a.jsx("td",{className:"px-6 py-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>D(E),className:"p-1.5 text-slate-500 hover:text-sky-600 hover:bg-sky-50 rounded-lg transition-colors",children:a.jsx(dR,{size:16})}),a.jsx("button",{onClick:()=>Y(E),className:`p-1.5 rounded-lg transition-colors ${E.status==="Active"?"text-slate-500 hover:text-orange-600 hover:bg-orange-50":"text-orange-500 hover:text-green-600 hover:bg-green-50"}`,title:E.status==="Active"?"Deactivate User":"Activate User",children:E.status==="Active"?a.jsx(QO,{size:16}):a.jsx(NR,{size:16})}),a.jsx("button",{onClick:()=>P(E.id,E.name),className:"p-1.5 text-slate-500 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:a.jsx(sa,{size:16})})]})})]},E.id)):a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"px-6 py-12 text-center text-[#5a6578]",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"p-3 bg-[#edf1f7] rounded-full",children:a.jsx(kt,{size:24,className:"text-slate-500"})}),a.jsx("p",{children:"No users found matching your filters"})]})})})})]})})}),a.jsx(Ob,{open:x,onOpenChange:p,children:a.jsxs(Db,{className:"sm:max-w-[425px]",children:[a.jsxs(Rb,{children:[a.jsx($b,{children:b?"Edit User Access":"Add New User"}),a.jsx(zb,{children:b?"Update user details and manage access permissions.":"Create a new user account and assign roles."})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"name",className:"text-right text-sm font-medium text-[#0a1628]",children:"Name"}),a.jsx(ve,{id:"name",value:k.name,onChange:E=>A({...k,name:E.target.value}),className:"col-span-3"})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"email",className:"text-right text-sm font-medium text-[#0a1628]",children:"Email"}),a.jsx(ve,{id:"email",type:"email",value:k.email,onChange:E=>A({...k,email:E.target.value}),className:"col-span-3"})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"role",className:"text-right text-sm font-medium text-[#0a1628]",children:"Role"}),a.jsx("div",{className:"col-span-3",children:a.jsxs(Ea,{value:k.role,onValueChange:E=>A({...k,role:E}),children:[a.jsx(Ia,{children:a.jsx(_a,{placeholder:"Select role"})}),a.jsxs(Oa,{children:[a.jsx(pt,{value:"Student",children:"Student"}),a.jsx(pt,{value:"Teacher",children:"Teacher"}),a.jsx(pt,{value:"Admin",children:"Admin"})]})]})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"status",className:"text-right text-sm font-medium text-[#0a1628]",children:"Status"}),a.jsx("div",{className:"col-span-3",children:a.jsxs(Ea,{value:k.status,onValueChange:E=>A({...k,status:E}),children:[a.jsx(Ia,{children:a.jsx(_a,{placeholder:"Select status"})}),a.jsxs(Oa,{children:[a.jsx(pt,{value:"Active",children:"Active"}),a.jsx(pt,{value:"Inactive",children:"Inactive"})]})]})})]}),k.role==="Student"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"lrn",className:"text-right text-sm font-medium text-[#0a1628]",children:"LRN"}),a.jsx(ve,{id:"lrn",value:k.lrn,onChange:E=>A({...k,lrn:E.target.value}),placeholder:"12-digit learner reference",className:"col-span-3"})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"grade",className:"text-right text-sm font-medium text-[#0a1628]",children:"Grade"}),a.jsx(ve,{id:"grade",value:k.grade,onChange:E=>A({...k,grade:E.target.value}),placeholder:"e.g. Grade 11",className:"col-span-3"})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"section",className:"text-right text-sm font-medium text-[#0a1628]",children:"Section"}),a.jsx(ve,{id:"section",value:k.section,onChange:E=>A({...k,section:E.target.value}),placeholder:"e.g. STEM A",className:"col-span-3"})]})]}):a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx("label",{htmlFor:"department",className:"text-right text-sm font-medium text-[#0a1628]",children:"Department"}),a.jsx(ve,{id:"department",value:k.department,onChange:E=>A({...k,department:E.target.value}),placeholder:"e.g. Mathematics",className:"col-span-3"})]})]}),a.jsxs(Lb,{children:[a.jsx(pe,{variant:"outline",onClick:()=>p(!1),disabled:i,children:"Cancel"}),a.jsxs(pe,{onClick:L,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:i,children:[i?a.jsx(He,{size:16,className:"animate-spin mr-2"}):null,b?"Save Changes":"Create User"]})]})]})}),a.jsx(Ua,{isOpen:j,onClose:()=>{l||(S(!1),N(null))},onConfirm:H,title:"Delete User?",message:y?`Delete user "${y.name}"? This cannot be undone.`:"Delete this user? This cannot be undone.",confirmText:l?"Deleting...":"Delete",cancelText:"Cancel",type:"danger",icon:"delete"})]})},_i=({icon:e,title:t,subtitle:n})=>a.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-10 text-center",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-[#edf1f7] flex items-center justify-center",children:e}),a.jsx("p",{className:"text-sm font-semibold text-[#5a6578]",children:t}),n&&a.jsx("p",{className:"text-xs text-[#a0aec0] max-w-xs",children:n})]}),Bne=()=>{const[e,t]=v.useState("30d"),[n,r]=v.useState(null),[s,i]=v.useState(!0);v.useEffect(()=>{Mne().then(r).catch(console.error).finally(()=>i(!1))},[]);const o={"7d":"Last 7 Days","30d":"Last 30 Days","90d":"Last 90 Days","12m":"Last 12 Months"},l=[{label:"Total Active Users",value:s?null:(n?.totalActiveUsers??0).toLocaleString(),icon:kt,color:"from-sky-500 to-blue-600"},{label:"Avg. Completion Rate",value:null,icon:cn,color:"from-teal-500 to-emerald-600"},{label:"Avg. Session Duration",value:null,icon:On,color:"from-violet-500 to-purple-600"},{label:"At-Risk Students",value:s?null:(n?.atRiskStudents??0).toString(),icon:Nv,color:"from-rose-500 to-orange-600"}],c=[{label:"Achievements Unlocked",icon:yt,color:"text-rose-600",bg:"bg-rose-50",value:s?null:(n?.achievementsUnlocked??0).toLocaleString()},{label:"XP Earned (Platform)",icon:Jn,color:"text-violet-600",bg:"bg-violet-50",value:s?null:(n?.totalXPEarned??0)>=1e6?`${((n?.totalXPEarned??0)/1e6).toFixed(1)}M`:(n?.totalXPEarned??0)>=1e3?`${Math.round((n?.totalXPEarned??0)/1e3)}K`:(n?.totalXPEarned??0).toLocaleString()},{label:"Active Streaks",icon:Nn,color:"text-orange-600",bg:"bg-orange-50",value:s?null:(n?.activeStreaks??0).toLocaleString()},{label:"AI Tutor Sessions",icon:lr,color:"text-sky-600",bg:"bg-sky-50",value:s?null:(n?.aiTutorSessions??0).toLocaleString()}];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(J.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center gap-2 bg-white rounded-xl p-1 shadow-sm border border-[#dde3eb]",children:Object.entries(o).map(([d,f])=>a.jsx("button",{onClick:()=>t(d),className:`px-4 py-2 rounded-lg text-sm font-semibold transition-all ${e===d?"bg-sky-600 text-white shadow-sm":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:f},d))}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(pe,{variant:"outline",disabled:!0,className:"px-4 py-2 gap-2 rounded-xl border-[#dde3eb] font-semibold text-sm opacity-50 cursor-not-allowed",children:[a.jsx(uC,{size:16}),"Filters"]}),a.jsxs(pe,{variant:"outline",disabled:!0,className:"px-4 py-2 gap-2 rounded-xl border-[#dde3eb] font-semibold text-sm opacity-50 cursor-not-allowed",children:[a.jsx(qa,{size:16}),"Export"]})]})]}),!s&&!n?.totalActiveUsers&&a.jsxs(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35},className:"flex items-center gap-3 bg-rose-50 border border-rose-200 rounded-2xl px-5 py-4",children:[a.jsx(ys,{size:18,className:"text-rose-600 shrink-0"}),a.jsxs("p",{className:"text-sm text-rose-800",children:[a.jsx("span",{className:"font-semibold",children:"Limited analytics data."})," ","KPI cards will populate automatically as students, quizzes, and sessions accumulate in the platform. Chart visualisations require time-series data."]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:l.map((d,f)=>{const u=d.icon;return a.jsxs(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.35,delay:f*.06},className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsx("div",{className:`w-11 h-11 rounded-xl bg-gradient-to-br ${d.color} flex items-center justify-center shadow-sm`,children:a.jsx(u,{size:20,className:"text-white"})}),a.jsx("div",{className:"w-[120px] h-8 rounded bg-[#f0f3f8]"})]}),s?a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(He,{size:16,className:"animate-spin text-[#a0aec0]"}),a.jsx("div",{className:"w-14 h-6 bg-[#edf1f7] rounded-lg animate-pulse"})]}):d.value!==null?a.jsx("p",{className:"text-2xl font-bold text-[#0a1628] mb-2",children:d.value}):a.jsx("div",{className:"w-16 h-7 bg-[#edf1f7] rounded-lg mb-2"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-[#5a6578] font-medium",children:d.label}),a.jsx("span",{className:"text-xs text-[#a0aec0] font-medium",children:d.value===null?"—":o[e]})]})]},d.label)})}),a.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[a.jsxs(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:"col-span-8 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Performance Trends"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Average scores — students vs. teacher targets"})]}),a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 rounded-full bg-sky-300"}),a.jsx("span",{className:"text-[#a0aec0] font-medium",children:"Students"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 rounded-full bg-violet-300"}),a.jsx("span",{className:"text-[#a0aec0] font-medium",children:"Teacher Targets"})]})]})]}),a.jsx(_i,{icon:a.jsx(wn,{size:24,className:"text-[#c2cad8]"}),title:"No performance data yet",subtitle:"Import student and class records to generate trend charts."})]}),a.jsxs(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.2},className:"col-span-4 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("div",{className:"w-10 h-10 bg-violet-100 rounded-xl flex items-center justify-center",children:a.jsx(j8,{size:20,className:"text-violet-400"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Grade Distribution"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"All students, current term"})]})]}),a.jsx(_i,{icon:a.jsx(ys,{size:24,className:"text-[#c2cad8]"}),title:"No grade data",subtitle:"Import quiz and assessment results to see grade breakdowns."})]})]}),a.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[a.jsxs(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.25},className:"col-span-7 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("div",{className:"w-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center",children:a.jsx(De,{size:20,className:"text-sky-400"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Subject Engagement"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Enrollment, completion, and average scores"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-[#dde3eb]",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[#f7f9fc]",children:[a.jsx("th",{className:"text-left text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Subject"}),a.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Enrolled"}),a.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Completion"}),a.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Avg. Score"}),a.jsx("th",{className:"text-left text-xs font-semibold text-[#5a6578] px-4 py-3 w-36",children:"Progress"})]})}),a.jsx("tbody",{children:a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-10",children:a.jsx(_i,{icon:a.jsx(ys,{size:22,className:"text-[#c2cad8]"}),title:"No subject data available",subtitle:"Import class enrollment records to view subject engagement."})})})})]})})]}),a.jsxs(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.3},className:"col-span-5 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("div",{className:"w-10 h-10 bg-orange-100 rounded-xl flex items-center justify-center",children:a.jsx(ta,{size:20,className:"text-orange-400"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Weekly Activity"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Sessions per day of week"})]})]}),a.jsx(_i,{icon:a.jsx(Nv,{size:24,className:"text-[#c2cad8]"}),title:"No session activity yet",subtitle:"Student logins and session data will appear here after data is imported."})]})]}),a.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[a.jsxs(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.35},className:"col-span-5 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("div",{className:"w-10 h-10 bg-rose-100 rounded-xl flex items-center justify-center",children:a.jsx(yt,{size:20,className:"text-rose-400"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Gamification Overview"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Engagement & motivation metrics"})]})]}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:c.map(d=>{const f=d.icon;return a.jsxs("div",{className:`${d.bg} border border-[#dde3eb] rounded-xl p-4`,children:[a.jsx(f,{size:20,className:d.color}),s?a.jsx("div",{className:"w-12 h-5 bg-white/60 rounded mt-2 mb-1 animate-pulse"}):d.value!==null?a.jsx("p",{className:"text-lg font-bold text-[#0a1628] mt-2 mb-1",children:d.value}):a.jsx("div",{className:"w-12 h-5 bg-white/60 rounded mt-2 mb-1"}),a.jsx("p",{className:"text-xs text-[#5a6578] font-medium",children:d.label}),!s&&d.value===null&&a.jsx("p",{className:"text-[10px] text-[#a0aec0] mt-1",children:"No data yet"})]},d.label)})})]}),a.jsxs(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.4},className:"col-span-7 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("div",{className:"w-10 h-10 bg-teal-100 rounded-xl flex items-center justify-center",children:a.jsx(fr,{size:20,className:"text-teal-400"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Top Performing Classes"}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:"Ranked by average score this term"})]})]}),a.jsx(_i,{icon:a.jsx(ys,{size:24,className:"text-[#c2cad8]"}),title:"No class data yet",subtitle:"Import class and student records to see top performers ranked here."})]})]})]})},Ml=[{id:"gen-math",name:"Gen Math",shortName:"GM",color:"#3B82F6"},{id:"stats-prob",name:"Stats & Prob",shortName:"SP",color:"#0ea5e9"},{id:"pre-calc",name:"Pre-Calc",shortName:"PC",color:"#F97316"},{id:"basic-calc",name:"Basic Calc",shortName:"BC",color:"#EF4444"}],Lp={"gen-math":[{name:"Functions & Relations",unit:"Functions"},{name:"Rational Functions",unit:"Functions"},{name:"Exponential Functions",unit:"Functions"},{name:"Logarithmic Functions",unit:"Functions"},{name:"Simple Interest",unit:"Business Math"},{name:"Compound Interest",unit:"Business Math"},{name:"Annuities",unit:"Business Math"},{name:"Propositions",unit:"Logic"},{name:"Truth Tables",unit:"Logic"}],"stats-prob":[{name:"Random Variables",unit:"Random Variables"},{name:"Probability Distributions",unit:"Random Variables"},{name:"Normal Distribution",unit:"Normal Dist"},{name:"Z-scores",unit:"Normal Dist"},{name:"Sampling Distributions",unit:"Sampling"},{name:"Central Limit Theorem",unit:"Sampling"},{name:"Confidence Intervals",unit:"Estimation"},{name:"Hypothesis Testing",unit:"Testing"},{name:"Correlation",unit:"Regression"}],"pre-calc":[{name:"Parabola",unit:"Conics"},{name:"Ellipse",unit:"Conics"},{name:"Hyperbola",unit:"Conics"},{name:"Arithmetic Seq",unit:"Series"},{name:"Geometric Seq",unit:"Series"},{name:"Math Induction",unit:"Series"},{name:"Trig Functions",unit:"Trigonometry"},{name:"Trig Identities",unit:"Trigonometry"},{name:"Polar Coords",unit:"Trigonometry"}],"basic-calc":[{name:"Limits",unit:"Limits"},{name:"Continuity",unit:"Limits"},{name:"Definition of Deriv.",unit:"Derivatives"},{name:"Diff. Rules",unit:"Derivatives"},{name:"Chain Rule",unit:"Derivatives"},{name:"Related Rates",unit:"Derivatives"},{name:"Optimization",unit:"Derivatives"},{name:"Antiderivatives",unit:"Integration"},{name:"Definite Integrals",unit:"Integration"}]};function qne(e){return e>=85?"bg-emerald-500":e>=70?"bg-emerald-300":e>=55?"bg-rose-300":e>=40?"bg-orange-400":e>=20?"bg-red-400":"bg-red-600"}function Vne(e){return e>=70||e>=40,"text-white"}const Une=({title:e="Platform-Wide Subject Mastery"})=>{const[t,n]=v.useState(null),[r,s]=v.useState("all"),[i,o]=v.useState([]),[l,c]=v.useState(!0);v.useEffect(()=>{(async()=>{c(!0);try{const x=await Ye(_e(fe,"progress")),p={};x.forEach(S=>{const N=S.data().subjects||{};for(const[b,w]of Object.entries(N)){const k=Lp[b]||[],A=w?.progress??0;for(const C of k){const F=`${b}::${C.name}`;p[F]||(p[F]={totalMastery:0,count:0}),p[F].totalMastery+=A,p[F].count+=1}}});const j=[];for(const S of Ml){const y=Lp[S.id]||[];for(const N of y){const b=`${S.id}::${N.name}`,w=p[b];j.push({subject:S.id,topic:N.name,mastery:w&&w.count>0?Math.round(w.totalMastery/w.count):0,students:w?.count??0})}}o(j)}catch(x){console.error("[MasteryHeatmap] Error fetching progress data:",x)}finally{c(!1)}})()},[]);const d=r==="all"?Ml:Ml.filter(g=>g.id===r),f=i.filter(g=>g.students>0),u=f.length>0?Math.round(f.reduce((g,x)=>g+x.mastery,0)/f.length):0,m=f.length>0?f.reduce((g,x)=>x.mastery0?f.reduce((g,x)=>x.mastery>g.mastery?x:g,f[0]):null;return l?a.jsx("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb] flex items-center justify-center min-h-[200px]",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx(He,{size:28,className:"text-sky-500 animate-spin"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Loading mastery data..."})]})}):a.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-500 to-sky-500 rounded-xl flex items-center justify-center",children:a.jsx(iD,{size:20,className:"text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:e}),a.jsxs("p",{className:"text-xs text-[#5a6578]",children:["Aggregated mastery levels across all classes • ",i.filter(g=>g.students>0).length," tracked combinations"]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{value:r,onChange:g=>s(g.target.value),className:"appearance-none bg-[#edf1f7] border border-[#dde3eb] rounded-lg px-3 py-1.5 pr-8 text-xs font-semibold text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[a.jsx("option",{value:"all",children:"All Subjects"}),Ml.map(g=>a.jsx("option",{value:g.id,children:g.name},g.id))]}),a.jsx(Hn,{size:12,className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-5",children:[a.jsxs("div",{className:"bg-[#edf1f7] rounded-xl p-3 flex items-center gap-3",children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${u>=70?"bg-emerald-100":"bg-rose-100"}`,children:a.jsx(Qi,{size:16,className:u>=70?"text-emerald-600":"text-rose-600"})}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-lg font-bold text-[#0a1628]",children:[u,"%"]}),a.jsx("p",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider",children:"Platform Average"})]})]}),a.jsxs("div",{className:"bg-red-50 rounded-xl p-3 flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-red-100 rounded-lg flex items-center justify-center",children:a.jsx(gC,{size:16,className:"text-red-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold text-[#0a1628] truncate",children:m?.topic}),a.jsxs("p",{className:"text-[10px] text-red-600 font-semibold",children:[m?.mastery,"% — Lowest"]})]})]}),a.jsxs("div",{className:"bg-emerald-50 rounded-xl p-3 flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-emerald-100 rounded-lg flex items-center justify-center",children:a.jsx(ot,{size:16,className:"text-emerald-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold text-[#0a1628] truncate",children:h?.topic}),a.jsxs("p",{className:"text-[10px] text-emerald-600 font-semibold",children:[h?.mastery,"% — Highest"]})]})]})]}),a.jsx("div",{className:"overflow-x-auto",children:d.map(g=>{const x=Lp[g.id]||[],p=i.filter(S=>S.subject===g.id),j=p.length>0?Math.round(p.reduce((S,y)=>S+y.mastery,0)/p.length):0;return a.jsxs("div",{className:"mb-5 last:mb-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:g.color}}),a.jsx("span",{className:"text-xs font-bold text-[#0a1628]",children:g.name}),a.jsxs("span",{className:"text-[10px] text-slate-500 ml-1",children:["Avg: ",j,"%"]})]}),a.jsxs("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${x.length}, minmax(0, 1fr))`},children:[x.map((S,y)=>a.jsx("div",{className:"text-center",children:a.jsx("p",{className:"text-[9px] text-slate-500 truncate px-0.5 mb-1",title:S.name,children:S.name})},`label-${y}`)),x.map((S,y)=>{const N=p.find(k=>k.topic===S.name),b=N?.mastery||0,w=t?.topic===S.name&&t?.subject===g.id;return a.jsxs(J.div,{onMouseEnter:()=>N&&n(N),onMouseLeave:()=>n(null),whileHover:{scale:1.05},className:`relative h-10 rounded-lg flex items-center justify-center cursor-pointer transition-all ${qne(b)} ${w?"ring-2 ring-white shadow-lg z-10":""}`,children:[a.jsxs("span",{className:`text-xs font-bold ${Vne(b)}`,children:[b,"%"]}),w&&N&&a.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 bg-slate-800 text-white rounded-lg px-3 py-2 text-xs whitespace-nowrap z-20 shadow-xl pointer-events-none",children:[a.jsx("p",{className:"font-bold mb-0.5",children:N.topic}),a.jsxs("p",{children:["Mastery: ",a.jsxs("strong",{children:[N.mastery,"%"]})]}),a.jsxs("p",{children:["Students: ",a.jsx("strong",{children:N.students})]}),a.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-full w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[6px] border-t-slate-800"})]})]},`cell-${y}`)})]})]},g.id)})}),a.jsxs("div",{className:"flex items-center justify-center gap-4 mt-5 pt-4 border-t border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#5a6578]",children:[a.jsx(Yr,{size:10}),a.jsx("span",{children:"Color scale:"})]}),[{label:"0-19%",color:"bg-red-600"},{label:"20-39%",color:"bg-red-400"},{label:"40-54%",color:"bg-orange-400"},{label:"55-69%",color:"bg-rose-300"},{label:"70-84%",color:"bg-emerald-300"},{label:"85-100%",color:"bg-emerald-500"}].map((g,x)=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`w-3 h-3 rounded-sm ${g.color}`}),a.jsx("span",{className:"text-[10px] text-[#5a6578]",children:g.label})]},x))]})]})},Gne=[{id:"gen-math",title:"General Mathematics",icon:De,bg:"bg-[#9956DE]",tags:["Algebra","Fractions","Integers"],level:1,progress:25,isAtRisk:!0},{id:"pre-calc",title:"Pre-Calculus",icon:De,bg:"bg-[#1FA7E1]",tags:["Functions","Limits","Graphs"],level:2,progress:15,isAtRisk:!0},{id:"stats-prob",title:"Statistics & Probability",icon:De,bg:"bg-[#FFB356]",tags:["Probability","Mean/Median"],level:2,progress:40,isAtRisk:!1},{id:"basic-calc",title:"Basic Calculus",icon:De,bg:"bg-[#FB96BB]",tags:["Derivatives","Integrals"],level:3,progress:50,isAtRisk:!1},{id:"adv-math",title:"Advanced Algebra",icon:De,bg:"bg-[#7274ED]",tags:["Math","Logic"],level:4,progress:10,isAtRisk:!0}].slice(0,5),Wne=()=>{const e=v.useRef(null),[t,n]=v.useState(0),r=()=>{if(!e.current)return;const{scrollLeft:i,scrollWidth:o,clientWidth:l}=e.current,c=i/(o-l),d=3;let f=Math.round(c*(d-1));f<0&&(f=0),f>=d&&(f=d-1),n(f)},s=i=>{if(!e.current)return;const{scrollWidth:o,clientWidth:l}=e.current,d=(o-l)/2*i;e.current.scrollTo({left:d,behavior:"smooth"}),n(i)};return a.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb] mb-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-5",children:a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-1",children:"Priority Attention Modules"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Highly recommended to be reviewed (lowest performance)."})]})}),a.jsx("div",{className:"relative",children:a.jsx("div",{ref:e,onScroll:r,className:"flex overflow-x-auto snap-x snap-mandatory gap-5 pb-6 hide-scrollbar",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:Gne.map(i=>{const o=i.icon;return a.jsxs("div",{className:`snap-center shrink-0 w-[280px] sm:w-[300px] ${i.bg} rounded-[2rem] p-5 min-h-[290px] relative overflow-hidden transition-all duration-300 flex flex-col group shadow-sm`,children:[a.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-32 h-32 bg-white opacity-10 rounded-full"}),a.jsx("div",{className:"absolute bottom-4 right-12 w-20 h-20 bg-white opacity-10 rounded-full"}),a.jsxs("div",{className:"flex justify-between items-start mb-4 relative z-10",children:[a.jsx("div",{className:"w-12 h-12 rounded-[1rem] bg-white/20 flex flex-shrink-0 items-center justify-center text-white backdrop-blur-sm",children:a.jsx(o,{size:24,className:"opacity-90"})}),a.jsxs("div",{className:"px-4 py-1.5 rounded-full bg-white/20 text-white/90 text-sm font-bold backdrop-blur-sm",children:["Lv ",i.level]})]}),a.jsxs("div",{className:"relative z-10 flex-1",children:[a.jsx("h3",{className:"text-2xl font-display font-black text-white leading-[1.1] mb-3 drop-shadow-sm pr-4 line-clamp-2",children:i.title}),a.jsx("div",{className:"flex flex-wrap gap-2 pb-4",children:i.tags.map(l=>a.jsx("span",{className:"px-3 py-1 rounded-full bg-white/20 text-white text-[13px] font-bold shadow-sm backdrop-blur-sm",children:l},l))})]}),a.jsxs("div",{className:"relative z-10 mt-auto pt-4 flex flex-col gap-2.5",children:[a.jsxs("div",{className:"flex justify-between text-white/90 text-[13px] font-bold",children:[a.jsx("div",{className:"flex items-center gap-1.5",children:a.jsx("span",{children:"Avg Mastery"})}),a.jsxs("span",{children:[i.progress,"%"]})]}),a.jsx("div",{className:"w-full h-2 rounded-full bg-white/30 overflow-hidden shadow-inner mt-1",children:a.jsx("div",{className:"h-full bg-white rounded-full",style:{width:`${i.progress}%`}})}),i.isAtRisk&&a.jsxs("div",{className:"absolute -top-12 right-0 bg-red-500 text-white px-3 py-1 rounded-full text-[11px] font-bold flex items-center gap-1 shadow-lg animate-pulse",children:[a.jsx(Gt,{size:12})," At Risk"]})]})]},i.id)})})}),a.jsx("div",{className:"flex justify-center items-center gap-2 mt-2",children:[0,1,2].map(i=>a.jsx("button",{onClick:()=>s(i),className:`w-2.5 h-2.5 rounded-full transition-all duration-300 ${t===i?"bg-sky-600 w-6":"bg-sky-200 hover:bg-sky-300"}`,"aria-label":`Go to slide ${i+1}`},i))}),a.jsx("style",{children:` + .hide-scrollbar::-webkit-scrollbar { + display: none; + } + `})]})},Hne=({onLogout:e,onOpenProfile:t,onOpenSettings:n})=>{const[r,s]=v.useState("Overview"),[i,o]=v.useState(!1),[l,c]=v.useState(!1),[d,f]=v.useState(null),[u,m]=v.useState([]),[h,g]=v.useState([]),[x,p]=v.useState(!0);v.useEffect(()=>{if(r!=="Overview")return;let y=!1;return p(!0),Promise.all([Tne(),vM(),Pne(3)]).then(([N,b,w])=>{y||(f(N),m(b.slice(0,4)),g(w))}).catch(console.error).finally(()=>{y||p(!1)}),()=>{y=!0}},[r]);const j=[{label:"Total Students",value:x?"...":(d?.totalStudents??0).toLocaleString(),icon:kt,color:"bg-sky-100",iconColor:"text-sky-600"},{label:"Active Teachers",value:x?"...":(d?.activeTeachers??0).toString(),icon:fr,color:"bg-teal-100",iconColor:"text-teal-600"},{label:"Total Classes",value:x?"...":(d?.totalClasses??0).toString(),icon:De,color:"bg-sky-100",iconColor:"text-sky-600"},{label:"At-Risk Students",value:x?"...":(d?.atRiskStudents??0).toString(),icon:Xr,color:"bg-red-100",iconColor:"text-red-600"},{label:"Avg Performance",value:x?"...":`${d?.avgPerformance??0}%`,icon:wn,color:"bg-orange-100",iconColor:"text-orange-600"},{label:"AI Interactions",value:x?"...":(d?.aiPredictions??0).toLocaleString(),icon:cn,color:"bg-sky-100",iconColor:"text-sky-600"}],S=y=>y==="Error"||y==="Critical"?{text:"text-red-600",bg:"bg-red-50"}:y==="Warning"?{text:"text-rose-600",bg:"bg-rose-50"}:{text:"text-sky-600",bg:"bg-sky-50"};return a.jsxs("div",{className:"flex h-screen w-full bg-[#edf1f7] overflow-hidden",children:[a.jsx(DC,{activeTab:r,setActiveTab:s,userRole:"admin",onOpenSettings:n,onLogout:()=>o(!0),sidebarCollapsed:l,setSidebarCollapsed:c}),a.jsxs("div",{className:"flex-1 flex flex-col",children:[a.jsxs("header",{className:"bg-white/80 backdrop-blur-md border-b border-[#dde3eb] px-6 py-3 flex items-center justify-between sticky top-0 z-30",children:[a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-xl font-display font-bold text-[#0a1628] leading-tight",children:[r==="Overview"&&"Admin Dashboard",r==="Content"&&"Content",r==="Audit Log"&&"Audit Log",r==="User Management"&&"User Management",r==="Analytics"&&"Analytics",r==="Settings"&&"Settings"]}),a.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:[r==="Overview"&&"System Overview & Management",r==="Content"&&"Manage platform content",r==="Audit Log"&&"Monitor system activity",r==="User Management"&&"Manage all user accounts",r==="Analytics"&&"Detailed performance metrics",r==="Settings"&&"Configure platform settings"]})]})}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("button",{onClick:t,className:"flex items-center gap-2.5 w-[152px] h-11 shrink-0 bg-[#edf1f7] p-1.5 pr-3 rounded-lg cursor-pointer hover:bg-[#dde3eb] transition-all group",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-sky-600 to-indigo-600 rounded-lg flex items-center justify-center",children:a.jsx(na,{size:16,className:"text-white"})}),a.jsx("div",{className:"min-w-0 flex-1 text-left",children:a.jsx("p",{className:"text-sm font-semibold text-[#0a1628] leading-none group-hover:text-sky-600 transition-colors truncate",children:"Admin"})})]})})]}),a.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[r==="Overview"&&a.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[a.jsxs("div",{className:"col-span-8 space-y-6",children:[a.jsx("div",{className:"grid grid-cols-3 gap-4",children:j.map((y,N)=>{const b=y.icon;return a.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb] hover:shadow-md transition-all",children:[a.jsx("div",{className:"flex items-start justify-between mb-3",children:a.jsx("div",{className:`w-12 h-12 ${y.color} rounded-xl flex items-center justify-center`,children:a.jsx(b,{size:24,className:y.iconColor})})}),a.jsx("h3",{className:"text-2xl font-bold text-[#0a1628] mb-1",children:x?a.jsx(He,{size:20,className:"animate-spin text-slate-400"}):y.value}),a.jsx("p",{className:"text-sm text-[#5a6578] font-medium",children:y.label})]},N)})}),a.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsx("div",{className:"flex items-center justify-between mb-6",children:a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-1",children:"System Performance Overview"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Last 30 days"})]})}),a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[a.jsx(wn,{size:32,className:"text-[#dde3eb]"}),a.jsx("p",{className:"text-sm font-medium text-[#5a6578]",children:"No performance data yet"}),a.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Import class records to populate analytics."})]})]}),a.jsx(Wne,{}),a.jsx(Une,{}),a.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-5",children:"Recent System Activity"}),x?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx(He,{className:"animate-spin text-sky-500"})}):u.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[a.jsx(n8,{size:28,className:"text-[#dde3eb]"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"No audit events yet"})]}):a.jsx("div",{className:"space-y-3",children:u.map(y=>{const N=S(y.severity);return a.jsxs("div",{className:`${N.bg} border border-[#dde3eb] rounded-2xl p-4 flex items-start gap-4`,children:[a.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center flex-shrink-0",children:a.jsx(na,{size:18,className:N.text})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-bold text-[#0a1628] mb-0.5",children:y.action}),a.jsx("p",{className:"text-xs text-[#5a6578] truncate",children:y.details}),a.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:[y.timestamp," · ",y.user.name]})]})]},y.id)})})]})]}),a.jsxs("div",{className:"col-span-4 space-y-6",children:[a.jsxs("div",{className:"bg-gradient-to-br from-indigo-600 to-sky-600 rounded-3xl p-6 text-white shadow-lg",children:[a.jsx("h2",{className:"text-lg font-bold mb-4",children:"Quick Actions"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[a.jsx("p",{className:"text-sm font-bold",children:"Add New Teacher"}),a.jsx("p",{className:"text-xs text-sky-100",children:"Create teacher account"})]}),a.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[a.jsx("p",{className:"text-sm font-bold",children:"Add New Student"}),a.jsx("p",{className:"text-xs text-sky-100",children:"Register new student"})]}),a.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[a.jsx("p",{className:"text-sm font-bold",children:"System Settings"}),a.jsx("p",{className:"text-xs text-sky-100",children:"Configure platform"})]}),a.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[a.jsx("p",{className:"text-sm font-bold",children:"Generate Report"}),a.jsx("p",{className:"text-xs text-sky-100",children:"Export analytics"})]})]})]}),a.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[a.jsx("div",{className:"w-10 h-10 bg-rose-100 rounded-xl flex items-center justify-center",children:a.jsx(yt,{size:20,className:"text-rose-600"})}),a.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Top Performers"})]}),x?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx(He,{className:"animate-spin text-sky-500"})}):h.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[a.jsx(yt,{size:28,className:"text-[#dde3eb]"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"No student data yet"}),a.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Students will appear here as they progress."})]}):a.jsx("div",{className:"space-y-3",children:h.map((y,N)=>a.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-2xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:y.avatar,alt:y.name,className:"w-12 h-12 rounded-xl object-cover"}),a.jsx("span",{className:"absolute -top-1 -right-1 w-6 h-6 bg-rose-500 text-white text-xs font-bold rounded-full flex items-center justify-center",children:N+1})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:y.name}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:y.class})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"bg-white rounded-xl p-2",children:[a.jsx("p",{className:"text-[10px] text-[#5a6578] mb-1",children:"Performance"}),a.jsxs("p",{className:"text-lg font-bold text-teal-600",children:[y.performance,"%"]})]}),a.jsxs("div",{className:"bg-white rounded-xl p-2",children:[a.jsx("p",{className:"text-[10px] text-[#5a6578] mb-1",children:"Level"}),a.jsx("p",{className:"text-lg font-bold text-sky-600",children:y.level})]})]})]},y.id))})]}),a.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[a.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-5",children:"AI Model Status"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-[#5a6578]",children:"Prediction Accuracy"}),a.jsx("span",{className:"text-sm font-bold text-[#5a6578]",children:"No data"})]}),a.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-[#dde3eb] rounded-full",style:{width:"0%"}})}),a.jsxs("div",{className:"flex items-center justify-between mt-4",children:[a.jsx("span",{className:"text-sm text-[#5a6578]",children:"Model Performance"}),a.jsx("span",{className:"text-sm font-bold text-[#5a6578]",children:"Untrained"})]}),a.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-[#dde3eb] rounded-full",style:{width:"0%"}})}),a.jsx("div",{className:"mt-4 p-3 bg-sky-50 border border-sky-200 rounded-xl",children:a.jsxs("p",{className:"text-xs text-sky-800",children:[a.jsx("strong",{children:"Status:"})," Import student data to enable AI predictions."]})})]})]})]})]}),r==="Content"&&a.jsx(Ene,{}),r==="Audit Log"&&a.jsx(_ne,{}),r==="User Management"&&a.jsx(Fne,{}),r==="Analytics"&&a.jsx(Bne,{}),r==="Settings"&&a.jsx(Rne,{})]})]}),a.jsx(Ua,{isOpen:i,onClose:()=>o(!1),onConfirm:e,title:"Logout Confirmation",message:"Are you sure you want to log out? This will end your current session.",confirmText:"Logout",cancelText:"Cancel"})]})},Kne="/assets/shader-bg-DA7bEbBA.mp4",p5=(e,t)=>{const n=e instanceof Error?e.message:t;return n.includes("auth/invalid-credential")||n.includes("auth/wrong-password")||n.includes("auth/user-not-found")?"Invalid email or password. Please check your credentials and try again.":n.includes("auth/email-already-in-use")?"This email is already registered. Please sign in instead.":n.includes("auth/weak-password")?"Password is too weak. It should be at least 6 characters.":n.includes("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.":n.includes("auth/network-request-failed")?"Network error. Please check your internet connection and try again.":n.includes("Firebase:")||n.includes("auth/")?t:n},Xne=()=>{const e=["Grade 11","Grade 12"],t={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"],"Grade 12":["STEM A","STEM B","ABM A","HUMSS A"]},n={teacher:["Mathematics","Science","English","Technology","Humanities"]},[r,s]=v.useState(""),[i,o]=v.useState(""),[l,c]=v.useState(!1),[d,f]=v.useState(!1),[u,m]=v.useState(""),[h,g]=v.useState("student"),[x,p]=v.useState("Grade 11"),[j,S]=v.useState(t["Grade 11"][0]),[y,N]=v.useState("Mathematics"),[b,w]=v.useState(!1),[k,A]=v.useState(null),[C,F]=v.useState(!1),D=v.useRef(null);v.useEffect(()=>{D.current&&D.current.play().catch(()=>{})},[]),v.useEffect(()=>{h==="teacher"&&!n.teacher.includes(y)&&N(n.teacher[0])},[y,h]),v.useEffect(()=>{const V=t[x]||[];V.length>0&&!V.includes(j)&&S(V[0])},[x,j]);const L=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:fr,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:De,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:tR,color:"rose"}],P=async(V,O,E)=>{A(null),w(!0),s(V),o(O),g(E),f(!1);try{$v(E),await zv(V,O)}catch(B){A(p5(B,"Demo sign-in failed")),w(!1)}},H=async V=>{V.preventDefault(),A(null),w(!0);try{if(d){if(!u.trim()){A("Please enter your name"),w(!1);return}if(h==="student"&&!x){A("Please select a grade level"),w(!1);return}if(h!=="student"&&!y){A("Please select a department"),w(!1);return}if(h==="admin"){A("Admin account creation is restricted. Please contact an existing administrator."),w(!1);return}$v(h),await CL(r,i,u,h,h==="student"?{grade:x,section:j}:{department:y})}else await zv(r,i)}catch(O){A(p5(O,"Authentication failed")),w(!1)}},Y=["∫","π","∑","Δ","∞","φ","√","λ","θ","∂"];return a.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative",style:{background:"linear-gradient(135deg, #f0f9ff 0%, #f8fafc 30%, #fff1f2 60%, #f0f9ff 100%)"},children:[a.jsx("video",{ref:D,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,onCanPlay:()=>F(!0),className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-1000 ${C?"opacity-40":"opacity-0"}`,src:Kne}),a.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 50%, rgba(240,249,255,0.2) 0%, rgba(248,250,252,0.5) 50%, rgba(255,241,242,0.4) 80%, rgba(248,250,252,0.85) 100%)"}}),a.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(168,85,247,0.3) 0%, transparent 70%)"}}),a.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(236,72,153,0.25) 0%, transparent 70%)"}}),a.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen",style:{background:"radial-gradient(circle, rgba(56,189,248,0.2) 0%, transparent 70%)"}}),a.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, rgba(15,23,42,0.4) 1px, transparent 1px)",backgroundSize:"24px 24px"}}),Y.map((V,O)=>a.jsx(J.span,{className:"absolute text-sky-700/[0.08] font-display select-none pointer-events-none",style:{fontSize:`${20+Math.random()*40}px`,left:`${5+O*9.5}%`,top:`${10+O*8}%`},animate:{y:[0,-30,0],opacity:[.04,.1,.04],rotate:[0,10,0]},transition:{duration:8+O*2,repeat:1/0,ease:"easeInOut",delay:O*.5},children:V},O)),a.jsx("div",{className:"absolute top-0 left-1/4 w-px h-full bg-gradient-to-b from-transparent via-sky-400/15 to-transparent"}),a.jsx("div",{className:"absolute top-0 right-1/3 w-px h-full bg-gradient-to-b from-transparent via-rose-300/10 to-transparent"}),a.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[a.jsxs(J.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col justify-center space-y-8",children:[a.jsxs(J.div,{className:"flex items-center gap-2.5",children:[a.jsx(J.div,{className:"relative flex items-center justify-center drop-shadow-md",children:a.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI Logo",className:"w-16 h-16 object-contain flex-shrink-0"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[a.jsx(ra,{size:12,className:"text-rose-500"}),a.jsx("span",{className:"text-xs text-slate-500 font-body font-medium tracking-wide",children:"Powered by Machine Learning"})]})]})]}),a.jsxs(J.div,{className:"space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[a.jsxs("h2",{className:"text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",a.jsx("br",{}),a.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),a.jsx("p",{className:"text-base text-slate-500 leading-relaxed max-w-md font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),a.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{icon:lr,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:ot,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:yt,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((V,O)=>{const E=V.icon,B={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"},T={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},M={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return a.jsxs(J.div,{className:`bg-white/80 backdrop-blur-xl border ${B[V.color]} rounded-xl p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+O*.1},whileHover:{scale:1.03,y:-4},children:[a.jsx("div",{className:`w-9 h-9 rounded-lg ${M[V.color]} flex items-center justify-center mb-3`,children:a.jsx(E,{size:18,className:T[V.color]})}),a.jsx("h3",{className:"text-sm font-display font-semibold text-slate-800 mb-0.5",children:V.label}),a.jsx("p",{className:"text-xs text-slate-400 font-body",children:V.desc})]},O)})})]}),a.jsx(J.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:a.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)]",children:[a.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"}),a.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"}),a.jsxs("div",{className:"text-center mb-6 relative",children:[a.jsx(J.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:d?"Create Account":"Welcome Back"}),a.jsx(J.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:d?"Begin your learning journey":"Sign in to continue learning"})]}),a.jsxs("form",{onSubmit:H,className:"space-y-4 mb-5 relative",children:[k&&a.jsx(J.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:k}),d&&a.jsxs(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Full Name"}),a.jsxs("div",{className:"relative",children:[a.jsx(kt,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),a.jsx(ve,{type:"text",placeholder:"Your Name",value:u,onChange:V=>m(V.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})]})]}),d&&a.jsxs(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(V=>{const O=h===V.role;return a.jsx("button",{type:"button",onClick:()=>g(V.role),className:`rounded-lg border px-3 py-2 text-xs font-body font-semibold transition-all ${O?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:V.label},V.role)})})]}),d&&h==="student"&&a.jsxs(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Grade Level"}),a.jsxs("div",{className:"relative",children:[a.jsx(fr,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),a.jsx("select",{value:x,onChange:V=>p(V.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:e.map(V=>a.jsx("option",{value:V,children:V},V))})]})]}),d&&h==="student"&&a.jsxs(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),a.jsxs("div",{className:"relative",children:[a.jsx(kt,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),a.jsx("select",{value:j,onChange:V=>S(V.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(t[x]||[]).map(V=>a.jsx("option",{value:V,children:V},V))})]})]}),d&&h!=="student"&&a.jsxs(J.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Department"}),a.jsxs("div",{className:"relative",children:[a.jsx(De,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),a.jsx("select",{value:y,onChange:V=>N(V.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:n.teacher.map(V=>a.jsx("option",{value:V,children:V},V))})]})]}),a.jsxs(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.5},children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Email Address"}),a.jsxs("div",{className:"relative",children:[a.jsx(hC,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),a.jsx(ve,{type:"email",placeholder:"your.email@school.edu",value:r,onChange:V=>s(V.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})]})]}),a.jsxs(J.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6},children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(_s,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),a.jsx(ve,{type:l?"text":"password",placeholder:"••••••••",value:i,onChange:V=>o(V.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:6}),a.jsx(J.button,{type:"button",onClick:()=>c(!l),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:l?a.jsx(dC,{size:16}):a.jsx(Bi,{size:16})})]})]}),a.jsx(J.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:a.jsxs(pe,{type:"submit",disabled:b,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:[a.jsx(J.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}}),a.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[b?"Please wait...":d?"Create Account":"Sign In",a.jsx(Ba,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),a.jsx("div",{className:"text-center",children:a.jsx("button",{type:"button",onClick:()=>{f(!d),A(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:d?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!d&&a.jsxs(J.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.85},className:"mb-4 relative",children:[a.jsxs("div",{className:"relative flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"flex-1 h-px bg-slate-200"}),a.jsx("span",{className:"text-[10px] font-body font-semibold text-slate-400 uppercase tracking-widest",children:"Quick Demo Access"}),a.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),a.jsx("div",{className:"flex flex-col gap-2",children:L.map(V=>{const O=V.icon,E={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},B={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return a.jsxs(J.button,{type:"button",onClick:()=>P(V.email,V.password,V.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:[a.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${E[V.color]}`,children:a.jsx(O,{size:15,className:B[V.color]})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[V.label," Account"]}),a.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:V.email})]}),a.jsx(Ba,{size:14,className:"text-slate-300 group-hover:text-sky-500 group-hover:translate-x-0.5 transition-all shrink-0"})]},V.label)})})]}),a.jsxs(J.p,{className:"text-xs text-slate-400 text-center mt-4 font-body relative",initial:{opacity:0},animate:{opacity:1},transition:{delay:1},children:[a.jsx(_s,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})},Yne=async e=>{try{const t=Me(fe,"users",e),n=await Lt(t);if(!n.exists())throw new Error("User not found");const r=n.data(),s=r.lastActivityDate?.toDate(),i=new Date;i.setHours(0,0,0,0);let o=r.streak||0;if(!s)o=1;else{const d=new Date(s);d.setHours(0,0,0,0);const f=Math.floor((i.getTime()-d.getTime())/(1e3*60*60*24));if(f===0)o=r.streak||1;else if(f===1){o=(r.streak||0)+1;const u=Math.min(o*5,50);await kM(e,u,"streak_bonus",`${o} day streak bonus!`)}else o=1}const l=new Date,c=`${l.getFullYear()}-${String(l.getMonth()+1).padStart(2,"0")}-${String(l.getDate()).padStart(2,"0")}`;return await vt(t,{streak:o,streakHistory:a6(c),lastActivityDate:ke(),updatedAt:ke()}),o}catch(t){return console.error("Error updating streak:",t),0}},kM=async(e,t,n,r)=>{try{const s=Me(fe,"users",e),i=await Lt(s);if(!i.exists())throw new Error("User not found");const o=i.data(),l=o.currentXP||0,c=o.totalXP||0,d=l+t,f=c+t,u=o.level||1;console.log(`🏆 XP Award - User: ${e}, Amount: ${t}, Previous currentXP: ${l}, New: ${d}, Type: ${n}`);let m=u,h=f,g=!1;for(;;){const j=Math.floor(100*Math.pow(1.5,m-1));let S=0;for(let y=1;y<=m;y++)S+=Math.floor(100*Math.pow(1.5,y-1));if(f>=S)m++,g=!0;else break}const x={currentXP:d,totalXP:f,level:m,updatedAt:ke()};await vt(s,x),console.log(`💾 Firebase Update - currentXP: ${l} -> ${d}, totalXP: ${c} -> ${f}, level: ${m}`);const p=Me(_e(fe,"xpActivities"));return await rt(p,{activityId:p.id,userId:e,type:n,xpEarned:t,description:r,timestamp:ke()}),{newLevel:m,leveledUp:g,xp:d,addedXp:t}}catch(s){throw console.error("Error awarding XP:",s),s}},AM=async(e,t=!1,n="all",r=10)=>{try{const s=at(_e(fe,"users"),Je("role","==","student"),Zn("totalXP","desc"),Er(r));return(await Ye(s)).docs.map((o,l)=>{const c=o.data();return{userId:o.id,name:c.name||"Unknown",photo:c.photo,xp:c.totalXP||0,level:c.level||1,rank:l+1,weeklyXP:c.weeklyXP||0,monthlyXP:c.monthlyXP||0}})}catch(s){return console.error("Error getting leaderboard:",s),[]}},Qne=async e=>{try{const t=await Lt(Me(fe,"users",e));if(!t.exists())return 0;const n=t.data().totalXP||0,r=at(_e(fe,"users"),Je("role","==","student"),Je("totalXP",">",n));return(await Ye(r)).size+1}catch(t){return console.error("Error getting user rank:",t),0}},Zne=async e=>{try{const t=await Lt(Me(fe,"achievements",e));return t.exists()?t.data().achievements||[]:[]}catch(t){return console.error("Error getting user achievements:",t),[]}},Jne=[{id:"top_blue",name:"Blue Uniform",category:"top",src:"/avatar/uniform_blue.png",thumbnail:"/avatar/uniform_blue_thumbnail.png",price:0},{id:"top_pink",name:"Pink Uniform",category:"top",src:"/avatar/uniform_pink.png",thumbnail:"/avatar/uniform_pink_thumbnail.png",price:200},{id:"bot_black",name:"Black Pants",category:"bottom",src:"/avatar/pants_black.png",thumbnail:"/avatar/pants_black_thumbnail.png",price:0},{id:"shoe_black",name:"Black Shoes",category:"shoes",src:"/avatar/shoes_black.png",thumbnail:"/avatar/shoes_black_thumbnail.png",price:0},{id:"acc_leaf_clip",name:"Leaf Clip",category:"accessory",src:"/avatar/leaf_clip.png",thumbnail:"/avatar/leaf_clip_thumbnail.png",price:0},{id:"acc_blue_cap",name:"Blue Cap",category:"accessory",src:"/avatar/blue_cap.png",thumbnail:"/avatar/blue_cap_thumbnail.png",price:250},{id:"acc_red_cap",name:"Red Cap",category:"accessory",src:"/avatar/red_cap.png",thumbnail:"/avatar/red_cap_thumbnail.png",price:250},{id:"acc_traffic_cone",name:"Traffic Cone",category:"accessory",src:"/avatar/traffic_cone.png",thumbnail:"/avatar/traffic_cone_thumbnail.png",price:500},{id:"acc_crown",name:"Crown",category:"accessory",src:"/avatar/crown.png",thumbnail:"/avatar/crown_thumbnail.png",price:1e3}],El=e=>{if(e)return Jne.find(t=>t.id===e)?.src},ere=({layers:e,className:t="w-10 h-10 bg-slate-200 rounded-full",fallbackSrc:n})=>{const r=El(e?.top),s=El(e?.bottom),i=El(e?.shoes),o=El(e?.accessory),l=a.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"base body",className:"absolute inset-0 w-full h-full object-contain z-10"}),c=a.jsxs(J.div,{className:"absolute inset-0 w-full h-full z-50 pointer-events-none",animate:{rotate:[-2,2,-2],y:[0,-3,0]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},style:{originY:.7,originX:.5},children:[a.jsx(J.img,{src:"/avatar/left_horn.png",alt:"left horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[-4,4,-4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),a.jsx(J.img,{src:"/avatar/right_horn.png",alt:"right horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[4,-4,4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),a.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"head base",className:"absolute inset-0 w-full h-full object-contain z-10"}),a.jsx(J.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:"absolute inset-0 w-full h-full object-contain z-10",style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),o&&a.jsx("img",{src:o,alt:"accessory",className:"absolute inset-0 w-full h-full object-contain z-20"})]});return!e||!e.top&&!e.bottom&&!e.shoes&&!e.accessory?a.jsxs("div",{className:`relative overflow-hidden ${t}`,children:[l,c]}):a.jsxs("div",{className:`relative overflow-hidden ${t}`,children:[l,s&&a.jsx("img",{src:s,alt:"bottom",className:"absolute inset-0 w-full h-full object-contain z-20"}),i&&a.jsx("img",{src:i,alt:"shoes",className:"absolute inset-0 w-full h-full object-contain z-30"}),r&&a.jsx("img",{src:r,alt:"top",className:"absolute inset-0 w-full h-full object-contain z-40"}),c]})},$p=({isOpen:e,onClose:t,profileData:n,onSave:r})=>{const[s,i]=v.useState(n),[o,l]=v.useState(!1),[c,d]=v.useState(!1),[f,u]=v.useState([]),[m,h]=v.useState(0);v.useEffect(()=>{if(!e)return;const y=N=>{N.key==="Escape"&&t()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[e,t]),v.useEffect(()=>{if(!e||s.role!=="student"||!s.uid)return;const y=s.uid;(async()=>{d(!0);try{const[b,w]=await Promise.all([AM(void 0,!1,"all",5),Qne(y)]);u(b),h(w)}catch(b){console.error("Failed to load leaderboard for profile modal:",b),u([]),h(0)}finally{d(!1)}})()},[e,s.role,s.uid]);const g=()=>{const y=["https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?w=200&h=200&fit=crop"],N=y[Math.floor(Math.random()*y.length)];i({...s,photo:N})},x=()=>{r(s),l(!1)},p=()=>{i(n),l(!1)},j=y=>{switch(y){case"student":return"bg-sky-100 text-sky-700 border-sky-200";case"teacher":return"bg-rose-100 text-rose-700 border-rose-200";case"admin":return"bg-rose-100 text-rose-700 border-rose-200";default:return"bg-zinc-100 text-zinc-700 border-zinc-200"}},S=f.find(y=>y.userId===s.uid);return a.jsx(Ke,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50"}),a.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},className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:y=>y.stopPropagation(),children:a.jsxs("div",{className:"bg-[#f7f9fc] rounded-2xl shadow-2xl w-full max-w-3xl max-h-[90vh] overflow-hidden border border-[#dde3eb]",children:[a.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-6 relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-white/30 to-transparent"}),a.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full -mr-24 -mt-24"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-36 h-36 bg-white/5 rounded-full -ml-18 -mb-18"}),a.jsxs("div",{className:"relative z-10 flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-xl font-display font-bold text-white mb-1",children:"Profile Settings"}),a.jsx("p",{className:"text-zinc-400 text-sm font-body",children:"Manage your account information"})]}),a.jsx("button",{onClick:t,className:"text-zinc-500 hover:text-sky-700 hover:bg-slate-100 p-2 rounded-lg transition-all",children:a.jsx(Xe,{size:20})})]})]}),a.jsxs("div",{className:"overflow-y-auto max-h-[calc(90vh-200px)] p-6 scrollbar-thin scrollbar-thumb-[#d1cec6] scrollbar-track-[#edf1f7]",children:[a.jsxs("div",{className:"flex flex-col items-center mb-8",children:[a.jsxs("div",{className:"relative group",children:[a.jsx(ere,{layers:s.avatarLayers,className:"w-28 h-28 rounded-xl bg-[#0B1021] shadow-lg border-2 border-[#dde3eb] ring-4 ring-sky-100",fallbackSrc:s.photo}),o&&a.jsx("button",{onClick:g,className:"absolute inset-0 bg-black/60 rounded-xl flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-50",children:a.jsxs("div",{className:"text-center text-white",children:[a.jsx(g8,{size:32,className:"mx-auto mb-1"}),a.jsx("span",{className:"text-xs font-bold",children:"Change Photo"})]})})]}),a.jsxs("div",{className:"mt-4 text-center",children:[a.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:s.name}),a.jsx("span",{className:`inline-block mt-2 px-3 py-1 rounded-full text-xs font-body font-semibold border ${j(s.role)}`,children:s.role.charAt(0).toUpperCase()+s.role.slice(1)})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[a.jsx("div",{className:"w-1 h-4 bg-sky-600 rounded-full"}),"Basic Information"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Full Name"}),a.jsxs("div",{className:"relative",children:[a.jsx(kt,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.name,onChange:y=>i({...s,name:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Email Address"}),a.jsxs("div",{className:"relative",children:[a.jsx(hC,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{type:"email",value:s.email,onChange:y=>i({...s,email:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Phone Number"}),a.jsxs("div",{className:"relative",children:[a.jsx(RD,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.phone,onChange:y=>i({...s,phone:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:s.role==="student"?"School":s.role==="teacher"?"Department":"Office Location"}),a.jsxs("div",{className:"relative",children:[a.jsx(u8,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.school||s.department||s.office||"",onChange:y=>{s.role==="student"?i({...s,school:y.target.value}):s.role==="teacher"?i({...s,department:y.target.value}):i({...s,office:y.target.value})},disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),s.role==="student"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[a.jsx("div",{className:"w-1 h-4 bg-teal-600 rounded-full"}),"Academic Information"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Learner's Reference Number (LRN)"}),a.jsxs("div",{className:"relative",children:[a.jsx(yt,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.lrn||"",onChange:y=>i({...s,lrn:y.target.value}),disabled:!o,className:"pl-10 bg-[#edf1f7] border-[#dde3eb] rounded-xl disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Grade Level"}),a.jsxs("div",{className:"relative",children:[a.jsx(De,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.grade||"",onChange:y=>i({...s,grade:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Section"}),a.jsxs("div",{className:"relative",children:[a.jsx(kt,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.section||"",onChange:y=>i({...s,section:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),a.jsxs("div",{children:[a.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[a.jsx("div",{className:"w-1 h-4 bg-rose-600 rounded-full"}),"Leaderboard Overview"]}),c?a.jsx("div",{className:"rounded-lg border border-[#dde3eb] bg-white p-4 text-sm font-body text-[#5a6578]",children:"Loading leaderboard data..."}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[a.jsxs("div",{className:"rounded-lg border border-rose-200 bg-rose-50 p-3",children:[a.jsx("p",{className:"text-xs font-body font-semibold text-rose-700 uppercase tracking-wider",children:"Your Rank"}),a.jsx("p",{className:"text-2xl font-display font-bold text-rose-800 mt-1",children:m>0?`#${m}`:"Unranked"})]}),a.jsxs("div",{className:"rounded-lg border border-sky-200 bg-sky-50 p-3",children:[a.jsx("p",{className:"text-xs font-body font-semibold text-sky-700 uppercase tracking-wider",children:"Total XP"}),a.jsx("p",{className:"text-2xl font-display font-bold text-sky-800 mt-1",children:S?.xp??0})]}),a.jsxs("div",{className:"rounded-lg border border-emerald-200 bg-emerald-50 p-3",children:[a.jsx("p",{className:"text-xs font-body font-semibold text-emerald-700 uppercase tracking-wider",children:"Level"}),a.jsx("p",{className:"text-2xl font-display font-bold text-emerald-800 mt-1",children:S?.level??"-"})]})]}),a.jsxs("div",{className:"rounded-lg border border-[#dde3eb] bg-white overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2 border-b border-[#dde3eb] bg-[#f7f9fc]",children:a.jsx("p",{className:"text-xs font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Top Students"})}),a.jsx("div",{className:"divide-y divide-[#edf1f7]",children:f.length>0?f.map(y=>a.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsx("div",{className:"w-7 h-7 rounded-full bg-[#edf1f7] text-[#0a1628] text-xs font-display font-bold flex items-center justify-center",children:y.rank}),a.jsxs("p",{className:"text-sm font-body font-semibold text-[#0a1628] truncate",children:[y.name,y.userId===s.uid?" (You)":""]})]}),a.jsxs("div",{className:"text-right",children:[a.jsxs("p",{className:"text-sm font-body font-semibold text-[#0a1628]",children:[y.xp," XP"]}),a.jsxs("p",{className:"text-xs font-body text-[#5a6578]",children:["Lv ",y.level]})]})]},y.userId)):a.jsx("div",{className:"px-4 py-6 text-center text-sm font-body text-[#5a6578]",children:"No leaderboard data available yet."})})]})]})]})]}),s.role==="teacher"&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[a.jsx("div",{className:"w-1 h-4 bg-rose-500 rounded-full"}),"Teaching Information"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Teacher ID"}),a.jsxs("div",{className:"relative",children:[a.jsx(yt,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.teacherId||"",onChange:y=>i({...s,teacherId:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Subject/Specialization"}),a.jsxs("div",{className:"relative",children:[a.jsx(De,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.subject||"",onChange:y=>i({...s,subject:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Years of Experience"}),a.jsxs("div",{className:"relative",children:[a.jsx(ta,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.yearsOfExperience||"",onChange:y=>i({...s,yearsOfExperience:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Qualification"}),a.jsxs("div",{className:"relative",children:[a.jsx(yt,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.qualification||"",onChange:y=>i({...s,qualification:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),s.role==="admin"&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[a.jsx("div",{className:"w-1 h-4 bg-rose-600 rounded-full"}),"Administrative Information"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Admin ID"}),a.jsxs("div",{className:"relative",children:[a.jsx(yt,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.adminId||"",onChange:y=>i({...s,adminId:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Position/Title"}),a.jsxs("div",{className:"relative",children:[a.jsx(kt,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.position||"",onChange:y=>i({...s,position:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Access Level/Permissions"}),a.jsxs("div",{className:"relative",children:[a.jsx(y0,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),a.jsx(ve,{value:s.permissions||"",onChange:y=>i({...s,permissions:y.target.value}),disabled:!o,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]})]})]}),a.jsx("div",{className:"border-t border-[#dde3eb] p-5 bg-[#edf1f7]",children:a.jsx("div",{className:"flex gap-3 justify-end",children:o?a.jsxs(a.Fragment,{children:[a.jsx(pe,{onClick:p,variant:"outline",className:"px-5 py-2 rounded-lg border-[#d1cec6] hover:bg-white font-body font-medium text-[#5a6578]",children:"Cancel"}),a.jsxs(pe,{onClick:x,className:"px-5 py-2 rounded-lg bg-sky-600 hover:bg-sky-700 text-white font-body font-semibold flex items-center gap-2",children:[a.jsx(id,{size:16}),"Save Changes"]})]}):a.jsxs(a.Fragment,{children:[a.jsx(pe,{onClick:t,variant:"outline",className:"px-5 py-2 rounded-lg border-[#d1cec6] hover:bg-white font-body font-medium text-[#5a6578]",children:"Close"}),a.jsx(pe,{onClick:()=>l(!0),className:"px-5 py-2 rounded-lg bg-sky-600 hover:bg-sky-700 text-white font-body font-semibold",children:"Edit Profile"})]})})})]})})]})})},tre=({userRole:e="student"})=>{const{currentUser:t}=$t(),[n,r]=v.useState(!1),[s,i]=v.useState([]),[o,l]=v.useState(!1);v.useEffect(()=>{(async()=>{if(t){l(!0);try{const x=(await t$(t.uid,20)).map(p=>{let j="info";p.type==="achievement"?j="achievement":p.type==="risk_alert"||p.type==="reminder"?j="alert":p.type==="message"?j="message":j="info";const S=p.createdAt instanceof Date?p.createdAt:new Date(p.createdAt),y=Date.now()-S.getTime(),N=Math.floor(y/6e4);let b;return N<1?b="Just now":N<60?b=`${N} min ago`:N<1440?b=`${Math.floor(N/60)} hours ago`:b=`${Math.floor(N/1440)} days ago`,{id:p.id,type:j,title:p.title,message:p.message,time:b,read:p.read}});i(x)}catch(g){console.error("Error loading notifications:",g)}finally{l(!1)}}})()},[t]);const c=s.filter(h=>!h.read).length,d=()=>{i(s.map(h=>({...h,read:!0}))),t&&GC(t.uid).catch(h=>console.error("Error marking all as read:",h))},f=h=>{i(s.map(g=>g.id===h?{...g,read:!0}:g)),UC(h).catch(g=>console.error("Error marking as read:",g))},u=h=>{switch(h){case"achievement":return Jt;case"alert":return Xr;case"message":return v0;case"info":return De;default:return Ar}},m=h=>{switch(h){case"achievement":return"bg-rose-500/10 text-rose-600";case"alert":return"bg-red-500/10 text-red-600";case"message":return"bg-sky-500/10 text-sky-600";case"info":return"bg-emerald-500/10 text-emerald-600";default:return"bg-[#edf1f7] text-[#5a6578]"}};return a.jsxs("div",{className:"relative",children:[a.jsxs(J.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>r(!n),className:"relative p-3 bg-[#edf1f7] rounded-xl text-[#5a6578] hover:bg-[#dde3eb] transition-colors",children:[a.jsx(Ar,{size:20}),c>0&&a.jsx(J.span,{initial:{scale:0},animate:{scale:1},className:"absolute -top-1 -right-1 w-5 h-5 bg-sky-600 text-white text-xs font-bold rounded-full flex items-center justify-center",children:c})]}),a.jsx(Ke,{children:n&&a.jsxs("div",{children:[a.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),a.jsxs(J.div,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.2},className:"absolute right-0 top-full mt-2 w-96 bg-[#f7f9fc] rounded-xl shadow-2xl border border-[#dde3eb] z-50 overflow-hidden",children:[a.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-gradient-to-r from-sky-600 to-sky-500",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-display font-bold text-white",children:"Notifications"}),a.jsx("p",{className:"text-xs text-sky-100 mt-0.5",children:c>0?`${c} unread`:"All caught up!"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[c>0&&a.jsx(J.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:d,className:"text-xs text-sky-400 hover:text-sky-300 font-bold",children:a.jsx(oC,{size:18})}),a.jsx(J.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>r(!1),className:"text-slate-500 hover:text-sky-700",children:a.jsx(Xe,{size:18})})]})]}),a.jsx("div",{className:"max-h-96 overflow-y-auto",children:s.length===0?a.jsxs("div",{className:"p-8 text-center",children:[a.jsx(Ar,{size:48,className:"text-[#d1cec6] mx-auto mb-3"}),a.jsx("p",{className:"text-[#5a6578] text-sm font-body",children:"No notifications yet"})]}):a.jsx("div",{children:s.map(h=>{const g=u(h.type);return a.jsx(J.div,{whileHover:{backgroundColor:"rgba(241, 245, 249, 0.5)"},onClick:()=>f(h.id),className:`p-4 border-b border-[#dde3eb] cursor-pointer transition-colors ${h.read?"":"bg-sky-50/40"}`,children:a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${m(h.type)}`,children:a.jsx(g,{size:18})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] line-clamp-1 font-body",children:h.title}),!h.read&&a.jsx("span",{className:"w-2 h-2 bg-sky-600 rounded-full flex-shrink-0 mt-1.5"})]}),a.jsx("p",{className:"text-xs text-[#5a6578] mb-2 line-clamp-2 font-body",children:h.message}),a.jsx("p",{className:"text-xs text-slate-500",children:h.time})]})]})},h.id)})})}),s.length>0&&a.jsx("div",{className:"p-3 border-t border-[#dde3eb] text-center bg-[#edf1f7]",children:a.jsx("button",{className:"text-xs text-sky-600 hover:text-sky-700 font-bold font-body",children:"View All Notifications"})})]})]},"notification-panel")})]})},nre=({placeholder:e="Search anything...",userRole:t="student",onSelect:n})=>{const[r,s]=v.useState(""),[i,o]=v.useState(!1),[l,c]=v.useState([]),d=v.useRef(null),f=()=>t==="student"?[{id:"1",type:"module",title:"General Mathematics",subtitle:"Grade 11 • Functions & Business Math",icon:De},{id:"2",type:"module",title:"Statistics & Probability",subtitle:"Grade 11 • Distributions & Testing",icon:De},{id:"3",type:"module",title:"Pre-Calculus",subtitle:"Grade 12 • Analytic Geometry & Trig",icon:De},{id:"4",type:"module",title:"Basic Calculus",subtitle:"Grade 12 • Limits & Derivatives",icon:De},{id:"5",type:"page",title:"AI Chat",subtitle:"Get help from AI tutor",icon:ot},{id:"6",type:"page",title:"My Progress",subtitle:"View your achievements",icon:ot}]:t==="teacher"?[{id:"1",type:"student",title:"Alex Johnson",subtitle:"Grade 11 • Level 12",icon:kt},{id:"2",type:"student",title:"Sarah Williams",subtitle:"Grade 12 • Level 11",icon:kt},{id:"3",type:"module",title:"Gen Math Quiz 5",subtitle:"12 submissions",icon:De},{id:"4",type:"page",title:"Analytics",subtitle:"Class performance overview",icon:ot},{id:"5",type:"page",title:"Create Assignment",subtitle:"New homework or quiz",icon:De}]:[{id:"1",type:"teacher",title:"Prof. Anderson",subtitle:"48 students • Math Dept",icon:fr},{id:"2",type:"student",title:"Alex Johnson",subtitle:"Top Performer • Level 12",icon:kt},{id:"3",type:"page",title:"System Settings",subtitle:"Platform configuration",icon:ot},{id:"4",type:"page",title:"Reports",subtitle:"Export analytics",icon:De},{id:"5",type:"page",title:"User Management",subtitle:"Manage accounts",icon:kt}],u=["Functions and Relations","Normal Distribution","AI Chat"];v.useEffect(()=>{if(r.trim()){const x=f().filter(p=>p.title.toLowerCase().includes(r.toLowerCase())||p.subtitle?.toLowerCase().includes(r.toLowerCase()));c(x)}else c([])},[r]);const m=g=>{s(""),o(!1),n?.(g)},h=()=>{s(""),d.current?.focus()};return v.useEffect(()=>{const g=x=>{x.ctrlKey&&x.key.toLowerCase()==="k"&&(x.preventDefault(),d.current?.focus(),o(!0))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]),a.jsxs("div",{className:"relative w-full max-w-xl",children:[a.jsxs("div",{className:"relative",children:[a.jsx(_n,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-500",size:18}),a.jsx("input",{ref:d,id:"global-search",name:"global-search","aria-label":"Search anything",type:"text",value:r,onChange:g=>s(g.target.value),onFocus:()=>o(!0),placeholder:e,className:"w-full pl-11 pr-24 py-2.5 bg-white border border-[#dde3eb] rounded-lg text-[#0a1628] placeholder-[#a8a5b3] font-body text-sm focus:bg-white focus:border-sky-400 focus:ring-2 focus:ring-sky-400/15 focus:outline-none transition-all"}),a.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[r&&a.jsx(J.button,{initial:{scale:0},animate:{scale:1},exit:{scale:0},whileHover:{scale:1.1},whileTap:{scale:.9},onClick:h,className:"p-1.5 text-slate-500 hover:text-[#5a6578] hover:bg-[#edf1f7] rounded-md transition-colors",children:a.jsx(Xe,{size:14})}),a.jsx("kbd",{className:"hidden sm:inline-flex px-2 py-0.5 text-[10px] font-body font-semibold text-slate-500 bg-[#edf1f7] border border-[#dde3eb] rounded-md",children:"Ctrl+K"})]})]}),a.jsx(Ke,{children:i&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>o(!1)}),a.jsx(J.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute top-full left-0 right-0 mt-2 bg-white rounded-xl shadow-lg border border-[#dde3eb] z-50 overflow-hidden max-h-96 overflow-y-auto",children:r.trim()?l.length>0?a.jsxs("div",{className:"p-2",children:[a.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Results"}),l.map(g=>{const x=g.icon||_n;return a.jsxs(J.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>m(g),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[a.jsx("div",{className:"w-9 h-9 bg-sky-500/10 rounded-lg flex items-center justify-center text-sky-600 flex-shrink-0",children:a.jsx(x,{size:16})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h4",{className:"text-sm font-body font-semibold text-[#0a1628] truncate",children:g.title}),g.subtitle&&a.jsx("p",{className:"text-xs font-body text-[#5a6578] truncate",children:g.subtitle})]})]},g.id)})]}):a.jsxs("div",{className:"p-8 text-center",children:[a.jsx(_n,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),a.jsx("p",{className:"text-[#5a6578] font-body text-sm",children:"No results found"}),a.jsx("p",{className:"text-slate-500 font-body text-xs mt-1",children:"Try a different search term"})]}):a.jsxs("div",{className:"p-2",children:[a.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Recent Searches"}),u.map((g,x)=>a.jsxs(J.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>s(g),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[a.jsx(On,{size:16,className:"text-slate-500 flex-shrink-0"}),a.jsx("span",{className:"text-sm font-body text-[#0a1628]",children:g})]},x))]})})]})})]})},rre=()=>{const{currentUser:e,userProfile:t}=$t(),[n,r]=v.useState("all"),[s,i]=v.useState("all"),[o,l]=v.useState(!0),[c,d]=v.useState(null),f=t?.grade,u=ld(f),m=new Set(u);v.useEffect(()=>{(async()=>{if(e){l(!0);try{const H=await Is(e.uid);d(H)}catch(H){console.error("Error loading grades:",H)}finally{l(!1)}}})()},[e]);const h=c?.quizAttempts||[],g=c?.totalQuizzesCompleted||0,x=c?.averageScore||0,p=x>0?Math.min(x/25,4).toFixed(2):"0.00",j={"gen-math":"blue","stats-prob":"cyan","pre-calc":"teal","basic-calc":"orange"},S=Va.reduce((P,H)=>(P[H.id]={label:H.name,color:j[H.id]||"slate"},P),{}),y=Va.filter(P=>m.has(P.id)).map(P=>P.name),N=Object.entries(c?.subjects||{}).filter(([P])=>m.has(P)).map(([P,H])=>{const Y=S[P]||{label:P,color:"slate"},V=h.filter(E=>E.quizId?.startsWith(P)),O=V.length>0?Math.round(V.reduce((E,B)=>E+B.score,0)/V.length):Math.round(H.progress);return{subject:Y.label,average:O,quizzes:V.length||H.completedModules,color:Y.color,trend:"up"}}),b=u.map(P=>{const H=S[P]||{label:P,color:"slate"};return{subject:H.label,average:0,quizzes:0,color:H.color,trend:"up"}}),w=N.length>0?N:b,k=h.sort((P,H)=>new Date(H.completedAt).getTime()-new Date(P.completedAt).getTime()).slice(0,10).map((P,H)=>({id:H+1,title:P.quizId?.replace(/-/g," ").replace(/\b\w/g,Y=>Y.toUpperCase())||`Quiz ${H+1}`,subject:Object.entries(S).find(([Y])=>P.quizId?.startsWith(Y))?.[1]?.label||"General",score:P.score,total:100,date:P.completedAt instanceof Date?P.completedAt.toISOString().split("T")[0]:new Date(P.completedAt).toISOString().split("T")[0],type:P.quizId?.includes("practice")?"practice":"module",status:P.score>=60?"passed":"failed"})).filter(P=>y.includes(P.subject)),A={gpa:parseFloat(p),totalQuizzes:g,averageScore:x,trendValue:0},C=k.filter(P=>{if(!y.includes(P.subject))return!1;const H=n==="all"||P.subject===n,Y=s==="all"||P.type===s;return H&&Y});v.useEffect(()=>{n!=="all"&&(y.includes(n)||r("all"))},[y,n]);const F=()=>{const P=["Quiz","Subject","Type","Score","Date","Status"],H=k.map(B=>[B.title,B.subject,B.type,`${B.score}%`,B.date,B.status]),Y=[P,...H].map(B=>B.join(",")).join(` +`),V=new Blob([Y],{type:"text/csv;charset=utf-8;"}),O=URL.createObjectURL(V),E=document.createElement("a");E.href=O,E.download=`mathpulse-grades-${new Date().toISOString().split("T")[0]}.csv`,E.click(),URL.revokeObjectURL(O)},D=P=>P>=90?"text-emerald-600 bg-emerald-50":P>=80?"text-sky-600 bg-sky-50":P>=70?"text-rose-600 bg-rose-50":"text-red-600 bg-red-50",L=P=>P>=90?"A":P>=80?"B":P>=70?"C":P>=60?"D":"F";return a.jsxs("div",{className:"space-y-6 px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[a.jsxs("div",{className:"bg-gradient-to-br from-white via-sky-50/30 to-white rounded-2xl p-7 card-elevated-lg relative overflow-hidden border border-slate-200/80",children:[a.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/40 to-transparent"}),a.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-sky-100/40 rounded-full -translate-y-1/2 translate-x-1/2"}),a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(yt,{size:18,className:"text-rose-500"}),a.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Overall GPA"})]}),a.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:A.gpa}),a.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[a.jsx(ot,{size:14,className:"text-emerald-500"}),a.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["+",A.trendValue,"% this month"]})]})]}),a.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(cn,{size:18,className:"text-sky-500"}),a.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Average Score"})]}),a.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[A.averageScore,"%"]}),a.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Across all subjects"})]}),a.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(ta,{size:18,className:"text-rose-500"}),a.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Total Quizzes"})]}),a.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:A.totalQuizzes}),a.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Completed"})]}),a.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(yt,{size:18,className:"text-rose-500"}),a.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Grade Rank"})]}),a.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:"Top 15%"}),a.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"In your class"})]})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:a.jsx(cn,{size:20,strokeWidth:2.5})}),a.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Subject Performance"})]}),a.jsxs(pe,{variant:"outline",size:"sm",className:"rounded-lg font-body border-[#dde3eb] text-[#5a6578]",onClick:F,children:[a.jsx(qa,{size:16,className:"mr-2"}),"Export Report"]})]}),a.jsx("div",{className:"grid grid-cols-2 gap-4",children:w.map(P=>a.jsxs(J.div,{whileHover:{scale:1.02},className:"bg-white rounded-xl p-5 border border-[#dde3eb] card-elevated cursor-pointer",children:[a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-display font-bold text-[#0a1628] mb-1",children:P.subject}),a.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:[P.quizzes," quizzes completed"]})]}),a.jsx("div",{className:`w-14 h-14 rounded-lg bg-${P.color}-50 flex items-center justify-center`,children:a.jsx("span",{className:`text-xl font-display font-bold text-${P.color}-600`,children:L(P.average)})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[P.average,"%"]}),a.jsx("p",{className:"text-xs text-[#5a6578] font-body mt-1",children:"Average"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[P.trend==="up"?a.jsx(ot,{size:18,className:"text-green-500"}):a.jsx(gC,{size:18,className:"text-red-500"}),a.jsx(jn,{size:16,className:"text-[#d1cec6]"})]})]})]},P.subject))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:a.jsx(ta,{size:20,strokeWidth:2.5})}),a.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Quiz History"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("select",{value:n,onChange:P=>r(P.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[a.jsx("option",{value:"all",children:"All Subjects"}),y.map(P=>a.jsx("option",{value:P,children:P},P))]}),a.jsxs("select",{value:s,onChange:P=>i(P.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[a.jsx("option",{value:"all",children:"All Types"}),a.jsx("option",{value:"practice",children:"Practice"}),a.jsx("option",{value:"module",children:"Module"})]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] card-elevated overflow-hidden",children:[a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-[#f7f9fc] border-b border-[#dde3eb]",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Quiz"}),a.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Subject"}),a.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Type"}),a.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Score"}),a.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Date"}),a.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Action"})]})}),a.jsx("tbody",{children:C.map(P=>a.jsxs("tr",{className:"border-b border-[#edf1f7] hover:bg-[#f7f9fc] transition-colors",children:[a.jsx("td",{className:"px-6 py-4",children:a.jsx("p",{className:"font-body font-semibold text-[#0a1628] text-sm",children:P.title})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:P.subject})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"px-2.5 py-1 bg-[#edf1f7] text-[#5a6578] text-xs font-body font-semibold rounded-md capitalize",children:P.type})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:`px-2.5 py-1 rounded-md text-sm font-body font-semibold ${D(P.score)}`,children:[P.score,"%"]}),a.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["(",P.score,"/",P.total,")"]})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:P.date})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx(pe,{variant:"outline",size:"sm",className:"rounded-lg",children:"Review"})})]},P.id))})]}),C.length===0&&a.jsxs("div",{className:"text-center py-12",children:[a.jsx(uC,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),a.jsx("p",{className:"text-[#5a6578] font-body",children:"No quizzes found with current filters"}),a.jsx("p",{className:"text-xs text-slate-500 font-body mt-1",children:"Try adjusting your filters"})]})]})]})]})};function are({className:e,...t}){return a.jsx(R6,{"data-slot":"tabs",className:Be("flex flex-col gap-2",e),...t})}function sre({className:e,...t}){return a.jsx(L6,{"data-slot":"tabs-list",className:Be("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",e),...t})}function _l({className:e,...t}){return a.jsx($6,{"data-slot":"tabs-trigger",className:Be("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ire({className:e,...t}){return a.jsx(z6,{"data-slot":"tabs-content",className:Be("flex-1 outline-none",e),...t})}const ore=[{id:"uniform_blue",name:"Blue Uniform",src:"/avatar/uniform_blue.png",thumbnail:"/avatar/uniform_blue_thumbnail.png",category:"Tops"},{id:"uniform_pink",name:"Pink Uniform",src:"/avatar/uniform_pink.png",thumbnail:"/avatar/uniform_pink_thumbnail.png",category:"Tops"},{id:"pants_black",name:"Black Pants",src:"/avatar/pants_black.png",thumbnail:"/avatar/pants_black_thumbnail.png",category:"Bottoms"},{id:"shoes_black",name:"Black Shoes",src:"/avatar/shoes_black.png",thumbnail:"/avatar/shoes_black_thumbnail.png",category:"Shoes"}],lre=e=>({top:e.tops??void 0,bottom:e.bottoms??void 0,shoes:e.shoes??void 0,accessory:e.accessories??void 0}),cre=e=>({tops:e?.top??"uniform_blue",bottoms:e?.bottom??"pants_black",shoes:e?.shoes??"shoes_black",accessories:e?.accessory??null}),dre=()=>{const{currentUser:e,userProfile:t,refreshProfile:n}=$t(),[r,s]=v.useState({tops:"uniform_blue",bottoms:"pants_black",shoes:"shoes_black",accessories:null}),[i,o]=v.useState(!1);v.useEffect(()=>{s(cre(t?.avatarLayers))},[t?.avatarLayers]);const l=u=>{s(m=>({...m,[u.category.toLowerCase()]:m[u.category.toLowerCase()]===u.id?null:u.id}))},c=async()=>{if(!e?.uid){ue.error("Please sign in to save avatar changes.");return}o(!0);try{await $C(e.uid,{avatarLayers:lre(r)}),await n(),ue.success("Avatar saved to your profile.")}catch(u){console.error("Failed to save avatar config:",u),ue.error("Unable to save avatar right now.")}finally{o(!1)}},d=["Tops","Bottoms","Shoes","Accessories"],f=u=>{switch(u){case"Tops":return"object-center scale-[1.7] translate-y-2";case"Bottoms":return"object-bottom scale-[2.2] translate-y-8";case"Shoes":return"object-bottom scale-[3.2] translate-y-12";default:return"object-center scale-[1.5]"}};return a.jsxs("div",{className:"relative min-h-full h-full w-full flex items-center justify-center p-4 lg:p-8 bg-transparent overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 50%, rgba(240,249,255,0.2) 0%, rgba(248,250,252,0.5) 50%, rgba(255,241,242,0.4) 80%, rgba(248,250,252,0.85) 100%)"}}),a.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(168,85,247,0.3) 0%, transparent 70%)"}}),a.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(236,72,153,0.25) 0%, transparent 70%)"}}),a.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen",style:{background:"radial-gradient(circle, rgba(56,189,248,0.2) 0%, transparent 70%)"}}),a.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, rgba(15,23,42,0.4) 1px, transparent 1px)",backgroundSize:"24px 24px"}}),a.jsxs("div",{className:"relative z-10 w-full max-w-[1400px] h-[calc(100vh-2rem)] lg:h-[800px] flex flex-col-reverse lg:flex-row bg-white/90 backdrop-blur-xl rounded-[2.5rem] shadow-2xl border border-white/50 overflow-hidden divide-y-reverse lg:divide-y-0 lg:divide-x divide-slate-100/60 ring-1 ring-slate-900/5",children:[a.jsxs("div",{className:"flex-1 lg:w-[55%] flex flex-col p-6 lg:p-12 space-y-8 bg-white/40 overflow-y-auto min-h-0",children:[a.jsxs("div",{className:"flex flex-col space-y-2",children:[a.jsx("h1",{className:"text-4xl lg:text-5xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-purple-600 via-pink-500 to-sky-500 flex items-center gap-3 drop-shadow-sm",children:"Avatar Studio ✨"}),a.jsx("p",{className:"text-slate-600 text-base font-medium lg:text-lg",children:"Design your perfect learning companion."})]}),a.jsxs(are,{defaultValue:"Tops",className:"w-full flex-1 flex flex-col",children:[a.jsxs(sre,{className:"flex flex-nowrap shrink-0 justify-start gap-3 bg-white/60 backdrop-blur-xl p-3 border-2 border-white/80 rounded-3xl mb-10 overflow-x-auto overflow-y-hidden whitespace-nowrap scrollbar-hide min-w-full shadow-[0_8px_30px_rgb(0,0,0,0.04)]",children:[a.jsxs(_l,{value:"Tops",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[a.jsx(xC,{className:"w-5 h-5 mr-2"})," Tops"]}),a.jsxs(_l,{value:"Bottoms",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[a.jsx(KD,{className:"w-5 h-5 mr-2"})," Bottoms"]}),a.jsxs(_l,{value:"Shoes",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[a.jsx(tD,{className:"w-5 h-5 mr-2"})," Shoes"]}),a.jsxs(_l,{value:"Accessories",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[a.jsx(Cr,{className:"w-5 h-5 mr-2"})," Accs"]})]}),d.map(u=>a.jsx(ire,{value:u,className:"flex-1 focus-visible:outline-none focus-visible:ring-0",children:u==="Accessories"?a.jsxs("div",{className:"h-48 md:h-64 flex flex-col items-center justify-center text-slate-400 font-medium bg-white/50 backdrop-blur-sm rounded-[2rem] border-4 border-dashed border-slate-200/60 gap-4 relative overflow-hidden group",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-100/30 to-pink-100/30 opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),a.jsx(J.div,{className:"w-20 h-20 bg-white rounded-3xl flex items-center justify-center shadow-[0_10px_30px_-10px_rgba(0,0,0,0.1)] rotate-3 group-hover:rotate-12 transition-transform duration-300",animate:{y:[0,-10,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"},children:a.jsx(ra,{className:"w-10 h-10 text-purple-400 drop-shadow-sm"})}),a.jsx("p",{className:"text-xl font-bold text-slate-500 group-hover:text-purple-500 transition-colors",children:"Accessories dropping soon! 🎁"})]}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-5 lg:gap-6 pb-8 lg:pb-0 h-full content-start",children:ore.filter(m=>m.category===u).map(m=>{const h=r[u.toLowerCase()]===m.id;return a.jsxs(J.div,{whileHover:{scale:1.05,y:-4,rotate:Math.random()*2-1},whileTap:{scale:.95},onClick:()=>l(m),className:Be("relative cursor-pointer rounded-[2rem] transition-all overflow-hidden flex flex-col items-center p-5 aspect-square bg-white border-4 justify-end group",h?"border-pink-500 shadow-[0_15px_35px_-5px_rgba(236,72,153,0.4)]":"border-slate-100 hover:border-sky-300 hover:shadow-[0_15px_35px_-5px_rgba(56,189,248,0.3)] shadow-sm"),children:[a.jsx("div",{className:Be("absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 bg-gradient-to-tr from-transparent via-white/50 to-white/10",h&&"opacity-100 bg-gradient-to-t from-pink-50/50 to-transparent")}),a.jsx("div",{className:"absolute inset-0 top-4 bottom-[20%] flex items-center justify-center pointer-events-none mix-blend-multiply overflow-hidden z-10 transition-transform duration-300 group-hover:scale-110",children:a.jsx("img",{src:m.thumbnail||m.src,alt:m.name,className:Be("w-full h-full object-contain drop-shadow-xl transition-all duration-300",!m.thumbnail&&f(m.category))})}),a.jsx("span",{className:Be("text-sm lg:text-base font-black z-20 bg-white/90 backdrop-blur-md px-4 py-1.5 rounded-xl mt-auto text-center w-full transition-colors",h?"text-pink-600":"text-slate-700"),children:m.name}),h&&a.jsx("div",{className:"absolute top-4 right-4 bg-gradient-to-r from-pink-500 to-purple-500 text-white text-[10px] uppercase font-black px-3 py-1.5 rounded-full z-20 shadow-lg transform rotate-3",children:"Equipped ✨"})]},m.id)})})},u))]})]}),a.jsxs("div",{className:"flex-1 lg:w-[45%] flex flex-col items-center justify-center p-8 lg:p-12 relative bg-transparent overflow-hidden",children:[a.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-gradient-to-tr from-purple-300/50 via-sky-300/30 to-pink-300/40 blur-[100px] rounded-full pointer-events-none"}),a.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-12 w-full max-w-[480px]",children:[a.jsxs("div",{className:"relative w-[340px] h-[340px] sm:w-[440px] sm:h-[440px] rounded-[3rem] bg-[#0A1128] border-[6px] border-[#1E293B] shadow-[0_30px_60px_rgba(15,23,42,0.4),inset_0_0_120px_rgba(0,0,0,0.9)] flex items-end justify-center pt-10 overflow-hidden transform-gpu shrink-0 ring-1 ring-white/10",children:[a.jsx("div",{className:"absolute top-[-10%] left-0 right-0 h-[110%] pointer-events-none mix-blend-screen",style:{background:"linear-gradient(to bottom, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 60%, transparent 100%)",clipPath:"polygon(15% 0, 85% 0, 65% 100%, 35% 100%)"}}),a.jsx("div",{className:"absolute bottom-5 left-1/2 -translate-x-1/2 w-[60%] h-8 bg-sky-300/30 blur-[15px] rounded-[100%] pointer-events-none"}),a.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-80 h-80 bg-gradient-to-br from-sky-500/20 to-indigo-500/20 blur-[70px] rounded-full pointer-events-none"}),a.jsxs(J.div,{className:"relative w-full h-[120%] pb-6",animate:{y:[-5,5,-5]},transition:{repeat:1/0,duration:3.5,ease:"easeInOut"},children:[a.jsx("img",{src:"/avatar/avatar_body.png",className:"absolute inset-0 w-full h-full object-contain z-10",alt:"Base Avatar"}),r.bottoms&&a.jsx("img",{src:`/avatar/${r.bottoms}.png`,className:"absolute inset-0 w-full h-full object-contain z-20",alt:"Pants"}),r.shoes&&a.jsx("img",{src:`/avatar/${r.shoes}.png`,className:"absolute inset-0 w-full h-full object-contain z-30",alt:"Shoes"}),r.tops&&a.jsx("img",{src:`/avatar/${r.tops}.png`,className:"absolute inset-0 w-full h-full object-contain z-40",alt:"Top"}),a.jsx(J.img,{src:"/avatar/left_horn.png",className:"absolute inset-0 w-full h-full object-contain z-50 origin-[50%_45%]",animate:{rotate:[-8,8,-8]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},alt:"Left Horn"}),a.jsx(J.img,{src:"/avatar/right_horn.png",className:"absolute inset-0 w-full h-full object-contain z-50 origin-[50%_45%]",animate:{rotate:[8,-8,8]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},alt:"Right Horn"}),a.jsx("div",{className:"absolute inset-0 pointer-events-none bg-gradient-to-t from-slate-900/40 via-transparent to-transparent z-[60]"})]})]}),a.jsxs(pe,{size:"lg",className:"relative w-full bg-blue-600 hover:bg-blue-500 text-white font-black h-[72px] rounded-2xl shadow-[0_10px_30px_-10px_rgba(37,99,235,0.6)] text-lg sm:text-xl transition-all hover:-translate-y-1 active:scale-95 group overflow-hidden border border-blue-500",onClick:c,disabled:i,children:[a.jsx("div",{className:"absolute inset-0 bg-white/10 translate-y-full group-hover:translate-y-0 transition-transform duration-300 ease-out"}),a.jsx("span",{className:"relative z-10 flex items-center justify-center gap-2",children:i?a.jsxs(a.Fragment,{children:[a.jsx(He,{className:"h-5 w-5 animate-spin"}),"Saving..."]}):"Save Profile Avatar"})]})]})]})]})]})};function rr({className:e,...t}){return a.jsx(F6,{"data-slot":"switch",className:Be("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(B6,{"data-slot":"switch-thumb",className:Be("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const zp=()=>JSON.parse(JSON.stringify(Fb)),ure=({isOpen:e,onClose:t,profileData:n,onSave:r,settingsData:s,onSaveSettings:i,onApplySettingsPreview:o,onUpdatePassword:l,onExportData:c,onClearCache:d,onDeleteAccount:f,onResetData:u})=>{const[m,h]=v.useState("account"),[g,x]=v.useState({}),[p,j]=v.useState(zp()),[S,y]=v.useState(!1),[N,b]=v.useState(!1),[w,k]=v.useState(!1),[A,C]=v.useState(!1),[F,D]=v.useState(!1),[L,P]=v.useState(!1),[H,Y]=v.useState(!1),[V,O]=v.useState(!1),[E,B]=v.useState(!1),[T,M]=v.useState(""),K=v.useRef(!1),X=v.useRef(zp());v.useEffect(()=>{if(!e){K.current=!1;return}if(K.current)return;K.current=!0;const q=s?JSON.parse(JSON.stringify(s)):zp();X.current=q,x({uid:n?.uid,name:n?.name||"",email:n?.email||"",phone:n?.phone||"",photo:n?.photo||"",avatarLayers:n?.avatarLayers,role:n?.role,lrn:n?.lrn||"",grade:n?.grade||"",section:n?.section||"",school:n?.school||"",department:n?.department||"",subject:n?.subject||"",yearsOfExperience:n?.yearsOfExperience||"",qualification:n?.qualification||"",position:n?.position||""}),j(q)},[e,n,s]),v.useEffect(()=>{e&&o?.(p)},[e,p,o]),v.useEffect(()=>{if(!e)return;const q=W=>{W.key==="Escape"&&(o?.(X.current),t())};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[e,t,o,s]);const I=v.useMemo(()=>[{id:"account",label:"Account",icon:Ji},{id:"notifications",label:"Notifications",icon:Ar},{id:"appearance",label:"Appearance",icon:ED},{id:"privacy",label:"Privacy & Security",icon:na},{id:"learning",label:"Learning",icon:y0},{id:"data",label:"Data & Storage",icon:qa}],[]),Z=q=>{j(W=>q(W))},ne=async()=>{y(!0);try{r&&await r(g),i&&await i(p),t()}catch(q){console.error("Error saving settings:",q),ue.error(q instanceof Error?q.message:"Failed to save settings")}finally{y(!1)}},ee=()=>{P(!1),Y(!1),O(!1),M(""),o?.(X.current),t()},$=()=>{!u||N||P(!0)},_=async()=>{if(!(!u||N)){P(!1),b(!0);try{await u(),ue.success("Testing data reset completed")}catch(q){console.error("Error resetting testing data:",q),ue.error(q instanceof Error?q.message:"Failed to reset testing data")}finally{b(!1)}}},Q=async()=>{if(!l){ue.info("Password update is not available in this environment.");return}M(""),O(!0)},R=async()=>{if(!l||E)return;const q=T.trim();if(!q){ue.error("Password is required.");return}if(q.length<8){ue.error("Password must be at least 8 characters long.");return}B(!0);try{await l(q),ue.success("Password updated successfully."),O(!1),M("")}catch(W){console.error("Error updating password:",W),ue.error(W instanceof Error?W.message:"Failed to update password")}finally{B(!1)}},G=()=>{ue.info("Two-factor authentication setup is not enabled for this project yet.")},ae=async()=>{if(!c||w){ue.info("Data export is not available right now.");return}k(!0);try{await c()}catch(q){console.error("Error exporting data:",q),ue.error(q instanceof Error?q.message:"Failed to export data")}finally{k(!1)}},re=async()=>{if(!d||A){ue.info("Cache clearing is not available right now.");return}C(!0);try{await d()}catch(q){console.error("Error clearing cache:",q),ue.error(q instanceof Error?q.message:"Failed to clear cache")}finally{C(!1)}},te=()=>{if(!f||F){ue.info("Account deletion is not available right now.");return}Y(!0)},se=async()=>{if(!(!f||F)){Y(!1),D(!0);try{await f(),t()}catch(q){console.error("Error deleting account:",q),ue.error(q instanceof Error?q.message:"Failed to delete account")}finally{D(!1)}}};return e?a.jsx(Ke,{children:a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[a.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:ee,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),a.jsxs(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-4xl max-h-[85vh] overflow-hidden flex",children:[a.jsxs("div",{className:"w-64 bg-slate-50 border-r border-slate-200 p-6 overflow-y-auto",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),a.jsx("nav",{className:"space-y-1",children:I.map(q=>{const W=q.icon;return a.jsxs("button",{onClick:()=>h(q.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${m===q.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[a.jsx(W,{size:18}),a.jsx("span",{className:"text-sm font-medium",children:q.label})]},q.id)})})]}),a.jsxs("div",{className:"flex-1 flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-[#dde3eb]",children:[a.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:I.find(q=>q.id===m)?.label}),a.jsx("button",{onClick:ee,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:a.jsx(Xe,{size:20,className:"text-[#5a6578]"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[m==="account"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),a.jsx(ve,{type:"text",value:g.name||"",onChange:q=>x(W=>({...W,name:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),a.jsx(ve,{type:"email",value:g.email||"",onChange:q=>x(W=>({...W,email:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),a.jsx(ve,{type:"tel",value:g.phone||"",onChange:q=>x(W=>({...W,phone:q.target.value})),className:"max-w-md"})]}),g.role==="student"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Learner's Reference Number (LRN)"}),a.jsx(ve,{type:"text",value:g.lrn||"",onChange:q=>x(W=>({...W,lrn:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),a.jsx(ve,{type:"text",value:g.grade||"",onChange:q=>x(W=>({...W,grade:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),a.jsx(ve,{type:"text",value:g.section||"",onChange:q=>x(W=>({...W,section:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),a.jsx(ve,{type:"text",value:g.school||"",onChange:q=>x(W=>({...W,school:q.target.value})),className:"max-w-md"})]})]}),g.role==="teacher"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),a.jsx(ve,{type:"text",value:g.department||"",onChange:q=>x(W=>({...W,department:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),a.jsx(ve,{type:"text",value:g.subject||"",onChange:q=>x(W=>({...W,subject:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),a.jsx(ve,{type:"text",value:g.yearsOfExperience||"",onChange:q=>x(W=>({...W,yearsOfExperience:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Qualification"}),a.jsx(ve,{type:"text",value:g.qualification||"",onChange:q=>x(W=>({...W,qualification:q.target.value})),className:"max-w-md"})]})]}),g.role==="admin"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),a.jsx(ve,{type:"text",value:g.position||"",onChange:q=>x(W=>({...W,position:q.target.value})),className:"max-w-md"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),a.jsx(ve,{type:"text",value:g.department||"",onChange:q=>x(W=>({...W,department:q.target.value})),className:"max-w-md"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Role"}),a.jsx(ve,{type:"text",value:g.role||"",className:"max-w-md bg-slate-100",disabled:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),a.jsxs(pe,{variant:"outline",className:"rounded-xl",onClick:Q,children:[a.jsx(_s,{size:16,className:"mr-2"}),"Update Password"]})]}),a.jsx("div",{className:"pt-4 border-t border-[#dde3eb]",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Two-Factor Authentication"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Add an extra layer of security"})]}),a.jsx(pe,{variant:"outline",size:"sm",className:"rounded-xl",onClick:G,children:"Enable"})]})})]}),m==="notifications"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Email Notifications"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Receive updates via email"})]}),a.jsx(rr,{checked:p.notifications.emailNotifications,onCheckedChange:q=>Z(W=>({...W,notifications:{...W.notifications,emailNotifications:q}}))})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),a.jsx(rr,{checked:p.notifications.pushNotifications,onCheckedChange:q=>Z(W=>({...W,notifications:{...W.notifications,pushNotifications:q}}))})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),a.jsx(rr,{checked:p.notifications.soundEnabled,onCheckedChange:q=>Z(W=>({...W,notifications:{...W.notifications,soundEnabled:q}}))})]}),a.jsxs("div",{className:"pt-4",children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),a.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(q=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"checkbox",checked:p.notifications.notificationTypes[q.key],onChange:W=>Z(de=>({...de,notifications:{...de.notifications,notificationTypes:{...de.notifications.notificationTypes,[q.key]:W.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),a.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:q.label})]},q.key))})]}),a.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[a.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[a.jsx(On,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ve,{type:"time",value:p.notifications.quietHours.start,onChange:q=>Z(W=>({...W,notifications:{...W.notifications,quietHours:{...W.notifications.quietHours,start:q.target.value}}})),className:"w-32"}),a.jsx("span",{className:"text-[#5a6578]",children:"to"}),a.jsx(ve,{type:"time",value:p.notifications.quietHours.end,onChange:q=>Z(W=>({...W,notifications:{...W.notifications,quietHours:{...W.notifications.quietHours,end:q.target.value}}})),className:"w-32"})]}),a.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"No notifications during this time"})]})]}),m==="appearance"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Smart invert colors like extension dark mode"})]}),a.jsx(rr,{checked:p.appearance.darkMode,onCheckedChange:q=>Z(W=>({...W,appearance:{...W.appearance,darkMode:q}}))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),a.jsx("input",{type:"range",min:"12",max:"20",value:p.appearance.fontSize,onChange:q=>Z(W=>({...W,appearance:{...W.appearance,fontSize:Number(q.target.value)}})),className:"flex-1"}),a.jsx("span",{className:"text-xs text-slate-500",children:"Large"})]})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),a.jsx(rr,{checked:p.appearance.compactView,onCheckedChange:q=>Z(W=>({...W,appearance:{...W.appearance,compactView:q}}))})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),a.jsx(rr,{checked:p.appearance.reduceAnimations,onCheckedChange:q=>Z(W=>({...W,appearance:{...W.appearance,reduceAnimations:q}}))})]})]}),m==="privacy"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),a.jsxs("select",{value:p.privacy.profileVisibility,onChange:q=>Z(W=>({...W,privacy:{...W.privacy,profileVisibility:q.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[a.jsx("option",{value:"everyone",children:"Everyone"}),a.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),a.jsx("option",{value:"private",children:"Private"})]})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),a.jsx(rr,{checked:p.privacy.showActivityStatus,onCheckedChange:q=>Z(W=>({...W,privacy:{...W.privacy,showActivityStatus:q}}))})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),a.jsx(rr,{checked:p.privacy.dataSharing,onCheckedChange:q=>Z(W=>({...W,privacy:{...W.privacy,dataSharing:q}}))})]})]}),m==="learning"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),a.jsx(ve,{type:"number",value:p.learning.dailyXpGoal,onChange:q=>Z(W=>({...W,learning:{...W.learning,dailyXpGoal:Number(q.target.value||0)}})),className:"max-w-xs"}),a.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Set your daily learning target"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),a.jsxs("select",{value:p.learning.preferredStudyTime,onChange:q=>Z(W=>({...W,learning:{...W.learning,preferredStudyTime:q.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[a.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),a.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),a.jsx("option",{value:"evening",children:"Evening (6PM - 12AM)"}),a.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),a.jsx(rr,{checked:p.learning.autoPlayLessons,onCheckedChange:q=>Z(W=>({...W,learning:{...W.learning,autoPlayLessons:q}}))})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),a.jsx(rr,{checked:p.learning.showHints,onCheckedChange:q=>Z(W=>({...W,learning:{...W.learning,showHints:q}}))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),a.jsxs("select",{value:p.learning.quizDifficultyPreference,onChange:q=>Z(W=>({...W,learning:{...W.learning,quizDifficultyPreference:q.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[a.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),a.jsx("option",{value:"easy",children:"Easy"}),a.jsx("option",{value:"medium",children:"Medium"}),a.jsx("option",{value:"hard",children:"Hard"})]})]}),a.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[a.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[a.jsx(iR,{size:16,className:"inline mr-2"}),"Study Reminders"]}),a.jsx(ve,{type:"time",value:p.learning.studyReminderTime,onChange:q=>Z(W=>({...W,learning:{...W.learning,studyReminderTime:q.target.value}})),className:"w-32"}),a.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Daily reminder to study"})]})]}),m==="data"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[a.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),a.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),a.jsxs(pe,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ae,disabled:w,children:[a.jsx(qa,{size:16,className:"mr-2"}),w?"Exporting...":"Request Data Export"]})]}),a.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[a.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),a.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),a.jsx(pe,{variant:"outline",size:"sm",className:"rounded-xl",onClick:re,disabled:A,children:A?"Clearing...":"Clear Cache"})]}),a.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[a.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),a.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[(g.role||"student")==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",g.role==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts for retesting.",g.role==="admin"&&"Reset admin testing artifacts like personal audit/content update records for QA loops."]}),a.jsx(pe,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!u||N,onClick:$,children:N?"Resetting...":"Reset Testing Data"})]}),g.role==="admin"?a.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[a.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),a.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),a.jsxs(pe,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:te,disabled:F,children:[a.jsx(sa,{size:16,className:"mr-2"}),F?"Deleting...":"Delete Account"]})]}):a.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-200 rounded-xl",children:[a.jsx("h4",{className:"text-sm font-bold text-emerald-900 mb-1 font-body",children:"Protected Account Controls"}),a.jsx("p",{className:"text-xs text-emerald-700",children:"Account deletion is restricted to administrator accounts."})]})]})]}),a.jsxs("div",{className:"p-6 border-t border-[#dde3eb] bg-[#edf1f7] flex items-center justify-between",children:[a.jsx("p",{className:"text-xs text-slate-500 font-body",children:"MathPulse AI v2.1.0"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(pe,{variant:"outline",onClick:ee,className:"rounded-lg border-[#dde3eb]",disabled:S,children:"Cancel"}),a.jsx(pe,{onClick:ne,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white",disabled:S,children:S?"Saving...":"Save Changes"})]})]})]})]})]}),V?a.jsx(J.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:()=>{E||(O(!1),M(""))},children:a.jsxs(J.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:q=>q.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[a.jsx("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:"Update Password"}),a.jsx("button",{onClick:()=>{E||(O(!1),M(""))},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close password update dialog",children:a.jsx(Xe,{size:18,className:"text-[#5a6578]"})})]}),a.jsxs("div",{className:"px-6 py-5 space-y-4",children:[a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter a new password with at least 8 characters."}),a.jsx(ve,{type:"password",value:T,onChange:q=>M(q.target.value),placeholder:"New password",autoFocus:!0,onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),R())},disabled:E}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(pe,{variant:"outline",onClick:()=>{E||(O(!1),M(""))},disabled:E,children:"Cancel"}),a.jsx(pe,{onClick:R,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:E,children:E?"Updating...":"Update Password"})]})]})]})}):null,a.jsx(Ua,{isOpen:L,onClose:()=>{N||P(!1)},onConfirm:_,title:"Reset Testing Data?",message:`Reset ${g.role||"student"} testing data? This action is for QA/demo use and cannot be undone.`,confirmText:N?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),a.jsx(Ua,{isOpen:H,onClose:()=>{F||Y(!1)},onConfirm:se,title:"Delete Account?",message:"Delete account permanently? This action cannot be undone.",confirmText:F?"Deleting...":"Delete Account",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null},fre=({student:e,onClose:t})=>{const[n,r]=v.useState([]),[s,i]=v.useState(!1);if(v.useEffect(()=>{e?.uid&&(i(!0),Zne(e.uid).then(r).catch(l=>console.error("Failed to load achievements:",l)).finally(()=>i(!1)))},[e?.uid]),!e)return null;const o={trophy:a.jsx(Jt,{size:24,className:"text-rose-500"}),flame:a.jsx(Nn,{size:24,className:"text-orange-500"}),star:a.jsx(aa,{size:24,className:"text-rose-400"}),"book-open":a.jsx(De,{size:24,className:"text-sky-600"}),"badge-check":a.jsx(XO,{size:24,className:"text-emerald-600"}),crown:a.jsx(Cr,{size:24,className:"text-rose-500"}),target:a.jsx(cn,{size:24,className:"text-rose-500"})};return a.jsx(Ke,{children:a.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[a.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),a.jsxs(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[90vh] overflow-hidden",children:[a.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-8 text-white relative overflow-hidden",children:[a.jsx("div",{className:"accent-line absolute top-0 left-0 right-0"}),a.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 hover:bg-slate-100 rounded-xl transition-colors z-10",children:a.jsx(Xe,{size:20})}),a.jsx("div",{className:"relative z-10",children:a.jsxs("div",{className:"flex items-start gap-6",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-24 h-24 bg-white/10 backdrop-blur-sm rounded-2xl flex items-center justify-center text-6xl border border-slate-300",children:e.avatar}),e.isOnline&&a.jsx("div",{className:"absolute -bottom-2 -right-2 w-6 h-6 bg-green-500 rounded-full border-4 border-white"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-3xl font-display font-bold mb-2",children:e.name}),a.jsx("p",{className:"text-slate-500 mb-4",children:e.section}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[a.jsx("p",{className:"text-xs text-slate-500",children:"Level"}),a.jsx("p",{className:"text-xl font-bold",children:e.level})]}),a.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[a.jsx("p",{className:"text-xs text-slate-500",children:"Total XP"}),a.jsx("p",{className:"text-xl font-bold",children:e.totalXP})]}),a.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[a.jsx("p",{className:"text-xs text-slate-500",children:"Streak"}),a.jsxs("p",{className:"text-xl font-bold flex items-center gap-1",children:[a.jsx(Nn,{size:16,className:"text-orange-300"}),e.currentStreak]})]})]})]})]})}),a.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-sky-500/5 rounded-full -translate-y-1/2 translate-x-1/2"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-rose-500/5 rounded-full translate-y-1/2 -translate-x-1/2"})]}),a.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-320px)]",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Performance Stats"}),a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[a.jsx(De,{size:24,className:"text-sky-600 mx-auto mb-2"}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:e.stats.quizzesCompleted}),a.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Quizzes"})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[a.jsx(cn,{size:24,className:"text-emerald-600 mx-auto mb-2"}),a.jsxs("p",{className:"text-2xl font-bold text-[#0a1628]",children:[e.stats.averageScore,"%"]}),a.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Avg Score"})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[a.jsx(yt,{size:24,className:"text-rose-600 mx-auto mb-2"}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:e.stats.modulesCompleted}),a.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Modules"})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[a.jsx(On,{size:24,className:"text-rose-600 mx-auto mb-2"}),a.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:e.stats.studyHours}),a.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Hours"})]})]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Rankings"}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4",children:[a.jsx(Jt,{size:20,className:"text-rose-600 mb-2"}),a.jsxs("p",{className:"text-2xl font-bold text-rose-900",children:["#",e.rank.global]}),a.jsx("p",{className:"text-xs text-rose-700 mt-1 font-body",children:"School"})]}),a.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-4",children:[a.jsx(Jt,{size:20,className:"text-sky-600 mb-2"}),a.jsxs("p",{className:"text-2xl font-bold text-sky-900",children:["#",e.rank.section]}),a.jsx("p",{className:"text-xs text-sky-700 mt-1 font-body",children:"Section"})]}),a.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4",children:[a.jsx(Jt,{size:20,className:"text-rose-600 mb-2"}),a.jsx("p",{className:"text-2xl font-bold text-rose-900",children:e.rank.change>0?a.jsxs("span",{className:"flex items-center gap-1 text-emerald-600",children:[a.jsx(ot,{size:20}),"+",e.rank.change]}):e.rank.change<0?a.jsxs("span",{className:"flex items-center gap-1 text-red-600",children:[a.jsx(ot,{size:20,className:"rotate-180"}),e.rank.change]}):"0"}),a.jsx("p",{className:"text-xs text-rose-700 mt-1 font-body",children:"This Week"})]})]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Achievements"}),s?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(He,{size:24,className:"text-sky-500 animate-spin"})}):n.length>0?a.jsx("div",{className:"grid grid-cols-3 gap-3",children:n.map(l=>a.jsxs("div",{className:"rounded-xl p-4 text-center transition-all bg-white border-2 border-sky-200",children:[a.jsx("div",{className:"text-3xl mb-2",children:o[l.icon]||a.jsx(yt,{size:24,className:"text-slate-500 mx-auto"})}),a.jsx("p",{className:"font-bold text-xs text-[#0a1628] mb-1 font-body",children:l.title}),a.jsx("p",{className:"text-xs text-[#5a6578]",children:l.description})]},l.id))}):a.jsxs("div",{className:"flex flex-col items-center py-8 gap-2",children:[a.jsx(yt,{size:32,className:"text-[#d1cec6]"}),a.jsx("p",{className:"text-sm text-[#5a6578] font-body",children:"No achievements unlocked yet"})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Recent Activity"}),a.jsxs("div",{className:"flex flex-col items-center py-8 gap-2",children:[a.jsx(De,{size:32,className:"text-[#d1cec6]"}),a.jsx("p",{className:"text-sm text-[#5a6578] font-body",children:"Activity history coming soon"})]})]})]})]})]})})},mre=({currentUserPhoto:e,onBack:t})=>{const{currentUser:n,userProfile:r}=$t(),s=r,[i]=v.useState("section"),[o,l]=v.useState("weekly"),[c,d]=v.useState(null),[f,u]=v.useState(!0),[m,h]=v.useState([]),g=[s?.grade,s?.section].filter(Boolean).join(" - "),x=["","","","","","","",""];v.useEffect(()=>{(async()=>{if(n){u(!0);try{const A={daily:"week",weekly:"week",all:"all"},C=o==="daily"?"week":o==="all"?"all":"week",D=(await AM(n.uid,!1,C,20)).map((L,P)=>({id:L.userId,uid:L.userId,name:L.name,avatar:L.userId===n.uid?e||L.photo||x[P%x.length]:L.photo||x[P%x.length],level:L.level,totalXP:L.xp,currentStreak:0,section:g||"Grade 11 - STEM A",rank:{global:L.rank,section:L.rank,change:0},stats:{quizzesCompleted:0,averageScore:0,modulesCompleted:0,studyHours:0},isOnline:!1,isYou:L.userId===n.uid}));h(D)}catch(A){console.error("Error loading leaderboard:",A)}finally{u(!1)}}})()},[n,g,o,e]);const j=(()=>{let k=m;if(i==="section"){const C=g||"";C&&(k=k.filter(F=>F.section===C))}const A=k.sort((C,F)=>{const D=i==="section"?"section":"global";return(C.rank[D]||999)-(F.rank[D]||999)});for(;A.length>0&&A.length<3;){const C=A.length+1;A.push({id:`mock-${C}`,uid:`mock-${C}`,name:`Student ${C}`,avatar:"",level:1,totalXP:0,currentStreak:0,section:g||"",rank:{global:C,section:C,change:0},stats:{quizzesCompleted:0,averageScore:0,modulesCompleted:0,studyHours:0},isOnline:!1,isYou:!1})}return A})(),S=j.find(k=>k.isYou)?.rank.section||4,y=Math.max(10,Math.min(99,100-S/Math.max(1,j.length)*100)),N=j.length>=3?j.slice(0,3):[],b=j.length>=3?j.slice(3):[],w=(k,A)=>k?k.startsWith("http")||k.startsWith("data:")?a.jsx("img",{src:k,alt:"Avatar",className:"w-full h-full object-cover rounded-full"}):a.jsx(Ji,{size:A,className:"text-slate-400 opacity-70"}):a.jsx(Ji,{size:A,className:"text-slate-400 opacity-70"});return f?a.jsx("div",{className:"flex justify-center items-center h-[500px]",children:a.jsx(He,{className:"w-8 h-8 animate-spin text-purple-600"})}):a.jsxs("div",{className:"w-full min-h-screen relative flex flex-col items-center font-body text-white",children:[a.jsxs("div",{className:"absolute inset-x-[-20px] top-0 bottom-[-50px] z-[-1] pointer-events-none overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,#9333ea_0%,#c084fc_40%,transparent_80%)]"}),a.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[250vw] md:w-[200vw] h-[150vh] opacity-75 pointer-events-none",style:{WebkitMaskImage:"radial-gradient(circle at 50% 100%, black 10%, transparent 60%)"},children:a.jsx(J.div,{className:"absolute bottom-0 left-1/2 w-[300vw] h-[300vw] md:w-[200vw] md:h-[200vw]",style:{x:"-50%",originX:.5,originY:1,background:`repeating-conic-gradient(from 0deg at 50% 100%, + rgba(255,255,255,0.7) 0deg, rgba(255,255,255,0.7) 6deg, + transparent 6deg, transparent 12deg)`},animate:{rotate:360},transition:{duration:160,repeat:1/0,ease:"linear"}})}),a.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[150vw] h-[100vh] bg-[radial-gradient(ellipse_at_50%_100%,#7e22ce_10%,transparent_60%)] mix-blend-overlay"})]}),a.jsx("div",{className:"absolute inset-0 bg-math-pattern opacity-[0.03] mix-blend-overlay pointer-events-none z-[-1]",style:{WebkitMaskImage:"linear-gradient(to bottom, transparent, black 15%)"}}),a.jsxs("div",{className:"relative z-10 w-full px-4 sm:px-8 py-4 md:py-6 flex flex-col items-center",children:[a.jsx("div",{className:"w-full flex justify-center items-center mb-4 mt-2",children:a.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold tracking-wide text-slate-800 drop-shadow-sm",children:"Leaderboard"})}),a.jsx("div",{className:"bg-slate-800/5 backdrop-blur-md rounded-full p-1 flex gap-1 mb-3 shadow-[inset_0_2px_4px_rgba(0,0,0,0.05)] border border-slate-800/10 w-full max-w-[340px]",children:["daily","weekly","all"].map(k=>a.jsx("button",{onClick:()=>l(k),className:`flex-1 py-1.5 rounded-full text-[13px] md:text-sm font-semibold transition-all capitalize inline-flex justify-center items-center ${o===k?"bg-white text-purple-700 shadow-md border border-white/50 backdrop-blur-lg":"text-slate-600 hover:text-purple-700 hover:bg-white/50"}`,children:k==="all"?"All Time":k},k))}),a.jsxs(J.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"w-full max-w-[420px] mb-4 bg-[#FFB356] p-2.5 md:p-3 rounded-full shadow-lg flex items-center gap-3 relative overflow-hidden ring-1 ring-white/20",children:[a.jsx("div",{className:"absolute inset-0 bg-noise opacity-[0.15] mix-blend-overlay pointer-events-none"}),a.jsx("div",{className:"bg-white/25 backdrop-blur-md px-4 py-2 min-w-[60px] rounded-full flex flex-col items-center justify-center shadow-sm z-10 border border-white/20",children:a.jsxs("span",{className:"text-xl md:text-2xl font-display font-bold text-white leading-none",children:["#",S]})}),a.jsx("div",{className:"z-10 flex-1 pr-2 md:pr-4",children:a.jsxs("p",{className:"font-medium text-white/90 text-sm md:text-[15px] leading-snug text-center",children:["You are doing better than ",a.jsxs("span",{className:"font-black text-white drop-shadow-sm",children:[Math.round(y),"%"]})," of other players!"]})})]}),a.jsxs("div",{className:"w-full max-w-[800px] flex items-end justify-center gap-2 md:gap-4 h-[280px] md:h-[310px] relative z-20 mt-8 md:mt-12 mx-auto px-2 sm:px-4 group perspective-1000",children:[a.jsxs(J.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.15,type:"spring",stiffness:90},className:"flex flex-col items-center relative z-10 w-[28%] sm:w-[30%] max-w-[145px] mx-1 md:mr-2",children:[a.jsxs("div",{className:"flex flex-col items-center mb-2 md:mb-4 relative z-40 w-full",children:[a.jsx("div",{className:"w-14 h-14 md:w-[72px] md:h-[72px] rounded-full border-[3px] border-[#FF8B8B] bg-[#111827] flex items-center justify-center shadow-[0_0_18px_rgba(255,139,139,0.6)] overflow-hidden",children:w(N[1]?.avatar,26)}),a.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-xs md:text-sm drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:N[1]?.name||"---"})]}),a.jsxs("div",{className:"w-[90%] relative mt-2",children:[a.jsx("div",{className:"w-full h-10 md:h-14 absolute -bottom-5 md:-bottom-7 bg-[#D96C6A] rounded-[50%] shadow-[0_15px_25px_rgba(0,0,0,0.4)] z-0"}),a.jsx("div",{className:"w-full h-[100px] md:h-[130px] bg-[#D96C6A] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:a.jsx("span",{className:"absolute inset-x-0 top-3 flex items-center justify-center text-[60px] md:text-[80px] font-black text-white/10 drop-shadow",children:"2"})}),a.jsx("div",{className:"w-full h-10 md:h-14 absolute -top-5 md:-top-7 bg-[#FF8B8B] rounded-[50%] z-20 shadow-[0_4px_8px_rgba(0,0,0,0.3)] flex flex-col items-center justify-center",children:a.jsxs("div",{className:"text-black/25 font-black text-[18px] md:text-[26px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[N[1]?.totalXP||0," XP"]})})]})]}),a.jsxs(J.div,{initial:{opacity:0,y:60},animate:{opacity:1,y:0},transition:{delay:.05,type:"spring",stiffness:100},className:"flex flex-col items-center relative z-30 w-[35%] sm:w-[38%] max-w-[190px]",children:[a.jsxs("div",{className:"flex flex-col items-center mb-3 md:mb-5 relative z-40 w-full",children:[a.jsx(J.div,{animate:{y:[0,-6,0]},transition:{repeat:1/0,duration:2.2,ease:"easeInOut"},className:"mb-[-10px] z-30",children:a.jsx(Cr,{size:30,className:"text-yellow-300 fill-yellow-300 drop-shadow-[0_0_12px_rgba(250,204,21,0.9)] md:w-9 md:h-9"})}),a.jsx("div",{className:"w-16 h-16 md:w-[86px] md:h-[86px] rounded-full border-[4px] border-[#fde68a] bg-[#111827] flex items-center justify-center shadow-[0_0_24px_rgba(250,204,21,0.6)] overflow-hidden",children:w(N[0]?.avatar,34)}),a.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-sm md:text-base drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:N[0]?.name||"---"})]}),a.jsxs("div",{className:"w-[95%] relative mt-2",children:[a.jsx("div",{className:"w-full h-12 md:h-16 absolute -bottom-6 md:-bottom-8 bg-[#6F2BAF] rounded-[50%] shadow-[0_20px_30px_rgba(0,0,0,0.5)] z-0"}),a.jsx("div",{className:"w-full h-[140px] md:h-[180px] bg-[#6F2BAF] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:a.jsx("span",{className:"absolute inset-x-0 top-4 flex items-center justify-center text-[80px] md:text-[110px] font-black text-white/10 drop-shadow",children:"1"})}),a.jsx("div",{className:"w-full h-12 md:h-16 absolute -top-6 md:-top-8 bg-[#9956DE] rounded-[50%] z-20 shadow-[0_5px_12px_rgba(0,0,0,0.4)] flex flex-col items-center justify-center",children:a.jsxs("div",{className:"text-black/25 font-black text-[22px] md:text-[32px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[N[0]?.totalXP||0," XP"]})})]})]}),a.jsxs(J.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.25,type:"spring",stiffness:90},className:"flex flex-col items-center relative z-10 w-[28%] sm:w-[30%] max-w-[145px] mx-1 md:ml-2",children:[a.jsxs("div",{className:"flex flex-col items-center mb-2 md:mb-4 relative z-40 w-full",children:[a.jsx("div",{className:"w-14 h-14 md:w-[72px] md:h-[72px] rounded-full border-[3px] border-[#FFB356] bg-[#111827] flex items-center justify-center shadow-[0_0_18px_rgba(255,179,86,0.6)] overflow-hidden",children:w(N[2]?.avatar,26)}),a.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-xs md:text-sm drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:N[2]?.name||"---"})]}),a.jsxs("div",{className:"w-[90%] relative mt-2",children:[a.jsx("div",{className:"w-full h-10 md:h-14 absolute -bottom-5 md:-bottom-7 bg-[#DE7949] rounded-[50%] shadow-[0_15px_25px_rgba(0,0,0,0.4)] z-0"}),a.jsx("div",{className:"w-full h-[75px] md:h-[100px] bg-[#DE7949] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:a.jsx("span",{className:"absolute inset-x-0 top-1 flex items-center justify-center text-[50px] md:text-[70px] font-black text-white/10 drop-shadow",children:"3"})}),a.jsx("div",{className:"w-full h-10 md:h-14 absolute -top-5 md:-top-7 bg-[#FFB356] rounded-[50%] z-20 shadow-[0_4px_8px_rgba(0,0,0,0.3)] flex flex-col items-center justify-center",children:a.jsxs("div",{className:"text-black/25 font-black text-[16px] md:text-[22px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[N[2]?.totalXP||0," XP"]})})]})]})]})]}),a.jsxs("div",{className:"w-full flex-grow relative z-20 pt-6 pb-32 px-4 sm:px-10 flex flex-col items-center mt-[-20px] md:mt-[-40px] bg-white transition-all duration-300 hover:-translate-y-2 rounded-t-[2.5rem] shadow-[0_-15px_50px_rgba(0,0,0,0.2)] hover:shadow-[0_-20px_60px_rgba(0,0,0,0.3)] border-t border-slate-100 min-h-[50vh]",children:[a.jsx("div",{className:"absolute top-[50%] bottom-[-500px] left-0 right-0 bg-white z-[-1]"}),a.jsx("div",{className:"w-12 h-1.5 bg-slate-300/80 rounded-full mb-6 mt-[-10px]"}),a.jsxs("div",{className:"w-full max-w-4xl space-y-3.5",children:[b.map((k,A)=>{const C=k.rank.global||A+4;return a.jsxs(J.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:A*.05+.3},onClick:()=>d(k),className:`flex items-center gap-4 p-3.5 md:p-4 rounded-3xl cursor-pointer bg-white border transition-all duration-300 ${k.isYou?"border-[#8B5CF6]/40 shadow-xl shadow-[#8B5CF6]/20 ring-2 ring-[#8B5CF6]/10":"border-slate-100 shadow-[0_12px_25px_rgba(0,0,0,0.08)] hover:shadow-[0_16px_30px_rgba(0,0,0,0.12)]"}`,children:[a.jsx("div",{className:"w-9 h-9 md:w-11 md:h-11 rounded-full border-2 border-slate-100 bg-white flex items-center justify-center font-display font-bold text-slate-500 shadow-sm text-sm",children:C}),a.jsx("div",{className:"w-11 h-11 md:w-14 md:h-14 bg-slate-100 rounded-full flex items-center justify-center text-xl overflow-hidden shadow-sm relative border-[3px] border-[#F1F5F9]",children:w(k.avatar,24)}),a.jsxs("div",{className:"flex-1 flex justify-between items-center pr-2",children:[a.jsx("div",{children:a.jsxs("h4",{className:"font-display font-bold text-[#1E293B] text-[15px] md:text-lg flex items-center gap-2 tracking-wide",children:[k.name,k.isYou&&a.jsx("span",{className:"text-[9px] uppercase tracking-wider bg-[#8B5CF6] text-white px-1.5 py-0.5 rounded font-bold",children:"You"})]})}),a.jsx("div",{children:a.jsxs("p",{className:"text-[13px] md:text-[15px] font-bold text-slate-500 text-right",children:[k.totalXP," ",a.jsx("span",{className:"text-[10px] text-slate-400 font-normal uppercase",children:"XP"})]})})]})]},k.id)}),b.length===0&&a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-slate-400 font-medium",children:"No other participants found in this view."})})]})]}),a.jsx(fre,{student:c,onClose:()=>d(null)})]})},Fg="iar-v2-deped-g11-core-g12-candidate-shortform",CM=[{id:"iar-fn-01",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"basic",competencyCode:"M11GM-Ia-2",competencyDescription:"Evaluates a function and solves basic linear expressions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Solve for x: 3x - 4 = 17",options:["5","6","7","8"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-fn-02",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"standard",competencyCode:"M11GM-Ib-5",competencyDescription:"Finds the domain of a rational function.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"What is the domain of f(x) = 5 / (x - 2)?",options:["All real numbers","x > 2","x ≠ 2","x < 2"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-fn-03",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Ie-f-1",competencyDescription:"Solves exponential equations in real-life growth contexts.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"A quantity doubles every hour. If it starts at 3, what is the value after 4 hours?",acceptableNumericAnswers:[48],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-04",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"challenge",competencyCode:"M11GM-Ii-4",competencyDescription:"Determines intercepts and asymptotic behavior of logarithmic functions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement is true for f(x) = log(x - 1)?",options:["Domain is all real numbers.","Vertical asymptote is x = 1.","x-intercept is always 0.","Range is x > 1."],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-c1",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Id-2",competencyDescription:"Determines the inverse of a one-to-one function.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"If f(x) = 2x + 3, what is f⁻¹(11)?",acceptableNumericAnswers:[4],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-bm-01",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"basic",competencyCode:"M11GM-IIa-b-1",competencyDescription:"Computes simple interest and maturity value.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Find the simple interest on PHP 8,000 at 5% annual rate for 2 years.",acceptableNumericAnswers:[800],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-02",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIa-2",competencyDescription:"Distinguishes simple and compound interest contexts.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement correctly describes compound interest?",options:["Interest is based only on original principal.","Interest is computed once at maturity.","Interest is computed on principal plus accumulated interest.","Interest is always lower than simple interest."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-03",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Computes annuity future value in basic settings.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A student saves PHP 1,000 monthly for 6 months with no interest. What is the accumulated amount?",options:["PHP 5,000","PHP 6,000","PHP 7,000","PHP 12,000"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-bm-04",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"challenge",competencyCode:"M11GM-IIf-3",competencyDescription:"Solves business and consumer loan scenarios.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A borrower receives PHP 20,000 and repays PHP 22,400 after 1 year. What is the annual simple interest rate?",options:["8%","10%","12%","14%"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-bm-c1",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Finds future value and present value of annuities.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Without interest, what is the present value of a 12-month annuity paying PHP 500 each month?",acceptableNumericAnswers:[6e3],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-01",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"basic",competencyCode:"M11GM-IIg-1",competencyDescription:"Identifies and negates propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'If p is "All triangles have three sides," what is not p?',options:["Some triangles have three sides.","No triangle has three sides.","At least one triangle does not have three sides.","All triangles are polygons."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-lg-02",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIh-1",competencyDescription:"Determines truth values of compound propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"When p is true and q is false, what is the truth value of p -> q?",options:["True","False","Cannot be determined","Both true and false"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-03",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIi-1",competencyDescription:"Identifies common reasoning fallacies in short arguments.",answerType:"shortAnswerText",depedBasis:"depedPattern",prompt:'A post says, "Everyone in my class passed because we used this lucky pen." Type the best label for this weak reasoning.',acceptableTextAnswers:["false cause","false causation","post hoc","hasty generalization"],isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-lg-04",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"challenge",competencyCode:"M11GM-IIi-2",competencyDescription:"Determines the validity of categorical syllogisms.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"All squares are rectangles. All rectangles are quadrilaterals. Therefore all squares are quadrilaterals. This argument is:",options:["Valid","Invalid","A fallacy of composition","A contradiction"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-lg-c1",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIj-1",competencyDescription:"Illustrates methods of proof and disproof.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'To prove "if n is even then n² is even," which method is commonly used?',options:["Direct proof","Proof by contradiction only","Survey method","Graph sketch only"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40}];function hre(e){return e>=75?"Mastered":e>=40?"NeedsReview":"HighRisk"}function pre(){return CM.filter(e=>e.depedBasis==="depedPattern"&&!!e.competencyCode)}function xre(e=CM){const t=e.reduce((n,r)=>n+r.estimatedSeconds,0);return Math.round(t/60*10)/10}const x5={Functions:"Functions and Graphs",BusinessMath:"Business and Financial Mathematics",Logic:"Logic and Reasoning"},gre={atRiskSubjectIds:[],questionSetVersion:Fg},wr=pre(),g5=e=>e.trim().toLowerCase().replace(/\s+/g," "),b5=(e,t)=>{if(!e.scorable)return!1;if(e.answerType==="MCQ")return typeof t=="number"&&t===e.correctOptionIndex;if(e.answerType==="shortAnswerNumeric"){if(typeof t!="string")return!1;const n=Number(t);if(Number.isNaN(n))return!1;const r=e.numericTolerance??0;return(e.acceptableNumericAnswers||[]).some(s=>Math.abs(n-s)<=r)}if(e.answerType==="shortAnswerText"){if(typeof t!="string")return!1;const n=g5(t);return(e.acceptableTextAnswers||[]).some(r=>g5(r)===n)}return!1},bre=e=>e==="Mastered"?"text-teal-600 bg-teal-50":e==="NeedsReview"?"text-amber-700 bg-amber-50":"text-red-600 bg-red-50",yre=e=>e==="NeedsReview"?"Needs Review":e==="HighRisk"?"High Risk":"Mastered",vre=({isOpen:e,onClose:t,onComplete:n,lrn:r,gradeLevel:s="Grade 11",workflowMode:i="iar_only",assessmentType:o="initial_assessment"})=>{const[l,c]=v.useState("intro"),[d,f]=v.useState(0),[u,m]=v.useState([]),[h,g]=v.useState(""),[x,p]=v.useState(!1),[j,S]=v.useState(!1),[y,N]=v.useState(null),[b,w]=v.useState(null),[k,A]=v.useState([]),[C,F]=v.useState(!1);U.useEffect(()=>{e&&(c("intro"),f(0),m([]),g(""),p(!1),S(!1),N(null),w(null),A([]))},[e]),U.useEffect(()=>{if(!e||l!=="test"){S(!1);return}if(d>0||x){S(!1);return}S(!0);const K=window.setTimeout(()=>{S(!1)},2800);return()=>window.clearTimeout(K)},[e,l,d,x]);const D=()=>{n({status:"skipped",...gre}),t()},L=()=>{t()};U.useEffect(()=>{if(!e)return;const K=X=>{X.key==="Escape"&&L()};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[e]);const P=()=>{c("test")},H=K=>{m(K),g(""),p(!1),d{f(X=>X+1)},300):O(K)},Y=K=>{const X=[...u];X[d]=K,H(X)},V=()=>{h.trim()&&Y(h.trim())},O=async K=>{const X=[],I={Functions:{correct:0,total:0},BusinessMath:{correct:0,total:0},Logic:{correct:0,total:0}},Z={Functions:[],BusinessMath:[],Logic:[]},ne={};wr.forEach((re,te)=>{const se=K[te];if(re.answerType==="confidenceLikert"&&typeof se=="number"&&Z[re.topicArea].push(se+1),!re.scorable)return;const q=b5(re,se);I[re.topicArea].total+=1,q&&(I[re.topicArea].correct+=1),ne[re.topicArea]||(ne[re.topicArea]=[]),ne[re.topicArea].push({correct:q,questionId:re.id,difficulty:re.difficulty,gradeLevelTag:re.gradeLevel,quarter:re.quarter,answerType:re.answerType})});const ee=Object.keys(I).reduce((re,te)=>{const{correct:se,total:q}=I[te],W=q>0?Math.round(se/q*100):0,de=hre(W);return de!=="Mastered"&&X.push(te),re[te]={correct:se,total:q,scorePercent:W,classification:de},re},{}),$=wr.filter(re=>re.scorable&&re.gradeLevel==="G12Candidate"),_=$.reduce((re,te)=>{const se=wr.findIndex(q=>q.id===te.id);return re+(b5(te,K[se])?1:0)},0),Q=$.length>0?_/$.length:1,ae={readyForFiniteMath:Object.values(ee).filter(re=>re.classification==="Mastered").length/3>=.67&&ee.Functions.classification!=="HighRisk"&&ee.BusinessMath.classification!=="HighRisk"&&Q>=.5,readyForAdvancedStats:ee.Logic.classification==="Mastered"&&Q>=.67,readyForCalcIntro:ee.Functions.classification==="Mastered"&&Q>=.67,needsStrongerFunctions:ee.Functions.classification!=="Mastered",needsStrongerBusinessMath:ee.BusinessMath.classification!=="Mastered"};if(Object.keys(ee).sort((re,te)=>{const se=ee[re],q=ee[te],W=Ae=>Ae==="HighRisk"?0:Ae==="NeedsReview"?1:2,de=W(se.classification)-W(q.classification);return de!==0?de:se.scorePercent-q.scorePercent}),A(X),N(ee),w(ae),c("results"),r){F(!0);try{const re=Object.keys(ee).map(te=>({subject:te,score:ee[te].scorePercent}));await WC(r,re,s,ne,i,o),console.log("[OK] Automation: diagnostic pipeline completed")}catch(re){console.error("[WARN] Automation: diagnostic pipeline failed:",re)}finally{F(!1)}}},E=()=>{if(!y||!b){n({status:"completed",atRiskSubjectIds:k,questionSetVersion:Fg}),t();return}n({status:"completed",atRiskSubjectIds:k,topicScores:{Functions:y.Functions.scorePercent,BusinessMath:y.BusinessMath.scorePercent,Logic:y.Logic.scorePercent},topicClassifications:{Functions:y.Functions.classification,BusinessMath:y.BusinessMath.classification,Logic:y.Logic.classification},priorityTopics:Object.keys(y).sort((K,X)=>y[K].scorePercent-y[X].scorePercent),g12ReadinessIndicators:b,questionSetVersion:Fg}),t()},B=wr[d],T=Math.round(d/wr.length*100),M=xre(wr);return e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:()=>{L()},children:[a.jsxs(J.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"bg-white rounded-3xl shadow-2xl max-w-2xl w-full flex flex-col max-h-[90vh] pointer-events-auto overflow-hidden relative z-[51]",onClick:K=>K.stopPropagation(),children:[a.jsxs("div",{className:"px-8 py-6 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center text-sky-600",children:a.jsx(lr,{size:24})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:o==="followup_diagnostic"?"Deep Diagnostic":"Initial Assessment"}),a.jsx("p",{className:"text-sm text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),a.jsxs("div",{className:"flex items-center gap-2 relative",children:[a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:()=>{p(!x),S(!1)},className:`relative w-10 h-10 rounded-xl flex items-center justify-center transition-all duration-200 border-2 ${x?"bg-sky-100 border-sky-300 text-sky-700 shadow-sm":"bg-white border-[#dde3eb] text-slate-500 hover:text-sky-600 hover:border-sky-200 hover:bg-sky-50"}`,title:"Toggle Calculator",children:a.jsx(Un,{size:20})}),a.jsx(Ke,{children:e&&l==="test"&&j&&!x&&a.jsxs(J.div,{initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},className:"absolute right-0 top-full mt-3 w-[260px] bg-[#0a1628] text-white border border-[#2a3648] rounded-2xl p-4 shadow-2xl z-50 pointer-events-none",children:[a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-sky-500/20 flex items-center justify-center flex-shrink-0",children:a.jsx(Un,{size:16,className:"text-sky-400"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-bold text-sm mb-1",children:"Calculator Available"}),a.jsx("p",{className:"text-xs text-slate-300 leading-relaxed",children:"You can freely use the scientific calculator at any time during this quiz."})]})]}),a.jsx("div",{className:"absolute -top-2 right-4 w-4 h-4 bg-[#0a1628] border-l border-t border-[#2a3648] rotate-45 rounded-tl-sm"})]})})]}),a.jsx("button",{onClick:()=>{L()},className:"w-10 h-10 rounded-xl flex items-center justify-center text-slate-500 border-2 border-transparent hover:text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] transition-all",title:"Close assessment",children:a.jsx(Xe,{size:20})})]})]}),a.jsx("div",{className:"p-8 overflow-y-auto",children:a.jsxs(Ke,{mode:"wait",children:[l==="intro"&&a.jsxs(J.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"text-center space-y-6",children:[a.jsx("div",{className:"w-32 h-32 bg-sky-50 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(Un,{size:64,className:"text-sky-600"})}),a.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:o==="followup_diagnostic"?"Let's close the gaps":"Welcome to MathPulse AI!"}),a.jsx("p",{className:"text-[#5a6578] max-w-md mx-auto leading-relaxed",children:o==="followup_diagnostic"?"You have pending weak-area checks from your initial assessment. Complete this deep diagnostic to unlock regular modules and practice.":`To personalize your learning path, complete a DepEd competency-based SHS diagnostic (${wr.length} items, around ${M} minutes).`}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-lg mx-auto text-left",children:[a.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[a.jsx(Kn,{size:16,className:"text-teal-500"}),"Personalized Path"]}),a.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Get recommendations based on your level."})]}),a.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[a.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[a.jsx(Gt,{size:16,className:"text-rose-500"}),"Identify Risks"]}),a.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Spot areas that need more attention early."})]})]}),a.jsxs("div",{className:"pt-4 space-y-3",children:[a.jsx(pe,{onClick:P,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-8 py-6 rounded-xl text-lg font-bold shadow-lg shadow-sky-200 w-full max-w-xs mx-auto",children:o==="followup_diagnostic"?"Start Deep Diagnostic":"Start Assessment"}),a.jsx("button",{onClick:()=>{D()},className:"block mx-auto text-sm text-slate-500 hover:text-[#5a6578] transition-colors font-medium",children:"Skip for now →"})]})]},"intro"),l==="test"&&a.jsxs(J.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-8",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm font-bold text-[#5a6578] mb-2",children:[a.jsxs("span",{children:["Question ",d+1," of ",wr.length]}),a.jsxs("span",{children:[T,"% Completed"]})]}),a.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden mb-8",children:a.jsx(J.div,{className:"h-full bg-sky-600 rounded-full",initial:{width:0},animate:{width:`${T}%`}})}),a.jsxs("div",{className:"bg-[#edf1f7] p-6 rounded-2xl border border-[#dde3eb] mb-6",children:[a.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500 mb-2",children:[x5[B.topicArea]," • ",B.difficulty]}),a.jsx("h3",{className:"text-xl font-bold text-[#0a1628] leading-relaxed",children:B.prompt})]}),(B.answerType==="MCQ"||B.answerType==="confidenceLikert")&&a.jsx("div",{className:"grid grid-cols-1 gap-3",children:(B.options||[]).map((K,X)=>a.jsxs("button",{onClick:()=>Y(X),className:"w-full text-left p-4 rounded-xl border-2 border-[#dde3eb] hover:border-indigo-600 hover:bg-sky-50 transition-all font-medium text-[#0a1628] group flex items-center justify-between",children:[a.jsxs("span",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"w-8 h-8 rounded-lg bg-white border border-[#dde3eb] flex items-center justify-center text-sm font-bold text-[#5a6578] group-hover:border-sky-300 group-hover:text-sky-600",children:String.fromCharCode(65+X)}),K]}),a.jsx(jn,{size:18,className:"opacity-0 group-hover:opacity-100 text-sky-600 transition-opacity"})]},X))}),(B.answerType==="shortAnswerNumeric"||B.answerType==="shortAnswerText")&&a.jsxs("div",{className:"space-y-3",children:[B.answerType==="shortAnswerNumeric"?a.jsx(a.Fragment,{children:a.jsx(QC,{value:h,onChange:g,placeholder:"Type numeric answer",onSubmit:V,onCalculatorOpen:()=>{p(!0),S(!1)}})}):a.jsx("input",{id:"diagnostic-short-answer",name:"diagnostic-short-answer","aria-label":"Short answer response",value:h,onChange:K=>g(K.target.value),onKeyDown:K=>{K.key==="Enter"&&V()},className:"w-full p-4 rounded-xl border-2 border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-200 focus:border-sky-500",placeholder:"Type short answer"}),a.jsx(pe,{onClick:V,disabled:!h.trim(),className:"w-full bg-sky-600 hover:bg-sky-700 text-white py-3 rounded-xl font-bold",children:"Submit Answer"})]})]},"test"),l==="results"&&a.jsxs(J.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center space-y-6",children:[a.jsx("div",{className:"w-24 h-24 bg-teal-100 rounded-full flex items-center justify-center mx-auto mb-4 animate-bounce",children:a.jsx(Kn,{size:48,className:"text-teal-600"})}),a.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:"Assessment Completed!"}),a.jsx("p",{className:"text-[#5a6578]",children:"We computed topic-level placement from your IAR responses."}),a.jsxs("div",{className:"bg-[#edf1f7] rounded-2xl p-6 border border-[#dde3eb] text-left space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:a.jsx(wn,{size:18,strokeWidth:2.4})}),a.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Topic Analysis"})]}),a.jsx("div",{className:"space-y-3",children:y&&Object.keys(y).map(K=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-xl border border-[#dde3eb]",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-[#0a1628]",children:x5[K]}),a.jsxs("p",{className:"text-xs text-slate-500",children:[y[K].correct,"/",y[K].total," correct • ",y[K].scorePercent,"%"]})]}),a.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-lg flex items-center gap-1 ${bre(y[K].classification)}`,children:[y[K].classification==="Mastered"?a.jsx(ot,{size:12}):a.jsx(Gt,{size:12}),yre(y[K].classification)]})]},K))})]}),b&&a.jsxs("div",{className:"bg-sky-50 rounded-2xl p-6 border border-sky-100 text-left space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:a.jsx(lr,{size:18,strokeWidth:2.4})}),a.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Grade 12 Readiness Signals"})]}),a.jsx("p",{className:"text-xs text-slate-600",children:"These indicators come from challenge and candidate items only."}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 text-xs",children:[a.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${b.readyForFiniteMath?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Finite Math: ",b.readyForFiniteMath?"Ready":"Build More"]}),a.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${b.readyForAdvancedStats?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Advanced Stats: ",b.readyForAdvancedStats?"Ready":"Build More"]}),a.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${b.readyForCalcIntro?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Calculus Intro: ",b.readyForCalcIntro?"Ready":"Build More"]})]})]}),k.length>0&&a.jsxs("div",{className:"flex items-start gap-3 p-4 bg-rose-50 border border-rose-100 rounded-xl text-left",children:[a.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-rose-100 border border-rose-200 flex items-center justify-center text-rose-600 shadow-inner shrink-0",children:a.jsx(Gt,{size:18,strokeWidth:2.3})}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-display font-black text-[20px] tracking-tight text-rose-800 leading-none mb-1",children:"Attention Needed"}),a.jsxs("p",{className:"text-rose-700 text-xs mt-1",children:["We flagged ",k.length," topic area",k.length>1?"s":""," for review. In IAR + Diagnostic mode, focused deep diagnostics may launch before full unlock."]})]})]}),a.jsx("div",{className:"pt-4",children:a.jsx(pe,{onClick:E,className:"bg-sky-600 hover:bg-sky-700 text-white px-8 py-4 rounded-xl text-lg font-bold w-full",children:"Go to Dashboard"})})]},"results")]})})]}),a.jsx(Ke,{children:x&&a.jsxs(J.div,{drag:!0,dragMomentum:!1,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{type:"spring",damping:25,stiffness:200},style:{position:"absolute",top:"50%",left:"calc(50% + 390px)",y:"-50%"},className:"w-[420px] max-w-[calc(100vw-24px)] bg-white rounded-3xl shadow-2xl border border-slate-200 flex flex-col pointer-events-auto overflow-hidden z-[60]",onClick:K=>K.stopPropagation(),children:[a.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0 cursor-move",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-xl bg-sky-100 flex items-center justify-center text-sky-600",children:a.jsx(Un,{size:18})}),a.jsx("h3",{className:"font-bold text-[#0a1628] select-none",children:"Scientific Calc"})]}),a.jsx("button",{onClick:K=>{K.stopPropagation(),p(!1)},className:"w-8 h-8 flex items-center justify-center text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-lg transition-colors cursor-pointer",title:"Close Calculator",children:a.jsx(Xe,{size:16})})]}),a.jsx("div",{className:"p-4 bg-[#f7f9fc]",children:a.jsx(C0,{isOpen:!0,onClose:()=>p(!1),inline:!0})})]})})]}):null},wre=()=>{const{isLoggedIn:e,userProfile:t,userRole:n,loading:r}=$t(),[s,i]=v.useState("Dashboard"),o=v.useRef(null),l=v.useRef(null),[c,d]=v.useState(!1),f=t,[u,m]=v.useState(f?.level||1),[h,g]=v.useState(f?.currentXP||0),[x,p]=v.useState(f?.totalXP||0),j=Math.floor(100*Math.pow(1.5,u-1)),[S,y]=v.useState(f?.streak||0),[N,b]=v.useState(!1),[w,k]=v.useState({show:!1,xp:0,message:""}),[A,C]=v.useState(!1),[F,D]=v.useState(!1),[L,P]=v.useState(!1),[H,Y]=v.useState(!1),[V,O]=v.useState({}),[E,B]=v.useState(!1),[T,M]=v.useState(f?.hasTakenDiagnostic||!1),[K,X]=v.useState(f?.atRiskSubjects||[]),[I,Z]=v.useState(f?.gpa||"0.00");v.useEffect(()=>{e&&n==="student"&&t&&Is(t.uid).then(te=>{if(te&&te.averageScore>0){const se=Math.min(te.averageScore/25,4).toFixed(2);Z(se)}}).catch(te=>console.error("Error loading progress for GPA:",te))},[e,n,t]);const[ne,ee]=v.useState(!1);v.useEffect(()=>{f&&n==="student"?(m(f.level||1),g(f.currentXP||0),p(f.totalXP||0),y(f.streak||0),X(f.atRiskSubjects||[]),M(f.hasTakenDiagnostic||!1),ee(!0)):n!=="student"&&ee(!0)},[t,n]),v.useEffect(()=>{e&&n==="student"&&t&&Yne(t.uid).then(te=>{y(te)})},[e,n,t]),v.useEffect(()=>{O({})},[t?.uid]),v.useEffect(()=>{if(e&&n==="student"&&!T){const te=setTimeout(()=>{B(!0)},1e3);return()=>clearTimeout(te)}},[e,n,T]);const $=te=>{X(te),M(!0),B(!1),i("Dashboard")},_=()=>{i("AI Chat")},Q=async(te,se)=>{if(t)try{const q=await kM(t.uid,te,"manual",se);g(W=>{const de=W+te;return q.leveledUp?(m(q.newLevel),de%j):de}),p(W=>W+te),k({show:!0,xp:te,message:se})}catch(q){console.error("Error awarding XP:",q)}},R=async()=>{try{await TL(),O({}),i("Dashboard"),C(!1)}catch(te){console.error("Error logging out:",te)}},G=async te=>{if(!t){P(!1),D(!1);return}const se={};["name","email","phone","photo","lrn","grade","section","school","enrollmentDate","major","gpa","department","subject","yearsOfExperience","qualification","position"].forEach(W=>{te[W]!==void 0&&(se[W]=te[W])});try{await $C(t.uid,se),O(W=>({...W,...se})),P(!1),D(!1),ue.success("Profile updated successfully")}catch(W){console.error("Error saving profile:",W),ue.error("Failed to update profile")}},ae=t?{uid:t.uid,name:t.name,email:t.email,phone:t.phone||"",photo:t.photo||"https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=200&h=200&fit=crop",role:t.role,...n==="student"&&f?{lrn:f.lrn,grade:f.grade,section:f.section,school:f.school,enrollmentDate:f.enrollmentDate,major:f.major,gpa:I}:{},...V}:{uid:void 0,name:"User",email:"",phone:"",photo:"https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=200&h=200&fit=crop",role:n},re=ae.name.trim().split(/\s+/).find(te=>/\p{L}/u.test(te))||ae.name.trim()||"User";return r?a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[#f7f9fc]",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-sky-600 mx-auto"}),a.jsx("p",{className:"mt-4 text-[#5a6578] font-body",children:"Loading MathPulse AI..."})]})}):(v.useEffect(()=>{const te=se=>{if(!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&se.altKey)switch(se.key.toLowerCase()){case"d":se.preventDefault(),i("Dashboard");break;case"m":se.preventDefault(),i("Modules");break;case"c":se.preventDefault(),i("AI Chat");break;case"g":se.preventDefault(),i("Grades");break;case"s":se.preventDefault(),D(!0);break;case"p":se.preventDefault(),P(!0);break;case"k":se.preventDefault(),Y(q=>!q);break}};if(e&&n==="student")return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[e,n]),e?n==="teacher"?a.jsxs(a.Fragment,{children:[a.jsx(one,{onLogout:R,onOpenProfile:()=>P(!0)}),a.jsx($p,{isOpen:L,onClose:()=>P(!1),profileData:ae,onSave:G}),a.jsx(Ep,{position:"top-right",richColors:!0,closeButton:!0})]}):n==="admin"?a.jsxs(a.Fragment,{children:[a.jsx(Hne,{onLogout:R,onOpenProfile:()=>P(!0)}),a.jsx($p,{isOpen:L,onClose:()=>P(!1),profileData:ae,onSave:G}),a.jsx(Ep,{position:"top-right",richColors:!0,closeButton:!0})]}):a.jsxs(a.Fragment,{children:[a.jsx(Vz,{children:a.jsxs("div",{className:"flex h-screen w-full bg-[#f7f9fc] overflow-hidden",children:[a.jsx(DC,{activeTab:s,setActiveTab:i,userRole:n,onOpenSettings:()=>D(!0),onLogout:()=>C(!0)}),a.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[a.jsxs("header",{className:"bg-white/80 backdrop-blur-md border-b border-[#dde3eb] px-6 py-3 flex items-center justify-between sticky top-0 z-30",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-display font-bold text-[#0a1628] leading-tight",children:s}),a.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:["Welcome back, ",ae.name.split(" ")[0],"!"]})]}),a.jsxs("div",{className:"hidden md:flex items-center gap-2 ml-2",children:[a.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-1.5 px-3 py-1.5 bg-rose-50 hover:bg-rose-100 border border-rose-200/60 rounded-lg transition-colors cursor-pointer group",title:"View Rewards & Progress",children:[a.jsx(Cr,{className:"h-3.5 w-3.5 text-rose-500","aria-hidden":"true"}),a.jsxs("span",{className:"text-xs font-display font-bold text-rose-700",children:["Lv ",u]})]}),a.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-1.5 px-3 py-1.5 bg-sky-50 hover:bg-sky-100 border border-sky-200/60 rounded-lg transition-colors cursor-pointer",title:`${h}/${j} XP to next level`,children:[a.jsx(Jn,{className:"h-3.5 w-3.5 text-sky-500","aria-hidden":"true"}),a.jsxs("span",{className:"text-xs font-display font-bold text-sky-700",children:[h," XP"]}),a.jsx("div",{className:"w-12 h-1.5 bg-sky-100 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-sky-500 rounded-full transition-all",style:{width:`${h/j*100}%`}})})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-orange-50 border border-orange-200/60 rounded-lg",children:[a.jsx(Nn,{className:"h-3.5 w-3.5 text-orange-500","aria-hidden":"true"}),a.jsxs("span",{className:"text-xs font-display font-bold text-orange-700",children:[S," day",S!==1?"s":""]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(nre,{onSelect:te=>{}}),a.jsx("button",{onClick:()=>Y(te=>!te),className:"p-2 rounded-lg bg-[#edf1f7] hover:bg-[#dde3eb] text-[#5a6578] hover:text-sky-600 transition-all group",title:"Scientific Calculator (Alt+K)",children:a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"group-hover:scale-110 transition-transform",children:[a.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),a.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"}),a.jsx("line",{x1:"16",x2:"16",y1:"14",y2:"18"}),a.jsx("path",{d:"M16 10h.01"}),a.jsx("path",{d:"M12 10h.01"}),a.jsx("path",{d:"M8 10h.01"}),a.jsx("path",{d:"M12 14h.01"}),a.jsx("path",{d:"M8 14h.01"}),a.jsx("path",{d:"M12 18h.01"}),a.jsx("path",{d:"M8 18h.01"})]})}),a.jsx(tre,{userRole:n}),a.jsxs("button",{onClick:()=>P(!0),className:"flex items-center gap-2.5 w-[152px] h-11 shrink-0 bg-[#edf1f7] hover:bg-[#dde3eb] p-1.5 pr-3 rounded-lg cursor-pointer transition-all group","aria-label":`Profile: ${ae.name}`,children:[a.jsx("img",{src:ae.photo,alt:ae.name,className:"w-8 h-8 rounded-lg object-cover"}),a.jsx("div",{className:"text-left min-w-0 flex-1",children:a.jsx("p",{className:"text-sm font-semibold text-[#0a1628] leading-none group-hover:text-sky-600 transition-colors font-body truncate",children:re})})]})]})]}),a.jsx("main",{ref:l,className:"flex-1 overflow-y-auto p-3 lg:p-4",children:a.jsx(Ke,{mode:"wait",children:a.jsx(J.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.25,ease:[.22,1,.36,1]},children:s==="Dashboard"?a.jsxs("div",{className:"space-y-4 pb-4",children:[a.jsx(vL,{userName:re,userLevel:u,onContinueLearning:()=>i("Modules")}),a.jsx(yx,{variant:"full",atRiskSubjects:K,onAction:()=>i("Modules")}),a.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[a.jsx("div",{className:"col-span-12 xl:col-span-9",children:ne&&a.jsx($L,{onNavigateToModules:()=>i("Modules"),atRiskSubjects:K})}),a.jsx("div",{className:"col-span-12 xl:col-span-3",children:a.jsx(GL,{onOpenRewards:()=>b(!0),userLevel:u,currentXP:h,xpToNextLevel:j,streak:S})})]})]}):s==="Modules"?a.jsx(ez,{onEarnXP:Q,atRiskSubjects:K}):s==="Leaderboard"?a.jsx(mre,{}):s==="AI Chat"?a.jsx(Wz,{}):s==="Grades"?a.jsx(rre,{}):s==="Avatar Shop"?a.jsx(dre,{}):a.jsxs("div",{className:"flex-1 flex items-center justify-center text-[#a8a5b3] font-medium font-body",children:[s," Content Coming Soon"]})},s)})}),s!=="AI Chat"&&a.jsx("div",{className:"fixed bottom-8 right-8 z-50",children:a.jsx(Kz,{constraintsRef:o,onFullScreen:_})}),a.jsx(Xz,{xp:w.xp,message:w.message,show:w.show,onComplete:()=>k(te=>({...te,show:!1}))}),a.jsx(Yz,{isOpen:N,onClose:()=>b(!1),userLevel:u,currentXP:h,xpToNextLevel:j,totalXP:x,streak:S}),a.jsx($p,{isOpen:L,onClose:()=>P(!1),profileData:ae,onSave:G}),a.jsx(Ua,{isOpen:A,onClose:()=>C(!1),onConfirm:R,title:"Confirm Logout",message:"Are you sure you want to log out? Your progress is saved automatically.",confirmText:"Logout",cancelText:"Stay",type:"warning",icon:"logout"}),a.jsx(ure,{isOpen:F,onClose:()=>D(!1),profileData:ae,onSave:G}),a.jsx(C0,{isOpen:H,onClose:()=>Y(!1)}),a.jsx(vre,{isOpen:E,onClose:()=>B(!1),onComplete:$,lrn:f?.lrn||t?.uid,gradeLevel:f?.grade})]})]})}),a.jsx(Ep,{position:"top-right",richColors:!0,closeButton:!0})]}):a.jsx(Xne,{}))};let y5=!1;const v5=()=>{y5||(y5=!0,Lr(()=>Promise.resolve({}),__vite__mapDeps([11])).catch(e=>{console.error("[styles] Deferred full stylesheet failed to load:",e)}))};if(typeof window<"u"){const e=window.requestIdleCallback,t=window.cancelIdleCallback,n=e?.(()=>{v5()},{timeout:1200});window.setTimeout(()=>{n!==void 0&&t&&t(n),v5()},1200)}const TM=document.getElementById("root");if(!TM)throw new Error("Root element not found");UM.createRoot(TM).render(a.jsx(PL,{children:a.jsx(wre,{})}));export{fe as d,El as g,J as m}; diff --git a/assets/index-C6dybEZ6.css b/assets/index-C6dybEZ6.css deleted file mode 100644 index cb9364f1af5ad9a483594a3c073cf48f7582e564..0000000000000000000000000000000000000000 --- a/assets/index-C6dybEZ6.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-300:oklch(90.5% .182 98.111);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-teal-50:oklch(98.4% .014 180.72);--color-teal-100:oklch(95.3% .051 180.801);--color-teal-200:oklch(91% .096 180.426);--color-teal-300:oklch(85.5% .138 181.071);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-teal-600:oklch(60% .118 184.704);--color-teal-700:oklch(51.1% .096 186.391);--color-teal-800:oklch(43.7% .078 188.216);--color-teal-900:oklch(38.6% .063 188.416);--color-cyan-50:oklch(98.4% .019 200.873);--color-cyan-100:oklch(95.6% .045 203.388);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-200:var(--color-violet-200);--color-sky-700:var(--color-violet-700);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-violet-50:oklch(96.9% .016 293.756);--color-violet-100:oklch(94.3% .029 294.588);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-600:oklch(54.1% .281 293.009);--color-violet-700:oklch(49.1% .27 292.581);--color-violet-800:oklch(43.2% .232 292.759);--color-violet-900:oklch(38% .189 293.745);--color-violet-950:oklch(28.3% .141 291.089);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-fuchsia-50:oklch(97.7% .017 320.058);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-100:oklch(94.1% .03 12.58);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-700:oklch(51.4% .222 16.935);--color-rose-800:oklch(45.5% .188 13.697);--color-rose-900:oklch(41% .159 10.272);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-700:oklch(37% .013 285.805);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground);font-family:var(--font-body);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-family:var(--font-display);font-size:var(--text-2xl);letter-spacing:-.02em;font-weight:700;line-height:1.3}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-family:var(--font-display);font-size:var(--text-xl);letter-spacing:-.01em;font-weight:700;line-height:1.35}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-family:var(--font-display);font-size:var(--text-lg);font-weight:600;line-height:1.4}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4{font-family:var(--font-display);font-size:var(--text-base);font-weight:600;line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-x-\[-20px\]{inset-inline:-20px}.inset-y-0{inset-block:calc(var(--spacing)*0)}.end-1{inset-inline-end:calc(var(--spacing)*1)}.-top-1{top:calc(var(--spacing)*-1)}.-top-2{top:calc(var(--spacing)*-2)}.-top-3{top:calc(var(--spacing)*-3)}.-top-4{top:calc(var(--spacing)*-4)}.-top-5{top:calc(var(--spacing)*-5)}.-top-6{top:calc(var(--spacing)*-6)}.-top-8{top:calc(var(--spacing)*-8)}.-top-12{top:calc(var(--spacing)*-12)}.-top-20{top:calc(var(--spacing)*-20)}.-top-24{top:calc(var(--spacing)*-24)}.-top-32{top:calc(var(--spacing)*-32)}.-top-40{top:calc(var(--spacing)*-40)}.top-0{top:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-1\.5{top:calc(var(--spacing)*1.5)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:calc(var(--spacing)*2)}.top-3{top:calc(var(--spacing)*3)}.top-3\.5{top:calc(var(--spacing)*3.5)}.top-4{top:calc(var(--spacing)*4)}.top-5{top:calc(var(--spacing)*5)}.top-6{top:calc(var(--spacing)*6)}.top-8{top:calc(var(--spacing)*8)}.top-24{top:calc(var(--spacing)*24)}.top-\[-10\%\]{top:-10%}.top-\[-20\%\]{top:-20%}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.-right-1{right:calc(var(--spacing)*-1)}.-right-2{right:calc(var(--spacing)*-2)}.-right-3{right:calc(var(--spacing)*-3)}.-right-4{right:calc(var(--spacing)*-4)}.-right-12{right:calc(var(--spacing)*-12)}.-right-32{right:calc(var(--spacing)*-32)}.-right-40{right:calc(var(--spacing)*-40)}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-1\/3{right:33.3333%}.right-1\/4{right:25%}.right-2{right:calc(var(--spacing)*2)}.right-2\.5{right:calc(var(--spacing)*2.5)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.right-6{right:calc(var(--spacing)*6)}.right-12{right:calc(var(--spacing)*12)}.right-\[-5\%\]{right:-5%}.right-\[-10\%\]{right:-10%}.right-\[-20\%\]{right:-20%}.right-\[150px\]{right:150px}.right-full{right:100%}.-bottom-2{bottom:calc(var(--spacing)*-2)}.-bottom-5{bottom:calc(var(--spacing)*-5)}.-bottom-6{bottom:calc(var(--spacing)*-6)}.-bottom-8{bottom:calc(var(--spacing)*-8)}.-bottom-10{bottom:calc(var(--spacing)*-10)}.-bottom-12{bottom:calc(var(--spacing)*-12)}.-bottom-32{bottom:calc(var(--spacing)*-32)}.-bottom-40{bottom:calc(var(--spacing)*-40)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-8{bottom:calc(var(--spacing)*8)}.bottom-12{bottom:calc(var(--spacing)*12)}.bottom-16{bottom:calc(var(--spacing)*16)}.bottom-20{bottom:calc(var(--spacing)*20)}.bottom-\[-20\%\]{bottom:-20%}.bottom-\[-50px\]{bottom:-50px}.bottom-\[-500px\]{bottom:-500px}.bottom-full{bottom:100%}.-left-2{left:calc(var(--spacing)*-2)}.-left-6{left:calc(var(--spacing)*-6)}.-left-10{left:calc(var(--spacing)*-10)}.-left-12{left:calc(var(--spacing)*-12)}.-left-32{left:calc(var(--spacing)*-32)}.-left-40{left:calc(var(--spacing)*-40)}.left-0{left:calc(var(--spacing)*0)}.left-1{left:calc(var(--spacing)*1)}.left-1\/2{left:50%}.left-1\/3{left:33.3333%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-3\.5{left:calc(var(--spacing)*3.5)}.left-4{left:calc(var(--spacing)*4)}.left-6{left:calc(var(--spacing)*6)}.left-12{left:calc(var(--spacing)*12)}.left-\[-10\%\]{left:-10%}.left-\[50\%\]{left:50%}.left-\[54px\]{left:54px}.left-\[56px\]{left:56px}.left-full{left:100%}.isolate{isolation:isolate}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.z-\[3\]{z-index:3}.z-\[4\]{z-index:4}.z-\[11\]{z-index:11}.z-\[12\]{z-index:12}.z-\[13\]{z-index:13}.z-\[51\]{z-index:51}.z-\[60\]{z-index:60}.z-\[70\]{z-index:70}.z-\[100\]{z-index:100}.z-\[130\]{z-index:130}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-12{grid-column:span 12/span 12}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.my-0\.5{margin-block:calc(var(--spacing)*.5)}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.25em;font-weight:600}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.prose{--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:oklab(21% -.00316127 -.0338527/.1);--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733);font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.-mt-0\.5{margin-top:calc(var(--spacing)*-.5)}.-mt-1{margin-top:calc(var(--spacing)*-1)}.-mt-4{margin-top:calc(var(--spacing)*-4)}.-mt-24{margin-top:calc(var(--spacing)*-24)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-\[-10px\]{margin-top:-10px}.mt-\[-20px\]{margin-top:-20px}.mt-\[5px\]{margin-top:5px}.mt-auto{margin-top:auto}.-mr-24{margin-right:calc(var(--spacing)*-24)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mr-4{margin-right:calc(var(--spacing)*4)}.-mb-18{margin-bottom:calc(var(--spacing)*-18)}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-\[-10px\]{margin-bottom:-10px}.-ml-4{margin-left:calc(var(--spacing)*-4)}.-ml-18{margin-left:calc(var(--spacing)*-18)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-11{margin-left:calc(var(--spacing)*11)}.ml-12{margin-left:calc(var(--spacing)*12)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.aspect-\[4\/5\]{aspect-ratio:4/5}.aspect-square{aspect-ratio:1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-full{width:100%;height:100%}.h-0{height:calc(var(--spacing)*0)}.h-1{height:calc(var(--spacing)*1)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-4\/5{height:80%}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-28{height:calc(var(--spacing)*28)}.h-32{height:calc(var(--spacing)*32)}.h-36{height:calc(var(--spacing)*36)}.h-48{height:calc(var(--spacing)*48)}.h-64{height:calc(var(--spacing)*64)}.h-80{height:calc(var(--spacing)*80)}.h-96{height:calc(var(--spacing)*96)}.h-\[1\.15rem\]{height:1.15rem}.h-\[1px\]{height:1px}.h-\[2px\]{height:2px}.h-\[5px\]{height:5px}.h-\[25px\]{height:25px}.h-\[34px\]{height:34px}.h-\[45vh\]{height:45vh}.h-\[50\%\]{height:50%}.h-\[52px\]{height:52px}.h-\[60\%\]{height:60%}.h-\[64px\]{height:64px}.h-\[72px\]{height:72px}.h-\[75px\]{height:75px}.h-\[80\%\]{height:80%}.h-\[85vh\]{height:85vh}.h-\[100px\]{height:100px}.h-\[100vh\]{height:100vh}.h-\[110\%\]{height:110%}.h-\[140px\]{height:140px}.h-\[150vh\]{height:150vh}.h-\[170px\]{height:170px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[300vw\]{height:300vw}.h-\[400px\]{height:400px}.h-\[420px\]{height:420px}.h-\[500px\]{height:500px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[calc\(100\%-24px\)\]{height:calc(100% - 24px)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-context-menu-content-available-height\){max-height:var(--radix-context-menu-content-available-height)}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-72{max-height:calc(var(--spacing)*72)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[70vh\]{max-height:70vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[300px\]{max-height:300px}.max-h-\[500px\]{max-height:500px}.max-h-\[600px\]{max-height:600px}.max-h-\[700px\]{max-height:700px}.max-h-\[850px\]{max-height:850px}.max-h-\[calc\(85vh-280px\)\]{max-height:calc(85vh - 280px)}.max-h-\[calc\(90vh-200px\)\]{max-height:calc(90vh - 200px)}.max-h-\[calc\(90vh-320px\)\]{max-height:calc(90vh - 320px)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-4{min-height:calc(var(--spacing)*4)}.min-h-11{min-height:calc(var(--spacing)*11)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\[24px\]{min-height:24px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[56px\]{min-height:56px}.min-h-\[80px\]{min-height:80px}.min-h-\[140px\]{min-height:140px}.min-h-\[170px\]{min-height:170px}.min-h-\[200px\]{min-height:200px}.min-h-\[240px\]{min-height:240px}.min-h-\[250px\]{min-height:250px}.min-h-\[290px\]{min-height:290px}.min-h-\[320px\]{min-height:320px}.min-h-\[450px\]{min-height:450px}.min-h-\[500px\]{min-height:500px}.min-h-\[600px\]{min-height:600px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-0{width:calc(var(--spacing)*0)}.w-0\.5{width:calc(var(--spacing)*.5)}.w-1{width:calc(var(--spacing)*1)}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-4\/5{width:80%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-8\/12{width:66.6667%}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-10\/12{width:83.3333%}.w-11{width:calc(var(--spacing)*11)}.w-11\/12{width:91.6667%}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-32{width:calc(var(--spacing)*32)}.w-36{width:calc(var(--spacing)*36)}.w-40{width:calc(var(--spacing)*40)}.w-44{width:calc(var(--spacing)*44)}.w-48{width:calc(var(--spacing)*48)}.w-52{width:calc(var(--spacing)*52)}.w-56{width:calc(var(--spacing)*56)}.w-64{width:calc(var(--spacing)*64)}.w-72{width:calc(var(--spacing)*72)}.w-80{width:calc(var(--spacing)*80)}.w-96{width:calc(var(--spacing)*96)}.w-\[5px\]{width:5px}.w-\[28\%\]{width:28%}.w-\[34px\]{width:34px}.w-\[35\%\]{width:35%}.w-\[46px\]{width:46px}.w-\[50\%\]{width:50%}.w-\[52px\]{width:52px}.w-\[60\%\]{width:60%}.w-\[70px\]{width:70px}.w-\[78px\]{width:78px}.w-\[90\%\]{width:90%}.w-\[95\%\]{width:95%}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[150vw\]{width:150vw}.w-\[152px\]{width:152px}.w-\[168px\]{width:168px}.w-\[220px\]{width:220px}.w-\[250vw\]{width:250vw}.w-\[260px\]{width:260px}.w-\[280px\]{width:280px}.w-\[300vw\]{width:300vw}.w-\[350px\]{width:350px}.w-\[400px\]{width:400px}.w-\[420px\]{width:420px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-20{max-width:calc(var(--spacing)*20)}.max-w-\[70\%\]{max-width:70%}.max-w-\[75\%\]{max-width:75%}.max-w-\[120px\]{max-width:120px}.max-w-\[145px\]{max-width:145px}.max-w-\[190px\]{max-width:190px}.max-w-\[200px\]{max-width:200px}.max-w-\[220px\]{max-width:220px}.max-w-\[340px\]{max-width:340px}.max-w-\[420px\]{max-width:420px}.max-w-\[450px\]{max-width:450px}.max-w-\[800px\]{max-width:800px}.max-w-\[1200px\]{max-width:1200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-\[calc\(100vw-24px\)\]{max-width:calc(100vw - 24px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-max{max-width:max-content}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-5{min-width:calc(var(--spacing)*5)}.min-w-8{min-width:calc(var(--spacing)*8)}.min-w-9{min-width:calc(var(--spacing)*9)}.min-w-10{min-width:calc(var(--spacing)*10)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[60px\]{min-width:60px}.min-w-\[140px\]{min-width:140px}.min-w-\[260px\]{min-width:260px}.min-w-\[280px\]{min-width:280px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\(--radix-context-menu-content-transform-origin\){transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-hover-card-content-transform-origin\){transform-origin:var(--radix-hover-card-content-transform-origin)}.origin-\(--radix-menubar-content-transform-origin\){transform-origin:var(--radix-menubar-content-transform-origin)}.origin-\(--radix-popover-content-transform-origin\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-\[50\%_45\%\]{transform-origin:50% 45%}.origin-bottom{transform-origin:bottom}.origin-bottom-right{transform-origin:100% 100%}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-1\/3{--tw-translate-x:calc(calc(1/3*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-1\/4{--tw-translate-x: -25% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/3{--tw-translate-x:calc(1/3*100%);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/4{--tw-translate-x: 25% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-10px\]{--tw-translate-x:-10px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0\.5{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-1{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-1\/2{--tw-translate-y: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-1\/3{--tw-translate-y:calc(1/3*100%);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-10{--tw-translate-y:calc(var(--spacing)*10);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[21\%\]{--tw-translate-y:21%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-full{--tw-translate-y:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-y-75{--tw-scale-y:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-\[0\.98\]{scale:.98}.scale-\[1\.02\]{scale:1.02}.scale-\[1\.25\]{scale:1.25}.-rotate-90{rotate:-90deg}.rotate-12{rotate:12deg}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.rotate-\[-3deg\]{rotate:-3deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-\[shimmer_2s_infinite\]{animation:2s infinite shimmer}.animate-bounce{animation:var(--animate-bounce)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-manipulation{touch-action:manipulation}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.snap-center{scroll-snap-align:center}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing)*1)}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-start{justify-items:start}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}.gap-10{gap:calc(var(--spacing)*10)}.gap-12{gap:calc(var(--spacing)*12)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*10)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*10)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing)*4)}.gap-x-6{column-gap:calc(var(--spacing)*6)}:where(.-space-x-2\.5>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*-2.5)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*-2.5)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing)*.5)}.gap-y-1{row-gap:calc(var(--spacing)*1)}.gap-y-8{row-gap:calc(var(--spacing)*8)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[\#dde3eb\]>:not(:last-child)){border-color:#dde3eb}:where(.divide-\[\#edf1f7\]>:not(:last-child)){border-color:#edf1f7}:where(.divide-border>:not(:last-child)){border-color:var(--border)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\[-20px\]{border-radius:-20px}.rounded-\[1\.2rem\]{border-radius:1.2rem}.rounded-\[1\.3rem\]{border-radius:1.3rem}.rounded-\[1\.4rem\]{border-radius:1.4rem}.rounded-\[1\.5rem\]{border-radius:1.5rem}.rounded-\[1rem\]{border-radius:1rem}.rounded-\[2\.5rem\]{border-radius:2.5rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[2rem\]{border-radius:2rem}.rounded-\[3rem\]{border-radius:3rem}.rounded-\[4px\]{border-radius:4px}.rounded-\[6px\]{border-radius:6px}.rounded-\[10px\]{border-radius:10px}.rounded-\[14px\]{border-radius:14px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[24px\]{border-radius:24px}.rounded-\[32px\]{border-radius:32px}.rounded-\[40px\]{border-radius:40px}.rounded-\[50\%\]{border-radius:50%}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-\[1\.2rem\]{border-top-left-radius:1.2rem;border-top-right-radius:1.2rem}.rounded-t-\[2\.5rem\]{border-top-left-radius:2.5rem;border-top-right-radius:2.5rem}.rounded-t-xl{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.rounded-tl-none{border-top-left-radius:0}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-r-full{border-top-right-radius:3.40282e38px;border-bottom-right-radius:3.40282e38px}.rounded-b-2xl{border-bottom-right-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-b-\[50\%\]{border-bottom-right-radius:50%;border-bottom-left-radius:50%}.rounded-b-\[60px\]{border-bottom-right-radius:60px;border-bottom-left-radius:60px}.rounded-b-md{border-bottom-right-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-br-sm{border-bottom-right-radius:calc(var(--radius) - 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-8{border-style:var(--tw-border-style);border-width:8px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[3px\]{border-style:var(--tw-border-style);border-width:3px}.border-\[4px\]{border-style:var(--tw-border-style);border-width:4px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.border-t-\[6px\]{border-top-style:var(--tw-border-style);border-top-width:6px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-4{border-right-style:var(--tw-border-style);border-right-width:4px}.border-r-\[6px\]{border-right-style:var(--tw-border-style);border-right-width:6px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-l-\[6px\]{border-left-style:var(--tw-border-style);border-left-width:6px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-\(--color-border\){border-color:var(--color-border)}.border-\[\#1FA7E1\]\/30{border-color:#1fa7e14d}.border-\[\#1FA7E1\]\/40{border-color:#1fa7e166}.border-\[\#2a3648\]{border-color:#2a3648}.border-\[\#8B5CF6\]\/40{border-color:#8b5cf666}.border-\[\#9956DE\]\/25{border-color:#9956de40}.border-\[\#F1F5F9\]{border-color:#f1f5f9}.border-\[\#FF8B8B\]{border-color:#ff8b8b}.border-\[\#FFB356\]{border-color:#ffb356}.border-\[\#b7d3ff\]{border-color:#b7d3ff}.border-\[\#d1cec6\]{border-color:#d1cec6}.border-\[\#dadce0\]{border-color:#dadce0}.border-\[\#dde3eb\]{border-color:#dde3eb}.border-\[\#edf1f7\]{border-color:#edf1f7}.border-\[\#fde68a\]{border-color:#fde68a}.border-amber-50{border-color:var(--color-amber-50)}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-200\/60{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/60{border-color:color-mix(in oklab,var(--color-amber-200)60%,transparent)}}.border-amber-300{border-color:var(--color-amber-300)}.border-amber-300\/70{border-color:#ffd236b3}@supports (color:color-mix(in lab,red,red)){.border-amber-300\/70{border-color:color-mix(in oklab,var(--color-amber-300)70%,transparent)}}.border-amber-400{border-color:var(--color-amber-400)}.border-blue-500{border-color:var(--color-blue-500)}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border)50%,transparent)}}.border-current{border-color:currentColor}.border-emerald-200{border-color:var(--color-emerald-200)}.border-emerald-200\/60{border-color:#a4f4cf99}@supports (color:color-mix(in lab,red,red)){.border-emerald-200\/60{border-color:color-mix(in oklab,var(--color-emerald-200)60%,transparent)}}.border-emerald-300{border-color:var(--color-emerald-300)}.border-emerald-400\/30{border-color:#00d2944d}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/30{border-color:color-mix(in oklab,var(--color-emerald-400)30%,transparent)}}.border-emerald-400\/80{border-color:#00d294cc}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/80{border-color:color-mix(in oklab,var(--color-emerald-400)80%,transparent)}}.border-emerald-600{border-color:var(--color-emerald-600)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-green-300{border-color:var(--color-green-300)}.border-green-500{border-color:var(--color-green-500)}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500)40%,transparent)}}.border-indigo-100{border-color:var(--color-indigo-100)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500)30%,transparent)}}.border-input{border-color:var(--input)}.border-orange-100{border-color:var(--color-orange-100)}.border-orange-200{border-color:var(--color-orange-200)}.border-orange-200\/60{border-color:#ffd7a899}@supports (color:color-mix(in lab,red,red)){.border-orange-200\/60{border-color:color-mix(in oklab,var(--color-orange-200)60%,transparent)}}.border-orange-400{border-color:var(--color-orange-400)}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500)40%,transparent)}}.border-primary,.border-primary\/60{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-primary\/60{border-color:color-mix(in oklab,var(--primary)60%,transparent)}}.border-red-100{border-color:var(--color-red-100)}.border-red-200{border-color:var(--color-red-200)}.border-red-200\/60{border-color:#ffcaca99}@supports (color:color-mix(in lab,red,red)){.border-red-200\/60{border-color:color-mix(in oklab,var(--color-red-200)60%,transparent)}}.border-red-300{border-color:var(--color-red-300)}.border-red-400{border-color:var(--color-red-400)}.border-red-500{border-color:var(--color-red-500)}.border-rose-100{border-color:var(--color-rose-100)}.border-rose-200{border-color:var(--color-rose-200)}.border-rose-200\/50{border-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/50{border-color:color-mix(in oklab,var(--color-rose-200)50%,transparent)}}.border-rose-200\/60{border-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/60{border-color:color-mix(in oklab,var(--color-rose-200)60%,transparent)}}.border-rose-300{border-color:var(--color-rose-300)}.border-rose-400{border-color:var(--color-rose-400)}.border-rose-500{border-color:var(--color-rose-500)}.border-rose-500\/30{border-color:#ff23574d}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/30{border-color:color-mix(in oklab,var(--color-rose-500)30%,transparent)}}.border-rose-600{border-color:var(--color-rose-600)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-sky-100{border-color:var(--color-violet-100)}.border-sky-200{border-color:var(--color-violet-200)}.border-sky-200\/50{border-color:#ddd6ff80}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/50{border-color:color-mix(in oklab,var(--color-violet-200)50%,transparent)}}.border-sky-200\/60{border-color:#ddd6ff99}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/60{border-color:color-mix(in oklab,var(--color-violet-200)60%,transparent)}}.border-sky-300{border-color:var(--color-violet-300)}.border-sky-400{border-color:var(--color-violet-400)}.border-sky-500{border-color:var(--color-violet-500)}.border-sky-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/30{border-color:color-mix(in oklab,var(--color-violet-500)30%,transparent)}}.border-sky-500\/40{border-color:#8d54ff66}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/40{border-color:color-mix(in oklab,var(--color-violet-500)40%,transparent)}}.border-sky-600{border-color:var(--color-violet-600)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\/60{border-color:#e2e8f099}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/60{border-color:color-mix(in oklab,var(--color-slate-200)60%,transparent)}}.border-slate-200\/70{border-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/70{border-color:color-mix(in oklab,var(--color-slate-200)70%,transparent)}}.border-slate-200\/80{border-color:#e2e8f0cc}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/80{border-color:color-mix(in oklab,var(--color-slate-200)80%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.border-slate-700{border-color:var(--color-slate-700)}.border-slate-800{border-color:var(--color-slate-800)}.border-slate-800\/10{border-color:#1d293d1a}@supports (color:color-mix(in lab,red,red)){.border-slate-800\/10{border-color:color-mix(in oklab,var(--color-slate-800)10%,transparent)}}.border-teal-100{border-color:var(--color-teal-100)}.border-teal-200{border-color:var(--color-teal-200)}.border-teal-400{border-color:var(--color-teal-400)}.border-teal-500{border-color:var(--color-teal-500)}.border-transparent{border-color:#0000}.border-violet-200{border-color:var(--color-violet-200)}.border-violet-200\/60{border-color:#ddd6ff99}@supports (color:color-mix(in lab,red,red)){.border-violet-200\/60{border-color:color-mix(in oklab,var(--color-violet-200)60%,transparent)}}.border-white{border-color:var(--color-white)}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-white\/25{border-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.border-white\/25{border-color:color-mix(in oklab,var(--color-white)25%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.border-white\/35{border-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.border-white\/35{border-color:color-mix(in oklab,var(--color-white)35%,transparent)}}.border-white\/50{border-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.border-white\/50{border-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.border-zinc-200{border-color:var(--color-zinc-200)}.border-t-slate-800{border-top-color:var(--color-slate-800)}.border-t-transparent{border-top-color:#0000}.border-t-violet-500{border-top-color:var(--color-violet-500)}.border-t-white{border-top-color:var(--color-white)}.border-r-\[\#0a1628\]{border-right-color:#0a1628}.border-r-\[\#2a2535\]{border-right-color:#2a2535}.border-r-amber-300{border-right-color:var(--color-amber-300)}.border-r-transparent{border-right-color:#0000}.border-b-amber-300{border-bottom-color:var(--color-amber-300)}.border-l-transparent{border-left-color:#0000}.\!bg-\[\#6ED1CF\]\/35{background-color:#6ed1cf59!important}.\!bg-\[\#7274ED\]{background-color:#7274ed!important}.bg-\(--color-bg\){background-color:var(--color-bg)}.bg-\[\#0B1021\]{background-color:#0b1021}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0f1422\]{background-color:#0f1422}.bg-\[\#00a86b\]{background-color:#00a86b}.bg-\[\#1FA7E1\]{background-color:#1fa7e1}.bg-\[\#5a6578\]{background-color:#5a6578}.bg-\[\#6ED1CF\]{background-color:#6ed1cf}.bg-\[\#6ED1CF\]\/20{background-color:#6ed1cf33}.bg-\[\#6ED1CF\]\/30{background-color:#6ed1cf4d}.bg-\[\#6F2BAF\]{background-color:#6f2baf}.bg-\[\#8B5CF6\]{background-color:#8b5cf6}.bg-\[\#50B8B6\]{background-color:#50b8b6}.bg-\[\#58B34D\]{background-color:#58b34d}.bg-\[\#75D06A\]{background-color:#75d06a}.bg-\[\#75D06A\]\/10{background-color:#75d06a1a}.bg-\[\#198abf\]{background-color:#198abf}.bg-\[\#7274ED\]{background-color:#7274ed}.bg-\[\#7274ED\]\/15{background-color:#7274ed26}.bg-\[\#8248c2\]{background-color:#8248c2}.bg-\[\#9956DE\]{background-color:#9956de}.bg-\[\#12192b\]{background-color:#12192b}.bg-\[\#111827\]{background-color:#111827}.bg-\[\#D96C6A\]{background-color:#d96c6a}.bg-\[\#DE7949\]{background-color:#de7949}.bg-\[\#E06A6A\]{background-color:#e06a6a}.bg-\[\#FAFAFA\]{background-color:#fafafa}.bg-\[\#FB96BB\]{background-color:#fb96bb}.bg-\[\#FB96BB\]\/20{background-color:#fb96bb33}.bg-\[\#FF8B8B\]{background-color:#ff8b8b}.bg-\[\#FF8B8B\]\/10{background-color:#ff8b8b1a}.bg-\[\#FFB356\]{background-color:#ffb356}.bg-\[\#FFB356\]\/20{background-color:#ffb35633}.bg-\[\#a8a5b3\]{background-color:#a8a5b3}.bg-\[\#d8e9ff\]{background-color:#d8e9ff}.bg-\[\#dce4ee\]{background-color:#dce4ee}.bg-\[\#dde3eb\]{background-color:#dde3eb}.bg-\[\#de7b9f\]{background-color:#de7b9f}.bg-\[\#e3eaf4\]{background-color:#e3eaf4}.bg-\[\#e6edf5\]{background-color:#e6edf5}.bg-\[\#e09841\]{background-color:#e09841}.bg-\[\#edf1f7\]{background-color:#edf1f7}.bg-\[\#edf1f7\]\/50{background-color:#edf1f780}.bg-\[\#edf1f7\]\/80{background-color:#edf1f7cc}.bg-\[\#eef3f9\]{background-color:#eef3f9}.bg-\[\#f0f3f8\]{background-color:#f0f3f8}.bg-\[\#f6f9ff\]{background-color:#f6f9ff}.bg-\[\#f7f9fc\]{background-color:#f7f9fc}.bg-\[\#f7fbff\]{background-color:#f7fbff}.bg-\[\#f8fafc\]{background-color:#f8fafc}.bg-\[\#f8faff\]{background-color:#f8faff}.bg-\[\#f8fbff\]{background-color:#f8fbff}.bg-\[\#fcfdff\]{background-color:#fcfdff}.bg-accent{background-color:var(--accent)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-100\/80{background-color:#fef3c6cc}@supports (color:color-mix(in lab,red,red)){.bg-amber-100\/80{background-color:color-mix(in oklab,var(--color-amber-100)80%,transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-600{background-color:var(--color-amber-600)}.bg-background{background-color:var(--background)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-100\/40{background-color:#dbeafe66}@supports (color:color-mix(in lab,red,red)){.bg-blue-100\/40{background-color:color-mix(in oklab,var(--color-blue-100)40%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--border)}.bg-card,.bg-card\/20{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,var(--card)20%,transparent)}}.bg-card\/80{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/80{background-color:color-mix(in oklab,var(--card)80%,transparent)}}.bg-current{background-color:currentColor}.bg-cyan-100{background-color:var(--color-cyan-100)}.bg-destructive{background-color:var(--destructive)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-200{background-color:var(--color-emerald-200)}.bg-emerald-300{background-color:var(--color-emerald-300)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-foreground{background-color:var(--foreground)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-50\/30{background-color:#f0fdf44d}@supports (color:color-mix(in lab,red,red)){.bg-green-50\/30{background-color:color-mix(in oklab,var(--color-green-50)30%,transparent)}}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-input-background{background-color:var(--input-background)}.bg-muted,.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted)30%,transparent)}}.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,var(--muted)40%,transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.bg-orange-50{background-color:var(--color-orange-50)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-orange-400{background-color:var(--color-orange-400)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-orange-500\/30{background-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/30{background-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary,.bg-primary\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary)10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary)20%,transparent)}}.bg-purple-100\/30{background-color:#f3e8ff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-100\/30{background-color:color-mix(in oklab,var(--color-purple-100)30%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-50\/30{background-color:#fef2f24d}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/30{background-color:color-mix(in oklab,var(--color-red-50)30%,transparent)}}.bg-red-50\/40{background-color:#fef2f266}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/40{background-color:color-mix(in oklab,var(--color-red-50)40%,transparent)}}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400{background-color:var(--color-red-400)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-100{background-color:var(--color-rose-100)}.bg-rose-100\/30{background-color:#ffe4e64d}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/30{background-color:color-mix(in oklab,var(--color-rose-100)30%,transparent)}}.bg-rose-100\/40{background-color:#ffe4e666}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/40{background-color:color-mix(in oklab,var(--color-rose-100)40%,transparent)}}.bg-rose-100\/60{background-color:#ffe4e699}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/60{background-color:color-mix(in oklab,var(--color-rose-100)60%,transparent)}}.bg-rose-200{background-color:var(--color-rose-200)}.bg-rose-200\/60{background-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/60{background-color:color-mix(in oklab,var(--color-rose-200)60%,transparent)}}.bg-rose-200\/70{background-color:#ffccd3b3}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/70{background-color:color-mix(in oklab,var(--color-rose-200)70%,transparent)}}.bg-rose-300{background-color:var(--color-rose-300)}.bg-rose-400\/5{background-color:#ff667f0d}@supports (color:color-mix(in lab,red,red)){.bg-rose-400\/5{background-color:color-mix(in oklab,var(--color-rose-400)5%,transparent)}}.bg-rose-500{background-color:var(--color-rose-500)}.bg-rose-500\/5{background-color:#ff23570d}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/5{background-color:color-mix(in oklab,var(--color-rose-500)5%,transparent)}}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/10{background-color:color-mix(in oklab,var(--color-rose-500)10%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500)20%,transparent)}}.bg-rose-500\/30{background-color:#ff23574d}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/30{background-color:color-mix(in oklab,var(--color-rose-500)30%,transparent)}}.bg-rose-600{background-color:var(--color-rose-600)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-sky-50{background-color:var(--color-violet-50)}.bg-sky-50\/40{background-color:#f5f3ff66}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/40{background-color:color-mix(in oklab,var(--color-violet-50)40%,transparent)}}.bg-sky-50\/50{background-color:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/50{background-color:color-mix(in oklab,var(--color-violet-50)50%,transparent)}}.bg-sky-100{background-color:var(--color-violet-100)}.bg-sky-100\/40{background-color:#ede9fe66}@supports (color:color-mix(in lab,red,red)){.bg-sky-100\/40{background-color:color-mix(in oklab,var(--color-violet-100)40%,transparent)}}.bg-sky-200{background-color:var(--color-violet-200)}.bg-sky-300{background-color:var(--color-violet-300)}.bg-sky-400{background-color:var(--color-violet-400)}.bg-sky-400\/10{background-color:#a685ff1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-400\/10{background-color:color-mix(in oklab,var(--color-violet-400)10%,transparent)}}.bg-sky-400\/30{background-color:#a685ff4d}@supports (color:color-mix(in lab,red,red)){.bg-sky-400\/30{background-color:color-mix(in oklab,var(--color-violet-400)30%,transparent)}}.bg-sky-500{background-color:var(--color-violet-500)}.bg-sky-500\/5{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/5{background-color:color-mix(in oklab,var(--color-violet-500)5%,transparent)}}.bg-sky-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-violet-500)10%,transparent)}}.bg-sky-500\/20{background-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/20{background-color:color-mix(in oklab,var(--color-violet-500)20%,transparent)}}.bg-sky-600{background-color:var(--color-violet-600)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\/50{background-color:#f8fafc80}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/50{background-color:color-mix(in oklab,var(--color-slate-50)50%,transparent)}}.bg-slate-50\/80{background-color:#f8fafccc}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/80{background-color:color-mix(in oklab,var(--color-slate-50)80%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-100\/70{background-color:#f1f5f9b3}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/70{background-color:color-mix(in oklab,var(--color-slate-100)70%,transparent)}}.bg-slate-100\/80{background-color:#f1f5f9cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/80{background-color:color-mix(in oklab,var(--color-slate-100)80%,transparent)}}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-200\/50{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.bg-slate-200\/50{background-color:color-mix(in oklab,var(--color-slate-200)50%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-300\/80{background-color:#cad5e2cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-300\/80{background-color:color-mix(in oklab,var(--color-slate-300)80%,transparent)}}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-800\/5{background-color:#1d293d0d}@supports (color:color-mix(in lab,red,red)){.bg-slate-800\/5{background-color:color-mix(in oklab,var(--color-slate-800)5%,transparent)}}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\/40{background-color:#0f172b66}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/40{background-color:color-mix(in oklab,var(--color-slate-900)40%,transparent)}}.bg-slate-900\/85{background-color:#0f172bd9}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/85{background-color:color-mix(in oklab,var(--color-slate-900)85%,transparent)}}.bg-teal-50{background-color:var(--color-teal-50)}.bg-teal-100{background-color:var(--color-teal-100)}.bg-teal-300{background-color:var(--color-teal-300)}.bg-teal-500{background-color:var(--color-teal-500)}.bg-teal-600{background-color:var(--color-teal-600)}.bg-transparent{background-color:#0000}.bg-violet-50{background-color:var(--color-violet-50)}.bg-violet-100{background-color:var(--color-violet-100)}.bg-violet-300{background-color:var(--color-violet-300)}.bg-violet-400\/5{background-color:#a685ff0d}@supports (color:color-mix(in lab,red,red)){.bg-violet-400\/5{background-color:color-mix(in oklab,var(--color-violet-400)5%,transparent)}}.bg-violet-500{background-color:var(--color-violet-500)}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/14{background-color:#ffffff24}@supports (color:color-mix(in lab,red,red)){.bg-white\/14{background-color:color-mix(in oklab,var(--color-white)14%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\/25{background-color:color-mix(in oklab,var(--color-white)25%,transparent)}}.bg-white\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.bg-white\/30{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.bg-white\/35{background-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.bg-white\/35{background-color:color-mix(in oklab,var(--color-white)35%,transparent)}}.bg-white\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\/40{background-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.bg-white\/70{background-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.bg-white\/70{background-color:color-mix(in oklab,var(--color-white)70%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-white\/85{background-color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.bg-white\/85{background-color:color-mix(in oklab,var(--color-white)85%,transparent)}}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white)90%,transparent)}}.bg-white\/95{background-color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.bg-white\/95{background-color:color-mix(in oklab,var(--color-white)95%,transparent)}}.bg-zinc-100{background-color:var(--color-zinc-100)}.\!bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab!important;background-image:linear-gradient(var(--tw-gradient-stops))!important}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.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\%\)\]{background-image:radial-gradient(circle at 14% 12%,#fb96bb59,#0000 42%),radial-gradient(circle at 80% 80%,#75d06a40,#0000 38%)}.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\%\)\]{background-image:radial-gradient(circle at 18% 8%,#fb96bb52,#0000 42%),radial-gradient(circle at 85% 84%,#75d06a3d,#0000 40%)}.bg-\[radial-gradient\(circle_at_50\%_100\%\,\#9333ea_0\%\,\#c084fc_40\%\,transparent_80\%\)\]{background-image:radial-gradient(circle at 50% 100%,#9333ea,#c084fc,#0000 80%)}.bg-\[radial-gradient\(circle_at_top_left\,\#f8fbff_0\%\,\#eef4ff_40\%\,\#f8f4ff_100\%\)\]{background-image:radial-gradient(circle at 0 0,#f8fbff,#eef4ff 40%,#f8f4ff)}.bg-\[radial-gradient\(ellipse_at_50\%_100\%\,\#7e22ce_10\%\,transparent_60\%\)\]{background-image:radial-gradient(at 50% 100%,#7e22ce 10%,#0000 60%)}.bg-\[url\(\'data\:image\/svg\+xml\;base64\,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI\+PC9yZWN0Pgo8L3N2Zz4\=\'\)\]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=)}.\!from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#7274ED\]{--tw-gradient-from:#7274ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#9956DE\]{--tw-gradient-from:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#FFB356\]{--tw-gradient-from:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-amber-100{--tw-gradient-from:var(--color-amber-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-amber-400{--tw-gradient-from:var(--color-amber-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-amber-500{--tw-gradient-from:var(--color-amber-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-emerald-400{--tw-gradient-from:var(--color-emerald-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500{--tw-gradient-from:var(--color-green-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-50{--tw-gradient-from:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-200{--tw-gradient-from:var(--color-indigo-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-600{--tw-gradient-from:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-orange-50{--tw-gradient-from:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-orange-500{--tw-gradient-from:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-primary\/8{--tw-gradient-from:var(--primary)}@supports (color:color-mix(in lab,red,red)){.from-primary\/8{--tw-gradient-from:color-mix(in oklab,var(--primary)8%,transparent)}}.from-primary\/8{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-600{--tw-gradient-from:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-rose-50{--tw-gradient-from:var(--color-rose-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-rose-400{--tw-gradient-from:var(--color-rose-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-rose-500{--tw-gradient-from:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-50{--tw-gradient-from:var(--color-violet-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-100{--tw-gradient-from:var(--color-violet-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-600{--tw-gradient-from:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-700{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-slate-50\/30{--tw-gradient-from:#f8fafc4d}@supports (color:color-mix(in lab,red,red)){.from-slate-50\/30{--tw-gradient-from:color-mix(in oklab,var(--color-slate-50)30%,transparent)}}.from-slate-50\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-slate-200{--tw-gradient-from:var(--color-slate-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-teal-50{--tw-gradient-from:var(--color-teal-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-violet-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white{--tw-gradient-from:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/0{--tw-gradient-from:#0000}@supports (color:color-mix(in lab,red,red)){.from-white\/0{--tw-gradient-from:color-mix(in oklab,var(--color-white)0%,transparent)}}.from-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/20{--tw-gradient-from:#fff3}@supports (color:color-mix(in lab,red,red)){.from-white\/20{--tw-gradient-from:color-mix(in oklab,var(--color-white)20%,transparent)}}.from-white\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-\[\#75D06A\]{--tw-gradient-via:#75d06a;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#7274ED\]{--tw-gradient-via:#7274ed;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-cyan-500{--tw-gradient-via:var(--color-cyan-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-emerald-500{--tw-gradient-via:var(--color-emerald-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-fuchsia-50{--tw-gradient-via:var(--color-fuchsia-50);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-500{--tw-gradient-via:var(--color-orange-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-primary\/4{--tw-gradient-via:var(--primary)}@supports (color:color-mix(in lab,red,red)){.via-primary\/4{--tw-gradient-via:color-mix(in oklab,var(--primary)4%,transparent)}}.via-primary\/4{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-rose-300\/10{--tw-gradient-via:#ffa2ae1a}@supports (color:color-mix(in lab,red,red)){.via-rose-300\/10{--tw-gradient-via:color-mix(in oklab,var(--color-rose-300)10%,transparent)}}.via-rose-300\/10{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/30{--tw-gradient-via:#f5f3ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/30{--tw-gradient-via:color-mix(in oklab,var(--color-violet-50)30%,transparent)}}.via-sky-50\/30{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/50{--tw-gradient-via:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/50{--tw-gradient-via:color-mix(in oklab,var(--color-violet-50)50%,transparent)}}.via-sky-50\/50{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/15{--tw-gradient-via:#a685ff26}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/15{--tw-gradient-via:color-mix(in oklab,var(--color-violet-400)15%,transparent)}}.via-sky-400\/15{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/30{--tw-gradient-via:#a685ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/30{--tw-gradient-via:color-mix(in oklab,var(--color-violet-400)30%,transparent)}}.via-sky-400\/30{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/40{--tw-gradient-via:#a685ff66}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/40{--tw-gradient-via:color-mix(in oklab,var(--color-violet-400)40%,transparent)}}.via-sky-400\/40{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/50{--tw-gradient-via:#a685ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/50{--tw-gradient-via:color-mix(in oklab,var(--color-violet-400)50%,transparent)}}.via-sky-400\/50{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-500{--tw-gradient-via:var(--color-violet-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-500\/50{--tw-gradient-via:#8d54ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-500\/50{--tw-gradient-via:color-mix(in oklab,var(--color-violet-500)50%,transparent)}}.via-sky-500\/50{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-600{--tw-gradient-via:var(--color-violet-600);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/15{--tw-gradient-via:#ffffff26}@supports (color:color-mix(in lab,red,red)){.via-white\/15{--tw-gradient-via:color-mix(in oklab,var(--color-white)15%,transparent)}}.via-white\/15{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/30{--tw-gradient-via:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.via-white\/30{--tw-gradient-via:color-mix(in oklab,var(--color-white)30%,transparent)}}.via-white\/30{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/40{--tw-gradient-via:#fff6}@supports (color:color-mix(in lab,red,red)){.via-white\/40{--tw-gradient-via:color-mix(in oklab,var(--color-white)40%,transparent)}}.via-white\/40{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.\!to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#9956DE\]{--tw-gradient-to:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#FF8B8B\]{--tw-gradient-to:#ff8b8b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#FFB356\]{--tw-gradient-to:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-amber-50{--tw-gradient-to:var(--color-amber-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-blue-600{--tw-gradient-to:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-50{--tw-gradient-to:var(--color-cyan-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-100{--tw-gradient-to:var(--color-cyan-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500{--tw-gradient-to:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-emerald-50{--tw-gradient-to:var(--color-emerald-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-emerald-500{--tw-gradient-to:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-emerald-600{--tw-gradient-to:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-100{--tw-gradient-to:var(--color-indigo-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-600{--tw-gradient-to:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-700{--tw-gradient-to:var(--color-indigo-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-800{--tw-gradient-to:var(--color-indigo-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-50{--tw-gradient-to:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-100{--tw-gradient-to:var(--color-orange-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-500{--tw-gradient-to:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-600{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-red-500{--tw-gradient-to:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-rose-500{--tw-gradient-to:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-rose-600{--tw-gradient-to:var(--color-rose-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-100{--tw-gradient-to:var(--color-violet-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-400{--tw-gradient-to:var(--color-violet-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-600{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-slate-50{--tw-gradient-to:var(--color-slate-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-slate-100{--tw-gradient-to:var(--color-slate-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-100{--tw-gradient-to:var(--color-teal-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-300{--tw-gradient-to:var(--color-teal-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-500{--tw-gradient-to:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-600{--tw-gradient-to:var(--color-teal-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-700{--tw-gradient-to:var(--color-teal-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white\/0{--tw-gradient-to:#0000}@supports (color:color-mix(in lab,red,red)){.to-white\/0{--tw-gradient-to:color-mix(in oklab,var(--color-white)0%,transparent)}}.to-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-amber-300{fill:var(--color-amber-300)}.fill-amber-400{fill:var(--color-amber-400)}.fill-blue-500{fill:var(--color-blue-500)}.fill-current{fill:currentColor}.fill-primary{fill:var(--primary)}.fill-white{fill:var(--color-white)}.fill-yellow-300{fill:var(--color-yellow-300)}.stroke-\[2\.5\]{stroke-width:2.5px}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-bottom{object-position:bottom}.p-0{padding:calc(var(--spacing)*0)}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-3\.5{padding:calc(var(--spacing)*3.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-7{padding:calc(var(--spacing)*7)}.p-8{padding:calc(var(--spacing)*8)}.p-12{padding:calc(var(--spacing)*12)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-0\.5{padding-inline:calc(var(--spacing)*.5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.px-10{padding-inline:calc(var(--spacing)*10)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-3\.5{padding-block:calc(var(--spacing)*3.5)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.py-16{padding-block:calc(var(--spacing)*16)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\.5{padding-top:calc(var(--spacing)*1.5)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-6{padding-top:calc(var(--spacing)*6)}.pt-8{padding-top:calc(var(--spacing)*8)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-2\.5{padding-right:calc(var(--spacing)*2.5)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-4{padding-right:calc(var(--spacing)*4)}.pr-6{padding-right:calc(var(--spacing)*6)}.pr-8{padding-right:calc(var(--spacing)*8)}.pr-11{padding-right:calc(var(--spacing)*11)}.pr-24{padding-right:calc(var(--spacing)*24)}.pr-40{padding-right:calc(var(--spacing)*40)}.pb-0{padding-bottom:calc(var(--spacing)*0)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-6{padding-bottom:calc(var(--spacing)*6)}.pb-8{padding-bottom:calc(var(--spacing)*8)}.pb-24{padding-bottom:calc(var(--spacing)*24)}.pb-32{padding-bottom:calc(var(--spacing)*32)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.pl-10{padding-left:calc(var(--spacing)*10)}.pl-11{padding-left:calc(var(--spacing)*11)}.pl-16{padding-left:calc(var(--spacing)*16)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[32px\]{font-size:32px}.text-\[36px\]{font-size:36px}.text-\[50px\]{font-size:50px}.text-\[60px\]{font-size:60px}.text-\[80px\]{font-size:80px}.leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.leading-\[1\.7\]{--tw-leading:1.7;line-height:1.7}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-\[\#1FA7E1\]{color:#1fa7e1!important}.\!text-white{color:var(--color-white)!important}.text-\[\#0a1628\]{color:#0a1628}.text-\[\#1E293B\]{color:#1e293b}.text-\[\#1FA7E1\]{color:#1fa7e1}.text-\[\#3c4043\]{color:#3c4043}.text-\[\#5a6578\]{color:#5a6578}.text-\[\#5f6368\]{color:#5f6368}.text-\[\#6ED1CF\]{color:#6ed1cf}.text-\[\#7b8798\]{color:#7b8798}.text-\[\#8A1A1A\]{color:#8a1a1a}.text-\[\#75D06A\]{color:#75d06a}.text-\[\#141b2d\]{color:#141b2d}.text-\[\#7274ED\]{color:#7274ed}.text-\[\#9956DE\]{color:#9956de}.text-\[\#202124\]{color:#202124}.text-\[\#334155\]{color:#334155}.text-\[\#EAFBFF\]{color:#eafbff}.text-\[\#FF8B8B\]{color:#ff8b8b}.text-\[\#FFB356\]{color:#ffb356}.text-\[\#a0aec0\]{color:#a0aec0}.text-\[\#a8a5b3\]{color:#a8a5b3}.text-\[\#c2cad8\]{color:#c2cad8}.text-\[\#d1cec6\]{color:#d1cec6}.text-\[\#dde3eb\]{color:#dde3eb}.text-\[\#f8fafc\]{color:#f8fafc}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-amber-900\/80{color:#7b3306cc}@supports (color:color-mix(in lab,red,red)){.text-amber-900\/80{color:color-mix(in oklab,var(--color-amber-900)80%,transparent)}}.text-amber-900\/85{color:#7b3306d9}@supports (color:color-mix(in lab,red,red)){.text-amber-900\/85{color:color-mix(in oklab,var(--color-amber-900)85%,transparent)}}.text-black\/25{color:#00000040}@supports (color:color-mix(in lab,red,red)){.text-black\/25{color:color-mix(in oklab,var(--color-black)25%,transparent)}}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-cyan-100{color:var(--color-cyan-100)}.text-cyan-200{color:var(--color-cyan-200)}.text-destructive{color:var(--destructive)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-800{color:var(--color-emerald-800)}.text-emerald-900{color:var(--color-emerald-900)}.text-foreground{color:var(--foreground)}.text-gray-600{color:var(--color-gray-600)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-muted-foreground{color:var(--muted-foreground)}.text-orange-300{color:var(--color-orange-300)}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/60{color:#ff8b1a99}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/60{color:color-mix(in oklab,var(--color-orange-400)60%,transparent)}}.text-orange-500{color:var(--color-orange-500)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-rose-200{color:var(--color-rose-200)}.text-rose-300{color:var(--color-rose-300)}.text-rose-400{color:var(--color-rose-400)}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-rose-700{color:var(--color-rose-700)}.text-rose-800{color:var(--color-rose-800)}.text-rose-900{color:var(--color-rose-900)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground)70%,transparent)}}.text-sky-100{color:var(--color-violet-100)}.text-sky-200{color:var(--color-violet-200)}.text-sky-300{color:var(--color-violet-300)}.text-sky-400{color:var(--color-violet-400)}.text-sky-500{color:var(--color-violet-500)}.text-sky-600{color:var(--color-violet-600)}.text-sky-700{color:var(--color-violet-700)}.text-sky-700\/\[0\.08\]{color:#7008e714}@supports (color:color-mix(in lab,red,red)){.text-sky-700\/\[0\.08\]{color:color-mix(in oklab,var(--color-violet-700)8%,transparent)}}.text-sky-800{color:var(--color-violet-800)}.text-sky-900{color:var(--color-violet-900)}.text-sky-900\/80{color:#4d179acc}@supports (color:color-mix(in lab,red,red)){.text-sky-900\/80{color:color-mix(in oklab,var(--color-violet-900)80%,transparent)}}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-400\/80{color:#90a1b9cc}@supports (color:color-mix(in lab,red,red)){.text-slate-400\/80{color:color-mix(in oklab,var(--color-slate-400)80%,transparent)}}.text-slate-500{color:var(--color-slate-500)}.text-slate-500\/60{color:#62748e99}@supports (color:color-mix(in lab,red,red)){.text-slate-500\/60{color:color-mix(in oklab,var(--color-slate-500)60%,transparent)}}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-teal-200{color:var(--color-teal-200)}.text-teal-400{color:var(--color-teal-400)}.text-teal-500{color:var(--color-teal-500)}.text-teal-600{color:var(--color-teal-600)}.text-teal-700{color:var(--color-teal-700)}.text-teal-800{color:var(--color-teal-800)}.text-teal-900{color:var(--color-teal-900)}.text-transparent{color:#0000}.text-violet-400{color:var(--color-violet-400)}.text-violet-500{color:var(--color-violet-500)}.text-violet-600{color:var(--color-violet-600)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.text-white\/5{color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.text-white\/5{color:color-mix(in oklab,var(--color-white)5%,transparent)}}.text-white\/10{color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.text-white\/10{color:color-mix(in oklab,var(--color-white)10%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white)50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.text-white\/85{color:color-mix(in oklab,var(--color-white)85%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white)90%,transparent)}}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white)95%,transparent)}}.text-yellow-300{color:var(--color-yellow-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.decoration-slate-400{-webkit-text-decoration-color:var(--color-slate-400);text-decoration-color:var(--color-slate-400)}.underline-offset-4{text-underline-offset:4px}.placeholder-\[\#a8a5b3\]::placeholder{color:#a8a5b3}.opacity-0{opacity:0}.opacity-5{opacity:.05}.opacity-10{opacity:.1}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}.opacity-\[0\.03\]{opacity:.03}.opacity-\[0\.15\]{opacity:.15}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-overlay{mix-blend-mode:overlay}.mix-blend-screen{mix-blend-mode:screen}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-15px_50px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 -15px 50px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(255\,255\,255\,0\.5\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#ffffff80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,139\,139\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ff8b8b99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,179\,86\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ffb35699);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_24px_rgba\(250\,204\,21\,0\.6\)\]{--tw-shadow:0 0 24px var(--tw-shadow-color,#facc1599);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_15px_-3px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 2px 15px -3px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_8px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 4px 8px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_5px_12px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 5px 12px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(18\,25\,43\,0\.3\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#12192b4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgb\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_40px_-10px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 10px 40px -10px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_25px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 12px 25px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_15px_25px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 15px 25px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_18px_30px_-20px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 18px 30px -20px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_30px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 30px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_40px_-10px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 40px -10px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_40px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 40px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_50px_rgba\(15\,20\,34\,0\.3\)\]{--tw-shadow:0 20px 50px var(--tw-shadow-color,#0f14224d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_-15px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 20px 60px -15px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 60px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_60px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 30px 60px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_6px_rgba\(0\,0\,0\,0\.05\)\,0_4px_6px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 -4px 6px var(--tw-shadow-color,#0000000d),0 4px 6px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_6px_rgba\(249\,115\,22\,0\.05\)\,0_4px_6px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:inset 0 -4px 6px var(--tw-shadow-color,#f973160d),0 4px 6px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_8px_rgba\(251\,191\,36\,0\.1\)\,0_6px_8px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 -4px 8px var(--tw-shadow-color,#fbbf241a),0 6px 8px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 2px 4px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow\/elevation,.shadow\/rim{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:#1fa7e133}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(68.7044% -.0807821 -.10979/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:#1fa7e14d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(68.7044% -.0807821 -.10979/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:#8b5cf633}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(60.5631% .0845415 -.201932/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#9956DE\]\/20{--tw-shadow-color:#9956de33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(59.4745% .111053 -.167638/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#9956DE\]\/30{--tw-shadow-color:#9956de4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(59.4745% .111053 -.167638/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:#fb96bb4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(78.801% .12777 -.00670064/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#FFB356\]\/30{--tw-shadow-color:#ffb3564d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FFB356\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(82.2219% .0499055 .130321/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[rgba\(124\,58\,237\,0\.05\)_0px_0px_30px_inset\]{--tw-shadow-color:#7c3aed0d}@supports (color:color-mix(in lab,red,red)){.shadow-\[rgba\(124\,58\,237\,0\.05\)_0px_0px_30px_inset\]{--tw-shadow-color:color-mix(in oklab,#7c3aed0d 0px 0px 30px inset var(--tw-shadow-alpha),transparent)}}.shadow-purple-500\/20{--tw-shadow-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.shadow-purple-500\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-purple-500)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-red-100{--tw-shadow-color:oklch(93.6% .032 17.717)}@supports (color:color-mix(in lab,red,red)){.shadow-red-100{--tw-shadow-color:color-mix(in oklab,var(--color-red-100)var(--tw-shadow-alpha),transparent)}}.shadow-red-900\/10{--tw-shadow-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.shadow-red-900\/10{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-red-900)10%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-rose-200{--tw-shadow-color:oklch(89.2% .058 10.001)}@supports (color:color-mix(in lab,red,red)){.shadow-rose-200{--tw-shadow-color:color-mix(in oklab,var(--color-rose-200)var(--tw-shadow-alpha),transparent)}}.shadow-sky-200{--tw-shadow-color:oklch(89.4% .057 293.283)}@supports (color:color-mix(in lab,red,red)){.shadow-sky-200{--tw-shadow-color:color-mix(in oklab,var(--color-violet-200)var(--tw-shadow-alpha),transparent)}}.shadow-sky-500\/20{--tw-shadow-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.shadow-sky-500\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-violet-500)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-sky-600\/25{--tw-shadow-color:#7f22fe40}@supports (color:color-mix(in lab,red,red)){.shadow-sky-600\/25{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-violet-600)25%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:#0f172b0a}@supports (color:color-mix(in lab,red,red)){.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-slate-900)4%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-slate-900\/\[0\.08\]{--tw-shadow-color:#0f172b14}@supports (color:color-mix(in lab,red,red)){.shadow-slate-900\/\[0\.08\]{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-slate-900)8%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-teal-100{--tw-shadow-color:oklch(95.3% .051 180.801)}@supports (color:color-mix(in lab,red,red)){.shadow-teal-100{--tw-shadow-color:color-mix(in oklab,var(--color-teal-100)var(--tw-shadow-alpha),transparent)}}.shadow-teal-200{--tw-shadow-color:oklch(91% .096 180.426)}@supports (color:color-mix(in lab,red,red)){.shadow-teal-200{--tw-shadow-color:color-mix(in oklab,var(--color-teal-200)var(--tw-shadow-alpha),transparent)}}.shadow-teal-500\/30{--tw-shadow-color:#00baa74d}@supports (color:color-mix(in lab,red,red)){.shadow-teal-500\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-teal-500)30%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-\[\#1FA7E1\]\/35{--tw-ring-color:oklab(68.7044% -.0807821 -.10979/.35)}.ring-\[\#8B5CF6\]\/10{--tw-ring-color:oklab(60.5631% .0845415 -.201932/.1)}.ring-\[\#9956DE\]\/50{--tw-ring-color:oklab(59.4745% .111053 -.167638/.5)}.ring-green-300{--tw-ring-color:var(--color-green-300)}.ring-indigo-100{--tw-ring-color:var(--color-indigo-100)}.ring-red-200{--tw-ring-color:var(--color-red-200)}.ring-red-300{--tw-ring-color:var(--color-red-300)}.ring-red-500{--tw-ring-color:var(--color-red-500)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.ring-rose-300{--tw-ring-color:var(--color-rose-300)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-sky-100{--tw-ring-color:var(--color-violet-100)}.ring-sky-200\/70{--tw-ring-color:#ddd6ffb3}@supports (color:color-mix(in lab,red,red)){.ring-sky-200\/70{--tw-ring-color:color-mix(in oklab,var(--color-violet-200)70%,transparent)}}.ring-sky-300\/50{--tw-ring-color:#c4b4ff80}@supports (color:color-mix(in lab,red,red)){.ring-sky-300\/50{--tw-ring-color:color-mix(in oklab,var(--color-violet-300)50%,transparent)}}.ring-sky-500\/10{--tw-ring-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.ring-sky-500\/10{--tw-ring-color:color-mix(in oklab,var(--color-violet-500)10%,transparent)}}.ring-teal-200{--tw-ring-color:var(--color-teal-200)}.ring-white{--tw-ring-color:var(--color-white)}.ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.ring-white\/10{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.ring-white\/20{--tw-ring-color:#fff3}@supports (color:color-mix(in lab,red,red)){.ring-white\/20{--tw-ring-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-2xl{--tw-blur:blur(var(--blur-2xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[100px\]{--tw-blur:blur(100px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[120px\]{--tw-blur:blur(120px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.contrast-50{--tw-contrast:contrast(50%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-2xl{--tw-drop-shadow-size:drop-shadow(0 25px 25px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-2xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(250\,204\,21\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#facc15e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-lg));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-md{--tw-drop-shadow-size:drop-shadow(0 3px 3px var(--tw-drop-shadow-color,#0000001f));--tw-drop-shadow:drop-shadow(var(--drop-shadow-md));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-sm{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-sm));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-xl{--tw-drop-shadow-size:drop-shadow(0 9px 7px var(--tw-drop-shadow-color,#0000001a));--tw-drop-shadow:drop-shadow(var(--drop-shadow-xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.saturate-50{--tw-saturate:saturate(50%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-2xl{--tw-backdrop-blur:blur(var(--blur-2xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-\[2px\]{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.delay-75{transition-delay:75ms}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.prose-slate{--tw-prose-body:oklch(37.2% .044 257.287);--tw-prose-headings:oklch(20.8% .042 265.755);--tw-prose-lead:oklch(44.6% .043 257.281);--tw-prose-links:oklch(20.8% .042 265.755);--tw-prose-bold:oklch(20.8% .042 265.755);--tw-prose-counters:oklch(55.4% .046 257.417);--tw-prose-bullets:oklch(86.9% .022 252.894);--tw-prose-hr:oklch(92.9% .013 255.508);--tw-prose-quotes:oklch(20.8% .042 265.755);--tw-prose-quote-borders:oklch(92.9% .013 255.508);--tw-prose-captions:oklch(55.4% .046 257.417);--tw-prose-kbd:oklch(20.8% .042 265.755);--tw-prose-kbd-shadows:oklab(20.8% -.00310889 -.0418848/.1);--tw-prose-code:oklch(20.8% .042 265.755);--tw-prose-pre-code:oklch(92.9% .013 255.508);--tw-prose-pre-bg:oklch(27.9% .041 260.031);--tw-prose-th-borders:oklch(86.9% .022 252.894);--tw-prose-td-borders:oklch(92.9% .013 255.508);--tw-prose-invert-body:oklch(86.9% .022 252.894);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.4% .04 256.788);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.4% .04 256.788);--tw-prose-invert-bullets:oklch(44.6% .043 257.281);--tw-prose-invert-hr:oklch(37.2% .044 257.287);--tw-prose-invert-quotes:oklch(96.8% .007 247.896);--tw-prose-invert-quote-borders:oklch(37.2% .044 257.287);--tw-prose-invert-captions:oklch(70.4% .04 256.788);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(86.9% .022 252.894);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .043 257.281);--tw-prose-invert-td-borders:oklch(37.2% .044 257.287)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media(hover:hover){.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:block:is(:where(.group):hover *){display:block}.group-hover\:-translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:-translate-y-1:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\:rotate-3:is(:where(.group):hover *){rotate:3deg}.group-hover\:rotate-45:is(:where(.group):hover *){rotate:45deg}.group-hover\:border-\[\#dde3eb\]:is(:where(.group):hover *){border-color:#dde3eb}.group-hover\:border-amber-400:is(:where(.group):hover *){border-color:var(--color-amber-400)}.group-hover\:border-sky-300:is(:where(.group):hover *){border-color:var(--color-violet-300)}.group-hover\:border-r-amber-400:is(:where(.group):hover *){border-right-color:var(--color-amber-400)}.group-hover\:border-b-amber-400:is(:where(.group):hover *){border-bottom-color:var(--color-amber-400)}.group-hover\:bg-amber-50:is(:where(.group):hover *){background-color:var(--color-amber-50)}.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:#fef3c680}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-amber-100)50%,transparent)}}.group-hover\:bg-slate-50:is(:where(.group):hover *){background-color:var(--color-slate-50)}.group-hover\:bg-slate-600:is(:where(.group):hover *){background-color:var(--color-slate-600)}.group-hover\:text-\[var\(--hover-color\)\]:is(:where(.group):hover *){color:var(--hover-color)}.group-hover\:text-amber-500:is(:where(.group):hover *){color:var(--color-amber-500)}.group-hover\:text-primary:is(:where(.group):hover *){color:var(--primary)}.group-hover\:text-sky-500:is(:where(.group):hover *){color:var(--color-violet-500)}.group-hover\:text-sky-600:is(:where(.group):hover *){color:var(--color-violet-600)}.group-hover\:text-sky-700:is(:where(.group):hover *){color:var(--color-violet-700)}.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\:shadow-\[0_24px_40px_-15px_rgba\(0\,0\,0\,0\.5\)\]:is(:where(.group):hover *){--tw-shadow:0 24px 40px -15px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:shadow-xl:is(:where(.group):hover *){--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing)*8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing)*-8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing)*8)!important;height:calc(var(--spacing)*8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)))}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing)*0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing)*-4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing)*0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:block:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\[viewport\=false\]\/navigation-menu\:top-full:is(:where(.group\/navigation-menu)[data-viewport=false] *){top:100%}.group-data-\[viewport\=false\]\/navigation-menu\:mt-1\.5:is(:where(.group\/navigation-menu)[data-viewport=false] *){margin-top:calc(var(--spacing)*1.5)}.group-data-\[viewport\=false\]\/navigation-menu\:overflow-hidden:is(:where(.group\/navigation-menu)[data-viewport=false] *){overflow:hidden}.group-data-\[viewport\=false\]\/navigation-menu\:rounded-md:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-radius:calc(var(--radius) - 2px)}.group-data-\[viewport\=false\]\/navigation-menu\:border:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[viewport\=false\]\/navigation-menu\:bg-popover:is(:where(.group\/navigation-menu)[data-viewport=false] *){background-color:var(--popover)}.group-data-\[viewport\=false\]\/navigation-menu\:text-popover-foreground:is(:where(.group\/navigation-menu)[data-viewport=false] *){color:var(--popover-foreground)}.group-data-\[viewport\=false\]\/navigation-menu\:shadow:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[viewport\=false\]\/navigation-menu\:duration-200:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-duration:.2s;transition-duration:.2s}.peer-checked\:bg-\[\#5a6578\]:is(:where(.peer):checked~*){background-color:#5a6578}.peer-checked\:bg-red-600:is(:where(.peer):checked~*){background-color:var(--color-red-600)}@media(hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-focus\:ring-4:is(:where(.peer):focus~*){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-focus\:ring-red-300:is(:where(.peer):focus~*){--tw-ring-color:var(--color-red-300)}.peer-focus\:outline-none:is(:where(.peer):focus~*){--tw-outline-style:none;outline-style:none}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing)*1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing)*2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing)*1)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:font-medium::placeholder{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.placeholder\:text-slate-400::placeholder{color:var(--color-slate-400)}.placeholder\:text-slate-500::placeholder{color:var(--color-slate-500)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing)*-2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:top-0\.5:after{content:var(--tw-content);top:calc(var(--spacing)*.5)}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:h-4:after{content:var(--tw-content);height:calc(var(--spacing)*4)}.after\:h-5:after{content:var(--tw-content);height:calc(var(--spacing)*5)}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:w-4:after{content:var(--tw-content);width:calc(var(--spacing)*4)}.after\:w-5:after{content:var(--tw-content);width:calc(var(--spacing)*5)}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.after\:rounded-full:after{content:var(--tw-content);border-radius:3.40282e38px}.after\:border:after{content:var(--tw-content);border-style:var(--tw-border-style);border-width:1px}.after\:border-\[\#dde3eb\]:after{content:var(--tw-content);border-color:#dde3eb}.after\:bg-white:after{content:var(--tw-content);background-color:var(--color-white)}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.peer-checked\:after\:translate-x-full:is(:where(.peer):checked~*):after{content:var(--tw-content);--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.peer-checked\:after\:border-white:is(:where(.peer):checked~*):after{content:var(--tw-content);border-color:var(--color-white)}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}@media(hover:hover){.hover\:z-10:hover{z-index:10}.hover\:-translate-x-1:hover{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:-translate-y-1:hover{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:-translate-y-2:hover{--tw-translate-y:calc(var(--spacing)*-2);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:scale-\[1\.01\]:hover{scale:1.01}.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:rotate-0:hover{rotate:none}.hover\:gap-2:hover{gap:calc(var(--spacing)*2)}.hover\:border-\[\#d1cec6\]:hover{border-color:#d1cec6}.hover\:border-\[\#dde3eb\]:hover{border-color:#dde3eb}.hover\:border-amber-200\/60:hover{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-200\/60:hover{border-color:color-mix(in oklab,var(--color-amber-200)60%,transparent)}}.hover\:border-emerald-300:hover{border-color:var(--color-emerald-300)}.hover\:border-emerald-400:hover{border-color:var(--color-emerald-400)}.hover\:border-emerald-500:hover{border-color:var(--color-emerald-500)}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:border-indigo-600:hover{border-color:var(--color-indigo-600)}.hover\:border-orange-300:hover{border-color:var(--color-orange-300)}.hover\:border-primary\/60:hover{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/60:hover{border-color:color-mix(in oklab,var(--primary)60%,transparent)}}.hover\:border-rose-300:hover{border-color:var(--color-rose-300)}.hover\:border-rose-400:hover{border-color:var(--color-rose-400)}.hover\:border-rose-500:hover{border-color:var(--color-rose-500)}.hover\:border-sky-200:hover{border-color:var(--color-violet-200)}.hover\:border-sky-300:hover{border-color:var(--color-violet-300)}.hover\:border-sky-400:hover{border-color:var(--color-violet-400)}.hover\:border-sky-500:hover{border-color:var(--color-violet-500)}.hover\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\:border-teal-300:hover{border-color:var(--color-teal-300)}.hover\:bg-\[\#1C96CB\]:hover{background-color:#1c96cb}.hover\:bg-\[\#008f5d\]:hover{background-color:#008f5d}.hover\:bg-\[\#8A4DCA\]:hover{background-color:#8a4dca}.hover\:bg-\[\#FA7DA9\]:hover{background-color:#fa7da9}.hover\:bg-\[\#FF7373\]:hover{background-color:#ff7373}.hover\:bg-\[\#dde3eb\]:hover{background-color:#dde3eb}.hover\:bg-\[\#edf1f7\]:hover{background-color:#edf1f7}.hover\:bg-\[\#edf1f7\]\/50:hover{background-color:#edf1f780}.hover\:bg-\[\#f7f9fc\]:hover{background-color:#f7f9fc}.hover\:bg-accent:hover,.hover\:bg-accent\/40:hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/40:hover{background-color:color-mix(in oklab,var(--accent)40%,transparent)}}.hover\:bg-amber-200:hover{background-color:var(--color-amber-200)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-cyan-200:hover{background-color:var(--color-cyan-200)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-emerald-50:hover{background-color:var(--color-emerald-50)}.hover\:bg-emerald-100:hover{background-color:var(--color-emerald-100)}.hover\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\:bg-green-50:hover{background-color:var(--color-green-50)}.hover\:bg-green-100:hover{background-color:var(--color-green-100)}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-muted:hover,.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.hover\:bg-orange-50:hover{background-color:var(--color-orange-50)}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-primary:hover,.hover\:bg-primary\/20:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary)20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-rose-50:hover{background-color:var(--color-rose-50)}.hover\:bg-rose-100:hover{background-color:var(--color-rose-100)}.hover\:bg-rose-500:hover{background-color:var(--color-rose-500)}.hover\:bg-rose-700:hover{background-color:var(--color-rose-700)}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:bg-sky-50:hover{background-color:var(--color-violet-50)}.hover\:bg-sky-50\/30:hover{background-color:#f5f3ff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-sky-50\/30:hover{background-color:color-mix(in oklab,var(--color-violet-50)30%,transparent)}}.hover\:bg-sky-50\/80:hover{background-color:#f5f3ffcc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-sky-50\/80:hover{background-color:color-mix(in oklab,var(--color-violet-50)80%,transparent)}}.hover\:bg-sky-100:hover{background-color:var(--color-violet-100)}.hover\:bg-sky-300:hover{background-color:var(--color-violet-300)}.hover\:bg-sky-600:hover{background-color:var(--color-violet-600)}.hover\:bg-sky-700:hover{background-color:var(--color-violet-700)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-slate-100:hover{background-color:var(--color-slate-100)}.hover\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\:bg-slate-200\/50:hover{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/50:hover{background-color:color-mix(in oklab,var(--color-slate-200)50%,transparent)}}.hover\:bg-slate-200\/70:hover{background-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/70:hover{background-color:color-mix(in oklab,var(--color-slate-200)70%,transparent)}}.hover\:bg-teal-600:hover{background-color:var(--color-teal-600)}.hover\:bg-violet-100:hover{background-color:var(--color-violet-100)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-white\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\:bg-white\/50:hover{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/50:hover{background-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.hover\:\!from-\[\#8FE4DA\]:hover{--tw-gradient-from:#8fe4da!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.hover\:from-amber-600:hover{--tw-gradient-from:var(--color-amber-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:from-sky-500:hover{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:from-sky-700:hover{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:\!to-\[\#49BDEB\]:hover{--tw-gradient-to:#49bdeb!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.hover\:to-cyan-400:hover{--tw-gradient-to:var(--color-cyan-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:to-orange-600:hover{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:to-sky-600:hover{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:text-\[\#0a1628\]:hover{color:#0a1628}.hover\:text-\[\#5a6578\]:hover{color:#5a6578}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-emerald-600:hover{color:var(--color-emerald-600)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-green-600:hover{color:var(--color-green-600)}.hover\:text-indigo-600:hover{color:var(--color-indigo-600)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:text-orange-600:hover{color:var(--color-orange-600)}.hover\:text-primary:hover{color:var(--primary)}.hover\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\:text-purple-700:hover{color:var(--color-purple-700)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-rose-300:hover{color:var(--color-rose-300)}.hover\:text-rose-600:hover{color:var(--color-rose-600)}.hover\:text-rose-700:hover{color:var(--color-rose-700)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:text-sky-300:hover{color:var(--color-violet-300)}.hover\:text-sky-500:hover{color:var(--color-violet-500)}.hover\:text-sky-600:hover{color:var(--color-violet-600)}.hover\:text-sky-700:hover{color:var(--color-violet-700)}.hover\:text-slate-500:hover{color:var(--color-slate-500)}.hover\:text-slate-600:hover{color:var(--color-slate-600)}.hover\:text-slate-700:hover{color:var(--color-slate-700)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-2xl:hover{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_-20px_60px_rgba\(0\,0\,0\,0\.3\)\]:hover{--tw-shadow:0 -20px 60px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_30px_rgba\(0\,0\,0\,0\.12\)\]:hover{--tw-shadow:0 16px 30px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_40px_rgba\(114\,116\,237\,0\.28\)\]:hover{--tw-shadow:0 16px 40px var(--tw-shadow-color,#7274ed47);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-purple-500)30%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:#c4b4ff80}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-violet-300)50%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:shadow-sky-500\/35:hover{--tw-shadow-color:#8d54ff59}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-sky-500\/35:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-violet-500)35%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:shadow-teal-500\/25:hover{--tw-shadow-color:#00baa740}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-teal-500\/25:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-teal-500)25%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:z-10:focus{z-index:10}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:border-indigo-600:focus{border-color:var(--color-indigo-600)}.focus\:border-primary:focus{border-color:var(--primary)}.focus\:border-sky-400:focus{border-color:var(--color-violet-400)}.focus\:border-sky-500:focus{border-color:var(--color-violet-500)}.focus\:border-sky-600:focus{border-color:var(--color-violet-600)}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-primary:focus{background-color:var(--primary)}.focus\:bg-white:focus{background-color:var(--color-white)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:text-primary-foreground:focus{color:var(--primary-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-4:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-100:focus{--tw-ring-color:var(--color-indigo-100)}.focus\:ring-primary\/20:focus{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/20:focus{--tw-ring-color:color-mix(in oklab,var(--primary)20%,transparent)}}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-sky-100:focus{--tw-ring-color:var(--color-violet-100)}.focus\:ring-sky-200:focus{--tw-ring-color:var(--color-violet-200)}.focus\:ring-sky-400\/15:focus{--tw-ring-color:#a685ff26}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-400\/15:focus{--tw-ring-color:color-mix(in oklab,var(--color-violet-400)15%,transparent)}}.focus\:ring-sky-400\/20:focus{--tw-ring-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-400\/20:focus{--tw-ring-color:color-mix(in oklab,var(--color-violet-400)20%,transparent)}}.focus\:ring-sky-500:focus{--tw-ring-color:var(--color-violet-500)}.focus\:ring-sky-500\/20:focus{--tw-ring-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-500\/20:focus{--tw-ring-color:color-mix(in oklab,var(--color-violet-500)20%,transparent)}}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:ring-sky-400:focus-visible{--tw-ring-color:var(--color-violet-400)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.active\:scale-\[0\.98\]:active{scale:.98}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-70:disabled{opacity:.7}.disabled\:opacity-100:disabled{opacity:1}.disabled\:shadow-none:disabled{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-disabled\:opacity-50:has(:disabled){opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing)*4)1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.aria-selected\:bg-accent[aria-selected=true]{background-color:var(--accent)}.aria-selected\:bg-primary[aria-selected=true]{background-color:var(--primary)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:var(--accent-foreground)}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.aria-selected\:text-primary-foreground[aria-selected=true]{color:var(--primary-foreground)}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[active\=true\]\:z-10[data-active=true]{z-index:10}.data-\[active\=true\]\:border-ring[data-active=true]{border-color:var(--ring)}.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-accent-foreground[data-active=true]{color:var(--accent-foreground)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[active\=true\]\:ring-\[3px\][data-active=true]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}@media(hover:hover){.data-\[active\=true\]\:hover\:bg-accent[data-active=true]:hover{background-color:var(--accent)}}.data-\[active\=true\]\:focus\:bg-accent[data-active=true]:focus{background-color:var(--accent)}.data-\[active\=true\]\:aria-invalid\:border-destructive[data-active=true][aria-invalid=true]{border-color:var(--destructive)}.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing)*8)}.data-\[orientation\=horizontal\]\:h-4[data-orientation=horizontal]{height:calc(var(--spacing)*4)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing)*44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing)*1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive)90%,transparent)}}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*12)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:ring-0 *)[data-slot=navigation-menu-link]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:outline-none *)[data-slot=navigation-menu-link]:focus{--tw-outline-style:none;outline-style:none}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\[state\=active\]\:bg-card[data-state=active]{background-color:var(--card)}.data-\[state\=active\]\:bg-gradient-to-r[data-state=active]{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.data-\[state\=active\]\:from-blue-600[data-state=active]{--tw-gradient-from:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.data-\[state\=active\]\:to-sky-500[data-state=active]{--tw-gradient-to:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.data-\[state\=active\]\:text-white[data-state=active]{color:var(--color-white)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=on\]\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:var(--accent-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open],.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}@media(hover:hover){.data-\[state\=open\]\:hover\:bg-accent[data-state=open]:hover{background-color:var(--accent)}.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=open\]\:focus\:bg-accent[data-state=open]:focus{background-color:var(--accent)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-switch-background[data-state=unchecked]{background-color:var(--switch-background)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}.data-\[variant\=outline\]\:border-l-0[data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.data-\[variant\=outline\]\:shadow-xs[data-variant=outline]{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[variant\=outline\]\:first\:border-l[data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=bottom\]\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=bottom\]\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=bottom\]\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing)*24)}.data-\[vaul-drawer-direction\=bottom\]\:max-h-\[80vh\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\[vaul-drawer-direction\=bottom\]\:rounded-t-lg[data-vaul-drawer-direction=bottom]{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.data-\[vaul-drawer-direction\=bottom\]\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\[vaul-drawer-direction\=left\]\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=left\]\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=left\]\:w-3\/4[data-vaul-drawer-direction=left]{width:75%}.data-\[vaul-drawer-direction\=left\]\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\[vaul-drawer-direction\=right\]\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=right\]\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=right\]\:w-3\/4[data-vaul-drawer-direction=right]{width:75%}.data-\[vaul-drawer-direction\=right\]\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=top\]\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=top\]\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=top\]\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing)*24)}.data-\[vaul-drawer-direction\=top\]\:max-h-\[80vh\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\[vaul-drawer-direction\=top\]\:rounded-b-lg[data-vaul-drawer-direction=top]{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[vaul-drawer-direction\=top\]\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@media(min-width:40rem){.sm\:top-4{top:calc(var(--spacing)*4)}.sm\:right-8{right:calc(var(--spacing)*8)}.sm\:bottom-8{bottom:calc(var(--spacing)*8)}.sm\:mb-8{margin-bottom:calc(var(--spacing)*8)}.sm\:ml-0{margin-left:calc(var(--spacing)*0)}.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:inline{display:inline}.sm\:inline-flex{display:inline-flex}.sm\:h-\[360px\]{height:360px}.sm\:w-\[30\%\]{width:30%}.sm\:w-\[38\%\]{width:38%}.sm\:w-\[300px\]{width:300px}.sm\:w-max{width:max-content}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[480px\]{max-width:480px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:calc(var(--spacing)*2.5)}.sm\:gap-8{gap:calc(var(--spacing)*8)}:where(.sm\:space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}.sm\:p-6{padding:calc(var(--spacing)*6)}.sm\:p-7{padding:calc(var(--spacing)*7)}.sm\:px-4{padding-inline:calc(var(--spacing)*4)}.sm\:px-5{padding-inline:calc(var(--spacing)*5)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:px-8{padding-inline:calc(var(--spacing)*8)}.sm\:px-10{padding-inline:calc(var(--spacing)*10)}.sm\:py-8{padding-block:calc(var(--spacing)*8)}.sm\:pr-2\.5{padding-right:calc(var(--spacing)*2.5)}.sm\:pb-28{padding-bottom:calc(var(--spacing)*28)}.sm\:pl-2\.5{padding-left:calc(var(--spacing)*2.5)}.sm\:text-left{text-align:left}.sm\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.data-\[vaul-drawer-direction\=left\]\:sm\:max-w-sm[data-vaul-drawer-direction=left],.data-\[vaul-drawer-direction\=right\]\:sm\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media(min-width:48rem){.md\:absolute{position:absolute}.md\:-top-7{top:calc(var(--spacing)*-7)}.md\:-top-8{top:calc(var(--spacing)*-8)}.md\:-bottom-7{bottom:calc(var(--spacing)*-7)}.md\:-bottom-8{bottom:calc(var(--spacing)*-8)}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-3{grid-column:span 3/span 3}.md\:col-span-9{grid-column:span 9/span 9}.md\:mt-2{margin-top:calc(var(--spacing)*2)}.md\:mt-12{margin-top:calc(var(--spacing)*12)}.md\:mt-\[-40px\]{margin-top:-40px}.md\:mr-2{margin-right:calc(var(--spacing)*2)}.md\:mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.md\:mb-4{margin-bottom:calc(var(--spacing)*4)}.md\:mb-5{margin-bottom:calc(var(--spacing)*5)}.md\:mb-8{margin-bottom:calc(var(--spacing)*8)}.md\:ml-2{margin-left:calc(var(--spacing)*2)}.md\:ml-4{margin-left:calc(var(--spacing)*4)}.md\:block{display:block}.md\:flex{display:flex}.md\:h-2{height:calc(var(--spacing)*2)}.md\:h-9{height:calc(var(--spacing)*9)}.md\:h-10{height:calc(var(--spacing)*10)}.md\:h-11{height:calc(var(--spacing)*11)}.md\:h-12{height:calc(var(--spacing)*12)}.md\:h-14{height:calc(var(--spacing)*14)}.md\:h-16{height:calc(var(--spacing)*16)}.md\:h-\[72px\]{height:72px}.md\:h-\[86px\]{height:86px}.md\:h-\[100px\]{height:100px}.md\:h-\[130px\]{height:130px}.md\:h-\[180px\]{height:180px}.md\:h-\[200vw\]{height:200vw}.md\:h-\[310px\]{height:310px}.md\:w-2{width:calc(var(--spacing)*2)}.md\:w-9{width:calc(var(--spacing)*9)}.md\:w-10{width:calc(var(--spacing)*10)}.md\:w-11{width:calc(var(--spacing)*11)}.md\:w-12{width:calc(var(--spacing)*12)}.md\:w-14{width:calc(var(--spacing)*14)}.md\:w-\[72px\]{width:72px}.md\:w-\[86px\]{width:86px}.md\:w-\[200vw\]{width:200vw}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.md\:flex-row{flex-direction:row}.md\:flex-nowrap{flex-wrap:nowrap}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-3{gap:calc(var(--spacing)*3)}.md\:gap-4{gap:calc(var(--spacing)*4)}.md\:gap-5{gap:calc(var(--spacing)*5)}.md\:gap-8{gap:calc(var(--spacing)*8)}:where(.md\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*5)*calc(1 - var(--tw-space-y-reverse)))}.md\:rounded-b-\[80px\]{border-bottom-right-radius:80px;border-bottom-left-radius:80px}.md\:p-3{padding:calc(var(--spacing)*3)}.md\:p-4{padding:calc(var(--spacing)*4)}.md\:p-5{padding:calc(var(--spacing)*5)}.md\:p-6{padding:calc(var(--spacing)*6)}.md\:p-10{padding:calc(var(--spacing)*10)}.md\:p-12{padding:calc(var(--spacing)*12)}.md\:px-4{padding-inline:calc(var(--spacing)*4)}.md\:px-8{padding-inline:calc(var(--spacing)*8)}.md\:py-2{padding-block:calc(var(--spacing)*2)}.md\:py-5{padding-block:calc(var(--spacing)*5)}.md\:py-6{padding-block:calc(var(--spacing)*6)}.md\:pt-8{padding-top:calc(var(--spacing)*8)}.md\:pr-4{padding-right:calc(var(--spacing)*4)}.md\:pr-10{padding-right:calc(var(--spacing)*10)}.md\:pl-12{padding-left:calc(var(--spacing)*12)}.md\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.md\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.md\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.md\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.md\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.md\:text-\[10px\]{font-size:10px}.md\:text-\[11px\]{font-size:11px}.md\:text-\[12px\]{font-size:12px}.md\:text-\[13px\]{font-size:13px}.md\:text-\[15px\]{font-size:15px}.md\:text-\[16px\]{font-size:16px}.md\:text-\[17px\]{font-size:17px}.md\:text-\[22px\]{font-size:22px}.md\:text-\[26px\]{font-size:26px}.md\:text-\[32px\]{font-size:32px}.md\:text-\[44px\]{font-size:44px}.md\:text-\[70px\]{font-size:70px}.md\:text-\[80px\]{font-size:80px}.md\:text-\[110px\]{font-size:110px}.md\:opacity-0{opacity:0}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing)*2)}.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing)*0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing)*2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media(min-width:64rem){.lg\:static{position:static}.lg\:right-10{right:calc(var(--spacing)*10)}.lg\:right-\[250px\]{right:250px}.lg\:bottom-20{bottom:calc(var(--spacing)*20)}.lg\:z-auto{z-index:auto}.lg\:mb-8{margin-bottom:calc(var(--spacing)*8)}.lg\:ml-10{margin-left:calc(var(--spacing)*10)}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:h-full{height:100%}.lg\:min-h-0{min-height:calc(var(--spacing)*0)}.lg\:min-h-\[160px\]{min-height:160px}.lg\:w-72{width:calc(var(--spacing)*72)}.lg\:w-\[270px\]{width:270px}.lg\:translate-y-\[19\%\]{--tw-translate-y:19%;translate:var(--tw-translate-x)var(--tw-translate-y)}.lg\:scale-\[1\.3\]{scale:1.3}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}.lg\:justify-end{justify-content:flex-end}.lg\:gap-5{gap:calc(var(--spacing)*5)}.lg\:gap-8{gap:calc(var(--spacing)*8)}.lg\:gap-10{gap:calc(var(--spacing)*10)}.lg\:gap-12{gap:calc(var(--spacing)*12)}.lg\:gap-14{gap:calc(var(--spacing)*14)}.lg\:overflow-hidden{overflow:hidden}.lg\:p-4{padding:calc(var(--spacing)*4)}.lg\:p-8{padding:calc(var(--spacing)*8)}.lg\:p-12{padding:calc(var(--spacing)*12)}.lg\:px-16{padding-inline:calc(var(--spacing)*16)}.lg\:pr-\[280px\]{padding-right:280px}.lg\:pb-0{padding-bottom:calc(var(--spacing)*0)}.lg\:pl-6{padding-left:calc(var(--spacing)*6)}.lg\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.lg\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.lg\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:80rem){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:col-span-3{grid-column:span 3/span 3}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:mx-0{margin-inline:calc(var(--spacing)*0)}.xl\:mb-8{margin-bottom:calc(var(--spacing)*8)}.xl\:flex{display:flex}.xl\:h-\[480px\]{height:480px}.xl\:w-7\/12{width:58.3333%}.xl\:w-\[450px\]{width:450px}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:flex-row{flex-direction:row}.xl\:self-center{align-self:center}.xl\:px-10{padding-inline:calc(var(--spacing)*10)}.xl\:text-\[3\.4rem\]{font-size:3.4rem}}.dark\:border-\[\#2b3140\]:is(.dark *){border-color:#2b3140}.dark\:border-\[\#2e364a\]:is(.dark *){border-color:#2e364a}.dark\:border-\[\#2f3547\]:is(.dark *){border-color:#2f3547}.dark\:border-\[\#8d7fff\]:is(.dark *){border-color:#8d7fff}.dark\:border-\[\#333a4e\]:is(.dark *){border-color:#333a4e}.dark\:border-\[\#30374a\]:is(.dark *){border-color:#30374a}.dark\:border-amber-300\/40:is(.dark *){border-color:#ffd23666}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-300\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-300)40%,transparent)}}.dark\:border-amber-400\/40:is(.dark *){border-color:#fcbb0066}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-400)40%,transparent)}}.dark\:border-amber-500\/40:is(.dark *){border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-500\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.dark\:border-amber-500\/50:is(.dark *){border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-500\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.dark\:border-emerald-300\/40:is(.dark *){border-color:#5ee9b566}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-300\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-300)40%,transparent)}}.dark\:border-emerald-400\/40:is(.dark *){border-color:#00d29466}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-400)40%,transparent)}}.dark\:border-emerald-400\/70:is(.dark *){border-color:#00d294b3}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-400\/70:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-400)70%,transparent)}}.dark\:border-gray-600:is(.dark *){border-color:var(--color-gray-600)}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:border-rose-300\/40:is(.dark *){border-color:#ffa2ae66}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-300\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-300)40%,transparent)}}.dark\:border-rose-400\/40:is(.dark *){border-color:#ff667f66}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-400)40%,transparent)}}.dark\:bg-\[\#2a3143\]:is(.dark *){background-color:#2a3143}.dark\:bg-\[\#8c7dff\]\/20:is(.dark *){background-color:#8c7dff33}.dark\:bg-\[\#171d2a\]:is(.dark *){background-color:#171d2a}.dark\:bg-\[\#181d27\]:is(.dark *){background-color:#181d27}.dark\:bg-\[\#11151d\]:is(.dark *){background-color:#11151d}.dark\:bg-amber-100\/20:is(.dark *){background-color:#fef3c633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-100\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-100)20%,transparent)}}.dark\:bg-amber-400\/10:is(.dark *){background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-400\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-500\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.dark\:bg-amber-500\/15:is(.dark *){background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-500\/15:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-500)15%,transparent)}}.dark\:bg-amber-900\/20:is(.dark *){background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-900)20%,transparent)}}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-emerald-500\/15:is(.dark *){background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/15:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500)15%,transparent)}}.dark\:bg-emerald-500\/20:is(.dark *){background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.dark\:bg-emerald-900\/20:is(.dark *){background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-900)20%,transparent)}}.dark\:bg-gray-800:is(.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-900:is(.dark *){background-color:var(--color-gray-900)}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:bg-rose-500\/15:is(.dark *){background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-500\/15:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-500)15%,transparent)}}.dark\:bg-rose-900\/20:is(.dark *){background-color:#8b083633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-900)20%,transparent)}}.dark\:bg-\[radial-gradient\(circle_at_15\%_15\%\,rgba\(140\,125\,255\,0\.28\)\,transparent_45\%\)\,radial-gradient\(circle_at_85\%_20\%\,rgba\(121\,79\,255\,0\.17\)\,transparent_40\%\)\]:is(.dark *){background-image:radial-gradient(circle at 15% 15%,#8c7dff47,#0000 45%),radial-gradient(circle at 85% 20%,#794fff2b,#0000 40%)}.dark\:text-\[\#9aa4be\]:is(.dark *){color:#9aa4be}.dark\:text-\[\#9da7bf\]:is(.dark *){color:#9da7bf}.dark\:text-\[\#9e8fff\]:is(.dark *){color:#9e8fff}.dark\:text-\[\#9ea8c2\]:is(.dark *){color:#9ea8c2}.dark\:text-\[\#95a0bb\]:is(.dark *){color:#95a0bb}.dark\:text-\[\#98a2bc\]:is(.dark *){color:#98a2bc}.dark\:text-\[\#a2abc2\]:is(.dark *){color:#a2abc2}.dark\:text-\[\#a8b2c9\]:is(.dark *){color:#a8b2c9}.dark\:text-\[\#a9b3ca\]:is(.dark *){color:#a9b3ca}.dark\:text-\[\#aab3c7\]:is(.dark *){color:#aab3c7}.dark\:text-\[\#b2bad0\]:is(.dark *){color:#b2bad0}.dark\:text-\[\#b3bdd5\]:is(.dark *){color:#b3bdd5}.dark\:text-\[\#b6bfd5\]:is(.dark *){color:#b6bfd5}.dark\:text-\[\#c4cce0\]:is(.dark *){color:#c4cce0}.dark\:text-\[\#c7c0ff\]:is(.dark *){color:#c7c0ff}.dark\:text-\[\#c7cfe3\]:is(.dark *){color:#c7cfe3}.dark\:text-\[\#d5dcf0\]:is(.dark *){color:#d5dcf0}.dark\:text-\[\#ecf0fb\]:is(.dark *){color:#ecf0fb}.dark\:text-\[\#f5f7fb\]:is(.dark *){color:#f5f7fb}.dark\:text-amber-100:is(.dark *){color:var(--color-amber-100)}.dark\:text-amber-100\/90:is(.dark *){color:#fef3c6e6}@supports (color:color-mix(in lab,red,red)){.dark\:text-amber-100\/90:is(.dark *){color:color-mix(in oklab,var(--color-amber-100)90%,transparent)}}.dark\:text-amber-200:is(.dark *){color:var(--color-amber-200)}.dark\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.dark\:text-emerald-200:is(.dark *){color:var(--color-emerald-200)}.dark\:text-emerald-300:is(.dark *){color:var(--color-emerald-300)}.dark\:text-gray-400:is(.dark *){color:var(--color-gray-400)}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}.dark\:text-rose-300:is(.dark *){color:var(--color-rose-300)}.dark\:shadow-\[0_12px_24px_rgba\(0\,0\,0\,0\.22\)\]:is(.dark *){--tw-shadow:0 12px 24px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.dark\:hover\:border-\[\#8c7dff\]:is(.dark *):hover{border-color:#8c7dff}.dark\:hover\:bg-\[\#202736\]:is(.dark *):hover{background-color:#202736}.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-amber-500\/25:is(.dark *):hover{background-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-amber-500\/25:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-amber-500)25%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-card-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--card-foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input)80%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:var(--muted-foreground)}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:color-mix(in oklab,var(--border)50%,transparent)}}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:var(--border)}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:var(--muted)}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{outline-offset:2px;outline:2px solid #0000}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\[\&_p\]\:m-0 p{margin:calc(var(--spacing)*0)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:var(--accent)}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:first-child:has([aria-selected]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:last-child:has([aria-selected]),.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\:last-child\]\:pb-6:last-child{padding-bottom:calc(var(--spacing)*6)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:h-2\.5>svg{height:calc(var(--spacing)*2.5)}.\[\&\>svg\]\:h-3>svg{height:calc(var(--spacing)*3)}.\[\&\>svg\]\:w-2\.5>svg{width:calc(var(--spacing)*2.5)}.\[\&\>svg\]\:w-3>svg{width:calc(var(--spacing)*3)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing)*-2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing)*-2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary)90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}:root{--font-size:16px;--font-display:"Nunito",ui-sans-serif,system-ui,sans-serif;--font-body:"Nunito",ui-sans-serif,system-ui,sans-serif;--background:#f7f9fc;--foreground:#0a1628;--card:#fff;--card-foreground:#0a1628;--popover:#fff;--popover-foreground:#0a1628;--primary:#7c3aed;--primary-foreground:#fff;--secondary:#f3f0ff;--secondary-foreground:#5b21b6;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#fff1f2;--accent-foreground:#be123c;--destructive:#ef4444;--destructive-foreground:#fff;--border:#e4e4e7;--input:transparent;--input-background:#f4f4f5;--switch-background:#d4d4d8;--font-weight-medium:500;--font-weight-normal:400;--ring:#a78bfa;--chart-1:#7c3aed;--chart-2:#f43f5e;--chart-3:#10b981;--chart-4:#fb923c;--chart-5:#0ea5e9;--radius:1.25rem;--sidebar:#fff;--sidebar-foreground:#09090b;--sidebar-primary:#7c3aed;--sidebar-primary-foreground:#fff;--sidebar-accent:#f3f0ff;--sidebar-accent-foreground:#5b21b6;--sidebar-border:#e4e4e7;--sidebar-ring:#7c3aed}.dark{--background:#050d18;--foreground:#f0f7ff;--card:#0a1628;--card-foreground:#f0f7ff;--popover:#0a1628;--popover-foreground:#f0f7ff;--primary:#a78bfa;--primary-foreground:#fff;--secondary:#2e1065;--secondary-foreground:#c4b5fd;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#f43f5e;--destructive:#ef4444;--destructive-foreground:#09090b;--border:#27272a;--input:#27272a;--input-background:#27272a;--switch-background:#3f3f46;--ring:#a78bfa;--font-weight-medium:500;--font-weight-normal:400;--chart-1:#a78bfa;--chart-2:#fb7185;--chart-3:#34d399;--chart-4:#fb923c;--chart-5:#38bdf8;--sidebar:#09090b;--sidebar-foreground:#fafafa;--sidebar-primary:#a78bfa;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#fafafa;--sidebar-border:#27272a;--sidebar-ring:#a78bfa}html{font-size:var(--font-size)}html[data-density=compact]{--radius:.9rem}html.reduced-motion *,html.reduced-motion :before,html.reduced-motion :after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}html.smart-dark{filter:invert()hue-rotate(180deg);background:#101217}html.smart-dark img,html.smart-dark picture,html.smart-dark video,html.smart-dark canvas,html.smart-dark svg,html.smart-dark iframe,html.smart-dark [data-preserve-color=true]{filter:invert()hue-rotate(180deg)}.font-display{font-family:var(--font-display)}.font-body{font-family:var(--font-body)}.glow-blue{box-shadow:0 0 24px #0284c71f,0 0 64px #0284c70a}.glow-violet{box-shadow:0 0 24px #7c3aed1f,0 0 64px #7c3aed0a}.glow-rose{box-shadow:0 0 24px #f43f5e1f,0 0 64px #f43f5e0a}.glow-emerald{box-shadow:0 0 24px #0596691f,0 0 64px #0596690a}.bg-dot-pattern{background-image:radial-gradient(circle,#7c3aed14 1px,#0000 1px);background-size:24px 24px}.dark .bg-dot-pattern{background-image:radial-gradient(circle,#a78bfa1f 1px,#0000 1px)}.bg-math-pattern{background-color:var(--background);background-image:url("data:image/svg+xml,%3Csvg width='150' height='150' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(124, 58, 237, 0.05)' font-family='sans-serif' font-weight='bold' font-size='28'%3E%3Ctext x='20' y='40'%3E%2B%3C/text%3E%3Ctext x='90' y='60'%3E%3D%3C/text%3E%3Ctext x='40' y='110'%3E%25%3C/text%3E%3Ctext x='110' y='130'%3E%C3%97%3C/text%3E%3Ctext x='130' y='30'%3E%C3%B7%3C/text%3E%3C/g%3E%3C/svg%3E");background-size:150px 150px}.bg-noise{position:relative}.bg-noise:before{content:"";opacity:.03;pointer-events:none;z-index:1;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");position:absolute;inset:0}.card-elevated{box-shadow:0 16px 40px -8px #7c3aed26,0 0 24px -5px #7c3aed14}.card-elevated-lg{box-shadow:0 24px 60px -12px #7c3aed33,0 0 32px -10px #7c3aed1a}.shadow-3d-button{box-shadow:0 12px 24px -6px var(--tw-shadow-color,#f9731666),0 6px 12px -4px var(--tw-shadow-color,#f973164d)}.dark .card-elevated{box-shadow:0 1px 2px #0003,0 4px 16px #00000026}.dark .card-elevated-lg{box-shadow:0 2px 4px #0003,0 8px 32px #0003}*{scrollbar-width:thin;scrollbar-color:transparent transparent}:hover{scrollbar-color:#0284c733 transparent}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:#0000;border-radius:10px;transition:background-color .3s}:hover::-webkit-scrollbar-thumb{background-color:#0284c733}::-webkit-scrollbar-thumb:hover{background-color:#0284c766}.scrollbar-hide{scrollbar-width:none;-ms-overflow-style:none}.scrollbar-hide::-webkit-scrollbar{display:none}.accent-line{position:relative}.accent-line:after{content:"";background:linear-gradient(90deg,#0284c7,#f43f5e);border-radius:2px;width:48px;height:3px;position:absolute;bottom:0;left:0}.surface-raised{background:linear-gradient(135deg,#fff,#f8fafc);border:1px solid #e2e8f0cc}.surface-inset{background:linear-gradient(135deg,#f1f5f9,#e8eef6);border:1px solid #cbd5e180}.card-accent-sky{border-left:3px solid #0284c7}.card-accent-rose{border-left:3px solid #f43f5e}.card-accent-emerald{border-left:3px solid #059669}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}.chat-markdown{font-family:var(--font-body);overflow-wrap:anywhere;word-break:break-word;font-size:.875rem;line-height:1.625}.chat-markdown h1{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:700}.chat-markdown h2{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.375rem;font-size:1.1rem;font-weight:700}.chat-markdown h3{font-family:var(--font-display);color:var(--muted-foreground);margin-top:.5rem;margin-bottom:.25rem;font-size:1rem;font-weight:600}.chat-markdown p{margin-top:.375rem;margin-bottom:.375rem}.chat-markdown ul,.chat-markdown ol{margin-top:.375rem;margin-bottom:.375rem;padding-left:1.25rem}.chat-markdown ul{list-style-type:disc}.chat-markdown ol{list-style-type:decimal}.chat-markdown li{margin-top:.125rem;margin-bottom:.125rem}.chat-markdown strong{color:var(--foreground);font-weight:700}.chat-markdown em{font-style:italic}.chat-markdown code{background:var(--secondary);color:var(--primary);border-radius:.25rem;padding:.125rem .375rem;font-size:.8125rem}.chat-markdown pre{background:var(--muted);border:1px solid var(--border);border-radius:.5rem;margin-top:.5rem;margin-bottom:.5rem;padding:.75rem;overflow-x:auto}.chat-markdown pre code{color:inherit;background:0 0;padding:0}.chat-markdown hr{border-color:#94a3b873;margin:.75rem 0}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5rem 0;font-size:.8125rem}.chat-markdown th{background:var(--muted);text-align:left;border:1px solid var(--border);padding:.375rem .5rem;font-weight:600}.chat-markdown td{border:1px solid var(--border);padding:.375rem .5rem}.chat-markdown blockquote{border-left:3px solid var(--primary);color:var(--muted-foreground);margin:.5rem 0;padding-left:.75rem;font-style:italic}.chat-markdown a{color:var(--primary);text-decoration:underline}.chat-markdown>:first-child{margin-top:0}.chat-markdown>:last-child{margin-bottom:0}.chat-markdown .katex-display{padding-bottom:.15rem;overflow:auto hidden}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}} diff --git a/assets/index-CI05E69G.css b/assets/index-CI05E69G.css new file mode 100644 index 0000000000000000000000000000000000000000..1580bb0609e4d669504371db0fb8b13c147fd108 --- /dev/null +++ b/assets/index-CI05E69G.css @@ -0,0 +1 @@ +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-divide-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-orange-900:oklch(40.8% .123 38.172);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-300:oklch(90.5% .182 98.111);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-teal-50:oklch(98.4% .014 180.72);--color-teal-100:oklch(95.3% .051 180.801);--color-teal-200:oklch(91% .096 180.426);--color-teal-300:oklch(85.5% .138 181.071);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-teal-600:oklch(60% .118 184.704);--color-teal-700:oklch(51.1% .096 186.391);--color-teal-800:oklch(43.7% .078 188.216);--color-teal-900:oklch(38.6% .063 188.416);--color-cyan-50:oklch(98.4% .019 200.873);--color-cyan-100:oklch(95.6% .045 203.388);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-200:var(--color-violet-200);--color-sky-700:var(--color-violet-700);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-violet-50:oklch(96.9% .016 293.756);--color-violet-100:oklch(94.3% .029 294.588);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-600:oklch(54.1% .281 293.009);--color-violet-700:oklch(49.1% .27 292.581);--color-violet-800:oklch(43.2% .232 292.759);--color-violet-900:oklch(38% .189 293.745);--color-violet-950:oklch(28.3% .141 291.089);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-purple-800:oklch(43.8% .218 303.724);--color-purple-900:oklch(38.1% .176 304.987);--color-fuchsia-200:oklch(90.3% .076 319.62);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-pink-50:oklch(97.1% .014 343.198);--color-pink-100:oklch(94.8% .028 342.258);--color-pink-300:oklch(82.3% .12 346.018);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-pink-600:oklch(59.2% .249 .584);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-100:oklch(94.1% .03 12.58);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-700:oklch(51.4% .222 16.935);--color-rose-800:oklch(45.5% .188 13.697);--color-rose-900:oklch(41% .159 10.272);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-700:oklch(37% .013 285.805);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground);font-family:var(--font-body);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-family:var(--font-display);font-size:var(--text-2xl);letter-spacing:-.02em;font-weight:700;line-height:1.3}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-family:var(--font-display);font-size:var(--text-xl);letter-spacing:-.01em;font-weight:700;line-height:1.35}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-family:var(--font-display);font-size:var(--text-lg);font-weight:600;line-height:1.4}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4{font-family:var(--font-display);font-size:var(--text-base);font-weight:600;line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.\[container-type\:inline-size\]{container-type:inline-size}.\[container-type\:size\]{container-type:size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-x-6{inset-inline:calc(var(--spacing)*6)}.inset-x-\[-20px\]{inset-inline:-20px}.inset-y-0{inset-block:calc(var(--spacing)*0)}.end-1{inset-inline-end:calc(var(--spacing)*1)}.-top-1{top:calc(var(--spacing)*-1)}.-top-2{top:calc(var(--spacing)*-2)}.-top-3{top:calc(var(--spacing)*-3)}.-top-4{top:calc(var(--spacing)*-4)}.-top-5{top:calc(var(--spacing)*-5)}.-top-6{top:calc(var(--spacing)*-6)}.-top-8{top:calc(var(--spacing)*-8)}.-top-12{top:calc(var(--spacing)*-12)}.-top-24{top:calc(var(--spacing)*-24)}.-top-32{top:calc(var(--spacing)*-32)}.-top-40{top:calc(var(--spacing)*-40)}.top-0{top:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-1\.5{top:calc(var(--spacing)*1.5)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:calc(var(--spacing)*2)}.top-3{top:calc(var(--spacing)*3)}.top-3\.5{top:calc(var(--spacing)*3.5)}.top-4{top:calc(var(--spacing)*4)}.top-5{top:calc(var(--spacing)*5)}.top-6{top:calc(var(--spacing)*6)}.top-8{top:calc(var(--spacing)*8)}.top-24{top:calc(var(--spacing)*24)}.top-\[-10\%\]{top:-10%}.top-\[1px\]{top:1px}.top-\[10\%\]{top:10%}.top-\[40\%\]{top:40%}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.-right-1{right:calc(var(--spacing)*-1)}.-right-2{right:calc(var(--spacing)*-2)}.-right-3{right:calc(var(--spacing)*-3)}.-right-4{right:calc(var(--spacing)*-4)}.-right-12{right:calc(var(--spacing)*-12)}.-right-24{right:calc(var(--spacing)*-24)}.-right-32{right:calc(var(--spacing)*-32)}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-1\/3{right:33.3333%}.right-1\/4{right:25%}.right-2{right:calc(var(--spacing)*2)}.right-2\.5{right:calc(var(--spacing)*2.5)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.right-6{right:calc(var(--spacing)*6)}.right-8{right:calc(var(--spacing)*8)}.right-12{right:calc(var(--spacing)*12)}.right-\[-5\%\]{right:-5%}.right-\[-5px\]{right:-5px}.right-\[-10\%\]{right:-10%}.right-\[-15px\]{right:-15px}.right-\[-20\%\]{right:-20%}.right-\[150px\]{right:150px}.right-full{right:100%}.-bottom-1{bottom:calc(var(--spacing)*-1)}.-bottom-2{bottom:calc(var(--spacing)*-2)}.-bottom-5{bottom:calc(var(--spacing)*-5)}.-bottom-6{bottom:calc(var(--spacing)*-6)}.-bottom-8{bottom:calc(var(--spacing)*-8)}.-bottom-10{bottom:calc(var(--spacing)*-10)}.-bottom-12{bottom:calc(var(--spacing)*-12)}.-bottom-32{bottom:calc(var(--spacing)*-32)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-5{bottom:calc(var(--spacing)*5)}.bottom-8{bottom:calc(var(--spacing)*8)}.bottom-16{bottom:calc(var(--spacing)*16)}.bottom-20{bottom:calc(var(--spacing)*20)}.bottom-\[-10\%\]{bottom:-10%}.bottom-\[-50px\]{bottom:-50px}.bottom-\[-500px\]{bottom:-500px}.bottom-\[20\%\]{bottom:20%}.bottom-\[40px\]{bottom:40px}.bottom-full{bottom:100%}.-left-1{left:calc(var(--spacing)*-1)}.-left-2{left:calc(var(--spacing)*-2)}.-left-4{left:calc(var(--spacing)*-4)}.-left-6{left:calc(var(--spacing)*-6)}.-left-10{left:calc(var(--spacing)*-10)}.-left-12{left:calc(var(--spacing)*-12)}.-left-32{left:calc(var(--spacing)*-32)}.-left-\[150\%\]{left:-150%}.left-0{left:calc(var(--spacing)*0)}.left-1{left:calc(var(--spacing)*1)}.left-1\/2{left:50%}.left-1\/3{left:33.3333%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-3\.5{left:calc(var(--spacing)*3.5)}.left-4{left:calc(var(--spacing)*4)}.left-6{left:calc(var(--spacing)*6)}.left-12{left:calc(var(--spacing)*12)}.left-\[-10\%\]{left:-10%}.left-\[-20px\]{left:-20px}.left-\[40\%\]{left:40%}.left-\[50\%\]{left:50%}.left-\[54px\]{left:54px}.left-\[56px\]{left:56px}.left-\[var\(--x\)\]{left:var(--x)}.left-full{left:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.z-\[3\]{z-index:3}.z-\[4\]{z-index:4}.z-\[11\]{z-index:11}.z-\[12\]{z-index:12}.z-\[13\]{z-index:13}.z-\[51\]{z-index:51}.z-\[60\]{z-index:60}.z-\[70\]{z-index:70}.z-\[100\]{z-index:100}.z-\[130\]{z-index:130}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-12{grid-column:span 12/span 12}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.-mx-3{margin-inline:calc(var(--spacing)*-3)}.-mx-\[4px\]{margin-inline:-4px}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-\[-20px\]{margin-inline:-20px}.mx-\[1px\]{margin-inline:1px}.mx-auto{margin-inline:auto}.my-0\.5{margin-block:calc(var(--spacing)*.5)}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.25em;font-weight:600}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.prose{--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:oklab(21% -.00316127 -.0338527/.1);--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733);font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.-mt-0\.5{margin-top:calc(var(--spacing)*-.5)}.-mt-1{margin-top:calc(var(--spacing)*-1)}.-mt-3{margin-top:calc(var(--spacing)*-3)}.-mt-4{margin-top:calc(var(--spacing)*-4)}.-mt-24{margin-top:calc(var(--spacing)*-24)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-\[-10px\]{margin-top:-10px}.mt-\[-20px\]{margin-top:-20px}.mt-\[5px\]{margin-top:5px}.mt-auto{margin-top:auto}.-mr-3{margin-right:calc(var(--spacing)*-3)}.-mr-24{margin-right:calc(var(--spacing)*-24)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mr-4{margin-right:calc(var(--spacing)*4)}.-mb-8{margin-bottom:calc(var(--spacing)*-8)}.-mb-18{margin-bottom:calc(var(--spacing)*-18)}.-mb-\[1px\]{margin-bottom:-1px}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-10{margin-bottom:calc(var(--spacing)*10)}.mb-\[-10px\]{margin-bottom:-10px}.mb-\[2px\]{margin-bottom:2px}.-ml-3{margin-left:calc(var(--spacing)*-3)}.-ml-4{margin-left:calc(var(--spacing)*-4)}.-ml-18{margin-left:calc(var(--spacing)*-18)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-11{margin-left:calc(var(--spacing)*11)}.ml-12{margin-left:calc(var(--spacing)*12)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.\[aspect-ratio\:1\/var\(--aspect-ratio\)\]{aspect-ratio:1/var(--aspect-ratio)}.aspect-\[4\/5\]{aspect-ratio:4/5}.aspect-square{aspect-ratio:1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-full{width:100%;height:100%}.\[height\:100cqmax\]{height:100cqmax}.h-0{height:calc(var(--spacing)*0)}.h-1{height:calc(var(--spacing)*1)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-28{height:calc(var(--spacing)*28)}.h-32{height:calc(var(--spacing)*32)}.h-36{height:calc(var(--spacing)*36)}.h-40{height:calc(var(--spacing)*40)}.h-48{height:calc(var(--spacing)*48)}.h-64{height:calc(var(--spacing)*64)}.h-80{height:calc(var(--spacing)*80)}.h-96{height:calc(var(--spacing)*96)}.h-\[1\.15rem\]{height:1.15rem}.h-\[1px\]{height:1px}.h-\[3px\]{height:3px}.h-\[5px\]{height:5px}.h-\[14px\]{height:14px}.h-\[16px\]{height:16px}.h-\[18px\]{height:18px}.h-\[34px\]{height:34px}.h-\[35px\]{height:35px}.h-\[40\%\]{height:40%}.h-\[40px\]{height:40px}.h-\[45vh\]{height:45vh}.h-\[50px\]{height:50px}.h-\[52px\]{height:52px}.h-\[60\%\]{height:60%}.h-\[60px\]{height:60px}.h-\[70\%\]{height:70%}.h-\[70px\]{height:70px}.h-\[72px\]{height:72px}.h-\[75px\]{height:75px}.h-\[100px\]{height:100px}.h-\[100vh\]{height:100vh}.h-\[105\%\]{height:105%}.h-\[110\%\]{height:110%}.h-\[120\%\]{height:120%}.h-\[120px\]{height:120px}.h-\[125px\]{height:125px}.h-\[140px\]{height:140px}.h-\[150vh\]{height:150vh}.h-\[155px\]{height:155px}.h-\[170px\]{height:170px}.h-\[205px\]{height:205px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[300vw\]{height:300vw}.h-\[340px\]{height:340px}.h-\[400px\]{height:400px}.h-\[420px\]{height:420px}.h-\[500px\]{height:500px}.h-\[600px\]{height:600px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[calc\(100\%-24px\)\]{height:calc(100% - 24px)}.h-\[calc\(100vh-2rem\)\]{height:calc(100vh - 2rem)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-context-menu-content-available-height\){max-height:var(--radix-context-menu-content-available-height)}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-72{max-height:calc(var(--spacing)*72)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[70vh\]{max-height:70vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[300px\]{max-height:300px}.max-h-\[500px\]{max-height:500px}.max-h-\[600px\]{max-height:600px}.max-h-\[700px\]{max-height:700px}.max-h-\[calc\(85vh-280px\)\]{max-height:calc(85vh - 280px)}.max-h-\[calc\(90vh-200px\)\]{max-height:calc(90vh - 200px)}.max-h-\[calc\(90vh-320px\)\]{max-height:calc(90vh - 320px)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-4{min-height:calc(var(--spacing)*4)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-24{min-height:calc(var(--spacing)*24)}.min-h-\[24px\]{min-height:24px}.min-h-\[48px\]{min-height:48px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[56px\]{min-height:56px}.min-h-\[78px\]{min-height:78px}.min-h-\[80px\]{min-height:80px}.min-h-\[140px\]{min-height:140px}.min-h-\[170px\]{min-height:170px}.min-h-\[200px\]{min-height:200px}.min-h-\[290px\]{min-height:290px}.min-h-\[450px\]{min-height:450px}.min-h-\[500px\]{min-height:500px}.min-h-\[calc\(100vh-3\.5rem\)\]{min-height:calc(100vh - 3.5rem)}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.\!w-auto{width:auto!important}.\[width\:100cqh\]{width:100cqh}.\[width\:100cqi\]{width:100cqi}.\[width\:var\(--width\)\]{width:var(--width)}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-0{width:calc(var(--spacing)*0)}.w-0\.5{width:calc(var(--spacing)*.5)}.w-1{width:calc(var(--spacing)*1)}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-8\/12{width:66.6667%}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-10\/12{width:83.3333%}.w-11{width:calc(var(--spacing)*11)}.w-11\/12{width:91.6667%}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-32{width:calc(var(--spacing)*32)}.w-36{width:calc(var(--spacing)*36)}.w-40{width:calc(var(--spacing)*40)}.w-44{width:calc(var(--spacing)*44)}.w-48{width:calc(var(--spacing)*48)}.w-52{width:calc(var(--spacing)*52)}.w-56{width:calc(var(--spacing)*56)}.w-64{width:calc(var(--spacing)*64)}.w-72{width:calc(var(--spacing)*72)}.w-80{width:calc(var(--spacing)*80)}.w-96{width:calc(var(--spacing)*96)}.w-\[5px\]{width:5px}.w-\[16px\]{width:16px}.w-\[28\%\]{width:28%}.w-\[34px\]{width:34px}.w-\[35\%\]{width:35%}.w-\[35px\]{width:35px}.w-\[40\%\]{width:40%}.w-\[46px\]{width:46px}.w-\[52px\]{width:52px}.w-\[55\%\]{width:55%}.w-\[55px\]{width:55px}.w-\[60\%\]{width:60%}.w-\[60px\]{width:60px}.w-\[65px\]{width:65px}.w-\[70\%\]{width:70%}.w-\[70px\]{width:70px}.w-\[75px\]{width:75px}.w-\[78px\]{width:78px}.w-\[85\%\]{width:85%}.w-\[90\%\]{width:90%}.w-\[95\%\]{width:95%}.w-\[100\%\]{width:100%}.w-\[100px\]{width:100px}.w-\[110\%\]{width:110%}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[150vw\]{width:150vw}.w-\[152px\]{width:152px}.w-\[168px\]{width:168px}.w-\[200px\]{width:200px}.w-\[220px\]{width:220px}.w-\[250vw\]{width:250vw}.w-\[260px\]{width:260px}.w-\[280px\]{width:280px}.w-\[300vw\]{width:300vw}.w-\[340px\]{width:340px}.w-\[350px\]{width:350px}.w-\[400px\]{width:400px}.w-\[420px\]{width:420px}.w-\[600px\]{width:600px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-20{max-width:calc(var(--spacing)*20)}.max-w-\[70\%\]{max-width:70%}.max-w-\[75\%\]{max-width:75%}.max-w-\[120px\]{max-width:120px}.max-w-\[145px\]{max-width:145px}.max-w-\[190px\]{max-width:190px}.max-w-\[200px\]{max-width:200px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[340px\]{max-width:340px}.max-w-\[420px\]{max-width:420px}.max-w-\[480px\]{max-width:480px}.max-w-\[800px\]{max-width:800px}.max-w-\[1400px\]{max-width:1400px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-\[calc\(100vw-24px\)\]{max-width:calc(100vw - 24px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-max{max-width:max-content}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-5{min-width:calc(var(--spacing)*5)}.min-w-8{min-width:calc(var(--spacing)*8)}.min-w-9{min-width:calc(var(--spacing)*9)}.min-w-10{min-width:calc(var(--spacing)*10)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[60px\]{min-width:60px}.min-w-\[120px\]{min-width:120px}.min-w-\[140px\]{min-width:140px}.min-w-\[260px\]{min-width:260px}.min-w-\[280px\]{min-width:280px}.min-w-\[1920px\]{min-width:1920px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.\[transform-origin\:0\%_0\%\]{transform-origin:0 0}.\[transform-origin\:50\%_0\%\]{transform-origin:50% 0}.\[transform-origin\:100\%_0\%\]{transform-origin:100% 0}.origin-\(--radix-context-menu-content-transform-origin\){transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-hover-card-content-transform-origin\){transform-origin:var(--radix-hover-card-content-transform-origin)}.origin-\(--radix-menubar-content-transform-origin\){transform-origin:var(--radix-menubar-content-transform-origin)}.origin-\(--radix-popover-content-transform-origin\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-\[50\%_45\%\]{transform-origin:50% 45%}.origin-bottom{transform-origin:bottom}.origin-bottom-right{transform-origin:100% 100%}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-1\/3{--tw-translate-x:calc(calc(1/3*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-1\/4{--tw-translate-x: -25% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-\[45px\]{--tw-translate-x: -45px ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/3{--tw-translate-x:calc(1/3*100%);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/4{--tw-translate-x: 25% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-10px\]{--tw-translate-x:-10px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[45px\]{--tw-translate-x:45px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0\.5{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-1{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-1\/2{--tw-translate-y: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-1\/3{--tw-translate-y:calc(1/3*100%);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-2{--tw-translate-y:calc(var(--spacing)*2);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-8{--tw-translate-y:calc(var(--spacing)*8);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-10{--tw-translate-y:calc(var(--spacing)*10);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-12{--tw-translate-y:calc(var(--spacing)*12);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[21\%\]{--tw-translate-y:21%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-full{--tw-translate-y:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-x-\[-1\]{--tw-scale-x:-1;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-y-75{--tw-scale-y:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-\[0\.75\]{scale:.75}.scale-\[0\.80\]{scale:.8}.scale-\[0\.98\]{scale:.98}.scale-\[1\.1\]{scale:1.1}.scale-\[1\.02\]{scale:1.02}.scale-\[1\.05\]{scale:1.05}.scale-\[1\.5\]{scale:1.5}.scale-\[1\.7\]{scale:1.7}.scale-\[1\.25\]{scale:1.25}.scale-\[2\.2\]{scale:2.2}.scale-\[3\.2\]{scale:3.2}.-rotate-12{rotate:-12deg}.-rotate-90{rotate:-90deg}.-rotate-\[15deg\]{rotate:-15deg}.rotate-3{rotate:3deg}.rotate-12{rotate:12deg}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.rotate-\[-3deg\]{rotate:-3deg}.rotate-\[15deg\]{rotate:15deg}.-skew-x-12{--tw-skew-x:skewX( -12deg );transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.\[transform\:rotate\(-90deg\)_rotateX\(-90deg\)\]{transform:rotate(-90deg)rotateX(-90deg)}.\[transform\:rotate\(90deg\)_rotateX\(-90deg\)\]{transform:rotate(90deg)rotateX(-90deg)}.\[transform\:rotateX\(-90deg\)\]{transform:rotateX(-90deg)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.transform-gpu{transform:translateZ(0)var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-\[shimmer_2s_infinite\]{animation:2s infinite shimmer}.animate-bounce{animation:var(--animate-bounce)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-manipulation{touch-action:manipulation}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.snap-center{scroll-snap-align:center}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing)*1)}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-cols-\[48px_280px_120px_120px_120px_120px_120px_140px_170px_170px_220px\]{grid-template-columns:48px 280px 120px 120px 120px 120px 120px 140px 170px 170px 220px}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-start{justify-items:start}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}.gap-12{gap:calc(var(--spacing)*12)}.gap-px{gap:1px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*10)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*10)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[1px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(1px*var(--tw-space-y-reverse));margin-block-end:calc(1px*calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing)*4)}.gap-x-6{column-gap:calc(var(--spacing)*6)}:where(.-space-x-2\.5>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*-2.5)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*-2.5)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing)*.5)}.gap-y-1{row-gap:calc(var(--spacing)*1)}.gap-y-8{row-gap:calc(var(--spacing)*8)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-\[\#dde3eb\]>:not(:last-child)){border-color:#dde3eb}:where(.divide-\[\#edf1f7\]>:not(:last-child)){border-color:#edf1f7}:where(.divide-border>:not(:last-child)){border-color:var(--border)}:where(.divide-slate-100\/60>:not(:last-child)){border-color:#f1f5f999}@supports (color:color-mix(in lab,red,red)){:where(.divide-slate-100\/60>:not(:last-child)){border-color:color-mix(in oklab,var(--color-slate-100)60%,transparent)}}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\[-20px\]{border-radius:-20px}.rounded-\[1\.2rem\]{border-radius:1.2rem}.rounded-\[1\.4rem\]{border-radius:1.4rem}.rounded-\[1rem\]{border-radius:1rem}.rounded-\[2\.5rem\]{border-radius:2.5rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[2rem\]{border-radius:2rem}.rounded-\[3rem\]{border-radius:3rem}.rounded-\[4px\]{border-radius:4px}.rounded-\[6px\]{border-radius:6px}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[14px\]{border-radius:14px}.rounded-\[16px\]{border-radius:16px}.rounded-\[18px\]{border-radius:18px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[32px\]{border-radius:32px}.rounded-\[40px\]{border-radius:40px}.rounded-\[50\%\]{border-radius:50%}.rounded-\[50\%_50\%_0_0\/100\%_100\%_0_0\]{border-radius:50% 50% 0 0/100% 100% 0 0}.rounded-\[100\%\]{border-radius:100%}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-\[1\.2rem\]{border-top-left-radius:1.2rem;border-top-right-radius:1.2rem}.rounded-t-\[2\.5rem\]{border-top-left-radius:2.5rem;border-top-right-radius:2.5rem}.rounded-t-xl{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.rounded-tl-none{border-top-left-radius:0}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-r-full{border-top-right-radius:3.40282e38px;border-bottom-right-radius:3.40282e38px}.rounded-b-2xl{border-bottom-right-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-b-\[2px\]{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.rounded-b-\[50\%\]{border-bottom-right-radius:50%;border-bottom-left-radius:50%}.rounded-b-\[60px\]{border-bottom-right-radius:60px;border-bottom-left-radius:60px}.rounded-b-md{border-bottom-right-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-br-sm{border-bottom-right-radius:calc(var(--radius) - 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[3px\]{border-style:var(--tw-border-style);border-width:3px}.border-\[4px\]{border-style:var(--tw-border-style);border-width:4px}.border-\[6px\]{border-style:var(--tw-border-style);border-width:6px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-t-\[6px\]{border-top-style:var(--tw-border-style);border-top-width:6px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-\[6px\]{border-right-style:var(--tw-border-style);border-right-width:6px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-l-\[6px\]{border-left-style:var(--tw-border-style);border-left-width:6px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-\(--color-border\){border-color:var(--color-border)}.border-\[\#1E293B\]{border-color:#1e293b}.border-\[\#1FA7E1\]\/20{border-color:#1fa7e133}.border-\[\#1FA7E1\]\/30{border-color:#1fa7e14d}.border-\[\#1FA7E1\]\/40{border-color:#1fa7e166}.border-\[\#2a3648\]{border-color:#2a3648}.border-\[\#8A3FD3\]\/20{border-color:#8a3fd333}.border-\[\#8A3FD3\]\/30{border-color:#8a3fd34d}.border-\[\#8B5CF6\]\/40{border-color:#8b5cf666}.border-\[\#75D06A\]{border-color:#75d06a}.border-\[\#75D06A\]\/35{border-color:#75d06a59}.border-\[\#9956DE\]{border-color:#9956de}.border-\[\#9956DE\]\/25{border-color:#9956de40}.border-\[\#9956DE\]\/30{border-color:#9956de4d}.border-\[\#9956DE\]\/45{border-color:#9956de73}.border-\[\#F1F5F9\]{border-color:#f1f5f9}.border-\[\#F08386\]{border-color:#f08386}.border-\[\#F08386\]\/30{border-color:#f083864d}.border-\[\#FF8B8B\]{border-color:#ff8b8b}.border-\[\#FF8B8B\]\/35{border-color:#ff8b8b59}.border-\[\#FFB356\]{border-color:#ffb356}.border-\[\#FFB356\]\/38{border-color:#ffb35661}.border-\[\#b7d3ff\]{border-color:#b7d3ff}.border-\[\#d1cec6\]{border-color:#d1cec6}.border-\[\#dadce0\]{border-color:#dadce0}.border-\[\#dde3eb\]{border-color:#dde3eb}.border-\[\#edf1f7\]{border-color:#edf1f7}.border-\[\#fde68a\]{border-color:#fde68a}.border-\[color-mix\(in_srgb\,var\(--primary\)_30\%\,transparent\)\]{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-\[color-mix\(in_srgb\,var\(--primary\)_30\%\,transparent\)\]{border-color:color-mix(in srgb,var(--primary)30%,transparent)}}.border-amber-50{border-color:var(--color-amber-50)}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-200\/60{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/60{border-color:color-mix(in oklab,var(--color-amber-200)60%,transparent)}}.border-amber-300{border-color:var(--color-amber-300)}.border-amber-400{border-color:var(--color-amber-400)}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border)50%,transparent)}}.border-current{border-color:currentColor}.border-destructive\/20{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.border-emerald-200{border-color:var(--color-emerald-200)}.border-emerald-200\/60{border-color:#a4f4cf99}@supports (color:color-mix(in lab,red,red)){.border-emerald-200\/60{border-color:color-mix(in oklab,var(--color-emerald-200)60%,transparent)}}.border-emerald-300{border-color:var(--color-emerald-300)}.border-emerald-400\/30{border-color:#00d2944d}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/30{border-color:color-mix(in oklab,var(--color-emerald-400)30%,transparent)}}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/20{border-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500)30%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500)50%,transparent)}}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-green-300{border-color:var(--color-green-300)}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500)40%,transparent)}}.border-indigo-100{border-color:var(--color-indigo-100)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-500\/20{border-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/20{border-color:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500)30%,transparent)}}.border-input{border-color:var(--input)}.border-muted-foreground\/15{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.border-muted-foreground\/15{border-color:color-mix(in oklab,var(--muted-foreground)15%,transparent)}}.border-orange-100{border-color:var(--color-orange-100)}.border-orange-200{border-color:var(--color-orange-200)}.border-orange-200\/60{border-color:#ffd7a899}@supports (color:color-mix(in lab,red,red)){.border-orange-200\/60{border-color:color-mix(in oklab,var(--color-orange-200)60%,transparent)}}.border-orange-400{border-color:var(--color-orange-400)}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500)40%,transparent)}}.border-pink-500{border-color:var(--color-pink-500)}.border-primary,.border-primary\/60{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-primary\/60{border-color:color-mix(in oklab,var(--primary)60%,transparent)}}.border-purple-200{border-color:var(--color-purple-200)}.border-purple-500\/20{border-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/20{border-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-red-100{border-color:var(--color-red-100)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-red-400{border-color:var(--color-red-400)}.border-red-500{border-color:var(--color-red-500)}.border-rose-100{border-color:var(--color-rose-100)}.border-rose-200{border-color:var(--color-rose-200)}.border-rose-200\/50{border-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/50{border-color:color-mix(in oklab,var(--color-rose-200)50%,transparent)}}.border-rose-200\/60{border-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/60{border-color:color-mix(in oklab,var(--color-rose-200)60%,transparent)}}.border-rose-300{border-color:var(--color-rose-300)}.border-rose-400{border-color:var(--color-rose-400)}.border-rose-500\/30{border-color:#ff23574d}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/30{border-color:color-mix(in oklab,var(--color-rose-500)30%,transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.border-sky-100{border-color:var(--color-violet-100)}.border-sky-200{border-color:var(--color-violet-200)}.border-sky-200\/50{border-color:#ddd6ff80}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/50{border-color:color-mix(in oklab,var(--color-violet-200)50%,transparent)}}.border-sky-200\/60{border-color:#ddd6ff99}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/60{border-color:color-mix(in oklab,var(--color-violet-200)60%,transparent)}}.border-sky-300{border-color:var(--color-violet-300)}.border-sky-400{border-color:var(--color-violet-400)}.border-sky-500{border-color:var(--color-violet-500)}.border-sky-500\/20{border-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/20{border-color:color-mix(in oklab,var(--color-violet-500)20%,transparent)}}.border-sky-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/30{border-color:color-mix(in oklab,var(--color-violet-500)30%,transparent)}}.border-sky-500\/40{border-color:#8d54ff66}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/40{border-color:color-mix(in oklab,var(--color-violet-500)40%,transparent)}}.border-sky-600{border-color:var(--color-violet-600)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\/60{border-color:#e2e8f099}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/60{border-color:color-mix(in oklab,var(--color-slate-200)60%,transparent)}}.border-slate-200\/70{border-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/70{border-color:color-mix(in oklab,var(--color-slate-200)70%,transparent)}}.border-slate-200\/80{border-color:#e2e8f0cc}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/80{border-color:color-mix(in oklab,var(--color-slate-200)80%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.border-slate-700{border-color:var(--color-slate-700)}.border-slate-800\/10{border-color:#1d293d1a}@supports (color:color-mix(in lab,red,red)){.border-slate-800\/10{border-color:color-mix(in oklab,var(--color-slate-800)10%,transparent)}}.border-teal-100{border-color:var(--color-teal-100)}.border-teal-200{border-color:var(--color-teal-200)}.border-teal-400{border-color:var(--color-teal-400)}.border-teal-500{border-color:var(--color-teal-500)}.border-transparent{border-color:#0000}.border-violet-200{border-color:var(--color-violet-200)}.border-white{border-color:var(--color-white)}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-white\/25{border-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.border-white\/25{border-color:color-mix(in oklab,var(--color-white)25%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.border-white\/35{border-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.border-white\/35{border-color:color-mix(in oklab,var(--color-white)35%,transparent)}}.border-white\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\/40{border-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.border-white\/50{border-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.border-white\/50{border-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.border-white\/80{border-color:#fffc}@supports (color:color-mix(in lab,red,red)){.border-white\/80{border-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.border-zinc-200{border-color:var(--color-zinc-200)}.border-t-slate-800{border-top-color:var(--color-slate-800)}.border-t-transparent{border-top-color:#0000}.border-t-violet-500{border-top-color:var(--color-violet-500)}.border-r-\[\#0a1628\]{border-right-color:#0a1628}.border-r-\[\#2a2535\]{border-right-color:#2a2535}.border-r-amber-300{border-right-color:var(--color-amber-300)}.border-r-transparent{border-right-color:#0000}.border-b-amber-300{border-bottom-color:var(--color-amber-300)}.border-l-transparent{border-left-color:#0000}.\!bg-\[\#6ED1CF\]\/35{background-color:#6ed1cf59!important}.\!bg-\[\#7274ED\]{background-color:#7274ed!important}.bg-\(--color-bg\){background-color:var(--color-bg)}.bg-\[\#0A1128\]{background-color:#0a1128}.bg-\[\#0B1021\]{background-color:#0b1021}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#00a86b\]{background-color:#00a86b}.bg-\[\#1FA7E1\]{background-color:#1fa7e1}.bg-\[\#1FA7E1\]\/10{background-color:#1fa7e11a}.bg-\[\#3b3a82\]{background-color:#3b3a82}.bg-\[\#5a6578\]{background-color:#5a6578}.bg-\[\#6ED1CF\]{background-color:#6ed1cf}.bg-\[\#6ED1CF\]\/20{background-color:#6ed1cf33}.bg-\[\#6ED1CF\]\/30{background-color:#6ed1cf4d}.bg-\[\#6F2BAF\]{background-color:#6f2baf}.bg-\[\#8A3FD3\]{background-color:#8a3fd3}.bg-\[\#8A3FD3\]\/5{background-color:#8a3fd30d}.bg-\[\#8A3FD3\]\/10{background-color:#8a3fd31a}.bg-\[\#8B5CF6\]{background-color:#8b5cf6}.bg-\[\#8b0d0d\]{background-color:#8b0d0d}.bg-\[\#34d399\]{background-color:#34d399}.bg-\[\#50B8B6\]{background-color:#50b8b6}.bg-\[\#58B34D\]{background-color:#58b34d}.bg-\[\#75D06A\]{background-color:#75d06a}.bg-\[\#75D06A\]\/10{background-color:#75d06a1a}.bg-\[\#75D06A\]\/14{background-color:#75d06a24}.bg-\[\#75D06A\]\/22{background-color:#75d06a38}.bg-\[\#127DA6\]{background-color:#127da6}.bg-\[\#198abf\]{background-color:#198abf}.bg-\[\#662AA8\]{background-color:#662aa8}.bg-\[\#7274ED\]{background-color:#7274ed}.bg-\[\#7274ED\]\/15{background-color:#7274ed26}.bg-\[\#8248c2\]{background-color:#8248c2}.bg-\[\#9956DE\]{background-color:#9956de}.bg-\[\#9956DE\]\/12{background-color:#9956de1f}.bg-\[\#9956DE\]\/20{background-color:#9956de33}.bg-\[\#9956DE\]\/32{background-color:#9956de52}.bg-\[\#12192b\]{background-color:#12192b}.bg-\[\#42389d\]{background-color:#42389d}.bg-\[\#111827\]{background-color:#111827}.bg-\[\#D96C6A\]{background-color:#d96c6a}.bg-\[\#DE7949\]{background-color:#de7949}.bg-\[\#E06A6A\]{background-color:#e06a6a}.bg-\[\#F08386\]{background-color:#f08386}.bg-\[\#F08386\]\/12{background-color:#f083861f}.bg-\[\#F08386\]\/20{background-color:#f0838633}.bg-\[\#FAFAFA\]{background-color:#fafafa}.bg-\[\#FB96BB\]{background-color:#fb96bb}.bg-\[\#FB96BB\]\/20{background-color:#fb96bb33}.bg-\[\#FF8B8B\]{background-color:#ff8b8b}.bg-\[\#FF8B8B\]\/10{background-color:#ff8b8b1a}.bg-\[\#FF8B8B\]\/14{background-color:#ff8b8b24}.bg-\[\#FF8B8B\]\/22{background-color:#ff8b8b38}.bg-\[\#FFB356\]{background-color:#ffb356}.bg-\[\#FFB356\]\/16{background-color:#ffb35629}.bg-\[\#FFB356\]\/20{background-color:#ffb35633}.bg-\[\#FFB356\]\/24{background-color:#ffb3563d}.bg-\[\#a8a5b3\]{background-color:#a8a5b3}.bg-\[\#b61515\]{background-color:#b61515}.bg-\[\#d8e9ff\]{background-color:#d8e9ff}.bg-\[\#d24b4b\]{background-color:#d24b4b}.bg-\[\#dde3eb\]{background-color:#dde3eb}.bg-\[\#de7b9f\]{background-color:#de7b9f}.bg-\[\#e1f5f7\]{background-color:#e1f5f7}.bg-\[\#e09841\]{background-color:#e09841}.bg-\[\#edf1f7\]{background-color:#edf1f7}.bg-\[\#edf1f7\]\/50{background-color:#edf1f780}.bg-\[\#edf1f7\]\/80{background-color:#edf1f7cc}.bg-\[\#f0eaff\]{background-color:#f0eaff}.bg-\[\#f0f3f8\]{background-color:#f0f3f8}.bg-\[\#f6f9ff\]{background-color:#f6f9ff}.bg-\[\#f7f9fc\]{background-color:#f7f9fc}.bg-\[\#f7fbff\]{background-color:#f7fbff}.bg-\[\#f8fafc\]{background-color:#f8fafc}.bg-\[\#f8fbff\]{background-color:#f8fbff}.bg-\[\#f2812d\]{background-color:#f2812d}.bg-\[\#fa9746\]{background-color:#fa9746}.bg-\[\#fb7185\]{background-color:#fb7185}.bg-\[\#fbbf24\]{background-color:#fbbf24}.bg-\[\#fcfdff\]{background-color:#fcfdff}.bg-\[\#fdeceb\]{background-color:#fdeceb}.bg-\[\#fe5c5c\]{background-color:#fe5c5c}.bg-\[\#fef5e7\]{background-color:#fef5e7}.bg-\[color-mix\(in_srgb\,var\(--chart-1\)_10\%\,transparent\)\]{background-color:var(--chart-1)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-1\)_10\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-1)10%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_10\%\,transparent\)\]{background-color:var(--chart-2)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_10\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-2)10%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_14\%\,transparent\)\]{background-color:var(--chart-2)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-2)14%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_10\%\,transparent\)\]{background-color:var(--chart-3)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_10\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-3)10%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_14\%\,transparent\)\]{background-color:var(--chart-3)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-3)14%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-4\)_14\%\,transparent\)\]{background-color:var(--chart-4)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-4\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-4)14%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--primary\)_10\%\,transparent\)\]{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--primary\)_10\%\,transparent\)\]{background-color:color-mix(in srgb,var(--primary)10%,transparent)}}.bg-\[var\(--chart-2\)\]{background-color:var(--chart-2)}.bg-\[var\(--chart-3\)\]{background-color:var(--chart-3)}.bg-\[var\(--chart-4\)\]{background-color:var(--chart-4)}.bg-\[var\(--primary\)\],.bg-\[var\(--primary\)\]\/60{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--primary\)\]\/60{background-color:color-mix(in oklab,var(--primary)60%,transparent)}}.bg-accent{background-color:var(--accent)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-400\/20{background-color:#fcbb0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-400\/20{background-color:color-mix(in oklab,var(--color-amber-400)20%,transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-600{background-color:var(--color-amber-600)}.bg-background{background-color:var(--background)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--border)}.bg-card,.bg-card\/20{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,var(--card)20%,transparent)}}.bg-card\/80{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/80{background-color:color-mix(in oklab,var(--card)80%,transparent)}}.bg-current{background-color:currentColor}.bg-cyan-100{background-color:var(--color-cyan-100)}.bg-cyan-400\/30{background-color:#00d2ef4d}@supports (color:color-mix(in lab,red,red)){.bg-cyan-400\/30{background-color:color-mix(in oklab,var(--color-cyan-400)30%,transparent)}}.bg-destructive,.bg-destructive\/5{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/5{background-color:color-mix(in oklab,var(--destructive)5%,transparent)}}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-200{background-color:var(--color-emerald-200)}.bg-emerald-300{background-color:var(--color-emerald-300)}.bg-emerald-400\/20{background-color:#00d29433}@supports (color:color-mix(in lab,red,red)){.bg-emerald-400\/20{background-color:color-mix(in oklab,var(--color-emerald-400)20%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-fuchsia-400\/30{background-color:#ec6cff4d}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-400\/30{background-color:color-mix(in oklab,var(--color-fuchsia-400)30%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-50\/30{background-color:#f0fdf44d}@supports (color:color-mix(in lab,red,red)){.bg-green-50\/30{background-color:color-mix(in oklab,var(--color-green-50)30%,transparent)}}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-400\/20{background-color:#7d87ff33}@supports (color:color-mix(in lab,red,red)){.bg-indigo-400\/20{background-color:color-mix(in oklab,var(--color-indigo-400)20%,transparent)}}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-input-background{background-color:var(--input-background)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground,.bg-muted-foreground\/30{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/30{background-color:color-mix(in oklab,var(--muted-foreground)30%,transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted)30%,transparent)}}.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,var(--muted)40%,transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.bg-muted\/60{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/60{background-color:color-mix(in oklab,var(--muted)60%,transparent)}}.bg-orange-50{background-color:var(--color-orange-50)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-orange-400{background-color:var(--color-orange-400)}.bg-orange-400\/20{background-color:#ff8b1a33}@supports (color:color-mix(in lab,red,red)){.bg-orange-400\/20{background-color:color-mix(in oklab,var(--color-orange-400)20%,transparent)}}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-orange-500\/30{background-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/30{background-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary,.bg-primary\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary)10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary)20%,transparent)}}.bg-purple-100{background-color:var(--color-purple-100)}.bg-purple-400\/20{background-color:#c07eff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-400\/20{background-color:color-mix(in oklab,var(--color-purple-400)20%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-50\/30{background-color:#fef2f24d}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/30{background-color:color-mix(in oklab,var(--color-red-50)30%,transparent)}}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400{background-color:var(--color-red-400)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-100{background-color:var(--color-rose-100)}.bg-rose-100\/30{background-color:#ffe4e64d}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/30{background-color:color-mix(in oklab,var(--color-rose-100)30%,transparent)}}.bg-rose-100\/40{background-color:#ffe4e666}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/40{background-color:color-mix(in oklab,var(--color-rose-100)40%,transparent)}}.bg-rose-100\/60{background-color:#ffe4e699}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/60{background-color:color-mix(in oklab,var(--color-rose-100)60%,transparent)}}.bg-rose-200{background-color:var(--color-rose-200)}.bg-rose-200\/60{background-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/60{background-color:color-mix(in oklab,var(--color-rose-200)60%,transparent)}}.bg-rose-200\/70{background-color:#ffccd3b3}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/70{background-color:color-mix(in oklab,var(--color-rose-200)70%,transparent)}}.bg-rose-300{background-color:var(--color-rose-300)}.bg-rose-400\/5{background-color:#ff667f0d}@supports (color:color-mix(in lab,red,red)){.bg-rose-400\/5{background-color:color-mix(in oklab,var(--color-rose-400)5%,transparent)}}.bg-rose-500{background-color:var(--color-rose-500)}.bg-rose-500\/5{background-color:#ff23570d}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/5{background-color:color-mix(in oklab,var(--color-rose-500)5%,transparent)}}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/10{background-color:color-mix(in oklab,var(--color-rose-500)10%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500)20%,transparent)}}.bg-rose-500\/30{background-color:#ff23574d}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/30{background-color:color-mix(in oklab,var(--color-rose-500)30%,transparent)}}.bg-rose-600{background-color:var(--color-rose-600)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-sky-50{background-color:var(--color-violet-50)}.bg-sky-50\/40{background-color:#f5f3ff66}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/40{background-color:color-mix(in oklab,var(--color-violet-50)40%,transparent)}}.bg-sky-50\/50{background-color:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/50{background-color:color-mix(in oklab,var(--color-violet-50)50%,transparent)}}.bg-sky-100{background-color:var(--color-violet-100)}.bg-sky-100\/40{background-color:#ede9fe66}@supports (color:color-mix(in lab,red,red)){.bg-sky-100\/40{background-color:color-mix(in oklab,var(--color-violet-100)40%,transparent)}}.bg-sky-200{background-color:var(--color-violet-200)}.bg-sky-300{background-color:var(--color-violet-300)}.bg-sky-300\/30{background-color:#c4b4ff4d}@supports (color:color-mix(in lab,red,red)){.bg-sky-300\/30{background-color:color-mix(in oklab,var(--color-violet-300)30%,transparent)}}.bg-sky-400{background-color:var(--color-violet-400)}.bg-sky-400\/20{background-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.bg-sky-400\/20{background-color:color-mix(in oklab,var(--color-violet-400)20%,transparent)}}.bg-sky-400\/30{background-color:#a685ff4d}@supports (color:color-mix(in lab,red,red)){.bg-sky-400\/30{background-color:color-mix(in oklab,var(--color-violet-400)30%,transparent)}}.bg-sky-500{background-color:var(--color-violet-500)}.bg-sky-500\/5{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/5{background-color:color-mix(in oklab,var(--color-violet-500)5%,transparent)}}.bg-sky-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-violet-500)10%,transparent)}}.bg-sky-500\/20{background-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/20{background-color:color-mix(in oklab,var(--color-violet-500)20%,transparent)}}.bg-sky-600{background-color:var(--color-violet-600)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\/80{background-color:#f8fafccc}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/80{background-color:color-mix(in oklab,var(--color-slate-50)80%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-100\/70{background-color:#f1f5f9b3}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/70{background-color:color-mix(in oklab,var(--color-slate-100)70%,transparent)}}.bg-slate-100\/80{background-color:#f1f5f9cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/80{background-color:color-mix(in oklab,var(--color-slate-100)80%,transparent)}}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-200\/50{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.bg-slate-200\/50{background-color:color-mix(in oklab,var(--color-slate-200)50%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-300\/80{background-color:#cad5e2cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-300\/80{background-color:color-mix(in oklab,var(--color-slate-300)80%,transparent)}}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-800\/5{background-color:#1d293d0d}@supports (color:color-mix(in lab,red,red)){.bg-slate-800\/5{background-color:color-mix(in oklab,var(--color-slate-800)5%,transparent)}}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\/40{background-color:#0f172b66}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/40{background-color:color-mix(in oklab,var(--color-slate-900)40%,transparent)}}.bg-slate-900\/85{background-color:#0f172bd9}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/85{background-color:color-mix(in oklab,var(--color-slate-900)85%,transparent)}}.bg-teal-50{background-color:var(--color-teal-50)}.bg-teal-100{background-color:var(--color-teal-100)}.bg-teal-300{background-color:var(--color-teal-300)}.bg-teal-400\/20{background-color:#00d3bd33}@supports (color:color-mix(in lab,red,red)){.bg-teal-400\/20{background-color:color-mix(in oklab,var(--color-teal-400)20%,transparent)}}.bg-teal-500{background-color:var(--color-teal-500)}.bg-teal-600{background-color:var(--color-teal-600)}.bg-transparent{background-color:#0000}.bg-violet-50{background-color:var(--color-violet-50)}.bg-violet-100{background-color:var(--color-violet-100)}.bg-violet-300{background-color:var(--color-violet-300)}.bg-violet-400\/5{background-color:#a685ff0d}@supports (color:color-mix(in lab,red,red)){.bg-violet-400\/5{background-color:color-mix(in oklab,var(--color-violet-400)5%,transparent)}}.bg-violet-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/10{background-color:color-mix(in oklab,var(--color-violet-500)10%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/14{background-color:#ffffff24}@supports (color:color-mix(in lab,red,red)){.bg-white\/14{background-color:color-mix(in oklab,var(--color-white)14%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\/25{background-color:color-mix(in oklab,var(--color-white)25%,transparent)}}.bg-white\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.bg-white\/30{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.bg-white\/35{background-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.bg-white\/35{background-color:color-mix(in oklab,var(--color-white)35%,transparent)}}.bg-white\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\/40{background-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.bg-white\/50{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.bg-white\/50{background-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.bg-white\/70{background-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.bg-white\/70{background-color:color-mix(in oklab,var(--color-white)70%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-white\/85{background-color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.bg-white\/85{background-color:color-mix(in oklab,var(--color-white)85%,transparent)}}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white)90%,transparent)}}.bg-white\/95{background-color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.bg-white\/95{background-color:color-mix(in oklab,var(--color-white)95%,transparent)}}.bg-zinc-100{background-color:var(--color-zinc-100)}.\!bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab!important;background-image:linear-gradient(var(--tw-gradient-stops))!important}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-l{--tw-gradient-position:to left in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tr{--tw-gradient-position:to top right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.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\%\)\]{background-image:radial-gradient(circle at 14% 12%,#fb96bb59,#0000 42%),radial-gradient(circle at 80% 80%,#75d06a40,#0000 38%)}.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\%\)\]{background-image:radial-gradient(circle at 18% 8%,#fb96bb52,#0000 42%),radial-gradient(circle at 85% 84%,#75d06a3d,#0000 40%)}.bg-\[radial-gradient\(circle_at_50\%_100\%\,\#9333ea_0\%\,\#c084fc_40\%\,transparent_80\%\)\]{background-image:radial-gradient(circle at 50% 100%,#9333ea,#c084fc,#0000 80%)}.bg-\[radial-gradient\(circle_at_top_left\,\#f8fbff_0\%\,\#eef4ff_40\%\,\#f8f4ff_100\%\)\]{background-image:radial-gradient(circle at 0 0,#f8fbff,#eef4ff 40%,#f8f4ff)}.bg-\[radial-gradient\(ellipse_at_50\%_100\%\,\#7e22ce_10\%\,transparent_60\%\)\]{background-image:radial-gradient(at 50% 100%,#7e22ce 10%,#0000 60%)}.bg-\[url\(\'data\:image\/svg\+xml\;base64\,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4\=\'\)\]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4=)}.bg-\[url\(\'data\:image\/svg\+xml\;base64\,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI\+PC9yZWN0Pgo8L3N2Zz4\=\'\)\]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=)}.\!from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.from-\[\#3b3a82\]{--tw-gradient-from:#3b3a82;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#7274ED\]{--tw-gradient-from:#7274ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#9956DE\]{--tw-gradient-from:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#9956DE\]\/12{--tw-gradient-from:oklab(59.4745% .111053 -.167638/.12);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#FFB356\]{--tw-gradient-from:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-amber-100{--tw-gradient-from:var(--color-amber-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-amber-400{--tw-gradient-from:var(--color-amber-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-amber-500\/20{--tw-gradient-from:#f99c0033}@supports (color:color-mix(in lab,red,red)){.from-amber-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.from-amber-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-amber-600{--tw-gradient-from:var(--color-amber-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-emerald-400{--tw-gradient-from:var(--color-emerald-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-emerald-500{--tw-gradient-from:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-emerald-500\/20{--tw-gradient-from:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.from-emerald-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-emerald-600{--tw-gradient-from:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500{--tw-gradient-from:var(--color-green-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-50{--tw-gradient-from:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-500\/20{--tw-gradient-from:#625fff33}@supports (color:color-mix(in lab,red,red)){.from-indigo-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.from-indigo-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-600{--tw-gradient-from:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-orange-50{--tw-gradient-from:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-orange-500{--tw-gradient-from:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-pink-50\/50{--tw-gradient-from:#fdf2f880}@supports (color:color-mix(in lab,red,red)){.from-pink-50\/50{--tw-gradient-from:color-mix(in oklab,var(--color-pink-50)50%,transparent)}}.from-pink-50\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-pink-500{--tw-gradient-from:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-100\/30{--tw-gradient-from:#f3e8ff4d}@supports (color:color-mix(in lab,red,red)){.from-purple-100\/30{--tw-gradient-from:color-mix(in oklab,var(--color-purple-100)30%,transparent)}}.from-purple-100\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-300\/50{--tw-gradient-from:#d9b3ff80}@supports (color:color-mix(in lab,red,red)){.from-purple-300\/50{--tw-gradient-from:color-mix(in oklab,var(--color-purple-300)50%,transparent)}}.from-purple-300\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-400\/20{--tw-gradient-from:#c07eff33}@supports (color:color-mix(in lab,red,red)){.from-purple-400\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-400)20%,transparent)}}.from-purple-400\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-600{--tw-gradient-from:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-rose-50{--tw-gradient-from:var(--color-rose-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-rose-400{--tw-gradient-from:var(--color-rose-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-rose-500{--tw-gradient-from:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-50{--tw-gradient-from:var(--color-violet-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-100{--tw-gradient-from:var(--color-violet-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-500\/20{--tw-gradient-from:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.from-sky-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-violet-500)20%,transparent)}}.from-sky-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-600{--tw-gradient-from:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-sky-700{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-slate-50\/30{--tw-gradient-from:#f8fafc4d}@supports (color:color-mix(in lab,red,red)){.from-slate-50\/30{--tw-gradient-from:color-mix(in oklab,var(--color-slate-50)30%,transparent)}}.from-slate-50\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-slate-200{--tw-gradient-from:var(--color-slate-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-slate-900\/40{--tw-gradient-from:#0f172b66}@supports (color:color-mix(in lab,red,red)){.from-slate-900\/40{--tw-gradient-from:color-mix(in oklab,var(--color-slate-900)40%,transparent)}}.from-slate-900\/40{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-teal-50{--tw-gradient-from:var(--color-teal-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-violet-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white{--tw-gradient-from:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/0{--tw-gradient-from:#0000}@supports (color:color-mix(in lab,red,red)){.from-white\/0{--tw-gradient-from:color-mix(in oklab,var(--color-white)0%,transparent)}}.from-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/20{--tw-gradient-from:#fff3}@supports (color:color-mix(in lab,red,red)){.from-white\/20{--tw-gradient-from:color-mix(in oklab,var(--color-white)20%,transparent)}}.from-white\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-\[\#75D06A\]{--tw-gradient-via:#75d06a;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#7274ED\]{--tw-gradient-via:#7274ed;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-amber-400\/40{--tw-gradient-via:#fcbb0066}@supports (color:color-mix(in lab,red,red)){.via-amber-400\/40{--tw-gradient-via:color-mix(in oklab,var(--color-amber-400)40%,transparent)}}.via-amber-400\/40{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-cyan-500{--tw-gradient-via:var(--color-cyan-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-cyan-500\/10{--tw-gradient-via:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.via-cyan-500\/10{--tw-gradient-via:color-mix(in oklab,var(--color-cyan-500)10%,transparent)}}.via-cyan-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-emerald-500{--tw-gradient-via:var(--color-emerald-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-emerald-500\/40{--tw-gradient-via:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.via-emerald-500\/40{--tw-gradient-via:color-mix(in oklab,var(--color-emerald-500)40%,transparent)}}.via-emerald-500\/40{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-fuchsia-500\/10{--tw-gradient-via:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.via-fuchsia-500\/10{--tw-gradient-via:color-mix(in oklab,var(--color-fuchsia-500)10%,transparent)}}.via-fuchsia-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-500{--tw-gradient-via:var(--color-orange-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-500\/10{--tw-gradient-via:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.via-orange-500\/10{--tw-gradient-via:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.via-orange-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-pink-500{--tw-gradient-via:var(--color-pink-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-pink-600{--tw-gradient-via:var(--color-pink-600);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-purple-500\/10{--tw-gradient-via:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.via-purple-500\/10{--tw-gradient-via:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.via-purple-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-rose-300\/10{--tw-gradient-via:#ffa2ae1a}@supports (color:color-mix(in lab,red,red)){.via-rose-300\/10{--tw-gradient-via:color-mix(in oklab,var(--color-rose-300)10%,transparent)}}.via-rose-300\/10{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-rose-500\/40{--tw-gradient-via:#ff235766}@supports (color:color-mix(in lab,red,red)){.via-rose-500\/40{--tw-gradient-via:color-mix(in oklab,var(--color-rose-500)40%,transparent)}}.via-rose-500\/40{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/30{--tw-gradient-via:#f5f3ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/30{--tw-gradient-via:color-mix(in oklab,var(--color-violet-50)30%,transparent)}}.via-sky-50\/30{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/50{--tw-gradient-via:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/50{--tw-gradient-via:color-mix(in oklab,var(--color-violet-50)50%,transparent)}}.via-sky-50\/50{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-300\/30{--tw-gradient-via:#c4b4ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-300\/30{--tw-gradient-via:color-mix(in oklab,var(--color-violet-300)30%,transparent)}}.via-sky-300\/30{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/15{--tw-gradient-via:#a685ff26}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/15{--tw-gradient-via:color-mix(in oklab,var(--color-violet-400)15%,transparent)}}.via-sky-400\/15{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/40{--tw-gradient-via:#a685ff66}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/40{--tw-gradient-via:color-mix(in oklab,var(--color-violet-400)40%,transparent)}}.via-sky-400\/40{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/50{--tw-gradient-via:#a685ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/50{--tw-gradient-via:color-mix(in oklab,var(--color-violet-400)50%,transparent)}}.via-sky-400\/50{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-500{--tw-gradient-via:var(--color-violet-500);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-600{--tw-gradient-via:var(--color-violet-600);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-teal-500\/10{--tw-gradient-via:#00baa71a}@supports (color:color-mix(in lab,red,red)){.via-teal-500\/10{--tw-gradient-via:color-mix(in oklab,var(--color-teal-500)10%,transparent)}}.via-teal-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/15{--tw-gradient-via:#ffffff26}@supports (color:color-mix(in lab,red,red)){.via-white\/15{--tw-gradient-via:color-mix(in oklab,var(--color-white)15%,transparent)}}.via-white\/15{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/30{--tw-gradient-via:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.via-white\/30{--tw-gradient-via:color-mix(in oklab,var(--color-white)30%,transparent)}}.via-white\/30{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/40{--tw-gradient-via:#fff6}@supports (color:color-mix(in lab,red,red)){.via-white\/40{--tw-gradient-via:color-mix(in oklab,var(--color-white)40%,transparent)}}.via-white\/40{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/50{--tw-gradient-via:#ffffff80}@supports (color:color-mix(in lab,red,red)){.via-white\/50{--tw-gradient-via:color-mix(in oklab,var(--color-white)50%,transparent)}}.via-white\/50{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.\!to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#6ED1CF\]\/18{--tw-gradient-to:oklab(80.0346% -.0906707 -.0221346/.18);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#9956DE\]{--tw-gradient-to:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#FF8B8B\]{--tw-gradient-to:#ff8b8b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#FFB356\]{--tw-gradient-to:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-amber-50{--tw-gradient-to:var(--color-amber-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-amber-600\/5{--tw-gradient-to:#dd74000d}@supports (color:color-mix(in lab,red,red)){.to-amber-600\/5{--tw-gradient-to:color-mix(in oklab,var(--color-amber-600)5%,transparent)}}.to-amber-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-blue-600{--tw-gradient-to:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-50{--tw-gradient-to:var(--color-cyan-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-100{--tw-gradient-to:var(--color-cyan-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500{--tw-gradient-to:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-emerald-50{--tw-gradient-to:var(--color-emerald-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-emerald-500{--tw-gradient-to:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-emerald-600{--tw-gradient-to:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-emerald-600\/5{--tw-gradient-to:#0097670d}@supports (color:color-mix(in lab,red,red)){.to-emerald-600\/5{--tw-gradient-to:color-mix(in oklab,var(--color-emerald-600)5%,transparent)}}.to-emerald-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-fuchsia-500{--tw-gradient-to:var(--color-fuchsia-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-100{--tw-gradient-to:var(--color-indigo-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-500\/20{--tw-gradient-to:#625fff33}@supports (color:color-mix(in lab,red,red)){.to-indigo-500\/20{--tw-gradient-to:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.to-indigo-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-600{--tw-gradient-to:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-600\/5{--tw-gradient-to:#4f39f60d}@supports (color:color-mix(in lab,red,red)){.to-indigo-600\/5{--tw-gradient-to:color-mix(in oklab,var(--color-indigo-600)5%,transparent)}}.to-indigo-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-700{--tw-gradient-to:var(--color-indigo-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-800{--tw-gradient-to:var(--color-indigo-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-50{--tw-gradient-to:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-100{--tw-gradient-to:var(--color-orange-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-500{--tw-gradient-to:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-600{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-pink-100\/30{--tw-gradient-to:#fce7f34d}@supports (color:color-mix(in lab,red,red)){.to-pink-100\/30{--tw-gradient-to:color-mix(in oklab,var(--color-pink-100)30%,transparent)}}.to-pink-100\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-pink-300\/40{--tw-gradient-to:#fda5d566}@supports (color:color-mix(in lab,red,red)){.to-pink-300\/40{--tw-gradient-to:color-mix(in oklab,var(--color-pink-300)40%,transparent)}}.to-pink-300\/40{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-pink-400\/20{--tw-gradient-to:#fb64b633}@supports (color:color-mix(in lab,red,red)){.to-pink-400\/20{--tw-gradient-to:color-mix(in oklab,var(--color-pink-400)20%,transparent)}}.to-pink-400\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500{--tw-gradient-to:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-600\/5{--tw-gradient-to:#9810fa0d}@supports (color:color-mix(in lab,red,red)){.to-purple-600\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-600)5%,transparent)}}.to-purple-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-red-500{--tw-gradient-to:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-rose-500{--tw-gradient-to:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-rose-600{--tw-gradient-to:var(--color-rose-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-100{--tw-gradient-to:var(--color-violet-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-600{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-600\/5{--tw-gradient-to:#7f22fe0d}@supports (color:color-mix(in lab,red,red)){.to-sky-600\/5{--tw-gradient-to:color-mix(in oklab,var(--color-violet-600)5%,transparent)}}.to-sky-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-slate-50{--tw-gradient-to:var(--color-slate-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-slate-100{--tw-gradient-to:var(--color-slate-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-100{--tw-gradient-to:var(--color-teal-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-300{--tw-gradient-to:var(--color-teal-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-500{--tw-gradient-to:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-600{--tw-gradient-to:var(--color-teal-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-teal-700{--tw-gradient-to:var(--color-teal-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white\/0{--tw-gradient-to:#0000}@supports (color:color-mix(in lab,red,red)){.to-white\/0{--tw-gradient-to:color-mix(in oklab,var(--color-white)0%,transparent)}}.to-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white\/10{--tw-gradient-to:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.to-white\/10{--tw-gradient-to:color-mix(in oklab,var(--color-white)10%,transparent)}}.to-white\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.\[background-size\:var\(--beam-size\)_var\(--beam-size\)\]{background-size:var(--beam-size)var(--beam-size)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-amber-300{fill:var(--color-amber-300)}.fill-amber-400{fill:var(--color-amber-400)}.fill-current{fill:currentColor}.fill-primary{fill:var(--primary)}.fill-yellow-300{fill:var(--color-yellow-300)}.stroke-\[2\.5\]{stroke-width:2.5px}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-bottom{object-position:bottom}.object-center{object-position:center}.p-0{padding:calc(var(--spacing)*0)}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-3\.5{padding:calc(var(--spacing)*3.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-7{padding:calc(var(--spacing)*7)}.p-8{padding:calc(var(--spacing)*8)}.p-10{padding:calc(var(--spacing)*10)}.p-12{padding:calc(var(--spacing)*12)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-0\.5{padding-inline:calc(var(--spacing)*.5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.px-10{padding-inline:calc(var(--spacing)*10)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-3\.5{padding-block:calc(var(--spacing)*3.5)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.py-16{padding-block:calc(var(--spacing)*16)}.py-20{padding-block:calc(var(--spacing)*20)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\.5{padding-top:calc(var(--spacing)*1.5)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-6{padding-top:calc(var(--spacing)*6)}.pt-8{padding-top:calc(var(--spacing)*8)}.pt-10{padding-top:calc(var(--spacing)*10)}.pr-0{padding-right:calc(var(--spacing)*0)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-2\.5{padding-right:calc(var(--spacing)*2.5)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-4{padding-right:calc(var(--spacing)*4)}.pr-6{padding-right:calc(var(--spacing)*6)}.pr-8{padding-right:calc(var(--spacing)*8)}.pr-11{padding-right:calc(var(--spacing)*11)}.pr-24{padding-right:calc(var(--spacing)*24)}.pr-40{padding-right:calc(var(--spacing)*40)}.pb-0{padding-bottom:calc(var(--spacing)*0)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-1\.5{padding-bottom:calc(var(--spacing)*1.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-6{padding-bottom:calc(var(--spacing)*6)}.pb-8{padding-bottom:calc(var(--spacing)*8)}.pb-32{padding-bottom:calc(var(--spacing)*32)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.pl-10{padding-left:calc(var(--spacing)*10)}.pl-11{padding-left:calc(var(--spacing)*11)}.pl-16{padding-left:calc(var(--spacing)*16)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[6px\]{font-size:6px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[32px\]{font-size:32px}.text-\[36px\]{font-size:36px}.text-\[40px\]{font-size:40px}.text-\[50px\]{font-size:50px}.text-\[60px\]{font-size:60px}.text-\[80px\]{font-size:80px}.leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.leading-\[1\.7\]{--tw-leading:1.7;line-height:1.7}.leading-\[1\.45\]{--tw-leading:1.45;line-height:1.45}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.1em\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.3px\]{--tw-tracking:.3px;letter-spacing:.3px}.tracking-\[0\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\[0\.25em\]{--tw-tracking:.25em;letter-spacing:.25em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking:var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-\[\#1FA7E1\]{color:#1fa7e1!important}.\!text-white{color:var(--color-white)!important}.text-\[\#0a1628\]{color:#0a1628}.text-\[\#1E293B\]{color:#1e293b}.text-\[\#1FA7E1\]{color:#1fa7e1}.text-\[\#2e2b5e\]{color:#2e2b5e}.text-\[\#3E8538\]{color:#3e8538}.text-\[\#3c4043\]{color:#3c4043}.text-\[\#4D9F46\]{color:#4d9f46}.text-\[\#5E3388\]{color:#5e3388}.text-\[\#5E3388\]\/80{color:#5e3388cc}.text-\[\#5a6578\]{color:#5a6578}.text-\[\#5f6368\]{color:#5f6368}.text-\[\#6ED1CF\]{color:#6ed1cf}.text-\[\#7A44B3\]{color:#7a44b3}.text-\[\#7b8798\]{color:#7b8798}.text-\[\#7eafbe\]{color:#7eafbe}.text-\[\#8A1A1A\]{color:#8a1a1a}.text-\[\#8A3FD3\]{color:#8a3fd3}.text-\[\#8a7fbc\]{color:#8a7fbc}.text-\[\#8f5ae2\]{color:#8f5ae2}.text-\[\#35a8bc\]\/10{color:#35a8bc1a}.text-\[\#75D06A\]{color:#75d06a}.text-\[\#141b2d\]{color:#141b2d}.text-\[\#319ab4\]{color:#319ab4}.text-\[\#6620a2\]{color:#6620a2}.text-\[\#7274ED\]{color:#7274ed}.text-\[\#9956DE\]{color:#9956de}.text-\[\#36326e\]{color:#36326e}.text-\[\#202124\]{color:#202124}.text-\[\#334155\]{color:#334155}.text-\[\#A56D29\]{color:#a56d29}.text-\[\#A74B50\]{color:#a74b50}.text-\[\#C65E63\]{color:#c65e63}.text-\[\#CC8A37\]{color:#cc8a37}.text-\[\#D66A6A\]{color:#d66a6a}.text-\[\#EAFBFF\]{color:#eafbff}.text-\[\#F1E4FF\]{color:#f1e4ff}.text-\[\#F08386\]{color:#f08386}.text-\[\#FF8B8B\]{color:#ff8b8b}.text-\[\#FFB356\]{color:#ffb356}.text-\[\#a0aec0\]{color:#a0aec0}.text-\[\#a06aec\]\/10{color:#a06aec1a}.text-\[\#a8a5b3\]{color:#a8a5b3}.text-\[\#baa4df\]{color:#baa4df}.text-\[\#c2cad8\]{color:#c2cad8}.text-\[\#d1abff\]{color:#d1abff}.text-\[\#d1cec6\]{color:#d1cec6}.text-\[\#d2a893\]{color:#d2a893}.text-\[\#d05c54\]{color:#d05c54}.text-\[\#db734b\]{color:#db734b}.text-\[\#dd9a9a\]{color:#dd9a9a}.text-\[\#dde3eb\]{color:#dde3eb}.text-\[\#df655a\]\/10{color:#df655a1a}.text-\[\#e87a42\]\/10{color:#e87a421a}.text-\[\#f8fafc\]{color:#f8fafc}.text-\[\#fcd34d\]{color:#fcd34d}.text-\[\#fde047\]{color:#fde047}.text-\[var\(--chart-1\)\]{color:var(--chart-1)}.text-\[var\(--chart-2\)\]{color:var(--chart-2)}.text-\[var\(--chart-3\)\]{color:var(--chart-3)}.text-\[var\(--chart-4\)\]{color:var(--chart-4)}.text-\[var\(--primary\)\]{color:var(--primary)}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-800\/80{color:#953d00cc}@supports (color:color-mix(in lab,red,red)){.text-amber-800\/80{color:color-mix(in oklab,var(--color-amber-800)80%,transparent)}}.text-amber-900{color:var(--color-amber-900)}.text-amber-900\/80{color:#7b3306cc}@supports (color:color-mix(in lab,red,red)){.text-amber-900\/80{color:color-mix(in oklab,var(--color-amber-900)80%,transparent)}}.text-black\/25{color:#00000040}@supports (color:color-mix(in lab,red,red)){.text-black\/25{color:color-mix(in oklab,var(--color-black)25%,transparent)}}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-cyan-100{color:var(--color-cyan-100)}.text-cyan-200{color:var(--color-cyan-200)}.text-destructive{color:var(--destructive)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-800{color:var(--color-emerald-800)}.text-emerald-800\/80{color:#005f46cc}@supports (color:color-mix(in lab,red,red)){.text-emerald-800\/80{color:color-mix(in oklab,var(--color-emerald-800)80%,transparent)}}.text-emerald-900{color:var(--color-emerald-900)}.text-foreground{color:var(--foreground)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-600{color:var(--color-gray-600)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-indigo-800\/80{color:#372aaccc}@supports (color:color-mix(in lab,red,red)){.text-indigo-800\/80{color:color-mix(in oklab,var(--color-indigo-800)80%,transparent)}}.text-muted-foreground,.text-muted-foreground\/40{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,var(--muted-foreground)40%,transparent)}}.text-muted-foreground\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,var(--muted-foreground)60%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/60{color:#ff8b1a99}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/60{color:color-mix(in oklab,var(--color-orange-400)60%,transparent)}}.text-orange-500{color:var(--color-orange-500)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-pink-600{color:var(--color-pink-600)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-purple-400{color:var(--color-purple-400)}.text-purple-600{color:var(--color-purple-600)}.text-purple-600\/80{color:#9810facc}@supports (color:color-mix(in lab,red,red)){.text-purple-600\/80{color:color-mix(in oklab,var(--color-purple-600)80%,transparent)}}.text-purple-700{color:var(--color-purple-700)}.text-purple-800{color:var(--color-purple-800)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-rose-200{color:var(--color-rose-200)}.text-rose-300{color:var(--color-rose-300)}.text-rose-400{color:var(--color-rose-400)}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-rose-700{color:var(--color-rose-700)}.text-rose-800{color:var(--color-rose-800)}.text-rose-900{color:var(--color-rose-900)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground)70%,transparent)}}.text-sky-100{color:var(--color-violet-100)}.text-sky-200{color:var(--color-violet-200)}.text-sky-300{color:var(--color-violet-300)}.text-sky-400{color:var(--color-violet-400)}.text-sky-500{color:var(--color-violet-500)}.text-sky-600{color:var(--color-violet-600)}.text-sky-600\/80{color:#7f22fecc}@supports (color:color-mix(in lab,red,red)){.text-sky-600\/80{color:color-mix(in oklab,var(--color-violet-600)80%,transparent)}}.text-sky-700{color:var(--color-violet-700)}.text-sky-700\/\[0\.08\]{color:#7008e714}@supports (color:color-mix(in lab,red,red)){.text-sky-700\/\[0\.08\]{color:color-mix(in oklab,var(--color-violet-700)8%,transparent)}}.text-sky-800{color:var(--color-violet-800)}.text-sky-900{color:var(--color-violet-900)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-400\/80{color:#90a1b9cc}@supports (color:color-mix(in lab,red,red)){.text-slate-400\/80{color:color-mix(in oklab,var(--color-slate-400)80%,transparent)}}.text-slate-500{color:var(--color-slate-500)}.text-slate-500\/60{color:#62748e99}@supports (color:color-mix(in lab,red,red)){.text-slate-500\/60{color:color-mix(in oklab,var(--color-slate-500)60%,transparent)}}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-teal-200{color:var(--color-teal-200)}.text-teal-400{color:var(--color-teal-400)}.text-teal-500{color:var(--color-teal-500)}.text-teal-600{color:var(--color-teal-600)}.text-teal-700{color:var(--color-teal-700)}.text-teal-800{color:var(--color-teal-800)}.text-teal-900{color:var(--color-teal-900)}.text-transparent{color:#0000}.text-violet-400{color:var(--color-violet-400)}.text-violet-600{color:var(--color-violet-600)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.text-white\/5{color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.text-white\/5{color:color-mix(in oklab,var(--color-white)5%,transparent)}}.text-white\/10{color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.text-white\/10{color:color-mix(in oklab,var(--color-white)10%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white)50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.text-white\/85{color:color-mix(in oklab,var(--color-white)85%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white)90%,transparent)}}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white)95%,transparent)}}.text-yellow-300{color:var(--color-yellow-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.decoration-slate-400{-webkit-text-decoration-color:var(--color-slate-400);text-decoration-color:var(--color-slate-400)}.underline-offset-4{text-underline-offset:4px}.placeholder-\[\#a8a5b3\]::placeholder{color:#a8a5b3}.opacity-0{opacity:0}.opacity-5{opacity:.05}.opacity-10{opacity:.1}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.opacity-100{opacity:1}.opacity-\[0\.2\]{opacity:.2}.opacity-\[0\.03\]{opacity:.03}.opacity-\[0\.15\]{opacity:.15}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-overlay{mix-blend-mode:overlay}.mix-blend-screen{mix-blend-mode:screen}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-15px_50px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 -15px 50px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(255\,255\,255\,0\.5\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#ffffff80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(99\,102\,241\,0\.2\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#6366f133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(245\,158\,11\,0\.2\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#f59e0b33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,139\,139\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ff8b8b99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,179\,86\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ffb35699);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_24px_rgba\(250\,204\,21\,0\.6\)\]{--tw-shadow:0 0 24px var(--tw-shadow-color,#facc1599);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(31\,167\,225\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#1fa7e133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(99\,102\,241\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#6366f133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(138\,63\,211\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#8a3fd333);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(245\,158\,11\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#f59e0b33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_15px_-3px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 2px 15px -3px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_8px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 4px 8px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_5px_12px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 5px 12px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(18\,25\,43\,0\.3\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#12192b4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgb\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(31\,167\,225\,0\.2\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#1fa7e133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(59\,58\,130\,0\.3\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#3b3a824d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(138\,63\,211\,0\.2\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#8a3fd333);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_30px_-10px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 10px 30px -10px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_30px_-10px_rgba\(37\,99\,235\,0\.6\)\]{--tw-shadow:0 10px 30px -10px var(--tw-shadow-color,#2563eb99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_40px_-10px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 10px 40px -10px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_25px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 12px 25px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_15px_25px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 15px 25px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_15px_35px_-5px_rgba\(236\,72\,153\,0\.4\)\]{--tw-shadow:0 15px 35px -5px var(--tw-shadow-color,#ec489966);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_18px_30px_-20px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 18px 30px -20px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_30px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 30px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_40px_-10px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 40px -10px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_40px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 40px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_45px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 45px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_-15px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 20px 60px -15px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 60px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_-15px_rgba\(168\,85\,247\,0\.15\)\]{--tw-shadow:0 20px 60px -15px var(--tw-shadow-color,#a855f726);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_60px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 30px 60px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_60px_rgba\(15\,23\,42\,0\.4\)\,inset_0_0_120px_rgba\(0\,0\,0\,0\.9\)\]{--tw-shadow:0 30px 60px var(--tw-shadow-color,#0f172a66),inset 0 0 120px var(--tw-shadow-color,#000000e6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_6px_rgba\(0\,0\,0\,0\.05\)\,0_4px_6px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 -4px 6px var(--tw-shadow-color,#0000000d),0 4px 6px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_6px_rgba\(249\,115\,22\,0\.05\)\,0_4px_6px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:inset 0 -4px 6px var(--tw-shadow-color,#f973160d),0 4px 6px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_8px_rgba\(251\,191\,36\,0\.1\)\,0_6px_8px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 -4px 8px var(--tw-shadow-color,#fbbf241a),0 6px 8px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 2px 4px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_2px_4px_rgba\(255\,255\,255\,0\.1\)\,_inset_0_-4px_4px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:inset 0 2px 4px var(--tw-shadow-color,#ffffff1a),inset 0 -4px 4px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_6px_15px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:inset 0 6px 15px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow\/elevation,.shadow\/rim{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:#1fa7e133}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(68.7044% -.0807821 -.10979/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:#1fa7e14d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(68.7044% -.0807821 -.10979/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#1FA7E1\]\/40{--tw-shadow-color:#1fa7e166}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/40{--tw-shadow-color:color-mix(in oklab,oklab(68.7044% -.0807821 -.10979/.4) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#8A3FD3\]\/30{--tw-shadow-color:#8a3fd34d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8A3FD3\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(54.1025% .117281 -.181162/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#8A3FD3\]\/40{--tw-shadow-color:#8a3fd366}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8A3FD3\]\/40{--tw-shadow-color:color-mix(in oklab,oklab(54.1025% .117281 -.181162/.4) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:#8b5cf633}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(60.5631% .0845415 -.201932/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#9956DE\]\/20{--tw-shadow-color:#9956de33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(59.4745% .111053 -.167638/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#9956DE\]\/30{--tw-shadow-color:#9956de4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(59.4745% .111053 -.167638/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:#fb96bb4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(78.801% .12777 -.00670064/.3) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#FFB356\]\/30{--tw-shadow-color:#ffb3564d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FFB356\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(82.2219% .0499055 .130321/.3) var(--tw-shadow-alpha),transparent)}}.shadow-purple-500\/20{--tw-shadow-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.shadow-purple-500\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-purple-500)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-purple-600\/25{--tw-shadow-color:#9810fa40}@supports (color:color-mix(in lab,red,red)){.shadow-purple-600\/25{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-purple-600)25%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-red-100{--tw-shadow-color:oklch(93.6% .032 17.717)}@supports (color:color-mix(in lab,red,red)){.shadow-red-100{--tw-shadow-color:color-mix(in oklab,var(--color-red-100)var(--tw-shadow-alpha),transparent)}}.shadow-red-900\/10{--tw-shadow-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.shadow-red-900\/10{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-red-900)10%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-rose-200{--tw-shadow-color:oklch(89.2% .058 10.001)}@supports (color:color-mix(in lab,red,red)){.shadow-rose-200{--tw-shadow-color:color-mix(in oklab,var(--color-rose-200)var(--tw-shadow-alpha),transparent)}}.shadow-sky-200{--tw-shadow-color:oklch(89.4% .057 293.283)}@supports (color:color-mix(in lab,red,red)){.shadow-sky-200{--tw-shadow-color:color-mix(in oklab,var(--color-violet-200)var(--tw-shadow-alpha),transparent)}}.shadow-sky-500\/20{--tw-shadow-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.shadow-sky-500\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-violet-500)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:#0f172b0a}@supports (color:color-mix(in lab,red,red)){.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-slate-900)4%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-teal-100{--tw-shadow-color:oklch(95.3% .051 180.801)}@supports (color:color-mix(in lab,red,red)){.shadow-teal-100{--tw-shadow-color:color-mix(in oklab,var(--color-teal-100)var(--tw-shadow-alpha),transparent)}}.shadow-teal-200{--tw-shadow-color:oklch(91% .096 180.426)}@supports (color:color-mix(in lab,red,red)){.shadow-teal-200{--tw-shadow-color:color-mix(in oklab,var(--color-teal-200)var(--tw-shadow-alpha),transparent)}}.shadow-teal-500\/30{--tw-shadow-color:#00baa74d}@supports (color:color-mix(in lab,red,red)){.shadow-teal-500\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-teal-500)30%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-\[\#1FA7E1\]\/35{--tw-ring-color:oklab(68.7044% -.0807821 -.10979/.35)}.ring-\[\#8B5CF6\]\/10{--tw-ring-color:oklab(60.5631% .0845415 -.201932/.1)}.ring-\[\#9956DE\]\/45{--tw-ring-color:oklab(59.4745% .111053 -.167638/.45)}.ring-\[\#9956DE\]\/50{--tw-ring-color:oklab(59.4745% .111053 -.167638/.5)}.ring-\[color-mix\(in_srgb\,var\(--chart-2\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-2)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-2\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-2)40%,transparent)}}.ring-\[color-mix\(in_srgb\,var\(--chart-3\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-3)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-3\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-3)40%,transparent)}}.ring-\[color-mix\(in_srgb\,var\(--chart-4\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-4)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-4\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-4)40%,transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-green-300{--tw-ring-color:var(--color-green-300)}.ring-indigo-100{--tw-ring-color:var(--color-indigo-100)}.ring-primary,.ring-primary\/40{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.ring-primary\/40{--tw-ring-color:color-mix(in oklab,var(--primary)40%,transparent)}}.ring-red-200{--tw-ring-color:var(--color-red-200)}.ring-red-300{--tw-ring-color:var(--color-red-300)}.ring-red-500{--tw-ring-color:var(--color-red-500)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.ring-rose-300{--tw-ring-color:var(--color-rose-300)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-sky-100{--tw-ring-color:var(--color-violet-100)}.ring-sky-300\/50{--tw-ring-color:#c4b4ff80}@supports (color:color-mix(in lab,red,red)){.ring-sky-300\/50{--tw-ring-color:color-mix(in oklab,var(--color-violet-300)50%,transparent)}}.ring-sky-500\/10{--tw-ring-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.ring-sky-500\/10{--tw-ring-color:color-mix(in oklab,var(--color-violet-500)10%,transparent)}}.ring-slate-900\/5{--tw-ring-color:#0f172b0d}@supports (color:color-mix(in lab,red,red)){.ring-slate-900\/5{--tw-ring-color:color-mix(in oklab,var(--color-slate-900)5%,transparent)}}.ring-teal-200{--tw-ring-color:var(--color-teal-200)}.ring-white{--tw-ring-color:var(--color-white)}.ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.ring-white\/10{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.ring-white\/20{--tw-ring-color:#fff3}@supports (color:color-mix(in lab,red,red)){.ring-white\/20{--tw-ring-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-2xl{--tw-blur:blur(var(--blur-2xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[1px\]{--tw-blur:blur(1px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[15px\]{--tw-blur:blur(15px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[60px\]{--tw-blur:blur(60px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[70px\]{--tw-blur:blur(70px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[100px\]{--tw-blur:blur(100px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[120px\]{--tw-blur:blur(120px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[140px\]{--tw-blur:blur(140px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[160px\]{--tw-blur:blur(160px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.contrast-50{--tw-contrast:contrast(50%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-2xl{--tw-drop-shadow-size:drop-shadow(0 25px 25px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-2xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[-2px_-2px_0px_white\]{--tw-drop-shadow-size:drop-shadow(-2px -2px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[-2px_2px_0px_white\]{--tw-drop-shadow-size:drop-shadow(-2px 2px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[-2px_3px_0px_rgba\(0\,0\,0\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(-2px 3px 0px var(--tw-drop-shadow-color,#000c));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[-3px_0px_0px_white\]{--tw-drop-shadow-size:drop-shadow(-3px 0px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(16\,185\,129\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#10b98180));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(31\,167\,225\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#1fa7e180));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(99\,102\,241\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#6366f180));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(138\,63\,211\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#8a3fd380));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(251\,191\,36\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#fbbf24e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(245\,158\,11\,0\.6\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#f59e0b99));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(250\,204\,21\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#facc15e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(255\,255\,255\,0\.4\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#fff6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_15px_rgba\(253\,224\,71\,0\.6\)\]{--tw-drop-shadow-size:drop-shadow(0 0 15px var(--tw-drop-shadow-color,#fde04799));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_0_25px_rgba\(252\,211\,77\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 25px var(--tw-drop-shadow-color,#fcd34de6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_12px_15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-drop-shadow-size:drop-shadow(0 12px 15px var(--tw-drop-shadow-color,#0000004d));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_15px_15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-drop-shadow-size:drop-shadow(0 15px 15px var(--tw-drop-shadow-color,#0000004d));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0px_-3px_0px_white\]{--tw-drop-shadow-size:drop-shadow(0px -3px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0px_3px_0px_white\]{--tw-drop-shadow-size:drop-shadow(0px 3px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[2px_-2px_0px_white\]{--tw-drop-shadow-size:drop-shadow(2px -2px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[2px_2px_0px_white\]{--tw-drop-shadow-size:drop-shadow(2px 2px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[3px_0px_0px_white\]{--tw-drop-shadow-size:drop-shadow(3px 0px 0px var(--tw-drop-shadow-color,white));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-lg));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-md{--tw-drop-shadow-size:drop-shadow(0 3px 3px var(--tw-drop-shadow-color,#0000001f));--tw-drop-shadow:drop-shadow(var(--drop-shadow-md));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-sm{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-sm));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-xl{--tw-drop-shadow-size:drop-shadow(0 9px 7px var(--tw-drop-shadow-color,#0000001a));--tw-drop-shadow:drop-shadow(var(--drop-shadow-xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.saturate-50{--tw-saturate:saturate(50%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-2xl{--tw-backdrop-blur:blur(var(--blur-2xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-\[2px\]{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.delay-75{transition-delay:75ms}.duration-0{--tw-duration:0s;transition-duration:0s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.prose-slate{--tw-prose-body:oklch(37.2% .044 257.287);--tw-prose-headings:oklch(20.8% .042 265.755);--tw-prose-lead:oklch(44.6% .043 257.281);--tw-prose-links:oklch(20.8% .042 265.755);--tw-prose-bold:oklch(20.8% .042 265.755);--tw-prose-counters:oklch(55.4% .046 257.417);--tw-prose-bullets:oklch(86.9% .022 252.894);--tw-prose-hr:oklch(92.9% .013 255.508);--tw-prose-quotes:oklch(20.8% .042 265.755);--tw-prose-quote-borders:oklch(92.9% .013 255.508);--tw-prose-captions:oklch(55.4% .046 257.417);--tw-prose-kbd:oklch(20.8% .042 265.755);--tw-prose-kbd-shadows:oklab(20.8% -.00310889 -.0418848/.1);--tw-prose-code:oklch(20.8% .042 265.755);--tw-prose-pre-code:oklch(92.9% .013 255.508);--tw-prose-pre-bg:oklch(27.9% .041 260.031);--tw-prose-th-borders:oklch(86.9% .022 252.894);--tw-prose-td-borders:oklch(92.9% .013 255.508);--tw-prose-invert-body:oklch(86.9% .022 252.894);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.4% .04 256.788);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.4% .04 256.788);--tw-prose-invert-bullets:oklch(44.6% .043 257.281);--tw-prose-invert-hr:oklch(37.2% .044 257.287);--tw-prose-invert-quotes:oklch(96.8% .007 247.896);--tw-prose-invert-quote-borders:oklch(37.2% .044 257.287);--tw-prose-invert-captions:oklch(70.4% .04 256.788);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(86.9% .022 252.894);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .043 257.281);--tw-prose-invert-td-borders:oklch(37.2% .044 257.287)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}.\[background\:linear-gradient\(var\(--grid-color\)_0_1px\,_transparent_1px_var\(--beam-size\)\)_50\%_-0\.5px_\/var\(--beam-size\)_var\(--beam-size\)\,linear-gradient\(90deg\,_var\(--grid-color\)_0_1px\,_transparent_1px_var\(--beam-size\)\)_50\%_50\%_\/var\(--beam-size\)_var\(--beam-size\)\]{background:linear-gradient(var(--grid-color)0 1px,transparent 1px var(--beam-size))50% -.5px/var(--beam-size)var(--beam-size),linear-gradient(90deg,var(--grid-color)0 1px,transparent 1px var(--beam-size))50% 50%/var(--beam-size)var(--beam-size)}.\[background\:var\(--background\)\]{background:var(--background)}.\[clip-path\:inset\(0\)\]{clip-path:inset(0)}.\[perspective\:var\(--perspective\)\]{perspective:var(--perspective)}.\[transform-style\:preserve-3d\]{transform-style:preserve-3d}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media(hover:hover){.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:left-\[150\%\]:is(:where(.group):hover *){left:150%}.group-hover\:block:is(:where(.group):hover *){display:block}.group-hover\:-translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:-translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:-translate-y-1:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:translate-y-0:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\:rotate-3:is(:where(.group):hover *){rotate:3deg}.group-hover\:rotate-12:is(:where(.group):hover *){rotate:12deg}.group-hover\:rotate-45:is(:where(.group):hover *){rotate:45deg}.group-hover\:border-\[\#dde3eb\]:is(:where(.group):hover *){border-color:#dde3eb}.group-hover\:border-amber-400:is(:where(.group):hover *){border-color:var(--color-amber-400)}.group-hover\:border-sky-300:is(:where(.group):hover *){border-color:var(--color-violet-300)}.group-hover\:border-r-amber-400:is(:where(.group):hover *){border-right-color:var(--color-amber-400)}.group-hover\:border-b-amber-400:is(:where(.group):hover *){border-bottom-color:var(--color-amber-400)}.group-hover\:bg-amber-50:is(:where(.group):hover *){background-color:var(--color-amber-50)}.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:#fef3c680}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-amber-100)50%,transparent)}}.group-hover\:bg-slate-50:is(:where(.group):hover *){background-color:var(--color-slate-50)}.group-hover\:bg-slate-600:is(:where(.group):hover *){background-color:var(--color-slate-600)}.group-hover\:text-\[\#9956DE\]:is(:where(.group):hover *){color:#9956de}.group-hover\:text-\[var\(--hover-color\)\]:is(:where(.group):hover *){color:var(--hover-color)}.group-hover\:text-amber-500:is(:where(.group):hover *){color:var(--color-amber-500)}.group-hover\:text-purple-500:is(:where(.group):hover *){color:var(--color-purple-500)}.group-hover\:text-sky-500:is(:where(.group):hover *){color:var(--color-violet-500)}.group-hover\:text-sky-600:is(:where(.group):hover *){color:var(--color-violet-600)}.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\:shadow-\[0_24px_40px_-15px_rgba\(0\,0\,0\,0\.5\)\]:is(:where(.group):hover *){--tw-shadow:0 24px 40px -15px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:shadow-xl:is(:where(.group):hover *){--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:duration-\[800ms\]:is(:where(.group):hover *){--tw-duration:.8s;transition-duration:.8s}.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing)*8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing)*-8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing)*8)!important;height:calc(var(--spacing)*8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)))}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing)*0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing)*-4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing)*0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:block:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\[viewport\=false\]\/navigation-menu\:top-full:is(:where(.group\/navigation-menu)[data-viewport=false] *){top:100%}.group-data-\[viewport\=false\]\/navigation-menu\:mt-1\.5:is(:where(.group\/navigation-menu)[data-viewport=false] *){margin-top:calc(var(--spacing)*1.5)}.group-data-\[viewport\=false\]\/navigation-menu\:overflow-hidden:is(:where(.group\/navigation-menu)[data-viewport=false] *){overflow:hidden}.group-data-\[viewport\=false\]\/navigation-menu\:rounded-md:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-radius:calc(var(--radius) - 2px)}.group-data-\[viewport\=false\]\/navigation-menu\:border:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[viewport\=false\]\/navigation-menu\:bg-popover:is(:where(.group\/navigation-menu)[data-viewport=false] *){background-color:var(--popover)}.group-data-\[viewport\=false\]\/navigation-menu\:text-popover-foreground:is(:where(.group\/navigation-menu)[data-viewport=false] *){color:var(--popover-foreground)}.group-data-\[viewport\=false\]\/navigation-menu\:shadow:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[viewport\=false\]\/navigation-menu\:duration-200:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-duration:.2s;transition-duration:.2s}.peer-checked\:bg-\[\#5a6578\]:is(:where(.peer):checked~*){background-color:#5a6578}.peer-checked\:bg-red-600:is(:where(.peer):checked~*){background-color:var(--color-red-600)}@media(hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-focus\:ring-4:is(:where(.peer):focus~*){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-focus\:ring-red-300:is(:where(.peer):focus~*){--tw-ring-color:var(--color-red-300)}.peer-focus\:outline-none:is(:where(.peer):focus~*){--tw-outline-style:none;outline-style:none}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing)*1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing)*2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing)*1)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:font-medium::placeholder{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.placeholder\:text-slate-400::placeholder{color:var(--color-slate-400)}.placeholder\:text-slate-500::placeholder{color:var(--color-slate-500)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing)*-2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:top-0\.5:after{content:var(--tw-content);top:calc(var(--spacing)*.5)}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:h-4:after{content:var(--tw-content);height:calc(var(--spacing)*4)}.after\:h-5:after{content:var(--tw-content);height:calc(var(--spacing)*5)}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:w-4:after{content:var(--tw-content);width:calc(var(--spacing)*4)}.after\:w-5:after{content:var(--tw-content);width:calc(var(--spacing)*5)}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.after\:rounded-full:after{content:var(--tw-content);border-radius:3.40282e38px}.after\:border:after{content:var(--tw-content);border-style:var(--tw-border-style);border-width:1px}.after\:border-\[\#dde3eb\]:after{content:var(--tw-content);border-color:#dde3eb}.after\:bg-white:after{content:var(--tw-content);background-color:var(--color-white)}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.peer-checked\:after\:translate-x-full:is(:where(.peer):checked~*):after{content:var(--tw-content);--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.peer-checked\:after\:border-white:is(:where(.peer):checked~*):after{content:var(--tw-content);border-color:var(--color-white)}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}@media(hover:hover){.hover\:-translate-x-1:hover{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:-translate-y-1:hover{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:-translate-y-2:hover{--tw-translate-y:calc(var(--spacing)*-2);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:scale-\[1\.01\]:hover{scale:1.01}.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:rotate-0:hover{rotate:none}.hover\:gap-2:hover{gap:calc(var(--spacing)*2)}.hover\:border-\[\#1FA7E1\]\/50:hover{border-color:#1fa7e180}.hover\:border-\[\#8A3FD3\]\/50:hover{border-color:#8a3fd380}.hover\:border-\[\#75D06A\]:hover{border-color:#75d06a}.hover\:border-\[\#75D06A\]\/60:hover{border-color:#75d06a99}.hover\:border-\[\#9956DE\]:hover{border-color:#9956de}.hover\:border-\[\#9956DE\]\/30:hover{border-color:#9956de4d}.hover\:border-\[\#9956DE\]\/60:hover{border-color:#9956de99}.hover\:border-\[\#F08386\]:hover{border-color:#f08386}.hover\:border-\[\#F08386\]\/60:hover{border-color:#f0838699}.hover\:border-\[\#d1cec6\]:hover{border-color:#d1cec6}.hover\:border-\[\#dde3eb\]:hover{border-color:#dde3eb}.hover\:border-amber-200\/60:hover{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-200\/60:hover{border-color:color-mix(in oklab,var(--color-amber-200)60%,transparent)}}.hover\:border-emerald-300:hover{border-color:var(--color-emerald-300)}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:border-indigo-600:hover{border-color:var(--color-indigo-600)}.hover\:border-orange-300:hover{border-color:var(--color-orange-300)}.hover\:border-rose-300:hover{border-color:var(--color-rose-300)}.hover\:border-sky-200:hover{border-color:var(--color-violet-200)}.hover\:border-sky-300:hover{border-color:var(--color-violet-300)}.hover\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\:border-teal-300:hover{border-color:var(--color-teal-300)}.hover\:bg-\[\#1C96CB\]:hover{background-color:#1c96cb}.hover\:bg-\[\#1FA7E1\]\/5:hover{background-color:#1fa7e10d}.hover\:bg-\[\#1a95c9\]:hover{background-color:#1a95c9}.hover\:bg-\[\#5AB84E\]:hover{background-color:#5ab84e}.hover\:bg-\[\#7A44B3\]:hover{background-color:#7a44b3}.hover\:bg-\[\#7b35c0\]:hover{background-color:#7b35c0}.hover\:bg-\[\#008f5d\]:hover{background-color:#008f5d}.hover\:bg-\[\#8A3FD3\]\/5:hover{background-color:#8a3fd30d}.hover\:bg-\[\#8A4DCA\]:hover{background-color:#8a4dca}.hover\:bg-\[\#75D06A\]\/14:hover{background-color:#75d06a24}.hover\:bg-\[\#9956DE\]\/12:hover{background-color:#9956de1f}.hover\:bg-\[\#F08386\]\/12:hover{background-color:#f083861f}.hover\:bg-\[\#FA7DA9\]:hover{background-color:#fa7da9}.hover\:bg-\[\#FF8B8B\]\/20:hover{background-color:#ff8b8b33}.hover\:bg-\[\#FF7373\]:hover{background-color:#ff7373}.hover\:bg-\[\#dde3eb\]:hover{background-color:#dde3eb}.hover\:bg-\[\#edf1f7\]:hover{background-color:#edf1f7}.hover\:bg-\[\#edf1f7\]\/50:hover{background-color:#edf1f780}.hover\:bg-\[\#f7f9fc\]:hover{background-color:#f7f9fc}.hover\:bg-accent:hover,.hover\:bg-accent\/40:hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/40:hover{background-color:color-mix(in oklab,var(--accent)40%,transparent)}}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-cyan-200:hover{background-color:var(--color-cyan-200)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-emerald-100:hover{background-color:var(--color-emerald-100)}.hover\:bg-green-50:hover{background-color:var(--color-green-50)}.hover\:bg-green-100:hover{background-color:var(--color-green-100)}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-muted:hover,.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.hover\:bg-orange-50:hover{background-color:var(--color-orange-50)}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-primary:hover,.hover\:bg-primary\/20:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary)20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-rose-50:hover{background-color:var(--color-rose-50)}.hover\:bg-rose-100:hover{background-color:var(--color-rose-100)}.hover\:bg-rose-500:hover{background-color:var(--color-rose-500)}.hover\:bg-rose-700:hover{background-color:var(--color-rose-700)}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:bg-sky-50:hover{background-color:var(--color-violet-50)}.hover\:bg-sky-50\/80:hover{background-color:#f5f3ffcc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-sky-50\/80:hover{background-color:color-mix(in oklab,var(--color-violet-50)80%,transparent)}}.hover\:bg-sky-100:hover{background-color:var(--color-violet-100)}.hover\:bg-sky-300:hover{background-color:var(--color-violet-300)}.hover\:bg-sky-600:hover{background-color:var(--color-violet-600)}.hover\:bg-sky-700:hover{background-color:var(--color-violet-700)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-slate-100:hover{background-color:var(--color-slate-100)}.hover\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\:bg-slate-200\/50:hover{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/50:hover{background-color:color-mix(in oklab,var(--color-slate-200)50%,transparent)}}.hover\:bg-slate-200\/70:hover{background-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/70:hover{background-color:color-mix(in oklab,var(--color-slate-200)70%,transparent)}}.hover\:bg-teal-600:hover{background-color:var(--color-teal-600)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-white\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\:bg-white\/50:hover{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/50:hover{background-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.hover\:bg-white\/80:hover{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/80:hover{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.hover\:\!from-\[\#8FE4DA\]:hover{--tw-gradient-from:#8fe4da!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.hover\:from-purple-500:hover{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:from-sky-700:hover{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:\!to-\[\#49BDEB\]:hover{--tw-gradient-to:#49bdeb!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))!important}.hover\:to-pink-400:hover{--tw-gradient-to:var(--color-pink-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:to-sky-600:hover{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:text-\[\#0a1628\]:hover{color:#0a1628}.hover\:text-\[\#5a6578\]:hover{color:#5a6578}.hover\:text-\[\#75D06A\]:hover{color:#75d06a}.hover\:text-\[\#9956DE\]:hover{color:#9956de}.hover\:text-\[\#F08386\]:hover{color:#f08386}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-emerald-600:hover{color:var(--color-emerald-600)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-green-600:hover{color:var(--color-green-600)}.hover\:text-indigo-600:hover{color:var(--color-indigo-600)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:text-orange-600:hover{color:var(--color-orange-600)}.hover\:text-primary:hover{color:var(--primary)}.hover\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\:text-purple-700:hover{color:var(--color-purple-700)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-rose-300:hover{color:var(--color-rose-300)}.hover\:text-rose-700:hover{color:var(--color-rose-700)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:text-sky-300:hover{color:var(--color-violet-300)}.hover\:text-sky-500:hover{color:var(--color-violet-500)}.hover\:text-sky-600:hover{color:var(--color-violet-600)}.hover\:text-sky-700:hover{color:var(--color-violet-700)}.hover\:text-slate-500:hover{color:var(--color-slate-500)}.hover\:text-slate-600:hover{color:var(--color-slate-600)}.hover\:text-slate-700:hover{color:var(--color-slate-700)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-2xl:hover{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_-20px_60px_rgba\(0\,0\,0\,0\.3\)\]:hover{--tw-shadow:0 -20px 60px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_45px_rgba\(31\,167\,225\,0\.4\)\]:hover{--tw-shadow:0 12px 45px var(--tw-shadow-color,#1fa7e166);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_45px_rgba\(138\,63\,211\,0\.4\)\]:hover{--tw-shadow:0 12px 45px var(--tw-shadow-color,#8a3fd366);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_15px_35px_-5px_rgba\(56\,189\,248\,0\.3\)\]:hover{--tw-shadow:0 15px 35px -5px var(--tw-shadow-color,#38bdf84d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_30px_rgba\(0\,0\,0\,0\.12\)\]:hover{--tw-shadow:0 16px 30px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_40px_rgba\(114\,116\,237\,0\.28\)\]:hover{--tw-shadow:0 16px 40px var(--tw-shadow-color,#7274ed47);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-pink-500\/35:hover{--tw-shadow-color:#f6339a59}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-pink-500\/35:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-pink-500)35%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-purple-500)30%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:#c4b4ff80}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-violet-300)50%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:shadow-teal-500\/25:hover{--tw-shadow-color:#00baa740}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-teal-500\/25:hover{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-teal-500)25%,transparent)var(--tw-shadow-alpha),transparent)}}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:z-10:focus{z-index:10}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:border-indigo-600:focus{border-color:var(--color-indigo-600)}.focus\:border-primary:focus{border-color:var(--primary)}.focus\:border-sky-400:focus{border-color:var(--color-violet-400)}.focus\:border-sky-500:focus{border-color:var(--color-violet-500)}.focus\:border-sky-600:focus{border-color:var(--color-violet-600)}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-primary:focus{background-color:var(--primary)}.focus\:bg-white:focus{background-color:var(--color-white)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:text-primary-foreground:focus{color:var(--primary-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-4:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-100:focus{--tw-ring-color:var(--color-indigo-100)}.focus\:ring-primary\/20:focus{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/20:focus{--tw-ring-color:color-mix(in oklab,var(--primary)20%,transparent)}}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-sky-100:focus{--tw-ring-color:var(--color-violet-100)}.focus\:ring-sky-200:focus{--tw-ring-color:var(--color-violet-200)}.focus\:ring-sky-400\/15:focus{--tw-ring-color:#a685ff26}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-400\/15:focus{--tw-ring-color:color-mix(in oklab,var(--color-violet-400)15%,transparent)}}.focus\:ring-sky-400\/20:focus{--tw-ring-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-400\/20:focus{--tw-ring-color:color-mix(in oklab,var(--color-violet-400)20%,transparent)}}.focus\:ring-sky-500:focus{--tw-ring-color:var(--color-violet-500)}.focus\:ring-sky-500\/20:focus{--tw-ring-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-500\/20:focus{--tw-ring-color:color-mix(in oklab,var(--color-violet-500)20%,transparent)}}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#8A3FD3\]\/50:focus-visible{--tw-ring-color:oklab(54.1025% .117281 -.181162/.5)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:ring-sky-400:focus-visible{--tw-ring-color:var(--color-violet-400)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.active\:scale-\[0\.98\]:active{scale:.98}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-100:disabled{opacity:1}.disabled\:shadow-none:disabled{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-disabled\:opacity-50:has(:disabled){opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing)*4)1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.aria-selected\:bg-accent[aria-selected=true]{background-color:var(--accent)}.aria-selected\:bg-primary[aria-selected=true]{background-color:var(--primary)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:var(--accent-foreground)}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.aria-selected\:text-primary-foreground[aria-selected=true]{color:var(--primary-foreground)}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[active\=true\]\:z-10[data-active=true]{z-index:10}.data-\[active\=true\]\:border-ring[data-active=true]{border-color:var(--ring)}.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-accent-foreground[data-active=true]{color:var(--accent-foreground)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[active\=true\]\:ring-\[3px\][data-active=true]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}@media(hover:hover){.data-\[active\=true\]\:hover\:bg-accent[data-active=true]:hover{background-color:var(--accent)}}.data-\[active\=true\]\:focus\:bg-accent[data-active=true]:focus{background-color:var(--accent)}.data-\[active\=true\]\:aria-invalid\:border-destructive[data-active=true][aria-invalid=true]{border-color:var(--destructive)}.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing)*8)}.data-\[orientation\=horizontal\]\:h-4[data-orientation=horizontal]{height:calc(var(--spacing)*4)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing)*44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing)*1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive)90%,transparent)}}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*12)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:ring-0 *)[data-slot=navigation-menu-link]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:outline-none *)[data-slot=navigation-menu-link]:focus{--tw-outline-style:none;outline-style:none}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\[state\=active\]\:bg-card[data-state=active]{background-color:var(--card)}.data-\[state\=active\]\:bg-gradient-to-r[data-state=active]{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.data-\[state\=active\]\:from-purple-500[data-state=active]{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.data-\[state\=active\]\:to-pink-500[data-state=active]{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.data-\[state\=active\]\:text-white[data-state=active]{color:var(--color-white)}.data-\[state\=active\]\:shadow-md[data-state=active]{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=inactive\]\:text-slate-500[data-state=inactive]{color:var(--color-slate-500)}@media(hover:hover){.data-\[state\=inactive\]\:hover\:bg-purple-50[data-state=inactive]:hover{background-color:var(--color-purple-50)}}.data-\[state\=on\]\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:var(--accent-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open],.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}@media(hover:hover){.data-\[state\=open\]\:hover\:bg-accent[data-state=open]:hover{background-color:var(--accent)}.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=open\]\:focus\:bg-accent[data-state=open]:focus{background-color:var(--accent)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-switch-background[data-state=unchecked]{background-color:var(--switch-background)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}.data-\[variant\=outline\]\:border-l-0[data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.data-\[variant\=outline\]\:shadow-xs[data-variant=outline]{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[variant\=outline\]\:first\:border-l[data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=bottom\]\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=bottom\]\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=bottom\]\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing)*24)}.data-\[vaul-drawer-direction\=bottom\]\:max-h-\[80vh\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\[vaul-drawer-direction\=bottom\]\:rounded-t-lg[data-vaul-drawer-direction=bottom]{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.data-\[vaul-drawer-direction\=bottom\]\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\[vaul-drawer-direction\=left\]\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=left\]\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=left\]\:w-3\/4[data-vaul-drawer-direction=left]{width:75%}.data-\[vaul-drawer-direction\=left\]\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\[vaul-drawer-direction\=right\]\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=right\]\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=right\]\:w-3\/4[data-vaul-drawer-direction=right]{width:75%}.data-\[vaul-drawer-direction\=right\]\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=top\]\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=top\]\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing)*0)}.data-\[vaul-drawer-direction\=top\]\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing)*24)}.data-\[vaul-drawer-direction\=top\]\:max-h-\[80vh\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\[vaul-drawer-direction\=top\]\:rounded-b-lg[data-vaul-drawer-direction=top]{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[vaul-drawer-direction\=top\]\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@media(min-width:40rem){.sm\:-top-\[30px\]{top:-30px}.sm\:top-4{top:calc(var(--spacing)*4)}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:mt-2{margin-top:calc(var(--spacing)*2)}.sm\:mb-0{margin-bottom:calc(var(--spacing)*0)}.sm\:mb-4{margin-bottom:calc(var(--spacing)*4)}.sm\:ml-0{margin-left:calc(var(--spacing)*0)}.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:inline{display:inline}.sm\:inline-flex{display:inline-flex}.sm\:h-8{height:calc(var(--spacing)*8)}.sm\:h-10{height:calc(var(--spacing)*10)}.sm\:h-14{height:calc(var(--spacing)*14)}.sm\:h-\[95px\]{height:95px}.sm\:h-\[115\%\]{height:115%}.sm\:h-\[125\%\]{height:125%}.sm\:h-\[140px\]{height:140px}.sm\:h-\[145px\]{height:145px}.sm\:h-\[165px\]{height:165px}.sm\:h-\[245px\]{height:245px}.sm\:h-\[360px\]{height:360px}.sm\:h-\[440px\]{height:440px}.sm\:w-8{width:calc(var(--spacing)*8)}.sm\:w-10{width:calc(var(--spacing)*10)}.sm\:w-14{width:calc(var(--spacing)*14)}.sm\:w-\[30\%\]{width:30%}.sm\:w-\[38\%\]{width:38%}.sm\:w-\[65px\]{width:65px}.sm\:w-\[300px\]{width:300px}.sm\:w-\[440px\]{width:440px}.sm\:w-auto{width:auto}.sm\:w-max{width:max-content}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[480px\]{max-width:480px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:max-w-xs{max-width:var(--container-xs)}.sm\:flex-none{flex:none}.sm\:-translate-x-\[60px\]{--tw-translate-x: -60px ;translate:var(--tw-translate-x)var(--tw-translate-y)}.sm\:translate-x-\[60px\]{--tw-translate-x:60px;translate:var(--tw-translate-x)var(--tw-translate-y)}.sm\:scale-\[0\.80\]{scale:.8}.sm\:scale-\[0\.85\]{scale:.85}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:calc(var(--spacing)*2.5)}.sm\:gap-8{gap:calc(var(--spacing)*8)}.sm\:p-6{padding:calc(var(--spacing)*6)}.sm\:p-7{padding:calc(var(--spacing)*7)}.sm\:p-8{padding:calc(var(--spacing)*8)}.sm\:px-4{padding-inline:calc(var(--spacing)*4)}.sm\:px-5{padding-inline:calc(var(--spacing)*5)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:px-8{padding-inline:calc(var(--spacing)*8)}.sm\:px-10{padding-inline:calc(var(--spacing)*10)}.sm\:py-4{padding-block:calc(var(--spacing)*4)}.sm\:py-8{padding-block:calc(var(--spacing)*8)}.sm\:pr-2\.5{padding-right:calc(var(--spacing)*2.5)}.sm\:pl-2\.5{padding-left:calc(var(--spacing)*2.5)}.sm\:text-left{text-align:left}.sm\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.sm\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.sm\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.sm\:text-\[10px\]{font-size:10px}.sm\:text-\[11px\]{font-size:11px}.sm\:text-\[12px\]{font-size:12px}.sm\:text-\[14px\]{font-size:14px}.data-\[vaul-drawer-direction\=left\]\:sm\:max-w-sm[data-vaul-drawer-direction=left],.data-\[vaul-drawer-direction\=right\]\:sm\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media(min-width:48rem){.md\:absolute{position:absolute}.md\:-top-7{top:calc(var(--spacing)*-7)}.md\:-top-8{top:calc(var(--spacing)*-8)}.md\:-bottom-7{bottom:calc(var(--spacing)*-7)}.md\:-bottom-8{bottom:calc(var(--spacing)*-8)}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-3{grid-column:span 3/span 3}.md\:col-span-9{grid-column:span 9/span 9}.md\:mt-2{margin-top:calc(var(--spacing)*2)}.md\:mt-12{margin-top:calc(var(--spacing)*12)}.md\:mt-\[-40px\]{margin-top:-40px}.md\:mr-2{margin-right:calc(var(--spacing)*2)}.md\:mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.md\:mb-4{margin-bottom:calc(var(--spacing)*4)}.md\:mb-5{margin-bottom:calc(var(--spacing)*5)}.md\:mb-8{margin-bottom:calc(var(--spacing)*8)}.md\:ml-2{margin-left:calc(var(--spacing)*2)}.md\:ml-4{margin-left:calc(var(--spacing)*4)}.md\:block{display:block}.md\:flex{display:flex}.md\:h-2{height:calc(var(--spacing)*2)}.md\:h-9{height:calc(var(--spacing)*9)}.md\:h-10{height:calc(var(--spacing)*10)}.md\:h-11{height:calc(var(--spacing)*11)}.md\:h-12{height:calc(var(--spacing)*12)}.md\:h-14{height:calc(var(--spacing)*14)}.md\:h-16{height:calc(var(--spacing)*16)}.md\:h-64{height:calc(var(--spacing)*64)}.md\:h-\[72px\]{height:72px}.md\:h-\[86px\]{height:86px}.md\:h-\[100px\]{height:100px}.md\:h-\[130px\]{height:130px}.md\:h-\[180px\]{height:180px}.md\:h-\[200vw\]{height:200vw}.md\:h-\[310px\]{height:310px}.md\:w-2{width:calc(var(--spacing)*2)}.md\:w-9{width:calc(var(--spacing)*9)}.md\:w-10{width:calc(var(--spacing)*10)}.md\:w-11{width:calc(var(--spacing)*11)}.md\:w-12{width:calc(var(--spacing)*12)}.md\:w-14{width:calc(var(--spacing)*14)}.md\:w-\[72px\]{width:72px}.md\:w-\[86px\]{width:86px}.md\:w-\[200vw\]{width:200vw}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-3{gap:calc(var(--spacing)*3)}.md\:gap-4{gap:calc(var(--spacing)*4)}.md\:gap-5{gap:calc(var(--spacing)*5)}.md\:gap-8{gap:calc(var(--spacing)*8)}:where(.md\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*5)*calc(1 - var(--tw-space-y-reverse)))}.md\:rounded-b-\[80px\]{border-bottom-right-radius:80px;border-bottom-left-radius:80px}.md\:p-3{padding:calc(var(--spacing)*3)}.md\:p-4{padding:calc(var(--spacing)*4)}.md\:p-5{padding:calc(var(--spacing)*5)}.md\:p-6{padding:calc(var(--spacing)*6)}.md\:p-10{padding:calc(var(--spacing)*10)}.md\:p-12{padding:calc(var(--spacing)*12)}.md\:px-4{padding-inline:calc(var(--spacing)*4)}.md\:px-8{padding-inline:calc(var(--spacing)*8)}.md\:px-10{padding-inline:calc(var(--spacing)*10)}.md\:py-2{padding-block:calc(var(--spacing)*2)}.md\:py-5{padding-block:calc(var(--spacing)*5)}.md\:py-6{padding-block:calc(var(--spacing)*6)}.md\:pt-8{padding-top:calc(var(--spacing)*8)}.md\:pr-4{padding-right:calc(var(--spacing)*4)}.md\:pr-10{padding-right:calc(var(--spacing)*10)}.md\:pr-\[240px\]{padding-right:240px}.md\:pl-12{padding-left:calc(var(--spacing)*12)}.md\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.md\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.md\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.md\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.md\:text-\[10px\]{font-size:10px}.md\:text-\[11px\]{font-size:11px}.md\:text-\[12px\]{font-size:12px}.md\:text-\[13px\]{font-size:13px}.md\:text-\[15px\]{font-size:15px}.md\:text-\[16px\]{font-size:16px}.md\:text-\[17px\]{font-size:17px}.md\:text-\[22px\]{font-size:22px}.md\:text-\[26px\]{font-size:26px}.md\:text-\[32px\]{font-size:32px}.md\:text-\[44px\]{font-size:44px}.md\:text-\[70px\]{font-size:70px}.md\:text-\[80px\]{font-size:80px}.md\:text-\[110px\]{font-size:110px}.md\:opacity-0{opacity:0}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing)*2)}.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing)*0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing)*2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media(min-width:64rem){.lg\:static{position:static}.lg\:top-\[5px\]{top:5px}.lg\:right-10{right:calc(var(--spacing)*10)}.lg\:right-\[-15px\]{right:-15px}.lg\:right-\[250px\]{right:250px}.lg\:bottom-20{bottom:calc(var(--spacing)*20)}.lg\:z-auto{z-index:auto}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:-mx-4{margin-inline:calc(var(--spacing)*-4)}.lg\:-mt-4{margin-top:calc(var(--spacing)*-4)}.lg\:mb-8{margin-bottom:calc(var(--spacing)*8)}.lg\:ml-10{margin-left:calc(var(--spacing)*10)}.lg\:flex{display:flex}.lg\:h-8{height:calc(var(--spacing)*8)}.lg\:h-12{height:calc(var(--spacing)*12)}.lg\:h-\[265px\]{height:265px}.lg\:h-\[800px\]{height:800px}.lg\:h-full{height:100%}.lg\:min-h-0{min-height:calc(var(--spacing)*0)}.lg\:min-h-\[160px\]{min-height:160px}.lg\:w-8{width:calc(var(--spacing)*8)}.lg\:w-12{width:calc(var(--spacing)*12)}.lg\:w-\[45\%\]{width:45%}.lg\:w-\[55\%\]{width:55%}.lg\:w-\[70px\]{width:70px}.lg\:w-\[260px\]{width:260px}.lg\:w-\[270px\]{width:270px}.lg\:origin-center{transform-origin:50%}.lg\:translate-y-\[19\%\]{--tw-translate-y:19%;translate:var(--tw-translate-x)var(--tw-translate-y)}.lg\:scale-\[0\.85\]{scale:.85}.lg\:scale-\[1\.3\]{scale:1.3}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-\[1fr_300px\]{grid-template-columns:1fr 300px}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}.lg\:justify-end{justify-content:flex-end}.lg\:gap-5{gap:calc(var(--spacing)*5)}.lg\:gap-6{gap:calc(var(--spacing)*6)}.lg\:gap-8{gap:calc(var(--spacing)*8)}.lg\:gap-10{gap:calc(var(--spacing)*10)}.lg\:gap-12{gap:calc(var(--spacing)*12)}:where(.lg\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.lg\:divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.lg\:divide-y-0>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(0px*var(--tw-divide-y-reverse));border-bottom-width:calc(0px*calc(1 - var(--tw-divide-y-reverse)))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-4{padding:calc(var(--spacing)*4)}.lg\:p-8{padding:calc(var(--spacing)*8)}.lg\:p-12{padding:calc(var(--spacing)*12)}.lg\:px-16{padding-inline:calc(var(--spacing)*16)}.lg\:pt-6{padding-top:calc(var(--spacing)*6)}.lg\:pr-\[280px\]{padding-right:280px}.lg\:pb-0{padding-bottom:calc(var(--spacing)*0)}.lg\:pl-6{padding-left:calc(var(--spacing)*6)}.lg\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.lg\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.lg\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.lg\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.lg\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.lg\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.lg\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.lg\:text-\[7px\]{font-size:7px}.lg\:text-\[16px\]{font-size:16px}.lg\:text-\[46px\]{font-size:46px}}@media(min-width:80rem){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:col-span-3{grid-column:span 3/span 3}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:mb-8{margin-bottom:calc(var(--spacing)*8)}.xl\:flex{display:flex}.xl\:w-\[75px\]{width:75px}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[1fr_320px\]{grid-template-columns:1fr 320px}.xl\:grid-cols-\[400px_1fr\]{grid-template-columns:400px 1fr}.xl\:gap-8{gap:calc(var(--spacing)*8)}.xl\:px-10{padding-inline:calc(var(--spacing)*10)}.xl\:text-\[3\.4rem\]{font-size:3.4rem}}.dark\:border-\[\#1FA7E1\]\/20:is(.dark *){border-color:#1fa7e133}.dark\:border-\[\#2b3140\]:is(.dark *){border-color:#2b3140}.dark\:border-\[\#2f3547\]:is(.dark *){border-color:#2f3547}.dark\:border-\[\#8A3FD3\]\/20:is(.dark *){border-color:#8a3fd333}.dark\:border-\[\#8A3FD3\]\/30:is(.dark *){border-color:#8a3fd34d}.dark\:border-\[\#8d7fff\]:is(.dark *){border-color:#8d7fff}.dark\:border-amber-300\/40:is(.dark *){border-color:#ffd23666}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-300\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-300)40%,transparent)}}.dark\:border-amber-400\/40:is(.dark *){border-color:#fcbb0066}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-400)40%,transparent)}}.dark\:border-amber-700\/50:is(.dark *){border-color:#b7500080}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-700)50%,transparent)}}.dark\:border-emerald-300\/40:is(.dark *){border-color:#5ee9b566}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-300\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-300)40%,transparent)}}.dark\:border-emerald-400\/40:is(.dark *){border-color:#00d29466}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-400)40%,transparent)}}.dark\:border-emerald-500\/40:is(.dark *){border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-500\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-500)40%,transparent)}}.dark\:border-emerald-700\/50:is(.dark *){border-color:#00795680}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-700)50%,transparent)}}.dark\:border-gray-600:is(.dark *){border-color:var(--color-gray-600)}.dark\:border-indigo-700\/50:is(.dark *){border-color:#432dd780}@supports (color:color-mix(in lab,red,red)){.dark\:border-indigo-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-indigo-700)50%,transparent)}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:border-purple-700\/50:is(.dark *){border-color:#8200da80}@supports (color:color-mix(in lab,red,red)){.dark\:border-purple-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-purple-700)50%,transparent)}}.dark\:border-rose-300\/40:is(.dark *){border-color:#ffa2ae66}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-300\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-300)40%,transparent)}}.dark\:border-rose-400\/40:is(.dark *){border-color:#ff667f66}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-400)40%,transparent)}}.dark\:border-rose-500\/20:is(.dark *){border-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-500\/20:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-500)20%,transparent)}}.dark\:border-rose-900:is(.dark *){border-color:var(--color-rose-900)}.dark\:border-sky-700\/50:is(.dark *){border-color:#7008e780}@supports (color:color-mix(in lab,red,red)){.dark\:border-sky-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-violet-700)50%,transparent)}}.dark\:border-slate-700:is(.dark *){border-color:var(--color-slate-700)}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/10:is(.dark *){border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:bg-\[\#1a1f2e\]\/90:is(.dark *){background-color:#1a1f2ee6}.dark\:bg-\[\#2a3143\]:is(.dark *){background-color:#2a3143}.dark\:bg-\[\#2b2b5f\]:is(.dark *){background-color:#2b2b5f}.dark\:bg-\[\#8A3FD3\]\/10:is(.dark *){background-color:#8a3fd31a}.dark\:bg-\[\#181d27\]:is(.dark *){background-color:#181d27}.dark\:bg-\[\#11151d\]:is(.dark *){background-color:#11151d}.dark\:bg-\[\#15803d\]:is(.dark *){background-color:#15803d}.dark\:bg-\[\#b0e6eb\]:is(.dark *){background-color:#b0e6eb}.dark\:bg-\[\#b45309\]:is(.dark *){background-color:#b45309}.dark\:bg-\[\#be123c\]:is(.dark *){background-color:#be123c}.dark\:bg-\[\#d6ccf5\]:is(.dark *){background-color:#d6ccf5}.dark\:bg-\[\#f6ebd2\]:is(.dark *){background-color:#f6ebd2}.dark\:bg-\[\#fbd3d3\]:is(.dark *){background-color:#fbd3d3}.dark\:bg-amber-900\/20:is(.dark *){background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-900)20%,transparent)}}.dark\:bg-amber-900\/50:is(.dark *){background-color:#7b330680}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-900)50%,transparent)}}.dark\:bg-black\/30:is(.dark *){background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.dark\:bg-black\/40:is(.dark *){background-color:#0006}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/40:is(.dark *){background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.dark\:bg-black\/50:is(.dark *){background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.dark\:bg-black\/80:is(.dark *){background-color:#000c}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/80:is(.dark *){background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.dark\:bg-emerald-500\/30:is(.dark *){background-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500)30%,transparent)}}.dark\:bg-emerald-900\/20:is(.dark *){background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-900)20%,transparent)}}.dark\:bg-emerald-900\/50:is(.dark *){background-color:#004e3b80}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-900)50%,transparent)}}.dark\:bg-gray-800:is(.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-900:is(.dark *){background-color:var(--color-gray-900)}.dark\:bg-indigo-900\/50:is(.dark *){background-color:#312c8580}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-indigo-900)50%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:bg-purple-900\/50:is(.dark *){background-color:#59168b80}@supports (color:color-mix(in lab,red,red)){.dark\:bg-purple-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-purple-900)50%,transparent)}}.dark\:bg-rose-500\/10:is(.dark *){background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-500\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-500)10%,transparent)}}.dark\:bg-rose-900\/20:is(.dark *){background-color:#8b083633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-900)20%,transparent)}}.dark\:bg-sky-500\/5:is(.dark *){background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-500\/5:is(.dark *){background-color:color-mix(in oklab,var(--color-violet-500)5%,transparent)}}.dark\:bg-sky-500\/15:is(.dark *){background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-500\/15:is(.dark *){background-color:color-mix(in oklab,var(--color-violet-500)15%,transparent)}}.dark\:bg-sky-900\/50:is(.dark *){background-color:#4d179a80}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-violet-900)50%,transparent)}}.dark\:from-\[\#2b2b5f\]:is(.dark *){--tw-gradient-from:#2b2b5f;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-amber-300:is(.dark *){--tw-gradient-from:var(--color-amber-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-amber-600\/20:is(.dark *){--tw-gradient-from:#dd740033}@supports (color:color-mix(in lab,red,red)){.dark\:from-amber-600\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab,var(--color-amber-600)20%,transparent)}}.dark\:from-amber-600\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-emerald-300:is(.dark *){--tw-gradient-from:var(--color-emerald-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-emerald-500\/20:is(.dark *){--tw-gradient-from:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.dark\:from-emerald-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.dark\:from-emerald-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-indigo-300:is(.dark *){--tw-gradient-from:var(--color-indigo-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-indigo-500\/20:is(.dark *){--tw-gradient-from:#625fff33}@supports (color:color-mix(in lab,red,red)){.dark\:from-indigo-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.dark\:from-indigo-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-purple-300:is(.dark *){--tw-gradient-from:var(--color-purple-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-sky-300:is(.dark *){--tw-gradient-from:var(--color-violet-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-from:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab,var(--color-violet-500)20%,transparent)}}.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab,var(--color-cyan-500)10%,transparent)}}.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab,var(--color-fuchsia-500)10%,transparent)}}.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:via-orange-500\/10:is(.dark *){--tw-gradient-via:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.dark\:via-orange-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.dark\:via-orange-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:via-purple-500\/10:is(.dark *){--tw-gradient-via:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.dark\:via-purple-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.dark\:via-purple-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:via-teal-500\/10:is(.dark *){--tw-gradient-via:#00baa71a}@supports (color:color-mix(in lab,red,red)){.dark\:via-teal-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab,var(--color-teal-500)10%,transparent)}}.dark\:via-teal-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:to-cyan-200:is(.dark *){--tw-gradient-to:var(--color-cyan-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-fuchsia-200:is(.dark *){--tw-gradient-to:var(--color-fuchsia-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-orange-200:is(.dark *){--tw-gradient-to:var(--color-orange-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-orange-900\/10:is(.dark *){--tw-gradient-to:#7e2a0c1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-orange-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab,var(--color-orange-900)10%,transparent)}}.dark\:to-orange-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-purple-200:is(.dark *){--tw-gradient-to:var(--color-purple-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-to:#59168b1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab,var(--color-purple-900)10%,transparent)}}.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-to:#4d179a1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab,var(--color-violet-900)10%,transparent)}}.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-teal-200:is(.dark *){--tw-gradient-to:var(--color-teal-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:to-teal-900\/10:is(.dark *){--tw-gradient-to:#0b4f4a1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-teal-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab,var(--color-teal-900)10%,transparent)}}.dark\:to-teal-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:text-\[\#4bc1f2\]:is(.dark *){color:#4bc1f2}.dark\:text-\[\#7ad8ff\]:is(.dark *){color:#7ad8ff}.dark\:text-\[\#7f88a3\]:is(.dark *){color:#7f88a3}.dark\:text-\[\#8b95ad\]:is(.dark *){color:#8b95ad}.dark\:text-\[\#9aa4be\]:is(.dark *){color:#9aa4be}.dark\:text-\[\#9da7bf\]:is(.dark *){color:#9da7bf}.dark\:text-\[\#9e8fff\]:is(.dark *){color:#9e8fff}.dark\:text-\[\#95a0bb\]:is(.dark *){color:#95a0bb}.dark\:text-\[\#98a2bc\]:is(.dark *){color:#98a2bc}.dark\:text-\[\#a8b2c9\]:is(.dark *){color:#a8b2c9}.dark\:text-\[\#a9b3ca\]:is(.dark *){color:#a9b3ca}.dark\:text-\[\#a35ceb\]:is(.dark *){color:#a35ceb}.dark\:text-\[\#aab3c7\]:is(.dark *){color:#aab3c7}.dark\:text-\[\#b2bad0\]:is(.dark *){color:#b2bad0}.dark\:text-\[\#c48bfc\]:is(.dark *){color:#c48bfc}.dark\:text-\[\#d3a8ff\]:is(.dark *){color:#d3a8ff}.dark\:text-\[\#e4e7f1\]:is(.dark *){color:#e4e7f1}.dark\:text-\[\#ecf0fb\]:is(.dark *){color:#ecf0fb}.dark\:text-\[\#f5f7fb\]:is(.dark *){color:#f5f7fb}.dark\:text-amber-100\/70:is(.dark *){color:#fef3c6b3}@supports (color:color-mix(in lab,red,red)){.dark\:text-amber-100\/70:is(.dark *){color:color-mix(in oklab,var(--color-amber-100)70%,transparent)}}.dark\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.dark\:text-amber-400:is(.dark *){color:var(--color-amber-400)}.dark\:text-emerald-100\/70:is(.dark *){color:#d0fae5b3}@supports (color:color-mix(in lab,red,red)){.dark\:text-emerald-100\/70:is(.dark *){color:color-mix(in oklab,var(--color-emerald-100)70%,transparent)}}.dark\:text-emerald-300:is(.dark *){color:var(--color-emerald-300)}.dark\:text-emerald-400:is(.dark *){color:var(--color-emerald-400)}.dark\:text-gray-400:is(.dark *){color:var(--color-gray-400)}.dark\:text-indigo-100\/70:is(.dark *){color:#e0e7ffb3}@supports (color:color-mix(in lab,red,red)){.dark\:text-indigo-100\/70:is(.dark *){color:color-mix(in oklab,var(--color-indigo-100)70%,transparent)}}.dark\:text-indigo-300:is(.dark *){color:var(--color-indigo-300)}.dark\:text-indigo-400:is(.dark *){color:var(--color-indigo-400)}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}.dark\:text-purple-300:is(.dark *){color:var(--color-purple-300)}.dark\:text-purple-400:is(.dark *){color:var(--color-purple-400)}.dark\:text-purple-400\/80:is(.dark *){color:#c07effcc}@supports (color:color-mix(in lab,red,red)){.dark\:text-purple-400\/80:is(.dark *){color:color-mix(in oklab,var(--color-purple-400)80%,transparent)}}.dark\:text-rose-300:is(.dark *){color:var(--color-rose-300)}.dark\:text-rose-400:is(.dark *){color:var(--color-rose-400)}.dark\:text-sky-300:is(.dark *){color:var(--color-violet-300)}.dark\:text-sky-400:is(.dark *){color:var(--color-violet-400)}.dark\:text-sky-400\/80:is(.dark *){color:#a685ffcc}@supports (color:color-mix(in lab,red,red)){.dark\:text-sky-400\/80:is(.dark *){color:color-mix(in oklab,var(--color-violet-400)80%,transparent)}}.dark\:text-slate-200:is(.dark *){color:var(--color-slate-200)}.dark\:text-slate-400:is(.dark *){color:var(--color-slate-400)}.dark\:text-violet-400:is(.dark *){color:var(--color-violet-400)}.dark\:opacity-10:is(.dark *){opacity:.1}.dark\:opacity-\[0\.25\]:is(.dark *){opacity:.25}.dark\:mix-blend-screen:is(.dark *){mix-blend-mode:screen}.dark\:shadow-\[0_12px_24px_rgba\(0\,0\,0\,0\.22\)\]:is(.dark *){--tw-shadow:0 12px 24px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:ring-offset-\[\#0B0F19\]:is(.dark *){--tw-ring-offset-color:#0b0f19}@media(hover:hover){.dark\:hover\:bg-\[\#1FA7E1\]\/10:is(.dark *):hover{background-color:#1fa7e11a}.dark\:hover\:bg-\[\#8A3FD3\]\/10:is(.dark *):hover{background-color:#8a3fd31a}.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-black\/50:is(.dark *):hover{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.dark\:hover\:bg-black\/60:is(.dark *):hover{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/60:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.dark\:hover\:bg-emerald-500\/20:is(.dark *):hover{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-emerald-500\/20:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}.dark\:hover\:bg-rose-900\/30:is(.dark *):hover{background-color:#8b08364d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-rose-900\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-rose-900)30%,transparent)}}.dark\:hover\:bg-slate-800:is(.dark *):hover{background-color:var(--color-slate-800)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-card-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--card-foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input)80%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:var(--muted-foreground)}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:color-mix(in oklab,var(--border)50%,transparent)}}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:var(--border)}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:var(--muted)}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{outline-offset:2px;outline:2px solid #0000}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\[\&_p\]\:m-0 p{margin:calc(var(--spacing)*0)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:var(--accent)}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:first-child:has([aria-selected]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:last-child:has([aria-selected]),.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\:last-child\]\:pb-6:last-child{padding-bottom:calc(var(--spacing)*6)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:h-2\.5>svg{height:calc(var(--spacing)*2.5)}.\[\&\>svg\]\:h-3>svg{height:calc(var(--spacing)*3)}.\[\&\>svg\]\:w-2\.5>svg{width:calc(var(--spacing)*2.5)}.\[\&\>svg\]\:w-3>svg{width:calc(var(--spacing)*3)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing)*-2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing)*-2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary)90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}:root{--font-size:16px;--font-display:"Nunito",ui-sans-serif,system-ui,sans-serif;--font-body:"Nunito",ui-sans-serif,system-ui,sans-serif;--background:#f7f9fc;--foreground:#0a1628;--card:#fff;--card-foreground:#0a1628;--popover:#fff;--popover-foreground:#0a1628;--amethyst:#9956de;--slate-blue:#7274ed;--summer-sky:#1fa7e1;--downy:#6ed1cf;--pastel-green:#75d06a;--texas-rose:#ffb356;--mona-lisa:#ff8b8b;--illusion:#fb96bb;--primary:#9956de;--primary-foreground:#fff;--secondary:#7274ed;--secondary-foreground:#fff;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#1fa7e1;--accent-foreground:#fff;--destructive:#ff8b8b;--destructive-foreground:#fff;--border:#e4e4e7;--input:transparent;--input-background:#f4f4f5;--switch-background:#d4d4d8;--font-weight-medium:500;--font-weight-normal:400;--ring:#9956de;--chart-1:#9956de;--chart-2:#ff8b8b;--chart-3:#75d06a;--chart-4:#ffb356;--chart-5:#1fa7e1;--radius:1.25rem;--sidebar:#fff;--sidebar-foreground:#09090b;--sidebar-primary:#7c3aed;--sidebar-primary-foreground:#fff;--sidebar-accent:#f3f0ff;--sidebar-accent-foreground:#5b21b6;--sidebar-border:#e4e4e7;--sidebar-ring:#7c3aed}.dark{--background:#050d18;--foreground:#f0f7ff;--card:#0a1628;--card-foreground:#f0f7ff;--popover:#0a1628;--popover-foreground:#f0f7ff;--primary:#a78bfa;--primary-foreground:#fff;--secondary:#2e1065;--secondary-foreground:#c4b5fd;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#f43f5e;--destructive:#ef4444;--destructive-foreground:#09090b;--border:#27272a;--input:#27272a;--input-background:#27272a;--switch-background:#3f3f46;--ring:#a78bfa;--font-weight-medium:500;--font-weight-normal:400;--chart-1:#a78bfa;--chart-2:#fb7185;--chart-3:#34d399;--chart-4:#fb923c;--chart-5:#38bdf8;--sidebar:#09090b;--sidebar-foreground:#fafafa;--sidebar-primary:#a78bfa;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#fafafa;--sidebar-border:#27272a;--sidebar-ring:#a78bfa}html{font-size:var(--font-size)}html,body,#root{height:100%}html[data-density=compact]{--radius:.9rem}html.reduced-motion *,html.reduced-motion :before,html.reduced-motion :after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}html.smart-dark{filter:invert()hue-rotate(180deg);background:#101217}html.smart-dark img,html.smart-dark picture,html.smart-dark video,html.smart-dark canvas,html.smart-dark svg,html.smart-dark iframe,html.smart-dark [data-preserve-color=true]{filter:invert()hue-rotate(180deg)}.font-display{font-family:var(--font-display)}.font-body{font-family:var(--font-body)}.glow-blue{box-shadow:0 0 24px #0284c71f,0 0 64px #0284c70a}.glow-violet{box-shadow:0 0 24px #7c3aed1f,0 0 64px #7c3aed0a}.glow-rose{box-shadow:0 0 24px #f43f5e1f,0 0 64px #f43f5e0a}.glow-emerald{box-shadow:0 0 24px #0596691f,0 0 64px #0596690a}.bg-dot-pattern{background-image:radial-gradient(circle,#7c3aed14 1px,#0000 1px);background-size:24px 24px}.dark .bg-dot-pattern{background-image:radial-gradient(circle,#a78bfa1f 1px,#0000 1px)}.bg-math-pattern{background-color:var(--background);background-image:url("data:image/svg+xml,%3Csvg width='150' height='150' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(124, 58, 237, 0.05)' font-family='sans-serif' font-weight='bold' font-size='28'%3E%3Ctext x='20' y='40'%3E%2B%3C/text%3E%3Ctext x='90' y='60'%3E%3D%3C/text%3E%3Ctext x='40' y='110'%3E%25%3C/text%3E%3Ctext x='110' y='130'%3E%C3%97%3C/text%3E%3Ctext x='130' y='30'%3E%C3%B7%3C/text%3E%3C/g%3E%3C/svg%3E");background-size:150px 150px}.bg-noise{position:relative}.bg-noise:before{content:"";opacity:.03;pointer-events:none;z-index:1;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");position:absolute;inset:0}.card-elevated{box-shadow:0 16px 40px -8px #7c3aed26,0 0 24px -5px #7c3aed14}.card-elevated-lg{box-shadow:0 24px 60px -12px #7c3aed33,0 0 32px -10px #7c3aed1a}.shadow-3d-button{box-shadow:0 12px 24px -6px var(--tw-shadow-color,#f9731666),0 6px 12px -4px var(--tw-shadow-color,#f973164d)}.dark .card-elevated{box-shadow:0 1px 2px #0003,0 4px 16px #00000026}.dark .card-elevated-lg{box-shadow:0 2px 4px #0003,0 8px 32px #0003}*{scrollbar-width:thin;scrollbar-color:transparent transparent}:hover{scrollbar-color:#0284c733 transparent}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:#0000;border-radius:10px;transition:background-color .3s}:hover::-webkit-scrollbar-thumb{background-color:#0284c733}::-webkit-scrollbar-thumb:hover{background-color:#0284c766}.scrollbar-hide{scrollbar-width:none;-ms-overflow-style:none}.scrollbar-hide::-webkit-scrollbar{display:none}.accent-line{position:relative}.accent-line:after{content:"";background:linear-gradient(90deg,#0284c7,#f43f5e);border-radius:2px;width:48px;height:3px;position:absolute;bottom:0;left:0}.surface-raised{background:linear-gradient(135deg,#fff,#f8fafc);border:1px solid #e2e8f0cc}.surface-inset{background:linear-gradient(135deg,#f1f5f9,#e8eef6);border:1px solid #cbd5e180}.card-accent-sky{border-left:3px solid #0284c7}.card-accent-rose{border-left:3px solid #f43f5e}.card-accent-emerald{border-left:3px solid #059669}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}.chat-markdown{font-family:var(--font-body);overflow-wrap:anywhere;word-break:break-word;font-size:.875rem;line-height:1.625}.chat-markdown h1{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:700}.chat-markdown h2{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.375rem;font-size:1.1rem;font-weight:700}.chat-markdown h3{font-family:var(--font-display);color:var(--muted-foreground);margin-top:.5rem;margin-bottom:.25rem;font-size:1rem;font-weight:600}.chat-markdown p{margin-top:.375rem;margin-bottom:.375rem}.chat-markdown ul,.chat-markdown ol{margin-top:.375rem;margin-bottom:.375rem;padding-left:1.25rem}.chat-markdown ul{list-style-type:disc}.chat-markdown ol{list-style-type:decimal}.chat-markdown li{margin-top:.125rem;margin-bottom:.125rem}.chat-markdown strong{color:var(--foreground);font-weight:700}.chat-markdown em{font-style:italic}.chat-markdown code{background:var(--secondary);color:var(--primary);border-radius:.25rem;padding:.125rem .375rem;font-size:.8125rem}.chat-markdown pre{background:var(--muted);border:1px solid var(--border);border-radius:.5rem;margin-top:.5rem;margin-bottom:.5rem;padding:.75rem;overflow-x:auto}.chat-markdown pre code{color:inherit;background:0 0;padding:0}.chat-markdown hr{border-color:#94a3b873;margin:.75rem 0}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5rem 0;font-size:.8125rem}.chat-markdown th{background:var(--muted);text-align:left;border:1px solid var(--border);padding:.375rem .5rem;font-weight:600}.chat-markdown td{border:1px solid var(--border);padding:.375rem .5rem}.chat-markdown blockquote{border-left:3px solid var(--primary);color:var(--muted-foreground);margin:.5rem 0;padding-left:.75rem;font-style:italic}.chat-markdown a{color:var(--primary);text-decoration:underline}.chat-markdown>:first-child{margin-top:0}.chat-markdown>:last-child{margin-bottom:0}.chat-markdown .katex-display{padding-bottom:.15rem;overflow:auto hidden}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}} diff --git a/assets/index-D4nJsLyx.js b/assets/index-D4nJsLyx.js deleted file mode 100644 index edf07f860cf31b8e21f89571b3097304566f796f..0000000000000000000000000000000000000000 --- a/assets/index-D4nJsLyx.js +++ /dev/null @@ -1,558 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/automationService-DNyauqGd.js","assets/vendor-firebase-firestore-BML5nJHm.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/apiService-axx1LHMk.js","assets/chatService-LsXGqjoV.js","assets/LoginPage-mXOi2OPh.js","assets/button-BpeUVhBo.js","assets/vendor-radix-BRdei-zg.js","assets/clsx-B-dksMZM.js","assets/utils-BQQgILNW.js","assets/input-DBkKXOmF.js","assets/sparkles-CXUFmaBJ.js","assets/brain-CPvGdgWE.js","assets/trending-up-D-vj8Gbq.js","assets/award-oJTbc9W5.js","assets/users-HMf2sdE3.js","assets/graduation-cap-Df8fGPxp.js","assets/book-open-BH50GByv.js","assets/mail-D7el5vSX.js","assets/lock-_59co5m5.js","assets/eye-off-BYAdNgqy.js","assets/eye-DXdRafOv.js","assets/shield-check-B_yHzqcC.js","assets/TeacherDashboard-D8avlB5m.js","assets/ConfirmModal-DGrnpObD.js","assets/x-BONnp2RF.js","assets/trash-2-BoXE_mye.js","assets/log-out-BqGKt-tT.js","assets/LogoutActionButton-FS5OGZjL.js","assets/quizService-CI5e0QMr.js","assets/loader-circle-J8Mwbkkw.js","assets/send-NQY-QTkN.js","assets/circle-alert-CBefjicJ.js","assets/minus-oFhmD2--.js","assets/plus-BxxucBR0.js","assets/check-BACdUlFL.js","assets/video-CS-NQBfT.js","assets/chart-column-D5mAWcRx.js","assets/skeleton-BUmMbOVs.js","assets/download-PWUf0XJa.js","assets/save-Og8yP5Yb.js","assets/search-Do6u3pFt.js","assets/chevron-up-Bfmq3Clw.js","assets/subjects-DDBtpdiA.js","assets/circle-check-big-0Gzyt_f3.js","assets/user-CaTzqgOL.js","assets/chevron-right-COMox1Xb.js","assets/ChatMarkdown-B34PtYCE.js","assets/vendor-markdown-C5ikSDMA.js","assets/vendor-markdown-CBmFCdgC.css","assets/target-D7SVtf3g.js","assets/bell-CbSbac2W.js","assets/calendar-BJ8oE6yW.js","assets/clock-DUJO-a50.js","assets/generateCategoricalChart-CiUYzAvW.js","assets/pen-line-Vok2l3fc.js","assets/AdminDashboard-BmyikugA.js","assets/Sidebar-xBQ3Qnyw.js","assets/shield-L33jkK5w.js","assets/message-square-DSAS4TVL.js","assets/swords-8_KH18p7.js","assets/trophy-C2nVcZnb.js","assets/shirt-BMZy0pq4.js","assets/select-Co4o1EaI.js","assets/circle-help-BmjHdT5a.js","assets/globe-BMa4SWkV.js","assets/trending-down-CqEkjFA9.js","assets/HeroBanner-BdiQHNd9.js","assets/RightSidebar-Dfek3lmU.js","assets/tooltip-BV3U-RJu.js","assets/star-dumQ9BVG.js","assets/XPNotification-4si_K5GL.js","assets/NotificationCenter-DGhehaGL.js","assets/SearchBar-ldiC0sUv.js","assets/SupplementalBanner-dklPrubU.js","assets/LearningPath-B_MkUEk2.js","assets/ModuleFolderCard-CoKTURyN.js","assets/CompetencyRadarChart-BfcP7xrw.js","assets/ModulesPage-y4YivjOd.js","assets/confetti.module-C94ZD2ww.js","assets/ScientificCalculator-wlhyNBDf.js","assets/MathAnswerInput-DNG5LFL4.js","assets/AIChatPage-CzCeFujm.js","assets/GradesPage-m1qiGDtC.js","assets/LeaderboardPage-jsrBZaI7.js","assets/QuizBattlePage-BbGkD7O9.js","assets/switch-eyvBOdtY.js","assets/AvatarShop-BirEYu2M.js","assets/CompositeAvatar-DMpjm5UY.js","assets/avatarData-BW_TX0b4.js","assets/FloatingAITutor-DkH3KrR1.js","assets/RewardsModal-HRePzoUo.js","assets/ProfileModal-D3hk8uuj.js","assets/SettingsModal-C-nK3nbS.js","assets/DiagnosticAssessmentModal-C541tkg_.js","assets/testResetService-DejIVH8F.js","assets/index-C6dybEZ6.css"])))=>i.map(i=>d[i]); -import{r as f,j as m,c as E,b as bl,e as xl}from"./vendor-react-Dexh7fmo.js";import{g as wl,G as Sl,c as Tl,u as Pl,s as Al,a as El,d as Cl,b as Dl,o as Rl}from"./vendor-firebase-auth-COrkgW0P.js";import{R as kl,T as Ml,U as Ll,V as Il}from"./vendor-firebase-core-DQ-pMjxd.js";import{g as Vl,d as J,s as Oe,a as oe,b as xe,c as _l,q as _t,e as Ge,w as Ze,o as As,l as Es,f as un,u as ct,h as jl,i as yo,j as Nl,k as jn}from"./vendor-firebase-firestore-BML5nJHm.js";import{g as Ol}from"./vendor-firebase-storage-BOeKE_0n.js";import{g as Fl}from"./vendor-firebase-analytics-CCo6E2f7.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const Bl="modulepreload",$l=function(e){return"/"+e},Fi={},W=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=r(n.map(u=>{if(u=$l(u),u in Fi)return;Fi[u]=!0;const d=u.endsWith(".css"),l=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${l}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":Bl,d||(h.as="script"),h.crossOrigin="",h.href=u,c&&h.setAttribute("nonce",c),document.head.appendChild(h),d)return new Promise((p,g)=>{h.addEventListener("load",p),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return i.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},ni=f.createContext({});function si(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const vo=typeof window<"u",bo=vo?f.useLayoutEffect:f.useEffect,Hn=f.createContext(null);function ii(e,t){e.indexOf(t)===-1&&e.push(t)}function Nn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ye=(e,t,n)=>n>t?t:n{};const Je={},xo=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function wo(e){return typeof e=="object"&&e!==null}const So=e=>/^0[^.\s]+$/u.test(e);function oi(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ne=e=>e,zl=(e,t)=>n=>t(e(n)),dn=(...e)=>e.reduce(zl),sn=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class ai{constructor(){this.subscriptions=[]}add(t){return ii(this.subscriptions,t),()=>Nn(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let o=0;oe*1e3,je=e=>e/1e3;function To(e,t){return t?e*(1e3/t):0}const Po=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ul=1e-7,Wl=12;function Hl(e,t,n,s,i){let o,r,a=0;do r=t+(n-t)/2,o=Po(r,s,i)-e,o>0?n=r:t=r;while(Math.abs(o)>Ul&&++aHl(o,0,1,e,n);return o=>o===0||o===1?o:Po(i(o),t,s)}const Ao=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Eo=e=>t=>1-e(1-t),Co=hn(.33,1.53,.69,.99),li=Eo(Co),Do=Ao(li),Ro=e=>(e*=2)<1?.5*li(e):.5*(2-Math.pow(2,-10*(e-1))),ci=e=>1-Math.sin(Math.acos(e)),ko=Eo(ci),Mo=Ao(ci),ql=hn(.42,0,1,1),Kl=hn(0,0,.58,1),Lo=hn(.42,0,.58,1),Xl=e=>Array.isArray(e)&&typeof e[0]!="number",Io=e=>Array.isArray(e)&&typeof e[0]=="number",Gl={linear:Ne,easeIn:ql,easeInOut:Lo,easeOut:Kl,circIn:ci,circInOut:Mo,circOut:ko,backIn:li,backInOut:Do,backOut:Co,anticipate:Ro},Yl=e=>typeof e=="string",Bi=e=>{if(Io(e)){ri(e.length===4);const[t,n,s,i]=e;return hn(t,n,s,i)}else if(Yl(e))return Gl[e];return e},bn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ql(e,t){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){r.has(d)&&(u.schedule(d),e()),d(a)}const u={schedule:(d,l=!1,h=!1)=>{const g=h&&i?n:s;return l&&r.add(d),g.has(d)||g.add(d),d},cancel:d=>{s.delete(d),r.delete(d)},process:d=>{if(a=d,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,o&&(o=!1,u.process(d))}};return u}const Zl=40;function Vo(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=bn.reduce((y,b)=>(y[b]=Ql(o),y),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:l,preRender:h,render:p,postRender:g}=r,w=()=>{const y=Je.useManualTiming?i.timestamp:performance.now();n=!1,Je.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,Zl),1)),i.timestamp=y,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),d.process(i),l.process(i),h.process(i),p.process(i),g.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(w))},T=()=>{n=!0,s=!0,i.isProcessing||e(w)};return{schedule:bn.reduce((y,b)=>{const P=r[b];return y[b]=(S,I=!1,x=!1)=>(n||T(),P.schedule(S,I,x)),y},{}),cancel:y=>{for(let b=0;b(Cn===void 0&&Ee.set(ge.isProcessing||Je.useManualTiming?ge.timestamp:performance.now()),Cn),set:e=>{Cn=e,queueMicrotask(Jl)}},_o=e=>t=>typeof t=="string"&&t.startsWith(e),jo=_o("--"),ec=_o("var(--"),ui=e=>ec(e)?tc.test(e.split("/*")[0].trim()):!1,tc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $i(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},rn={...Nt,transform:e=>Ye(0,1,e)},xn={...Nt,default:1},Jt=e=>Math.round(e*1e5)/1e5,di=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function nc(e){return e==null}const sc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,hi=(e,t)=>n=>!!(typeof n=="string"&&sc.test(n)&&n.startsWith(e)||t&&!nc(n)&&Object.prototype.hasOwnProperty.call(n,t)),No=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(di);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},ic=e=>Ye(0,255,e),ts={...Nt,transform:e=>Math.round(ic(e))},yt={test:hi("rgb","red"),parse:No("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+ts.transform(e)+", "+ts.transform(t)+", "+ts.transform(n)+", "+Jt(rn.transform(s))+")"};function rc(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Cs={test:hi("#"),parse:rc,transform:yt.transform},fn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),it=fn("deg"),Xe=fn("%"),k=fn("px"),oc=fn("vh"),ac=fn("vw"),zi={...Xe,parse:e=>Xe.parse(e)/100,transform:e=>Xe.transform(e*100)},Dt={test:hi("hsl","hue"),parse:No("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+Xe.transform(Jt(t))+", "+Xe.transform(Jt(n))+", "+Jt(rn.transform(s))+")"},ce={test:e=>yt.test(e)||Cs.test(e)||Dt.test(e),parse:e=>yt.test(e)?yt.parse(e):Dt.test(e)?Dt.parse(e):Cs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?yt.transform(e):Dt.transform(e),getAnimatableNone:e=>{const t=ce.parse(e);return t.alpha=0,ce.transform(t)}},lc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cc(e){return isNaN(e)&&typeof e=="string"&&(e.match(di)?.length||0)+(e.match(lc)?.length||0)>0}const Oo="number",Fo="color",uc="var",dc="var(",Ui="${}",hc=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function on(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(hc,c=>(ce.test(c)?(s.color.push(o),i.push(Fo),n.push(ce.parse(c))):c.startsWith(dc)?(s.var.push(o),i.push(uc),n.push(c)):(s.number.push(o),i.push(Oo),n.push(parseFloat(c))),++o,Ui)).split(Ui);return{values:n,split:a,indexes:s,types:i}}function Bo(e){return on(e).values}function $o(e){const{split:t,types:n}=on(e),s=t.length;return i=>{let o="";for(let r=0;rtypeof e=="number"?0:ce.test(e)?ce.getAnimatableNone(e):e;function pc(e){const t=Bo(e);return $o(e)(t.map(fc))}const at={test:cc,parse:Bo,createTransformer:$o,getAnimatableNone:pc};function ns(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function mc({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,o=0,r=0;if(!t)i=o=r=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;i=ns(c,a,e+1/3),o=ns(c,a,e),r=ns(c,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function On(e,t){return n=>n>0?t:e}const ne=(e,t,n)=>e+(t-e)*n,ss=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},gc=[Cs,yt,Dt],yc=e=>gc.find(t=>t.test(e));function Wi(e){const t=yc(e);if(!t)return!1;let n=t.parse(e);return t===Dt&&(n=mc(n)),n}const Hi=(e,t)=>{const n=Wi(e),s=Wi(t);if(!n||!s)return On(e,t);const i={...n};return o=>(i.red=ss(n.red,s.red,o),i.green=ss(n.green,s.green,o),i.blue=ss(n.blue,s.blue,o),i.alpha=ne(n.alpha,s.alpha,o),yt.transform(i))},Ds=new Set(["none","hidden"]);function vc(e,t){return Ds.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function bc(e,t){return n=>ne(e,t,n)}function fi(e){return typeof e=="number"?bc:typeof e=="string"?ui(e)?On:ce.test(e)?Hi:Sc:Array.isArray(e)?zo:typeof e=="object"?ce.test(e)?Hi:xc:On}function zo(e,t){const n=[...e],s=n.length,i=e.map((o,r)=>fi(o)(o,t[r]));return o=>{for(let r=0;r{for(const o in s)n[o]=s[o](i);return n}}function wc(e,t){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const n=at.createTransformer(t),s=on(e),i=on(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ds.has(e)&&!i.values.length||Ds.has(t)&&!s.values.length?vc(e,t):dn(zo(wc(s,i),i.values),n):On(e,t)};function Uo(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ne(e,t,n):fi(e)(e,t)}const Tc=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Z.update(t,n),stop:()=>ot(t),now:()=>ge.isProcessing?ge.timestamp:Ee.now()}},Wo=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let o=0;o=Fn?1/0:t}function Pc(e,t=100,n){const s=n({...e,keyframes:[0,t]}),i=Math.min(pi(s),Fn);return{type:"keyframes",ease:o=>s.next(i*o).value/t,duration:je(i)}}const Ac=5;function Ho(e,t,n){const s=Math.max(t-Ac,0);return To(n-e(s),t-s)}const ie={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},is=.001;function Ec({duration:e=ie.duration,bounce:t=ie.bounce,velocity:n=ie.velocity,mass:s=ie.mass}){let i,o,r=1-t;r=Ye(ie.minDamping,ie.maxDamping,r),e=Ye(ie.minDuration,ie.maxDuration,je(e)),r<1?(i=u=>{const d=u*r,l=d*e,h=d-n,p=Rs(u,r),g=Math.exp(-l);return is-h/p*g},o=u=>{const l=u*r*e,h=l*n+n,p=Math.pow(r,2)*Math.pow(u,2)*e,g=Math.exp(-l),w=Rs(Math.pow(u,2),r);return(-i(u)+is>0?-1:1)*((h-p)*g)/w}):(i=u=>{const d=Math.exp(-u*e),l=(u-n)*e+1;return-is+d*l},o=u=>{const d=Math.exp(-u*e),l=(n-u)*(e*e);return d*l});const a=5/e,c=Dc(i,o,a);if(e=Ue(e),isNaN(c))return{stiffness:ie.stiffness,damping:ie.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:e}}}const Cc=12;function Dc(e,t,n){let s=n;for(let i=1;ie[n]!==void 0)}function Mc(e){let t={velocity:ie.velocity,stiffness:ie.stiffness,damping:ie.damping,mass:ie.mass,isResolvedFromDuration:!1,...e};if(!qi(e,kc)&&qi(e,Rc))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*Ye(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ie.mass,stiffness:i,damping:o}}else{const n=Ec(e);t={...t,...n,mass:ie.mass},t.isResolvedFromDuration=!0}return t}function Bn(e=ie.visualDuration,t=ie.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:u,mass:d,duration:l,velocity:h,isResolvedFromDuration:p}=Mc({...n,velocity:-je(n.velocity||0)}),g=h||0,w=u/(2*Math.sqrt(c*d)),T=r-o,v=je(Math.sqrt(c/d)),A=Math.abs(T)<5;s||(s=A?ie.restSpeed.granular:ie.restSpeed.default),i||(i=A?ie.restDelta.granular:ie.restDelta.default);let y;if(w<1){const P=Rs(v,w);y=S=>{const I=Math.exp(-w*v*S);return r-I*((g+w*v*T)/P*Math.sin(P*S)+T*Math.cos(P*S))}}else if(w===1)y=P=>r-Math.exp(-v*P)*(T+(g+v*T)*P);else{const P=v*Math.sqrt(w*w-1);y=S=>{const I=Math.exp(-w*v*S),x=Math.min(P*S,300);return r-I*((g+w*v*T)*Math.sinh(x)+P*T*Math.cosh(x))/P}}const b={calculatedDuration:p&&l||null,next:P=>{const S=y(P);if(p)a.done=P>=l;else{let I=P===0?g:0;w<1&&(I=P===0?Ue(g):Ho(y,P,S));const x=Math.abs(I)<=s,R=Math.abs(r-S)<=i;a.done=x&&R}return a.value=a.done?r:S,a},toString:()=>{const P=Math.min(pi(b),Fn),S=Wo(I=>b.next(P*I).value,P,30);return P+"ms "+S},toTransition:()=>{}};return b}Bn.applyToOptions=e=>{const t=Pc(e,100,Bn);return e.ease=t.ease,e.duration=Ue(t.duration),e.type="keyframes",e};function ks({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:c,restDelta:u=.5,restSpeed:d}){const l=e[0],h={done:!1,value:l},p=x=>a!==void 0&&xc,g=x=>a===void 0?c:c===void 0||Math.abs(a-x)-w*Math.exp(-x/s),y=x=>v+A(x),b=x=>{const R=A(x),L=y(x);h.done=Math.abs(R)<=u,h.value=h.done?v:L};let P,S;const I=x=>{p(h.value)&&(P=x,S=Bn({keyframes:[h.value,g(h.value)],velocity:Ho(y,x,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:d}))};return I(0),{calculatedDuration:null,next:x=>{let R=!1;return!S&&P===void 0&&(R=!0,b(x),I(x)),P!==void 0&&x>=P?S.next(x-P):(!R&&b(x),h)}}}function Lc(e,t,n){const s=[],i=n||Je.mix||Uo,o=e.length-1;for(let r=0;rt[0];if(o===2&&t[0]===t[1])return()=>t[1];const r=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Lc(t,s,i),c=a.length,u=d=>{if(r&&d1)for(;lu(Ye(e[0],e[o-1],d)):u}function Vc(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=sn(0,t,s);e.push(ne(n,1,i))}}function _c(e){const t=[0];return Vc(t,e.length-1),t}function jc(e,t){return e.map(n=>n*t)}function Nc(e,t){return e.map(()=>t||Lo).splice(0,e.length-1)}function en({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=Xl(s)?s.map(Bi):Bi(s),o={done:!1,value:t[0]},r=jc(n&&n.length===t.length?n:_c(t),e),a=Ic(r,t,{ease:Array.isArray(i)?i:Nc(t,i)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const Oc=e=>e!==null;function mi(e,{repeat:t,repeatType:n="loop"},s,i=1){const o=e.filter(Oc),a=i<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Fc={decay:ks,inertia:ks,tween:en,keyframes:en,spring:Bn};function qo(e){typeof e.type=="string"&&(e.type=Fc[e.type])}class gi{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Bc=e=>e/100;class yi extends gi{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Ee.now()&&this.tick(Ee.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;qo(t);const{type:n=en,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const c=n||en;c!==en&&typeof a[0]!="number"&&(this.mixKeyframes=dn(Bc,Uo(a[0],a[1])),a=[0,100]);const u=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=pi(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:d,repeat:l,repeatType:h,repeatDelay:p,type:g,onUpdate:w,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,b=s;if(l){const x=Math.min(this.currentTime,i)/a;let R=Math.floor(x),L=x%1;!L&&x>=1&&(L=1),L===1&&R--,R=Math.min(R,l+1),!!(R%2)&&(h==="reverse"?(L=1-L,p&&(L-=p/a)):h==="mirror"&&(b=r)),y=Ye(0,1,L)*a}const P=A?{done:!1,value:d[0]}:b.next(y);o&&(P.value=o(P.value));let{done:S}=P;!A&&c!==null&&(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return I&&g!==ks&&(P.value=mi(d,this.options,T,this.speed)),w&&w(P.value),I&&this.finish(),P}then(t,n){return this.finished.then(t,n)}get duration(){return je(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+je(t)}get time(){return je(this.currentTime)}set time(t){t=Ue(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ee.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=je(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Tc,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ee.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function $c(e){for(let t=1;te*180/Math.PI,Ms=e=>{const t=vt(Math.atan2(e[1],e[0]));return Ls(t)},zc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ms,rotateZ:Ms,skewX:e=>vt(Math.atan(e[1])),skewY:e=>vt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ls=e=>(e=e%360,e<0&&(e+=360),e),Ki=Ms,Xi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Gi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Uc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xi,scaleY:Gi,scale:e=>(Xi(e)+Gi(e))/2,rotateX:e=>Ls(vt(Math.atan2(e[6],e[5]))),rotateY:e=>Ls(vt(Math.atan2(-e[2],e[0]))),rotateZ:Ki,rotate:Ki,skewX:e=>vt(Math.atan(e[4])),skewY:e=>vt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Is(e){return e.includes("scale")?1:0}function Vs(e,t){if(!e||e==="none")return Is(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Uc,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=zc,i=a}if(!i)return Is(t);const o=s[t],r=i[1].split(",").map(Hc);return typeof o=="function"?o(r):r[o]}const Wc=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Vs(n,t)};function Hc(e){return parseFloat(e.trim())}const Ot=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ft=new Set(Ot),Yi=e=>e===Nt||e===k,qc=new Set(["x","y","z"]),Kc=Ot.filter(e=>!qc.has(e));function Xc(e){const t=[];return Kc.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const rt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Vs(t,"x"),y:(e,{transform:t})=>Vs(t,"y")};rt.translateX=rt.x;rt.translateY=rt.y;const bt=new Set;let _s=!1,js=!1,Ns=!1;function Ko(){if(js){const e=Array.from(bt).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=Xc(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{s.getValue(o)?.set(r)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}js=!1,_s=!1,bt.forEach(e=>e.complete(Ns)),bt.clear()}function Xo(){bt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(js=!0)})}function Gc(){Ns=!0,Xo(),Ko(),Ns=!1}class vi{constructor(t,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(bt.add(this),_s||(_s=!0,Z.read(Xo),Z.resolveKeyframes(Ko))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;if(t[0]===null){const o=i?.get(),r=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=r),i&&o===void 0&&i.set(t[0])}$c(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),bt.delete(this)}cancel(){this.state==="scheduled"&&(bt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Yc=e=>e.startsWith("--");function Qc(e,t,n){Yc(t)?e.style.setProperty(t,n):e.style[t]=n}const Zc=oi(()=>window.ScrollTimeline!==void 0),Jc={};function eu(e,t){const n=oi(e);return()=>Jc[t]??n()}const Go=eu(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Zt=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Qi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zt([0,.65,.55,1]),circOut:Zt([.55,0,1,.45]),backIn:Zt([.31,.01,.66,-.59]),backOut:Zt([.33,1.53,.69,.99])};function Yo(e,t){if(e)return typeof e=="function"?Go()?Wo(e,t):"ease-out":Io(e)?Zt(e):Array.isArray(e)?e.map(n=>Yo(n,t)||Qi.easeOut):Qi[e]}function tu(e,t,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const l=Yo(a,i);Array.isArray(l)&&(d.easing=l);const h={delay:s,duration:i,easing:Array.isArray(l)?"linear":l,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(d,h)}function Qo(e){return typeof e=="function"&&"applyToOptions"in e}function nu({type:e,...t}){return Qo(e)&&Go()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Zo extends gi{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=t,ri(typeof t.type!="string");const u=nu(t);this.animation=tu(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=mi(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):Qc(n,s,d),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return je(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+je(t)}get time(){return je(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ue(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Zc()?(this.animation.timeline=t,Ne):n(this)}}const Jo={anticipate:Ro,backInOut:Do,circInOut:Mo};function su(e){return e in Jo}function iu(e){typeof e.ease=="string"&&su(e.ease)&&(e.ease=Jo[e.ease])}const rs=10;class ru extends Zo{constructor(t){iu(t),qo(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new yi({...r,autoplay:!1}),c=Math.max(rs,Ee.now()-this.startTime),u=Ye(0,rs,c-rs);n.setWithVelocity(a.sample(Math.max(0,c-u)).value,a.sample(c).value,u),a.stop()}}const Zi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(at.test(e)||e==="0")&&!e.startsWith("url("));function ou(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function uu(e){const{motionValue:t,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return cu()&&n&&lu.has(n)&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const du=40;class hu extends gi{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:c,motionValue:u,element:d,...l}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ee.now();const h={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:c,motionValue:u,element:d,...l},p=d?.KeyframeResolver||vi;this.keyframeResolver=new p(a,(g,w,T)=>this.onKeyframesResolved(g,w,h,!T),c,u,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:c,isHandoff:u,onUpdate:d}=s;this.resolvedAt=Ee.now(),au(t,o,r,a)||((Je.instantAnimations||!c)&&d?.(mi(t,s,n)),t[0]=t[t.length-1],Os(s),s.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>du?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},p=!u&&uu(h),g=h.motionValue?.owner?.current,w=p?new ru({...h,element:g}):new yi(h);w.finished.then(()=>{this.notifyFinished()}).catch(Ne),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Gc()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ea(e,t,n,s=0,i=1){const o=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),r=e.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const fu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pu(e){const t=fu.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function ta(e,t,n=1){const[s,i]=pu(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const r=o.trim();return xo(r)?parseFloat(r):r}return ui(i)?ta(i,t,n+1):i}const mu={type:"spring",stiffness:500,damping:25,restSpeed:10},gu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),yu={type:"keyframes",duration:.8},vu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bu=(e,{keyframes:t})=>t.length>2?yu:Ft.has(e)?e.startsWith("scale")?gu(t[1]):mu:vu,xu=e=>e!==null;function wu(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(xu),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[o]}function na(e,t){if(e?.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function bi(e,t){const n=e?.[t]??e?.default??e;return n!==e?na(n,e):n}function Su({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const xi=(e,t,n,s={},i,o)=>r=>{const a=bi(s,e)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Ue(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};Su(a)||Object.assign(d,bu(e,d)),d.duration&&(d.duration=Ue(d.duration)),d.repeatDelay&&(d.repeatDelay=Ue(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let l=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Os(d),d.delay===0&&(l=!0)),(Je.instantAnimations||Je.skipAnimations||i?.shouldSkipAnimations)&&(l=!0,Os(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,l&&!o&&t.get()!==void 0){const h=wu(d.keyframes,a);if(h!==void 0){Z.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new yi(d):new hu(d)};function Ji(e){const t=[{},{}];return e?.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function wi(e,t,n,s){if(typeof t=="function"){const[i,o]=Ji(s);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Ji(s);t=t(n!==void 0?n:e.custom,i,o)}return t}function It(e,t,n){const s=e.getProps();return wi(s,t,n!==void 0?n:s.custom,e)}const sa=new Set(["width","height","top","left","right","bottom",...Ot]),er=30,Tu=e=>!isNaN(parseFloat(e));class Pu{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=Ee.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ee.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Tu(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ai);const s=this.events[t].add(n);return t==="change"?()=>{s(),Z.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ee.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>er)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,er);return To(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jt(e,t){return new Pu(e,t)}const Fs=e=>Array.isArray(e);function Au(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,jt(n))}function Eu(e){return Fs(e)?e[e.length-1]||0:e}function Cu(e,t){const n=It(e,t);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Eu(o[r]);Au(e,r,a)}}const be=e=>!!(e&&e.getVelocity);function Du(e){return!!(be(e)&&e.add)}function Bs(e,t){const n=e.getValue("willChange");if(Du(n))return n.add(t);if(!n&&Je.WillChange){const s=new Je.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Si(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ru="framerAppearId",ia="data-"+Si(Ru);function ra(e){return e.props[ia]}function ku({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function oa(e,t,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o,transitionEnd:r,...a}=t;const c=e.getDefaultTransition();o=o?na(o,c):c;const u=o?.reduceMotion;s&&(o=s);const d=[],l=i&&e.animationState&&e.animationState.getState()[i];for(const h in a){const p=e.getValue(h,e.latestValues[h]??null),g=a[h];if(g===void 0||l&&ku(l,h))continue;const w={delay:n,...bi(o||{},h)},T=p.get();if(T!==void 0&&!p.isAnimating&&!Array.isArray(g)&&g===T&&!w.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const b=ra(e);if(b){const P=window.MotionHandoffAnimation(b,h,Z);P!==null&&(w.startTime=P,v=!0)}}Bs(e,h);const A=u??e.shouldReduceMotion;p.start(xi(h,p,g,A&&sa.has(h)?{type:!1}:w,e,v));const y=p.animation;y&&d.push(y)}if(r){const h=()=>Z.update(()=>{r&&Cu(e,r)});d.length?Promise.all(d).then(h):h()}return d}function $s(e,t,n={}){const s=It(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(oa(e,s,n)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:l}=i;return Mu(e,t,c,u,d,l,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>u())}else return Promise.all([o(),r(n.delay)])}function Mu(e,t,n=0,s=0,i=0,o=1,r){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push($s(c,t,{...r,delay:n+(typeof s=="function"?0:s)+ea(e.variantChildren,c,s,i,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Lu(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(o=>$s(e,o,n));s=Promise.all(i)}else if(typeof t=="string")s=$s(e,t,n);else{const i=typeof t=="function"?It(e,t,n.custom):t;s=Promise.all(oa(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Iu={test:e=>e==="auto",parse:e=>e},aa=e=>t=>t.test(e),la=[Nt,k,Xe,it,ac,oc,Iu],tr=e=>la.find(aa(e));function Vu(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||So(e):!0}const _u=new Set(["brightness","contrast","saturate","opacity"]);function ju(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(di)||[];if(!s)return e;const i=n.replace(s,"");let o=_u.has(t)?1:0;return s!==n&&(o*=100),t+"("+o+i+")"}const Nu=/\b([a-z-]*)\(.*?\)/gu,zs={...at,getAnimatableNone:e=>{const t=e.match(Nu);return t?t.map(ju).join(" "):e}},nr={...Nt,transform:Math.round},Ou={rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:xn,scaleX:xn,scaleY:xn,scaleZ:xn,skew:it,skewX:it,skewY:it,distance:k,translateX:k,translateY:k,translateZ:k,x:k,y:k,z:k,perspective:k,transformPerspective:k,opacity:rn,originX:zi,originY:zi,originZ:k},Ti={borderWidth:k,borderTopWidth:k,borderRightWidth:k,borderBottomWidth:k,borderLeftWidth:k,borderRadius:k,borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomRightRadius:k,borderBottomLeftRadius:k,width:k,maxWidth:k,height:k,maxHeight:k,top:k,right:k,bottom:k,left:k,inset:k,insetBlock:k,insetBlockStart:k,insetBlockEnd:k,insetInline:k,insetInlineStart:k,insetInlineEnd:k,padding:k,paddingTop:k,paddingRight:k,paddingBottom:k,paddingLeft:k,paddingBlock:k,paddingBlockStart:k,paddingBlockEnd:k,paddingInline:k,paddingInlineStart:k,paddingInlineEnd:k,margin:k,marginTop:k,marginRight:k,marginBottom:k,marginLeft:k,marginBlock:k,marginBlockStart:k,marginBlockEnd:k,marginInline:k,marginInlineStart:k,marginInlineEnd:k,fontSize:k,backgroundPositionX:k,backgroundPositionY:k,...Ou,zIndex:nr,fillOpacity:rn,strokeOpacity:rn,numOctaves:nr},Fu={...Ti,color:ce,backgroundColor:ce,outlineColor:ce,fill:ce,stroke:ce,borderColor:ce,borderTopColor:ce,borderRightColor:ce,borderBottomColor:ce,borderLeftColor:ce,filter:zs,WebkitFilter:zs},ca=e=>Fu[e];function ua(e,t){let n=ca(e);return n!==zs&&(n=at),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bu=new Set(["auto","none","0"]);function $u(e,t,n){let s=0,i;for(;s{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const Uu=new Set(["opacity","clipPath","filter","transform"]);function da(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const i=n?.[e]??s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(s=>s!=null)}const ha=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Us(e){return wo(e)&&"offsetHeight"in e}const{schedule:Pi}=Vo(queueMicrotask,!1),ze={x:!1,y:!1};function fa(){return ze.x||ze.y}function Wu(e){return e==="x"||e==="y"?ze[e]?null:(ze[e]=!0,()=>{ze[e]=!1}):ze.x||ze.y?null:(ze.x=ze.y=!0,()=>{ze.x=ze.y=!1})}function pa(e,t){const n=da(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function Hu(e){return!(e.pointerType==="touch"||fa())}function qu(e,t,n={}){const[s,i,o]=pa(e,n);return s.forEach(r=>{let a=!1,c=!1,u;const d=()=>{r.removeEventListener("pointerleave",g)},l=T=>{u&&(u(T),u=void 0),d()},h=T=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,l(T))},p=()=>{a=!0,window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",h,i)},g=T=>{if(T.pointerType!=="touch"){if(a){c=!0;return}l(T)}},w=T=>{if(!Hu(T))return;c=!1;const v=t(r,T);typeof v=="function"&&(u=v,r.addEventListener("pointerleave",g,i))};r.addEventListener("pointerenter",w,i),r.addEventListener("pointerdown",p,i)}),o}const ma=(e,t)=>t?e===t?!0:ma(e,t.parentElement):!1,Ai=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Ku=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Xu(e){return Ku.has(e.tagName)||e.isContentEditable===!0}const Gu=new Set(["INPUT","SELECT","TEXTAREA"]);function Yu(e){return Gu.has(e.tagName)||e.isContentEditable===!0}const Dn=new WeakSet;function sr(e){return t=>{t.key==="Enter"&&e(t)}}function os(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Qu=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=sr(()=>{if(Dn.has(n))return;os(n,"down");const i=sr(()=>{os(n,"up")}),o=()=>os(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function ir(e){return Ai(e)&&!fa()}const rr=new WeakSet;function Zu(e,t,n={}){const[s,i,o]=pa(e,n),r=a=>{const c=a.currentTarget;if(!ir(a)||rr.has(a))return;Dn.add(c),n.stopPropagation&&rr.add(a);const u=t(c,a),d=(p,g)=>{window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",h),Dn.has(c)&&Dn.delete(c),ir(p)&&typeof u=="function"&&u(p,{success:g})},l=p=>{d(p,c===window||c===document||n.useGlobalTarget||ma(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",l,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Us(a)&&(a.addEventListener("focus",u=>Qu(u,i)),!Xu(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Ei(e){return wo(e)&&"ownerSVGElement"in e}const Rn=new WeakMap;let kn;const ga=(e,t,n)=>(s,i)=>i&&i[0]?i[0][e+"Size"]:Ei(s)&&"getBBox"in s?s.getBBox()[t]:s[n],Ju=ga("inline","width","offsetWidth"),ed=ga("block","height","offsetHeight");function td({target:e,borderBoxSize:t}){Rn.get(e)?.forEach(n=>{n(e,{get width(){return Ju(e,t)},get height(){return ed(e,t)}})})}function nd(e){e.forEach(td)}function sd(){typeof ResizeObserver>"u"||(kn=new ResizeObserver(nd))}function id(e,t){kn||sd();const n=da(e);return n.forEach(s=>{let i=Rn.get(s);i||(i=new Set,Rn.set(s,i)),i.add(t),kn?.observe(s)}),()=>{n.forEach(s=>{const i=Rn.get(s);i?.delete(t),i?.size||kn?.unobserve(s)})}}const Mn=new Set;let Rt;function rd(){Rt=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Mn.forEach(t=>t(e))},window.addEventListener("resize",Rt)}function od(e){return Mn.add(e),Rt||rd(),()=>{Mn.delete(e),!Mn.size&&typeof Rt=="function"&&(window.removeEventListener("resize",Rt),Rt=void 0)}}function or(e,t){return typeof e=="function"?od(e):id(e,t)}function ad(e){return Ei(e)&&e.tagName==="svg"}const ld=[...la,ce,at],cd=e=>ld.find(aa(e)),ar=()=>({translate:0,scale:1,origin:0,originPoint:0}),kt=()=>({x:ar(),y:ar()}),lr=()=>({min:0,max:0}),fe=()=>({x:lr(),y:lr()}),ud=new WeakMap;function qn(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function an(e){return typeof e=="string"||Array.isArray(e)}const Ci=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Di=["initial",...Ci];function Kn(e){return qn(e.animate)||Di.some(t=>an(e[t]))}function ya(e){return!!(Kn(e)||e.variants)}function dd(e,t,n){for(const s in t){const i=t[s],o=n[s];if(be(i))e.addValue(s,i);else if(be(o))e.addValue(s,jt(i,{owner:e}));else if(o!==i)if(e.hasValue(s)){const r=e.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=e.getStaticValue(s);e.addValue(s,jt(r!==void 0?r:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const Ws={current:null},va={current:!1},hd=typeof window<"u";function fd(){if(va.current=!0,!!hd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ws.current=e.matches;e.addEventListener("change",t),t()}else Ws.current=!1}const cr=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let $n={};function ba(e){$n=e}function pd(){return $n}class md{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=vi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ee.now();this.renderScheduledAtthis.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(va.current||fd(),this.shouldReduceMotion=Ws.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ot(this.notifyUpdate),ot(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Uu.has(t)&&this.current instanceof HTMLElement){const{factory:r,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,l=new Zo({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:Ue(d)}),h=r(l);this.valueSubscriptions.set(t,()=>{h(),l.cancel()});return}const s=Ft.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[t]=r,this.props.onUpdate&&Z.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $n){const n=$n[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=jt(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(xo(s)||So(s))?s=parseFloat(s):!cd(s)&&at.test(n)&&(s=ua(t,n)),this.setBaseTarget(t,be(s)?s.get():s)),be(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=wi(this.props,n,this.presenceContext?.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!be(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ai),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Pi.render(this.render)}}class xa extends md{constructor(){super(...arguments),this.KeyframeResolver=zu}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;be(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ut{constructor(t){this.isMounted=!1,this.node=t}update(){}}function wa({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function gd({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function yd(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function as(e){return e===void 0||e===1}function Hs({scale:e,scaleX:t,scaleY:n}){return!as(e)||!as(t)||!as(n)}function gt(e){return Hs(e)||Sa(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Sa(e){return ur(e.x)||ur(e.y)}function ur(e){return e&&e!=="0%"}function zn(e,t,n){const s=e-n,i=t*s;return n+i}function dr(e,t,n,s,i){return i!==void 0&&(e=zn(e,i,s)),zn(e,n,s)+t}function qs(e,t=0,n=1,s,i){e.min=dr(e.min,t,n,s,i),e.max=dr(e.max,t,n,s,i)}function Ta(e,{x:t,y:n}){qs(e.x,t.translate,t.scale,t.originPoint),qs(e.y,n.translate,n.scale,n.originPoint)}const hr=.999999999999,fr=1.0000000000001;function vd(e,t,n,s=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,r;for(let a=0;ahr&&(t.x=1),t.yhr&&(t.y=1)}function Mt(e,t){e.min=e.min+t,e.max=e.max+t}function pr(e,t,n,s,i=.5){const o=ne(e.min,e.max,i);qs(e,t,n,o,s)}function Lt(e,t){pr(e.x,t.x,t.scaleX,t.scale,t.originX),pr(e.y,t.y,t.scaleY,t.scale,t.originY)}function Pa(e,t){return wa(yd(e.getBoundingClientRect(),t))}function bd(e,t,n){const s=Pa(e,n),{scroll:i}=t;return i&&(Mt(s.x,i.offset.x),Mt(s.y,i.offset.y)),s}const xd={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wd=Ot.length;function Sd(e,t,n){let s="",i=!0;for(let o=0;o{if(!t.target)return e;if(typeof e=="string")if(k.test(e))e=parseFloat(e);else return e;const n=mr(e,t.target.x),s=mr(e,t.target.y);return`${n}% ${s}%`}},Td={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=at.parse(e);if(i.length>5)return s;const o=at.createTransformer(e),r=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;i[0+r]/=a,i[1+r]/=c;const u=ne(a,c,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},Ks={borderRadius:{...Yt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yt,borderTopRightRadius:Yt,borderBottomLeftRadius:Yt,borderBottomRightRadius:Yt,boxShadow:Td};function Ea(e,{layout:t,layoutId:n}){return Ft.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ks[e]||e==="opacity")}function ki(e,t,n){const s=e.style,i=t?.style,o={};if(!s)return o;for(const r in s)(be(s[r])||i&&be(i[r])||Ea(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function Pd(e){return window.getComputedStyle(e)}class Ad extends xa{constructor(){super(...arguments),this.type="html",this.renderInstance=Aa}readValueFromInstance(t,n){if(Ft.has(n))return this.projection?.isProjecting?Is(n):Wc(t,n);{const s=Pd(t),i=(jo(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Pa(t,n)}build(t,n,s){Ri(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return ki(t,n,s)}}const Ed={offset:"stroke-dashoffset",array:"stroke-dasharray"},Cd={offset:"strokeDashoffset",array:"strokeDasharray"};function Dd(e,t,n=1,s=0,i=!0){e.pathLength=1;const o=i?Ed:Cd;e[o.offset]=`${-s}`,e[o.array]=`${t} ${n}`}const Rd=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ca(e,{attrX:t,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},c,u,d){if(Ri(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:l,style:h}=e;l.transform&&(h.transform=l.transform,delete l.transform),(h.transform||l.transformOrigin)&&(h.transformOrigin=l.transformOrigin??"50% 50%",delete l.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete l.transformBox);for(const p of Rd)l[p]!==void 0&&(h[p]=l[p],delete l[p]);t!==void 0&&(l.x=t),n!==void 0&&(l.y=n),s!==void 0&&(l.scale=s),i!==void 0&&Dd(l,i,o,r,!1)}const Da=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Ra=e=>typeof e=="string"&&e.toLowerCase()==="svg";function kd(e,t,n,s){Aa(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(Da.has(i)?i:Si(i),t.attrs[i])}function ka(e,t,n){const s=ki(e,t,n);for(const i in e)if(be(e[i])||be(t[i])){const o=Ot.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=e[i]}return s}class Md extends xa{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ft.has(n)){const s=ca(n);return s&&s.default||0}return n=Da.has(n)?n:Si(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return ka(t,n,s)}build(t,n,s){Ca(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,i){kd(t,n,s,i)}mount(t){this.isSVGTag=Ra(t.tagName),super.mount(t)}}const Ld=Di.length;function Ma(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ma(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:s})=>Lu(e,n,s)))}function jd(e){let t=_d(e),n=gr(),s=!0;const i=c=>(u,d)=>{const l=It(e,d,c==="exit"?e.presenceContext?.custom:void 0);if(l){const{transition:h,transitionEnd:p,...g}=l;u={...u,...g,...p}}return u};function o(c){t=c(e)}function r(c){const{props:u}=e,d=Ma(e.parent)||{},l=[],h=new Set;let p={},g=1/0;for(let T=0;Tg&&b,R=!1;const L=Array.isArray(y)?y:[y];let _=L.reduce(i(v),{});P===!1&&(_={});const{prevResolvedValues:ae={}}=A,se={...ae,..._},ye=N=>{x=!0,h.has(N)&&(R=!0,h.delete(N)),A.needsAnimating[N]=!0;const U=e.getValue(N);U&&(U.liveStyle=!1)};for(const N in se){const U=_[N],le=ae[N];if(p.hasOwnProperty(N))continue;let K=!1;Fs(U)&&Fs(le)?K=!La(U,le):K=U!==le,K?U!=null?ye(N):h.add(N):U!==void 0&&h.has(N)?ye(N):A.protectedKeys[N]=!0}A.prevProp=y,A.prevResolvedValues=_,A.isActive&&(p={...p,..._}),s&&e.blockInitialAnimation&&(x=!1);const De=S&&I;x&&(!De||R)&&l.push(...L.map(N=>{const U={type:v};if(typeof N=="string"&&s&&!De&&e.manuallyAnimateOnMount&&e.parent){const{parent:le}=e,K=It(le,N);if(le.enteringChildren&&K){const{delayChildren:q}=K.transition||{};U.delay=ea(le.enteringChildren,e,q)}}return{animation:N,options:U}}))}if(h.size){const T={};if(typeof u.initial!="boolean"){const v=It(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(T.transition=v.transition)}h.forEach(v=>{const A=e.getBaseTarget(v),y=e.getValue(v);y&&(y.liveStyle=!0),T[v]=A??null}),l.push({animation:T})}let w=!!l.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),s=!1,w?t(l):Promise.resolve()}function a(c,u){if(n[c].isActive===u)return Promise.resolve();e.variantChildren?.forEach(l=>l.animationState?.setActive(c,u)),n[c].isActive=u;const d=r(c);for(const l in n)n[l].protectedKeys={};return d}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=gr()}}}function Nd(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!La(t,e):!1}function pt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gr(){return{animate:pt(!0),whileInView:pt(),whileHover:pt(),whileTap:pt(),whileDrag:pt(),whileFocus:pt(),exit:pt()}}function yr(e,t){e.min=t.min,e.max=t.max}function $e(e,t){yr(e.x,t.x),yr(e.y,t.y)}function vr(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Ia=1e-4,Od=1-Ia,Fd=1+Ia,Va=.01,Bd=0-Va,$d=0+Va;function Ce(e){return e.max-e.min}function zd(e,t,n){return Math.abs(e-t)<=n}function br(e,t,n,s=.5){e.origin=s,e.originPoint=ne(t.min,t.max,e.origin),e.scale=Ce(n)/Ce(t),e.translate=ne(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Od&&e.scale<=Fd||isNaN(e.scale))&&(e.scale=1),(e.translate>=Bd&&e.translate<=$d||isNaN(e.translate))&&(e.translate=0)}function tn(e,t,n,s){br(e.x,t.x,n.x,s?s.originX:void 0),br(e.y,t.y,n.y,s?s.originY:void 0)}function xr(e,t,n){e.min=n.min+t.min,e.max=e.min+Ce(t)}function Ud(e,t,n){xr(e.x,t.x,n.x),xr(e.y,t.y,n.y)}function wr(e,t,n){e.min=t.min-n.min,e.max=e.min+Ce(t)}function Un(e,t,n){wr(e.x,t.x,n.x),wr(e.y,t.y,n.y)}function Sr(e,t,n,s,i){return e-=t,e=zn(e,1/n,s),i!==void 0&&(e=zn(e,1/i,s)),e}function Wd(e,t=0,n=1,s=.5,i,o=e,r=e){if(Xe.test(t)&&(t=parseFloat(t),t=ne(r.min,r.max,t/100)-r.min),typeof t!="number")return;let a=ne(o.min,o.max,s);e===o&&(a-=t),e.min=Sr(e.min,t,n,a,i),e.max=Sr(e.max,t,n,a,i)}function Tr(e,t,[n,s,i],o,r){Wd(e,t[n],t[s],t[i],t.scale,o,r)}const Hd=["x","scaleX","originX"],qd=["y","scaleY","originY"];function Pr(e,t,n,s){Tr(e.x,t,Hd,n?n.x:void 0,s?s.x:void 0),Tr(e.y,t,qd,n?n.y:void 0,s?s.y:void 0)}function Ar(e){return e.translate===0&&e.scale===1}function _a(e){return Ar(e.x)&&Ar(e.y)}function Er(e,t){return e.min===t.min&&e.max===t.max}function Kd(e,t){return Er(e.x,t.x)&&Er(e.y,t.y)}function Cr(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ja(e,t){return Cr(e.x,t.x)&&Cr(e.y,t.y)}function Dr(e){return Ce(e.x)/Ce(e.y)}function Rr(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ke(e){return[e("x"),e("y")]}function Xd(e,t,n){let s="";const i=e.x.translate/t.x,o=e.y.translate/t.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:l,rotateY:h,skewX:p,skewY:g}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),l&&(s+=`rotateX(${l}deg) `),h&&(s+=`rotateY(${h}deg) `),p&&(s+=`skewX(${p}deg) `),g&&(s+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const Na=["TopLeft","TopRight","BottomLeft","BottomRight"],Gd=Na.length,kr=e=>typeof e=="string"?parseFloat(e):e,Mr=e=>typeof e=="number"||k.test(e);function Yd(e,t,n,s,i,o){i?(e.opacity=ne(0,n.opacity??1,Qd(s)),e.opacityExit=ne(t.opacity??1,0,Zd(s))):o&&(e.opacity=ne(t.opacity??1,n.opacity??1,s));for(let r=0;rst?1:n(sn(e,t,s))}function Jd(e,t,n){const s=be(e)?e:jt(e);return s.start(xi("",s,t,n)),s.animation}function ln(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}const eh=(e,t)=>e.depth-t.depth;class th{constructor(){this.children=[],this.isDirty=!1}add(t){ii(this.children,t),this.isDirty=!0}remove(t){Nn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(eh),this.isDirty=!1,this.children.forEach(t)}}function nh(e,t){const n=Ee.now(),s=({timestamp:i})=>{const o=i-n;o>=t&&(ot(s),e(o-t))};return Z.setup(s,!0),()=>ot(s)}function Ln(e){return be(e)?e.get():e}class sh{constructor(){this.members=[]}add(t){ii(this.members,t);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===t||s===this.lead||s===this.prevLead)continue;const i=s.instance;i&&i.isConnected===!1&&s.isPresent!==!1&&!s.snapshot&&Nn(this.members,s)}t.scheduleRender()}remove(t){if(Nn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i],r=o.instance;if(o.isPresent!==!1&&(!r||r.isConnected!==!1)){s=o;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender();const i=s.options.layoutDependency,o=t.options.layoutDependency;if(!(i!==void 0&&o!==void 0&&i===o)){const c=s.instance;c&&c.isConnected===!1&&!s.snapshot||(t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:a}=t.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const In={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ls=["","X","Y","Z"],ih=1e3;let rh=0;function cs(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function Fa(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ra(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Z,!(i||o))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&Fa(s)}function Ba({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=t?.()){this.id=rh++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(lh),this.nodes.forEach(hh),this.nodes.forEach(fh),this.nodes.forEach(ch)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;Z.read(()=>{l=window.innerWidth}),e(r,()=>{const p=window.innerWidth;p!==l&&(l=p,this.root.updateBlockedByResize=!0,d&&d(),d=nh(h,250),In.hasAnimatedSinceResize&&(In.hasAnimatedSinceResize=!1,this.nodes.forEach(_r)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:l,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||vh,{onLayoutAnimationStart:w,onLayoutAnimationComplete:T}=u.getProps(),v=!this.targetLayout||!ja(this.targetLayout,p),A=!l&&h;if(this.options.layoutRoot||this.resumeFrom||A||l&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...bi(g,"layout"),onPlay:w,onComplete:T};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,A)}else l||_r(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ot(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ph),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Fa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ce(this.snapshot.measuredBox.x)&&!Ce(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const P=b/1e3;jr(l.x,r.x,P),jr(l.y,r.y,P),this.setTargetDelta(l),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Un(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gh(this.relativeTarget,this.relativeTargetOrigin,h,P),y&&Kd(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=fe()),$e(y,this.relativeTarget)),w&&(this.animationValues=d,Yd(d,u,this.latestValues,P,A,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ot(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Z.update(()=>{In.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=jt(0)),this.currentAnimation=Jd(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ih),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=r;if(!(!a||!c||!u)){if(this!==r&&this.layout&&u&&$a(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||fe();const l=Ce(this.layout.layoutBox.x);c.x.min=r.target.x.min,c.x.max=c.x.min+l;const h=Ce(this.layout.layoutBox.y);c.y.min=r.target.y.min,c.y.max=c.y.min+h}$e(a,c),Lt(a,d),tn(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new sh),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:c}=r;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&cs("z",r,u,this.animationValues);for(let d=0;dr.currentAnimation?.stop()),this.root.nodes.forEach(Ir),this.root.sharedNodes.clear()}}}function oh(e){e.updateLayout()}function ah(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;i==="size"?Ke(d=>{const l=o?t.measuredBox[d]:t.layoutBox[d],h=Ce(l);l.min=n[d].min,l.max=l.min+h}):$a(i,t.layoutBox,n)&&Ke(d=>{const l=o?t.measuredBox[d]:t.layoutBox[d],h=Ce(n[d]);l.max=l.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const r=kt();tn(r,n,t.layoutBox);const a=kt();o?tn(a,e.applyTransform(s,!0),t.measuredBox):tn(a,n,t.layoutBox);const c=!_a(r);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:l,layout:h}=d;if(l&&h){const p=fe();Un(p,t.layoutBox,l.layoutBox);const g=fe();Un(g,n,h.layoutBox),ja(p,g)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:r,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function lh(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ch(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function uh(e){e.clearSnapshot()}function Ir(e){e.clearMeasurements()}function Vr(e){e.isLayoutDirty=!1}function dh(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function _r(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hh(e){e.resolveTargetDelta()}function fh(e){e.calcProjection()}function ph(e){e.resetSkewAndRotation()}function mh(e){e.removeLeadSnapshot()}function jr(e,t,n){e.translate=ne(t.translate,0,n),e.scale=ne(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Nr(e,t,n,s){e.min=ne(t.min,n.min,s),e.max=ne(t.max,n.max,s)}function gh(e,t,n,s){Nr(e.x,t.x,n.x,s),Nr(e.y,t.y,n.y,s)}function yh(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vh={duration:.45,ease:[.4,0,.1,1]},Or=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Fr=Or("applewebkit/")&&!Or("chrome/")?Math.round:Ne;function Br(e){e.min=Fr(e.min),e.max=Fr(e.max)}function bh(e){Br(e.x),Br(e.y)}function $a(e,t,n){return e==="position"||e==="preserve-aspect"&&!zd(Dr(t),Dr(n),.2)}function xh(e){return e!==e.root&&e.scroll?.wasRoot}const wh=Ba({attachResizeListener:(e,t)=>ln(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),us={current:void 0},za=Ba({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!us.current){const e=new wh({});e.mount(window),e.setOptions({layoutScroll:!0}),us.current=e}return us.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Mi=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function $r(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sh(...e){return t=>{let n=!1;const s=e.map(i=>{const o=$r(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{width:h,height:p,top:g,left:w,right:T,bottom:v}=c.current;if(t||o===!1||!a.current||!h||!p)return;const A=n==="left"?`left: ${w}`:`right: ${T}`,y=s==="bottom"?`bottom: ${v}`:`top: ${g}`;a.current.dataset.motionPopId=r;const b=document.createElement("style");u&&(b.nonce=u);const P=i??document.head;return P.appendChild(b),b.sheet&&b.sheet.insertRule(` - [data-motion-pop-id="${r}"] { - position: absolute !important; - width: ${h}px !important; - height: ${p}px !important; - ${A}px !important; - ${y}px !important; - } - `),()=>{P.contains(b)&&P.removeChild(b)}},[t]),m.jsx(Ph,{isPresent:t,childRef:a,sizeRef:c,pop:o,children:o===!1?e:f.cloneElement(e,{ref:l})})}const Eh=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a,anchorY:c,root:u})=>{const d=si(Ch),l=f.useId();let h=!0,p=f.useMemo(()=>(h=!1,{id:l,initial:t,isPresent:n,custom:i,onExitComplete:g=>{d.set(g,!0);for(const w of d.values())if(!w)return;s&&s()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,s]);return o&&h&&(p={...p}),f.useMemo(()=>{d.forEach((g,w)=>d.set(w,!1))},[n]),f.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),e=m.jsx(Ah,{pop:r==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:e}),m.jsx(Hn.Provider,{value:p,children:e})};function Ch(){return new Map}function Ua(e=!0){const t=f.useContext(Hn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,o=f.useId();f.useEffect(()=>{if(e)return i(o)},[e]);const r=f.useCallback(()=>e&&s&&s(o),[o,s,e]);return!n&&s?[!1,r]:[!0]}const wn=e=>e.key||"";function zr(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const Dh=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,l]=Ua(r),h=f.useMemo(()=>zr(e),[e]),p=r&&!d?[]:h.map(wn),g=f.useRef(!0),w=f.useRef(h),T=si(()=>new Map),v=f.useRef(new Set),[A,y]=f.useState(h),[b,P]=f.useState(h);bo(()=>{g.current=!1,w.current=h;for(let x=0;x{const R=wn(x),L=r&&!d?!1:h===b||p.includes(R),_=()=>{if(v.current.has(R))return;if(v.current.add(R),T.has(R))T.set(R,!0);else return;let ae=!0;T.forEach(se=>{se||(ae=!1)}),ae&&(I?.(),P(w.current),r&&l?.(),s&&s())};return m.jsx(Eh,{isPresent:L,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:u,onExitComplete:L?void 0:_,anchorX:a,anchorY:c,children:x},R)})})},Wa=f.createContext({strict:!1}),Ur={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Wr=!1;function Rh(){if(Wr)return;const e={};for(const t in Ur)e[t]={isEnabled:n=>Ur[t].some(s=>!!n[s])};ba(e),Wr=!0}function Ha(){return Rh(),pd()}function kh(e){const t=Ha();for(const n in e)t[n]={...t[n],...e[n]};ba(t)}const Mh=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Wn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Mh.has(e)}let qa=e=>!Wn(e);function Lh(e){typeof e=="function"&&(qa=t=>t.startsWith("on")?!Wn(t):e(t))}try{Lh(require("@emotion/is-prop-valid").default)}catch{}function Ih(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(qa(i)||n===!0&&Wn(i)||!t&&!Wn(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}const Xn=f.createContext({});function Vh(e,t){if(Kn(e)){const{initial:n,animate:s}=e;return{initial:n===!1||an(n)?n:void 0,animate:an(s)?s:void 0}}return e.inherit!==!1?t:{}}function _h(e){const{initial:t,animate:n}=Vh(e,f.useContext(Xn));return f.useMemo(()=>({initial:t,animate:n}),[Hr(t),Hr(n)])}function Hr(e){return Array.isArray(e)?e.join(" "):e}const Li=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ka(e,t,n){for(const s in t)!be(t[s])&&!Ea(s,n)&&(e[s]=t[s])}function jh({transformTemplate:e},t){return f.useMemo(()=>{const n=Li();return Ri(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Nh(e,t){const n=e.style||{},s={};return Ka(s,n,e),Object.assign(s,jh(e,t)),s}function Oh(e,t){const n={},s=Nh(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Xa=()=>({...Li(),attrs:{}});function Fh(e,t,n,s){const i=f.useMemo(()=>{const o=Xa();return Ca(o,t,Ra(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Ka(o,e.style,e),i.style={...o,...i.style}}return i}const Bh=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ii(e){return typeof e!="string"||e.includes("-")?!1:!!(Bh.indexOf(e)>-1||/[A-Z]/u.test(e))}function $h(e,t,n,{latestValues:s},i,o=!1,r){const c=(r??Ii(e)?Fh:Oh)(t,s,i,e),u=Ih(t,typeof e=="string",o),d=e!==f.Fragment?{...u,...c,ref:n}:{},{children:l}=t,h=f.useMemo(()=>be(l)?l.get():l,[l]);return f.createElement(e,{...d,children:h})}function zh({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,i){return{latestValues:Uh(n,s,i,e),renderState:t()}}function Uh(e,t,n,s){const i={},o=s(e,{});for(const h in o)i[h]=Ln(o[h]);let{initial:r,animate:a}=e;const c=Kn(e),u=ya(e);t&&u&&!c&&e.inherit!==!1&&(r===void 0&&(r=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||r===!1;const l=d?a:r;if(l&&typeof l!="boolean"&&!qn(l)){const h=Array.isArray(l)?l:[l];for(let p=0;p(t,n)=>{const s=f.useContext(Xn),i=f.useContext(Hn),o=()=>zh(e,t,s,i);return n?o():si(o)},Wh=Ga({scrapeMotionValuesFromProps:ki,createRenderState:Li}),Hh=Ga({scrapeMotionValuesFromProps:ka,createRenderState:Xa}),qh=Symbol.for("motionComponentSymbol");function Kh(e,t,n){const s=f.useRef(n);f.useInsertionEffect(()=>{s.current=n});const i=f.useRef(null);return f.useCallback(o=>{o&&e.onMount?.(o),t&&(o?t.mount(o):t.unmount());const r=s.current;if(typeof r=="function")if(o){const a=r(o);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o)},[t])}const Ya=f.createContext({});function Ct(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xh(e,t,n,s,i,o){const{visualElement:r}=f.useContext(Xn),a=f.useContext(Wa),c=f.useContext(Hn),u=f.useContext(Mi),d=u.reducedMotion,l=u.skipAnimations,h=f.useRef(null),p=f.useRef(!1);s=s||a.renderer,!h.current&&s&&(h.current=s(e,{visualState:t,parent:r,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:l,isSVG:o}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,w=f.useContext(Ya);g&&!g.projection&&i&&(g.type==="html"||g.type==="svg")&&Gh(h.current,n,i,w);const T=f.useRef(!1);f.useInsertionEffect(()=>{g&&T.current&&g.update(n,c)});const v=n[ia],A=f.useRef(!!v&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return bo(()=>{p.current=!0,g&&(T.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),A.current&&g.animationState&&g.animationState.animateChanges())}),f.useEffect(()=>{g&&(!A.current&&g.animationState&&g.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),A.current=!1),g.enteringChildren=void 0)}),g}function Gh(e,t,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Qa(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&Ct(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:d,layoutScroll:c,layoutRoot:u})}function Qa(e){if(e)return e.options.allowProjection!==!1?e.projection:Qa(e.parent)}function ds(e,{forwardMotionProps:t=!1,type:n}={},s,i){s&&kh(s);const o=n?n==="svg":Ii(e),r=o?Hh:Wh;function a(u,d){let l;const h={...f.useContext(Mi),...u,layoutId:Yh(u)},{isStatic:p}=h,g=_h(u),w=r(u,p);if(!p&&vo){Qh();const T=Zh(h);l=T.MeasureLayout,g.visualElement=Xh(e,w,h,i,T.ProjectionNode,o)}return m.jsxs(Xn.Provider,{value:g,children:[l&&g.visualElement?m.jsx(l,{visualElement:g.visualElement,...h}):null,$h(e,u,Kh(w,g.visualElement,d),w,p,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=f.forwardRef(a);return c[qh]=e,c}function Yh({layoutId:e}){const t=f.useContext(ni).id;return t&&e!==void 0?t+"-"+e:e}function Qh(e,t){f.useContext(Wa).strict}function Zh(e){const t=Ha(),{drag:n,layout:s}=t;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(e)||s?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Jh(e,t){if(typeof Proxy>"u")return ds;const n=new Map,s=(o,r)=>ds(o,r,e,t),i=(o,r)=>s(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,ds(r,void 0,e,t)),n.get(r))})}const ef=(e,t)=>t.isSVG??Ii(e)?new Md(t):new Ad(t,{allowProjection:e!==f.Fragment});class tf extends ut{constructor(t){super(t),t.animationState||(t.animationState=jd(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();qn(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let nf=0;class sf extends ut{constructor(){super(...arguments),this.id=nf++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const rf={animation:{Feature:tf},exit:{Feature:sf}};function pn(e){return{point:{x:e.pageX,y:e.pageY}}}const of=e=>t=>Ai(t)&&e(t,pn(t));function nn(e,t,n,s){return ln(e,t,of(n),s)}const Za=({current:e})=>e?e.ownerDocument.defaultView:null,qr=(e,t)=>Math.abs(e-t);function af(e,t){const n=qr(e.x,t.x),s=qr(e.y,t.y);return Math.sqrt(n**2+s**2)}const Kr=new Set(["auto","scroll"]);class Ja{constructor(t,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=fs(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,w=af(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!w)return;const{point:T}=p,{timestamp:v}=ge;this.history.push({...T,timestamp:v});const{onStart:A,onMove:y}=this.handlers;g||(A&&A(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=hs(g,this.transformPagePoint),Z.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:w,onSessionEnd:T,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=fs(p.type==="pointercancel"?this.lastMoveEventInfo:hs(g,this.transformPagePoint),this.history);this.startEvent&&w&&w(p,A),T&&T(p,A)},!Ai(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const c=pn(t),u=hs(c,this.transformPagePoint),{point:d}=u,{timestamp:l}=ge;this.history=[{...d,timestamp:l}];const{onSessionStart:h}=n;h&&h(t,fs(u,this.history)),this.removeListeners=dn(nn(this.contextWindow,"pointermove",this.handlePointerMove),nn(this.contextWindow,"pointerup",this.handlePointerUp),nn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const s=getComputedStyle(n);(Kr.has(s.overflowX)||Kr.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const s=t===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,i),Z.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ot(this.updatePoint)}}function hs(e,t){return t?{point:t(e.point)}:e}function Xr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fs({point:e},t){return{point:e,delta:Xr(e,el(t)),offset:Xr(e,lf(t)),velocity:cf(t,.1)}}function lf(e){return e[0]}function el(e){return e[e.length-1]}function cf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=el(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>Ue(t)));)n--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&i.timestamp-s.timestamp>Ue(t)*2&&(s=e[1]);const o=je(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function uf(e,{min:t,max:n},s){return t!==void 0&&en&&(e=s?ne(n,e,s.max):Math.min(e,n)),e}function Gr(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function df(e,{top:t,left:n,bottom:s,right:i}){return{x:Gr(e.x,n,i),y:Gr(e.y,t,s)}}function Yr(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.mins?n=sn(t.min,t.max-s,e.min):s>i&&(n=sn(e.min,e.max-i,t.min)),Ye(0,1,n)}function pf(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Xs=.35;function mf(e=Xs){return e===!1?e=0:e===!0&&(e=Xs),{x:Qr(e,"left","right"),y:Qr(e,"top","bottom")}}function Qr(e,t,n){return{min:Zr(e,t),max:Zr(e,n)}}function Zr(e,t){return typeof e=="number"?e:e[t]||0}const gf=new WeakMap;class yf{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=l=>{n&&this.snapToCursor(pn(l).point),this.stopAnimation()},r=(l,h)=>{const{drag:p,dragPropagation:g,onDragStart:w}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Wu(p),!this.openDragLock))return;this.latestPointerEvent=l,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ke(v=>{let A=this.getAxisMotionValue(v).get()||0;if(Xe.test(A)){const{projection:y}=this.visualElement;if(y&&y.layout){const b=y.layout.layoutBox[v];b&&(A=Ce(b)*(parseFloat(A)/100))}}this.originPoint[v]=A}),w&&Z.update(()=>w(l,h),!1,!0),Bs(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},a=(l,h)=>{this.latestPointerEvent=l,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:w,onDrag:T}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=h;if(g&&this.currentDirection===null){this.currentDirection=bf(v),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",h.point,v),this.updateAxis("y",h.point,v),this.visualElement.render(),T&&Z.update(()=>T(l,h),!1,!0)},c=(l,h)=>{this.latestPointerEvent=l,this.latestPanInfo=h,this.stop(l,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:l}=this.getProps();(l||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Ja(t,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:s,contextWindow:Za(this.visualElement),element:this.visualElement.current})}stop(t,n){const s=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&Z.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,s){const{drag:i}=this.getProps();if(!s||!Sn(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(r=uf(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Ct(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=df(s.layoutBox,t):this.constraints=!1,this.elastic=mf(n),i!==this.constraints&&!Ct(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&Ke(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=pf(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ct(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=bd(s,i.root,this.visualElement.getTransformPagePoint());let r=hf(i.layout.layoutBox,o);if(n){const a=n(gd(r));this.hasMutatedConstraints=!!a,a&&(r=wa(a))}return r}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Ke(d=>{if(!Sn(d,n,this.currentDirection))return;let l=c&&c[d]||{};r&&(l={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:s?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return Bs(this.visualElement,t),s.start(xi(t,s,0,n,this.visualElement,!1))}stopAnimation(){Ke(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Ke(n=>{const{drag:s}=this.getProps();if(!Sn(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],c=o.get()||0;o.set(t[n]-ne(r,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Ct(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ke(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const c=a.get();i[r]=ff({min:c,max:c},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ke(r=>{if(!Sn(r,t,null))return;const a=this.getAxisMotionValue(r),{min:c,max:u}=this.constraints[r];a.set(ne(c,u,i[r]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gf.set(this.visualElement,this);const t=this.visualElement.current,n=nn(t,"pointerdown",u=>{const{drag:d,dragListener:l=!0}=this.getProps(),h=u.target,p=h!==t&&Yu(h);d&&l&&!p&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();Ct(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=vf(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,r=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Z.read(i);const a=ln(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Ke(l=>{const h=this.getAxisMotionValue(l);h&&(this.originPoint[l]+=u[l].translate,h.set(h.get()+u[l].translate))}),this.visualElement.render())}));return()=>{a(),n(),r(),c&&c(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Xs,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Jr(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function vf(e,t,n){const s=or(e,Jr(n)),i=or(t,Jr(n));return()=>{s(),i()}}function Sn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bf(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class xf extends ut{constructor(t){super(t),this.removeGroupControls=Ne,this.removeListeners=Ne,this.controls=new yf(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ne}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ps=e=>(t,n)=>{e&&Z.update(()=>e(t,n),!1,!0)};class wf extends ut{constructor(){super(...arguments),this.removePointerDownListener=Ne}onPointerDown(t){this.session=new Ja(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Za(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:ps(t),onStart:ps(n),onMove:ps(s),onEnd:(o,r)=>{delete this.session,i&&Z.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=nn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ms=!1;class Sf extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),ms&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),In.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,t.layoutDependency!==n&&r.setOptions({...r.options,layoutDependency:n}),ms=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||Z.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Pi.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=t;ms=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function tl(e){const[t,n]=Ua(),s=f.useContext(ni);return m.jsx(Sf,{...e,layoutGroup:s,switchLayoutGroup:f.useContext(Ya),isPresent:t,safeToRemove:n})}const Tf={pan:{Feature:wf},drag:{Feature:xf,ProjectionNode:za,MeasureLayout:tl}};function eo(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&Z.postRender(()=>o(t,pn(t)))}class Pf extends ut{mount(){const{current:t}=this.node;t&&(this.unmount=qu(t,(n,s)=>(eo(this.node,s,"Start"),i=>eo(this.node,i,"End"))))}unmount(){}}class Af extends ut{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dn(ln(this.node.current,"focus",()=>this.onFocus()),ln(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function to(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&Z.postRender(()=>o(t,pn(t)))}class Ef extends ut{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Zu(t,(i,o)=>(to(this.node,o,"Start"),(r,{success:a})=>to(this.node,r,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const Gs=new WeakMap,gs=new WeakMap,Cf=e=>{const t=Gs.get(e.target);t&&t(e)},Df=e=>{e.forEach(Cf)};function Rf({root:e,...t}){const n=e||document;gs.has(n)||gs.set(n,{});const s=gs.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(Df,{root:e,...t})),s[i]}function kf(e,t,n){const s=Rf(t);return Gs.set(e,n),s.observe(e),()=>{Gs.delete(e),s.unobserve(e)}}const Mf={some:0,all:1};class Lf extends ut{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=t,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Mf[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:l}=this.node.getProps(),h=u?d:l;h&&h(c)};return kf(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(If(t,n))&&this.startObserver()}unmount(){}}function If({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Vf={inView:{Feature:Lf},tap:{Feature:Ef},focus:{Feature:Af},hover:{Feature:Pf}},_f={layout:{ProjectionNode:za,MeasureLayout:tl}},jf={...rf,...Vf,...Tf,..._f},Vn=Jh(jf,ef);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Of=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase()),no=e=>{const t=Of(e);return t.charAt(0).toUpperCase()+t.slice(1)},nl=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Ff={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bf=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:r,...a},c)=>f.createElement("svg",{ref:c,...Ff,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:nl("lucide",i),...a},[...r.map(([u,d])=>f.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dt=(e,t)=>{const n=f.forwardRef(({className:s,...i},o)=>f.createElement(Bf,{ref:o,iconNode:t,className:nl(`lucide-${Nf(no(e))}`,`lucide-${e}`,s),...i}));return n.displayName=no(e),n};/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $f=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zf=dt("arrow-right",$f);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uf=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Wf=dt("bot",Uf);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hf=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],qf=dt("calculator",Hf);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kf=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Xf=dt("crown",Kf);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gf=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],Yf=dt("flame",Gf);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qf=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Zf=dt("menu",Qf);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jf=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ep=dt("triangle-alert",Jf);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tp=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],np=dt("zap",tp),Qt=({message:e="Loading MathPulse AI..."})=>{const[t,n]=f.useState(!1),s={position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",padding:"1rem",background:"#f7f9fc"},i={width:"min(100%, 24rem)",padding:"2rem",borderRadius:"2rem",border:"1px solid #dde3eb",background:"#ffffff",boxShadow:"0 24px 40px rgba(56, 189, 248, 0.12)",display:"flex",flexDirection:"column",alignItems:"center",gap:"1.5rem"},o={width:"6rem",height:"6rem",borderRadius:"1.5rem",border:"2px solid #ffffff",background:"linear-gradient(135deg, #e0f2fe 0%, #e0e7ff 100%)",boxShadow:"0 12px 24px rgba(15, 23, 42, 0.12)",display:"flex",alignItems:"center",justifyContent:"center"},r={width:"4rem",height:"4rem",objectFit:"contain",filter:"drop-shadow(0 8px 12px rgba(15, 23, 42, 0.2))"},a={marginTop:"0.5rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"0.5rem"},c={width:"1rem",height:"1rem",borderRadius:"999px",border:"2px solid #0284c7",borderTopColor:"transparent"},u={margin:0,fontSize:"1.25rem",fontWeight:700,color:"#0a1628"},d={margin:0,fontSize:"0.875rem",fontWeight:600,color:"#64748b"};return m.jsx("div",{className:"app-loader-screen",style:s,role:"status","aria-live":"polite","aria-busy":"true","aria-label":e,children:m.jsxs(Vn.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.4,ease:"easeOut"},className:"app-loader-card",style:i,children:[m.jsxs(Vn.div,{animate:{y:[0,-10,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"app-loader-avatar-shell",style:o,children:[m.jsx("img",{src:"/avatar/avatar_icon.png",alt:"Loading...",className:"app-loader-avatar",style:{...r,display:t?"none":"block"},onError:()=>{n(!0)}}),m.jsx(Wf,{className:"app-loader-bot-icon",style:{display:t?"block":"none"}})]}),m.jsxs("div",{className:"app-loader-copy",children:[m.jsx("h2",{className:"app-loader-title",style:u,children:"MathPulse AI"}),m.jsxs("div",{className:"app-loader-message-row",style:a,children:[m.jsx(Vn.div,{animate:{rotate:360},transition:{duration:1.5,repeat:1/0,ease:"linear"},className:"app-loader-spinner",style:c}),m.jsx("p",{className:"app-loader-message",style:d,children:e})]})]})]})})},sp=e=>{if(!e||e.includes("your_project")||e.includes("your_database")||e.includes("your_"))return!1;try{const t=new URL(e);return t.protocol!=="https:"?!1:t.hostname.endsWith(".firebaseio.com")||t.hostname.endsWith(".firebasedatabase.app")}catch{return!1}},Ys="".trim(),cn=sp(Ys)?Ys:"";Ys&&!cn&&console.warn("[FIREBASE] VITE_FIREBASE_DATABASE_URL is set but invalid. Expected an https URL ending in .firebaseio.com or .firebasedatabase.app. RTDB presence is disabled.");const Vt={apiKey:"AIzaSyBtKDbf3CoNSJHMX2W-Bfru8qEX2mKm03Y",authDomain:"mathpulse-ai-2026.firebaseapp.com",projectId:"mathpulse-ai-2026",storageBucket:"mathpulse-ai-2026.firebasestorage.app",messagingSenderId:"441656461",appId:"1:441656461:web:68f877c7bdde7065ec2ec4",measurementId:void 0,...cn?{databaseURL:cn}:{}};Vt.apiKey||console.error("[ERROR] Firebase API key is missing! Copy .env.example to .env.local and fill in your values.");console.log("[FIREBASE] Config:",{projectId:Vt.projectId,authDomain:Vt.authDomain,configured:!!Vt.apiKey});const Bt=kl(Vt),lt=wl(Bt),H=Vl(Bt);Ol(Bt);const ip=Ml(Bt),rp="".toLowerCase()==="true";if(rp){const e="127.0.0.1".trim()||"127.0.0.1",t=5001,n=Number.isFinite(t)&&t>0?Math.floor(t):5001;Ll(ip,e,n),console.log(`[FIREBASE] Functions emulator enabled at ${e}:${n}`)}const fg=cn?Il(Bt,cn):null;typeof window<"u"&&Vt.measurementId&&Fl(Bt);new Sl;const Qs="mathpulse.pendingAuthRole",sl="mathpulse.lastAuthRole",op=e=>{if(e==="admin")throw new Error("Admin account creation is restricted. Please contact an existing administrator.")},pg=e=>{try{localStorage.setItem(Qs,e),localStorage.setItem(sl,e)}catch{}},ap=()=>{try{const e=localStorage.getItem(Qs);return localStorage.removeItem(Qs),e==="student"||e==="teacher"||e==="admin"?e:null}catch{return null}},lp=()=>{try{const e=localStorage.getItem(sl);return e==="student"||e==="teacher"||e==="admin"?e:null}catch{return null}},mg=async(e,t,n,s,i={})=>{try{op(s);const r=(await Tl(lt,e,t)).user;return await Pl(r,{displayName:n}),await il(r,s,i)}catch(o){const r=o;throw console.error("[ERROR] Error signing up:",{code:r.code,message:r.message,fullError:o}),new Error(r.message||"Failed to create account")}},gg=async(e,t)=>{try{console.log("[AUTH] Attempting sign in...",{email:e}),await Al(lt,e,t),console.log("[OK] Sign in successful, AuthContext will handle profile creation")}catch(n){const s=n;throw console.error("[ERROR] Error signing in:",{code:s.code,message:s.message,fullError:n}),new Error(s.message||"Failed to sign in")}},cp=async()=>{try{await El(lt)}catch(e){throw console.error("Error signing out:",e),new Error(e instanceof Error?e.message:"Failed to sign out")}},il=async(e,t,n)=>{const s=`${Date.now()}`.slice(-12).padStart(12,"0"),i={uid:e.uid,email:e.email||"",name:e.displayName||n.name||"User",role:t,photo:e.photoURL||"",createdAt:oe(),updatedAt:oe()},o=(()=>{switch(t){case"student":return{lrn:n.lrn||s,grade:n.grade||"Grade 11",section:n.section||"Section A",classSectionId:n.classSectionId||"",adviserTeacherId:n.adviserTeacherId||"",adviserTeacherName:n.adviserTeacherName||"",schoolYear:n.schoolYear||"",school:n.school||"",enrollmentDate:new Date().toISOString().split("T")[0],major:n.major||"General",gpa:n.gpa||"0.00",level:1,currentXP:0,totalXP:0,streak:0,atRiskSubjects:[],hasTakenDiagnostic:!1,iarAssessmentState:"not_started",startingQuarterG11:"Q1",recommendedPace:"normal"};case"teacher":return{teacherId:`TCH-${Date.now()}`,department:n.department||"Mathematics",subject:n.subject||"Mathematics",yearsOfExperience:n.yearsOfExperience||"0",qualification:n.qualification||"",students:[]};case"admin":return{adminId:`ADM-${Date.now()}`,position:n.position||"Administrator",department:n.department||"System"}}})(),r={...i,...o};return await Oe(J(H,"users",e.uid),r),r},Zs=async e=>{try{const t=J(H,"users",e),n=await xe(t);return n.exists()?{...n.data(),uid:n.id}:null}catch(t){return console.error("Error getting user profile:",t),null}},ys=async(e,t)=>{try{const n=await Zs(e);if(!n)throw new Error("Profile not found");const s=["name","email","phone","photo","avatarLayers"],i={student:["lrn","grade","section","school","enrollmentDate","major","gpa"],teacher:["department","subject","yearsOfExperience","qualification"],admin:["department","position"]},o=new Set([...s,...i[n.role]]),r={};Object.entries(t).forEach(([c,u])=>{u!==void 0&&o.has(c)&&(r[c]=u)});const a=J(H,"users",e);await Oe(a,{...r,updatedAt:oe()},{merge:!0})}catch(n){throw console.error("Error updating user profile:",n),n}},up=async e=>{if(!lt.currentUser)throw new Error("No user logged in");await Dl(lt.currentUser,e)},dp=async e=>{if(!lt.currentUser)throw new Error("No user logged in");await Cl(lt.currentUser);try{await _l(J(H,"users",e))}catch(t){console.warn("User auth deleted but profile document cleanup failed:",t)}},rl=f.createContext({currentUser:null,userProfile:null,loading:!0,isLoggedIn:!1,userRole:"student",refreshProfile:async()=>{}}),ol=()=>{const e=f.useContext(rl);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},hp=({children:e})=>{const[t,n]=f.useState(null),[s,i]=f.useState(null),[o,r]=f.useState(!0),[a,c]=f.useState("student"),u=h=>{if(!h)return null;const p=h.trim().toLowerCase();return p==="testteacher@school.edu"?"teacher":p==="testadmin@school.edu"?"admin":p==="teststudent@school.edu"?"student":null};f.useEffect(()=>Rl(lt,async p=>{if(r(!0),n(p),p){const g=ap()||lp()||u(p.email)||"student",w=g==="admin"?"student":g;let T=await Zs(p.uid);if(!T&&p.email){console.log("[WARN] AuthContext: Profile missing, auto-creating...");const v=w,A=p.displayName||"User";try{T=await il(p,v,{name:A}),console.log("[OK] AuthContext: Profile auto-created:",{role:v,name:A}),v==="student"&&W(async()=>{const{triggerStudentEnrolled:y}=await import("./automationService-DNyauqGd.js");return{triggerStudentEnrolled:y}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({triggerStudentEnrolled:y})=>y({lrn:T?.lrn||p.uid,name:A,email:p.email||"",gradeLevel:""})).catch(y=>console.error("[WARN] Automation: enrollment pipeline failed:",y))}catch(y){console.error("[ERROR] AuthContext: Failed to auto-create profile:",y)}}T?(c(T.role),i(T)):(c(w),i({uid:p.uid,email:p.email||"",name:p.displayName||"User",role:w,photo:p.photoURL||"",createdAt:new Date,updatedAt:new Date}))}else c("student"),i(null);r(!1)}),[]);const d=async()=>{if(t){const h=await Zs(t.uid);h&&i(h)}},l={currentUser:t,userProfile:s,loading:o,isLoggedIn:!!t,userRole:s?.role||a,refreshProfile:d};return m.jsx(rl.Provider,{value:l,children:e})},fp=/(```[\s\S]*?```|`[^`\n]+`)/g,pp=/(\$\$[\s\S]*?\$\$|\$[^$\n]+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\])/g,mp=/\\(?:boxed\{[^{}]+\}|frac\{[^{}]+\}\{[^{}]+\}|sqrt\{[^{}]+\}|(?:cdot|times|pm|mp|leq|geq|neq|approx|alpha|beta|gamma|delta|theta|pi|sum|int)(?:_[a-zA-Z0-9]+|_\{[^{}]+\})?(?:\^[a-zA-Z0-9]+|\^\{[^{}]+\})?)/g,gp=/<\s*think\b[^>]*>[\s\S]*?<\s*\/\s*think\s*>/gi,yp=/<\s*\/?\s*think\b[^>]*>/gi,vp=/<\s*\/\s*think\s*>/gi,bp=/<\s*(\/?)\s*think\b([\s\S]*?)>/gi,xp=/(?:<\s*\/?\s*t(?:h(?:i(?:n(?:k)?)?)?)?)\s*$/i,wp=/(?:<\s*\/?\s*t(?:h(?:i(?:n(?:k)?)?)?)?)\s*$/i,Sp=/\bfinal\s+answer\s*:|(?:^|\n)\s*#{1,6}\s+\S|(?:^|\n)\s*(?:answer|solution)\s*:|(?:^|\n)\s*here(?:'s| is)\b|(?:^|\n)\s*(?:\d+[.)]|[-*])\s+\S/i,Tp=/^\s*(?:okay|alright|let\s+me|i\s+should|i\s+need\s+to|i\s+will|wait|hmm|maybe|the\s+user\s+asked|let\s+us|let's)\b/i;function al(e){return e.replace(bp,(t,n,s)=>`<${n?"/":""}think${s}>`)}function Pp(e,t){t.lastIndex=0;let n=-1,s=t.exec(e);for(;s;)n=s.index+s[0].length,s=t.exec(e);return n}function Ap(e){const t=al(e);if(/<\s*think\b/i.test(t))return"";const n=Pp(t,vp);return n===-1?"":t.slice(n).trim()}function Ep(e){const t=e.replace(/\r\n?/g,` -`).trim();if(!t)return"";const n=Sp.exec(t);return n&&typeof n.index=="number"?t.slice(n.index).trim():t.split(` -`).map(o=>o.trim()).filter(o=>o&&Tp.test(o)).length>=2?"":t}function Js(e,t={}){if(!e||typeof e!="string")return"";let n=al(e),s="";for(;n!==s;)s=n,n=n.replace(gp,"");if(!t.preserveUnclosedThinkBlocks){const i=n.toLowerCase(),o=i.lastIndexOf("");o!==-1&&o>r&&(n=n.slice(0,o))}return n=n.replace(yp,""),t.streamingSafeTail&&(n=n.replace(xp,"").replace(wp,"")),n}function Cp(e){return Js(e,{streamingSafeTail:!0}).trim()}function _e(e){const t=Ap(e);if(t)return t;const n=Js(e,{streamingSafeTail:!0}).trim();if(n)return n;const s=Js(e,{streamingSafeTail:!0,preserveUnclosedThinkBlocks:!0}).trim();return Ep(s)}function Dp(e){return e.replace(mp,t=>`$${t}$`)}function Rp(e){return!e||typeof e!="string"?"":_e(e).replace(/\r\n?/g,` -`).split(fp).map((i,o)=>o%2===1?i:i.replace(/\\\\(?=(?:boxed|frac|sqrt|cdot|times|pm|mp|leq|geq|neq|approx|alpha|beta|gamma|delta|theta|pi|sum|int)\b|[()[\]{}])/g,"\\").replace(/\\n/g,` -`).split(pp).map((c,u)=>u%2===1?c:Dp(c)).join("")).join("")}const kp=80;function vs(e,t=kp){if(!e||typeof e!="string")return"";const n=Rp(e).replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/```(?:[a-zA-Z0-9_-]+\n)?([\s\S]*?)```/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\$\$([\s\S]+?)\$\$/g,"$1").replace(/\$([^$\n]+)\$/g,"$1").replace(/\\\(([\s\S]+?)\\\)/g,"$1").replace(/\\\[([\s\S]+?)\\\]/g,"$1").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm,"").replace(/^\s{0,3}(?:[-*_]\s?){3,}$/gm," ").replace(/\\boxed\{([^{}]+)\}/g,"$1").replace(/\\frac\{([^{}]+)\}\{([^{}]+)\}/g,"$1/$2").replace(/\\sqrt\{([^{}]+)\}/g,"sqrt($1)").replace(/\\(?:cdot|times)/g,"*").replace(/\\(alpha|beta|gamma|delta|theta|pi|sum|int|pm|mp|leq|geq|neq|approx)\b/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1").replace(/~~([^~]+)~~/g,"$1").replace(/\*{2,}|_{2,}|~{2,}/g,"").replace(/`+/g,"").replace(/\|/g," ").replace(/\s+/g," ").trim();return n.length<=t?n:n.slice(0,t)}const Mp=/^\s*(?:hi|hello|hey|good\s+(?:morning|afternoon|evening))\b/i,Lp=/\b(?:thanks|thank\s+you|thank\s+u|ty)\b/i,ll=["Hi! I am MathPulse, your math tutor. I can help with algebra, geometry, calculus, and more. What math question would you like to try?","Hello! Great to see you. I am here for math topics and step-by-step solutions whenever you are ready."],cl=["You are very welcome. If you want, send another math question and we can work through it together.","Glad I could help. I am here anytime you want to practice more math."],so=["That topic is outside my math scope, but I would be happy to help with mathematics like algebra, calculus, geometry, trigonometry, or statistics.","I focus on math-only support, so I may not be the best for that request. Share a math question and I will guide you step by step.","I am built for math tutoring, so I can best help with mathematical problems and explanations. If you want, ask me any math question next."],Ip=["math","mathematics","algebra","geometry","trigonometry","calculus","statistics","probability","arithmetic","equation","inequality","function","graph","slope","derivative","integral","limit","matrix","determinant","fraction","percentage","ratio","polynomial","quadratic","logarithm","exponent","angle","triangle","circle","perimeter","area","volume","mean","median","mode","standard deviation","solve","simplify","factor","evaluate","compute","calculate"],Vp=[/\d+\s*[%+\-*/^=]\s*[-+]?\d*/,/\b(?:sin|cos|tan|cot|sec|csc|log|ln|sqrt)\s*\(?/,/\b(?:differentiate|integrate|derive|proof|prove)\b/,/\b(?:x|y|z)\s*[=+\-*/^]\s*[-+]?\d/],_p=new Set(["go","continue","yes","ok","next","more"]),jp=[/\bshall\s+we\s+continue\b/i,/\b(?:would|do)\s+you\s+like\s+to\s+continue\b/i,/\b(?:want|need)\s+me\s+to\s+continue\b/i,/\bshould\s+(?:i|we)\s+continue\b/i,/\bcontinue\s*\?\s*$/i,/\b(?:ready\s+for|go\s+to)\s+the\s+next\s+step\b/i,/\bnext\s+step(?:s)?\s*\?\s*$/i,/\bkeep\s+going\s*\?\s*$/i],io="I can continue once I know which math problem you mean. Please share the problem again or tell me which step to continue.";function Tn(e){return e.length===0?"":e[Math.floor(Math.random()*e.length)]??e[0]}function Np(e){const t=(e??"").trim().toLowerCase();return t?Ip.some(n=>t.includes(n))?!0:Vp.some(n=>n.test(t)):!1}function Op(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").replace(/[\p{P}]+$/gu,"")}function ul(e){const t=Op(e);return t?_p.has(t):!1}function ro(e){const t=(e??"").trim();return t?Np(t)?null:Mp.test(t)?Tn(ll):Lp.test(t)?Tn(cl):Tn(so):Tn(so)}function Fp(e){const t=(e?.latestAssistantMessage??"").trim();if(t)return t;const n=e?.history??[];for(let s=n.length-1;s>=0;s-=1){const i=n[s],o=(i?.role??"").toLowerCase(),r=(i?.content??"").trim();if(r&&(o==="assistant"||o==="ai"))return r}return null}function Bp(e){const t=Fp(e);return t?jp.some(n=>n.test(t)):!1}function $p(e){const t=e?.history??[];for(let n=t.length-1;n>=0;n-=1){const s=t[n],i=(s?.role??"").toLowerCase(),o=(s?.content??"").trim();if(o&&i==="user"&&!ul(o))return o}return null}function zp(e){return ll.includes(e)||cl.includes(e)}function dl(e,t){const n=ro(e);if(n===null)return null;if(!ul(e))return n;if(Bp(t))return null;const s=$p(t);if(!s)return io;const i=ro(s);return i===null?null:zp(i)?io:i}const hl=f.createContext(void 0);let bs=null,xs=null;const oo=()=>(bs||(bs=W(()=>import("./apiService-axx1LHMk.js"),__vite__mapDeps([7,3,4,2,1,5,6]))),bs),mt=()=>(xs||(xs=W(()=>import("./chatService-LsXGqjoV.js"),__vite__mapDeps([8,1,2,3,4,5,6]))),xs),Up=new Set(["go","continue","next","more","yes","ok"]),Wp=[/\b(?:end|finish|stop)\s+with(?:\s+the\s+(?:exact\s+)?(?:marker|text))?\s*[:\-]?\s*(["'`]?)([A-Za-z0-9_:\-]{2,96})\1/i,/\b(?:include|append)\s+(?:the\s+)?marker\s*[:\-]?\s*(["'`]?)([A-Za-z0-9_:\-]{2,96})\1/i];function mn(e){if(!e)return null;let t=e.trim();return!t||(t.length>=2&&t[0]===t[t.length-1]&&['"',"'","`"].includes(t[0])&&(t=t.slice(1,-1).trim()),t=t.replace(/[.,;\s]+$/g,""),!t)?null:t.slice(0,120)}function Hp(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").replace(/[\p{P}]+$/gu,"")}function fl(e){const t=Hp(e);return t?Up.has(t):!1}function qp(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.role!=="user")continue;const s=(n.content??"").trim();if(s&&!fl(s))return s}return null}function Kp(e){return["Continue the ongoing math explanation for the same user request.","Do not refuse or reset the topic if the request is mathematical.","Original user request:",e].join(` -`)}function Xp(e){const t=(e??"").trim();if(!t)return null;for(const n of Wp){const s=n.exec(t);if(!s)continue;const i=mn(s[2]);if(i)return i}return null}function Gp(e,t){const n=mn(t);return n?e.toLowerCase().includes(n.toLowerCase()):!1}function ei(e,t,n,s){return n&&!Gp(t,n)?!0:s?Qp(e,t):!1}function Yp(e){const t=e.trim();if(!t||[/```[^`]*$/,/\$\$[^$]*$/,/\$[^$\n]*$/,/\\\[[^\]]*$/,/\\\([^\)]*$/,/\\boxed\{[^}]*$/,/\\frac\{[^}]*\}\{?$/,/\\[a-zA-Z]+\s*$/,/(?:Step\s*\d+[:.]?)\s*$/i,/(?:Final\s*Answer[:.]?)\s*$/i].some(h=>h.test(t))||(t.match(/```/g)??[]).length%2!==0||(()=>{let h=0;for(let p=0;p=0&&t[w]==="\\";w-=1)g+=1;g%2===0&&(h+=1)}return h})()%2!==0)return!0;const o=(t.match(/\\left\b/g)??[]).length,r=(t.match(/\\right\b/g)??[]).length;if(o!==r)return!0;const a=[["(",")"],["[","]"],["{","}"]];for(const[h,p]of a){const g=(t.match(new RegExp(`\\${h}`,"g"))??[]).length,w=(t.match(new RegExp(`\\${p}`,"g"))??[]).length;if(g>w)return!0}if(t.length>=80&&/\b(?:and|or|but|because|since|so|then|which|that|where|when|with|for|to|from|of|in|on|at|by)\s*$/i.test(t))return!0;const c=t.split(/\r?\n/).map(h=>h.trim()).filter(Boolean),u=c.length>0?c[c.length-1]:t,d=/[.!?)]$/.test(u),l=/(?:=|\\boxed|\\int|d\/dx|f\(x\)|x\^\d+|\b\d+(?:\.\d+)?\b)\s*$/.test(u);return t.length>=140&&!d&&!l}function Qp(e,t){const n=t.trim(),s=e.toLowerCase();if(!n||Yp(n))return!0;const i=n.replace(/[#*_`>|\-]/g," ").replace(/\s+/g," ").trim();if(!i||i.length<24&&/(derivative|integral|equation|complete|explain|step)/.test(s))return!0;if(s.includes("derivative")&&s.includes("integral")){const o=n.toLowerCase(),r=/derivative|f'|d\/dx/.test(o),a=/integral|∫|\\int/.test(o);if(!r||!a)return!0}return!!((s.includes("complete equation")||s.includes("complete equations")||s.includes("step-by-step")||s.includes("step by step"))&&((n.match(/=|\\frac|\\int|∫|\\boxed|d\/dx|\b(dx|x\^\d+)\b/g)??[]).length<2||n.length<120))}function Et(e){const t=e.split(/\n{2,}/).map(i=>i.trim()).filter(Boolean);if(t.length<=1)return e.trim();const n=new Set,s=[];for(const i of t){const o=i.toLowerCase().replace(/[#*_`]/g,"").replace(/\s+/g," ").trim();!o||n.has(o)||(n.add(o),s.push(i))}return s.join(` - -`).trim()}function Pn(e,t){const n=e.trim(),s=t.trim();if(!n)return Et(s);if(!s)return Et(n);const i=Math.min(n.length,s.length,220);for(let o=i;o>=24;o-=1){const r=n.slice(-o),a=s.slice(0,o);if(r===a)return Et(`${n}${s.slice(o)}`.trim())}return n.endsWith(s)?Et(n):s.startsWith(n)?Et(s):Et(`${n} - -${s}`.trim())}function ao(e,t,n){const s=["Continue the same solution from exactly where it stopped.","Do not restart. Do not repeat completed parts. Keep the same formatting style.","Finish all remaining steps and provide a complete final answer.","",`Question: ${e}`,"","Current partial answer:",t],i=mn(n);return i&&(s.push(""),s.push(`Include the exact marker "${i}" at the very end when done.`)),s.join(` -`)}function lo(e,t,n){const s=["Continue and complete the answer in plain text only.","No markdown, no LaTeX, no code fences. Do not restart.","",`Question: ${e}`,"","Current partial answer:",t],i=mn(n);return i&&(s.push(""),s.push(`End with the exact marker "${i}".`)),s.join(` -`)}function co(e,t){const n=["Provide a complete final tutoring answer for the student question below.","Do not include meta commentary, internal reasoning, or notes about instructions.","Cover every requested part explicitly and include final results.","",`Question: ${e}`],s=mn(t);return s&&(n.push(""),n.push(`Include the exact marker "${s}" once all requested parts are complete.`)),n.join(` -`)}function uo(e,t,n,s=null,i=!0){const o=t.trim(),r=n.trim();if(!r)return o;if(!o)return r;const a=ei(e,o,s,i),c=ei(e,r,s,i);return a!==c?c?o:r:r.length>=o.length+80?r:o}function Zp(e){const t=e.toLowerCase();return!["derivative","integral","equation","latex","step-by-step","step by step","formatting","proof","fraction","limit","matrix","sqrt","boxed","^","dx"].some(s=>t.includes(s))}function Jp(e){const n=e.toLowerCase().trim();return!n||/^(hi|hello|hey|yo|sup|good morning|good afternoon|good evening)\b/.test(n)||/^(thanks|thank you|thx|ty)\b/.test(n)||/^(bye|goodbye|see you|later)\b/.test(n)||n.includes("fun fact")&&!/(solve|deriv|integr|equation|step|proof|show work|explain)/.test(n)?!1:["derivative","integral","equation","step-by-step","step by step","solve","differentiat","integrat","limit","proof","find","compute","simplify","factor","evaluate","calculate","graph","matrix","probability","statistics","trigonometry","algebra","geometry","calculus","show work","explain","define","describe","how","why","what is"].some(s=>n.includes(s))}function An(e,t=[]){const n=dl(e,{history:t});if(n)return n;const s=e.toLowerCase().trim();if(/^(hi|hello|hey|good morning|good afternoon|good evening)\b/.test(s))return"Hello! I'm your MathPulse AI tutor. I can help you with algebra, calculus, geometry, statistics, and more. What math topic would you like to explore today?";if(s.includes("thank")||s.includes("thanks"))return"You're welcome! I'm always here to help with math. Feel free to ask about any topic — algebra, calculus, geometry, statistics, or anything else. Keep up the great work!";if(/^(bye|goodbye|see you|later)\b/.test(s))return"Goodbye! Come back anytime you need math help. Happy studying!";const i=s.match(/(?:what(?:'s| is| are)|tell me (?:about|what)|explain|define|describe)\s+(.+)/);if(i){const o=i[1].replace(/[?.!]+$/,"").trim();return/\balgebra\b/.test(o)?`## What is Algebra? - -Algebra is a branch of mathematics that uses **letters and symbols** (like *x*, *y*, *a*, *b*) to represent numbers and quantities in equations and formulas. - -### Key concepts: -- **Variables** — symbols that stand for unknown values -- **Expressions** — combinations of numbers, variables, and operations (e.g., \`3x + 5\`) -- **Equations** — statements that two expressions are equal (e.g., \`2x + 3 = 11\`) -- **Functions** — rules that assign each input exactly one output - -### Why it matters: -Algebra is the foundation for almost all higher mathematics, including calculus, statistics, and physics. It teaches you to think abstractly and solve problems systematically. - -### Quick example: -Solve \`2x + 3 = 11\` -1. Subtract 3 from both sides → \`2x = 8\` -2. Divide by 2 → \`x = 4\` - -Would you like to dive deeper into any specific area of algebra?`:/\bcalculus\b/.test(o)?`## What is Calculus? - -Calculus is the mathematical study of **continuous change**. It has two main branches: - -### 1. Differential Calculus -Studies **rates of change** and slopes of curves. -- *Core tool:* the **derivative** — measures how fast a function changes at any point -- *Example:* If position = t², then velocity = 2t - -### 2. Integral Calculus -Studies **accumulation** of quantities and areas under curves. -- *Core tool:* the **integral** — adds up infinitely many tiny pieces -- *Example:* Area under y = x from 0 to 3 = ∫₀³ x dx = 9/2 = 4.5 - -### Why it matters: -Calculus is used in physics, engineering, economics, biology, and virtually every science. It lets you model anything that changes continuously. - -Want to start with derivatives, integrals, or limits?`:/\bgeometry\b/.test(o)?`## What is Geometry? - -Geometry is the branch of mathematics that studies **shapes, sizes, positions, and properties** of figures and spaces. - -### Key areas: -- **Euclidean Geometry** — points, lines, angles, triangles, circles, polygons -- **Coordinate Geometry** — shapes on the x-y plane using algebra -- **Solid Geometry** — 3D shapes like spheres, cylinders, cones -- **Transformations** — rotations, reflections, translations, dilations - -### Fundamental concepts: -- **Angles** — measured in degrees or radians -- **Congruence & Similarity** — same shape/size vs. same shape/different size -- **Pythagorean Theorem** — a² + b² = c² for right triangles -- **Area & Volume formulas** for common shapes - -What geometry topic would you like to explore?`:/\btrigonometry|trig\b/.test(o)?`## What is Trigonometry? - -Trigonometry is the study of relationships between **angles and sides** of triangles. - -### The core functions (SOH-CAH-TOA): -- **sin(θ)** = Opposite / Hypotenuse -- **cos(θ)** = Adjacent / Hypotenuse -- **tan(θ)** = Opposite / Adjacent - -### Beyond triangles: -Trig functions describe **periodic phenomena** like sound waves, light, tides, and circular motion. - -### Key identities: -- sin²θ + cos²θ = 1 -- tan(θ) = sin(θ)/cos(θ) - -Trigonometry is essential for calculus, physics, and engineering. What trig topic would you like help with?`:/\bstatistic/.test(o)?`## What is Statistics? - -Statistics is the branch of mathematics that deals with **collecting, analyzing, interpreting, and presenting data**. - -### Key areas: -- **Descriptive Statistics** — summarizing data with measures like mean, median, mode, and standard deviation -- **Inferential Statistics** — drawing conclusions about populations from samples -- **Probability** — the mathematics of chance and uncertainty - -### Common measures: -| Measure | Purpose | -|---------|--------| -| Mean | Average of all values | -| Median | Middle value when sorted | -| Mode | Most frequent value | -| Std Dev | How spread out values are | - -Want help with a specific statistics concept?`:/\bderivative/.test(o)?`## What is a Derivative? - -A derivative measures the **instantaneous rate of change** of a function — essentially, how fast something is changing at a specific point. - -### Formal definition: -f'(x) = lim(h→0) [f(x+h) - f(x)] / h - -### Intuition: -- The derivative of **position** is **velocity** -- The derivative of **velocity** is **acceleration** -- Geometrically, it's the **slope of the tangent line** to the curve - -### Key rules: -- **Power Rule:** d/dx[xⁿ] = nxⁿ⁻¹ -- **Product Rule:** d/dx[fg] = f'g + fg' -- **Chain Rule:** d/dx[f(g(x))] = f'(g(x)) · g'(x) - -Would you like to practice finding derivatives?`:/\bintegral|integration/.test(o)?`## What is Integration? - -Integration is the process of finding the **accumulated total** of a quantity. It's the reverse of differentiation. - -### Two types: -1. **Indefinite Integral** — finds a family of antiderivatives: ∫f(x) dx = F(x) + C -2. **Definite Integral** — calculates the area under a curve: ∫ₐᵇ f(x) dx - -### Intuition: -- If a derivative tells you *how fast* something changes, an integral tells you *how much* it accumulates -- Area under a velocity-time graph = total distance traveled - -### Key rule: -**Power Rule:** ∫xⁿ dx = xⁿ⁺¹/(n+1) + C (n ≠ -1) - -Want to try some integration problems?`:/\blimit/.test(o)?`## What is a Limit? - -A limit describes the value a function **approaches** as the input approaches some value. - -### Notation: -lim(x→a) f(x) = L means "as x gets closer and closer to a, f(x) gets closer and closer to L." - -### Why it matters: -Limits are the **foundation of calculus** — both derivatives and integrals are defined using limits. - -### How to evaluate: -1. **Direct substitution** — plug in the value first -2. **Factor & cancel** — if you get 0/0 -3. **L'Hôpital's Rule** — for 0/0 or ∞/∞ forms - -### Example: -lim(x→2) (x²-4)/(x-2) = lim(x→2) (x+2)(x-2)/(x-2) = lim(x→2) (x+2) = **4** - -What limit problem are you working on?`:/\bfraction/.test(o)?`## What is a Fraction? - -A fraction represents a **part of a whole**. It's written as **a/b**, where: -- **a** = numerator (parts you have) -- **b** = denominator (total equal parts) - -### Operations: -- **Addition:** a/b + c/d = (ad + bc) / bd -- **Multiplication:** a/b × c/d = ac / bd -- **Division:** a/b ÷ c/d = a/b × d/c (flip and multiply) - -### Example: -3/4 + 2/3 = 9/12 + 8/12 = **17/12** - -What fraction problem can I help you with?`:/\bpercent/.test(o)?`## What is a Percentage? - -A percentage is a way of expressing a number as a **fraction of 100**. The symbol **%** means "per hundred." - -### Key formulas: -- Percentage = (Part / Whole) × 100 -- Part = (Percentage × Whole) / 100 -- % Change = ((New - Old) / Old) × 100 - -### Examples: -- 25% of 200 = (25 × 200) / 100 = **50** -- 15 is what % of 60? → (15/60) × 100 = **25%** - -Need help with a specific percentage problem?`:/\bpythag/.test(o)?`## What is the Pythagorean Theorem? - -The Pythagorean Theorem states that in a **right triangle**, the square of the hypotenuse equals the sum of the squares of the other two sides: - -### **a² + b² = c²** - -where *c* is the hypotenuse (longest side, opposite the right angle). - -### Example: -If a = 3 and b = 4: -- 3² + 4² = 9 + 16 = 25 -- c = √25 = **5** - -### Common Pythagorean Triples: -- (3, 4, 5) -- (5, 12, 13) -- (8, 15, 17) - -Need help with a specific problem?`:`That's a great question about **${o}**! I'm currently in offline mode with limited responses. Here's what I can help with right now: - -- **Algebra** — equations, variables, functions -- **Calculus** — derivatives, integrals, limits -- **Geometry** — shapes, areas, volumes -- **Trigonometry** — angles, sin/cos/tan -- **Statistics** — data analysis, probability -- **Arithmetic** — fractions, percentages, ratios - -Try asking "What is algebra?" or "How do I solve quadratic equations?" for a detailed explanation. - -*Tip: The AI tutor works best when the server is online for full, personalized answers.*`}if(/\bhow (?:do|can|to|would|should)\b/.test(s)||/\bsolve\b/.test(s)||/\bfind\b/.test(s)||/\bcalculate\b/.test(s)){if(s.includes("quadratic")||s.includes("ax")&&s.includes("bx"))return`## Solving Quadratic Equations - -A quadratic equation has the form **ax² + bx + c = 0**. - -### Method 1: Quadratic Formula -**x = (-b ± √(b² - 4ac)) / 2a** - -### Steps: -1. Identify a, b, and c from your equation -2. Calculate the discriminant: **b² - 4ac** -3. If discriminant > 0 → two real solutions -4. If discriminant = 0 → one real solution -5. If discriminant < 0 → no real solutions - -### Example: x² - 5x + 6 = 0 -- a=1, b=-5, c=6 -- Discriminant = 25 - 24 = 1 -- x = (5 ± 1) / 2 → **x = 3** or **x = 2** - -### Method 2: Factoring -x² - 5x + 6 = (x - 3)(x - 2) = 0 - -Want me to help solve a specific quadratic?`;if(s.includes("derivative")||s.includes("differentiat"))return`## How to Find Derivatives - -The derivative measures the rate of change of a function. - -### Key Rules: -| Rule | Formula | -|------|--------| -| Power | d/dx[xⁿ] = nxⁿ⁻¹ | -| Constant | d/dx[c] = 0 | -| Sum | d/dx[f+g] = f' + g' | -| Product | d/dx[fg] = f'g + fg' | -| Chain | d/dx[f(g(x))] = f'(g(x)) · g'(x) | - -### Common Derivatives: -- d/dx[sin(x)] = cos(x) -- d/dx[cos(x)] = -sin(x) -- d/dx[eˣ] = eˣ -- d/dx[ln(x)] = 1/x - -### Example: f(x) = 3x² + 2x - 5 -f'(x) = 6x + 2 - -What function would you like to differentiate?`;if(s.includes("integral")||s.includes("integrat"))return`## How to Integrate - -Integration is the reverse of differentiation. - -### Key Rules: -- **Power Rule:** ∫xⁿ dx = xⁿ⁺¹/(n+1) + C (n ≠ -1) -- ∫1/x dx = ln|x| + C -- ∫eˣ dx = eˣ + C -- ∫sin(x) dx = -cos(x) + C -- ∫cos(x) dx = sin(x) + C - -### Techniques: -1. **Substitution (u-sub)** — simplify by substituting a part of the expression -2. **Integration by parts** — ∫u dv = uv - ∫v du -3. **Partial fractions** — break rational functions into simpler pieces - -Want help with a specific integral?`;if(s.includes("equation")||s.includes("solve"))return`## How to Solve Equations - -### Linear Equations (ax + b = c): -1. Move constants to one side -2. Divide by the coefficient of x - -**Example:** 3x + 7 = 22 -- 3x = 22 - 7 = 15 -- x = 15/3 = **5** - -### Systems of Equations: -- **Substitution** — solve one equation for a variable, plug into the other -- **Elimination** — add/subtract equations to eliminate a variable -- **Graphing** — find the intersection point - -### Tips: -- Always check your answer by substituting back -- Whatever you do to one side, do to the other - -Share your equation and I'll help solve it step by step!`;if(s.includes("area")||s.includes("perimeter")||s.includes("volume"))return`## Geometry Formulas - -### 2D Shapes: -| Shape | Area | Perimeter | -|-------|------|----------| -| Rectangle | l × w | 2(l + w) | -| Triangle | ½ × b × h | a + b + c | -| Circle | πr² | 2πr | -| Trapezoid | ½(a+b) × h | sum of sides | - -### 3D Shapes: -| Shape | Volume | Surface Area | -|-------|--------|--------------| -| Sphere | (4/3)πr³ | 4πr² | -| Cylinder | πr²h | 2πr² + 2πrh | -| Cone | (1/3)πr²h | πr² + πrl | - -What geometry problem do you need help with?`;if(s.includes("graph")||s.includes("plot")||s.includes("slope"))return`## Graphing & Linear Functions - -### Slope-Intercept Form: y = mx + b -- **m** = slope (rise / run) -- **b** = y-intercept (where the line crosses the y-axis) - -### Finding Slope: -m = (y₂ - y₁) / (x₂ - x₁) - -### Example: -Through (1, 3) and (4, 9): -- m = (9-3)/(4-1) = 6/3 = 2 -- Plug into y = mx + b: 3 = 2(1) + b → b = 1 -- Equation: **y = 2x + 1** - -What would you like to graph or understand?`;if(s.includes("factor"))return`## How to Factor - -### Common Techniques: -1. **GCF (Greatest Common Factor):** Factor out the largest shared factor - - 6x² + 9x = **3x(2x + 3)** - -2. **Difference of Squares:** a² - b² = (a+b)(a-b) - - x² - 25 = **(x+5)(x-5)** - -3. **Trinomial Factoring:** x² + bx + c = (x + p)(x + q) where p·q = c and p+q = b - - x² + 5x + 6 = **(x+2)(x+3)** - -4. **Grouping:** For 4-term polynomials - -What expression would you like to factor?`}return s.includes("pythag")||s.includes("right")&&s.includes("triangle")?`## Pythagorean Theorem - -For a right triangle with legs a and b, and hypotenuse c: - -### **a² + b² = c²** - -**Example:** If a = 3, b = 4: -- 9 + 16 = 25 -- c = √25 = **5** - -### Common Pythagorean Triples: -- (3, 4, 5) -- (5, 12, 13) -- (8, 15, 17) -- (7, 24, 25) - -Need help with a specific problem?`:s.includes("trig")||/\b(sin|cos|tan)\b/.test(s)?`## Trigonometry - -### SOH-CAH-TOA: -- **sin(θ)** = Opposite / Hypotenuse -- **cos(θ)** = Adjacent / Hypotenuse -- **tan(θ)** = Opposite / Adjacent - -### Key Identities: -- sin²θ + cos²θ = 1 -- tan(θ) = sin(θ)/cos(θ) -- sin(2θ) = 2sin(θ)cos(θ) - -### Unit Circle Values: -| Angle | sin | cos | -|-------|-----|-----| -| 0° | 0 | 1 | -| 30° | 1/2 | √3/2 | -| 45° | √2/2 | √2/2 | -| 90° | 1 | 0 | - -What trig topic would you like help with?`:s.includes("statistic")||s.includes("probability")||s.includes("mean")||s.includes("median")?`## Statistics & Probability - -### Measures of Central Tendency: -- **Mean:** Sum of all values ÷ number of values -- **Median:** Middle value when sorted -- **Mode:** Most frequent value - -### Probability Basics: -- P(event) = favorable outcomes / total outcomes -- 0 ≤ P(event) ≤ 1 -- P(A or B) = P(A) + P(B) - P(A and B) - -### Example: -For data {2, 5, 5, 8, 10}: -- Mean = 30/5 = **6** -- Median = **5** -- Mode = **5** - -What statistics concept do you need help with?`:s.includes("percent")||s.includes("%")?`## Percentages - -### Key Formulas: -- Percentage = (Part / Whole) × 100 -- Part = (Percentage × Whole) / 100 -- % Change = ((New - Old) / Old) × 100 - -### Examples: -- 25% of 200 = (25 × 200) / 100 = **50** -- 15 is what % of 60? → (15/60) × 100 = **25%** -- % increase from 80 to 100 = (20/80) × 100 = **25%** - -Need help with a specific percentage problem?`:s.includes("fraction")||s.includes("numerator")||s.includes("denominator")?`## Fractions - -### Operations: -- **Addition:** a/b + c/d = (ad + bc) / bd -- **Subtraction:** a/b - c/d = (ad - bc) / bd -- **Multiplication:** a/b × c/d = ac / bd -- **Division:** a/b ÷ c/d = a/b × d/c - -### Simplifying: -Divide both numerator and denominator by their GCD. - -### Example: -3/4 + 2/3 = 9/12 + 8/12 = **17/12** - -What fraction problem can I help you with?`:s.includes("limit")?`## Limits - -The limit describes what value a function **approaches** as x approaches some value. - -### How to evaluate: -1. **Direct substitution** — try plugging in the value first -2. **Factor & cancel** — if you get 0/0 -3. **L'Hôpital's Rule** — for 0/0 or ∞/∞ forms - -### Example: -lim(x→2) (x²-4)/(x-2) -= lim(x→2) (x+2)(x-2)/(x-2) -= lim(x→2) (x+2) = **4** - -What limit problem are you working on?`:s.includes("matrix")||s.includes("matrices")?`## Matrices - -A matrix is a rectangular array of numbers arranged in rows and columns. - -### Operations: -- **Addition:** Add corresponding elements (same dimensions required) -- **Scalar multiplication:** Multiply every element by a constant -- **Matrix multiplication:** Rows × Columns (dimensions must be compatible: m×n · n×p = m×p) - -### Determinant (2×2): -For matrix [[a, b], [c, d]]: det = **ad - bc** - -### Example: -| 2 3 | | 1 0 | | 3 3 | -| 4 1 | + | 2 5 | = | 6 6 | - -What matrix operation do you need help with?`:s.includes("logarithm")||s.includes("log")?`## Logarithms - -A logarithm answers: **"What exponent gives me this number?"** - -log_b(x) = y means b^y = x - -### Key Properties: -- log(ab) = log(a) + log(b) -- log(a/b) = log(a) - log(b) -- log(aⁿ) = n · log(a) -- log_b(b) = 1 -- log_b(1) = 0 - -### Common bases: -- **log** = log₁₀ (common log) -- **ln** = logₑ (natural log, e ≈ 2.718) - -### Example: -log₂(8) = 3 because 2³ = 8 - -What logarithm problem are you working on?`:s.includes("exponent")||s.includes("power")?`## Exponents - -An exponent tells you how many times to multiply a base by itself. - -### Key Rules: -- aᵐ · aⁿ = aᵐ⁺ⁿ -- aᵐ / aⁿ = aᵐ⁻ⁿ -- (aᵐ)ⁿ = aᵐⁿ -- a⁰ = 1 (any nonzero number) -- a⁻ⁿ = 1/aⁿ -- a^(1/n) = ⁿ√a - -### Example: -2³ × 2⁴ = 2⁷ = **128** - -What exponent problem can I help with?`:`I'm your **MathPulse AI** math tutor! - -I can help with a wide range of math topics. Try asking: - -- **"What is algebra?"** — get a clear explanation of any topic -- **"How do I solve quadratic equations?"** — step-by-step instructions -- **"Explain the Pythagorean theorem"** — concept breakdowns -- **"What is the derivative of x²?"** — specific problems - -### Topics I cover: -- Algebra, Geometry, Trigonometry -- Calculus (derivatives, integrals, limits) -- Statistics & Probability -- Arithmetic (fractions, percentages) -- Logarithms, Exponents, Matrices - -What would you like to learn about?`}const yg=()=>{const e=f.useContext(hl);if(!e)throw new Error("useChatContext must be used within ChatProvider");return e},em=({children:e})=>{const{currentUser:t}=ol(),[n,s]=f.useState([]),[i,o]=f.useState(null),[r,a]=f.useState(!1),[c,u]=f.useState(null),[d,l]=f.useState(!1),h=f.useRef(new Map);f.useEffect(()=>{if(!t){s([]),l(!1);return}(async()=>{try{const P=await mt(),S=await P.getUserChatSessions(t.uid),I=await Promise.all(S.map(async x=>{const L=(await P.getSessionMessages(x.id)).map(_=>({id:_.id,sender:_.role==="user"?"user":"ai",text:_.role==="assistant"?_e(_.content):_.content,timestamp:_.timestamp instanceof Date?_.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):new Date(_.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}));return{id:x.id,title:x.title,date:x.updatedAt instanceof Date?x.updatedAt.toLocaleDateString():new Date(x.updatedAt).toLocaleDateString(),messageCount:L.length,preview:L.length>0&&vs(L[L.length-1].text)||"No messages yet",topics:[],messages:L,createdAt:x.createdAt instanceof Date?x.createdAt:new Date(x.createdAt),updatedAt:x.updatedAt instanceof Date?x.updatedAt:new Date(x.updatedAt)}}));s(I)}catch(P){console.error("Error loading chat sessions:",P)}finally{l(!0)}})()},[t]);const p=b=>{if(b.length===0)return"New Chat";const P=b.find(x=>x.sender==="user")?.text||"",S=P.toLowerCase();if(S.includes("quadratic")||S.includes("ax² + bx + c"))return"Quadratic Equations Help";if(S.includes("derivative")||S.includes("calculus"))return"Derivatives & Calculus";if(S.includes("pythagor")||S.includes("right triangle"))return"Pythagorean Theorem";if(S.includes("trig")||S.includes("sin")||S.includes("cos"))return"Trigonometry Help";if(S.includes("area")||S.includes("perimeter"))return"Geometry - Area & Perimeter";if(S.includes("algebra")||S.includes("solve")&&S.includes("x"))return"Algebra Problem Solving";if(S.includes("factor"))return"Factoring Practice";if(S.includes("graph")||S.includes("plot"))return"Graphing Functions";if(S.includes("matrix")||S.includes("matrices"))return"Matrix Operations";if(S.includes("integral")||S.includes("integrate"))return"Integration Problems";if(S.includes("limit"))return"Limits in Calculus";if(S.includes("statistic")||S.includes("probability"))return"Statistics & Probability";const I=P.slice(0,40);return I.length{const P=Date.now().toString(),S=new Date,I={id:P,title:b?p([b]):"New Chat",date:"Just now",messageCount:b?1:0,preview:b&&vs(b.text)||"Start a new conversation...",topics:[],messages:b?[b]:[],createdAt:S,updatedAt:S};if(s(x=>[I,...x]),t){const x=b?p([b]):"New Chat",R=mt().then(async L=>{const _=await L.createChatSession(t.uid,x);return b&&await L.addMessageToSession(_.id,b.sender==="user"?"user":"assistant",b.text),_.id}).catch(L=>(console.error("Error creating Firebase session:",L),P));h.current.set(P,R)}return P},[t]),w=f.useCallback((b,P)=>{const S=P.sender==="ai"?{...P,text:_e(P.text)}:P;s(x=>x.map(R=>{if(R.id===b){const L=[...R.messages,S];return{...R,messages:L,messageCount:L.length,preview:vs(S.text)||R.preview,updatedAt:new Date,title:L.length===2?p(L):R.title}}return R}));const I=async x=>{const R=h.current.get(x);return R?await R:x};I(b).then(async x=>{await(await mt()).addMessageToSession(x,S.sender==="user"?"user":"assistant",S.text)}).catch(x=>console.error("Error persisting message:",x)),s(x=>{const R=x.find(L=>L.id===b);if(R&&R.messages.length===2){const L=p(R.messages);I(b).then(async _=>{await(await mt()).updateSessionTitle(_,L)}).catch(_=>console.error("Error updating title:",_))}return x})},[]),T=f.useCallback(async(b,P)=>{const S=P.trim(),I={id:Date.now().toString(),sender:"user",text:S,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};w(b,I),u(b),a(!0);try{let x=null,R=null;const L=n.find(B=>B.id===b),_=(L?.messages||[]).map(B=>({role:B.sender==="user"?"user":"assistant",content:B.text})),ae=fl(S)?qp(_):null,se=ae?Kp(ae):S,ye=ae??S,De=dl(S,{history:_});if(De){const B={id:(Date.now()+1).toString(),sender:"ai",text:De,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};w(b,B);return}try{const B=await oo();x=B.apiService,R=B.ApiTimeoutError}catch(B){console.error("Failed to load API service for chat:",B);const C={id:(Date.now()+1).toString(),sender:"ai",text:An(ye),timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};w(b,C);return}const $=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});let N="",U=null;const le=Zp(S),K=Jp(S),q=Xp(S),ee=K||!!q,V=q?{expectedEndMarker:q,completionMode:"marker"}:void 0,O=B=>ei(S,B,q,K),X=B=>{B.trim()&&s(C=>C.map(G=>{if(G.id!==b)return G;if(!U){U=`stream-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;const re={id:U,sender:"ai",text:B,timestamp:$},F=[...G.messages,re];return{...G,messages:F,messageCount:F.length,updatedAt:new Date}}return{...G,messages:G.messages.map(re=>re.id===U?{...re,text:B}:re),updatedAt:new Date}}))},ue=()=>{if(!U)return;const B=U;s(C=>C.map(G=>{if(G.id!==b)return G;const re=G.messages.filter(F=>F.id!==B);return{...G,messages:re,messageCount:re.length,updatedAt:new Date}}))};try{const{response:B}=await x.chat(se,_,F=>{N+=F,le&&X(Cp(N))},V);let C=_e(B||N).trim();if(ee&&C&&O(C)){try{const F=await x.chatSafe(ao(S,C,q),_,V),te=_e(F.data.response).trim();C=Pn(C,te)}catch(F){console.warn("Streaming completion repair failed:",F)}if(ee&&C&&O(C))try{const F=await x.chatSafe(lo(S,C,q),_,V),te=_e(F.data.response).trim();C=Pn(C,te)}catch(F){console.warn("Streaming plain continuation repair failed:",F)}if(ee&&C&&O(C))try{const F=await x.chatSafe(co(S,q),_,V),te=_e(F.data.response).trim();te&&(C=uo(S,C,te,q,K))}catch(F){console.warn("Streaming full completion repair failed:",F)}}const G=O(C);(!C||G&&!ee)&&(C=An(ye,_)),U&&ue();const re={id:(Date.now()+1).toString(),sender:"ai",text:C,timestamp:$};w(b,re)}catch(B){R&&B instanceof R?console.warn(`Streaming timed out after ${B.timeoutMs}ms, falling back to non-streaming chat.`,B):console.warn("Streaming failed, falling back to non-streaming chat:",B),U&&ue();let C="";try{const F=x??(await oo()).apiService,{data:te}=await F.chatSafe(se,_,V);if(C=_e(te.response).trim(),ee&&C&&O(C))try{const we=await F.chatSafe(ao(S,C,q),_,V),ve=_e(we.data.response).trim();C=Pn(C,ve)}catch(we){console.warn("Non-stream completion repair failed:",we)}if(ee&&C&&O(C))try{const we=await F.chatSafe(lo(S,C,q),_,V),ve=_e(we.data.response).trim();C=Pn(C,ve)}catch(we){console.warn("Non-stream plain continuation repair failed:",we)}if(ee&&C&&O(C))try{const we=await F.chatSafe(co(S,q),_,V),ve=_e(we.data.response).trim();ve&&(C=uo(S,C,ve,q,K))}catch(we){console.warn("Non-stream full completion repair failed:",we)}}catch(F){console.warn("Chat request failed, using local fallback response:",F),C=An(ye,_)}const G=O(C);(!C||G&&!ee)&&(C=An(ye,_));const re={id:(Date.now()+1).toString(),sender:"ai",text:_e(C),timestamp:$};w(b,re)}if(L&&L.messages.length===1){const B=n.find(C=>C.id===b);if(B&&B.messages.length>1){const C=p(B.messages),G=h.current.get(b);(G||Promise.resolve(b)).then(async F=>{await(await mt()).updateSessionTitle(F,C)}).catch(F=>console.error("Error updating title:",F))}}}finally{a(!1),u(null)}},[n,w]),v=f.useCallback((b,P)=>{s(x=>x.map(R=>R.id===b?{...R,title:P}:R));const S=h.current.get(b);(S||Promise.resolve(b)).then(async x=>{await(await mt()).updateSessionTitle(x,P)}).catch(x=>console.error("Error updating session title:",x))},[]),A=f.useCallback(b=>{s(I=>I.filter(x=>x.id!==b)),i===b&&o(null);const P=h.current.get(b);(P||Promise.resolve(b)).then(async I=>{await(await mt()).deleteSession(I)}).catch(I=>console.error("Error deleting session:",I)),h.current.delete(b)},[i]),y=f.useCallback(()=>n.find(b=>b.id===i)||null,[n,i]);return m.jsx(hl.Provider,{value:{sessions:n,activeSessionId:i,isLoading:r,loadingSessionId:c,sessionsLoaded:d,setActiveSessionId:o,createNewSession:g,addMessageToSession:w,sendMessage:T,updateSessionTitle:v,deleteSession:A,getActiveSession:y,generateTitleFromMessages:p},children:e})},tm=async(e,t,n,s,i)=>{try{const o=J(Ge(H,"notifications")),r={id:o.id,userId:e,type:t,title:n,message:s,read:!1,...i?{actionUrl:i}:{},createdAt:new Date};return await Oe(o,{id:o.id,userId:e,type:t,title:n,message:s,read:!1,...i?{actionUrl:i}:{},createdAt:oe()}),r}catch(o){throw console.error("Error creating notification:",o),o}},vg=async(e,t=50,n=!1)=>{try{let s=_t(Ge(H,"notifications"),Ze("userId","==",e),As("createdAt","desc"),Es(t));return n&&(s=_t(Ge(H,"notifications"),Ze("userId","==",e),Ze("read","==",!1),As("createdAt","desc"),Es(t))),(await un(s)).docs.map(o=>{const r=o.data();return{...r,id:o.id,actionUrl:r.actionUrl??r.link,createdAt:r.createdAt?.toDate()||new Date}})}catch(s){return console.error("Error getting notifications:",s),[]}},bg=async e=>{try{const t=J(H,"notifications",e);await ct(t,{read:!0})}catch(t){throw console.error("Error marking notification as read:",t),t}},xg=async e=>{try{const t=_t(Ge(H,"notifications"),Ze("userId","==",e),Ze("read","==",!1)),n=await un(t);await Promise.all(n.docs.map(s=>ct(s.ref,{read:!0})))}catch(t){throw console.error("Error marking all notifications as read:",t),t}},nm=async e=>{try{const t=J(H,"users",e),n=await xe(t);if(!n.exists())throw new Error("User not found");const s=n.data(),i=s.lastActivityDate?.toDate(),o=new Date;o.setHours(0,0,0,0);let r=s.streak||0;if(!i)r=1;else{const u=new Date(i);u.setHours(0,0,0,0);const d=Math.floor((o.getTime()-u.getTime())/(1e3*60*60*24));if(d===0)r=s.streak||1;else if(d===1){r=(s.streak||0)+1;const l=Math.min(r*5,50);await pl(e,l,"streak_bonus",`${r} day streak bonus!`)}else r=1}const a=new Date,c=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;return await ct(t,{streak:r,streakHistory:yo(c),lastActivityDate:oe(),updatedAt:oe()}),r}catch(t){return console.error("Error updating streak:",t),0}},pl=async(e,t,n,s)=>{try{const i=J(H,"users",e),o=await xe(i);if(!o.exists())throw new Error("User not found");const r=o.data(),a=r.currentXP||0,c=r.totalXP||0,u=a+t,d=c+t,l=r.level||1;console.log(`🏆 XP Award - User: ${e}, Amount: ${t}, Previous currentXP: ${a}, New: ${u}, Type: ${n}`);let h=l,p=d,g=!1;for(;;){const v=Math.floor(100*Math.pow(1.5,h-1));let A=0;for(let y=1;y<=h;y++)A+=Math.floor(100*Math.pow(1.5,y-1));if(d>=A)h++,g=!0;else break}const w={currentXP:u,totalXP:d,level:h,updatedAt:oe()};await ct(i,w),console.log(`💾 Firebase Update - currentXP: ${a} -> ${u}, totalXP: ${c} -> ${d}, level: ${h}`);const T=J(Ge(H,"xpActivities"));return await Oe(T,{activityId:T.id,userId:e,type:n,xpEarned:t,description:s,timestamp:oe()}),{newLevel:h,leveledUp:g,xp:u,addedXp:t}}catch(i){throw console.error("Error awarding XP:",i),i}},wg=async(e,t=!1,n="all",s=10)=>{try{const i=_t(Ge(H,"users"),Ze("role","==","student"),As("totalXP","desc"),Es(s));return(await un(i)).docs.map((r,a)=>{const c=r.data();return{userId:r.id,name:c.name||"Unknown",photo:c.photo,xp:c.totalXP||0,level:c.level||1,rank:a+1,weeklyXP:c.weeklyXP||0,monthlyXP:c.monthlyXP||0}})}catch(i){return console.error("Error getting leaderboard:",i),[]}},Sg=async e=>{try{const t=await xe(J(H,"users",e));if(!t.exists())return 0;const n=t.data().totalXP||0,s=_t(Ge(H,"users"),Ze("role","==","student"),Ze("totalXP",">",n));return(await un(s)).size+1}catch(t){return console.error("Error getting user rank:",t),0}},Tg=async e=>{try{const t=await xe(J(H,"achievements",e));return t.exists()?t.data().achievements||[]:[]}catch(t){return console.error("Error getting user achievements:",t),[]}},Pg=async(e,t,n)=>{try{const s=J(H,"users",e),i=await xe(s);if(!i.exists())throw new Error("User not found");const o=i.data(),r=o.currentXP||0;if((o.ownedAvatarItems||[]).includes(t))return{success:!1,message:"You already own this item",currentXP:r};if(r{try{const t=J(H,"users",e),n=await xe(t);if(!n.exists())return{success:!1,newXP:0};const i=n.data().currentXP||0,o=Math.max(i,5e3);return await ct(t,{ownedAvatarItems:[],avatarLayers:jl(),currentXP:o,updatedAt:oe()}),{success:!0,newXP:o}}catch(t){return console.error("Error resetting avatar items:",t),{success:!1,newXP:0}}},Vi=async e=>{const t={userId:e,subjects:{},lessons:{},quizAttempts:[],totalLessonsCompleted:0,totalQuizzesCompleted:0,averageScore:0,updatedAt:new Date};return await Oe(J(H,"progress",e),t),t},sm=async e=>{try{const t=J(H,"progress",e),n=await xe(t);if(n.exists()){const s=n.data();return{...s,updatedAt:s.updatedAt?.toDate()||new Date}}return await Vi(e)}catch(t){return console.error("Error getting user progress:",t),null}},Eg=(e,t)=>{const n=J(H,"progress",e);return Nl(n,s=>{if(!s.exists()){t(null);return}const i=s.data();t({...i,updatedAt:i.updatedAt?.toDate?.()||new Date})},s=>{console.error("Error subscribing to user progress:",s),t(null)})},Cg=async(e,t,n)=>{const s=Math.max(0,Math.min(100,n)),i=J(H,"progress",e);await Oe(i,{[`lessons.${t}.lessonId`]:t,[`lessons.${t}.progressPercent`]:s,updatedAt:oe()},{merge:!0})},Dg=async(e,t,n,s,i)=>{const o=J(H,"progress",e),r=await xe(o);if(!r.exists())return 0;const c=r.data().subjects?.[t]?.modulesProgress?.[n];if(!c)return 0;const u=Math.max(1,s+i),d=c.lessonsCompleted?.length||0,l=c.quizzesCompleted?.length||0,h=Math.round((d+l)/u*100);return await Oe(o,{[`subjects.${t}.modulesProgress.${n}.progress`]:h,[`subjects.${t}.modulesProgress.${n}.lastAccessedAt`]:oe(),updatedAt:oe()},{merge:!0}),h},Rg=async(e,t,n,s,i,o=50)=>{try{const r=J(H,"progress",e);let a=await xe(r);a.exists()||(await Vi(e),a=await xe(r));const c=a.data(),u={lessonId:s,completed:!0,completedAt:new Date,timeSpent:i};c.subjects||(c.subjects={}),c.subjects[t]||(c.subjects[t]={subjectId:t,progress:0,completedModules:0,totalModules:0,modulesProgress:{}});const d=c.subjects[t];d.modulesProgress[n]||(d.modulesProgress[n]={moduleId:n,subjectId:t,progress:0,lessonsCompleted:[],quizzesCompleted:[],startedAt:new Date,lastAccessedAt:new Date});const l=d.modulesProgress[n],h=!l.lessonsCompleted.includes(s);h&&(l.lessonsCompleted.push(s),l.lastAccessedAt=new Date),await Oe(r,{[`lessons.${s}`]:u,[`subjects.${t}.modulesProgress.${n}`]:l,...h&&{totalLessonsCompleted:jn(1)},updatedAt:oe()},{merge:!0}),await ml(e,o,"lesson_complete",`Completed lesson: ${s}`)}catch(r){throw console.error("Error completing lesson:",r),r}},kg=async(e,t,n,s,i,o,r)=>{try{const a=J(H,"progress",e);let c=await xe(a);c.exists()||(await Vi(e),c=await xe(a));const u=c.data(),d={quizId:s,attemptNumber:(u.quizAttempts?.filter(w=>w.quizId===s).length||0)+1,score:i,completedAt:new Date,timeSpent:r,answers:o},l=Math.floor(i/100*100);u.subjects||(u.subjects={}),u.subjects[t]||(u.subjects[t]={subjectId:t,progress:0,completedModules:0,totalModules:0,modulesProgress:{}});const h=u.subjects[t];h.modulesProgress[n]||(h.modulesProgress[n]={moduleId:n,subjectId:t,progress:0,lessonsCompleted:[],quizzesCompleted:[],startedAt:new Date,lastAccessedAt:new Date});const p=h.modulesProgress[n],g=!p.quizzesCompleted.includes(s);g&&(p.quizzesCompleted.push(s),p.lastAccessedAt=new Date),await ct(a,{quizAttempts:[...u.quizAttempts||[],d],[`subjects.${t}.modulesProgress.${n}`]:p,...g&&{totalQuizzesCompleted:jn(1)},updatedAt:oe()}),await ml(e,l,"quiz_complete",`Completed quiz: ${s} (Score: ${i}%)`)}catch(a){throw console.error("Error completing quiz:",a),a}},ml=async(e,t,n,s)=>{try{const i=J(H,"users",e);await ct(i,{currentXP:jn(t),totalXP:jn(t),updatedAt:oe()});const o=J(Ge(H,"xpActivities"));await Oe(o,{activityId:o.id,userId:e,type:n,xpEarned:t,description:s,timestamp:oe()})}catch(i){console.error("Error awarding XP:",i)}},_n={notifications:{emailNotifications:!0,pushNotifications:!0,soundEnabled:!0,notificationTypes:{quizReminders:!0,newContent:!0,achievements:!0,streakAlerts:!0,weeklySummary:!0},quietHours:{start:"22:00",end:"08:00"}},appearance:{darkMode:!1,fontSize:16,compactView:!1,reduceAnimations:!1},privacy:{profileVisibility:"everyone",showActivityStatus:!0,dataSharing:!0},learning:{dailyXpGoal:100,preferredStudyTime:"evening",autoPlayLessons:!1,showHints:!0,quizDifficultyPreference:"adaptive",studyReminderTime:"18:00"},adminPanel:{siteName:"MathPulse AI",siteDescription:"AI-Powered Mathematics Learning Platform",defaultLanguage:"English",maintenanceMode:!1,enforceStrongPasswords:!0,sessionTimeoutMinutes:60,aiTutorEnabled:!0,aiAutoRecommendations:!0,aiRiskAlertsEnabled:!0,gradingScale:"percentage",passingGrade:75,parentSummaryEmails:!0,teacherDigestEmails:!0,weeklyPlatformReport:!0,autoBackupEnabled:!1,backupFrequency:"weekly"}},im="preferences",_i=()=>JSON.parse(JSON.stringify(_n)),gl=e=>{const t=_i();return e?{...t,...e,notifications:{...t.notifications,...e.notifications,notificationTypes:{...t.notifications.notificationTypes,...e.notifications?.notificationTypes},quietHours:{...t.notifications.quietHours,...e.notifications?.quietHours}},appearance:{...t.appearance,...e.appearance},privacy:{...t.privacy,...e.privacy},learning:{...t.learning,...e.learning},adminPanel:{...t.adminPanel,...e.adminPanel}}:t},ji=e=>J(H,"users",e,"settings",im),yl=async e=>{const t=ji(e),n=await xe(t);if(!n.exists()){const s=_i();return await Oe(t,{...s,createdAt:oe(),updatedAt:oe()}),s}return gl(n.data())},rm=async(e,t)=>{const n=await yl(e),s=gl({...n,...t});return await Oe(ji(e),{...s,updatedAt:oe()},{merge:!0}),s},om=e=>{const t=document.documentElement;t.style.setProperty("--font-size",`${e.appearance.fontSize}px`),t.dataset.density=e.appearance.compactView?"compact":"comfortable",e.appearance.reduceAnimations?t.classList.add("reduced-motion"):t.classList.remove("reduced-motion"),e.appearance.darkMode?t.classList.add("smart-dark"):t.classList.remove("smart-dark")},am=async()=>{try{if(localStorage.clear(),sessionStorage.clear(),"caches"in window){const e=await caches.keys();await Promise.all(e.map(t=>caches.delete(t)))}}catch(e){throw console.error("Failed clearing client cache:",e),new Error("Unable to clear cache on this device.")}},lm=async e=>{const t=J(H,"users",e),n=await xe(t),s=await xe(ji(e)),i=["progress","xpActivities","achievements","notifications","tasks","chatSessions","chatMessages"],o=await Promise.all(i.map(async r=>{const a=_t(Ge(H,r),Ze("userId","==",e)),c=await un(a);return{collectionName:r,items:c.docs.map(u=>({id:u.id,...u.data()}))}}));return{exportedAt:new Date().toISOString(),user:n.exists()?{id:n.id,...n.data()}:null,settings:s.exists()?s.data():_i(),collections:o.reduce((r,a)=>(r[a.collectionName]=a.items,r),{})}};function cm(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const um=e=>{switch(e){case"success":return fm;case"info":return mm;case"warning":return pm;case"error":return gm;default:return null}},dm=Array(12).fill(0),hm=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},dm.map((n,s)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),fm=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),pm=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),mm=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),gm=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ym=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),vm=()=>{const[e,t]=E.useState(document.hidden);return E.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let ti=1;class bm{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...i}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:ti++,r=this.toasts.find(c=>c.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),r?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:s}),{...c,...t,id:o,dismissible:a,title:s}):c):this.addToast({title:s,...i,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=s!==void 0,r;const a=i.then(async u=>{if(r=["resolve",u],E.isValidElement(u))o=!1,this.create({id:s,type:"default",message:u});else if(wm(u)&&!u.ok){o=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,g=typeof l=="object"&&!E.isValidElement(l)?l:{message:l};this.create({id:s,type:"error",description:h,...g})}else if(u instanceof Error){o=!1;const l=typeof n.error=="function"?await n.error(u):n.error,h=typeof n.description=="function"?await n.description(u):n.description,g=typeof l=="object"&&!E.isValidElement(l)?l:{message:l};this.create({id:s,type:"error",description:h,...g})}else if(n.success!==void 0){o=!1;const l=typeof n.success=="function"?await n.success(u):n.success,h=typeof n.description=="function"?await n.description(u):n.description,g=typeof l=="object"&&!E.isValidElement(l)?l:{message:l};this.create({id:s,type:"success",description:h,...g})}}).catch(async u=>{if(r=["reject",u],n.error!==void 0){o=!1;const d=typeof n.error=="function"?await n.error(u):n.error,l=typeof n.description=="function"?await n.description(u):n.description,p=typeof d=="object"&&!E.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:l,...p})}}).finally(()=>{o&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>a.then(()=>r[0]==="reject"?d(r[1]):u(r[1])).catch(d));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,n)=>{const s=n?.id||ti++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ie=new bm,xm=(e,t)=>{const n=t?.id||ti++;return Ie.addToast({title:e,...t,id:n}),n},wm=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Sm=xm,Tm=()=>Ie.toasts,Pm=()=>Ie.getActiveToasts(),Ae=Object.assign(Sm,{success:Ie.success,info:Ie.info,warning:Ie.warning,error:Ie.error,custom:Ie.custom,message:Ie.message,promise:Ie.promise,dismiss:Ie.dismiss,loading:Ie.loading},{getHistory:Tm,getToasts:Pm});cm("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function En(e){return e.label!==void 0}const Am=3,Em="24px",Cm="16px",ho=4e3,Dm=356,Rm=14,km=45,Mm=200;function qe(...e){return e.filter(Boolean).join(" ")}function Lm(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const Im=e=>{var t,n,s,i,o,r,a,c,u;const{invert:d,toast:l,unstyled:h,interacting:p,setHeights:g,visibleToasts:w,heights:T,index:v,toasts:A,expanded:y,removeToast:b,defaultRichColors:P,closeButton:S,style:I,cancelButtonStyle:x,actionButtonStyle:R,className:L="",descriptionClassName:_="",duration:ae,position:se,gap:ye,expandByDefault:De,classNames:$,icons:N,closeButtonAriaLabel:U="Close toast"}=e,[le,K]=E.useState(null),[q,ee]=E.useState(null),[V,O]=E.useState(!1),[X,ue]=E.useState(!1),[B,C]=E.useState(!1),[G,re]=E.useState(!1),[F,te]=E.useState(!1),[we,ve]=E.useState(0),[ht,$t]=E.useState(0),et=E.useRef(l.duration||ae||ho),Qe=E.useRef(null),Ve=E.useRef(null),zt=v===0,Ut=v+1<=w,pe=l.type,Re=l.dismissible!==!1,xt=l.className||"",Wt=l.descriptionClassName||"",tt=E.useMemo(()=>T.findIndex(j=>j.toastId===l.id)||0,[T,l.id]),Gn=E.useMemo(()=>{var j;return(j=l.closeButton)!=null?j:S},[l.closeButton,S]),Ht=E.useMemo(()=>l.duration||ae||ho,[l.duration,ae]),ft=E.useRef(0),We=E.useRef(0),nt=E.useRef(0),Fe=E.useRef(null),[qt,wt]=se.split("-"),Kt=E.useMemo(()=>T.reduce((j,Q,de)=>de>=tt?j:j+Q.height,0),[T,tt]),st=vm(),gn=l.invert||d,St=pe==="loading";We.current=E.useMemo(()=>tt*ye+Kt,[tt,Kt]),E.useEffect(()=>{et.current=Ht},[Ht]),E.useEffect(()=>{O(!0)},[]),E.useEffect(()=>{const j=Ve.current;if(j){const Q=j.getBoundingClientRect().height;return $t(Q),g(de=>[{toastId:l.id,height:Q,position:l.position},...de]),()=>g(de=>de.filter(Se=>Se.toastId!==l.id))}},[g,l.id]),E.useLayoutEffect(()=>{if(!V)return;const j=Ve.current,Q=j.style.height;j.style.height="auto";const de=j.getBoundingClientRect().height;j.style.height=Q,$t(de),g(Se=>Se.find(he=>he.toastId===l.id)?Se.map(he=>he.toastId===l.id?{...he,height:de}:he):[{toastId:l.id,height:de,position:l.position},...Se])},[V,l.title,l.description,g,l.id,l.jsx,l.action,l.cancel]);const He=E.useCallback(()=>{ue(!0),ve(We.current),g(j=>j.filter(Q=>Q.toastId!==l.id)),setTimeout(()=>{b(l)},Mm)},[l,b,g,We]);E.useEffect(()=>{if(l.promise&&pe==="loading"||l.duration===1/0||l.type==="loading")return;let j;return y||p||st?(()=>{if(nt.current{et.current!==1/0&&(ft.current=new Date().getTime(),j=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),He()},et.current))})(),()=>clearTimeout(j)},[y,p,l,pe,st,He]),E.useEffect(()=>{l.delete&&(He(),l.onDismiss==null||l.onDismiss.call(l,l))},[He,l.delete]);function Xt(){var j;if(N?.loading){var Q;return E.createElement("div",{className:qe($?.loader,l==null||(Q=l.classNames)==null?void 0:Q.loader,"sonner-loader"),"data-visible":pe==="loading"},N.loading)}return E.createElement(hm,{className:qe($?.loader,l==null||(j=l.classNames)==null?void 0:j.loader),visible:pe==="loading"})}const Gt=l.icon||N?.[pe]||um(pe);var yn,ke;return E.createElement("li",{tabIndex:0,ref:Ve,className:qe(L,xt,$?.toast,l==null||(t=l.classNames)==null?void 0:t.toast,$?.default,$?.[pe],l==null||(n=l.classNames)==null?void 0:n[pe]),"data-sonner-toast":"","data-rich-colors":(yn=l.richColors)!=null?yn:P,"data-styled":!(l.jsx||l.unstyled||h),"data-mounted":V,"data-promise":!!l.promise,"data-swiped":F,"data-removed":X,"data-visible":Ut,"data-y-position":qt,"data-x-position":wt,"data-index":v,"data-front":zt,"data-swiping":B,"data-dismissible":Re,"data-type":pe,"data-invert":gn,"data-swipe-out":G,"data-swipe-direction":q,"data-expanded":!!(y||De&&V),"data-testid":l.testId,style:{"--index":v,"--toasts-before":v,"--z-index":A.length-v,"--offset":`${X?we:We.current}px`,"--initial-height":De?"auto":`${ht}px`,...I,...l.style},onDragEnd:()=>{C(!1),K(null),Fe.current=null},onPointerDown:j=>{j.button!==2&&(St||!Re||(Qe.current=new Date,ve(We.current),j.target.setPointerCapture(j.pointerId),j.target.tagName!=="BUTTON"&&(C(!0),Fe.current={x:j.clientX,y:j.clientY})))},onPointerUp:()=>{var j,Q,de;if(G||!Re)return;Fe.current=null;const Se=Number(((j=Ve.current)==null?void 0:j.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tt=Number(((Q=Ve.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),he=new Date().getTime()-((de=Qe.current)==null?void 0:de.getTime()),Me=le==="x"?Se:Tt,Pt=Math.abs(Me)/he;if(Math.abs(Me)>=km||Pt>.11){ve(We.current),l.onDismiss==null||l.onDismiss.call(l,l),ee(le==="x"?Se>0?"right":"left":Tt>0?"down":"up"),He(),re(!0);return}else{var Te,me;(Te=Ve.current)==null||Te.style.setProperty("--swipe-amount-x","0px"),(me=Ve.current)==null||me.style.setProperty("--swipe-amount-y","0px")}te(!1),C(!1),K(null)},onPointerMove:j=>{var Q,de,Se;if(!Fe.current||!Re||((Q=window.getSelection())==null?void 0:Q.toString().length)>0)return;const he=j.clientY-Fe.current.y,Me=j.clientX-Fe.current.x;var Pt;const Te=(Pt=e.swipeDirections)!=null?Pt:Lm(se);!le&&(Math.abs(Me)>1||Math.abs(he)>1)&&K(Math.abs(Me)>Math.abs(he)?"x":"y");let me={x:0,y:0};const At=Be=>1/(1.5+Math.abs(Be)/20);if(le==="y"){if(Te.includes("top")||Te.includes("bottom"))if(Te.includes("top")&&he<0||Te.includes("bottom")&&he>0)me.y=he;else{const Be=he*At(he);me.y=Math.abs(Be)0)me.x=Me;else{const Be=Me*At(Me);me.x=Math.abs(Be)0||Math.abs(me.y)>0)&&te(!0),(de=Ve.current)==null||de.style.setProperty("--swipe-amount-x",`${me.x}px`),(Se=Ve.current)==null||Se.style.setProperty("--swipe-amount-y",`${me.y}px`)}},Gn&&!l.jsx&&pe!=="loading"?E.createElement("button",{"aria-label":U,"data-disabled":St,"data-close-button":!0,onClick:St||!Re?()=>{}:()=>{He(),l.onDismiss==null||l.onDismiss.call(l,l)},className:qe($?.closeButton,l==null||(s=l.classNames)==null?void 0:s.closeButton)},(ke=N?.close)!=null?ke:ym):null,(pe||l.icon||l.promise)&&l.icon!==null&&(N?.[pe]!==null||l.icon)?E.createElement("div",{"data-icon":"",className:qe($?.icon,l==null||(i=l.classNames)==null?void 0:i.icon)},l.promise||l.type==="loading"&&!l.icon?l.icon||Xt():null,l.type!=="loading"?Gt:null):null,E.createElement("div",{"data-content":"",className:qe($?.content,l==null||(o=l.classNames)==null?void 0:o.content)},E.createElement("div",{"data-title":"",className:qe($?.title,l==null||(r=l.classNames)==null?void 0:r.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?E.createElement("div",{"data-description":"",className:qe(_,Wt,$?.description,l==null||(a=l.classNames)==null?void 0:a.description)},typeof l.description=="function"?l.description():l.description):null),E.isValidElement(l.cancel)?l.cancel:l.cancel&&En(l.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||x,onClick:j=>{En(l.cancel)&&Re&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,j),He())},className:qe($?.cancelButton,l==null||(c=l.classNames)==null?void 0:c.cancelButton)},l.cancel.label):null,E.isValidElement(l.action)?l.action:l.action&&En(l.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||R,onClick:j=>{En(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,j),!j.defaultPrevented&&He())},className:qe($?.actionButton,l==null||(u=l.classNames)==null?void 0:u.actionButton)},l.action.label):null)};function fo(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Vm(e,t){const n={};return[e,t].forEach((s,i)=>{const o=i===1,r=o?"--mobile-offset":"--offset",a=o?Cm:Em;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${r}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${r}-${u}`]=a:n[`${r}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(a)}),n}const ws=E.forwardRef(function(t,n){const{id:s,invert:i,position:o="bottom-right",hotkey:r=["altKey","KeyT"],expand:a,closeButton:c,className:u,offset:d,mobileOffset:l,theme:h="light",richColors:p,duration:g,style:w,visibleToasts:T=Am,toastOptions:v,dir:A=fo(),gap:y=Rm,icons:b,containerAriaLabel:P="Notifications"}=t,[S,I]=E.useState([]),x=E.useMemo(()=>s?S.filter(V=>V.toasterId===s):S.filter(V=>!V.toasterId),[S,s]),R=E.useMemo(()=>Array.from(new Set([o].concat(x.filter(V=>V.position).map(V=>V.position)))),[x,o]),[L,_]=E.useState([]),[ae,se]=E.useState(!1),[ye,De]=E.useState(!1),[$,N]=E.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=E.useRef(null),le=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=E.useRef(null),q=E.useRef(!1),ee=E.useCallback(V=>{I(O=>{var X;return(X=O.find(ue=>ue.id===V.id))!=null&&X.delete||Ie.dismiss(V.id),O.filter(({id:ue})=>ue!==V.id)})},[]);return E.useEffect(()=>Ie.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{I(O=>O.map(X=>X.id===V.id?{...X,delete:!0}:X))});return}setTimeout(()=>{bl.flushSync(()=>{I(O=>{const X=O.findIndex(ue=>ue.id===V.id);return X!==-1?[...O.slice(0,X),{...O[X],...V},...O.slice(X+1)]:[V,...O]})})})}),[S]),E.useEffect(()=>{if(h!=="system"){N(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?N("dark"):N("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:O})=>{N(O?"dark":"light")})}catch{V.addListener(({matches:X})=>{try{N(X?"dark":"light")}catch(ue){console.error(ue)}})}},[h]),E.useEffect(()=>{S.length<=1&&se(!1)},[S]),E.useEffect(()=>{const V=O=>{var X;if(r.every(C=>O[C]||O.code===C)){var B;se(!0),(B=U.current)==null||B.focus()}O.code==="Escape"&&(document.activeElement===U.current||(X=U.current)!=null&&X.contains(document.activeElement))&&se(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),E.useEffect(()=>{if(U.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,q.current=!1)}},[U.current]),E.createElement("section",{ref:n,"aria-label":`${P} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((V,O)=>{var X;const[ue,B]=V.split("-");return x.length?E.createElement("ol",{key:V,dir:A==="auto"?fo():A,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":ue,"data-x-position":B,style:{"--front-toast-height":`${((X=L[0])==null?void 0:X.height)||0}px`,"--width":`${Dm}px`,"--gap":`${y}px`,...w,...Vm(d,l)},onBlur:C=>{q.current&&!C.currentTarget.contains(C.relatedTarget)&&(q.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:C=>{C.target instanceof HTMLElement&&C.target.dataset.dismissible==="false"||q.current||(q.current=!0,K.current=C.relatedTarget)},onMouseEnter:()=>se(!0),onMouseMove:()=>se(!0),onMouseLeave:()=>{ye||se(!1)},onDragEnd:()=>se(!1),onPointerDown:C=>{C.target instanceof HTMLElement&&C.target.dataset.dismissible==="false"||De(!0)},onPointerUp:()=>De(!1)},x.filter(C=>!C.position&&O===0||C.position===V).map((C,G)=>{var re,F;return E.createElement(Im,{key:C.id,icons:b,index:G,toast:C,defaultRichColors:p,duration:(re=v?.duration)!=null?re:g,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:i,visibleToasts:T,closeButton:(F=v?.closeButton)!=null?F:c,interacting:ye,position:V,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:x.filter(te=>te.position==C.position),heights:L.filter(te=>te.position==C.position),setHeights:_,expandByDefault:a,gap:y,expanded:ae,swipeDirections:t.swipeDirections})})):null}))}),_m={Functions:"Functions and Graphs",BusinessMath:"Business and Financial Mathematics",Logic:"Logic and Reasoning"},Mg={Functions:"gm-1",BusinessMath:"gm-2",Logic:"gm-3"},Ss=e=>{const t=e.trim().toLowerCase();return t==="functions"||t.includes("function")?"Functions":t==="businessmath"||t.includes("business")?"BusinessMath":t==="logic"||t.includes("reason")?"Logic":null},jm=f.lazy(()=>W(()=>import("./LoginPage-mXOi2OPh.js"),__vite__mapDeps([9,3,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,4,2,1,5,6]))),Nm=f.lazy(()=>W(()=>import("./TeacherDashboard-D8avlB5m.js"),__vite__mapDeps([27,3,10,11,12,13,14,28,29,30,31,4,2,1,5,6,32,7,20,16,21,33,34,25,35,36,37,38,39,40,41,42,43,15,44,17,19,45,46,47,48,24,49,50,18,51,52,53,54,55,56,57,58,59]))),Om=f.lazy(()=>W(()=>import("./AdminDashboard-BmyikugA.js"),__vite__mapDeps([60,3,61,32,13,12,31,29,50,19,21,41,62,63,20,64,65,66,4,2,1,5,6,28,10,11,30,14,67,46,39,40,38,34,48,59,45,68,56,36,25,55,69,44,54,57,18,16,70,43,37,17]))),po=f.lazy(()=>W(()=>import("./Sidebar-xBQ3Qnyw.js"),__vite__mapDeps([61,3,32,13,12,31,29,50,19,21,41,62,63,20,64,65,66,4,2,1,5,6]))),Fm=f.lazy(()=>W(()=>import("./HeroBanner-BdiQHNd9.js"),__vite__mapDeps([71,3,16,4,2,1,5,6]))),Bm=f.lazy(()=>W(()=>import("./RightSidebar-Dfek3lmU.js"),__vite__mapDeps([72,3,48,73,11,13,12,65,50,74,4,2,1,5,6]))),$m=f.lazy(()=>W(()=>import("./XPNotification-4si_K5GL.js"),__vite__mapDeps([75,3,74,15,4,2,1,5,6]))),zm=f.lazy(()=>W(()=>import("./NotificationCenter-DGhehaGL.js"),__vite__mapDeps([76,3,55,29,21,63,36,65,4,2,1,5,6]))),Um=f.lazy(()=>W(()=>import("./SearchBar-ldiC0sUv.js"),__vite__mapDeps([77,3,45,29,57,21,17,19,20,4,2,1,5,6]))),Wm=f.lazy(()=>W(()=>import("./SupplementalBanner-dklPrubU.js"),__vite__mapDeps([78,3,29,15,50,21,17,16,4,2,1,5,6]))),Hm=f.lazy(()=>W(()=>import("./LearningPath-B_MkUEk2.js"),__vite__mapDeps([79,3,47,17,41,80,21,57,4,2,1,5,6]))),qm=f.lazy(()=>W(()=>import("./CompetencyRadarChart-BfcP7xrw.js"),__vite__mapDeps([81,3,47,17,41,16,15,58,12,4,2,1,5,6])).then(e=>({default:e.CompetencyRadarChart}))),Km=f.lazy(()=>W(()=>import("./ModulesPage-y4YivjOd.js"),__vite__mapDeps([82,3,80,21,57,10,11,12,13,14,65,15,54,18,74,39,29,68,47,17,41,33,1,2,48,23,83,0,4,5,6,84,7,46,85,78,50,16,59,45]))),Xm=f.lazy(()=>W(()=>import("./AIChatPage-CzCeFujm.js"),__vite__mapDeps([86,3,10,11,12,13,14,51,52,53,4,2,1,5,6,38,45,30,35]))),Gm=f.lazy(()=>W(()=>import("./GradesPage-m1qiGDtC.js"),__vite__mapDeps([87,3,10,11,12,13,47,17,41,18,54,56,43,70,50,4,2,1,5,6]))),Ym=f.lazy(()=>W(()=>import("./LeaderboardPage-jsrBZaI7.js"),__vite__mapDeps([88,3,29,21,54,18,57,65,17,34,74,49,4,2,1,5,6]))),Qm=f.lazy(()=>W(()=>import("./QuizBattlePage-BbGkD7O9.js"),__vite__mapDeps([89,3,47,17,41,1,2,10,11,12,13,67,46,39,14,90,42,64,19,50,54,34,65,15,26,4,5,6]))),Zm=f.lazy(()=>W(()=>import("./AvatarShop-BirEYu2M.js"),__vite__mapDeps([91,3,11,73,13,12,92,93,15,23,44,66,4,2,1,5,6]))),Jm=f.lazy(()=>W(()=>import("./FloatingAITutor-DkH3KrR1.js"),__vite__mapDeps([94,3,37,29,35,4,2,1,5,6]))),eg=f.lazy(()=>W(()=>import("./RewardsModal-HRePzoUo.js"),__vite__mapDeps([95,3,29,74,65,54,21,18,56,19,17,4,2,1,5,6]))),Ts=f.lazy(()=>W(()=>import("./ProfileModal-D3hk8uuj.js"),__vite__mapDeps([96,3,10,11,12,13,14,92,93,29,19,22,18,21,56,69,44,4,2,1,5,6]))),tg=f.lazy(()=>W(()=>import("./ConfirmModal-DGrnpObD.js"),__vite__mapDeps([28,3,10,11,12,13,29,30,31,4,2,1,5,6]))),Ps=f.lazy(()=>W(()=>import("./SettingsModal-C-nK3nbS.js"),__vite__mapDeps([97,3,10,11,12,13,14,90,28,29,30,31,4,2,1,5,6,49,55,62,69,43,23,57]))),ng=f.lazy(()=>W(()=>import("./ScientificCalculator-wlhyNBDf.js"),__vite__mapDeps([84,3,7,4,2,1,5,6,46,29]))),sg=f.lazy(()=>W(()=>import("./DiagnosticAssessmentModal-C541tkg_.js"),__vite__mapDeps([98,3,10,11,12,13,85,84,7,4,2,1,5,6,46,29,0,16,48,50,41,17]))),ig=()=>{const{isLoggedIn:e,userProfile:t,userRole:n,loading:s,refreshProfile:i}=ol(),o=m.jsx("div",{className:"flex min-h-[320px] items-center justify-center text-sm font-semibold text-slate-500",children:"Loading content..."}),r=m.jsx("div",{className:"pb-4 text-sm font-semibold text-slate-500",children:"Loading dashboard content..."}),a=m.jsx("div",{className:"h-11 w-11 shrink-0 rounded-xl bg-[#edf1f7]","aria-hidden":"true"}),c=m.jsx("div",{className:"h-11 w-full rounded-xl bg-[#edf1f7]","aria-hidden":"true"}),u=m.jsx("div",{className:"h-screen w-72 border-r border-[#dde3eb] bg-white/70","aria-hidden":"true"}),d=m.jsx("div",{className:"min-h-[240px] rounded-3xl border border-[#dde3eb] bg-white/70","aria-hidden":"true"}),[l,h]=f.useState("Dashboard"),p=f.useRef(null),g=f.useRef(null),[w,T]=f.useState(!1),[v,A]=f.useState(!1),y=t,[b,P]=f.useState(y?.level||1),[S,I]=f.useState(y?.currentXP||0),[x,R]=f.useState(y?.totalXP||0),L=Math.floor(100*Math.pow(1.5,b-1));let _=0;for(let D=1;D{e&&n==="student"&&t&&sm(t.uid).then(D=>{if(D&&D.averageScore>0){const M=Math.min(D.averageScore/25,4).toFixed(2);Ht(M)}}).catch(D=>console.error("Error loading progress for GPA:",D))},[e,n,t]);const[st,gn]=f.useState(!1);f.useEffect(()=>{y&&n==="student"?(P(y.level||1),I(y.currentXP||0),R(y.totalXP||0),ye(y.streak||0),xt(y.atRiskSubjects||[]),tt(y.priorityTopics||[]),pe(y.hasTakenDiagnostic||!1),We(y.learningPathState||"unlocked"),Fe(y.iarAssessmentState||"not_started"),gn(!0)):n!=="student"&&gn(!0)},[t,n]),f.useEffect(()=>{if(!e||n!=="student"){$t(!1);return}let D=!1;const M=()=>{D||$t(!0)},z=window.requestIdleCallback,Y=window.cancelIdleCallback,Pe=window.setTimeout(M,800),Jn=window.requestAnimationFrame(()=>{z||M()}),Oi=z?.(()=>{M()},{timeout:500});return()=>{D=!0,window.clearTimeout(Pe),window.cancelAnimationFrame(Jn),Oi!==void 0&&Y&&Y(Oi)}},[e,n]),f.useEffect(()=>{let D=!1;return(async()=>{if(!e||n!=="student"){wt(0);return}const z=y?.lrn||t?.uid;if(!z||ft!=="locked_pending_deep_diagnostic"){wt(0);return}try{const{getPendingDeepDiagnosticCount:Y}=await W(async()=>{const{getPendingDeepDiagnosticCount:Jn}=await import("./automationService-DNyauqGd.js");return{getPendingDeepDiagnosticCount:Jn}},__vite__mapDeps([0,1,2,3,4,5,6])),Pe=await Y(z);D||wt(Pe)}catch(Y){console.error("Error loading deep diagnostic assignments:",Y)}})(),()=>{D=!0}},[e,n,t?.uid,y?.lrn,ft]);const St=n==="student"&&(ft==="locked_pending_deep_diagnostic"||nt==="deep_diagnostic_required"||nt==="deep_diagnostic_in_progress")&&(qt>0||nt==="deep_diagnostic_required"||nt==="deep_diagnostic_in_progress"),He=n==="student"&&nt==="skipped_unassessed",Xt=f.useMemo(()=>{const D=new Set;return Re.map(z=>Ss(z)).filter(z=>z!==null).filter(z=>D.has(z)?!1:(D.add(z),!0))},[Re]),Gt=f.useMemo(()=>{const D=Wt.length>0?Wt:Xt,M=new Set;return D.filter(z=>M.has(z)?!1:(M.add(z),!0))},[Wt,Xt]),yn=()=>{zt("initial_assessment"),Qe(!0)},ke=(D,M)=>{if(D==="Modules"&&St){Ae.info(`Complete your deep diagnostic (${qt} outstanding) to unlock modules and regular practice.`),zt("followup_diagnostic"),Qe(!0),h("Dashboard");return}M?re(M):D==="Modules"&&l!=="Modules"&&re(null),h(D),A(!1)};f.useEffect(()=>{e&&n==="student"&&t&&nm(t.uid).then(D=>{ye(D)})},[e,n,t]),f.useEffect(()=>{C({})},[t?.uid]);const j=[...Re].sort().join("|"),Q=t?.uid?`mathpulse_supplemental_dismissed_${t.uid}`:null;f.useEffect(()=>{if(!Q){ve("");return}try{const D=localStorage.getItem(Q)||"";ve(D)}catch{ve("")}},[Q]);const de=()=>{if(j&&(ve(j),!!Q))try{localStorage.setItem(Q,j)}catch{}},Se=()=>{if(ve(""),!!Q)try{localStorage.removeItem(Q)}catch{}},Tt=Re.length>0&&we!==j;f.useEffect(()=>{(async()=>{if(!t?.uid){te(_n);return}try{const M=await yl(t.uid);te(M)}catch(M){console.error("Error loading user settings:",M),te(_n)}})()},[t?.uid]),f.useEffect(()=>{om(F)},[F]),f.useEffect(()=>{if(e&&n==="student"&&st&&!Ut){const D=setTimeout(()=>{zt("initial_assessment"),Qe(!0)},1e3);return()=>clearTimeout(D)}},[e,n,st,Ut]);const he=async D=>{const M=y?.lrn||t?.uid;if(D.status==="skipped"){if(xt([]),tt([]),pe(!0),We("unlocked"),Fe("skipped_unassessed"),t?.uid)try{await ys(t.uid,{hasTakenDiagnostic:!0,atRiskSubjects:[],priorityTopics:[],learningPathState:"unlocked",remediationState:"not_required",iarAssessmentState:"skipped_unassessed",recommendedNextTopicGroupId:"g11-q1-functions-foundations",recommendationRationale:"Default Grade 11 Q1 path after explicit IAR skip.",recommendedPace:"normal",startingQuarterG11:"Q1",currentCurriculumVersionSetId:y?.currentCurriculumVersionSetId||"g11-core-genmath-legacy-detail-strengthened-structure"}),await tm(t.uid,"reminder","IAR Skipped: You are on default path","You are currently marked as Unassessed and placed on Grade 11 Quarter 1 default flow. Take the Initial Assessment anytime for personalized placement.")}catch(Pe){console.error("Failed to persist skipped IAR state:",Pe)}Ae.message("Assessment skipped. Default Grade 11 Q1 path applied.",{description:"You can take the Initial Assessment later for personalized recommendations."}),Qe(!1),h("Dashboard");return}Se();const z=(D.atRiskSubjectIds||[]).map(Pe=>Ss(Pe)).filter(Pe=>Pe!==null),Y=(D.priorityTopics||[]).map(Pe=>Ss(Pe)).filter(Pe=>Pe!==null);if(xt(z.length>0?z:D.atRiskSubjectIds||[]),tt(Y),pe(!0),Fe("in_progress"),t?.uid)try{await ys(t.uid,{hasTakenDiagnostic:!0,atRiskSubjects:z,priorityTopics:Y,topicScores:D.topicScores,iarTopicClassifications:D.topicClassifications,g12ReadinessIndicators:D.g12ReadinessIndicators,iarAssessmentState:"in_progress",iarQuestionSetVersion:D.questionSetVersion})}catch(Pe){console.error("Failed to persist completed IAR payload:",Pe)}Ve==="followup_diagnostic"&&Ae.success("Deep diagnostic submitted. Module unlock will update after assignment-state verification."),Ve==="initial_assessment"&&M&&((D.atRiskSubjectIds||[]).length>0&&Kt==="iar_plus_diagnostic"||Ae.success("Initial assessment completed. Personalized path is now active.")),Qe(!1),h("Dashboard")},Me=()=>{h("AI Chat")},Pt=async(D,M)=>{if(t)try{const z=await pl(t.uid,D,"manual",M);I(z.xp),z.leveledUp&&P(z.newLevel),R(Y=>Y+D),await i(),U({show:!0,xp:D,message:M})}catch(z){console.error("Error awarding XP:",z)}},Te=async()=>{try{await cp(),C({}),h("Dashboard"),K(!1)}catch(D){console.error("Error logging out:",D)}},me=async D=>{if(!t){O(!1),ee(!1);return}const M={};["name","email","phone","photo","avatarLayers","lrn","grade","section","school","enrollmentDate","major","gpa","department","subject","yearsOfExperience","qualification","position"].forEach(Y=>{D[Y]!==void 0&&(M[Y]=D[Y])});try{await ys(t.uid,M),C(Y=>({...Y,...M})),O(!1),ee(!1),Ae.success("Profile updated successfully")}catch(Y){console.error("Error saving profile:",Y),Ae.error("Failed to update profile")}},At=async D=>{if(t?.uid)try{const M=await rm(t.uid,D);te(M),Ae.success("Settings saved successfully")}catch(M){throw console.error("Error saving settings:",M),Ae.error("Failed to save settings"),M}},Be=async D=>{try{await up(D),Ae.success("Password updated successfully")}catch(M){const z=M instanceof Error?M.message:"Unable to update password";throw Ae.error(z),M}},vn=async()=>{if(!t?.uid)return;const D=await lm(t.uid),M=new Blob([JSON.stringify(D,null,2)],{type:"application/json"}),z=URL.createObjectURL(M),Y=document.createElement("a");Y.href=z,Y.download=`mathpulse-data-export-${t.uid}-${Date.now()}.json`,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y),URL.revokeObjectURL(z),Ae.success("Data export downloaded")},Yn=async()=>{await am(),Ae.success("Local cache cleared")},Qn=async()=>{if(!t?.uid||n!=="admin")throw new Error("Only admin accounts can delete this account from settings.");try{await dp(t.uid),Ae.success("Account deleted successfully")}catch(D){const M=D instanceof Error?D.message:"Unable to delete account";throw Ae.error(M),D}},Zn=async()=>{if(!t)throw new Error("No active profile found.");const D=n==="student"?y?.lrn||t.uid:void 0,{resetTestingDataForRole:M}=await W(async()=>{const{resetTestingDataForRole:Y}=await import("./testResetService-DejIVH8F.js");return{resetTestingDataForRole:Y}},__vite__mapDeps([99,1,2,3,4,5,6])),z=await M({uid:t.uid,role:n,lrn:D});n==="student"&&(P(1),I(0),R(0),ye(0),xt([]),pe(!1),We("unlocked"),Fe("not_started"),Ht("0.00"),wt(0),h("Dashboard")),Ae.success(z.summary)},Le=t?{uid:t.uid,name:t.name,email:t.email,phone:t.phone||"",photo:t.photo||"https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=200&h=200&fit=crop",avatarLayers:t.avatarLayers,role:t.role,...n==="student"&&y?{lrn:y.lrn,grade:y.grade,section:y.section,school:y.school,enrollmentDate:y.enrollmentDate,major:y.major,gpa:Gn}:{},...B}:{uid:void 0,name:"User",email:"",phone:"",photo:"https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=200&h=200&fit=crop",avatarLayers:void 0,role:n},Ni=Le.name.trim().split(/\s+/).find(D=>/\p{L}/u.test(D))||Le.name.trim()||"User";return f.useEffect(()=>{const D=M=>{if(!(M.target instanceof HTMLInputElement||M.target instanceof HTMLTextAreaElement)&&M.altKey)switch(M.key.toLowerCase()){case"d":M.preventDefault(),ke("Dashboard");break;case"m":M.preventDefault(),ke("Modules");break;case"c":M.preventDefault(),ke("AI Chat");break;case"g":M.preventDefault(),ke("Grades");break;case"b":M.preventDefault(),ke("Quiz Battle");break;case"s":M.preventDefault(),ee(!0);break;case"p":M.preventDefault(),O(!0);break;case"k":M.preventDefault(),ue(z=>!z);break}};if(e&&n==="student")return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[e,n,St,qt]),s?m.jsx(Qt,{}):e?n!=="student"||st?n==="teacher"?m.jsxs(m.Fragment,{children:[m.jsx(f.Suspense,{fallback:m.jsx(Qt,{message:"Loading teacher dashboard..."}),children:m.jsx(Nm,{onLogout:Te,onOpenProfile:()=>O(!0),onOpenSettings:()=>ee(!0)})}),V&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(Ts,{isOpen:V,onClose:()=>O(!1),profileData:Le,onSave:me})}),q&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(Ps,{isOpen:q,onClose:()=>ee(!1),profileData:Le,onSave:me,settingsData:F,onSaveSettings:At,onApplySettingsPreview:te,onUpdatePassword:Be,onExportData:vn,onClearCache:Yn,onDeleteAccount:Qn,onResetData:Zn})}),m.jsx(ws,{position:"top-right",richColors:!0,closeButton:!0})]}):n==="admin"?m.jsxs(m.Fragment,{children:[m.jsx(f.Suspense,{fallback:m.jsx(Qt,{message:"Loading admin dashboard..."}),children:m.jsx(Om,{onLogout:Te,onOpenProfile:()=>O(!0),onOpenSettings:()=>ee(!0)})}),V&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(Ts,{isOpen:V,onClose:()=>O(!1),profileData:Le,onSave:me})}),q&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(Ps,{isOpen:q,onClose:()=>ee(!1),profileData:Le,onSave:me,settingsData:F,onSaveSettings:At,onApplySettingsPreview:te,onUpdatePassword:Be,onExportData:vn,onClearCache:Yn,onDeleteAccount:Qn,onResetData:Zn})}),m.jsx(ws,{position:"top-right",richColors:!0,closeButton:!0})]}):m.jsxs(m.Fragment,{children:[m.jsx(em,{children:m.jsxs("div",{className:"flex h-screen w-full bg-[#f8faff] overflow-hidden",children:[m.jsx("div",{className:"hidden lg:block",children:m.jsx(f.Suspense,{fallback:u,children:m.jsx(po,{activeTab:l,setActiveTab:ke,userRole:n,onOpenSettings:()=>ee(!0),onLogout:()=>K(!0),sidebarCollapsed:w,setSidebarCollapsed:T})})}),v&&m.jsxs(m.Fragment,{children:[m.jsx("button",{"aria-label":"Close navigation",className:"fixed inset-0 z-40 bg-slate-900/40 backdrop-blur-[1px] lg:hidden",onClick:()=>A(!1)}),m.jsx("div",{className:"fixed inset-y-0 left-0 z-50 p-3 lg:hidden",children:m.jsx(f.Suspense,{fallback:u,children:m.jsx(po,{mode:"mobile",onRequestClose:()=>A(!1),activeTab:l,setActiveTab:ke,userRole:n,onOpenSettings:()=>{ee(!0),A(!1)},onLogout:()=>{K(!0),A(!1)},sidebarCollapsed:!1})})})]}),m.jsxs("div",{className:"flex-1 min-h-0 flex flex-col min-w-0 bg-gradient-to-br from-indigo-200 via-fuchsia-50 to-orange-100 relative z-10 shadow-[rgba(124,58,237,0.05)_0px_0px_30px_inset]",children:[m.jsx("div",{className:"absolute inset-0 bg-math-pattern opacity-30 pointer-events-none mix-blend-multiply z-0"}),m.jsxs("header",{className:"bg-white/90 backdrop-blur-md border-b border-[#dde3eb] px-3 sm:px-6 py-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sticky top-0 z-30 shadow-sm",children:[m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m.jsx("button",{className:"lg:hidden p-2 rounded-xl bg-[#edf1f7] hover:bg-[#dde3eb] text-[#5a6578] hover:text-primary transition-colors",onClick:()=>A(!0),"aria-label":"Open navigation",children:m.jsx(Zf,{size:20})}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("h1",{className:"text-lg sm:text-xl font-display font-bold text-[#0a1628] leading-tight truncate",children:l}),m.jsxs("p",{className:"text-xs text-[#5a6578] font-body truncate",children:["Welcome back, ",Le.name.split(" ")[0],"!"]})]}),m.jsxs("div",{className:"hidden md:flex items-center gap-2 ml-2",children:[m.jsxs("button",{onClick:()=>$(!0),className:"flex items-center gap-1.5 px-3 py-1.5 bg-rose-50 hover:bg-rose-100 border border-rose-200/60 rounded-lg transition-colors cursor-pointer group",title:"View Rewards & Progress",children:[m.jsx(Xf,{className:"h-3.5 w-3.5 text-rose-500","aria-hidden":"true"}),m.jsxs("span",{className:"text-xs font-display font-bold text-rose-700",children:["Lv ",b]})]}),m.jsxs("button",{onClick:()=>$(!0),className:"flex items-center gap-1.5 px-3 py-1.5 bg-violet-50 hover:bg-violet-100 border border-violet-200/60 rounded-lg transition-colors cursor-pointer",title:`${ae}/${L} XP to next level`,children:[m.jsx(np,{className:"h-3.5 w-3.5 text-violet-500","aria-hidden":"true"}),m.jsxs("span",{className:"text-xs font-display font-bold text-violet-700",children:[S," XP"]}),m.jsx("div",{className:"w-12 h-1.5 bg-violet-100 rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-violet-500 rounded-full transition-all",style:{width:`${ae/L*100}%`}})})]}),m.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-orange-50 border border-orange-200/60 rounded-lg",children:[m.jsx(Yf,{className:"h-3.5 w-3.5 text-orange-500","aria-hidden":"true"}),m.jsxs("span",{className:"text-xs font-display font-bold text-orange-700",children:[se," day",se!==1?"s":""]})]})]})]}),m.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-2 min-w-0",children:[m.jsx("div",{className:"hidden md:block flex-1 min-w-0 max-w-[420px]",children:m.jsx(f.Suspense,{fallback:c,children:m.jsx(Um,{onSelect:D=>{}})})}),m.jsx("button",{onClick:()=>ue(D=>!D),className:"p-3 rounded-xl bg-[#edf1f7] hover:bg-[#dde3eb] text-[#5a6578] hover:text-primary transition-all group",title:"Scientific Calculator (Alt+K)",children:m.jsx(qf,{size:20,className:"group-hover:scale-110 transition-transform"})}),m.jsx(f.Suspense,{fallback:a,children:m.jsx(zm,{userRole:n})}),m.jsxs("button",{onClick:()=>O(!0),className:"flex items-center gap-2.5 h-11 shrink-0 bg-[#edf1f7] hover:bg-[#dde3eb] p-1.5 pr-3 rounded-lg cursor-pointer transition-all group","aria-label":`Profile: ${Le.name}`,children:[m.jsx("img",{src:Le.photo,alt:Le.name,className:"w-8 h-8 rounded-lg object-cover"}),m.jsx("div",{className:"hidden sm:block text-left min-w-0 flex-1",children:m.jsx("p",{className:"text-sm font-semibold text-[#0a1628] leading-none group-hover:text-primary transition-colors font-body truncate",children:Ni})})]})]})]}),m.jsx("main",{ref:g,className:`flex-1 min-h-0 p-3 lg:p-4 ${l==="AI Chat"?"overflow-hidden":"overflow-y-auto pb-24 sm:pb-28"}`,children:m.jsx(Dh,{mode:"wait",children:m.jsx(Vn.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.25,ease:[.22,1,.36,1]},className:l==="AI Chat"?"h-full min-h-0":"",children:l==="Dashboard"?m.jsx("div",{className:"px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:m.jsxs("div",{className:"grid grid-cols-12 gap-6 sm:gap-8 lg:gap-10",children:[m.jsxs("div",{className:"col-span-12 xl:col-span-9 flex flex-col gap-10 lg:gap-14 pt-0",children:[m.jsx(f.Suspense,{fallback:d,children:m.jsx(Fm,{userName:Ni,userLevel:b,avatarLayers:Le.avatarLayers,onContinueLearning:()=>ke("Modules"),showAssessmentTooltip:He,onOpenAssessment:yn})}),ht&&Ut&&Xt.length>0&&m.jsxs("div",{className:"rounded-2xl border border-amber-300 bg-amber-50 px-5 py-4 shadow-sm dark:border-amber-400/40 dark:bg-amber-400/10",children:[m.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[m.jsxs("div",{children:[m.jsxs("p",{className:"inline-flex items-center gap-2 text-sm font-black text-amber-900 dark:text-amber-200",children:[m.jsx(ep,{className:"h-4 w-4"}),"Assessment Focus Review"]}),m.jsx("p",{className:"mt-1 text-sm text-amber-900/85 dark:text-amber-100/90",children:"Your latest diagnostic flagged these topics for review. Modules are prioritized based on this focus order."})]}),m.jsxs("button",{type:"button",onClick:()=>ke("Modules"),className:"inline-flex items-center gap-1.5 rounded-xl bg-amber-600 px-3 py-2 text-xs font-bold text-white transition-colors hover:bg-amber-700",children:["Open Modules",m.jsx(zf,{className:"h-3.5 w-3.5"})]})]}),m.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:Gt.map((D,M)=>m.jsxs("span",{className:"rounded-full bg-white/90 px-3 py-1 text-xs font-semibold text-amber-900 shadow-sm dark:bg-amber-100/20 dark:text-amber-100",children:[M+1,". ",_m[D]]},D))})]}),ht&&Tt&&m.jsx(f.Suspense,{fallback:r,children:m.jsx(Wm,{variant:"full",atRiskSubjects:Re,onDismiss:de,onAction:()=>{de(),ke("Modules")}})}),st&&ht&&m.jsx(f.Suspense,{fallback:r,children:m.jsx("div",{className:"pb-4",children:m.jsx(Hm,{onNavigateToModules:D=>ke("Modules",D),atRiskSubjects:Re,priorityTopics:Gt})})}),st&&ht&&m.jsx(f.Suspense,{fallback:r,children:m.jsx("div",{className:"pb-4",children:m.jsx(qm,{})})})]}),m.jsx("div",{className:"col-span-12 xl:col-span-3 pt-2",children:ht?m.jsx(f.Suspense,{fallback:d,children:m.jsx(Bm,{onOpenRewards:()=>$(!0),onOpenLeaderboard:()=>h("Leaderboard"),onNavigateToModules:()=>h("Modules"),userLevel:b,currentXP:ae,xpToNextLevel:L,overallXP:S,streak:se,streakHistory:y?.streakHistory||[]})}):d})]})}):l==="Modules"?m.jsx(f.Suspense,{fallback:o,children:m.jsx(Km,{onEarnXP:Pt,atRiskSubjects:Re,priorityTopics:Gt,initialModuleId:G})}):l==="Leaderboard"?m.jsx(f.Suspense,{fallback:o,children:m.jsx(Ym,{currentUserPhoto:Le.photo})}):l==="Quiz Battle"?m.jsx(f.Suspense,{fallback:o,children:m.jsx(Qm,{})}):l==="AI Chat"?m.jsx(f.Suspense,{fallback:o,children:m.jsx(Xm,{})}):l==="Grades"?m.jsx(f.Suspense,{fallback:o,children:m.jsx(Gm,{})}):l==="Avatar Studio"?m.jsx(f.Suspense,{fallback:o,children:m.jsx(Zm,{onSaveProfile:D=>{C(M=>({...M,avatarLayers:D}))},onNavigateToModules:()=>h("Modules")})}):m.jsxs("div",{className:"flex-1 flex items-center justify-center text-[#a8a5b3] font-medium font-body",children:[l," Content Coming Soon"]})},l)})}),l!=="AI Chat"&&m.jsx(f.Suspense,{fallback:null,children:m.jsx("div",{className:"fixed bottom-4 right-4 sm:bottom-8 sm:right-8 z-50",children:m.jsx(Jm,{constraintsRef:p,onFullScreen:Me})})}),m.jsx(f.Suspense,{fallback:null,children:m.jsx($m,{xp:N.xp,message:N.message,show:N.show,onComplete:()=>U(D=>({...D,show:!1}))})}),De&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(eg,{isOpen:De,onClose:()=>$(!1),userLevel:b,currentXP:S,xpToNextLevel:L,totalXP:x,streak:se})}),V&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(Ts,{isOpen:V,onClose:()=>O(!1),profileData:Le,onSave:me})}),le&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(tg,{isOpen:le,onClose:()=>K(!1),onConfirm:Te,title:"Confirm Logout",message:"Are you sure you want to log out? Your progress is saved automatically.",confirmText:"Logout",cancelText:"Stay",type:"warning",icon:"logout"})}),q&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(Ps,{isOpen:q,onClose:()=>ee(!1),profileData:Le,onSave:me,settingsData:F,onSaveSettings:At,onApplySettingsPreview:te,onUpdatePassword:Be,onExportData:vn,onClearCache:Yn,onDeleteAccount:Qn,onResetData:Zn})}),X&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(ng,{isOpen:X,onClose:()=>ue(!1)})}),et&&m.jsx(f.Suspense,{fallback:null,children:m.jsx(sg,{isOpen:et,onClose:()=>Qe(!1),onComplete:he,lrn:y?.lrn||t?.uid,gradeLevel:y?.grade,workflowMode:Kt,assessmentType:Ve})})]})]})}),m.jsx(ws,{position:"top-right",richColors:!0,closeButton:!0})]}):m.jsx(Qt,{message:"Preparing your dashboard..."}):m.jsx(f.Suspense,{fallback:m.jsx(Qt,{message:"Loading sign in..."}),children:m.jsx(jm,{})})};let mo=!1;const go=()=>{mo||(mo=!0,W(()=>Promise.resolve({}),__vite__mapDeps([100])).catch(e=>{console.error("[styles] Deferred full stylesheet failed to load:",e)}))};if(typeof window<"u"){const e=window.requestIdleCallback,t=window.cancelIdleCallback,n=e?.(()=>{go()},{timeout:1200});window.setTimeout(()=>{n!==void 0&&t&&t(n),go()},1200)}const vl=document.getElementById("root");if(!vl)throw new Error("Root element not found");xl.createRoot(vl).render(m.jsx(hp,{children:m.jsx(ig,{})}));export{zf as A,wg as B,qf as C,_n as D,fg as E,Yf as F,lt as G,ip as H,Wf as I,Ag as J,Pg as K,ys as L,Zf as M,Sg as N,tm as O,Vi as P,Rp as Q,ep as T,np as Z,W as _,mg as a,gg as b,dt as c,H as d,Dh as e,yl as f,sm as g,rm as h,Xf as i,vg as j,xg as k,bg as l,Vn as m,Ss as n,Mg as o,Eg as p,Rg as q,Dg as r,pg as s,Ae as t,ol as u,Cg as v,kg as w,_m as x,yg as y,Tg as z}; diff --git a/assets/input-DBkKXOmF.js b/assets/input-DBkKXOmF.js deleted file mode 100644 index 2e504c9a1ad3bc930f00a2f7181101938380f9e7..0000000000000000000000000000000000000000 --- a/assets/input-DBkKXOmF.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./vendor-react-Dexh7fmo.js";import{c as n}from"./utils-BQQgILNW.js";function a({className:e,type:i,...r}){return t.jsx("input",{type:i,"data-slot":"input",className:n("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","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",e),...r})}export{a as I}; diff --git a/assets/loader-circle-J8Mwbkkw.js b/assets/loader-circle-J8Mwbkkw.js deleted file mode 100644 index 847e6aa4d4d720d16611dcbd3557c551c9968204..0000000000000000000000000000000000000000 --- a/assets/loader-circle-J8Mwbkkw.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=c("loader-circle",e);export{a as L}; diff --git a/assets/lock-_59co5m5.js b/assets/lock-_59co5m5.js deleted file mode 100644 index 5711b824d0479bf0007f644b0e7cd203350b6f7e..0000000000000000000000000000000000000000 --- a/assets/lock-_59co5m5.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],t=c("lock",e);export{t as L}; diff --git a/assets/log-out-BqGKt-tT.js b/assets/log-out-BqGKt-tT.js deleted file mode 100644 index 6ea437a8c3305c8f3acc435444dfcf9f2a8f51fc..0000000000000000000000000000000000000000 --- a/assets/log-out-BqGKt-tT.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as o}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],a=o("log-out",e);export{a as L}; diff --git a/assets/mail-D7el5vSX.js b/assets/mail-D7el5vSX.js deleted file mode 100644 index b2c6e69c2f67c00e3215cc8a4dc9c51b3b45df7e..0000000000000000000000000000000000000000 --- a/assets/mail-D7el5vSX.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],t=c("mail",e);export{t as M}; diff --git a/assets/message-square-DSAS4TVL.js b/assets/message-square-DSAS4TVL.js deleted file mode 100644 index 3219a41bea6fb3194b65ff6ad05b48732283ff8d..0000000000000000000000000000000000000000 --- a/assets/message-square-DSAS4TVL.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],o=e("message-square",a);export{o as M}; diff --git a/assets/minus-oFhmD2--.js b/assets/minus-oFhmD2--.js deleted file mode 100644 index 8e1de0446ad1747bfa14c86b6f1b9838502ca24d..0000000000000000000000000000000000000000 --- a/assets/minus-oFhmD2--.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as o}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["path",{d:"M5 12h14",key:"1ays0h"}]],e=o("minus",c);export{e as M}; diff --git a/assets/pen-line-Vok2l3fc.js b/assets/pen-line-Vok2l3fc.js deleted file mode 100644 index 45c65c96d086731c8a60c087888229dbd2c0a406..0000000000000000000000000000000000000000 --- a/assets/pen-line-Vok2l3fc.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],n=e("pen-line",a);export{n as P}; diff --git a/assets/plus-BxxucBR0.js b/assets/plus-BxxucBR0.js deleted file mode 100644 index 42419bfc326a62923d07db418af3300372211df9..0000000000000000000000000000000000000000 --- a/assets/plus-BxxucBR0.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c=e("plus",o);export{c as P}; diff --git a/assets/quizService-CI5e0QMr.js b/assets/quizService-CI5e0QMr.js deleted file mode 100644 index 75d0bd3d4fdaad9fe3bf8ccd323a2a7ba1e93d83..0000000000000000000000000000000000000000 --- a/assets/quizService-CI5e0QMr.js +++ /dev/null @@ -1,11 +0,0 @@ -import{c as A,d as i}from"./index-D4nJsLyx.js";import{d as o,e as r,s as f,q as z,w as m,o as L,f as b,u as g,c as M,a as d}from"./vendor-firebase-firestore-BML5nJHm.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const D=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],x=A("layers",D);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const I=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],R=A("lightbulb",I),N=e=>{if(!(e instanceof Error))return!1;const t=e.code,s=(e.message||"").toLowerCase();return t==="failed-precondition"&&s.includes("requires an index")},w=e=>{if(!e)return 0;if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;if(typeof e=="string"){const t=Date.parse(e);return Number.isNaN(t)?0:t}if(typeof e=="object"){const t=e;if(typeof t.toMillis=="function")return t.toMillis();if(typeof t.seconds=="number")return t.seconds*1e3}return 0};async function _(e,t,s){const a=s?.documentId?o(i,"generatedQuizzes",s.documentId):o(r(i,"generatedQuizzes")),n={...e,teacherId:t,createdAt:d(),status:"draft"};return s?.documentId?await f(a,n,{merge:!0}):await f(a,n),a.id}async function B(e){await g(o(i,"generatedQuizzes",e),{status:"published",publishedAt:d()})}async function C(e){await M(o(i,"generatedQuizzes",e))}async function j(e,t,s){await g(o(i,"generatedQuizzes",e),{status:"assigned","metadata.assignedTo":t,assignedBy:s,assignedAt:d()});const a=o(r(i,"quizAssignments"));await f(a,{quizId:e,lrn:t,teacherId:s,status:"pending",assignedAt:d(),dueDate:null});const n=o(r(i,"notifications"));await f(n,{userId:t,type:"quiz_assigned",title:"New Quiz Assigned",message:"Your teacher has assigned you a new quiz. Complete it to earn XP!",quizId:e,read:!1,createdAt:d()})}async function E(e){try{const t=z(r(i,"generatedQuizzes"),m("teacherId","==",e),L("createdAt","desc"));return(await b(t)).docs.map(a=>({id:a.id,...a.data()}))}catch(t){if(!N(t))throw t;const s=z(r(i,"generatedQuizzes"),m("teacherId","==",e));return(await b(s)).docs.map(n=>({id:n.id,...n.data()})).sort((n,l)=>w(l.createdAt)-w(n.createdAt))}}async function G(e,t,s,a,n,l,Q,q,p,y){const h=o(r(i,"quizSubmissions"));if(await f(h,{submissionId:h.id,lrn:e,quizId:t,generatedQuizId:s??null,subject:a,source:n,score:l,xpEarned:Q,totalTime:q,answers:p,correctCount:p.filter(c=>c.correct).length,totalQuestions:p.length,questionBreakdown:p.map((c,u)=>({questionId:c.questionId,topic:y[u]?.topic??a,difficulty:y[u]?.difficulty??"medium",bloomLevel:y[u]?.bloomLevel??"understand",correct:c.correct,timeSpent:c.timeSpent})),submittedAt:d()}),s){const c=z(r(i,"quizAssignments"),m("quizId","==",s),m("lrn","==",e)),u=await b(c);for(const k of u.docs)await g(k.ref,{status:"completed",completedAt:d(),score:l});try{await g(o(i,"generatedQuizzes",s),{status:"completed"})}catch{}}}export{R as L,x as a,j as b,G as c,C as d,E as f,B as p,_ as s}; diff --git a/assets/save-Og8yP5Yb.js b/assets/save-Og8yP5Yb.js deleted file mode 100644 index dde4be9b401fc0344b2e14c994bf1020aeaea22b..0000000000000000000000000000000000000000 --- a/assets/save-Og8yP5Yb.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],o=a("save",e);export{o as S}; diff --git a/assets/search-Do6u3pFt.js b/assets/search-Do6u3pFt.js deleted file mode 100644 index b76e3fdb900e8c3a88b095c91fad92f22aeb195f..0000000000000000000000000000000000000000 --- a/assets/search-Do6u3pFt.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],r=c("search",e);export{r as S}; diff --git a/assets/select-Co4o1EaI.js b/assets/select-Co4o1EaI.js deleted file mode 100644 index ab26b25ebf57a9ff6aa0abde4783e19e00d9464a..0000000000000000000000000000000000000000 --- a/assets/select-Co4o1EaI.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./vendor-react-Dexh7fmo.js";import{i as l,j as i,k as d,V as c,l as u,m,n as p,o as f,p as x,q as g,S as v,r as h}from"./vendor-radix-BRdei-zg.js";import{c as r}from"./utils-BQQgILNW.js";import{a as n,C as b}from"./chevron-up-Bfmq3Clw.js";import{C as j}from"./check-BACdUlFL.js";function _({...t}){return e.jsx(l,{"data-slot":"select",...t})}function I({...t}){return e.jsx(c,{"data-slot":"select-value",...t})}function B({className:t,size:a="default",children:s,...o}){return e.jsxs(i,{"data-slot":"select-trigger","data-size":a,className:r("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...o,children:[s,e.jsx(d,{asChild:!0,children:e.jsx(n,{className:"size-4 opacity-50"})})]})}function V({className:t,children:a,position:s="popper",...o}){return e.jsx(u,{children:e.jsxs(m,{"data-slot":"select-content",className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...o,children:[e.jsx(w,{}),e.jsx(p,{className:r("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(y,{})]})})}function D({className:t,children:a,...s}){return e.jsxs(f,{"data-slot":"select-item",className:r("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(x,{children:e.jsx(j,{className:"size-4"})})}),e.jsx(g,{children:a})]})}function w({className:t,...a}){return e.jsx(v,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(b,{className:"size-4"})})}function y({className:t,...a}){return e.jsx(h,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(n,{className:"size-4"})})}export{_ as S,B as a,I as b,V as c,D as d}; diff --git a/assets/send-NQY-QTkN.js b/assets/send-NQY-QTkN.js deleted file mode 100644 index d7c31813f374faf1699b55f35be887c267b0a3d1..0000000000000000000000000000000000000000 --- a/assets/send-NQY-QTkN.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],o=a("send",e);export{o as S}; diff --git a/assets/shield-L33jkK5w.js b/assets/shield-L33jkK5w.js deleted file mode 100644 index 883fa5c3237122719902ec566fc4cdd337727b97..0000000000000000000000000000000000000000 --- a/assets/shield-L33jkK5w.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],a=c("shield",e);export{a as S}; diff --git a/assets/shield-check-B_yHzqcC.js b/assets/shield-check-B_yHzqcC.js deleted file mode 100644 index b40a6d324fc02184c78dad768a7f3adae6f9424d..0000000000000000000000000000000000000000 --- a/assets/shield-check-B_yHzqcC.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],o=c("shield-check",e);export{o as S}; diff --git a/assets/shirt-BMZy0pq4.js b/assets/shirt-BMZy0pq4.js deleted file mode 100644 index 47e88cf1d2142ccce79d442d6590f22931a18c46..0000000000000000000000000000000000000000 --- a/assets/shirt-BMZy0pq4.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]],t=a("shirt",c);export{t as S}; diff --git a/assets/skeleton-BUmMbOVs.js b/assets/skeleton-BUmMbOVs.js deleted file mode 100644 index d122003838ff5663dcd16fbb6b52f4f61fee26ae..0000000000000000000000000000000000000000 --- a/assets/skeleton-BUmMbOVs.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as o}from"./index-D4nJsLyx.js";import{j as c}from"./vendor-react-Dexh7fmo.js";import{c as a}from"./utils-BQQgILNW.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const r=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],m=o("copy",r);function d({className:e,...t}){return c.jsx("div",{"data-slot":"skeleton",className:a("bg-accent animate-pulse rounded-md",e),...t})}export{m as C,d as S}; diff --git a/assets/sparkles-CXUFmaBJ.js b/assets/sparkles-CXUFmaBJ.js deleted file mode 100644 index 6d1fe1a95dccdf433985dcfdf92158d060e52a57..0000000000000000000000000000000000000000 --- a/assets/sparkles-CXUFmaBJ.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],t=a("sparkles",e);export{t as S}; diff --git a/assets/star-dumQ9BVG.js b/assets/star-dumQ9BVG.js deleted file mode 100644 index 0249ab223bf450f07aec87289b5b8b3e9c51d102..0000000000000000000000000000000000000000 --- a/assets/star-dumQ9BVG.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],c=a("star",o);export{c as S}; diff --git a/assets/subjects-DDBtpdiA.js b/assets/subjects-DDBtpdiA.js deleted file mode 100644 index 11b80b4c41d1e254af24b9252505d2e0737438e9..0000000000000000000000000000000000000000 --- a/assets/subjects-DDBtpdiA.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a,C as o}from"./index-D4nJsLyx.js";import{T as l}from"./trending-up-D-vj8Gbq.js";import{C as s}from"./chart-column-D5mAWcRx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const d=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],c=a("sigma",d),t=[{id:"gen-math",code:"GEN MATH",name:"General Mathematics",gradeLevel:"Grade 11",semester:"1st Semester",color:"from-blue-500 to-cyan-500",topics:[{id:"gen-math-001",name:"Patterns and Real-Life Relationships",unit:"Patterns, Relations, and Functions"},{id:"gen-math-002",name:"Functions as Mathematical Models",unit:"Patterns, Relations, and Functions"},{id:"gen-math-003",name:"Function Notation and Evaluation",unit:"Patterns, Relations, and Functions"},{id:"gen-math-004",name:"Domain and Range of Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-005",name:"Operations on Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-006",name:"Composite Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-007",name:"Inverse Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-008",name:"Graphs of Rational Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-009",name:"Graphs of Exponential Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-010",name:"Graphs of Logarithmic Functions",unit:"Patterns, Relations, and Functions"},{id:"gen-math-011",name:"Simple and Compound Interest",unit:"Financial Mathematics"},{id:"gen-math-012",name:"Simple and General Annuities",unit:"Financial Mathematics"},{id:"gen-math-013",name:"Present and Future Value",unit:"Financial Mathematics"},{id:"gen-math-014",name:"Loans, Amortization, and Sinking Funds",unit:"Financial Mathematics"},{id:"gen-math-015",name:"Stocks, Bonds, and Market Indices",unit:"Financial Mathematics"},{id:"gen-math-016",name:"Business Decision-Making with Mathematical Models",unit:"Financial Mathematics"},{id:"gen-math-017",name:"Propositions and Logical Connectives",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-018",name:"Truth Values and Truth Tables",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-019",name:"Logical Equivalence and Implication",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-020",name:"Quantifiers and Negation",unit:"Logic and Mathematical Reasoning"},{id:"gen-math-021",name:"Validity of Arguments",unit:"Logic and Mathematical Reasoning"}]},{id:"stats-prob",code:"STAT&PROB",name:"Statistics and Probability",gradeLevel:"Grade 11",semester:"2nd Semester",color:"from-sky-500 to-cyan-500",topics:[{id:"stat-001",name:"Random Variables",unit:"Random Variables"},{id:"stat-002",name:"Discrete Probability Distributions",unit:"Random Variables"},{id:"stat-003",name:"Mean and Variance of Discrete RV",unit:"Random Variables"},{id:"stat-004",name:"Normal Distribution",unit:"Normal Distribution"},{id:"stat-005",name:"Standard Normal Distribution and Z-scores",unit:"Normal Distribution"},{id:"stat-006",name:"Areas Under the Normal Curve",unit:"Normal Distribution"},{id:"stat-007",name:"Sampling Distributions",unit:"Sampling and Estimation"},{id:"stat-008",name:"Central Limit Theorem",unit:"Sampling and Estimation"},{id:"stat-009",name:"Point Estimation",unit:"Sampling and Estimation"},{id:"stat-010",name:"Confidence Intervals",unit:"Sampling and Estimation"},{id:"stat-011",name:"Hypothesis Testing Concepts",unit:"Hypothesis Testing"},{id:"stat-012",name:"T-test",unit:"Hypothesis Testing"},{id:"stat-013",name:"Z-test",unit:"Hypothesis Testing"},{id:"stat-014",name:"Correlation and Regression",unit:"Correlation and Regression"}]},{id:"pre-calc",code:"PRE-CALC",name:"Pre-Calculus",gradeLevel:"Grade 12",semester:"1st Semester",color:"from-orange-500 to-red-500",topics:[{id:"pre-calc-001",name:"Conic Sections - Parabola",unit:"Analytic Geometry"},{id:"pre-calc-002",name:"Conic Sections - Ellipse",unit:"Analytic Geometry"},{id:"pre-calc-003",name:"Conic Sections - Hyperbola",unit:"Analytic Geometry"},{id:"pre-calc-004",name:"Conic Sections - Circle",unit:"Analytic Geometry"},{id:"pre-calc-005",name:"Systems of Nonlinear Equations",unit:"Analytic Geometry"},{id:"pre-calc-006",name:"Sequences and Series",unit:"Series and Induction"},{id:"pre-calc-007",name:"Arithmetic Sequences",unit:"Series and Induction"},{id:"pre-calc-008",name:"Geometric Sequences",unit:"Series and Induction"},{id:"pre-calc-009",name:"Mathematical Induction",unit:"Series and Induction"},{id:"pre-calc-010",name:"Binomial Theorem",unit:"Series and Induction"},{id:"pre-calc-011",name:"Angles and Unit Circle",unit:"Trigonometry"},{id:"pre-calc-012",name:"Trigonometric Functions",unit:"Trigonometry"},{id:"pre-calc-013",name:"Trigonometric Identities",unit:"Trigonometry"},{id:"pre-calc-014",name:"Sum and Difference Formulas",unit:"Trigonometry"},{id:"pre-calc-015",name:"Inverse Trigonometric Functions",unit:"Trigonometry"},{id:"pre-calc-016",name:"Polar Coordinates",unit:"Trigonometry"}]},{id:"basic-calc",code:"BASIC CALC",name:"Basic Calculus",gradeLevel:"Grade 12",semester:"2nd Semester",color:"from-green-500 to-teal-500",topics:[{id:"calc-001",name:"Limits of Functions",unit:"Limits"},{id:"calc-002",name:"Limit Theorems",unit:"Limits"},{id:"calc-003",name:"One-Sided Limits",unit:"Limits"},{id:"calc-004",name:"Infinite Limits and Limits at Infinity",unit:"Limits"},{id:"calc-005",name:"Continuity of Functions",unit:"Limits"},{id:"calc-006",name:"Definition of the Derivative",unit:"Derivatives"},{id:"calc-007",name:"Differentiation Rules",unit:"Derivatives"},{id:"calc-008",name:"Chain Rule",unit:"Derivatives"},{id:"calc-009",name:"Implicit Differentiation",unit:"Derivatives"},{id:"calc-010",name:"Higher-Order Derivatives",unit:"Derivatives"},{id:"calc-011",name:"Related Rates",unit:"Derivatives"},{id:"calc-012",name:"Extrema and the First Derivative Test",unit:"Derivatives"},{id:"calc-013",name:"Concavity and the Second Derivative Test",unit:"Derivatives"},{id:"calc-014",name:"Optimization Problems",unit:"Derivatives"},{id:"calc-015",name:"Antiderivatives and Indefinite Integrals",unit:"Integration"},{id:"calc-016",name:"Definite Integrals and the FTC",unit:"Integration"},{id:"calc-017",name:"Integration by Substitution",unit:"Integration"},{id:"calc-018",name:"Area Under a Curve",unit:"Integration"}]}],g=["Grade 11","Grade 12"];t.filter(i=>i.gradeLevel==="Grade 11"),t.filter(i=>i.gradeLevel==="Grade 12");const r={"Grade 11":["gen-math","pre-calc","stats-prob","basic-calc"],"Grade 12":["pre-calc","basic-calc","gen-math","stats-prob"]};function m(i){if(!i)return null;const e=i.trim().toLowerCase();return e==="grade 11"||e==="11"||e.includes("11")?"Grade 11":e==="grade 12"||e==="12"||e.includes("12")?"Grade 12":null}function b(i){const e=m(i);return e?r[e]:t.map(n=>n.id)}const k=[{id:"gen-math",title:"General Mathematics",description:"Functions, business math, and logic for Grade 11 Senior High School students.",icon:o,color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,totalModules:3,completedModules:0,rating:4.9,reviewCount:204,modules:[{id:"gm-1",title:"Functions and Their Graphs",description:"Evaluate, compose, and represent functions including rational, exponential, and logarithmic types.",color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,lessons:[{id:"gm-1-l1",title:"Patterns and Real-Life Relationships",duration:"15 min",completed:!1,locked:!1},{id:"gm-1-l2",title:"Functions as Mathematical Models",duration:"16 min",completed:!1,locked:!1},{id:"gm-1-l3",title:"Operations on Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l4",title:"Composite Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l5",title:"Function Notation and Evaluation",duration:"16 min",completed:!1,locked:!1},{id:"gm-1-l6",title:"Domain and Range of Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l7",title:"Inverse Functions",duration:"18 min",completed:!1,locked:!1},{id:"gm-1-l8",title:"Graphs of Rational Functions",duration:"20 min",completed:!1,locked:!1},{id:"gm-1-l9",title:"Graphs of Exponential Functions",duration:"20 min",completed:!1,locked:!1},{id:"gm-1-l10",title:"Graphs of Logarithmic Functions",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"gm-1-q1",title:"Practice Quiz: Functions",questions:10,duration:"15 min",completed:!1,locked:!1,type:"practice"},{id:"gm-1-q2",title:"Module Quiz: Functions and Graphs",questions:15,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"gm-2",title:"Business Mathematics",description:"Simple and compound interest, annuities, stocks, and bonds.",color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,lessons:[{id:"gm-2-l1",title:"Simple and Compound Interest",duration:"18 min",completed:!1,locked:!1},{id:"gm-2-l2",title:"Simple and General Annuities",duration:"20 min",completed:!1,locked:!1},{id:"gm-2-l3",title:"Present and Future Value",duration:"18 min",completed:!1,locked:!1},{id:"gm-2-l4",title:"Loans, Amortization, and Sinking Funds",duration:"20 min",completed:!1,locked:!1},{id:"gm-2-l5",title:"Stocks, Bonds, and Market Indices",duration:"18 min",completed:!1,locked:!1},{id:"gm-2-l6",title:"Business Decision-Making with Mathematical Models",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"gm-2-q1",title:"Practice Quiz: Interest",questions:12,duration:"18 min",completed:!1,locked:!1,type:"practice"},{id:"gm-2-q2",title:"Module Quiz: Business Math",questions:15,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"gm-3",title:"Logic",description:"Propositions, truth tables, logical equivalence, and valid arguments.",color:"bg-indigo-50",iconColor:"text-indigo-600",accentColor:"bg-indigo-600",progress:0,lessons:[{id:"gm-3-l1",title:"Propositions and Connectives",duration:"15 min",completed:!1,locked:!1},{id:"gm-3-l2",title:"Truth Values and Truth Tables",duration:"18 min",completed:!1,locked:!1},{id:"gm-3-l3",title:"Logical Equivalence and Implication",duration:"18 min",completed:!1,locked:!1},{id:"gm-3-l4",title:"Quantifiers and Negation",duration:"18 min",completed:!1,locked:!1},{id:"gm-3-l5",title:"Validity of Arguments",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"gm-3-q1",title:"Practice Quiz: Logic",questions:10,duration:"15 min",completed:!1,locked:!1,type:"practice"},{id:"gm-3-q2",title:"Module Quiz: Logic",questions:12,duration:"18 min",completed:!1,locked:!0,type:"module"}]}]},{id:"pre-calc",title:"Pre-Calculus",description:"Analytic geometry, trigonometry, and series for Grade 12 STEM students.",icon:l,color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,totalModules:3,completedModules:0,rating:4.7,reviewCount:192,modules:[{id:"pc-1",title:"Analytic Geometry",description:"Conic sections: circles, parabolas, ellipses, and hyperbolas.",color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,lessons:[{id:"pc-1-l1",title:"Conic Sections - Parabola",duration:"22 min",completed:!1,locked:!1},{id:"pc-1-l2",title:"Conic Sections - Ellipse",duration:"24 min",completed:!1,locked:!1},{id:"pc-1-l3",title:"Conic Sections - Hyperbola",duration:"24 min",completed:!1,locked:!1},{id:"pc-1-l4",title:"Conic Sections - Circle",duration:"18 min",completed:!1,locked:!1},{id:"pc-1-l5",title:"Systems of Nonlinear Equations",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"pc-1-q1",title:"Practice Quiz: Conics",questions:14,duration:"20 min",completed:!1,locked:!1,type:"practice"},{id:"pc-1-q2",title:"Module Quiz: Analytic Geometry",questions:18,duration:"25 min",completed:!1,locked:!1,type:"module"}]},{id:"pc-2",title:"Series and Induction",description:"Sequences, series, mathematical induction, and the binomial theorem.",color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,lessons:[{id:"pc-2-l1",title:"Sequences and Series",duration:"18 min",completed:!1,locked:!1},{id:"pc-2-l2",title:"Arithmetic Sequences",duration:"18 min",completed:!1,locked:!1},{id:"pc-2-l3",title:"Geometric Sequences",duration:"20 min",completed:!1,locked:!1},{id:"pc-2-l4",title:"Mathematical Induction",duration:"24 min",completed:!1,locked:!1},{id:"pc-2-l5",title:"Binomial Theorem",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"pc-2-q1",title:"Practice Quiz: Sequences & Series",questions:12,duration:"18 min",completed:!1,locked:!1,type:"practice"},{id:"pc-2-q2",title:"Module Quiz: Series and Induction",questions:16,duration:"24 min",completed:!1,locked:!1,type:"module"}]},{id:"pc-3",title:"Trigonometry",description:"Trigonometric functions, identities, equations, and the unit circle.",color:"bg-teal-50",iconColor:"text-teal-600",accentColor:"bg-teal-500",progress:0,lessons:[{id:"pc-3-l1",title:"Angles and Unit Circle",duration:"18 min",completed:!1,locked:!1},{id:"pc-3-l2",title:"Trigonometric Functions",duration:"22 min",completed:!1,locked:!1},{id:"pc-3-l3",title:"Trigonometric Identities",duration:"22 min",completed:!1,locked:!1},{id:"pc-3-l4",title:"Sum and Difference Formulas",duration:"20 min",completed:!1,locked:!1},{id:"pc-3-l5",title:"Inverse Trigonometric Functions",duration:"20 min",completed:!1,locked:!1},{id:"pc-3-l6",title:"Polar Coordinates",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"pc-3-q1",title:"Practice Quiz: Trig Functions",questions:15,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"pc-3-q2",title:"Module Quiz: Trigonometry",questions:20,duration:"30 min",completed:!1,locked:!0,type:"module"}]}]},{id:"stats-prob",title:"Statistics and Probability",description:"Random variables, distributions, sampling, and hypothesis testing for Grade 11 students.",icon:s,color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,totalModules:4,completedModules:0,rating:4.8,reviewCount:160,modules:[{id:"sp-1",title:"Random Variables and Probability Distributions",description:"Discrete random variables, probability distributions, mean, and variance.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-1-l1",title:"Random Variables",duration:"16 min",completed:!1,locked:!1},{id:"sp-1-l2",title:"Discrete Probability Distributions",duration:"18 min",completed:!1,locked:!1},{id:"sp-1-l3",title:"Mean and Variance of Discrete RV",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"sp-1-q1",title:"Practice Quiz: Random Variables",questions:10,duration:"15 min",completed:!1,locked:!1,type:"practice"},{id:"sp-1-q2",title:"Module Quiz: Probability Distributions",questions:15,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"sp-2",title:"Normal Distribution",description:"The normal curve, standard normal distribution, z-scores, and areas under the curve.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-2-l1",title:"Normal Distribution",duration:"16 min",completed:!1,locked:!1},{id:"sp-2-l2",title:"Standard Normal Distribution and Z-scores",duration:"18 min",completed:!1,locked:!1},{id:"sp-2-l3",title:"Areas Under the Normal Curve",duration:"18 min",completed:!1,locked:!1}],quizzes:[{id:"sp-2-q1",title:"Practice Quiz: Normal Distribution",questions:12,duration:"18 min",completed:!1,locked:!1,type:"practice"},{id:"sp-2-q2",title:"Module Quiz: Z-Scores & Normal Curve",questions:14,duration:"20 min",completed:!1,locked:!1,type:"module"}]},{id:"sp-3",title:"Sampling and Estimation",description:"Sampling distributions, central limit theorem, point estimation, and confidence intervals.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-3-l1",title:"Sampling Distributions",duration:"18 min",completed:!1,locked:!1},{id:"sp-3-l2",title:"Central Limit Theorem",duration:"20 min",completed:!1,locked:!1},{id:"sp-3-l3",title:"Point Estimation",duration:"18 min",completed:!1,locked:!1},{id:"sp-3-l4",title:"Confidence Intervals",duration:"22 min",completed:!1,locked:!1}],quizzes:[{id:"sp-3-q1",title:"Practice Quiz: Sampling",questions:14,duration:"20 min",completed:!1,locked:!1,type:"practice"},{id:"sp-3-q2",title:"Module Quiz: Estimation",questions:16,duration:"24 min",completed:!1,locked:!0,type:"module"}]},{id:"sp-4",title:"Hypothesis Testing",description:"Hypothesis testing concepts, T-test, Z-test, and correlation & regression.",color:"bg-sky-50",iconColor:"text-sky-600",accentColor:"bg-sky-500",progress:0,lessons:[{id:"sp-4-l1",title:"Hypothesis Testing Concepts",duration:"20 min",completed:!1,locked:!1},{id:"sp-4-l2",title:"T-test",duration:"22 min",completed:!1,locked:!1},{id:"sp-4-l3",title:"Z-test",duration:"22 min",completed:!1,locked:!1},{id:"sp-4-l4",title:"Correlation and Regression",duration:"24 min",completed:!1,locked:!1}],quizzes:[{id:"sp-4-q1",title:"Practice Quiz: Hypothesis Testing",questions:14,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"sp-4-q2",title:"Module Quiz: Hypothesis Testing",questions:18,duration:"28 min",completed:!1,locked:!0,type:"module"}]}]},{id:"basic-calc",title:"Basic Calculus",description:"Limits, derivatives, and integrals for Grade 12 STEM students.",icon:c,color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,totalModules:3,completedModules:0,rating:4.9,reviewCount:216,modules:[{id:"bc-1",title:"Limits",description:"Limits of functions, limit theorems, one-sided limits, infinite limits, and continuity.",color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,lessons:[{id:"bc-1-l1",title:"Limits of Functions",duration:"20 min",completed:!1,locked:!1},{id:"bc-1-l2",title:"Limit Theorems",duration:"22 min",completed:!1,locked:!1},{id:"bc-1-l3",title:"One-Sided Limits",duration:"18 min",completed:!1,locked:!1},{id:"bc-1-l4",title:"Infinite Limits and Limits at Infinity",duration:"20 min",completed:!1,locked:!1},{id:"bc-1-l5",title:"Continuity of Functions",duration:"20 min",completed:!1,locked:!1}],quizzes:[{id:"bc-1-q1",title:"Practice Quiz: Limits",questions:12,duration:"20 min",completed:!1,locked:!1,type:"practice"},{id:"bc-1-q2",title:"Module Quiz: Limits & Continuity",questions:16,duration:"25 min",completed:!1,locked:!1,type:"module"}]},{id:"bc-2",title:"Derivatives",description:"Differentiation rules, chain rule, implicit differentiation, related rates, and optimization.",color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,lessons:[{id:"bc-2-l1",title:"Definition of the Derivative",duration:"22 min",completed:!1,locked:!1},{id:"bc-2-l2",title:"Differentiation Rules",duration:"20 min",completed:!1,locked:!1},{id:"bc-2-l3",title:"Chain Rule",duration:"24 min",completed:!1,locked:!1},{id:"bc-2-l4",title:"Implicit Differentiation",duration:"26 min",completed:!1,locked:!1},{id:"bc-2-l5",title:"Higher-Order Derivatives",duration:"20 min",completed:!1,locked:!1},{id:"bc-2-l6",title:"Related Rates",duration:"26 min",completed:!1,locked:!1},{id:"bc-2-l7",title:"Extrema and the First Derivative Test",duration:"22 min",completed:!1,locked:!1},{id:"bc-2-l8",title:"Concavity and the Second Derivative Test",duration:"22 min",completed:!1,locked:!1},{id:"bc-2-l9",title:"Optimization Problems",duration:"24 min",completed:!1,locked:!1}],quizzes:[{id:"bc-2-q1",title:"Practice Quiz: Derivatives",questions:14,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"bc-2-q2",title:"Module Quiz: Differentiation",questions:18,duration:"28 min",completed:!1,locked:!1,type:"module"}]},{id:"bc-3",title:"Integration",description:"Antiderivatives, definite integrals, the fundamental theorem of calculus, and applications.",color:"bg-orange-50",iconColor:"text-orange-600",accentColor:"bg-orange-500",progress:0,lessons:[{id:"bc-3-l1",title:"Antiderivatives and Indefinite Integrals",duration:"20 min",completed:!1,locked:!1},{id:"bc-3-l2",title:"Definite Integrals and the FTC",duration:"24 min",completed:!1,locked:!1},{id:"bc-3-l3",title:"Integration by Substitution",duration:"22 min",completed:!1,locked:!1},{id:"bc-3-l4",title:"Area Under a Curve",duration:"24 min",completed:!1,locked:!1}],quizzes:[{id:"bc-3-q1",title:"Practice Quiz: Antiderivatives",questions:14,duration:"22 min",completed:!1,locked:!1,type:"practice"},{id:"bc-3-q2",title:"Module Quiz: Integration",questions:20,duration:"32 min",completed:!1,locked:!0,type:"module"}]}]}];export{g as G,t as S,c as a,b as g,k as s}; diff --git a/assets/switch-eyvBOdtY.js b/assets/switch-eyvBOdtY.js deleted file mode 100644 index 70db93a0b5b427394f2d17c1cce97c3136d16e18..0000000000000000000000000000000000000000 --- a/assets/switch-eyvBOdtY.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./vendor-react-Dexh7fmo.js";import{x as s,y as n}from"./vendor-radix-BRdei-zg.js";import{c as t}from"./utils-BQQgILNW.js";function c({className:a,...r}){return e.jsx(s,{"data-slot":"switch",className:t("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",a),...r,children:e.jsx(n,{"data-slot":"switch-thumb",className:t("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S}; diff --git a/assets/swords-8_KH18p7.js b/assets/swords-8_KH18p7.js deleted file mode 100644 index d74a42a5b38a05ed9ac9a28be3e0fec7435bbd2e..0000000000000000000000000000000000000000 --- a/assets/swords-8_KH18p7.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const y=[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]],o=e("swords",y);export{o as S}; diff --git a/assets/target-D7SVtf3g.js b/assets/target-D7SVtf3g.js deleted file mode 100644 index b469f42310e64cd7b04445077265d89a3e5a4839..0000000000000000000000000000000000000000 --- a/assets/target-D7SVtf3g.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],o=c("target",e);export{o as T}; diff --git a/assets/testResetService-DejIVH8F.js b/assets/testResetService-DejIVH8F.js deleted file mode 100644 index 86c3ca2270b7906911e5402a1cdf2ee669436cde..0000000000000000000000000000000000000000 --- a/assets/testResetService-DejIVH8F.js +++ /dev/null @@ -1 +0,0 @@ -import{s as l,a as d,d as i,f,q as p,w as g,e as I,c as m,n as w}from"./vendor-firebase-firestore-BML5nJHm.js";import{G as S,P as v,d as n}from"./index-D4nJsLyx.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const k=400,A="https://deign86-mathpulse-api-v3test.hf.space";async function T(e){const t=S.currentUser;if(!t)throw new Error("Authentication is required to reset testing data.");const s=await t.getIdToken(),o=await fetch(`${A}/api/testing/reset-data`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({role:e.role,...e.lrn?{lrn:e.lrn}:{}})}),r=await o.json().catch(()=>({}));if(!o.ok){const D=typeof r?.detail=="string"?r.detail:"";throw new Error(D||`Reset request failed with status ${o.status}.`)}const c=typeof r?.role=="string"?r.role:e.role,u=Number(r?.deletedDocs??0),h=Number(r?.updatedDocs??0),y=typeof r?.summary=="string"?r.summary:`${c} reset complete: ${u} records deleted, ${h} records reset.`;return{role:c,deletedDocs:u,updatedDocs:h,summary:y}}async function R(e){const t=await f(e);if(t.empty)return 0;let s=w(n),o=0,r=0;for(const c of t.docs)s.delete(c.ref),o+=1,r+=1,o>=k&&(await s.commit(),s=w(n),o=0);return o>0&&await s.commit(),r}async function B(e,t,s){return R(p(I(n,e),g(t,"==",s)))}async function a(e,t,s){try{return await B(e,t,s)}catch{return 0}}async function b(e,t){const s=t||e;let o=0,r=0;return await v(e),r+=1,await l(i(n,"users",e),{level:1,currentXP:0,totalXP:0,streak:0,streakHistory:[],atRiskSubjects:[],hasTakenDiagnostic:!1,iarAssessmentState:"not_started",learningPathState:"unlocked",remediationState:"not_required",subjectBadges:{},riskClassifications:{},overallRisk:"Low",updatedAt:d()},{merge:!0}),r+=1,o+=await a("notifications","userId",e),o+=await a("chatSessions","userId",e),o+=await a("chatMessages","userId",e),s!==e&&(o+=await a("notifications","userId",s)),await l(i(n,"achievements",e),{userId:e,achievements:[],totalAchievements:0,updatedAt:d()},{merge:!0}).catch(()=>{}),{deletedDocs:o,updatedDocs:r}}async function $(e){let t=0,s=0;const r=(await f(p(I(n,"classrooms"),g("teacherId","==",e)))).docs.map(c=>c.id);t+=await a("notifications","userId",e),t+=await a("chatSessions","userId",e),t+=await a("chatMessages","userId",e),t+=await a("announcements","teacherId",e),t+=await a("classSectionOwnership","ownerTeacherId",e),t+=await a("managedStudents","teacherId",e),t+=await a("classrooms","teacherId",e),t+=await a("normalizedClassRecords","teacherId",e),t+=await a("classRecordImports","teacherId",e),t+=await a("courseMaterials","teacherId",e),t+=await a("riskRefreshEvents","teacherId",e),t+=await a("riskRefreshJobs","teacherId",e),t+=await a("importGroundedFeedbackEvents","teacherId",e),t+=await a("accessAuditLogs","actorUid",e),t+=await a("accessAuditLogs","teacherId",e);for(const c of r)t+=await a("managedStudents","classroomId",c),t+=await a("activities","classroomId",c),t+=await a("announcements","classroomId",c),await m(i(n,"classrooms",c)).then(()=>{t+=1}).catch(()=>{});return await m(i(n,"riskRefreshStats",e)).then(()=>{t+=1}).catch(()=>{}),await l(i(n,"users",e),{testingResetAt:d(),updatedAt:d()},{merge:!0}).catch(()=>{}),s+=1,{deletedDocs:t,updatedDocs:s}}async function P(e){let t=0,s=0;return t+=await a("notifications","userId",e),t+=await a("chatSessions","userId",e),t+=await a("chatMessages","userId",e),t+=await a("curriculumContent","updatedBy",e),t+=await a("curriculumContent","deletedBy",e),await l(i(n,"users",e),{testingResetAt:d(),updatedAt:d()},{merge:!0}).catch(()=>{}),s+=1,{deletedDocs:t,updatedDocs:s}}async function F(e){const{uid:t,role:s,lrn:o}=e;if(!t)throw new Error("Missing user id for reset.");if(s==="teacher"||s==="admin")return T(e);let r;s==="student"?r=await b(t,o):s==="teacher"?r=await $(t):r=await P(t);const c=`${s} reset complete: ${r.deletedDocs} records deleted, ${r.updatedDocs} records reset.`;return{role:s,deletedDocs:r.deletedDocs,updatedDocs:r.updatedDocs,summary:c}}export{F as resetTestingDataForRole}; diff --git a/assets/tooltip-BV3U-RJu.js b/assets/tooltip-BV3U-RJu.js deleted file mode 100644 index 30806058882fe675f241738c81970e9d5f7efc90..0000000000000000000000000000000000000000 --- a/assets/tooltip-BV3U-RJu.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./vendor-react-Dexh7fmo.js";import{s as e,t as s,u as n,v as d,A as l,w as m}from"./vendor-radix-BRdei-zg.js";import{c as p}from"./utils-BQQgILNW.js";function c({delayDuration:t=0,...a}){return o.jsx(m,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function g({...t}){return o.jsx(c,{children:o.jsx(e,{"data-slot":"tooltip",...t})})}function j({...t}){return o.jsx(s,{"data-slot":"tooltip-trigger",...t})}function T({className:t,sideOffset:a=0,children:r,...i}){return o.jsx(n,{children:o.jsxs(d,{"data-slot":"tooltip-content",sideOffset:a,className:p("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...i,children:[r,o.jsx(l,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}export{g as T,j as a,T as b}; diff --git a/assets/trash-2-BoXE_mye.js b/assets/trash-2-BoXE_mye.js deleted file mode 100644 index e1f278c058859b8147cea3dee5c3a75e4beb372f..0000000000000000000000000000000000000000 --- a/assets/trash-2-BoXE_mye.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],a=e("trash-2",c);export{a as T}; diff --git a/assets/trending-down-CqEkjFA9.js b/assets/trending-down-CqEkjFA9.js deleted file mode 100644 index bb6212a744c7711db1e4be38c29679d254736eff..0000000000000000000000000000000000000000 --- a/assets/trending-down-CqEkjFA9.js +++ /dev/null @@ -1,11 +0,0 @@ -import{c as n}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],t=n("funnel",o);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]],c=n("trending-down",e);export{t as F,c as T}; diff --git a/assets/trending-up-D-vj8Gbq.js b/assets/trending-up-D-vj8Gbq.js deleted file mode 100644 index b139d9c0ba0eaca43c137e9e1c7d064ab43537cb..0000000000000000000000000000000000000000 --- a/assets/trending-up-D-vj8Gbq.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as n}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],i=n("trending-up",o);export{i as T}; diff --git a/assets/trophy-C2nVcZnb.js b/assets/trophy-C2nVcZnb.js deleted file mode 100644 index 88c94558e1b9af19467b8f7a713d1e35df70e7a2..0000000000000000000000000000000000000000 --- a/assets/trophy-C2nVcZnb.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as a}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const p=[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]],e=a("trophy",p);export{e as T}; diff --git a/assets/user-CaTzqgOL.js b/assets/user-CaTzqgOL.js deleted file mode 100644 index 2e03542a1a2653de540be446b3b0b21c180c8934..0000000000000000000000000000000000000000 --- a/assets/user-CaTzqgOL.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],r=c("user",e);export{r as U}; diff --git a/assets/users-HMf2sdE3.js b/assets/users-HMf2sdE3.js deleted file mode 100644 index 6b10248a88ccb0a7967146b7595d3753a47ec26c..0000000000000000000000000000000000000000 --- a/assets/users-HMf2sdE3.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],s=e("users",c);export{s as U}; diff --git a/assets/utils-BQQgILNW.js b/assets/utils-BQQgILNW.js deleted file mode 100644 index 7f962430450efb43d642be6cf16708df95af7459..0000000000000000000000000000000000000000 --- a/assets/utils-BQQgILNW.js +++ /dev/null @@ -1 +0,0 @@ -import{c as Oe}from"./clsx-B-dksMZM.js";const Le=(e,t)=>{const o=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),xe=(e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),K="-",ue=[],Ne="arbitrary..",Ee=e=>{const t=Fe(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Ve(a);const u=a.split(K),c=u[0]===""&&u.length>1?1:0;return ke(u,c,t)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],f=o[a];return c?f?Le(f,c):c:f||ue}return o[a]||ue}}},ke=(e,t,o)=>{if(e.length-t===0)return o.classGroupId;const i=e[t],d=o.nextPart.get(i);if(d){const f=ke(e,t+1,d);if(f)return f}const a=o.validators;if(a===null)return;const u=t===0?e.join(K):e.slice(t).join(K),c=a.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),o=t.indexOf(":"),r=t.slice(0,o);return r?Ne+r:void 0})(),Fe=e=>{const{theme:t,classGroups:o}=e;return We(o,t)},We=(e,t)=>{const o=xe();for(const r in e){const i=e[r];te(i,o,r,t)}return o},te=(e,t,o,r)=>{const i=e.length;for(let d=0;d{if(typeof e=="string"){Be(e,t,o);return}if(typeof e=="function"){$e(e,t,o,r);return}Ue(e,t,o,r)},Be=(e,t,o)=>{const r=e===""?t:ye(t,e);r.classGroupId=o},$e=(e,t,o,r)=>{if(De(e)){te(e(r),t,o,r);return}t.validators===null&&(t.validators=[]),t.validators.push(je(o,e))},Ue=(e,t,o,r)=>{const i=Object.entries(e),d=i.length;for(let a=0;a{let o=e;const r=t.split(K),i=r.length;for(let d=0;d"isThemeGetter"in e&&e.isThemeGetter===!0,Ye=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),r=Object.create(null);const i=(d,a)=>{o[d]=a,t++,t>e&&(t=0,r=o,o=Object.create(null))};return{get(d){let a=o[d];if(a!==void 0)return a;if((a=r[d])!==void 0)return i(d,a),a},set(d,a){d in o?o[d]=a:i(d,a)}}},re="!",fe=":",qe=[],be=(e,t,o,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:r,isExternal:i}),Xe=e=>{const{prefix:t,experimentalParseClassName:o}=e;let r=i=>{const d=[];let a=0,u=0,c=0,f;const h=i.length;for(let v=0;vc?f-c:void 0;return be(d,M,z,P)};if(t){const i=t+fe,d=r;r=a=>a.startsWith(i)?d(a.slice(i.length)):be(qe,!1,a,void 0,!0)}if(o){const i=r;r=d=>o({className:d,parseClassName:i})}return r},Je=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((o,r)=>{t.set(o,1e6+r)}),o=>{const r=[];let i=[];for(let d=0;d0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},He=e=>({cache:Ye(e.cacheSize),parseClassName:Xe(e),sortModifiers:Je(e),...Ee(e)}),Ke=/\s+/,Qe=(e,t)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:d}=t,a=[],u=e.trim().split(Ke);let c="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:y,modifiers:z,hasImportantModifier:M,baseClassName:P,maybePostfixModifierPosition:v}=o(h);if(y){c=h+(c.length>0?" "+c:c);continue}let x=!!v,G=r(x?P.substring(0,v):P);if(!G){if(!x){c=h+(c.length>0?" "+c:c);continue}if(G=r(P),!G){c=h+(c.length>0?" "+c:c);continue}x=!1}const $=z.length===0?"":z.length===1?z[0]:d(z).join(":"),W=M?$+re:$,N=W+G;if(a.indexOf(N)>-1)continue;a.push(N);const E=i(G,x);for(let T=0;T0?" "+c:c)}return c},Ze=(...e)=>{let t=0,o,r,i="";for(;t{if(typeof e=="string")return e;let t,o="";for(let r=0;r{let o,r,i,d;const a=c=>{const f=t.reduce((h,y)=>y(h),e());return o=He(f),r=o.cache.get,i=o.cache.set,d=u,u(c)},u=c=>{const f=r(c);if(f)return f;const h=Qe(c,o);return i(c,h),h};return d=a,(...c)=>d(Ze(...c))},oo=[],b=e=>{const t=o=>o[e]||oo;return t.isThemeGetter=!0,t},ze=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ce=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ro=/^\d+\/\d+$/,to=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,so=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,no=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ao=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,io=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,F=e=>ro.test(e),p=e=>!!e&&!Number.isNaN(Number(e)),R=e=>!!e&&Number.isInteger(Number(e)),oe=e=>e.endsWith("%")&&p(e.slice(0,-1)),S=e=>to.test(e),Ae=()=>!0,lo=e=>so.test(e)&&!no.test(e),se=()=>!1,co=e=>ao.test(e),mo=e=>io.test(e),po=e=>!s(e)&&!n(e),uo=e=>I(e,Ie,se),s=e=>ze.test(e),L=e=>I(e,Me,lo),ge=e=>I(e,yo,p),fo=e=>I(e,Ge,Ae),bo=e=>I(e,Pe,se),he=e=>I(e,Se,se),go=e=>I(e,Re,mo),J=e=>I(e,Te,co),n=e=>Ce.test(e),B=e=>j(e,Me),ho=e=>j(e,Pe),we=e=>j(e,Se),wo=e=>j(e,Ie),xo=e=>j(e,Re),H=e=>j(e,Te,!0),ko=e=>j(e,Ge,!0),I=(e,t,o)=>{const r=ze.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},j=(e,t,o=!1)=>{const r=Ce.exec(e);return r?r[1]?t(r[1]):o:!1},Se=e=>e==="position"||e==="percentage",Re=e=>e==="image"||e==="url",Ie=e=>e==="length"||e==="size"||e==="bg-size",Me=e=>e==="length",yo=e=>e==="number",Pe=e=>e==="family-name",Ge=e=>e==="number"||e==="weight",Te=e=>e==="shadow",vo=()=>{const e=b("color"),t=b("font"),o=b("text"),r=b("font-weight"),i=b("tracking"),d=b("leading"),a=b("breakpoint"),u=b("container"),c=b("spacing"),f=b("radius"),h=b("shadow"),y=b("inset-shadow"),z=b("text-shadow"),M=b("drop-shadow"),P=b("blur"),v=b("perspective"),x=b("aspect"),G=b("ease"),$=b("animate"),W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...N(),n,s],T=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],m=()=>[n,s,c],C=()=>[F,"full","auto",...m()],ne=()=>[R,"none","subgrid",n,s],ae=()=>["auto",{span:["full",R,n,s]},R,n,s],U=()=>[R,"auto",n,s],ie=()=>["auto","min","max","fr",n,s],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...m()],O=()=>[F,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...m()],l=()=>[e,n,s],le=()=>[...N(),we,he,{position:[n,s]}],ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",wo,uo,{size:[n,s]}],Z=()=>[oe,B,L],w=()=>["","none","full",f,n,s],k=()=>["",p,B,L],D=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],g=()=>[p,oe,we,he],pe=()=>["","none",P,n,s],Y=()=>["none",p,n,s],q=()=>["none",p,n,s],ee=()=>[p,n,s],X=()=>[F,"full",...m()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[S],breakpoint:[S],color:[Ae],container:[S],"drop-shadow":[S],ease:["in","out","in-out"],font:[po],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[S],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[S],shadow:[S],spacing:["px",p],text:[S],"text-shadow":[S],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",F,s,n,x]}],container:["container"],columns:[{columns:[p,s,n,u]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[R,"auto",n,s]}],basis:[{basis:[F,"full","auto",u,...m()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[p,F,"auto","initial","none",s]}],grow:[{grow:["",p,n,s]}],shrink:[{shrink:["",p,n,s]}],order:[{order:[R,"first","last","none",n,s]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:m()}],"gap-x":[{"gap-x":m()}],"gap-y":[{"gap-y":m()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:m()}],px:[{px:m()}],py:[{py:m()}],ps:[{ps:m()}],pe:[{pe:m()}],pt:[{pt:m()}],pr:[{pr:m()}],pb:[{pb:m()}],pl:[{pl:m()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":m()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":m()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[u,"screen",...O()]}],"min-w":[{"min-w":[u,"screen","none",...O()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",o,B,L]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ko,fo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",oe,s]}],"font-family":[{font:[ho,bo,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,n,s]}],"line-clamp":[{"line-clamp":[p,"none",n,ge]}],leading:[{leading:[d,...m()]}],"list-image":[{"list-image":["none",n,s]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",n,s]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:l()}],"text-color":[{text:l()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[p,"from-font","auto",n,L]}],"text-decoration-color":[{decoration:l()}],"underline-offset":[{"underline-offset":[p,"auto",n,s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",n,s]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",n,s]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},R,n,s],radial:["",n,s],conic:[R,n,s]},xo,go]}],"bg-color":[{bg:l()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:l()}],"gradient-via":[{via:l()}],"gradient-to":[{to:l()}],rounded:[{rounded:w()}],"rounded-s":[{"rounded-s":w()}],"rounded-e":[{"rounded-e":w()}],"rounded-t":[{"rounded-t":w()}],"rounded-r":[{"rounded-r":w()}],"rounded-b":[{"rounded-b":w()}],"rounded-l":[{"rounded-l":w()}],"rounded-ss":[{"rounded-ss":w()}],"rounded-se":[{"rounded-se":w()}],"rounded-ee":[{"rounded-ee":w()}],"rounded-es":[{"rounded-es":w()}],"rounded-tl":[{"rounded-tl":w()}],"rounded-tr":[{"rounded-tr":w()}],"rounded-br":[{"rounded-br":w()}],"rounded-bl":[{"rounded-bl":w()}],"border-w":[{border:k()}],"border-w-x":[{"border-x":k()}],"border-w-y":[{"border-y":k()}],"border-w-s":[{"border-s":k()}],"border-w-e":[{"border-e":k()}],"border-w-t":[{"border-t":k()}],"border-w-r":[{"border-r":k()}],"border-w-b":[{"border-b":k()}],"border-w-l":[{"border-l":k()}],"divide-x":[{"divide-x":k()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":k()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"hidden","none"]}],"border-color":[{border:l()}],"border-color-x":[{"border-x":l()}],"border-color-y":[{"border-y":l()}],"border-color-s":[{"border-s":l()}],"border-color-e":[{"border-e":l()}],"border-color-t":[{"border-t":l()}],"border-color-r":[{"border-r":l()}],"border-color-b":[{"border-b":l()}],"border-color-l":[{"border-l":l()}],"divide-color":[{divide:l()}],"outline-style":[{outline:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[p,n,s]}],"outline-w":[{outline:["",p,B,L]}],"outline-color":[{outline:l()}],shadow:[{shadow:["","none",h,H,J]}],"shadow-color":[{shadow:l()}],"inset-shadow":[{"inset-shadow":["none",y,H,J]}],"inset-shadow-color":[{"inset-shadow":l()}],"ring-w":[{ring:k()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:l()}],"ring-offset-w":[{"ring-offset":[p,L]}],"ring-offset-color":[{"ring-offset":l()}],"inset-ring-w":[{"inset-ring":k()}],"inset-ring-color":[{"inset-ring":l()}],"text-shadow":[{"text-shadow":["none",z,H,J]}],"text-shadow-color":[{"text-shadow":l()}],opacity:[{opacity:[p,n,s]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[p]}],"mask-image-linear-from-pos":[{"mask-linear-from":g()}],"mask-image-linear-to-pos":[{"mask-linear-to":g()}],"mask-image-linear-from-color":[{"mask-linear-from":l()}],"mask-image-linear-to-color":[{"mask-linear-to":l()}],"mask-image-t-from-pos":[{"mask-t-from":g()}],"mask-image-t-to-pos":[{"mask-t-to":g()}],"mask-image-t-from-color":[{"mask-t-from":l()}],"mask-image-t-to-color":[{"mask-t-to":l()}],"mask-image-r-from-pos":[{"mask-r-from":g()}],"mask-image-r-to-pos":[{"mask-r-to":g()}],"mask-image-r-from-color":[{"mask-r-from":l()}],"mask-image-r-to-color":[{"mask-r-to":l()}],"mask-image-b-from-pos":[{"mask-b-from":g()}],"mask-image-b-to-pos":[{"mask-b-to":g()}],"mask-image-b-from-color":[{"mask-b-from":l()}],"mask-image-b-to-color":[{"mask-b-to":l()}],"mask-image-l-from-pos":[{"mask-l-from":g()}],"mask-image-l-to-pos":[{"mask-l-to":g()}],"mask-image-l-from-color":[{"mask-l-from":l()}],"mask-image-l-to-color":[{"mask-l-to":l()}],"mask-image-x-from-pos":[{"mask-x-from":g()}],"mask-image-x-to-pos":[{"mask-x-to":g()}],"mask-image-x-from-color":[{"mask-x-from":l()}],"mask-image-x-to-color":[{"mask-x-to":l()}],"mask-image-y-from-pos":[{"mask-y-from":g()}],"mask-image-y-to-pos":[{"mask-y-to":g()}],"mask-image-y-from-color":[{"mask-y-from":l()}],"mask-image-y-to-color":[{"mask-y-to":l()}],"mask-image-radial":[{"mask-radial":[n,s]}],"mask-image-radial-from-pos":[{"mask-radial-from":g()}],"mask-image-radial-to-pos":[{"mask-radial-to":g()}],"mask-image-radial-from-color":[{"mask-radial-from":l()}],"mask-image-radial-to-color":[{"mask-radial-to":l()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[p]}],"mask-image-conic-from-pos":[{"mask-conic-from":g()}],"mask-image-conic-to-pos":[{"mask-conic-to":g()}],"mask-image-conic-from-color":[{"mask-conic-from":l()}],"mask-image-conic-to-color":[{"mask-conic-to":l()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",n,s]}],filter:[{filter:["","none",n,s]}],blur:[{blur:pe()}],brightness:[{brightness:[p,n,s]}],contrast:[{contrast:[p,n,s]}],"drop-shadow":[{"drop-shadow":["","none",M,H,J]}],"drop-shadow-color":[{"drop-shadow":l()}],grayscale:[{grayscale:["",p,n,s]}],"hue-rotate":[{"hue-rotate":[p,n,s]}],invert:[{invert:["",p,n,s]}],saturate:[{saturate:[p,n,s]}],sepia:[{sepia:["",p,n,s]}],"backdrop-filter":[{"backdrop-filter":["","none",n,s]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[p,n,s]}],"backdrop-contrast":[{"backdrop-contrast":[p,n,s]}],"backdrop-grayscale":[{"backdrop-grayscale":["",p,n,s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p,n,s]}],"backdrop-invert":[{"backdrop-invert":["",p,n,s]}],"backdrop-opacity":[{"backdrop-opacity":[p,n,s]}],"backdrop-saturate":[{"backdrop-saturate":[p,n,s]}],"backdrop-sepia":[{"backdrop-sepia":["",p,n,s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":m()}],"border-spacing-x":[{"border-spacing-x":m()}],"border-spacing-y":[{"border-spacing-y":m()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",n,s]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[p,"initial",n,s]}],ease:[{ease:["linear","initial",G,n,s]}],delay:[{delay:[p,n,s]}],animate:[{animate:["none",$,n,s]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,n,s]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[n,s,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],accent:[{accent:l()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:l()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",n,s]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",n,s]}],fill:[{fill:["none",...l()]}],"stroke-w":[{stroke:[p,B,L,ge]}],stroke:[{stroke:["none",...l()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},zo=eo(vo);function Ao(...e){return zo(Oe(e))}export{Ao as c}; diff --git a/assets/vendor-firebase-analytics-CCo6E2f7.js b/assets/vendor-firebase-analytics-FE_tmzXh.js similarity index 99% rename from assets/vendor-firebase-analytics-CCo6E2f7.js rename to assets/vendor-firebase-analytics-FE_tmzXh.js index 48aeb070d58759c32702c07da43ccc18f7bb67fb..082f4800f4ed375f3f0c645a00f7f6d5b885e869 100644 --- a/assets/vendor-firebase-analytics-CCo6E2f7.js +++ b/assets/vendor-firebase-analytics-FE_tmzXh.js @@ -1,4 +1,4 @@ -import{L,_ as v,C as T,r as A,E as O,d as w,b as k,N as z,O as U,P as E,F as G,l as F,n as j,o as B,Q as K}from"./vendor-firebase-core-DQ-pMjxd.js";/** +import{L,_ as v,C as T,r as A,E as O,d as w,b as k,N as z,O as U,P as E,F as G,l as F,n as j,o as B,Q as K}from"./vendor-firebase-core-BireMWc7.js";/** * @license * Copyright 2019 Google LLC * diff --git a/assets/vendor-firebase-auth-COrkgW0P.js b/assets/vendor-firebase-auth-DUGvAaJx.js similarity index 87% rename from assets/vendor-firebase-auth-COrkgW0P.js rename to assets/vendor-firebase-auth-DUGvAaJx.js index fea8b07f087fb75a9e822aa1b146edccec540300..d9e9cc5119fa9f30293a0fcd9f9e5f465d7c5639 100644 --- a/assets/vendor-firebase-auth-COrkgW0P.js +++ b/assets/vendor-firebase-auth-DUGvAaJx.js @@ -1,4 +1,4 @@ -import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E as Ee,c as m,d as g,e as $t,f as nt,h as f,F as ye,j as jt,q as B,k as ve,l as rt,m as Gt,n as Bt,o as me,p as zt,u as Jt,s as Yt,t as Xt,v as q,w as K,x as Qt}from"./vendor-firebase-core-DQ-pMjxd.js";function it(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Zt=it,st=new Ee("auth","Firebase",it());/** +import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E as Ee,c as g,d as T,e as $t,f as nt,h as f,F as ye,j as jt,q as B,k as ve,l as rt,m as Gt,n as Bt,o as me,p as zt,u as Jt,s as Yt,t as Xt,v as q,w as K,x as Qt}from"./vendor-firebase-core-BireMWc7.js";function it(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Zt=it,st=new Ee("auth","Firebase",it());/** * @license * Copyright 2020 Google LLC * @@ -28,7 +28,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function I(n,...e){throw ke(n,...e)}function w(n,...e){return ke(n,...e)}function ot(n,e,t){const r={...Zt(),[e]:t};return new Ee("auth","Firebase",r).create(e,{appName:n.name})}function k(n){return ot(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ke(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return st.create(n,...e)}function u(n,e,...t){if(!n)throw ke(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ee(e),new Error(e)}function P(n,e){n||y(e)}/** + */function _(n,...e){throw ke(n,...e)}function I(n,...e){return ke(n,...e)}function ot(n,e,t){const r={...Zt(),[e]:t};return new Ee("auth","Firebase",r).create(e,{appName:n.name})}function v(n){return ot(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ke(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return st.create(n,...e)}function u(n,e,...t){if(!n)throw ke(e,...t)}function E(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ee(e),new Error(e)}function k(n,e){n||E(e)}/** * @license * Copyright 2020 Google LLC * @@ -73,7 +73,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class z{constructor(e,t){this.shortDelay=e,this.longDelay=t,P(t>e,"Short delay should be less than long delay!"),this.isMobile=Ht()||qt()}get(){return nn()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** + */class z{constructor(e,t){this.shortDelay=e,this.longDelay=t,k(t>e,"Short delay should be less than long delay!"),this.isMobile=Ht()||qt()}get(){return nn()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** * @license * Copyright 2020 Google LLC * @@ -88,7 +88,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Pe(n,e){P(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/** + */function Pe(n,e){k(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/** * @license * Copyright 2020 Google LLC * @@ -103,7 +103,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class at{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;y("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;y("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;y("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** + */class at{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;E("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;E("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;E("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** * @license * Copyright 2020 Google LLC * @@ -133,7 +133,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const on=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],an=new z(3e4,6e4);function O(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function E(n,e,t,r,i={}){return ct(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=B({key:n.config.apiKey,...o}).slice(1),c=await n._getAdditionalHeaders();c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode);const l={method:e,headers:c,...s};return Qt()||(l.referrerPolicy="no-referrer"),n.emulatorConfig&&ve(n.emulatorConfig.host)&&(l.credentials="include"),at.fetch()(await lt(n,n.config.apiHost,t,a),l)})}async function ct(n,e,t){n._canInitEmulator=!1;const r={...sn,...e};try{const i=new ln(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw Z(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw Z(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw Z(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw Z(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ot(n,d,l);I(n,d)}}catch(i){if(i instanceof ye)throw i;I(n,"network-request-failed",{message:String(i)})}}async function J(n,e,t,r,i={}){const s=await E(n,e,t,r,i);return"mfaPendingCredential"in s&&I(n,"multi-factor-auth-required",{_serverResponse:s}),s}async function lt(n,e,t,r){const i=`${e}${t}?${r}`,s=n,o=s.config.emulator?Pe(n.config,i):`${n.config.apiScheme}://${i}`;return on.includes(t)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}function cn(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ln{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(w(this.auth,"network-request-failed")),an.get())})}}function Z(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=w(n,e,r);return i.customData._tokenResponse=t,i}function Fe(n){return n!==void 0&&n.enterprise!==void 0}class un{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return cn(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function dn(n,e){return E(n,"GET","/v2/recaptchaConfig",O(n,e))}/** + */const on=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],an=new z(3e4,6e4);function O(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function P(n,e,t,r,i={}){return ct(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=B({key:n.config.apiKey,...o}).slice(1),c=await n._getAdditionalHeaders();c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode);const l={method:e,headers:c,...s};return Qt()||(l.referrerPolicy="no-referrer"),n.emulatorConfig&&ve(n.emulatorConfig.host)&&(l.credentials="include"),at.fetch()(await lt(n,n.config.apiHost,t,a),l)})}async function ct(n,e,t){n._canInitEmulator=!1;const r={...sn,...e};try{const i=new ln(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw Z(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw Z(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw Z(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw Z(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ot(n,d,l);_(n,d)}}catch(i){if(i instanceof ye)throw i;_(n,"network-request-failed",{message:String(i)})}}async function J(n,e,t,r,i={}){const s=await P(n,e,t,r,i);return"mfaPendingCredential"in s&&_(n,"multi-factor-auth-required",{_serverResponse:s}),s}async function lt(n,e,t,r){const i=`${e}${t}?${r}`,s=n,o=s.config.emulator?Pe(n.config,i):`${n.config.apiScheme}://${i}`;return on.includes(t)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}function cn(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ln{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(I(this.auth,"network-request-failed")),an.get())})}}function Z(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=I(n,e,r);return i.customData._tokenResponse=t,i}function Fe(n){return n!==void 0&&n.enterprise!==void 0}class un{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return cn(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function dn(n,e){return P(n,"GET","/v2/recaptchaConfig",O(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -148,7 +148,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function hn(n,e){return E(n,"POST","/v1/accounts:delete",e)}async function se(n,e){return E(n,"POST","/v1/accounts:lookup",e)}/** + */async function hn(n,e){return P(n,"POST","/v1/accounts:delete",e)}async function se(n,e){return P(n,"POST","/v1/accounts:lookup",e)}/** * @license * Copyright 2020 Google LLC * @@ -163,7 +163,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function $(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function fn(n,e=!1){const t=g(n),r=await t.getIdToken(e),i=Se(r);u(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:$(pe(i.auth_time)),issuedAtTime:$(pe(i.iat)),expirationTime:$(pe(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function pe(n){return Number(n)*1e3}function Se(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return ee("JWT malformed, contained fewer than 3 sections"),null;try{const i=jt(t);return i?JSON.parse(i):(ee("Failed to decode base64 JWT payload"),null)}catch(i){return ee("Caught error parsing JWT payload as JSON",i?.toString()),null}}function xe(n){const e=Se(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** + */function $(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function fn(n,e=!1){const t=T(n),r=await t.getIdToken(e),i=Se(r);u(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:$(pe(i.auth_time)),issuedAtTime:$(pe(i.iat)),expirationTime:$(pe(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function pe(n){return Number(n)*1e3}function Se(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return ee("JWT malformed, contained fewer than 3 sections"),null;try{const i=jt(t);return i?JSON.parse(i):(ee("Failed to decode base64 JWT payload"),null)}catch(i){return ee("Caught error parsing JWT payload as JSON",i?.toString()),null}}function xe(n){const e=Se(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** * @license * Copyright 2020 Google LLC * @@ -178,7 +178,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function N(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof ye&&pn(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function pn({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/** + */async function V(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof ye&&pn(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function pn({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/** * @license * Copyright 2020 Google LLC * @@ -223,7 +223,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function oe(n){const e=n.auth,t=await n.getIdToken(),r=await N(n,se(e,{idToken:t}));u(r?.users.length,e,"internal-error");const i=r.users[0];n._notifyReloadListener(i);const s=i.providerUserInfo?.length?ut(i.providerUserInfo):[],o=_n(n.providerData,s),a=n.isAnonymous,c=!(n.email&&i.passwordHash)&&!o?.length,l=a?c:!1,d={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new Ie(i.createdAt,i.lastLoginAt),isAnonymous:l};Object.assign(n,d)}async function mn(n){const e=g(n);await oe(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function _n(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function ut(n){return n.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}/** + */async function oe(n){const e=n.auth,t=await n.getIdToken(),r=await V(n,se(e,{idToken:t}));u(r?.users.length,e,"internal-error");const i=r.users[0];n._notifyReloadListener(i);const s=i.providerUserInfo?.length?ut(i.providerUserInfo):[],o=_n(n.providerData,s),a=n.isAnonymous,c=!(n.email&&i.passwordHash)&&!o?.length,l=a?c:!1,d={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new Ie(i.createdAt,i.lastLoginAt),isAnonymous:l};Object.assign(n,d)}async function mn(n){const e=T(n);await oe(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function _n(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function ut(n){return n.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}/** * @license * Copyright 2020 Google LLC * @@ -238,7 +238,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function In(n,e){const t=await ct(n,{},async()=>{const r=B({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=await lt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const c={method:"POST",headers:a,body:r};return n.emulatorConfig&&ve(n.emulatorConfig.host)&&(c.credentials="include"),at.fetch()(o,c)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function wn(n,e){return E(n,"POST","/v2/accounts:revokeToken",O(n,e))}/** + */async function In(n,e){const t=await ct(n,{},async()=>{const r=B({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=await lt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const c={method:"POST",headers:a,body:r};return n.emulatorConfig&&ve(n.emulatorConfig.host)&&(c.credentials="include"),at.fetch()(o,c)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function wn(n,e){return P(n,"POST","/v2/accounts:revokeToken",O(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -253,7 +253,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class F{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):xe(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){u(e.length!==0,"internal-error");const t=xe(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(u(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await In(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new F;return r&&(u(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new F,this.toJSON())}_performRefresh(){return y("not implemented")}}/** + */class M{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):xe(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){u(e.length!==0,"internal-error");const t=xe(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(u(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await In(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new M;return r&&(u(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new M,this.toJSON())}_performRefresh(){return E("not implemented")}}/** * @license * Copyright 2020 Google LLC * @@ -268,7 +268,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function S(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class _{constructor({uid:e,auth:t,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new gn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new Ie(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await N(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return fn(this,e)}reload(){return mn(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new _({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){u(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await oe(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(m(this.auth.app))return Promise.reject(k(this.auth));const e=await this.getIdToken();return await N(this,hn(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const r=t.displayName??void 0,i=t.email??void 0,s=t.phoneNumber??void 0,o=t.photoURL??void 0,a=t.tenantId??void 0,c=t._redirectEventId??void 0,l=t.createdAt??void 0,d=t.lastLoginAt??void 0,{uid:h,emailVerified:p,isAnonymous:Q,providerData:H,stsTokenManager:Ne}=t;u(h&&Ne,e,"internal-error");const xt=F.fromJSON(this.name,Ne);u(typeof h=="string",e,"internal-error"),S(r,e.name),S(i,e.name),u(typeof p=="boolean",e,"internal-error"),u(typeof Q=="boolean",e,"internal-error"),S(s,e.name),S(o,e.name),S(a,e.name),S(c,e.name),S(l,e.name),S(d,e.name);const fe=new _({uid:h,auth:e,email:i,emailVerified:p,displayName:r,isAnonymous:Q,photoURL:o,phoneNumber:s,tenantId:a,stsTokenManager:xt,createdAt:l,lastLoginAt:d});return H&&Array.isArray(H)&&(fe.providerData=H.map(Vt=>({...Vt}))),c&&(fe._redirectEventId=c),fe}static async _fromIdTokenResponse(e,t,r=!1){const i=new F;i.updateFromServerResponse(t);const s=new _({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await oe(s),s}static async _fromGetAccountInfoResponse(e,t,r){const i=t.users[0];u(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?ut(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!s?.length,a=new F;a.updateFromIdToken(r);const c=new _({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new Ie(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!s?.length};return Object.assign(c,l),c}}/** + */function S(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class m{constructor({uid:e,auth:t,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new gn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new Ie(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await V(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return fn(this,e)}reload(){return mn(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new m({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){u(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await oe(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(g(this.auth.app))return Promise.reject(v(this.auth));const e=await this.getIdToken();return await V(this,hn(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const r=t.displayName??void 0,i=t.email??void 0,s=t.phoneNumber??void 0,o=t.photoURL??void 0,a=t.tenantId??void 0,c=t._redirectEventId??void 0,l=t.createdAt??void 0,d=t.lastLoginAt??void 0,{uid:h,emailVerified:p,isAnonymous:Q,providerData:H,stsTokenManager:Ne}=t;u(h&&Ne,e,"internal-error");const xt=M.fromJSON(this.name,Ne);u(typeof h=="string",e,"internal-error"),S(r,e.name),S(i,e.name),u(typeof p=="boolean",e,"internal-error"),u(typeof Q=="boolean",e,"internal-error"),S(s,e.name),S(o,e.name),S(a,e.name),S(c,e.name),S(l,e.name),S(d,e.name);const fe=new m({uid:h,auth:e,email:i,emailVerified:p,displayName:r,isAnonymous:Q,photoURL:o,phoneNumber:s,tenantId:a,stsTokenManager:xt,createdAt:l,lastLoginAt:d});return H&&Array.isArray(H)&&(fe.providerData=H.map(Vt=>({...Vt}))),c&&(fe._redirectEventId=c),fe}static async _fromIdTokenResponse(e,t,r=!1){const i=new M;i.updateFromServerResponse(t);const s=new m({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await oe(s),s}static async _fromGetAccountInfoResponse(e,t,r){const i=t.users[0];u(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?ut(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!s?.length,a=new M;a.updateFromIdToken(r);const c=new m({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new Ie(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!s?.length};return Object.assign(c,l),c}}/** * @license * Copyright 2020 Google LLC * @@ -283,7 +283,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ve=new Map;function v(n){P(n instanceof Function,"Expected a class definition");let e=Ve.get(n);return e?(P(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,Ve.set(n,e),e)}/** + */const Ve=new Map;function y(n){k(n instanceof Function,"Expected a class definition");let e=Ve.get(n);return e?(k(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,Ve.set(n,e),e)}/** * @license * Copyright 2019 Google LLC * @@ -313,7 +313,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function te(n,e,t){return`firebase:${n}:${e}:${t}`}class x{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=te(this.userKey,i.apiKey,s),this.fullPersistenceKey=te("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const t=await se(this.auth,{idToken:e}).catch(()=>{});return t?_._fromGetAccountInfoResponse(this.auth,t,e):null}return _._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new x(v(We),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||v(We);const o=te(r,e.config.apiKey,e.name);let a=null;for(const l of t)try{const d=await l._get(o);if(d){let h;if(typeof d=="string"){const p=await se(e,{idToken:d}).catch(()=>{});if(!p)break;h=await _._fromGetAccountInfoResponse(e,p,d)}else h=_._fromJSON(e,d);l!==s&&(a=h),s=l;break}}catch{}const c=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new x(s,e,r):(s=c[0],a&&await s._set(o,a.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new x(s,e,r))}}/** + */function te(n,e,t){return`firebase:${n}:${e}:${t}`}class F{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=te(this.userKey,i.apiKey,s),this.fullPersistenceKey=te("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const t=await se(this.auth,{idToken:e}).catch(()=>{});return t?m._fromGetAccountInfoResponse(this.auth,t,e):null}return m._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new F(y(We),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||y(We);const o=te(r,e.config.apiKey,e.name);let a=null;for(const l of t)try{const d=await l._get(o);if(d){let h;if(typeof d=="string"){const p=await se(e,{idToken:d}).catch(()=>{});if(!p)break;h=await m._fromGetAccountInfoResponse(e,p,d)}else h=m._fromJSON(e,d);l!==s&&(a=h),s=l;break}}catch{}const c=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new F(s,e,r):(s=c[0],a&&await s._set(o,a.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new F(s,e,r))}}/** * @license * Copyright 2020 Google LLC * @@ -373,7 +373,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function vn(n,e={}){return E(n,"GET","/v2/passwordPolicy",O(n,e))}/** + */async function vn(n,e={}){return P(n,"GET","/v2/passwordPolicy",O(n,e))}/** * @license * Copyright 2023 Google LLC * @@ -403,7 +403,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Sn{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new qe(this),this.idTokenSubscription=new qe(this),this.beforeStateQueue=new yn(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=st,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=v(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await x.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await se(this,{idToken:e}),r=await _._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(m(this.app)){const s=this.app.settings.authIdToken;return s?new Promise(o=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(o,o))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let r=t,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const s=this.redirectUser?._redirectEventId,o=r?._redirectEventId,a=await this.tryRedirectSignIn(e);(!s||s===o)&&a?.user&&(r=a.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await oe(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=rn()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(m(this.app))return Promise.reject(k(this));const t=e?g(e):null;return t&&u(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&u(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return m(this.app)?Promise.reject(k(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return m(this.app)?Promise.reject(k(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(v(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await vn(this),t=new Pn(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Ee("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await wn(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&v(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await x.create(this,[v(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(u(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const c=e.addObserver(t,r,i);return()=>{o=!0,c()}}else{const c=e.addObserver(t);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Tt(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e["X-Firebase-Client"]=t);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(m(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&en(`Error while retrieving App Check token: ${e.error}`),e?.token}}function D(n){return g(n)}class qe{constructor(e){this.auth=e,this.observer=null,this.addObserver=$t(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + */class Sn{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new qe(this),this.idTokenSubscription=new qe(this),this.beforeStateQueue=new yn(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=st,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=y(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await F.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await se(this,{idToken:e}),r=await m._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(g(this.app)){const s=this.app.settings.authIdToken;return s?new Promise(o=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(o,o))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let r=t,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const s=this.redirectUser?._redirectEventId,o=r?._redirectEventId,a=await this.tryRedirectSignIn(e);(!s||s===o)&&a?.user&&(r=a.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await oe(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=rn()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(g(this.app))return Promise.reject(v(this));const t=e?T(e):null;return t&&u(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&u(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return g(this.app)?Promise.reject(v(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return g(this.app)?Promise.reject(v(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(y(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await vn(this),t=new Pn(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Ee("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await wn(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&y(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await F.create(this,[y(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(u(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const c=e.addObserver(t,r,i);return()=>{o=!0,c()}}else{const c=e.addObserver(t);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Tt(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e["X-Firebase-Client"]=t);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(g(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&en(`Error while retrieving App Check token: ${e.error}`),e?.token}}function U(n){return T(n)}class qe{constructor(e){this.auth=e,this.observer=null,this.addObserver=$t(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** * @license * Copyright 2020 Google LLC * @@ -418,7 +418,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */let ue={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Rn(n){ue=n}function Et(n){return ue.loadJS(n)}function An(){return ue.recaptchaEnterpriseScript}function Cn(){return ue.gapiScript}function bn(n){return`__${n}${Math.floor(Math.random()*1e6)}`}class On{constructor(){this.enterprise=new Nn}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class Nn{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const Ln="recaptcha-enterprise",yt="NO_RECAPTCHA";class Un{constructor(e){this.type=Ln,this.auth=D(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{dn(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const l=new un(c);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(c=>{a(c)})})}function i(s,o,a){const c=window.grecaptcha;Fe(c)?c.enterprise.ready(()=>{c.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(yt)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new On().execute("siteKey",{action:"verify"}):new Promise((s,o)=>{r(this.auth).then(a=>{if(!t&&Fe(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=An();c.length!==0&&(c+=a),Et(c).then(()=>{i(a,s,o)}).catch(l=>{o(l)})}}).catch(a=>{o(a)})})}}async function Ke(n,e,t,r=!1,i=!1){const s=new Un(n);let o;if(i)o=yt;else try{o=await s.verify(t)}catch{o=await s.verify(t,!0)}const a={...e};if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const c=a.phoneEnrollmentInfo.phoneNumber,l=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:l,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const c=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function we(n,e,t,r,i){if(n._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await Ke(n,e,t,t==="getOobCode");return r(n,s)}else return r(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await Ke(n,e,t,t==="getOobCode");return r(n,o)}else return Promise.reject(s)})}/** + */let ue={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Rn(n){ue=n}function Et(n){return ue.loadJS(n)}function An(){return ue.recaptchaEnterpriseScript}function Cn(){return ue.gapiScript}function bn(n){return`__${n}${Math.floor(Math.random()*1e6)}`}class On{constructor(){this.enterprise=new Nn}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class Nn{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const Ln="recaptcha-enterprise",yt="NO_RECAPTCHA";class Un{constructor(e){this.type=Ln,this.auth=U(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{dn(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const l=new un(c);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(c=>{a(c)})})}function i(s,o,a){const c=window.grecaptcha;Fe(c)?c.enterprise.ready(()=>{c.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(yt)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new On().execute("siteKey",{action:"verify"}):new Promise((s,o)=>{r(this.auth).then(a=>{if(!t&&Fe(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=An();c.length!==0&&(c+=a),Et(c).then(()=>{i(a,s,o)}).catch(l=>{o(l)})}}).catch(a=>{o(a)})})}}async function Ke(n,e,t,r=!1,i=!1){const s=new Un(n);let o;if(i)o=yt;else try{o=await s.verify(t)}catch{o=await s.verify(t,!0)}const a={...e};if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const c=a.phoneEnrollmentInfo.phoneNumber,l=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:l,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const c=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function we(n,e,t,r,i){if(n._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await Ke(n,e,t,t==="getOobCode");return r(n,s)}else return r(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await Ke(n,e,t,t==="getOobCode");return r(n,o)}else return Promise.reject(s)})}/** * @license * Copyright 2020 Google LLC * @@ -433,7 +433,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Dn(n,e){const t=rt(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(me(s,e??{}))return i;I(i,"already-initialized")}return t.initialize({options:e})}function Mn(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(v);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function Fn(n,e,t){const r=D(n);u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=vt(e),{host:o,port:a}=xn(e),c=a===null?"":`:${a}`,l={url:`${s}//${o}${c}/`},d=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){u(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),u(me(l,r.config.emulator)&&me(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=l,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,ve(o)?(zt(`${s}//${o}${c}`),Jt("Auth",!0)):Vn()}function vt(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function xn(n){const e=vt(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:$e(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:$e(o)}}}function $e(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Vn(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/** + */function Dn(n,e){const t=rt(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(me(s,e??{}))return i;_(i,"already-initialized")}return t.initialize({options:e})}function Mn(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(y);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function Fn(n,e,t){const r=U(n);u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=vt(e),{host:o,port:a}=xn(e),c=a===null?"":`:${a}`,l={url:`${s}//${o}${c}/`},d=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){u(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),u(me(l,r.config.emulator)&&me(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=l,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,ve(o)?(zt(`${s}//${o}${c}`),Jt("Auth",!0)):Vn()}function vt(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function xn(n){const e=vt(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:$e(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:$e(o)}}}function $e(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Vn(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/** * @license * Copyright 2020 Google LLC * @@ -448,7 +448,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Ae{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return y("not implemented")}_getIdTokenResponse(e){return y("not implemented")}_linkToIdToken(e,t){return y("not implemented")}_getReauthenticationResolver(e){return y("not implemented")}}async function Wn(n,e){return E(n,"POST","/v1/accounts:update",e)}async function Hn(n,e){return E(n,"POST","/v1/accounts:signUp",e)}/** + */class Ae{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return E("not implemented")}_getIdTokenResponse(e){return E("not implemented")}_linkToIdToken(e,t){return E("not implemented")}_getReauthenticationResolver(e){return E("not implemented")}}async function Wn(n,e){return P(n,"POST","/v1/accounts:signUp",e)}/** * @license * Copyright 2020 Google LLC * @@ -463,7 +463,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function qn(n,e){return J(n,"POST","/v1/accounts:signInWithPassword",O(n,e))}/** + */async function Hn(n,e){return J(n,"POST","/v1/accounts:signInWithPassword",O(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -478,7 +478,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Kn(n,e){return J(n,"POST","/v1/accounts:signInWithEmailLink",O(n,e))}async function $n(n,e){return J(n,"POST","/v1/accounts:signInWithEmailLink",O(n,e))}/** + */async function qn(n,e){return J(n,"POST","/v1/accounts:signInWithEmailLink",O(n,e))}async function Kn(n,e){return J(n,"POST","/v1/accounts:signInWithEmailLink",O(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -493,7 +493,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class j extends Ae{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new j(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new j(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return we(e,t,"signInWithPassword",qn);case"emailLink":return Kn(e,{email:this._email,oobCode:this._password});default:I(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return we(e,r,"signUpPassword",Hn);case"emailLink":return $n(e,{idToken:t,email:this._email,oobCode:this._password});default:I(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/** + */class j extends Ae{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new j(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new j(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return we(e,t,"signInWithPassword",Hn);case"emailLink":return qn(e,{email:this._email,oobCode:this._password});default:_(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return we(e,r,"signUpPassword",Wn);case"emailLink":return Kn(e,{idToken:t,email:this._email,oobCode:this._password});default:_(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/** * @license * Copyright 2020 Google LLC * @@ -508,7 +508,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function V(n,e){return J(n,"POST","/v1/accounts:signInWithIdp",O(n,e))}/** + */async function x(n,e){return J(n,"POST","/v1/accounts:signInWithIdp",O(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -523,7 +523,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const jn="http://localhost";class L extends Ae{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new L(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):I("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=t;if(!r||!i)return null;const o=new L(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return V(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,V(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,V(e,t)}buildRequest(){const e={requestUri:jn,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=B(t)}return e}}/** + */const $n="http://localhost";class N extends Ae{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new N(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):_("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=t;if(!r||!i)return null;const o=new N(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return x(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,x(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,x(e,t)}buildRequest(){const e={requestUri:$n,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=B(t)}return e}}/** * @license * Copyright 2020 Google LLC * @@ -538,7 +538,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Gn(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Bn(n){const e=q(K(n)).link,t=e?q(K(e)).deep_link_id:null,r=q(K(n)).deep_link_id;return(r?q(K(r)).link:null)||r||t||e||n}class Ce{constructor(e){const t=q(K(e)),r=t.apiKey??null,i=t.oobCode??null,s=Gn(t.mode??null);u(r&&i&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=i,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){const t=Bn(e);try{return new Ce(t)}catch{return null}}}/** + */function jn(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Gn(n){const e=q(K(n)).link,t=e?q(K(e)).deep_link_id:null,r=q(K(n)).deep_link_id;return(r?q(K(r)).link:null)||r||t||e||n}class Ce{constructor(e){const t=q(K(e)),r=t.apiKey??null,i=t.oobCode??null,s=jn(t.mode??null);u(r&&i&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=i,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){const t=Gn(e);try{return new Ce(t)}catch{return null}}}/** * @license * Copyright 2020 Google LLC * @@ -598,7 +598,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class R extends Y{constructor(){super("facebook.com")}static credential(e){return L._fromParams({providerId:R.PROVIDER_ID,signInMethod:R.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return R.credentialFromTaggedObject(e)}static credentialFromError(e){return R.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return R.credential(e.oauthAccessToken)}catch{return null}}}R.FACEBOOK_SIGN_IN_METHOD="facebook.com";R.PROVIDER_ID="facebook.com";/** + */class R extends Y{constructor(){super("facebook.com")}static credential(e){return N._fromParams({providerId:R.PROVIDER_ID,signInMethod:R.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return R.credentialFromTaggedObject(e)}static credentialFromError(e){return R.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return R.credential(e.oauthAccessToken)}catch{return null}}}R.FACEBOOK_SIGN_IN_METHOD="facebook.com";R.PROVIDER_ID="facebook.com";/** * @license * Copyright 2020 Google LLC * @@ -613,7 +613,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class A extends Y{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return L._fromParams({providerId:A.PROVIDER_ID,signInMethod:A.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return A.credentialFromTaggedObject(e)}static credentialFromError(e){return A.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return A.credential(t,r)}catch{return null}}}A.GOOGLE_SIGN_IN_METHOD="google.com";A.PROVIDER_ID="google.com";/** + */class A extends Y{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return N._fromParams({providerId:A.PROVIDER_ID,signInMethod:A.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return A.credentialFromTaggedObject(e)}static credentialFromError(e){return A.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return A.credential(t,r)}catch{return null}}}A.GOOGLE_SIGN_IN_METHOD="google.com";A.PROVIDER_ID="google.com";/** * @license * Copyright 2020 Google LLC * @@ -628,7 +628,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class C extends Y{constructor(){super("github.com")}static credential(e){return L._fromParams({providerId:C.PROVIDER_ID,signInMethod:C.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return C.credentialFromTaggedObject(e)}static credentialFromError(e){return C.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return C.credential(e.oauthAccessToken)}catch{return null}}}C.GITHUB_SIGN_IN_METHOD="github.com";C.PROVIDER_ID="github.com";/** + */class C extends Y{constructor(){super("github.com")}static credential(e){return N._fromParams({providerId:C.PROVIDER_ID,signInMethod:C.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return C.credentialFromTaggedObject(e)}static credentialFromError(e){return C.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return C.credential(e.oauthAccessToken)}catch{return null}}}C.GITHUB_SIGN_IN_METHOD="github.com";C.PROVIDER_ID="github.com";/** * @license * Copyright 2020 Google LLC * @@ -643,7 +643,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class b extends Y{constructor(){super("twitter.com")}static credential(e,t){return L._fromParams({providerId:b.PROVIDER_ID,signInMethod:b.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return b.credentialFromTaggedObject(e)}static credentialFromError(e){return b.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return b.credential(t,r)}catch{return null}}}b.TWITTER_SIGN_IN_METHOD="twitter.com";b.PROVIDER_ID="twitter.com";/** + */class b extends Y{constructor(){super("twitter.com")}static credential(e,t){return N._fromParams({providerId:b.PROVIDER_ID,signInMethod:b.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return b.credentialFromTaggedObject(e)}static credentialFromError(e){return b.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return b.credential(t,r)}catch{return null}}}b.TWITTER_SIGN_IN_METHOD="twitter.com";b.PROVIDER_ID="twitter.com";/** * @license * Copyright 2020 Google LLC * @@ -658,7 +658,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function zn(n,e){return J(n,"POST","/v1/accounts:signUp",O(n,e))}/** + */async function Bn(n,e){return J(n,"POST","/v1/accounts:signUp",O(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -673,7 +673,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class U{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await _._fromIdTokenResponse(e,r,i),o=je(r);return new U({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=je(r);return new U({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function je(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/** + */class L{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await m._fromIdTokenResponse(e,r,i),o=je(r);return new L({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=je(r);return new L({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function je(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/** * @license * Copyright 2020 Google LLC * @@ -688,7 +688,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class ae extends ye{constructor(e,t,r,i){super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,ae.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new ae(e,t,r,i)}}function Pt(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?ae._fromErrorAndOperation(n,s,e,r):s})}async function Jn(n,e,t=!1){const r=await N(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return U._forOperation(n,"link",r)}/** + */class ae extends ye{constructor(e,t,r,i){super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,ae.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new ae(e,t,r,i)}}function Pt(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?ae._fromErrorAndOperation(n,s,e,r):s})}async function zn(n,e,t=!1){const r=await V(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return L._forOperation(n,"link",r)}/** * @license * Copyright 2019 Google LLC * @@ -703,7 +703,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Yn(n,e,t=!1){const{auth:r}=n;if(m(r.app))return Promise.reject(k(r));const i="reauthenticate";try{const s=await N(n,Pt(r,i,e,n),t);u(s.idToken,r,"internal-error");const o=Se(s.idToken);u(o,r,"internal-error");const{sub:a}=o;return u(n.uid===a,r,"user-mismatch"),U._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&I(r,"user-mismatch"),s}}/** + */async function Jn(n,e,t=!1){const{auth:r}=n;if(g(r.app))return Promise.reject(v(r));const i="reauthenticate";try{const s=await V(n,Pt(r,i,e,n),t);u(s.idToken,r,"internal-error");const o=Se(s.idToken);u(o,r,"internal-error");const{sub:a}=o;return u(n.uid===a,r,"user-mismatch"),L._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&_(r,"user-mismatch"),s}}/** * @license * Copyright 2020 Google LLC * @@ -718,7 +718,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function St(n,e,t=!1){if(m(n.app))return Promise.reject(k(n));const r="signIn",i=await Pt(n,r,e),s=await U._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Xn(n,e){return St(D(n),e)}/** + */async function St(n,e,t=!1){if(g(n.app))return Promise.reject(v(n));const r="signIn",i=await Pt(n,r,e),s=await L._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Yn(n,e){return St(U(n),e)}/** * @license * Copyright 2020 Google LLC * @@ -733,7 +733,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Rt(n){const e=D(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function pi(n,e,t){if(m(n.app))return Promise.reject(k(n));const r=D(n),o=await we(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",zn).catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&Rt(n),c}),a=await U._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(a.user),a}function gi(n,e,t){return m(n.app)?Promise.reject(k(n)):Xn(g(n),W.credential(e,t)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Rt(n),r})}/** + */async function Rt(n){const e=U(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function hi(n,e,t){if(g(n.app))return Promise.reject(v(n));const r=U(n),o=await we(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Bn).catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&Rt(n),c}),a=await L._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(a.user),a}function fi(n,e,t){return g(n.app)?Promise.reject(v(n)):Yn(T(n),W.credential(e,t)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Rt(n),r})}/** * @license * Copyright 2020 Google LLC * @@ -748,7 +748,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Qn(n,e){return E(n,"POST","/v1/accounts:update",e)}/** + */async function Xn(n,e){return P(n,"POST","/v1/accounts:update",e)}/** * @license * Copyright 2020 Google LLC * @@ -763,7 +763,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function mi(n,{displayName:e,photoURL:t}){if(e===void 0&&t===void 0)return;const r=g(n),s={idToken:await r.getIdToken(),displayName:e,photoUrl:t,returnSecureToken:!0},o=await N(r,Qn(r.auth,s));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:c})=>c==="password");a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function _i(n,e){return Zn(g(n),null,e)}async function Zn(n,e,t){const{auth:r}=n,s={idToken:await n.getIdToken(),returnSecureToken:!0};t&&(s.password=t);const o=await N(n,Wn(r,s));await n._updateTokensIfNecessary(o,!0)}function er(n,e,t,r){return g(n).onIdTokenChanged(e,t,r)}function tr(n,e,t){return g(n).beforeAuthStateChanged(e,t)}function Ii(n,e,t,r){return g(n).onAuthStateChanged(e,t,r)}function wi(n){return g(n).signOut()}async function Ti(n){return g(n).delete()}const ce="__sak";/** + */async function pi(n,{displayName:e,photoURL:t}){if(e===void 0&&t===void 0)return;const r=T(n),s={idToken:await r.getIdToken(),displayName:e,photoUrl:t,returnSecureToken:!0},o=await V(r,Xn(r.auth,s));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:c})=>c==="password");a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function Qn(n,e,t,r){return T(n).onIdTokenChanged(e,t,r)}function Zn(n,e,t){return T(n).beforeAuthStateChanged(e,t)}function gi(n,e,t,r){return T(n).onAuthStateChanged(e,t,r)}function mi(n){return T(n).signOut()}const ce="__sak";/** * @license * Copyright 2019 Google LLC * @@ -793,7 +793,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const nr=1e3,rr=10;class Ct extends At{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=wt(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;t?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);En()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,rr):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},nr)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Ct.type="LOCAL";const ir=Ct;/** + */const er=1e3,tr=10;class Ct extends At{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=wt(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;t?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);En()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,tr):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},er)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Ct.type="LOCAL";const nr=Ct;/** * @license * Copyright 2020 Google LLC * @@ -823,7 +823,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function sr(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/** + */function rr(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/** * @license * Copyright 2019 Google LLC * @@ -838,7 +838,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class de{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new de(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async l=>l(t.origin,s)),c=await sr(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}de.receivers=[];/** + */class de{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new de(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async l=>l(t.origin,s)),c=await rr(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}de.receivers=[];/** * @license * Copyright 2020 Google LLC * @@ -868,7 +868,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class or{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const l=be("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(h){const p=h;if(p.data.eventId===l)switch(p.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(p.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/** + */class ir{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const l=be("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(h){const p=h;if(p.data.eventId===l)switch(p.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(p.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/** * @license * Copyright 2020 Google LLC * @@ -883,7 +883,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function T(){return window}function ar(n){T().location.href=n}/** + */function w(){return window}function sr(n){w().location.href=n}/** * @license * Copyright 2020 Google LLC. * @@ -898,7 +898,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Nt(){return typeof T().WorkerGlobalScope<"u"&&typeof T().importScripts=="function"}async function cr(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function lr(){return navigator?.serviceWorker?.controller||null}function ur(){return Nt()?self:null}/** + */function Nt(){return typeof w().WorkerGlobalScope<"u"&&typeof w().importScripts=="function"}async function or(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function ar(){return navigator?.serviceWorker?.controller||null}function cr(){return Nt()?self:null}/** * @license * Copyright 2019 Google LLC * @@ -913,7 +913,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Lt="firebaseLocalStorageDb",dr=1,le="firebaseLocalStorage",Ut="fbase_key";class X{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function he(n,e){return n.transaction([le],e?"readwrite":"readonly").objectStore(le)}function hr(){const n=indexedDB.deleteDatabase(Lt);return new X(n).toPromise()}function Te(){const n=indexedDB.open(Lt,dr);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(le,{keyPath:Ut})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(le)?e(r):(r.close(),await hr(),e(await Te()))})})}async function Ge(n,e,t){const r=he(n,!0).put({[Ut]:e,value:t});return new X(r).toPromise()}async function fr(n,e){const t=he(n,!1).get(e),r=await new X(t).toPromise();return r===void 0?null:r.value}function Be(n,e){const t=he(n,!0).delete(e);return new X(t).toPromise()}const pr=800,gr=3;class Dt{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Te(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>gr)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Nt()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=de._getInstance(ur()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await cr(),!this.activeServiceWorker)return;this.sender=new or(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||lr()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Te();return await Ge(e,ce,"1"),await Be(e,ce),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>Ge(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>fr(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Be(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=he(i,!1).getAll();return new X(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),pr)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Dt.type="LOCAL";const mr=Dt;new z(3e4,6e4);/** + */const Lt="firebaseLocalStorageDb",lr=1,le="firebaseLocalStorage",Ut="fbase_key";class X{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function he(n,e){return n.transaction([le],e?"readwrite":"readonly").objectStore(le)}function ur(){const n=indexedDB.deleteDatabase(Lt);return new X(n).toPromise()}function Te(){const n=indexedDB.open(Lt,lr);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(le,{keyPath:Ut})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(le)?e(r):(r.close(),await ur(),e(await Te()))})})}async function Ge(n,e,t){const r=he(n,!0).put({[Ut]:e,value:t});return new X(r).toPromise()}async function dr(n,e){const t=he(n,!1).get(e),r=await new X(t).toPromise();return r===void 0?null:r.value}function Be(n,e){const t=he(n,!0).delete(e);return new X(t).toPromise()}const hr=800,fr=3;class Dt{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Te(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>fr)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Nt()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=de._getInstance(cr()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await or(),!this.activeServiceWorker)return;this.sender=new ir(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||ar()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Te();return await Ge(e,ce,"1"),await Be(e,ce),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>Ge(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>dr(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Be(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=he(i,!1).getAll();return new X(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),hr)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Dt.type="LOCAL";const pr=Dt;new z(3e4,6e4);/** * @license * Copyright 2021 Google LLC * @@ -928,7 +928,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function _r(n,e){return e?v(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/** + */function gr(n,e){return e?y(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/** * @license * Copyright 2019 Google LLC * @@ -943,7 +943,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Oe extends Ae{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return V(e,this._buildIdpRequest())}_linkToIdToken(e,t){return V(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return V(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Ir(n){return St(n.auth,new Oe(n),n.bypassAuthState)}function wr(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Yn(t,new Oe(n),n.bypassAuthState)}async function Tr(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Jn(t,new Oe(n),n.bypassAuthState)}/** + */class Oe extends Ae{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return x(e,this._buildIdpRequest())}_linkToIdToken(e,t){return x(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return x(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function mr(n){return St(n.auth,new Oe(n),n.bypassAuthState)}function _r(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Jn(t,new Oe(n),n.bypassAuthState)}async function Ir(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),zn(t,new Oe(n),n.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * @@ -958,7 +958,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Mt{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Ir;case"linkViaPopup":case"linkViaRedirect":return Tr;case"reauthViaPopup":case"reauthViaRedirect":return wr;default:I(this.auth,"internal-error")}}resolve(e){P(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){P(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + */class Mt{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return mr;case"linkViaPopup":case"linkViaRedirect":return Ir;case"reauthViaPopup":case"reauthViaRedirect":return _r;default:_(this.auth,"internal-error")}}resolve(e){k(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){k(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** * @license * Copyright 2020 Google LLC * @@ -973,7 +973,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Er=new z(2e3,1e4);class M extends Mt{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,M.currentPopupAction&&M.currentPopupAction.cancel(),M.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){P(this.filter.length===1,"Popup operations only handle one event");const e=be();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(w(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(w(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,M.currentPopupAction=null}pollUserCancellation(){const e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(w(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Er.get())};e()}}M.currentPopupAction=null;/** + */const wr=new z(2e3,1e4);class D extends Mt{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,D.currentPopupAction&&D.currentPopupAction.cancel(),D.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){k(this.filter.length===1,"Popup operations only handle one event");const e=be();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(I(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(I(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,D.currentPopupAction=null}pollUserCancellation(){const e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(I(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,wr.get())};e()}}D.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * @@ -988,7 +988,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const yr="pendingRedirect",ne=new Map;class vr extends Mt{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ne.get(this.auth._key());if(!e){try{const r=await kr(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}ne.set(this.auth._key(),e)}return this.bypassAuthState||ne.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function kr(n,e){const t=Rr(e),r=Sr(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function Pr(n,e){ne.set(n._key(),e)}function Sr(n){return v(n._redirectPersistence)}function Rr(n){return te(yr,n.config.apiKey,n.name)}async function Ar(n,e,t=!1){if(m(n.app))return Promise.reject(k(n));const r=D(n),i=_r(r,e),o=await new vr(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/** + */const Tr="pendingRedirect",ne=new Map;class Er extends Mt{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ne.get(this.auth._key());if(!e){try{const r=await yr(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}ne.set(this.auth._key(),e)}return this.bypassAuthState||ne.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function yr(n,e){const t=Pr(e),r=kr(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function vr(n,e){ne.set(n._key(),e)}function kr(n){return y(n._redirectPersistence)}function Pr(n){return te(Tr,n.config.apiKey,n.name)}async function Sr(n,e,t=!1){if(g(n.app))return Promise.reject(v(n));const r=U(n),i=gr(r,e),o=await new Er(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/** * @license * Copyright 2020 Google LLC * @@ -1003,7 +1003,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Cr=600*1e3;class br{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Or(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!Ft(e)){const r=e.error.code?.split("auth/")[1]||"internal-error";t.onError(w(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Cr&&this.cachedEventUids.clear(),this.cachedEventUids.has(ze(e))}saveEventToCache(e){this.cachedEventUids.add(ze(e)),this.lastProcessedEventTime=Date.now()}}function ze(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Ft({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function Or(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Ft(n);default:return!1}}/** + */const Rr=600*1e3;class Ar{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Cr(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!Ft(e)){const r=e.error.code?.split("auth/")[1]||"internal-error";t.onError(I(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Rr&&this.cachedEventUids.clear(),this.cachedEventUids.has(ze(e))}saveEventToCache(e){this.cachedEventUids.add(ze(e)),this.lastProcessedEventTime=Date.now()}}function ze(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Ft({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function Cr(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Ft(n);default:return!1}}/** * @license * Copyright 2020 Google LLC * @@ -1018,7 +1018,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Nr(n,e={}){return E(n,"GET","/v1/projects",e)}/** + */async function br(n,e={}){return P(n,"GET","/v1/projects",e)}/** * @license * Copyright 2020 Google LLC * @@ -1033,7 +1033,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Lr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ur=/^https?/;async function Dr(n){if(n.config.emulator)return;const{authorizedDomains:e}=await Nr(n);for(const t of e)try{if(Mr(t))return}catch{}I(n,"unauthorized-domain")}function Mr(n){const e=_e(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!Ur.test(t))return!1;if(Lr.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** + */const Or=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Nr=/^https?/;async function Lr(n){if(n.config.emulator)return;const{authorizedDomains:e}=await br(n);for(const t of e)try{if(Ur(t))return}catch{}_(n,"unauthorized-domain")}function Ur(n){const e=_e(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!Nr.test(t))return!1;if(Or.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** * @license * Copyright 2020 Google LLC. * @@ -1048,7 +1048,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Fr=new z(3e4,6e4);function Je(){const n=T().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{function r(){Je(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Je(),t(w(n,"network-request-failed"))},timeout:Fr.get()})}if(T().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(T().gapi?.load)r();else{const i=bn("iframefcb");return T()[i]=()=>{gapi.load?r():t(w(n,"network-request-failed"))},Et(`${Cn()}?onload=${i}`).catch(s=>t(s))}}).catch(e=>{throw re=null,e})}let re=null;function Vr(n){return re=re||xr(n),re}/** + */const Dr=new z(3e4,6e4);function Je(){const n=w().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{function r(){Je(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Je(),t(I(n,"network-request-failed"))},timeout:Dr.get()})}if(w().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(w().gapi?.load)r();else{const i=bn("iframefcb");return w()[i]=()=>{gapi.load?r():t(I(n,"network-request-failed"))},Et(`${Cn()}?onload=${i}`).catch(s=>t(s))}}).catch(e=>{throw re=null,e})}let re=null;function Fr(n){return re=re||Mr(n),re}/** * @license * Copyright 2020 Google LLC. * @@ -1063,7 +1063,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Wr=new z(5e3,15e3),Hr="__/auth/iframe",qr="emulator/auth/iframe",Kr={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},$r=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function jr(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Pe(e,qr):`https://${n.config.authDomain}/${Hr}`,r={apiKey:e.apiKey,appName:n.name,v:G},i=$r.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${B(r).slice(1)}`}async function Gr(n){const e=await Vr(n),t=T().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:jr(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Kr,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=w(n,"network-request-failed"),a=T().setTimeout(()=>{s(o)},Wr.get());function c(){T().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/** + */const xr=new z(5e3,15e3),Vr="__/auth/iframe",Wr="emulator/auth/iframe",Hr={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},qr=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Kr(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Pe(e,Wr):`https://${n.config.authDomain}/${Vr}`,r={apiKey:e.apiKey,appName:n.name,v:G},i=qr.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${B(r).slice(1)}`}async function $r(n){const e=await Fr(n),t=w().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:Kr(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Hr,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=I(n,"network-request-failed"),a=w().setTimeout(()=>{s(o)},xr.get());function c(){w().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/** * @license * Copyright 2020 Google LLC. * @@ -1078,7 +1078,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Br={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},zr=500,Jr=600,Yr="_blank",Xr="http://localhost";class Ye{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Qr(n,e,t,r=zr,i=Jr){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c={...Br,width:r.toString(),height:i.toString(),top:s,left:o},l=f().toLowerCase();t&&(a=pt(l)?Yr:t),ht(l)&&(e=e||Xr,c.scrollbars="yes");const d=Object.entries(c).reduce((p,[Q,H])=>`${p}${Q}=${H},`,"");if(Tn(l)&&a!=="_self")return Zr(e||"",a),new Ye(null);const h=window.open(e||"",a,d);u(h,n,"popup-blocked");try{h.focus()}catch{}return new Ye(h)}function Zr(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/** + */const jr={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Gr=500,Br=600,zr="_blank",Jr="http://localhost";class Ye{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Yr(n,e,t,r=Gr,i=Br){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c={...jr,width:r.toString(),height:i.toString(),top:s,left:o},l=f().toLowerCase();t&&(a=pt(l)?zr:t),ht(l)&&(e=e||Jr,c.scrollbars="yes");const d=Object.entries(c).reduce((p,[Q,H])=>`${p}${Q}=${H},`,"");if(Tn(l)&&a!=="_self")return Xr(e||"",a),new Ye(null);const h=window.open(e||"",a,d);u(h,n,"popup-blocked");try{h.focus()}catch{}return new Ye(h)}function Xr(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/** * @license * Copyright 2021 Google LLC * @@ -1093,7 +1093,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ei="__/auth/handler",ti="emulator/auth/handler",ni=encodeURIComponent("fac");async function Xe(n,e,t,r,i,s){u(n.config.authDomain,n,"auth-domain-config-required"),u(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:G,eventId:i};if(e instanceof kt){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Xt(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,h]of Object.entries({}))o[d]=h}if(e instanceof Y){const d=e.getScopes().filter(h=>h!=="");d.length>0&&(o.scopes=d.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const c=await n._getAppCheckToken(),l=c?`#${ni}=${encodeURIComponent(c)}`:"";return`${ri(n)}?${B(a).slice(1)}${l}`}function ri({config:n}){return n.emulator?Pe(n,ti):`https://${n.authDomain}/${ei}`}/** + */const Qr="__/auth/handler",Zr="emulator/auth/handler",ei=encodeURIComponent("fac");async function Xe(n,e,t,r,i,s){u(n.config.authDomain,n,"auth-domain-config-required"),u(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:G,eventId:i};if(e instanceof kt){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Xt(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,h]of Object.entries({}))o[d]=h}if(e instanceof Y){const d=e.getScopes().filter(h=>h!=="");d.length>0&&(o.scopes=d.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const c=await n._getAppCheckToken(),l=c?`#${ei}=${encodeURIComponent(c)}`:"";return`${ti(n)}?${B(a).slice(1)}${l}`}function ti({config:n}){return n.emulator?Pe(n,Zr):`https://${n.authDomain}/${Qr}`}/** * @license * Copyright 2020 Google LLC * @@ -1108,7 +1108,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ge="webStorageSupport";class ii{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ot,this._completeRedirectFn=Ar,this._overrideRedirectResult=Pr}async _openPopup(e,t,r,i){P(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");const s=await Xe(e,t,r,_e(),i);return Qr(e,s,be())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await Xe(e,t,r,_e(),i);return ar(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(P(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Gr(e),r=new br(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(ge,{type:ge},i=>{const s=i?.[0]?.[ge];s!==void 0&&t(!!s),I(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Dr(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return wt()||ft()||Re()}}const si=ii;var Qe="@firebase/auth",Ze="1.12.0";/** + */const ge="webStorageSupport";class ni{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ot,this._completeRedirectFn=Sr,this._overrideRedirectResult=vr}async _openPopup(e,t,r,i){k(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");const s=await Xe(e,t,r,_e(),i);return Yr(e,s,be())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await Xe(e,t,r,_e(),i);return sr(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(k(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await $r(e),r=new Ar(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(ge,{type:ge},i=>{const s=i?.[0]?.[ge];s!==void 0&&t(!!s),_(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Lr(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return wt()||ft()||Re()}}const ri=ni;var Qe="@firebase/auth",Ze="1.12.0";/** * @license * Copyright 2020 Google LLC * @@ -1123,7 +1123,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class oi{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** + */class ii{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** * @license * Copyright 2020 Google LLC * @@ -1138,7 +1138,7 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function ai(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function ci(n){Le(new Ue("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;u(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Tt(n)},l=new Sn(r,i,s,c);return Mn(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Le(new Ue("auth-internal",e=>{const t=D(e.getProvider("auth").getImmediate());return(r=>new oi(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),De(Qe,Ze,ai(n)),De(Qe,Ze,"esm2020")}/** + */function si(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function oi(n){Le(new Ue("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;u(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Tt(n)},l=new Sn(r,i,s,c);return Mn(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Le(new Ue("auth-internal",e=>{const t=U(e.getProvider("auth").getImmediate());return(r=>new ii(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),De(Qe,Ze,si(n)),De(Qe,Ze,"esm2020")}/** * @license * Copyright 2021 Google LLC * @@ -1153,4 +1153,4 @@ import{L as Wt,g as tt,i as Ht,a as qt,_ as Le,C as Ue,r as De,b as Kt,S as G,E * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const li=300,ui=tt("authIdTokenMaxAge")||li;let et=null;const di=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>ui)return;const i=t?.token;et!==i&&(et=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Ei(n=Bt()){const e=rt(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Dn(n,{popupRedirectResolver:si,persistence:[mr,ir,Ot]}),r=tt("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=di(s.toString());tr(t,o,()=>o(t.currentUser)),er(t,a=>o(a))}}const i=Gt("auth");return i&&Fn(t,`http://${i}`),t}function hi(){return document.getElementsByTagName("head")?.[0]??document}Rn({loadJS(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=w("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",hi().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});ci("Browser");export{A as G,wi as a,_i as b,pi as c,Ti as d,Ei as g,Ii as o,gi as s,mi as u}; + */const ai=300,ci=tt("authIdTokenMaxAge")||ai;let et=null;const li=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>ci)return;const i=t?.token;et!==i&&(et=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function _i(n=Bt()){const e=rt(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Dn(n,{popupRedirectResolver:ri,persistence:[pr,nr,Ot]}),r=tt("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=li(s.toString());Zn(t,o,()=>o(t.currentUser)),Qn(t,a=>o(a))}}const i=Gt("auth");return i&&Fn(t,`http://${i}`),t}function ui(){return document.getElementsByTagName("head")?.[0]??document}Rn({loadJS(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=I("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",ui().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});oi("Browser");export{A as G,fi as a,hi as c,_i as g,gi as o,mi as s,pi as u}; diff --git a/assets/vendor-firebase-core-BireMWc7.js b/assets/vendor-firebase-core-BireMWc7.js new file mode 100644 index 0000000000000000000000000000000000000000..84db7c770d853066bef591f0517b02977361945f --- /dev/null +++ b/assets/vendor-firebase-core-BireMWc7.js @@ -0,0 +1,1855 @@ +const Xa=()=>{};var Sr={};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const wo={NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const A=function(n,e){if(!n)throw dt(e)},dt=function(n){return new Error("Firebase Database ("+wo.SDK_VERSION+") INTERNAL ASSERT FAILED: "+n)};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const So=function(n){const e=[];let t=0;for(let i=0;i>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},Ja=function(n){const e=[];let t=0,i=0;for(;t191&&r<224){const l=n[t++];e[i++]=String.fromCharCode((r&31)<<6|l&63)}else if(r>239&&r<365){const l=n[t++],a=n[t++],u=n[t++],p=((r&7)<<18|(l&63)<<12|(a&63)<<6|u&63)-65536;e[i++]=String.fromCharCode(55296+(p>>10)),e[i++]=String.fromCharCode(56320+(p&1023))}else{const l=n[t++],a=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(l&63)<<6|a&63)}}return e.join("")},zi={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r>2,w=(l&3)<<4|u>>4;let I=(u&15)<<2|f>>6,N=f&63;p||(N=64,a||(I=64)),i.push(t[T],t[w],t[I],t[N])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(So(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Ja(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r>4;if(i.push(I),f!==64){const N=u<<4&240|f>>2;if(i.push(N),w!==64){const R=f<<6&192|w;i.push(R)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class Qa extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const To=function(n){const e=So(n);return zi.encodeByteArray(e,!0)},yn=function(n){return To(n).replace(/\./g,"")},Ai=function(n){try{return zi.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Za(n){return Io(void 0,n)}function Io(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(const t in e)!e.hasOwnProperty(t)||!eh(t)||(n[t]=Io(n[t],e[t]));return n}function eh(n){return n!=="__proto__"}/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function th(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const nh=()=>th().__FIREBASE_DEFAULTS__,ih=()=>{if(typeof process>"u"||typeof Sr>"u")return;const n=Sr.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},sh=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Ai(n[1]);return e&&JSON.parse(e)},Dn=()=>{try{return Xa()||nh()||ih()||sh()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},rh=n=>Dn()?.emulatorHosts?.[n],bo=n=>{const e=rh(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const i=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),i]:[e.substring(0,t),i]},Ao=()=>Dn()?.config,kp=n=>Dn()?.[`_${n}`];/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ki{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}}/** + * @license + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function On(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Ro(n){return(await fetch(n,{credentials:"include"})).ok}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function oh(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},i=e||"demo-project",r=n.iat||0,l=n.sub||n.user_id;if(!l)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a={iss:`https://securetoken.google.com/${i}`,aud:i,iat:r,exp:r+3600,auth_time:r,sub:l,user_id:l,firebase:{sign_in_provider:"custom",identities:{}},...n};return[yn(JSON.stringify(t)),yn(JSON.stringify(a)),""].join(".")}const Bt={};function lh(){const n={prod:[],emulator:[]};for(const e of Object.keys(Bt))Bt[e]?n.emulator.push(e):n.prod.push(e);return n}function ah(n){let e=document.getElementById(n),t=!1;return e||(e=document.createElement("div"),e.setAttribute("id",n),t=!0),{created:t,element:e}}let Tr=!1;function No(n,e){if(typeof window>"u"||typeof document>"u"||!On(window.location.host)||Bt[n]===e||Bt[n]||Tr)return;Bt[n]=e;function t(I){return`__firebase__banner__${I}`}const i="__firebase__banner",l=lh().prod.length>0;function a(){const I=document.getElementById(i);I&&I.remove()}function u(I){I.style.display="flex",I.style.background="#7faaf0",I.style.position="fixed",I.style.bottom="5px",I.style.left="5px",I.style.padding=".5em",I.style.borderRadius="5px",I.style.alignItems="center"}function p(I,N){I.setAttribute("width","24"),I.setAttribute("id",N),I.setAttribute("height","24"),I.setAttribute("viewBox","0 0 24 24"),I.setAttribute("fill","none"),I.style.marginLeft="-6px"}function f(){const I=document.createElement("span");return I.style.cursor="pointer",I.style.marginLeft="16px",I.style.fontSize="24px",I.innerHTML=" ×",I.onclick=()=>{Tr=!0,a()},I}function T(I,N){I.setAttribute("id",N),I.innerText="Learn more",I.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",I.setAttribute("target","__blank"),I.style.paddingLeft="5px",I.style.textDecoration="underline"}function w(){const I=ah(i),N=t("text"),R=document.getElementById(N)||document.createElement("span"),M=t("learnmore"),D=document.getElementById(M)||document.createElement("a"),le=t("preprendIcon"),J=document.getElementById(le)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(I.created){const Q=I.element;u(Q),T(D,M);const _e=f();p(J,le),Q.append(J,R,D,_e),document.body.appendChild(Q)}l?(R.innerText="Preview backend disconnected.",J.innerHTML=` + + + + + + +`):(J.innerHTML=` + + + + + + +`,R.innerText="Preview backend running in this workspace."),R.setAttribute("id",N)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",w):w()}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ko(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Do(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(ko())}function hh(){const n=Dn()?.forceEnvironment;if(n==="node")return!0;if(n==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Dp(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Op(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function ch(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Mp(){const n=ko();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function uh(){return wo.NODE_ADMIN===!0}function Pp(){return!hh()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function fh(){try{return typeof indexedDB=="object"}catch{return!1}}function dh(){return new Promise((n,e)=>{try{let t=!0;const i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{e(r.error?.message||"")}}catch(t){e(t)}})}function xp(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const ph="FirebaseError";class pt extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=ph,Object.setPrototypeOf(this,pt.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Yi.prototype.create)}}class Yi{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){const i=t[0]||{},r=`${this.service}/${e}`,l=this.errors[e],a=l?gh(l,i):"Error",u=`${this.serviceName}: ${a} (${r}).`;return new pt(r,u,i)}}function gh(n,e){return n.replace(_h,(t,i)=>{const r=e[i];return r!=null?String(r):`<${i}?>`})}const _h=/\{\$([^}]+)}/g;/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function $t(n){return JSON.parse(n)}function X(n){return JSON.stringify(n)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Oo=function(n){let e={},t={},i={},r="";try{const l=n.split(".");e=$t(Ai(l[0])||""),t=$t(Ai(l[1])||""),r=l[2],i=t.d||{},delete t.d}catch{}return{header:e,claims:t,data:i,signature:r}},mh=function(n){const e=Oo(n),t=e.claims;return!!t&&typeof t=="object"&&t.hasOwnProperty("iat")},yh=function(n){const e=Oo(n).claims;return typeof e=="object"&&e.admin===!0};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ie(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ct(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}function Ir(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function vn(n,e,t){const i={};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=e.call(t,n[r],r,n));return i}function Cn(n,e){if(n===e)return!0;const t=Object.keys(n),i=Object.keys(e);for(const r of t){if(!i.includes(r))return!1;const l=n[r],a=e[r];if(br(l)&&br(a)){if(!Cn(l,a))return!1}else if(l!==a)return!1}for(const r of i)if(!t.includes(r))return!1;return!0}function br(n){return n!==null&&typeof n=="object"}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function vh(n){const e=[];for(const[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function Lp(n){const e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){const[r,l]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(l)}}),e}function Fp(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ch{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e>>31)&4294967295}let r=this.chain_[0],l=this.chain_[1],a=this.chain_[2],u=this.chain_[3],p=this.chain_[4],f,T;for(let w=0;w<80;w++){w<40?w<20?(f=u^l&(a^u),T=1518500249):(f=l^a^u,T=1859775393):w<60?(f=l&a|u&(l|a),T=2400959708):(f=l^a^u,T=3395469782);const I=(r<<5|r>>>27)+f+p+T+i[w]&4294967295;p=u,u=a,a=(l<<30|l>>>2)&4294967295,l=r,r=I}this.chain_[0]=this.chain_[0]+r&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+u&4294967295,this.chain_[4]=this.chain_[4]+p&4294967295}update(e,t){if(e==null)return;t===void 0&&(t=e.length);const i=t-this.blockSize;let r=0;const l=this.buf_;let a=this.inbuf_;for(;r=56;r--)this.buf_[r]=t&255,t/=256;this.compress_(this.buf_);let i=0;for(let r=0;r<5;r++)for(let l=24;l>=0;l-=8)e[i]=this.chain_[r]>>l&255,++i;return e}}function Bp(n,e){const t=new Eh(n,e);return t.subscribe.bind(t)}class Eh{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");wh(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=di),r.error===void 0&&(r.error=di),r.complete===void 0&&(r.complete=di);const l=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),l}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function wh(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function di(){}function Sh(n,e){return`${n} failed: ${e} argument `}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Th=function(n){const e=[];let t=0;for(let i=0;i=55296&&r<=56319){const l=r-55296;i++,A(i>6|192,e[t++]=r&63|128):r<65536?(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},Mn=function(n){let e=0;for(let t=0;t=55296&&i<=56319?(e+=4,t++):e+=3}return e};/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ih=1e3,bh=2,Ah=14400*1e3,Rh=.5;function Hp(n,e=Ih,t=bh){const i=e*Math.pow(t,n),r=Math.round(Rh*i*(Math.random()-.5)*2);return Math.min(Ah,i+r)}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Pn(n){return n&&n._delegate?n._delegate:n}class Le{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ve="[DEFAULT]";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Nh{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const i=new Ki;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e?.identifier),i=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(r){if(i)return null;throw r}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Dh(e))try{this.getOrInitializeService({instanceIdentifier:Ve})}catch{}for(const[t,i]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(t);try{const l=this.getOrInitializeService({instanceIdentifier:r});i.resolve(l)}catch{}}}}clearInstance(e=Ve){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Ve){return this.instances.has(e)}getOptions(e=Ve){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(const[l,a]of this.instancesDeferred.entries()){const u=this.normalizeInstanceIdentifier(l);i===u&&a.resolve(r)}return r}onInit(e,t){const i=this.normalizeInstanceIdentifier(t),r=this.onInitCallbacks.get(i)??new Set;r.add(e),this.onInitCallbacks.set(i,r);const l=this.instances.get(i);return l&&e(l,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const i=this.onInitCallbacks.get(t);if(i)for(const r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:kh(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=Ve){return this.component?this.component.multipleInstances?e:Ve:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function kh(n){return n===Ve?void 0:n}function Dh(n){return n.instantiationMode==="EAGER"}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Oh{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new Nh(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var H;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(H||(H={}));const Mh={debug:H.DEBUG,verbose:H.VERBOSE,info:H.INFO,warn:H.WARN,error:H.ERROR,silent:H.SILENT},Ph=H.INFO,xh={[H.DEBUG]:"log",[H.VERBOSE]:"log",[H.INFO]:"info",[H.WARN]:"warn",[H.ERROR]:"error"},Lh=(n,e,...t)=>{if(ee.some(t=>n instanceof t);let Ar,Rr;function Bh(){return Ar||(Ar=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Hh(){return Rr||(Rr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Po=new WeakMap,Ri=new WeakMap,xo=new WeakMap,pi=new WeakMap,Xi=new WeakMap;function Uh(n){const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("success",l),n.removeEventListener("error",a)},l=()=>{t(Me(n.result)),r()},a=()=>{i(n.error),r()};n.addEventListener("success",l),n.addEventListener("error",a)});return e.then(t=>{t instanceof IDBCursor&&Po.set(t,n)}).catch(()=>{}),Xi.set(e,n),e}function jh(n){if(Ri.has(n))return;const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("complete",l),n.removeEventListener("error",a),n.removeEventListener("abort",a)},l=()=>{t(),r()},a=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",l),n.addEventListener("error",a),n.addEventListener("abort",a)});Ri.set(n,e)}let Ni={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Ri.get(n);if(e==="objectStoreNames")return n.objectStoreNames||xo.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return Me(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Wh(n){Ni=n(Ni)}function $h(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const i=n.call(gi(this),e,...t);return xo.set(i,e.sort?e.sort():[e]),Me(i)}:Hh().includes(n)?function(...e){return n.apply(gi(this),e),Me(Po.get(this))}:function(...e){return Me(n.apply(gi(this),e))}}function Vh(n){return typeof n=="function"?$h(n):(n instanceof IDBTransaction&&jh(n),Fh(n,Bh())?new Proxy(n,Ni):n)}function Me(n){if(n instanceof IDBRequest)return Uh(n);if(pi.has(n))return pi.get(n);const e=Vh(n);return e!==n&&(pi.set(n,e),Xi.set(e,n)),e}const gi=n=>Xi.get(n);function Lo(n,e,{blocked:t,upgrade:i,blocking:r,terminated:l}={}){const a=indexedDB.open(n,e),u=Me(a);return i&&a.addEventListener("upgradeneeded",p=>{i(Me(a.result),p.oldVersion,p.newVersion,Me(a.transaction),p)}),t&&a.addEventListener("blocked",p=>t(p.oldVersion,p.newVersion,p)),u.then(p=>{l&&p.addEventListener("close",()=>l()),r&&p.addEventListener("versionchange",f=>r(f.oldVersion,f.newVersion,f))}).catch(()=>{}),u}const Gh=["get","getKey","getAll","getAllKeys","count"],qh=["put","add","delete","clear"],_i=new Map;function Nr(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(_i.get(e))return _i.get(e);const t=e.replace(/FromIndex$/,""),i=e!==t,r=qh.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||Gh.includes(t)))return;const l=async function(a,...u){const p=this.transaction(a,r?"readwrite":"readonly");let f=p.store;return i&&(f=f.index(u.shift())),(await Promise.all([f[t](...u),r&&p.done]))[0]};return _i.set(e,l),l}Wh(n=>({...n,get:(e,t,i)=>Nr(e,t)||n.get(e,t,i),has:(e,t)=>!!Nr(e,t)||n.has(e,t)}));/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zh{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Kh(t)){const i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}}function Kh(n){return n.getComponent()?.type==="VERSION"}const ki="@firebase/app",kr="0.14.8";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Se=new Mo("@firebase/app"),Yh="@firebase/app-compat",Xh="@firebase/analytics-compat",Jh="@firebase/analytics",Qh="@firebase/app-check-compat",Zh="@firebase/app-check",ec="@firebase/auth",tc="@firebase/auth-compat",nc="@firebase/database",ic="@firebase/data-connect",sc="@firebase/database-compat",rc="@firebase/functions",oc="@firebase/functions-compat",lc="@firebase/installations",ac="@firebase/installations-compat",hc="@firebase/messaging",cc="@firebase/messaging-compat",uc="@firebase/performance",fc="@firebase/performance-compat",dc="@firebase/remote-config",pc="@firebase/remote-config-compat",gc="@firebase/storage",_c="@firebase/storage-compat",mc="@firebase/firestore",yc="@firebase/ai",vc="@firebase/firestore-compat",Cc="firebase",Ec="12.9.0";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Di="[DEFAULT]",wc={[ki]:"fire-core",[Yh]:"fire-core-compat",[Jh]:"fire-analytics",[Xh]:"fire-analytics-compat",[Zh]:"fire-app-check",[Qh]:"fire-app-check-compat",[ec]:"fire-auth",[tc]:"fire-auth-compat",[nc]:"fire-rtdb",[ic]:"fire-data-connect",[sc]:"fire-rtdb-compat",[rc]:"fire-fn",[oc]:"fire-fn-compat",[lc]:"fire-iid",[ac]:"fire-iid-compat",[hc]:"fire-fcm",[cc]:"fire-fcm-compat",[uc]:"fire-perf",[fc]:"fire-perf-compat",[dc]:"fire-rc",[pc]:"fire-rc-compat",[gc]:"fire-gcs",[_c]:"fire-gcs-compat",[mc]:"fire-fst",[vc]:"fire-fst-compat",[yc]:"fire-vertex","fire-js":"fire-js",[Cc]:"fire-js-all"};/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const En=new Map,Sc=new Map,Oi=new Map;function Dr(n,e){try{n.container.addComponent(e)}catch(t){Se.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Ke(n){const e=n.name;if(Oi.has(e))return Se.debug(`There were multiple attempts to register component ${e}.`),!1;Oi.set(e,n);for(const t of En.values())Dr(t,n);for(const t of Sc.values())Dr(t,n);return!0}function xn(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function Fo(n){return n==null?!1:n.settings!==void 0}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Tc={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Pe=new Yi("app","Firebase",Tc);/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ic{constructor(e,t,i){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new Le("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Pe.create("app-deleted",{appName:this._name})}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const bc=Ec;function Ac(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const i={name:Di,automaticDataCollectionEnabled:!0,...e},r=i.name;if(typeof r!="string"||!r)throw Pe.create("bad-app-name",{appName:String(r)});if(t||(t=Ao()),!t)throw Pe.create("no-options");const l=En.get(r);if(l){if(Cn(t,l.options)&&Cn(i,l.config))return l;throw Pe.create("duplicate-app",{appName:r})}const a=new Oh(r);for(const p of Oi.values())a.addComponent(p);const u=new Ic(t,i,a);return En.set(r,u),u}function Bo(n=Di){const e=En.get(n);if(!e&&n===Di&&Ao())return Ac();if(!e)throw Pe.create("no-app",{appName:n});return e}function Ce(n,e,t){let i=wc[n]??n;t&&(i+=`-${t}`);const r=i.match(/\s|\//),l=e.match(/\s|\//);if(r||l){const a=[`Unable to register library "${i}" with version "${e}":`];r&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),r&&l&&a.push("and"),l&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Se.warn(a.join(" "));return}Ke(new Le(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Rc="firebase-heartbeat-database",Nc=1,Vt="firebase-heartbeat-store";let mi=null;function Ho(){return mi||(mi=Lo(Rc,Nc,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(Vt)}catch(t){console.warn(t)}}}}).catch(n=>{throw Pe.create("idb-open",{originalErrorMessage:n.message})})),mi}async function kc(n){try{const t=(await Ho()).transaction(Vt),i=await t.objectStore(Vt).get(Uo(n));return await t.done,i}catch(e){if(e instanceof pt)Se.warn(e.message);else{const t=Pe.create("idb-get",{originalErrorMessage:e?.message});Se.warn(t.message)}}}async function Or(n,e){try{const i=(await Ho()).transaction(Vt,"readwrite");await i.objectStore(Vt).put(e,Uo(n)),await i.done}catch(t){if(t instanceof pt)Se.warn(t.message);else{const i=Pe.create("idb-set",{originalErrorMessage:t?.message});Se.warn(i.message)}}}function Uo(n){return`${n.name}!${n.options.appId}`}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Dc=1024,Oc=30;class Mc{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new xc(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}async triggerHeartbeat(){try{const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=Mr();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(r=>r.date===i))return;if(this._heartbeatsCache.heartbeats.push({date:i,agent:t}),this._heartbeatsCache.heartbeats.length>Oc){const r=Lc(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(r,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){Se.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const e=Mr(),{heartbeatsToSend:t,unsentEntries:i}=Pc(this._heartbeatsCache.heartbeats),r=yn(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(e){return Se.warn(e),""}}}function Mr(){return new Date().toISOString().substring(0,10)}function Pc(n,e=Dc){const t=[];let i=n.slice();for(const r of n){const l=t.find(a=>a.agent===r.agent);if(l){if(l.dates.push(r.date),Pr(t)>e){l.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),Pr(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}class xc{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return fh()?dh().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await kc(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const i=await this.read();return Or(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const i=await this.read();return Or(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Pr(n){return yn(JSON.stringify({version:2,heartbeats:n})).length}function Lc(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let i=1;inew zh(e),"PRIVATE")),Ke(new Le("heartbeat",e=>new Mc(e),"PRIVATE")),Ce(ki,kr,n),Ce(ki,kr,"esm2020"),Ce("fire-js","")}Fc("");var Bc="firebase",Hc="12.9.0";/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */Ce(Bc,Hc,"app");var xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var Uc,jc;(function(){var n;/** @license + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/function e(y,d){function _(){}_.prototype=d.prototype,y.F=d.prototype,y.prototype=new _,y.prototype.constructor=y,y.D=function(v,m,E){for(var g=Array(arguments.length-2),re=2;re>>25),g=E+(m^d&(_^m))+v[1]+3905402710&4294967295,E=d+(g<<12&4294967295|g>>>20),g=m+(_^E&(d^_))+v[2]+606105819&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(d^m&(E^d))+v[3]+3250441966&4294967295,_=m+(g<<22&4294967295|g>>>10),g=d+(E^_&(m^E))+v[4]+4118548399&4294967295,d=_+(g<<7&4294967295|g>>>25),g=E+(m^d&(_^m))+v[5]+1200080426&4294967295,E=d+(g<<12&4294967295|g>>>20),g=m+(_^E&(d^_))+v[6]+2821735955&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(d^m&(E^d))+v[7]+4249261313&4294967295,_=m+(g<<22&4294967295|g>>>10),g=d+(E^_&(m^E))+v[8]+1770035416&4294967295,d=_+(g<<7&4294967295|g>>>25),g=E+(m^d&(_^m))+v[9]+2336552879&4294967295,E=d+(g<<12&4294967295|g>>>20),g=m+(_^E&(d^_))+v[10]+4294925233&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(d^m&(E^d))+v[11]+2304563134&4294967295,_=m+(g<<22&4294967295|g>>>10),g=d+(E^_&(m^E))+v[12]+1804603682&4294967295,d=_+(g<<7&4294967295|g>>>25),g=E+(m^d&(_^m))+v[13]+4254626195&4294967295,E=d+(g<<12&4294967295|g>>>20),g=m+(_^E&(d^_))+v[14]+2792965006&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(d^m&(E^d))+v[15]+1236535329&4294967295,_=m+(g<<22&4294967295|g>>>10),g=d+(m^E&(_^m))+v[1]+4129170786&4294967295,d=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(d^_))+v[6]+3225465664&4294967295,E=d+(g<<9&4294967295|g>>>23),g=m+(d^_&(E^d))+v[11]+643717713&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^d&(m^E))+v[0]+3921069994&4294967295,_=m+(g<<20&4294967295|g>>>12),g=d+(m^E&(_^m))+v[5]+3593408605&4294967295,d=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(d^_))+v[10]+38016083&4294967295,E=d+(g<<9&4294967295|g>>>23),g=m+(d^_&(E^d))+v[15]+3634488961&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^d&(m^E))+v[4]+3889429448&4294967295,_=m+(g<<20&4294967295|g>>>12),g=d+(m^E&(_^m))+v[9]+568446438&4294967295,d=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(d^_))+v[14]+3275163606&4294967295,E=d+(g<<9&4294967295|g>>>23),g=m+(d^_&(E^d))+v[3]+4107603335&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^d&(m^E))+v[8]+1163531501&4294967295,_=m+(g<<20&4294967295|g>>>12),g=d+(m^E&(_^m))+v[13]+2850285829&4294967295,d=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(d^_))+v[2]+4243563512&4294967295,E=d+(g<<9&4294967295|g>>>23),g=m+(d^_&(E^d))+v[7]+1735328473&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^d&(m^E))+v[12]+2368359562&4294967295,_=m+(g<<20&4294967295|g>>>12),g=d+(_^m^E)+v[5]+4294588738&4294967295,d=_+(g<<4&4294967295|g>>>28),g=E+(d^_^m)+v[8]+2272392833&4294967295,E=d+(g<<11&4294967295|g>>>21),g=m+(E^d^_)+v[11]+1839030562&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^d)+v[14]+4259657740&4294967295,_=m+(g<<23&4294967295|g>>>9),g=d+(_^m^E)+v[1]+2763975236&4294967295,d=_+(g<<4&4294967295|g>>>28),g=E+(d^_^m)+v[4]+1272893353&4294967295,E=d+(g<<11&4294967295|g>>>21),g=m+(E^d^_)+v[7]+4139469664&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^d)+v[10]+3200236656&4294967295,_=m+(g<<23&4294967295|g>>>9),g=d+(_^m^E)+v[13]+681279174&4294967295,d=_+(g<<4&4294967295|g>>>28),g=E+(d^_^m)+v[0]+3936430074&4294967295,E=d+(g<<11&4294967295|g>>>21),g=m+(E^d^_)+v[3]+3572445317&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^d)+v[6]+76029189&4294967295,_=m+(g<<23&4294967295|g>>>9),g=d+(_^m^E)+v[9]+3654602809&4294967295,d=_+(g<<4&4294967295|g>>>28),g=E+(d^_^m)+v[12]+3873151461&4294967295,E=d+(g<<11&4294967295|g>>>21),g=m+(E^d^_)+v[15]+530742520&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^d)+v[2]+3299628645&4294967295,_=m+(g<<23&4294967295|g>>>9),g=d+(m^(_|~E))+v[0]+4096336452&4294967295,d=_+(g<<6&4294967295|g>>>26),g=E+(_^(d|~m))+v[7]+1126891415&4294967295,E=d+(g<<10&4294967295|g>>>22),g=m+(d^(E|~_))+v[14]+2878612391&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~d))+v[5]+4237533241&4294967295,_=m+(g<<21&4294967295|g>>>11),g=d+(m^(_|~E))+v[12]+1700485571&4294967295,d=_+(g<<6&4294967295|g>>>26),g=E+(_^(d|~m))+v[3]+2399980690&4294967295,E=d+(g<<10&4294967295|g>>>22),g=m+(d^(E|~_))+v[10]+4293915773&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~d))+v[1]+2240044497&4294967295,_=m+(g<<21&4294967295|g>>>11),g=d+(m^(_|~E))+v[8]+1873313359&4294967295,d=_+(g<<6&4294967295|g>>>26),g=E+(_^(d|~m))+v[15]+4264355552&4294967295,E=d+(g<<10&4294967295|g>>>22),g=m+(d^(E|~_))+v[6]+2734768916&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~d))+v[13]+1309151649&4294967295,_=m+(g<<21&4294967295|g>>>11),g=d+(m^(_|~E))+v[4]+4149444226&4294967295,d=_+(g<<6&4294967295|g>>>26),g=E+(_^(d|~m))+v[11]+3174756917&4294967295,E=d+(g<<10&4294967295|g>>>22),g=m+(d^(E|~_))+v[2]+718787259&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~d))+v[9]+3951481745&4294967295,y.g[0]=y.g[0]+d&4294967295,y.g[1]=y.g[1]+(m+(g<<21&4294967295|g>>>11))&4294967295,y.g[2]=y.g[2]+m&4294967295,y.g[3]=y.g[3]+E&4294967295}i.prototype.v=function(y,d){d===void 0&&(d=y.length);const _=d-this.blockSize,v=this.C;let m=this.h,E=0;for(;E>>v&255;return y};function l(y,d){var _=u;return Object.prototype.hasOwnProperty.call(_,y)?_[y]:_[y]=d(y)}function a(y,d){this.h=d;const _=[];let v=!0;for(let m=y.length-1;m>=0;m--){const E=y[m]|0;v&&E==d||(_[m]=E,v=!1)}this.g=_}var u={};function p(y){return-128<=y&&y<128?l(y,function(d){return new a([d|0],d<0?-1:0)}):new a([y|0],y<0?-1:0)}function f(y){if(isNaN(y)||!isFinite(y))return w;if(y<0)return D(f(-y));const d=[];let _=1;for(let v=0;y>=_;v++)d[v]=y/_|0,_*=4294967296;return new a(d,0)}function T(y,d){if(y.length==0)throw Error("number format error: empty string");if(d=d||10,d<2||36=0)throw Error('number format error: interior "-" character');const _=f(Math.pow(d,8));let v=w;for(let E=0;E=0?v:4294967296+v)*d,d*=4294967296}return y},n.toString=function(y){if(y=y||10,y<2||360?_.g[0]:_.h)>>>0).toString(y);if(_=m,R(_))return E+v;for(;E.length<6;)E="0"+E;v=E+v}},n.i=function(y){return y<0?0:y>>16)+(this.i(m)>>>16)+(y.i(m)>>>16);v=g>>>16,E&=65535,g&=65535,_[m]=g<<16|E}return new a(_,_[_.length-1]&-2147483648?-1:0)};function le(y,d){return y.add(D(d))}n.j=function(y){if(R(this)||R(y))return w;if(M(this))return M(y)?D(this).j(D(y)):D(D(this).j(y));if(M(y))return D(this.j(D(y)));if(this.l(N)<0&&y.l(N)<0)return f(this.m()*y.m());const d=this.g.length+y.g.length,_=[];for(var v=0;v<2*d;v++)_[v]=0;for(v=0;v>>16,g=this.i(v)&65535,re=y.i(m)>>>16,Be=y.i(m)&65535;_[2*v+2*m]+=g*Be,J(_,2*v+2*m),_[2*v+2*m+1]+=E*Be,J(_,2*v+2*m+1),_[2*v+2*m+1]+=g*re,J(_,2*v+2*m+1),_[2*v+2*m+2]+=E*re,J(_,2*v+2*m+2)}for(y=0;y>>16,y[d]&=65535,d++}function Q(y,d){this.g=y,this.h=d}function _e(y,d){if(R(d))throw Error("division by zero");if(R(y))return new Q(w,w);if(M(y))return d=_e(D(y),d),new Q(D(d.g),D(d.h));if(M(d))return d=_e(y,D(d)),new Q(D(d.g),d.h);if(y.g.length>30){if(M(y)||M(d))throw Error("slowDivide_ only works with positive integers.");for(var _=I,v=d;v.l(y)<=0;)_=be(_),v=be(v);var m=ce(_,1),E=ce(v,1);for(v=ce(v,2),_=ce(_,2);!R(v);){var g=E.add(v);g.l(y)<=0&&(m=m.add(_),E=g),v=ce(v,1),_=ce(_,1)}return d=le(y,m.j(d)),new Q(m,d)}for(m=w;y.l(d)>=0;){for(_=Math.max(1,Math.floor(y.m()/d.m())),v=Math.ceil(Math.log(_)/Math.LN2),v=v<=48?1:Math.pow(2,v-48),E=f(_),g=E.j(d);M(g)||g.l(y)>0;)_-=v,E=f(_),g=E.j(d);R(E)&&(E=I),m=m.add(E),y=le(y,g)}return new Q(m,y)}n.B=function(y){return _e(this,y).h},n.and=function(y){const d=Math.max(this.g.length,y.g.length),_=[];for(let v=0;v>>31;return new a(_,y.h)}function ce(y,d){const _=d>>5;d%=32;const v=y.g.length-_,m=[];for(let E=0;E0?y.i(E+_)>>>d|y.i(E+_+1)<<32-d:y.i(E+_);return new a(m,y.h)}i.prototype.digest=i.prototype.A,i.prototype.reset=i.prototype.u,i.prototype.update=i.prototype.v,jc=i,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.B,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=f,a.fromString=T,Uc=a}).apply(typeof xr<"u"?xr:typeof self<"u"?self:typeof window<"u"?window:{});var pn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var Wc,$c,Vc,Gc,qc,zc,Kc,Yc;(function(){var n,e=Object.defineProperty;function t(s){s=[typeof globalThis=="object"&&globalThis,s,typeof window=="object"&&window,typeof self=="object"&&self,typeof pn=="object"&&pn];for(var o=0;os&&AsyncContext.Snapshot.wrap(s):s=>s;function N(s){const o=s.length;if(o>0){const h=Array(o);for(let c=0;c0?(this.h--,o=this.g,this.g=o.next,o.next=null):o=this.i(),o}}function D(s){a.setTimeout(()=>{throw s},0)}function le(){var s=y;let o=null;return s.g&&(o=s.g,s.g=s.g.next,s.g||(s.h=null),o.next=null),o}class J{constructor(){this.h=this.g=null}add(o,h){const c=Q.get();c.set(o,h),this.h?this.h.next=c:this.g=c,this.h=c}}var Q=new M(()=>new _e,s=>s.reset());class _e{constructor(){this.next=this.g=this.h=null}set(o,h){this.h=o,this.g=h,this.next=null}reset(){this.next=this.g=this.h=null}}let be,ce=!1,y=new J,d=()=>{const s=Promise.resolve(void 0);be=()=>{s.then(_)}};function _(){for(var s;s=le();){try{s.h.call(s.g)}catch(h){D(h)}var o=Q;o.j(s),o.h<100&&(o.h++,s.next=o.g,o.g=s)}ce=!1}function v(){this.u=this.u,this.C=this.C}v.prototype.u=!1,v.prototype.dispose=function(){this.u||(this.u=!0,this.N())},v.prototype[Symbol.dispose]=function(){this.dispose()},v.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function m(s,o){this.type=s,this.g=this.target=o,this.defaultPrevented=!1}m.prototype.h=function(){this.defaultPrevented=!0};var E=(function(){if(!a.addEventListener||!Object.defineProperty)return!1;var s=!1,o=Object.defineProperty({},"passive",{get:function(){s=!0}});try{const h=()=>{};a.addEventListener("test",h,o),a.removeEventListener("test",h,o)}catch{}return s})();function g(s){return/^[\s\xa0]*$/.test(s)}function re(s,o){m.call(this,s?s.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,s&&this.init(s,o)}w(re,m),re.prototype.init=function(s,o){const h=this.type=s.type,c=s.changedTouches&&s.changedTouches.length?s.changedTouches[0]:null;this.target=s.target||s.srcElement,this.g=o,o=s.relatedTarget,o||(h=="mouseover"?o=s.fromElement:h=="mouseout"&&(o=s.toElement)),this.relatedTarget=o,c?(this.clientX=c.clientX!==void 0?c.clientX:c.pageX,this.clientY=c.clientY!==void 0?c.clientY:c.pageY,this.screenX=c.screenX||0,this.screenY=c.screenY||0):(this.clientX=s.clientX!==void 0?s.clientX:s.pageX,this.clientY=s.clientY!==void 0?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0),this.button=s.button,this.key=s.key||"",this.ctrlKey=s.ctrlKey,this.altKey=s.altKey,this.shiftKey=s.shiftKey,this.metaKey=s.metaKey,this.pointerId=s.pointerId||0,this.pointerType=s.pointerType,this.state=s.state,this.i=s,s.defaultPrevented&&re.Z.h.call(this)},re.prototype.h=function(){re.Z.h.call(this);const s=this.i;s.preventDefault?s.preventDefault():s.returnValue=!1};var Be="closure_listenable_"+(Math.random()*1e6|0),ya=0;function va(s,o,h,c,C){this.listener=s,this.proxy=null,this.src=o,this.type=h,this.capture=!!c,this.ha=C,this.key=++ya,this.da=this.fa=!1}function Qt(s){s.da=!0,s.listener=null,s.proxy=null,s.src=null,s.ha=null}function Zt(s,o,h){for(const c in s)o.call(h,s[c],c,s)}function Ca(s,o){for(const h in s)o.call(void 0,s[h],h,s)}function ws(s){const o={};for(const h in s)o[h]=s[h];return o}const Ss="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ts(s,o){let h,c;for(let C=1;C-1?(o=s[b],h||(o.fa=!1)):(o=new va(o,this.src,S,!!c,C),o.fa=h,s.push(o)),o};function $n(s,o){const h=o.type;if(h in s.g){var c=s.g[h],C=Array.prototype.indexOf.call(c,o,void 0),S;(S=C>=0)&&Array.prototype.splice.call(c,C,1),S&&(Qt(o),s.g[h].length==0&&(delete s.g[h],s.h--))}}function Vn(s,o,h,c){for(let C=0;C-1&&(Qt(o[h]),Array.prototype.splice.call(o,h,1),o.length==0&&(delete s.g[S],s.h--)))):s&&(s=Kn(s))&&(o=s.g[o.toString()],s=-1,o&&(s=Vn(o,h,c,C)),(h=s>-1?o[s]:null)&&zn(h))}function zn(s){if(typeof s!="number"&&s&&!s.da){var o=s.src;if(o&&o[Be])$n(o.i,s);else{var h=s.type,c=s.proxy;o.removeEventListener?o.removeEventListener(h,c,s.capture):o.detachEvent?o.detachEvent(As(h),c):o.addListener&&o.removeListener&&o.removeListener(c),(h=Kn(o))?($n(h,s),h.h==0&&(h.src=null,o[Gn]=null)):Qt(s)}}}function As(s){return s in qn?qn[s]:qn[s]="on"+s}function Sa(s,o){if(s.da)s=!0;else{o=new re(o,this);const h=s.listener,c=s.ha||s.src;s.fa&&zn(s),s=h.call(c,o)}return s}function Kn(s){return s=s[Gn],s instanceof en?s:null}var Yn="__closure_events_fn_"+(Math.random()*1e9>>>0);function Rs(s){return typeof s=="function"?s:(s[Yn]||(s[Yn]=function(o){return s.handleEvent(o)}),s[Yn])}function Z(){v.call(this),this.i=new en(this),this.M=this,this.G=null}w(Z,v),Z.prototype[Be]=!0,Z.prototype.removeEventListener=function(s,o,h,c){bs(this,s,o,h,c)};function ie(s,o){var h,c=s.G;if(c)for(h=[];c;c=c.G)h.push(c);if(s=s.M,c=o.type||o,typeof o=="string")o=new m(o,s);else if(o instanceof m)o.target=o.target||s;else{var C=o;o=new m(c,s),Ts(o,C)}C=!0;let S,b;if(h)for(b=h.length-1;b>=0;b--)S=o.g=h[b],C=tn(S,c,!0,o)&&C;if(S=o.g=s,C=tn(S,c,!0,o)&&C,C=tn(S,c,!1,o)&&C,h)for(b=0;b2147483647?-1:a.setTimeout(s,o||0)}function Ns(s){s.g=Ta(()=>{s.g=null,s.i&&(s.i=!1,Ns(s))},s.l);const o=s.h;s.h=null,s.m.apply(null,o)}class Ia extends v{constructor(o,h){super(),this.m=o,this.l=h,this.h=null,this.i=!1,this.g=null}j(o){this.h=arguments,this.g?this.i=!0:Ns(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function yt(s){v.call(this),this.h=s,this.g={}}w(yt,v);var ks=[];function Ds(s){Zt(s.g,function(o,h){this.g.hasOwnProperty(h)&&zn(o)},s),s.g={}}yt.prototype.N=function(){yt.Z.N.call(this),Ds(this)},yt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Xn=a.JSON.stringify,ba=a.JSON.parse,Aa=class{stringify(s){return a.JSON.stringify(s,void 0)}parse(s){return a.JSON.parse(s,void 0)}};function Os(){}function Ms(){}var vt={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function Jn(){m.call(this,"d")}w(Jn,m);function Qn(){m.call(this,"c")}w(Qn,m);var He={},Ps=null;function nn(){return Ps=Ps||new Z}He.Ia="serverreachability";function xs(s){m.call(this,He.Ia,s)}w(xs,m);function Ct(s){const o=nn();ie(o,new xs(o))}He.STAT_EVENT="statevent";function Ls(s,o){m.call(this,He.STAT_EVENT,s),this.stat=o}w(Ls,m);function se(s){const o=nn();ie(o,new Ls(o,s))}He.Ja="timingevent";function Fs(s,o){m.call(this,He.Ja,s),this.size=o}w(Fs,m);function Et(s,o){if(typeof s!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){s()},o)}function wt(){this.g=!0}wt.prototype.ua=function(){this.g=!1};function Ra(s,o,h,c,C,S){s.info(function(){if(s.g)if(S){var b="",k=S.split("&");for(let B=0;B1){const q=G[0];G=G[1];const ye=q.split("_");b=ye.length>=2&&ye[1]=="type"?b+(q+"="+G+"&"):b+(q+"=redacted&")}}}else b=null;else b=S;return"XMLHTTP REQ ("+c+") [attempt "+C+"]: "+o+` +`+h+` +`+b})}function Na(s,o,h,c,C,S,b){s.info(function(){return"XMLHTTP RESP ("+c+") [ attempt "+C+"]: "+o+` +`+h+` +`+S+" "+b})}function nt(s,o,h,c){s.info(function(){return"XMLHTTP TEXT ("+o+"): "+Da(s,h)+(c?" "+c:"")})}function ka(s,o){s.info(function(){return"TIMEOUT: "+o})}wt.prototype.info=function(){};function Da(s,o){if(!s.g)return o;if(!o)return null;try{const S=JSON.parse(o);if(S){for(s=0;s0&&s.length;)h.push(s.shift()),o--;return s.length&&h.push(s.join(":")),h}function Ae(s,o,h,c){this.j=s,this.i=o,this.l=h,this.S=c||1,this.V=new yt(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Us}function Us(){this.i=null,this.g="",this.h=!1}var js={},ei={};function ti(s,o,h){s.M=1,s.A=on(me(o)),s.u=h,s.R=!0,Ws(s,null)}function Ws(s,o){s.F=Date.now(),rn(s),s.B=me(s.A);var h=s.B,c=s.S;Array.isArray(c)||(c=[String(c)]),tr(h.i,"t",c),s.C=0,h=s.j.L,s.h=new Us,s.g=vr(s.j,h?o:null,!s.u),s.P>0&&(s.O=new Ia(f(s.Y,s,s.g),s.P)),o=s.V,h=s.g,c=s.ba;var C="readystatechange";Array.isArray(C)||(C&&(ks[0]=C.toString()),C=ks);for(let S=0;S0&&!this.W){this.W=!0;var b=this.j;b.g==this&&b.aa&&!b.P&&(b.j.info("Great, no buffering proxy detected. Bytes received: "+h.length),ui(b),b.P=!0,se(11))}}else nt(this.i,this.l,h,null),ii(this,h);k==4&&Ue(this),this.o&&!this.K&&(k==4?gr(this.j,this):(this.o=!1,rn(this)))}else Ka(this.g),o==400&&h.indexOf("Unknown SID")>0?(this.m=3,se(12)):(this.m=0,se(13)),Ue(this),Tt(this)}}}catch{}finally{}};function Ma(s){if(!$s(s))return s.g.la();const o=ar(s.g);if(o==="")return"";let h="";const c=o.length,C=ke(s.g)==4;if(!s.h.i){if(typeof TextDecoder>"u")return Ue(s),Tt(s),"";s.h.i=new a.TextDecoder}for(let S=0;So.length?ei:(o=o.slice(c,c+h),s.C=c+h,o)))}Ae.prototype.cancel=function(){this.K=!0,Ue(this)};function rn(s){s.T=Date.now()+s.H,Vs(s,s.H)}function Vs(s,o){if(s.D!=null)throw Error("WatchDog timer not null");s.D=Et(f(s.aa,s),o)}function ni(s){s.D&&(a.clearTimeout(s.D),s.D=null)}Ae.prototype.aa=function(){this.D=null;const s=Date.now();s-this.T>=0?(ka(this.i,this.B),this.M!=2&&(Ct(),se(17)),Ue(this),this.m=2,Tt(this)):Vs(this,this.T-s)};function Tt(s){s.j.I==0||s.K||gr(s.j,s)}function Ue(s){ni(s);var o=s.O;o&&typeof o.dispose=="function"&&o.dispose(),s.O=null,Ds(s.V),s.g&&(o=s.g,s.g=null,o.abort(),o.dispose())}function ii(s,o){try{var h=s.j;if(h.I!=0&&(h.g==s||si(h.h,s))){if(!s.L&&si(h.h,s)&&h.I==3){try{var c=h.Ba.g.parse(o)}catch{c=null}if(Array.isArray(c)&&c.length==3){var C=c;if(C[0]==0){e:if(!h.v){if(h.g)if(h.g.F+3e30&&(c=1.5*De,h.O=c,h.j.info("backChannelRequestTimeoutMs_="+c)),c=h;const Oe=s.g;if(Oe){const dn=Oe.g?Oe.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(dn){var S=c.h;S.g||dn.indexOf("spdy")==-1&&dn.indexOf("quic")==-1&&dn.indexOf("h2")==-1||(S.j=S.l,S.g=new Set,S.h&&(ri(S,S.h),S.h=null))}if(c.G){const fi=Oe.g?Oe.g.getResponseHeader("X-HTTP-Session-Id"):null;fi&&(c.wa=fi,U(c.J,c.G,fi))}}h.I=3,h.l&&h.l.ra(),h.aa&&(h.T=Date.now()-s.F,h.j.info("Handshake RTT: "+h.T+"ms")),c=h;var b=s;if(c.na=yr(c,c.L?c.ba:null,c.W),b.L){Ks(c.h,b);var k=b,G=c.O;G&&(k.H=G),k.D&&(ni(k),rn(k)),c.g=b}else dr(c);h.i.length>0&&cn(h)}else B[0]!="stop"&&B[0]!="close"||We(h,7);else h.I==3&&(B[0]=="stop"||B[0]=="close"?B[0]=="stop"?We(h,7):hi(h):B[0]!="noop"&&h.l&&h.l.qa(B),h.A=0)}}Ct(4)}catch{}}var xa=class{constructor(s,o){this.g=s,this.map=o}};function Gs(s){this.l=s||10,a.PerformanceNavigationTiming?(s=a.performance.getEntriesByType("navigation"),s=s.length>0&&(s[0].nextHopProtocol=="hq"||s[0].nextHopProtocol=="h2")):s=!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=s?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function qs(s){return s.h?!0:s.g?s.g.size>=s.j:!1}function zs(s){return s.h?1:s.g?s.g.size:0}function si(s,o){return s.h?s.h==o:s.g?s.g.has(o):!1}function ri(s,o){s.g?s.g.add(o):s.h=o}function Ks(s,o){s.h&&s.h==o?s.h=null:s.g&&s.g.has(o)&&s.g.delete(o)}Gs.prototype.cancel=function(){if(this.i=Ys(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const s of this.g.values())s.cancel();this.g.clear()}};function Ys(s){if(s.h!=null)return s.i.concat(s.h.G);if(s.g!=null&&s.g.size!==0){let o=s.i;for(const h of s.g.values())o=o.concat(h.G);return o}return N(s.i)}var Xs=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function La(s,o){if(s){s=s.split("&");for(let h=0;h=0?(C=s[h].substring(0,c),S=s[h].substring(c+1)):C=s[h],o(C,S?decodeURIComponent(S.replace(/\+/g," ")):"")}}}function Re(s){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let o;s instanceof Re?(this.l=s.l,It(this,s.j),this.o=s.o,this.g=s.g,bt(this,s.u),this.h=s.h,oi(this,nr(s.i)),this.m=s.m):s&&(o=String(s).match(Xs))?(this.l=!1,It(this,o[1]||"",!0),this.o=At(o[2]||""),this.g=At(o[3]||"",!0),bt(this,o[4]),this.h=At(o[5]||"",!0),oi(this,o[6]||"",!0),this.m=At(o[7]||"")):(this.l=!1,this.i=new Nt(null,this.l))}Re.prototype.toString=function(){const s=[];var o=this.j;o&&s.push(Rt(o,Js,!0),":");var h=this.g;return(h||o=="file")&&(s.push("//"),(o=this.o)&&s.push(Rt(o,Js,!0),"@"),s.push(St(h).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),h=this.u,h!=null&&s.push(":",String(h))),(h=this.h)&&(this.g&&h.charAt(0)!="/"&&s.push("/"),s.push(Rt(h,h.charAt(0)=="/"?Ha:Ba,!0))),(h=this.i.toString())&&s.push("?",h),(h=this.m)&&s.push("#",Rt(h,ja)),s.join("")},Re.prototype.resolve=function(s){const o=me(this);let h=!!s.j;h?It(o,s.j):h=!!s.o,h?o.o=s.o:h=!!s.g,h?o.g=s.g:h=s.u!=null;var c=s.h;if(h)bt(o,s.u);else if(h=!!s.h){if(c.charAt(0)!="/")if(this.g&&!this.h)c="/"+c;else{var C=o.h.lastIndexOf("/");C!=-1&&(c=o.h.slice(0,C+1)+c)}if(C=c,C==".."||C==".")c="";else if(C.indexOf("./")!=-1||C.indexOf("/.")!=-1){c=C.lastIndexOf("/",0)==0,C=C.split("/");const S=[];for(let b=0;b1||S.length==1&&S[0]!="")&&S.pop(),c&&b==C.length&&S.push("")):(S.push(k),c=!0)}c=S.join("/")}else c=C}return h?o.h=c:h=s.i.toString()!=="",h?oi(o,nr(s.i)):h=!!s.m,h&&(o.m=s.m),o};function me(s){return new Re(s)}function It(s,o,h){s.j=h?At(o,!0):o,s.j&&(s.j=s.j.replace(/:$/,""))}function bt(s,o){if(o){if(o=Number(o),isNaN(o)||o<0)throw Error("Bad port number "+o);s.u=o}else s.u=null}function oi(s,o,h){o instanceof Nt?(s.i=o,Wa(s.i,s.l)):(h||(o=Rt(o,Ua)),s.i=new Nt(o,s.l))}function U(s,o,h){s.i.set(o,h)}function on(s){return U(s,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),s}function At(s,o){return s?o?decodeURI(s.replace(/%25/g,"%2525")):decodeURIComponent(s):""}function Rt(s,o,h){return typeof s=="string"?(s=encodeURI(s).replace(o,Fa),h&&(s=s.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),s):null}function Fa(s){return s=s.charCodeAt(0),"%"+(s>>4&15).toString(16)+(s&15).toString(16)}var Js=/[#\/\?@]/g,Ba=/[#\?:]/g,Ha=/[#\?]/g,Ua=/[#\?@]/g,ja=/#/g;function Nt(s,o){this.h=this.g=null,this.i=s||null,this.j=!!o}function je(s){s.g||(s.g=new Map,s.h=0,s.i&&La(s.i,function(o,h){s.add(decodeURIComponent(o.replace(/\+/g," ")),h)}))}n=Nt.prototype,n.add=function(s,o){je(this),this.i=null,s=it(this,s);let h=this.g.get(s);return h||this.g.set(s,h=[]),h.push(o),this.h+=1,this};function Qs(s,o){je(s),o=it(s,o),s.g.has(o)&&(s.i=null,s.h-=s.g.get(o).length,s.g.delete(o))}function Zs(s,o){return je(s),o=it(s,o),s.g.has(o)}n.forEach=function(s,o){je(this),this.g.forEach(function(h,c){h.forEach(function(C){s.call(o,C,c,this)},this)},this)};function er(s,o){je(s);let h=[];if(typeof o=="string")Zs(s,o)&&(h=h.concat(s.g.get(it(s,o))));else for(s=Array.from(s.g.values()),o=0;o0?String(s[0]):o):o};function tr(s,o,h){Qs(s,o),h.length>0&&(s.i=null,s.g.set(it(s,o),N(h)),s.h+=h.length)}n.toString=function(){if(this.i)return this.i;if(!this.g)return"";const s=[],o=Array.from(this.g.keys());for(let c=0;c{c.abort(),Ne(h,"TestPingServer: timeout",!1,o)},1e4);fetch(s,{signal:c.signal}).then(S=>{clearTimeout(C),S.ok?Ne(h,"TestPingServer: ok",!0,o):Ne(h,"TestPingServer: server error",!1,o)}).catch(()=>{clearTimeout(C),Ne(h,"TestPingServer: error",!1,o)})}function Ne(s,o,h,c,C){try{C&&(C.onload=null,C.onerror=null,C.onabort=null,C.ontimeout=null),c(h)}catch{}}function Ga(){this.g=new Aa}function li(s){this.i=s.Sb||null,this.h=s.ab||!1}w(li,Os),li.prototype.g=function(){return new ln(this.i,this.h)};function ln(s,o){Z.call(this),this.H=s,this.o=o,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}w(ln,Z),n=ln.prototype,n.open=function(s,o){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=s,this.D=o,this.readyState=1,Dt(this)},n.send=function(s){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const o={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};s&&(o.body=s),(this.H||a).fetch(new Request(this.D,o)).then(this.Pa.bind(this),this.ga.bind(this))},n.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,kt(this)),this.readyState=0},n.Pa=function(s){if(this.g&&(this.l=s,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=s.headers,this.readyState=2,Dt(this)),this.g&&(this.readyState=3,Dt(this),this.g)))if(this.responseType==="arraybuffer")s.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in s){if(this.j=s.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;ir(this)}else s.text().then(this.Oa.bind(this),this.ga.bind(this))};function ir(s){s.j.read().then(s.Ma.bind(s)).catch(s.ga.bind(s))}n.Ma=function(s){if(this.g){if(this.o&&s.value)this.response.push(s.value);else if(!this.o){var o=s.value?s.value:new Uint8Array(0);(o=this.B.decode(o,{stream:!s.done}))&&(this.response=this.responseText+=o)}s.done?kt(this):Dt(this),this.readyState==3&&ir(this)}},n.Oa=function(s){this.g&&(this.response=this.responseText=s,kt(this))},n.Na=function(s){this.g&&(this.response=s,kt(this))},n.ga=function(){this.g&&kt(this)};function kt(s){s.readyState=4,s.l=null,s.j=null,s.B=null,Dt(s)}n.setRequestHeader=function(s,o){this.A.append(s,o)},n.getResponseHeader=function(s){return this.h&&this.h.get(s.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const s=[],o=this.h.entries();for(var h=o.next();!h.done;)h=h.value,s.push(h[0]+": "+h[1]),h=o.next();return s.join(`\r +`)};function Dt(s){s.onreadystatechange&&s.onreadystatechange.call(s)}Object.defineProperty(ln.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(s){this.m=s?"include":"same-origin"}});function sr(s){let o="";return Zt(s,function(h,c){o+=c,o+=":",o+=h,o+=`\r +`}),o}function ai(s,o,h){e:{for(c in h){var c=!1;break e}c=!0}c||(h=sr(h),typeof s=="string"?h!=null&&St(h):U(s,o,h))}function V(s){Z.call(this),this.headers=new Map,this.L=s||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}w(V,Z);var qa=/^https?$/i,za=["POST","PUT"];n=V.prototype,n.Fa=function(s){this.H=s},n.ea=function(s,o,h,c){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+s);o=o?o.toUpperCase():"GET",this.D=s,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():Hs.g(),this.g.onreadystatechange=I(f(this.Ca,this));try{this.B=!0,this.g.open(o,String(s),!0),this.B=!1}catch(S){rr(this,S);return}if(s=h||"",h=new Map(this.headers),c)if(Object.getPrototypeOf(c)===Object.prototype)for(var C in c)h.set(C,c[C]);else if(typeof c.keys=="function"&&typeof c.get=="function")for(const S of c.keys())h.set(S,c.get(S));else throw Error("Unknown input type for opt_headers: "+String(c));c=Array.from(h.keys()).find(S=>S.toLowerCase()=="content-type"),C=a.FormData&&s instanceof a.FormData,!(Array.prototype.indexOf.call(za,o,void 0)>=0)||c||C||h.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[S,b]of h)this.g.setRequestHeader(S,b);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(s),this.v=!1}catch(S){rr(this,S)}};function rr(s,o){s.h=!1,s.g&&(s.j=!0,s.g.abort(),s.j=!1),s.l=o,s.o=5,or(s),an(s)}function or(s){s.A||(s.A=!0,ie(s,"complete"),ie(s,"error"))}n.abort=function(s){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=s||7,ie(this,"complete"),ie(this,"abort"),an(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),an(this,!0)),V.Z.N.call(this)},n.Ca=function(){this.u||(this.B||this.v||this.j?lr(this):this.Xa())},n.Xa=function(){lr(this)};function lr(s){if(s.h&&typeof l<"u"){if(s.v&&ke(s)==4)setTimeout(s.Ca.bind(s),0);else if(ie(s,"readystatechange"),ke(s)==4){s.h=!1;try{const S=s.ca();e:switch(S){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break e;default:o=!1}var h;if(!(h=o)){var c;if(c=S===0){let b=String(s.D).match(Xs)[1]||null;!b&&a.self&&a.self.location&&(b=a.self.location.protocol.slice(0,-1)),c=!qa.test(b?b.toLowerCase():"")}h=c}if(h)ie(s,"complete"),ie(s,"success");else{s.o=6;try{var C=ke(s)>2?s.g.statusText:""}catch{C=""}s.l=C+" ["+s.ca()+"]",or(s)}}finally{an(s)}}}}function an(s,o){if(s.g){s.m&&(clearTimeout(s.m),s.m=null);const h=s.g;s.g=null,o||ie(s,"ready");try{h.onreadystatechange=null}catch{}}}n.isActive=function(){return!!this.g};function ke(s){return s.g?s.g.readyState:0}n.ca=function(){try{return ke(this)>2?this.g.status:-1}catch{return-1}},n.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},n.La=function(s){if(this.g){var o=this.g.responseText;return s&&o.indexOf(s)==0&&(o=o.substring(s.length)),ba(o)}};function ar(s){try{if(!s.g)return null;if("response"in s.g)return s.g.response;switch(s.F){case"":case"text":return s.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in s.g)return s.g.mozResponseArrayBuffer}return null}catch{return null}}function Ka(s){const o={};s=(s.g&&ke(s)>=2&&s.g.getAllResponseHeaders()||"").split(`\r +`);for(let c=0;c0&&(this.ia=s.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}n=hr.prototype,n.ka=8,n.I=1,n.connect=function(s,o,h,c){se(0),this.W=s,this.H=o||{},h&&c!==void 0&&(this.H.OSID=h,this.H.OAID=c),this.F=this.X,this.J=yr(this,null,this.W),cn(this)};function hi(s){if(cr(s),s.I==3){var o=s.V++,h=me(s.J);if(U(h,"SID",s.M),U(h,"RID",o),U(h,"TYPE","terminate"),Mt(s,h),o=new Ae(s,s.j,o),o.M=2,o.A=on(me(h)),h=!1,a.navigator&&a.navigator.sendBeacon)try{h=a.navigator.sendBeacon(o.A.toString(),"")}catch{}!h&&a.Image&&(new Image().src=o.A,h=!0),h||(o.g=vr(o.j,null),o.g.ea(o.A)),o.F=Date.now(),rn(o)}mr(s)}function hn(s){s.g&&(ui(s),s.g.cancel(),s.g=null)}function cr(s){hn(s),s.v&&(a.clearTimeout(s.v),s.v=null),un(s),s.h.cancel(),s.m&&(typeof s.m=="number"&&a.clearTimeout(s.m),s.m=null)}function cn(s){if(!qs(s.h)&&!s.m){s.m=!0;var o=s.Ea;be||d(),ce||(be(),ce=!0),y.add(o,s),s.D=0}}function Ya(s,o){return zs(s.h)>=s.h.j-(s.m?1:0)?!1:s.m?(s.i=o.G.concat(s.i),!0):s.I==1||s.I==2||s.D>=(s.Sa?0:s.Ta)?!1:(s.m=Et(f(s.Ea,s,o),_r(s,s.D)),s.D++,!0)}n.Ea=function(s){if(this.m)if(this.m=null,this.I==1){if(!s){this.V=Math.floor(Math.random()*1e5),s=this.V++;const C=new Ae(this,this.j,s);let S=this.o;if(this.U&&(S?(S=ws(S),Ts(S,this.U)):S=this.U),this.u!==null||this.R||(C.J=S,S=null),this.S)e:{for(var o=0,h=0;h4096){o=h;break e}if(o===4096||h===this.i.length-1){o=h+1;break e}}o=1e3}else o=1e3;o=fr(this,C,o),h=me(this.J),U(h,"RID",s),U(h,"CVER",22),this.G&&U(h,"X-HTTP-Session-Id",this.G),Mt(this,h),S&&(this.R?o="headers="+St(sr(S))+"&"+o:this.u&&ai(h,this.u,S)),ri(this.h,C),this.Ra&&U(h,"TYPE","init"),this.S?(U(h,"$req",o),U(h,"SID","null"),C.U=!0,ti(C,h,null)):ti(C,h,o),this.I=2}}else this.I==3&&(s?ur(this,s):this.i.length==0||qs(this.h)||ur(this))};function ur(s,o){var h;o?h=o.l:h=s.V++;const c=me(s.J);U(c,"SID",s.M),U(c,"RID",h),U(c,"AID",s.K),Mt(s,c),s.u&&s.o&&ai(c,s.u,s.o),h=new Ae(s,s.j,h,s.D+1),s.u===null&&(h.J=s.o),o&&(s.i=o.G.concat(s.i)),o=fr(s,h,1e3),h.H=Math.round(s.va*.5)+Math.round(s.va*.5*Math.random()),ri(s.h,h),ti(h,c,o)}function Mt(s,o){s.H&&Zt(s.H,function(h,c){U(o,c,h)}),s.l&&Zt({},function(h,c){U(o,c,h)})}function fr(s,o,h){h=Math.min(s.i.length,h);const c=s.l?f(s.l.Ka,s.l,s):null;e:{var C=s.i;let k=-1;for(;;){const G=["count="+h];k==-1?h>0?(k=C[0].g,G.push("ofs="+k)):k=0:G.push("ofs="+k);let B=!0;for(let q=0;q=3?!1:(s.Y++,s.v=Et(f(s.Da,s),_r(s,s.A)),s.A++,!0)}n.Da=function(){if(this.v=null,pr(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var s=4*this.T;this.j.info("BP detection timer enabled: "+s),this.B=Et(f(this.Wa,this),s)}},n.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,se(10),hn(this),pr(this))};function ui(s){s.B!=null&&(a.clearTimeout(s.B),s.B=null)}function pr(s){s.g=new Ae(s,s.j,"rpc",s.Y),s.u===null&&(s.g.J=s.o),s.g.P=0;var o=me(s.na);U(o,"RID","rpc"),U(o,"SID",s.M),U(o,"AID",s.K),U(o,"CI",s.F?"0":"1"),!s.F&&s.ia&&U(o,"TO",s.ia),U(o,"TYPE","xmlhttp"),Mt(s,o),s.u&&s.o&&ai(o,s.u,s.o),s.O&&(s.g.H=s.O);var h=s.g;s=s.ba,h.M=1,h.A=on(me(o)),h.u=null,h.R=!0,Ws(h,s)}n.Va=function(){this.C!=null&&(this.C=null,hn(this),ci(this),se(19))};function un(s){s.C!=null&&(a.clearTimeout(s.C),s.C=null)}function gr(s,o){var h=null;if(s.g==o){un(s),ui(s),s.g=null;var c=2}else if(si(s.h,o))h=o.G,Ks(s.h,o),c=1;else return;if(s.I!=0){if(o.o)if(c==1){h=o.u?o.u.length:0,o=Date.now()-o.F;var C=s.D;c=nn(),ie(c,new Fs(c,h)),cn(s)}else dr(s);else if(C=o.m,C==3||C==0&&o.X>0||!(c==1&&Ya(s,o)||c==2&&ci(s)))switch(h&&h.length>0&&(o=s.h,o.i=o.i.concat(h)),C){case 1:We(s,5);break;case 4:We(s,10);break;case 3:We(s,6);break;default:We(s,2)}}}function _r(s,o){let h=s.Qa+Math.floor(Math.random()*s.Za);return s.isActive()||(h*=2),h*o}function We(s,o){if(s.j.info("Error code "+o),o==2){var h=f(s.bb,s),c=s.Ua;const C=!c;c=new Re(c||"//www.google.com/images/cleardot.gif"),a.location&&a.location.protocol=="http"||It(c,"https"),on(c),C?$a(c.toString(),h):Va(c.toString(),h)}else se(2);s.I=0,s.l&&s.l.pa(o),mr(s),cr(s)}n.bb=function(s){s?(this.j.info("Successfully pinged google.com"),se(2)):(this.j.info("Failed to ping google.com"),se(1))};function mr(s){if(s.I=0,s.ja=[],s.l){const o=Ys(s.h);(o.length!=0||s.i.length!=0)&&(R(s.ja,o),R(s.ja,s.i),s.h.i.length=0,N(s.i),s.i.length=0),s.l.oa()}}function yr(s,o,h){var c=h instanceof Re?me(h):new Re(h);if(c.g!="")o&&(c.g=o+"."+c.g),bt(c,c.u);else{var C=a.location;c=C.protocol,o=o?o+"."+C.hostname:C.hostname,C=+C.port;const S=new Re(null);c&&It(S,c),o&&(S.g=o),C&&bt(S,C),h&&(S.h=h),c=S}return h=s.G,o=s.wa,h&&o&&U(c,h,o),U(c,"VER",s.ka),Mt(s,c),c}function vr(s,o,h){if(o&&!s.L)throw Error("Can't create secondary domain capable XhrIo object.");return o=s.Aa&&!s.ma?new V(new li({ab:h})):new V(s.ma),o.Fa(s.L),o}n.isActive=function(){return!!this.l&&this.l.isActive(this)};function Cr(){}n=Cr.prototype,n.ra=function(){},n.qa=function(){},n.pa=function(){},n.oa=function(){},n.isActive=function(){return!0},n.Ka=function(){};function fn(){}fn.prototype.g=function(s,o){return new ae(s,o)};function ae(s,o){Z.call(this),this.g=new hr(o),this.l=s,this.h=o&&o.messageUrlParams||null,s=o&&o.messageHeaders||null,o&&o.clientProtocolHeaderRequired&&(s?s["X-Client-Protocol"]="webchannel":s={"X-Client-Protocol":"webchannel"}),this.g.o=s,s=o&&o.initMessageHeaders||null,o&&o.messageContentType&&(s?s["X-WebChannel-Content-Type"]=o.messageContentType:s={"X-WebChannel-Content-Type":o.messageContentType}),o&&o.sa&&(s?s["X-WebChannel-Client-Profile"]=o.sa:s={"X-WebChannel-Client-Profile":o.sa}),this.g.U=s,(s=o&&o.Qb)&&!g(s)&&(this.g.u=s),this.A=o&&o.supportsCrossDomainXhr||!1,this.v=o&&o.sendRawJson||!1,(o=o&&o.httpSessionIdParam)&&!g(o)&&(this.g.G=o,s=this.h,s!==null&&o in s&&(s=this.h,o in s&&delete s[o])),this.j=new st(this)}w(ae,Z),ae.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},ae.prototype.close=function(){hi(this.g)},ae.prototype.o=function(s){var o=this.g;if(typeof s=="string"){var h={};h.__data__=s,s=h}else this.v&&(h={},h.__data__=Xn(s),s=h);o.i.push(new xa(o.Ya++,s)),o.I==3&&cn(o)},ae.prototype.N=function(){this.g.l=null,delete this.j,hi(this.g),delete this.g,ae.Z.N.call(this)};function Er(s){Jn.call(this),s.__headers__&&(this.headers=s.__headers__,this.statusCode=s.__status__,delete s.__headers__,delete s.__status__);var o=s.__sm__;if(o){e:{for(const h in o){s=h;break e}s=void 0}(this.i=s)&&(s=this.i,o=o!==null&&s in o?o[s]:void 0),this.data=o}else this.data=s}w(Er,Jn);function wr(){Qn.call(this),this.status=1}w(wr,Qn);function st(s){this.g=s}w(st,Cr),st.prototype.ra=function(){ie(this.g,"a")},st.prototype.qa=function(s){ie(this.g,new Er(s))},st.prototype.pa=function(s){ie(this.g,new wr)},st.prototype.oa=function(){ie(this.g,"b")},fn.prototype.createWebChannel=fn.prototype.g,ae.prototype.send=ae.prototype.o,ae.prototype.open=ae.prototype.m,ae.prototype.close=ae.prototype.close,Yc=function(){return new fn},Kc=function(){return nn()},zc=He,qc={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},sn.NO_ERROR=0,sn.TIMEOUT=8,sn.HTTP_ERROR=6,Gc=sn,Bs.COMPLETE="complete",Vc=Bs,Ms.EventType=vt,vt.OPEN="a",vt.CLOSE="b",vt.ERROR="c",vt.MESSAGE="d",Z.prototype.listen=Z.prototype.J,$c=Ms,V.prototype.listenOnce=V.prototype.K,V.prototype.getLastError=V.prototype.Ha,V.prototype.getLastErrorCode=V.prototype.ya,V.prototype.getStatus=V.prototype.ca,V.prototype.getResponseJson=V.prototype.La,V.prototype.getResponseText=V.prototype.la,V.prototype.send=V.prototype.ea,V.prototype.setWithCredentials=V.prototype.Fa,Wc=V}).apply(typeof pn<"u"?pn:typeof self<"u"?self:typeof window<"u"?window:{});/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const jo="functions";/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Xc{constructor(e,t,i,r){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,Fo(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=t.getImmediate({optional:!0}),this.messaging=i.getImmediate({optional:!0}),this.auth||t.get().then(l=>this.auth=l,()=>{}),this.messaging||i.get().then(l=>this.messaging=l,()=>{}),this.appCheck||r?.get().then(l=>this.appCheck=l,()=>{})}async getAuthToken(){if(this.auth)try{return(await this.auth.getToken())?.accessToken}catch{return}}async getMessagingToken(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return await this.messaging.getToken()}catch{return}}async getAppCheckToken(e){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){const t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){const t=await this.getAuthToken(),i=await this.getMessagingToken(),r=await this.getAppCheckToken(e);return{authToken:t,messagingToken:i,appCheckToken:r}}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Mi="us-central1";class Jc{constructor(e,t,i,r,l=Mi,a=(...u)=>fetch(...u)){this.app=e,this.fetchImpl=a,this.emulatorOrigin=null,this.contextProvider=new Xc(e,t,i,r),this.cancelAllRequests=new Promise(u=>{this.deleteService=()=>Promise.resolve(u())});try{const u=new URL(l);this.customDomain=u.origin+(u.pathname==="/"?"":u.pathname),this.region=Mi}catch{this.customDomain=null,this.region=l}}_delete(){return this.deleteService()}_url(e){const t=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${t}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`}}function Qc(n,e,t){const i=On(e);n.emulatorOrigin=`http${i?"s":""}://${e}:${t}`,i&&(Ro(n.emulatorOrigin+"/backends"),No("Functions",!0))}const Lr="@firebase/functions",Fr="0.13.1";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Zc="auth-internal",eu="app-check-internal",tu="messaging-internal";function nu(n){const e=(t,{instanceIdentifier:i})=>{const r=t.getProvider("app").getImmediate(),l=t.getProvider(Zc),a=t.getProvider(tu),u=t.getProvider(eu);return new Jc(r,l,a,u,i)};Ke(new Le(jo,e,"PUBLIC").setMultipleInstances(!0)),Ce(Lr,Fr,n),Ce(Lr,Fr,"esm2020")}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Up(n=Bo(),e=Mi){const i=xn(Pn(n),jo).getImmediate({identifier:e}),r=bo("functions");return r&&iu(i,...r),i}function iu(n,e,t){Qc(Pn(n),e,t)}nu();var Br={};const Hr="@firebase/database",Ur="1.1.0";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let Wo="";function su(n){Wo=n}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ru{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){t==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),X(t))}get(e){const t=this.domStorage_.getItem(this.prefixedName_(e));return t==null?null:$t(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ou{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){t==null?delete this.cache_[e]:this.cache_[e]=t}get(e){return Ie(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const $o=function(n){try{if(typeof window<"u"&&typeof window[n]<"u"){const e=window[n];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new ru(e)}}catch{}return new ou},qe=$o("localStorage"),lu=$o("sessionStorage");/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const at=new Mo("@firebase/database"),au=(function(){let n=1;return function(){return n++}})(),Vo=function(n){const e=Th(n),t=new Ch;t.update(e);const i=t.digest();return zi.encodeByteArray(i)},zt=function(...n){let e="";for(let t=0;t{document.readyState==="complete"&&t()}),window.attachEvent("onload",t))}},ut="[MIN_NAME]",Ye="[MAX_NAME]",gt=function(n,e){if(n===e)return 0;if(n===ut||e===Ye)return-1;if(e===ut||n===Ye)return 1;{const t=Wr(n),i=Wr(e);return t!==null?i!==null?t-i===0?n.length-e.length:t-i:-1:i!==null?1:nt?i.push(n.substring(r,t)):i.push(n.substring(r,r+e));return i};function fe(n,e){for(const t in n)n.hasOwnProperty(t)&&e(t,n[t])}const zo=function(n){A(!Go(n),"Invalid JSON number");const e=11,t=52,i=(1<=Math.pow(2,1-i)?(u=Math.min(Math.floor(Math.log(n)/Math.LN2),i),l=u+i,a=Math.round(n*Math.pow(2,t-u)-Math.pow(2,t))):(l=0,a=Math.round(n/Math.pow(2,1-i-t))));const f=[];for(p=t;p;p-=1)f.push(a%2?1:0),a=Math.floor(a/2);for(p=e;p;p-=1)f.push(l%2?1:0),l=Math.floor(l/2);f.push(r?1:0),f.reverse();const T=f.join("");let w="";for(p=0;p<64;p+=8){let I=parseInt(T.substr(p,8),2).toString(16);I.length===1&&(I="0"+I),w=w+I}return w.toLowerCase()},du=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},pu=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"},gu=new RegExp("^-?(0*)\\d{1,10}$"),_u=-2147483648,mu=2147483647,Wr=function(n){if(gu.test(n)){const e=Number(n);if(e>=_u&&e<=mu)return e}return null},Yt=function(n){try{n()}catch(e){setTimeout(()=>{const t=e.stack||"";throw he("Exception was thrown by user callback.",t),e},Math.floor(0))}},yu=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Ut=function(n,e){const t=setTimeout(n,e);return typeof t=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(t):typeof t=="object"&&t.unref&&t.unref(),t};/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class vu{constructor(e,t){this.appCheckProvider=t,this.appName=e.name,Fo(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=t?.getImmediate({optional:!0}),this.appCheck||t?.get().then(i=>this.appCheck=i)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((t,i)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,i):t(null)},0)})}addTokenChangeListener(e){this.appCheckProvider?.get().then(t=>t.addTokenListener(e))}notifyForInvalidToken(){he(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cu{constructor(e,t,i){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=i,this.auth_=null,this.auth_=i.getImmediate({optional:!0}),this.auth_||i.onInit(r=>this.auth_=r)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(t=>t&&t.code==="auth/token-not-initialized"?(ee("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)):new Promise((t,i)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,i):t(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(t=>t.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(t=>t.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',he(e)}}class mn{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}mn.OWNER="owner";/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Qi="5",Ko="v",Yo="s",Xo="r",Jo="f",Qo=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Zo="ls",el="p",xi="ac",tl="websocket",nl="long_polling";/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class il{constructor(e,t,i,r,l=!1,a="",u=!1,p=!1,f=null){this.secure=t,this.namespace=i,this.webSocketOnly=r,this.nodeAdmin=l,this.persistenceKey=a,this.includeNamespaceInQueryParams=u,this.isUsingEmulator=p,this.emulatorOptions=f,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=qe.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&qe.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${t}`}}function Eu(n){return n.host!==n.internalHost||n.isCustomHost()||n.includeNamespaceInQueryParams}function sl(n,e,t){A(typeof e=="string","typeof type must == string"),A(typeof t=="object","typeof params must == object");let i;if(e===tl)i=(n.secure?"wss://":"ws://")+n.internalHost+"/.ws?";else if(e===nl)i=(n.secure?"https://":"http://")+n.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);Eu(n)&&(t.ns=n.namespace);const r=[];return fe(t,(l,a)=>{r.push(l+"="+a)}),i+r.join("&")}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class wu{constructor(){this.counters_={}}incrementCounter(e,t=1){Ie(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return Za(this.counters_)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const yi={},vi={};function Zi(n){const e=n.toString();return yi[e]||(yi[e]=new wu),yi[e]}function Su(n,e){const t=n.toString();return vi[t]||(vi[t]=e()),vi[t]}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Tu{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse{this.onMessage_(i[r])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const $r="start",Iu="close",bu="pLPCommand",Au="pRTLPCB",rl="id",ol="pw",ll="ser",Ru="cb",Nu="seg",ku="ts",Du="d",Ou="dframe",al=1870,hl=30,Mu=al-hl,Pu=25e3,xu=3e4;class ot{constructor(e,t,i,r,l,a,u){this.connId=e,this.repoInfo=t,this.applicationId=i,this.appCheckToken=r,this.authToken=l,this.transportSessionId=a,this.lastSessionId=u,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Kt(e),this.stats_=Zi(t),this.urlFn=p=>(this.appCheckToken&&(p[xi]=this.appCheckToken),sl(t,nl,p))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new Tu(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(xu)),uu(()=>{if(this.isClosed_)return;this.scriptTagHolder=new es((...l)=>{const[a,u,p,f,T]=l;if(this.incrementIncomingBytes_(l),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,a===$r)this.id=u,this.password=p;else if(a===Iu)u?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(u,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+a)},(...l)=>{const[a,u]=l;this.incrementIncomingBytes_(l),this.myPacketOrderer.handleResponse(a,u)},()=>{this.onClosed_()},this.urlFn);const i={};i[$r]="t",i[ll]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(i[Ru]=this.scriptTagHolder.uniqueCallbackIdentifier),i[Ko]=Qi,this.transportSessionId&&(i[Yo]=this.transportSessionId),this.lastSessionId&&(i[Zo]=this.lastSessionId),this.applicationId&&(i[el]=this.applicationId),this.appCheckToken&&(i[xi]=this.appCheckToken),typeof location<"u"&&location.hostname&&Qo.test(location.hostname)&&(i[Xo]=Jo);const r=this.urlFn(i);this.log_("Connecting via long-poll to "+r),this.scriptTagHolder.addTag(r,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){ot.forceAllow_=!0}static forceDisallow(){ot.forceDisallow_=!0}static isAvailable(){return ot.forceAllow_?!0:!ot.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!du()&&!pu()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=X(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const i=To(t),r=qo(i,Mu);for(let l=0;ldocument.domain="'+document.domain+'";<\/script>');const a=""+l+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(u){ee("frame writing exception"),u.stack&&ee(u.stack),ee(u)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||ee("No IE domain setting required")}catch{const i=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+i+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e[rl]=this.myID,e[ol]=this.myPW,e[ll]=this.currentSerial;let t=this.urlFn(e),i="",r=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+hl+i.length<=al;){const a=this.pendingSegs.shift();i=i+"&"+Nu+r+"="+a.seg+"&"+ku+r+"="+a.ts+"&"+Du+r+"="+a.d,r++}return t=t+i,this.addLongPollTag_(t,this.currentSerial),!0}else return!1}enqueueSegment(e,t,i){this.pendingSegs.push({seg:e,ts:t,d:i}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);const i=()=>{this.outstandingRequests.delete(t),this.newRequest_()},r=setTimeout(i,Math.floor(Pu)),l=()=>{clearTimeout(r),i()};this.addTag(e,l)}addTag(e,t){setTimeout(()=>{try{if(!this.sendNewPolls)return;const i=this.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){const r=i.readyState;(!r||r==="loaded"||r==="complete")&&(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),t())},i.onerror=()=>{ee("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(i)}catch{}},Math.floor(1))}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Lu=16384,Fu=45e3;let wn=null;typeof MozWebSocket<"u"?wn=MozWebSocket:typeof WebSocket<"u"&&(wn=WebSocket);class de{constructor(e,t,i,r,l,a,u){this.connId=e,this.applicationId=i,this.appCheckToken=r,this.authToken=l,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Kt(this.connId),this.stats_=Zi(t),this.connURL=de.connectionURL_(t,a,u,r,i),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,i,r,l){const a={};return a[Ko]=Qi,typeof location<"u"&&location.hostname&&Qo.test(location.hostname)&&(a[Xo]=Jo),t&&(a[Yo]=t),i&&(a[Zo]=i),r&&(a[xi]=r),l&&(a[el]=l),sl(e,tl,a)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,qe.set("previous_websocket_failure",!0);try{let i;uh(),this.mySock=new wn(this.connURL,[],i)}catch(i){this.log_("Error instantiating WebSocket.");const r=i.message||i.data;r&&this.log_(r),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=i=>{this.handleIncomingFrame(i)},this.mySock.onerror=i=>{this.log_("WebSocket error. Closing connection.");const r=i.message||i.data;r&&this.log_(r),this.onClosed_()}}start(){}static forceDisallow(){de.forceDisallow_=!0}static isAvailable(){let e=!1;if(typeof navigator<"u"&&navigator.userAgent){const t=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(t);i&&i.length>1&&parseFloat(i[1])<4.4&&(e=!0)}return!e&&wn!==null&&!de.forceDisallow_}static previouslyFailed(){return qe.isInMemoryStorage||qe.get("previous_websocket_failure")===!0}markConnectionHealthy(){qe.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const t=this.frames.join("");this.frames=null;const i=$t(t);this.onMessage(i)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(A(this.frames===null,"We already have a frame buffer"),e.length<=6){const t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;const t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(t);else{const i=this.extractFrameCount_(t);i!==null&&this.appendFrame_(i)}}send(e){this.resetKeepAlive();const t=X(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const i=qo(t,Lu);i.length>1&&this.sendString_(String(i.length));for(let r=0;r{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(Fu))}sendString_(e){try{this.mySock.send(e)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}de.responsesRequiredToBeHealthy=2;de.healthyTimeout=3e4;/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gt{static get ALL_TRANSPORTS(){return[ot,de]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const t=de&&de.isAvailable();let i=t&&!de.previouslyFailed();if(e.webSocketOnly&&(t||he("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[de];else{const r=this.transports_=[];for(const l of Gt.ALL_TRANSPORTS)l&&l.isAvailable()&&r.push(l);Gt.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}Gt.globalTransportInitialized_=!1;/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Bu=6e4,Hu=5e3,Uu=10*1024,ju=100*1024,Ci="t",Vr="d",Wu="s",Gr="r",$u="e",qr="o",zr="a",Kr="n",Yr="p",Vu="h";class Gu{constructor(e,t,i,r,l,a,u,p,f,T){this.id=e,this.repoInfo_=t,this.applicationId_=i,this.appCheckToken_=r,this.authToken_=l,this.onMessage_=a,this.onReady_=u,this.onDisconnect_=p,this.onKill_=f,this.lastSessionId=T,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Kt("c:"+this.id+":"),this.transportManager_=new Gt(t),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.conn_),i=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(t,i)},Math.floor(0));const r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=Ut(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>ju?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Uu?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(r)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){const t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(Ci in e){const t=e[Ci];t===zr?this.upgradeIfSecondaryHealthy_():t===Gr?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):t===qr&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const t=Pt("t",e),i=Pt("d",e);if(t==="c")this.onSecondaryControl_(i);else if(t==="d")this.pendingDataMessages.push(i);else throw new Error("Unknown protocol layer: "+t)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:Yr,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:zr,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:Kr,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const t=Pt("t",e),i=Pt("d",e);t==="c"?this.onControl_(i):t==="d"&&this.onDataMessage_(i)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const t=Pt(Ci,e);if(Vr in e){const i=e[Vr];if(t===Vu){const r={...i};this.repoInfo_.isUsingEmulator&&(r.h=this.repoInfo_.host),this.onHandshake_(r)}else if(t===Kr){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let r=0;r{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Bu))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Ut(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Hu))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:Yr,d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(qe.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cl{put(e,t,i,r){}merge(e,t,i,r){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,i){}onDisconnectMerge(e,t,i){}onDisconnectCancel(e,t){}reportStats(e){}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ul{constructor(e){this.allowedEvents_=e,this.listeners_={},A(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...t){if(Array.isArray(this.listeners_[e])){const i=[...this.listeners_[e]];for(let r=0;rt===e),"Unknown event: "+e)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Sn extends ul{static getInstance(){return new Sn}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!Do()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return A(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Xr=32,Jr=768;class ${constructor(e,t){if(t===void 0){this.pieces_=e.split("/");let i=0;for(let r=0;r0&&(this.pieces_[i]=this.pieces_[r],i++);this.pieces_.length=i,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t=n.pieces_.length?null:n.pieces_[n.pieceNum_]}function Fe(n){return n.pieces_.length-n.pieceNum_}function W(n){let e=n.pieceNum_;return e=n.pieces_.length)return null;const e=[];for(let t=n.pieceNum_;t0&&t.push(i[r])}return new $(t,0)}function O(n){return n.pieceNum_>=n.pieces_.length}function ue(n,e){const t=P(n),i=P(e);if(t===null)return e;if(t===i)return ue(W(n),W(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+n+")")}function gl(n,e){if(Fe(n)!==Fe(e))return!1;for(let t=n.pieceNum_,i=e.pieceNum_;t<=n.pieces_.length;t++,i++)if(n.pieces_[t]!==e.pieces_[i])return!1;return!0}function pe(n,e){let t=n.pieceNum_,i=e.pieceNum_;if(Fe(n)>Fe(e))return!1;for(;t0&&(n.byteLength_+=1),n.parts_.push(e),n.byteLength_+=Mn(e),_l(n)}function Yu(n){const e=n.parts_.pop();n.byteLength_-=Mn(e),n.parts_.length>0&&(n.byteLength_-=1)}function _l(n){if(n.byteLength_>Jr)throw new Error(n.errorPrefix_+"has a key path longer than "+Jr+" bytes ("+n.byteLength_+").");if(n.parts_.length>Xr)throw new Error(n.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+Xr+") or object contains a cycle "+Ge(n))}function Ge(n){return n.parts_.length===0?"":"in property '"+n.parts_.join(".")+"'"}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ts extends ul{static getInstance(){return new ts}constructor(){super(["visible"]);let e,t;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(t="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(t="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(t="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,()=>{const i=!document[e];i!==this.visible_&&(this.visible_=i,this.trigger("visible",i))},!1)}getInitialEvent(e){return A(e==="visible","Unknown event type: "+e),[this.visible_]}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const xt=1e3,Xu=300*1e3,Qr=30*1e3,Ju=1.3,Qu=3e4,Zu="server_kill",Zr=3;class we extends cl{constructor(e,t,i,r,l,a,u,p){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=i,this.onConnectStatus_=r,this.onServerInfoUpdate_=l,this.authTokenProvider_=a,this.appCheckTokenProvider_=u,this.authOverride_=p,this.id=we.nextPersistentConnectionId_++,this.log_=Kt("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=xt,this.maxReconnectDelay_=Xu,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,p)throw new Error("Auth override specified in options, but not supported on non Node.js platforms");ts.getInstance().on("visible",this.onVisible_,this),e.host.indexOf("fblocal")===-1&&Sn.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,i){const r=++this.requestNumber_,l={r,a:e,b:t};this.log_(X(l)),A(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(l),i&&(this.requestCBHash_[r]=i)}get(e){this.initConnection_();const t=new Ki,r={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:a=>{const u=a.d;a.s==="ok"?t.resolve(u):t.reject(u)}};this.outstandingGets_.push(r),this.outstandingGetCount_++;const l=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(l),t.promise}listen(e,t,i,r){this.initConnection_();const l=e._queryIdentifier,a=e._path.toString();this.log_("Listen called for "+a+" "+l),this.listens.has(a)||this.listens.set(a,new Map),A(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),A(!this.listens.get(a).has(l),"listen() called twice for same path/queryId.");const u={onComplete:r,hashFn:t,query:e,tag:i};this.listens.get(a).set(l,u),this.connected_&&this.sendListen_(u)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,i=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(i)})}sendListen_(e){const t=e.query,i=t._path.toString(),r=t._queryIdentifier;this.log_("Listen on "+i+" for "+r);const l={p:i},a="q";e.tag&&(l.q=t._queryObject,l.t=e.tag),l.h=e.hashFn(),this.sendRequest(a,l,u=>{const p=u.d,f=u.s;we.warnOnListenWarnings_(p,t),(this.listens.get(i)&&this.listens.get(i).get(r))===e&&(this.log_("listen response",u),f!=="ok"&&this.removeListen_(i,r),e.onComplete&&e.onComplete(f,p))})}static warnOnListenWarnings_(e,t){if(e&&typeof e=="object"&&Ie(e,"w")){const i=ct(e,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){const r='".indexOn": "'+t._queryParams.getIndex().toString()+'"',l=t._path.toString();he(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${r} at ${l} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||yh(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=Qr)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=mh(e)?"auth":"gauth",i={cred:e};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(t,i,r=>{const l=r.s,a=r.d||"error";this.authToken_===e&&(l==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(l,a))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const t=e.s,i=e.d||"error";t==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,i)})}unlisten(e,t){const i=e._path.toString(),r=e._queryIdentifier;this.log_("Unlisten called for "+i+" "+r),A(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,r)&&this.connected_&&this.sendUnlisten_(i,r,e._queryObject,t)}sendUnlisten_(e,t,i,r){this.log_("Unlisten on "+e+" for "+t);const l={p:e},a="n";r&&(l.q=i,l.t=r),this.sendRequest(a,l)}onDisconnectPut(e,t,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:i})}onDisconnectMerge(e,t,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:i})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,i,r){const l={p:t,d:i};this.log_("onDisconnect "+e,l),this.sendRequest(e,l,a=>{r&&setTimeout(()=>{r(a.s,a.d)},Math.floor(0))})}put(e,t,i,r){this.putInternal("p",e,t,i,r)}merge(e,t,i,r){this.putInternal("m",e,t,i,r)}putInternal(e,t,i,r,l){this.initConnection_();const a={p:t,d:i};l!==void 0&&(a.h=l),this.outstandingPuts_.push({action:e,request:a,onComplete:r}),this.outstandingPutCount_++;const u=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(u):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,i=this.outstandingPuts_[e].request,r=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,i,l=>{this.log_(t+" response",l),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),r&&r(l.s,l.d)})}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,i=>{if(i.s!=="ok"){const l=i.d;this.log_("reportStats","Error sending stats: "+l)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+X(e));const t=e.r,i=this.requestCBHash_[t];i&&(delete this.requestCBHash_[t],i(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),e==="d"?this.onDataUpdate_(t.p,t.d,!1,t.t):e==="m"?this.onDataUpdate_(t.p,t.d,!0,t.t):e==="c"?this.onListenRevoked_(t.p,t.q):e==="ac"?this.onAuthRevoked_(t.s,t.d):e==="apc"?this.onAppCheckRevoked_(t.s,t.d):e==="sd"?this.onSecurityDebugPacket_(t):Pi("Unrecognized action received from server: "+X(e)+` +Are you using the latest client?`)}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){A(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=xt,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=xt,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>Qu&&(this.reconnectDelay_=xt),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const e=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_);let t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*Ju)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+we.nextConnectionId_++,l=this.lastSessionId;let a=!1,u=null;const p=function(){u?u.close():(a=!0,i())},f=function(w){A(u,"sendRequest call when we're not connected not allowed."),u.sendRequest(w)};this.realtime_={close:p,sendRequest:f};const T=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[w,I]=await Promise.all([this.authTokenProvider_.getToken(T),this.appCheckTokenProvider_.getToken(T)]);a?ee("getToken() completed but was canceled"):(ee("getToken() completed. Creating connection."),this.authToken_=w&&w.accessToken,this.appCheckToken_=I&&I.token,u=new Gu(r,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,i,N=>{he(N+" ("+this.repoInfo_.toString()+")"),this.interrupt(Zu)},l))}catch(w){this.log_("Failed to get token: "+w),a||(this.repoInfo_.nodeAdmin&&he(w),p())}}}interrupt(e){ee("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){ee("Resuming connection for reason: "+e),delete this.interruptReasons_[e],Ir(this.interruptReasons_)&&(this.reconnectDelay_=xt,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;eJi(l)).join("$"):i="default";const r=this.removeListen_(e,i);r&&r.onComplete&&r.onComplete("permission_denied")}removeListen_(e,t){const i=new $(e).toString();let r;if(this.listens.has(i)){const l=this.listens.get(i);r=l.get(t),l.delete(t),l.size===0&&this.listens.delete(i)}else r=void 0;return r}onAuthRevoked_(e,t){ee("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e==="invalid_token"||e==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=Zr&&(this.reconnectDelay_=Qr,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){ee("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e==="invalid_token"||e==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=Zr&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace(` +`,` +FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e0}peek(){if(this.nodeStack_.length===0)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class K{constructor(e,t,i,r,l){this.key=e,this.value=t,this.color=i??K.RED,this.left=r??oe.EMPTY_NODE,this.right=l??oe.EMPTY_NODE}copy(e,t,i,r,l){return new K(e??this.key,t??this.value,i??this.color,r??this.left,l??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,i){let r=this;const l=i(e,r.key);return l<0?r=r.copy(null,null,null,r.left.insert(e,t,i),null):l===0?r=r.copy(null,t,null,null,null):r=r.copy(null,null,null,null,r.right.insert(e,t,i)),r.fixUp_()}removeMin_(){if(this.left.isEmpty())return oe.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let i,r;if(i=this,t(e,i.key)<0)!i.left.isEmpty()&&!i.left.isRed_()&&!i.left.left.isRed_()&&(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),!i.right.isEmpty()&&!i.right.isRed_()&&!i.right.left.isRed_()&&(i=i.moveRedRight_()),t(e,i.key)===0){if(i.right.isEmpty())return oe.EMPTY_NODE;r=i.right.min_(),i=i.copy(r.key,r.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,K.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,K.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}K.RED=!0;K.BLACK=!1;class ef{copy(e,t,i,r,l){return this}insert(e,t,i){return new K(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}class oe{constructor(e,t=oe.EMPTY_NODE){this.comparator_=e,this.root_=t}insert(e,t){return new oe(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,K.BLACK,null,null))}remove(e){return new oe(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,K.BLACK,null,null))}get(e){let t,i=this.root_;for(;!i.isEmpty();){if(t=this.comparator_(e,i.key),t===0)return i.value;t<0?i=i.left:t>0&&(i=i.right)}return null}getPredecessorKey(e){let t,i=this.root_,r=null;for(;!i.isEmpty();)if(t=this.comparator_(e,i.key),t===0){if(i.left.isEmpty())return r?r.key:null;for(i=i.left;!i.right.isEmpty();)i=i.right;return i.key}else t<0?i=i.left:t>0&&(r=i,i=i.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new _n(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new _n(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new _n(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new _n(this.root_,null,this.comparator_,!0,e)}}oe.EMPTY_NODE=new ef;/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function tf(n,e){return gt(n.name,e.name)}function ns(n,e){return gt(n,e)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let Li;function nf(n){Li=n}const yl=function(n){return typeof n=="number"?"number:"+zo(n):"string:"+n},vl=function(n){if(n.isLeafNode()){const e=n.val();A(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Ie(e,".sv"),"Priority must be a string or number.")}else A(n===Li||n.isEmpty(),"priority of unexpected type.");A(n===Li||n.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let eo;class z{static set __childrenNodeConstructor(e){eo=e}static get __childrenNodeConstructor(){return eo}constructor(e,t=z.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=t,this.lazyHash_=null,A(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),vl(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new z(this.value_,e)}getImmediateChild(e){return e===".priority"?this.priorityNode_:z.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return O(e)?this:P(e)===".priority"?this.priorityNode_:z.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return e===".priority"?this.updatePriority(t):t.isEmpty()&&e!==".priority"?this:z.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const i=P(e);return i===null?t:t.isEmpty()&&i!==".priority"?this:(A(i!==".priority"||Fe(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(i,z.__childrenNodeConstructor.EMPTY_NODE.updateChild(W(e),t)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+yl(this.priorityNode_.val())+":");const t=typeof this.value_;e+=t+":",t==="number"?e+=zo(this.value_):e+=this.value_,this.lazyHash_=Vo(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===z.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof z.__childrenNodeConstructor?-1:(A(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const t=typeof e.value_,i=typeof this.value_,r=z.VALUE_TYPE_ORDER.indexOf(t),l=z.VALUE_TYPE_ORDER.indexOf(i);return A(r>=0,"Unknown leaf type: "+t),A(l>=0,"Unknown leaf type: "+i),r===l?i==="object"?0:this.value_parseInt(Math.log(l)/lf,10),i=l=>parseInt(Array(l+1).join("1"),2);this.count=t(e+1),this.current_=this.count-1;const r=i(this.count);this.bits_=e+1&r}nextBitIsOne(){const e=!(this.bits_&1<{const a=ct(this.indexSet_,l);if(A(a,"Missing index implementation for "+l),r===rt)if(a.isDefinedOn(e.node)){const u=[],p=t.getIterator(x.Wrap);let f=p.getNext();for(;f;)f.name!==e.name&&u.push(f),f=p.getNext();return u.push(e),Tn(u,a.getCompare())}else return rt;else{const u=t.get(e.name);let p=r;return u&&(p=p.remove(new x(e.name,u))),p.insert(e,e.node)}});return new Ee(i,this.indexSet_)}removeFromIndexes(e,t){const i=vn(this.indexes_,r=>{if(r===rt)return r;{const l=t.get(e.name);return l?r.remove(new x(e.name,l)):r}});return new Ee(i,this.indexSet_)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let Lt;class L{static get EMPTY_NODE(){return Lt||(Lt=new L(new oe(ns),null,Ee.Default))}constructor(e,t,i){this.children_=e,this.priorityNode_=t,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&vl(this.priorityNode_),this.children_.isEmpty()&&A(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Lt}updatePriority(e){return this.children_.isEmpty()?this:new L(this.children_,e,this.indexMap_)}getImmediateChild(e){if(e===".priority")return this.getPriority();{const t=this.children_.get(e);return t===null?Lt:t}}getChild(e){const t=P(e);return t===null?this:this.getImmediateChild(t).getChild(W(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(e,t){if(A(t,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(t);{const i=new x(e,t);let r,l;t.isEmpty()?(r=this.children_.remove(e),l=this.indexMap_.removeFromIndexes(i,this.children_)):(r=this.children_.insert(e,t),l=this.indexMap_.addToIndexes(i,this.children_));const a=r.isEmpty()?Lt:this.priorityNode_;return new L(r,a,l)}}updateChild(e,t){const i=P(e);if(i===null)return t;{A(P(e)!==".priority"||Fe(e)===1,".priority must be the last token in a path");const r=this.getImmediateChild(i).updateChild(W(e),t);return this.updateImmediateChild(i,r)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const t={};let i=0,r=0,l=!0;if(this.forEachChild(ne,(a,u)=>{t[a]=u.val(e),i++,l&&L.INTEGER_REGEXP_.test(a)?r=Math.max(r,Number(a)):l=!1}),!e&&l&&r<2*i){const a=[];for(const u in t)a[u]=t[u];return a}else return e&&!this.getPriority().isEmpty()&&(t[".priority"]=this.getPriority().val()),t}hash(){if(this.lazyHash_===null){let e="";this.getPriority().isEmpty()||(e+="priority:"+yl(this.getPriority().val())+":"),this.forEachChild(ne,(t,i)=>{const r=i.hash();r!==""&&(e+=":"+t+":"+r)}),this.lazyHash_=e===""?"":Vo(e)}return this.lazyHash_}getPredecessorChildName(e,t,i){const r=this.resolveIndex_(i);if(r){const l=r.getPredecessorKey(new x(e,t));return l?l.name:null}else return this.children_.getPredecessorKey(e)}getFirstChildName(e){const t=this.resolveIndex_(e);if(t){const i=t.minKey();return i&&i.name}else return this.children_.minKey()}getFirstChild(e){const t=this.getFirstChildName(e);return t?new x(t,this.children_.get(t)):null}getLastChildName(e){const t=this.resolveIndex_(e);if(t){const i=t.maxKey();return i&&i.name}else return this.children_.maxKey()}getLastChild(e){const t=this.getLastChildName(e);return t?new x(t,this.children_.get(t)):null}forEachChild(e,t){const i=this.resolveIndex_(e);return i?i.inorderTraversal(r=>t(r.name,r.node)):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){const i=this.resolveIndex_(t);if(i)return i.getIteratorFrom(e,r=>r);{const r=this.children_.getIteratorFrom(e.name,x.Wrap);let l=r.peek();for(;l!=null&&t.compare(l,e)<0;)r.getNext(),l=r.peek();return r}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){const i=this.resolveIndex_(t);if(i)return i.getReverseIteratorFrom(e,r=>r);{const r=this.children_.getReverseIteratorFrom(e.name,x.Wrap);let l=r.peek();for(;l!=null&&t.compare(l,e)>0;)r.getNext(),l=r.peek();return r}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Xt?-1:0}withIndex(e){if(e===ht||this.indexMap_.hasIndex(e))return this;{const t=this.indexMap_.addIndex(e,this.children_);return new L(this.children_,this.priorityNode_,t)}}isIndexed(e){return e===ht||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const t=e;if(this.getPriority().equals(t.getPriority()))if(this.children_.count()===t.children_.count()){const i=this.getIterator(ne),r=t.getIterator(ne);let l=i.getNext(),a=r.getNext();for(;l&&a;){if(l.name!==a.name||!l.node.equals(a.node))return!1;l=i.getNext(),a=r.getNext()}return l===null&&a===null}else return!1;else return!1}}resolveIndex_(e){return e===ht?null:this.indexMap_.get(e.toString())}}L.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;class hf extends L{constructor(){super(new oe(ns),L.EMPTY_NODE,Ee.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return L.EMPTY_NODE}isEmpty(){return!1}}const Xt=new hf;Object.defineProperties(x,{MIN:{value:new x(ut,L.EMPTY_NODE)},MAX:{value:new x(Ye,Xt)}});ml.__EMPTY_NODE=L.EMPTY_NODE;z.__childrenNodeConstructor=L;nf(Xt);rf(Xt);/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const cf=!0;function te(n,e=null){if(n===null)return L.EMPTY_NODE;if(typeof n=="object"&&".priority"in n&&(e=n[".priority"]),A(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof n=="object"&&".value"in n&&n[".value"]!==null&&(n=n[".value"]),typeof n!="object"||".sv"in n){const t=n;return new z(t,te(e))}if(!(n instanceof Array)&&cf){const t=[];let i=!1;if(fe(n,(a,u)=>{if(a.substring(0,1)!=="."){const p=te(u);p.isEmpty()||(i=i||!p.getPriority().isEmpty(),t.push(new x(a,p)))}}),t.length===0)return L.EMPTY_NODE;const l=Tn(t,tf,a=>a.name,ns);if(i){const a=Tn(t,ne.getCompare());return new L(l,te(e),new Ee({".priority":a},{".priority":ne}))}else return new L(l,te(e),Ee.Default)}else{let t=L.EMPTY_NODE;return fe(n,(i,r)=>{if(Ie(n,i)&&i.substring(0,1)!=="."){const l=te(r);(l.isLeafNode()||!l.isEmpty())&&(t=t.updateImmediateChild(i,l))}}),t.updatePriority(te(e))}}sf(te);/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class uf extends Ln{constructor(e){super(),this.indexPath_=e,A(!O(e)&&P(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){const i=this.extractChild(e.node),r=this.extractChild(t.node),l=i.compareTo(r);return l===0?gt(e.name,t.name):l}makePost(e,t){const i=te(e),r=L.EMPTY_NODE.updateChild(this.indexPath_,i);return new x(t,r)}maxPost(){const e=L.EMPTY_NODE.updateChild(this.indexPath_,Xt);return new x(Ye,e)}toString(){return dl(this.indexPath_,0).join("/")}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ff extends Ln{compare(e,t){const i=e.node.compareTo(t.node);return i===0?gt(e.name,t.name):i}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return x.MIN}maxPost(){return x.MAX}makePost(e,t){const i=te(e);return new x(t,i)}toString(){return".value"}}const df=new ff;/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function pf(n){return{type:"value",snapshotNode:n}}function gf(n,e){return{type:"child_added",snapshotNode:e,childName:n}}function _f(n,e){return{type:"child_removed",snapshotNode:e,childName:n}}function to(n,e,t){return{type:"child_changed",snapshotNode:e,childName:n,oldSnap:t}}function mf(n,e){return{type:"child_moved",snapshotNode:e,childName:n}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class is{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=ne}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return A(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return A(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:ut}hasEnd(){return this.endSet_}getIndexEndValue(){return A(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return A(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:Ye}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return A(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===ne}copy(){const e=new is;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function no(n){const e={};if(n.isDefault())return e;let t;if(n.index_===ne?t="$priority":n.index_===df?t="$value":n.index_===ht?t="$key":(A(n.index_ instanceof uf,"Unrecognized index type!"),t=n.index_.toString()),e.orderBy=X(t),n.startSet_){const i=n.startAfterSet_?"startAfter":"startAt";e[i]=X(n.indexStartValue_),n.startNameSet_&&(e[i]+=","+X(n.indexStartName_))}if(n.endSet_){const i=n.endBeforeSet_?"endBefore":"endAt";e[i]=X(n.indexEndValue_),n.endNameSet_&&(e[i]+=","+X(n.indexEndName_))}return n.limitSet_&&(n.isViewFromLeft()?e.limitToFirst=n.limit_:e.limitToLast=n.limit_),e}function io(n){const e={};if(n.startSet_&&(e.sp=n.indexStartValue_,n.startNameSet_&&(e.sn=n.indexStartName_),e.sin=!n.startAfterSet_),n.endSet_&&(e.ep=n.indexEndValue_,n.endNameSet_&&(e.en=n.indexEndName_),e.ein=!n.endBeforeSet_),n.limitSet_){e.l=n.limit_;let t=n.viewFrom_;t===""&&(n.isViewFromLeft()?t="l":t="r"),e.vf=t}return n.index_!==ne&&(e.i=n.index_.toString()),e}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class In extends cl{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return t!==void 0?"tag$"+t:(A(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,i,r){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=i,this.appCheckTokenProvider_=r,this.log_=Kt("p:rest:"),this.listens_={}}listen(e,t,i,r){const l=e._path.toString();this.log_("Listen called for "+l+" "+e._queryIdentifier);const a=In.getListenId_(e,i),u={};this.listens_[a]=u;const p=no(e._queryParams);this.restRequest_(l+".json",p,(f,T)=>{let w=T;if(f===404&&(w=null,f=null),f===null&&this.onDataUpdate_(l,w,!1,i),ct(this.listens_,a)===u){let I;f?f===401?I="permission_denied":I="rest_error:"+f:I="ok",r(I,null)}})}unlisten(e,t){const i=In.getListenId_(e,t);delete this.listens_[i]}get(e){const t=no(e._queryParams),i=e._path.toString(),r=new Ki;return this.restRequest_(i+".json",t,(l,a)=>{let u=a;l===404&&(u=null,l=null),l===null?(this.onDataUpdate_(i,u,!1,null),r.resolve(u)):r.reject(new Error(u))}),r.promise}refreshAuthToken(e){}restRequest_(e,t={},i){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([r,l])=>{r&&r.accessToken&&(t.auth=r.accessToken),l&&l.token&&(t.ac=l.token);const a=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+vh(t);this.log_("Sending REST request for "+a);const u=new XMLHttpRequest;u.onreadystatechange=()=>{if(i&&u.readyState===4){this.log_("REST Response for "+a+" received. status:",u.status,"response:",u.responseText);let p=null;if(u.status>=200&&u.status<300){try{p=$t(u.responseText)}catch{he("Failed to parse JSON response for "+a+": "+u.responseText)}i(null,p)}else u.status!==401&&u.status!==404&&he("Got unsuccessful REST response for "+a+" Status: "+u.status),i(u.status);i=null}},u.open("GET",a,!0),u.send()})}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yf{constructor(){this.rootNode_=L.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function bn(){return{value:null,children:new Map}}function wl(n,e,t){if(O(e))n.value=t,n.children.clear();else if(n.value!==null)n.value=n.value.updateChild(e,t);else{const i=P(e);n.children.has(i)||n.children.set(i,bn());const r=n.children.get(i);e=W(e),wl(r,e,t)}}function Fi(n,e,t){n.value!==null?t(e,n.value):vf(n,(i,r)=>{const l=new $(e.toString()+"/"+i);Fi(r,l,t)})}function vf(n,e){n.children.forEach((t,i)=>{e(i,t)})}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cf{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),t={...e};return this.last_&&fe(this.last_,(i,r)=>{t[i]=t[i]-r}),this.last_=e,t}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const so=10*1e3,Ef=30*1e3,wf=300*1e3;class Sf{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new Cf(e);const i=so+(Ef-so)*Math.random();Ut(this.reportStats_.bind(this),Math.floor(i))}reportStats_(){const e=this.statsListener_.get(),t={};let i=!1;fe(e,(r,l)=>{l>0&&Ie(this.statsToReport_,r)&&(t[r]=l,i=!0)}),i&&this.server_.reportStats(t),Ut(this.reportStats_.bind(this),Math.floor(Math.random()*2*wf))}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var ve;(function(n){n[n.OVERWRITE=0]="OVERWRITE",n[n.MERGE=1]="MERGE",n[n.ACK_USER_WRITE=2]="ACK_USER_WRITE",n[n.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(ve||(ve={}));function Sl(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Tl(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function Il(n){return{fromUser:!1,fromServer:!0,queryId:n,tagged:!0}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class An{constructor(e,t,i){this.path=e,this.affectedTree=t,this.revert=i,this.type=ve.ACK_USER_WRITE,this.source=Sl()}operationForChild(e){if(O(this.path)){if(this.affectedTree.value!=null)return A(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const t=this.affectedTree.subtree(new $(e));return new An(F(),t,this.revert)}}else return A(P(this.path)===e,"operationForChild called for unrelated child."),new An(W(this.path),this.affectedTree,this.revert)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Xe{constructor(e,t,i){this.source=e,this.path=t,this.snap=i,this.type=ve.OVERWRITE}operationForChild(e){return O(this.path)?new Xe(this.source,F(),this.snap.getImmediateChild(e)):new Xe(this.source,W(this.path),this.snap)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qt{constructor(e,t,i){this.source=e,this.path=t,this.children=i,this.type=ve.MERGE}operationForChild(e){if(O(this.path)){const t=this.children.subtree(new $(e));return t.isEmpty()?null:t.value?new Xe(this.source,F(),t.value):new qt(this.source,F(),t)}else return A(P(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new qt(this.source,W(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ss{constructor(e,t,i){this.node_=e,this.fullyInitialized_=t,this.filtered_=i}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(O(e))return this.isFullyInitialized()&&!this.filtered_;const t=P(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}function Tf(n,e,t,i){const r=[],l=[];return e.forEach(a=>{a.type==="child_changed"&&n.index_.indexedValueChanged(a.oldSnap,a.snapshotNode)&&l.push(mf(a.childName,a.snapshotNode))}),Ft(n,r,"child_removed",e,i,t),Ft(n,r,"child_added",e,i,t),Ft(n,r,"child_moved",l,i,t),Ft(n,r,"child_changed",e,i,t),Ft(n,r,"value",e,i,t),r}function Ft(n,e,t,i,r,l){const a=i.filter(u=>u.type===t);a.sort((u,p)=>bf(n,u,p)),a.forEach(u=>{const p=If(n,u,l);r.forEach(f=>{f.respondsTo(u.type)&&e.push(f.createEvent(p,n.query_))})})}function If(n,e,t){return e.type==="value"||e.type==="child_removed"||(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,n.index_)),e}function bf(n,e,t){if(e.childName==null||t.childName==null)throw dt("Should only compare child_ events.");const i=new x(e.childName,e.snapshotNode),r=new x(t.childName,t.snapshotNode);return n.index_.compare(i,r)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function bl(n,e){return{eventCache:n,serverCache:e}}function jt(n,e,t,i){return bl(new ss(e,t,i),n.serverCache)}function Al(n,e,t,i){return bl(n.eventCache,new ss(e,t,i))}function Bi(n){return n.eventCache.isFullyInitialized()?n.eventCache.getNode():null}function Je(n){return n.serverCache.isFullyInitialized()?n.serverCache.getNode():null}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let wi;const Af=()=>(wi||(wi=new oe(fu)),wi);class j{static fromObject(e){let t=new j(null);return fe(e,(i,r)=>{t=t.set(new $(i),r)}),t}constructor(e,t=Af()){this.value=e,this.children=t}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(this.value!=null&&t(this.value))return{path:F(),value:this.value};if(O(e))return null;{const i=P(e),r=this.children.get(i);if(r!==null){const l=r.findRootMostMatchingPathAndValue(W(e),t);return l!=null?{path:Y(new $(i),l.path),value:l.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(O(e))return this;{const t=P(e),i=this.children.get(t);return i!==null?i.subtree(W(e)):new j(null)}}set(e,t){if(O(e))return new j(t,this.children);{const i=P(e),l=(this.children.get(i)||new j(null)).set(W(e),t),a=this.children.insert(i,l);return new j(this.value,a)}}remove(e){if(O(e))return this.children.isEmpty()?new j(null):new j(null,this.children);{const t=P(e),i=this.children.get(t);if(i){const r=i.remove(W(e));let l;return r.isEmpty()?l=this.children.remove(t):l=this.children.insert(t,r),this.value===null&&l.isEmpty()?new j(null):new j(this.value,l)}else return this}}get(e){if(O(e))return this.value;{const t=P(e),i=this.children.get(t);return i?i.get(W(e)):null}}setTree(e,t){if(O(e))return t;{const i=P(e),l=(this.children.get(i)||new j(null)).setTree(W(e),t);let a;return l.isEmpty()?a=this.children.remove(i):a=this.children.insert(i,l),new j(this.value,a)}}fold(e){return this.fold_(F(),e)}fold_(e,t){const i={};return this.children.inorderTraversal((r,l)=>{i[r]=l.fold_(Y(e,r),t)}),t(e,this.value,i)}findOnPath(e,t){return this.findOnPath_(e,F(),t)}findOnPath_(e,t,i){const r=this.value?i(t,this.value):!1;if(r)return r;if(O(e))return null;{const l=P(e),a=this.children.get(l);return a?a.findOnPath_(W(e),Y(t,l),i):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,F(),t)}foreachOnPath_(e,t,i){if(O(e))return this;{this.value&&i(t,this.value);const r=P(e),l=this.children.get(r);return l?l.foreachOnPath_(W(e),Y(t,r),i):new j(null)}}foreach(e){this.foreach_(F(),e)}foreach_(e,t){this.children.inorderTraversal((i,r)=>{r.foreach_(Y(e,i),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,i)=>{i.value&&e(t,i.value)})}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ge{constructor(e){this.writeTree_=e}static empty(){return new ge(new j(null))}}function Wt(n,e,t){if(O(e))return new ge(new j(t));{const i=n.writeTree_.findRootMostValueAndPath(e);if(i!=null){const r=i.path;let l=i.value;const a=ue(r,e);return l=l.updateChild(a,t),new ge(n.writeTree_.set(r,l))}else{const r=new j(t),l=n.writeTree_.setTree(e,r);return new ge(l)}}}function ro(n,e,t){let i=n;return fe(t,(r,l)=>{i=Wt(i,Y(e,r),l)}),i}function oo(n,e){if(O(e))return ge.empty();{const t=n.writeTree_.setTree(e,new j(null));return new ge(t)}}function Hi(n,e){return et(n,e)!=null}function et(n,e){const t=n.writeTree_.findRootMostValueAndPath(e);return t!=null?n.writeTree_.get(t.path).getChild(ue(t.path,e)):null}function lo(n){const e=[],t=n.writeTree_.value;return t!=null?t.isLeafNode()||t.forEachChild(ne,(i,r)=>{e.push(new x(i,r))}):n.writeTree_.children.inorderTraversal((i,r)=>{r.value!=null&&e.push(new x(i,r.value))}),e}function xe(n,e){if(O(e))return n;{const t=et(n,e);return t!=null?new ge(new j(t)):new ge(n.writeTree_.subtree(e))}}function Ui(n){return n.writeTree_.isEmpty()}function ft(n,e){return Rl(F(),n.writeTree_,e)}function Rl(n,e,t){if(e.value!=null)return t.updateChild(n,e.value);{let i=null;return e.children.inorderTraversal((r,l)=>{r===".priority"?(A(l.value!==null,"Priority writes must always be leaf nodes"),i=l.value):t=Rl(Y(n,r),l,t)}),!t.getChild(n).isEmpty()&&i!==null&&(t=t.updateChild(Y(n,".priority"),i)),t}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Nl(n,e){return Pl(e,n)}function Rf(n,e,t,i,r){A(i>n.lastWriteId,"Stacking an older write on top of newer ones"),r===void 0&&(r=!0),n.allWrites.push({path:e,snap:t,writeId:i,visible:r}),r&&(n.visibleWrites=Wt(n.visibleWrites,e,t)),n.lastWriteId=i}function Nf(n,e){for(let t=0;tu.writeId===e);A(t>=0,"removeWrite called with nonexistent writeId.");const i=n.allWrites[t];n.allWrites.splice(t,1);let r=i.visible,l=!1,a=n.allWrites.length-1;for(;r&&a>=0;){const u=n.allWrites[a];u.visible&&(a>=t&&Df(u,i.path)?r=!1:pe(i.path,u.path)&&(l=!0)),a--}if(r){if(l)return Of(n),!0;if(i.snap)n.visibleWrites=oo(n.visibleWrites,i.path);else{const u=i.children;fe(u,p=>{n.visibleWrites=oo(n.visibleWrites,Y(i.path,p))})}return!0}else return!1}function Df(n,e){if(n.snap)return pe(n.path,e);for(const t in n.children)if(n.children.hasOwnProperty(t)&&pe(Y(n.path,t),e))return!0;return!1}function Of(n){n.visibleWrites=kl(n.allWrites,Mf,F()),n.allWrites.length>0?n.lastWriteId=n.allWrites[n.allWrites.length-1].writeId:n.lastWriteId=-1}function Mf(n){return n.visible}function kl(n,e,t){let i=ge.empty();for(let r=0;r{i=i.updateImmediateChild(l,a)}),i;if(t){const l=xe(n.visibleWrites,e);return t.forEachChild(ne,(a,u)=>{const p=ft(xe(l,new $(a)),u);i=i.updateImmediateChild(a,p)}),lo(l).forEach(a=>{i=i.updateImmediateChild(a.name,a.node)}),i}else{const l=xe(n.visibleWrites,e);return lo(l).forEach(a=>{i=i.updateImmediateChild(a.name,a.node)}),i}}function xf(n,e,t,i,r){A(i||r,"Either existingEventSnap or existingServerSnap must exist");const l=Y(e,t);if(Hi(n.visibleWrites,l))return null;{const a=xe(n.visibleWrites,l);return Ui(a)?r.getChild(t):ft(a,r.getChild(t))}}function Lf(n,e,t,i){const r=Y(e,t),l=et(n.visibleWrites,r);if(l!=null)return l;if(i.isCompleteForChild(t)){const a=xe(n.visibleWrites,r);return ft(a,i.getNode().getImmediateChild(t))}else return null}function Ff(n,e){return et(n.visibleWrites,e)}function Bf(n,e,t,i,r,l,a){let u;const p=xe(n.visibleWrites,e),f=et(p,F());if(f!=null)u=f;else if(t!=null)u=ft(p,t);else return[];if(u=u.withIndex(a),!u.isEmpty()&&!u.isLeafNode()){const T=[],w=a.getCompare(),I=l?u.getReverseIteratorFrom(i,a):u.getIteratorFrom(i,a);let N=I.getNext();for(;N&&T.length0||!n.eventCache.isFullyInitialized()||r&&!i.getNode().equals(l)||!i.getNode().getPriority().equals(l.getPriority()))&&t.push(pf(Bi(e)))}}function Ll(n,e,t,i,r,l){const a=e.eventCache;if(Rn(i,t)!=null)return e;{let u,p;if(O(t))if(A(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const f=Je(e),T=f instanceof L?f:L.EMPTY_NODE,w=Ol(i,T);u=n.filter.updateFullNode(e.eventCache.getNode(),w,l)}else{const f=ji(i,Je(e));u=n.filter.updateFullNode(e.eventCache.getNode(),f,l)}else{const f=P(t);if(f===".priority"){A(Fe(t)===1,"Can't have a priority with additional path components");const T=a.getNode();p=e.serverCache.getNode();const w=ao(i,t,T,p);w!=null?u=n.filter.updatePriority(T,w):u=a.getNode()}else{const T=W(t);let w;if(a.isCompleteForChild(f)){p=e.serverCache.getNode();const I=ao(i,t,a.getNode(),p);I!=null?w=a.getNode().getImmediateChild(f).updateChild(T,I):w=a.getNode().getImmediateChild(f)}else w=rs(i,f,e.serverCache);w!=null?u=n.filter.updateChild(a.getNode(),f,w,T,r,l):u=a.getNode()}}return jt(e,u,a.isFullyInitialized()||O(t),n.filter.filtersNodes())}}function Nn(n,e,t,i,r,l,a,u){const p=e.serverCache;let f;const T=a?n.filter:n.filter.getIndexedFilter();if(O(t))f=T.updateFullNode(p.getNode(),i,null);else if(T.filtersNodes()&&!p.isFiltered()){const N=p.getNode().updateChild(t,i);f=T.updateFullNode(p.getNode(),N,null)}else{const N=P(t);if(!p.isCompleteForPath(t)&&Fe(t)>1)return e;const R=W(t),D=p.getNode().getImmediateChild(N).updateChild(R,i);N===".priority"?f=T.updatePriority(p.getNode(),D):f=T.updateChild(p.getNode(),N,D,R,xl,null)}const w=Al(e,f,p.isFullyInitialized()||O(t),T.filtersNodes()),I=new os(r,w,l);return Ll(n,w,t,r,I,u)}function Wi(n,e,t,i,r,l,a){const u=e.eventCache;let p,f;const T=new os(r,e,l);if(O(t))f=n.filter.updateFullNode(e.eventCache.getNode(),i,a),p=jt(e,f,!0,n.filter.filtersNodes());else{const w=P(t);if(w===".priority")f=n.filter.updatePriority(e.eventCache.getNode(),i),p=jt(e,f,u.isFullyInitialized(),u.isFiltered());else{const I=W(t),N=u.getNode().getImmediateChild(w);let R;if(O(I))R=i;else{const M=T.getCompleteChild(w);M!=null?fl(I)===".priority"&&M.getChild(pl(I)).isEmpty()?R=M:R=M.updateChild(I,i):R=L.EMPTY_NODE}if(N.equals(R))p=e;else{const M=n.filter.updateChild(u.getNode(),w,R,I,T,a);p=jt(e,M,u.isFullyInitialized(),n.filter.filtersNodes())}}}return p}function ho(n,e){return n.eventCache.isCompleteForChild(e)}function qf(n,e,t,i,r,l,a){let u=e;return i.foreach((p,f)=>{const T=Y(t,p);ho(e,P(T))&&(u=Wi(n,u,T,f,r,l,a))}),i.foreach((p,f)=>{const T=Y(t,p);ho(e,P(T))||(u=Wi(n,u,T,f,r,l,a))}),u}function co(n,e,t){return t.foreach((i,r)=>{e=e.updateChild(i,r)}),e}function $i(n,e,t,i,r,l,a,u){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let p=e,f;O(t)?f=i:f=new j(null).setTree(t,i);const T=e.serverCache.getNode();return f.children.inorderTraversal((w,I)=>{if(T.hasChild(w)){const N=e.serverCache.getNode().getImmediateChild(w),R=co(n,N,I);p=Nn(n,p,new $(w),R,r,l,a,u)}}),f.children.inorderTraversal((w,I)=>{const N=!e.serverCache.isCompleteForChild(w)&&I.value===null;if(!T.hasChild(w)&&!N){const R=e.serverCache.getNode().getImmediateChild(w),M=co(n,R,I);p=Nn(n,p,new $(w),M,r,l,a,u)}}),p}function zf(n,e,t,i,r,l,a){if(Rn(r,t)!=null)return e;const u=e.serverCache.isFiltered(),p=e.serverCache;if(i.value!=null){if(O(t)&&p.isFullyInitialized()||p.isCompleteForPath(t))return Nn(n,e,t,p.getNode().getChild(t),r,l,u,a);if(O(t)){let f=new j(null);return p.getNode().forEachChild(ht,(T,w)=>{f=f.set(new $(T),w)}),$i(n,e,t,f,r,l,u,a)}else return e}else{let f=new j(null);return i.foreach((T,w)=>{const I=Y(t,T);p.isCompleteForPath(I)&&(f=f.set(T,p.getNode().getChild(I)))}),$i(n,e,t,f,r,l,u,a)}}function Kf(n,e,t,i,r){const l=e.serverCache,a=Al(e,l.getNode(),l.isFullyInitialized()||O(t),l.isFiltered());return Ll(n,a,t,i,xl,r)}function Yf(n,e,t,i,r,l){let a;if(Rn(i,t)!=null)return e;{const u=new os(i,e,r),p=e.eventCache.getNode();let f;if(O(t)||P(t)===".priority"){let T;if(e.serverCache.isFullyInitialized())T=ji(i,Je(e));else{const w=e.serverCache.getNode();A(w instanceof L,"serverChildren would be complete if leaf node"),T=Ol(i,w)}T=T,f=n.filter.updateFullNode(p,T,l)}else{const T=P(t);let w=rs(i,T,e.serverCache);w==null&&e.serverCache.isCompleteForChild(T)&&(w=p.getImmediateChild(T)),w!=null?f=n.filter.updateChild(p,T,w,W(t),u,l):e.eventCache.getNode().hasChild(T)?f=n.filter.updateChild(p,T,L.EMPTY_NODE,W(t),u,l):f=p,f.isEmpty()&&e.serverCache.isFullyInitialized()&&(a=ji(i,Je(e)),a.isLeafNode()&&(f=n.filter.updateFullNode(f,a,l)))}return a=e.serverCache.isFullyInitialized()||Rn(i,F())!=null,jt(e,f,a,n.filter.filtersNodes())}}function Xf(n,e){const t=Je(n.viewCache_);return t&&(n.query._queryParams.loadsAllData()||!O(e)&&!t.getImmediateChild(P(e)).isEmpty())?t.getChild(e):null}function uo(n,e,t,i){e.type===ve.MERGE&&e.source.queryId!==null&&(A(Je(n.viewCache_),"We should always have a full cache before handling merges"),A(Bi(n.viewCache_),"Missing event cache, even though we have a server cache"));const r=n.viewCache_,l=Vf(n.processor_,r,e,t,i);return $f(n.processor_,l.viewCache),A(l.viewCache.serverCache.isFullyInitialized()||!r.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),n.viewCache_=l.viewCache,Jf(n,l.changes,l.viewCache.eventCache.getNode())}function Jf(n,e,t,i){const r=n.eventRegistrations_;return Tf(n.eventGenerator_,e,t,r)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let fo;function Qf(n){A(!fo,"__referenceConstructor has already been defined"),fo=n}function ls(n,e,t,i){const r=e.source.queryId;if(r!==null){const l=n.views.get(r);return A(l!=null,"SyncTree gave us an op for an invalid query."),uo(l,e,t,i)}else{let l=[];for(const a of n.views.values())l=l.concat(uo(a,e,t,i));return l}}function as(n,e){let t=null;for(const i of n.views.values())t=t||Xf(i,e);return t}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let po;function Zf(n){A(!po,"__referenceConstructor has already been defined"),po=n}class go{constructor(e){this.listenProvider_=e,this.syncPointTree_=new j(null),this.pendingWriteTree_=Hf(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function ed(n,e,t,i,r){return Rf(n.pendingWriteTree_,e,t,i,r),r?Bn(n,new Xe(Sl(),e,t)):[]}function lt(n,e,t=!1){const i=Nf(n.pendingWriteTree_,e);if(kf(n.pendingWriteTree_,e)){let l=new j(null);return i.snap!=null?l=l.set(F(),!0):fe(i.children,a=>{l=l.set(new $(a),!0)}),Bn(n,new An(i.path,l,t))}else return[]}function Fn(n,e,t){return Bn(n,new Xe(Tl(),e,t))}function td(n,e,t){const i=j.fromObject(t);return Bn(n,new qt(Tl(),e,i))}function nd(n,e,t,i){const r=Ul(n,i);if(r!=null){const l=jl(r),a=l.path,u=l.queryId,p=ue(a,e),f=new Xe(Il(u),p,t);return Wl(n,a,f)}else return[]}function id(n,e,t,i){const r=Ul(n,i);if(r){const l=jl(r),a=l.path,u=l.queryId,p=ue(a,e),f=j.fromObject(t),T=new qt(Il(u),p,f);return Wl(n,a,T)}else return[]}function Fl(n,e,t){const r=n.pendingWriteTree_,l=n.syncPointTree_.findOnPath(e,(a,u)=>{const p=ue(a,e),f=as(u,p);if(f)return f});return Dl(r,e,l,t,!0)}function Bn(n,e){return Bl(e,n.syncPointTree_,null,Nl(n.pendingWriteTree_,F()))}function Bl(n,e,t,i){if(O(n.path))return Hl(n,e,t,i);{const r=e.get(F());t==null&&r!=null&&(t=as(r,F()));let l=[];const a=P(n.path),u=n.operationForChild(a),p=e.children.get(a);if(p&&u){const f=t?t.getImmediateChild(a):null,T=Ml(i,a);l=l.concat(Bl(u,p,f,T))}return r&&(l=l.concat(ls(r,n,i,t))),l}}function Hl(n,e,t,i){const r=e.get(F());t==null&&r!=null&&(t=as(r,F()));let l=[];return e.children.inorderTraversal((a,u)=>{const p=t?t.getImmediateChild(a):null,f=Ml(i,a),T=n.operationForChild(a);T&&(l=l.concat(Hl(T,u,p,f)))}),r&&(l=l.concat(ls(r,n,i,t))),l}function Ul(n,e){return n.tagToQueryMap.get(e)}function jl(n){const e=n.indexOf("$");return A(e!==-1&&e{const f=us(p,e.getImmediateChild(u),t);f!==p&&(l=l.updateImmediateChild(u,f))}),l}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class fs{constructor(e="",t=null,i={children:{},childCount:0}){this.name=e,this.parent=t,this.node=i}}function ds(n,e){let t=e instanceof $?e:new $(e),i=n,r=P(t);for(;r!==null;){const l=ct(i.node.children,r)||{children:{},childCount:0};i=new fs(r,i,l),t=W(t),r=P(t)}return i}function _t(n){return n.node.value}function $l(n,e){n.node.value=e,Vi(n)}function Vl(n){return n.node.childCount>0}function hd(n){return _t(n)===void 0&&!Vl(n)}function Hn(n,e){fe(n.node.children,(t,i)=>{e(new fs(t,n,i))})}function Gl(n,e,t,i){t&&e(n),Hn(n,r=>{Gl(r,e,!0)})}function cd(n,e,t){let i=n.parent;for(;i!==null;){if(e(i))return!0;i=i.parent}return!1}function Jt(n){return new $(n.parent===null?n.name:Jt(n.parent)+"/"+n.name)}function Vi(n){n.parent!==null&&ud(n.parent,n.name,n)}function ud(n,e,t){const i=hd(t),r=Ie(n.node.children,e);i&&r?(delete n.node.children[e],n.node.childCount--,Vi(n)):!i&&!r&&(n.node.children[e]=t.node,n.node.childCount++,Vi(n))}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const fd=/[\[\].#$\/\u0000-\u001F\u007F]/,dd=/[\[\].#$\u0000-\u001F\u007F]/,Si=10*1024*1024,ql=function(n){return typeof n=="string"&&n.length!==0&&!fd.test(n)},pd=function(n){return typeof n=="string"&&n.length!==0&&!dd.test(n)},gd=function(n){return n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),pd(n)},zl=function(n,e,t){const i=t instanceof $?new zu(t,n):t;if(e===void 0)throw new Error(n+"contains undefined "+Ge(i));if(typeof e=="function")throw new Error(n+"contains a function "+Ge(i)+" with contents = "+e.toString());if(Go(e))throw new Error(n+"contains "+e.toString()+" "+Ge(i));if(typeof e=="string"&&e.length>Si/3&&Mn(e)>Si)throw new Error(n+"contains a string greater than "+Si+" utf8 bytes "+Ge(i)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let r=!1,l=!1;if(fe(e,(a,u)=>{if(a===".value")r=!0;else if(a!==".priority"&&a!==".sv"&&(l=!0,!ql(a)))throw new Error(n+" contains an invalid key ("+a+") "+Ge(i)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Ku(i,a),zl(n,u,i),Yu(i)}),r&&l)throw new Error(n+' contains ".value" child '+Ge(i)+" in addition to actual children.")}},_d=function(n,e){const t=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!ql(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||t.length!==0&&!gd(t))throw new Error(Sh(n,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class md{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function yd(n,e){let t=null;for(let i=0;ipe(i,e)||pe(e,i))}function vd(n,e){n.recursionDepth_++;let t=!0;for(let i=0;i{mo(n,i,r,l,a)},n.authTokenProvider_,n.appCheckProvider_),setTimeout(()=>yo(n,!0),0);else{if(typeof t<"u"&&t!==null){if(typeof t!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{X(t)}catch(i){throw new Error("Invalid authOverride provided: "+i)}}n.persistentConnection_=new we(n.repoInfo_,e,(i,r,l,a)=>{mo(n,i,r,l,a)},i=>{yo(n,i)},i=>{bd(n,i)},n.authTokenProvider_,n.appCheckProvider_,t),n.server_=n.persistentConnection_}n.authTokenProvider_.addTokenChangeListener(i=>{n.server_.refreshAuthToken(i)}),n.appCheckProvider_.addTokenChangeListener(i=>{n.server_.refreshAppCheckToken(i.token)}),n.statsReporter_=Su(n.repoInfo_,()=>new Sf(n.stats_,n.server_)),n.infoData_=new yf,n.infoSyncTree_=new go({startListening:(i,r,l,a)=>{let u=[];const p=n.infoData_.getNode(i._path);return p.isEmpty()||(u=Fn(n.infoSyncTree_,i._path,p),setTimeout(()=>{a("ok")},0)),u},stopListening:()=>{}}),ps(n,"connected",!1),n.serverSyncTree_=new go({startListening:(i,r,l,a)=>(n.server_.listen(i,l,r,(u,p)=>{const f=a(u,p);tt(n.eventQueue_,i._path,f)}),[]),stopListening:(i,r)=>{n.server_.unlisten(i,r)}})}function Id(n){const t=n.infoData_.getNode(new $(".info/serverTimeOffset")).val()||0;return new Date().getTime()+t}function Kl(n){return sd({timestamp:Id(n)})}function mo(n,e,t,i,r){n.dataUpdateCount++;const l=new $(e);t=n.interceptServerDataCallback_?n.interceptServerDataCallback_(e,t):t;let a=[];if(r)if(i){const p=vn(t,f=>te(f));a=id(n.serverSyncTree_,l,p,r)}else{const p=te(t);a=nd(n.serverSyncTree_,l,p,r)}else if(i){const p=vn(t,f=>te(f));a=td(n.serverSyncTree_,l,p)}else{const p=te(t);a=Fn(n.serverSyncTree_,l,p)}let u=l;a.length>0&&(u=_s(n,l)),tt(n.eventQueue_,u,a)}function yo(n,e){ps(n,"connected",e),e===!1&&Rd(n)}function bd(n,e){fe(e,(t,i)=>{ps(n,t,i)})}function ps(n,e,t){const i=new $("/.info/"+e),r=te(t);n.infoData_.updateSnapshot(i,r);const l=Fn(n.infoSyncTree_,i,r);tt(n.eventQueue_,i,l)}function Ad(n){return n.nextWriteId_++}function Rd(n){Yl(n,"onDisconnectEvents");const e=Kl(n),t=bn();Fi(n.onDisconnect_,F(),(r,l)=>{const a=ld(r,l,n.serverSyncTree_,e);wl(t,r,a)});let i=[];Fi(t,F(),(r,l)=>{i=i.concat(Fn(n.serverSyncTree_,r,l));const a=Od(n,r);_s(n,a)}),n.onDisconnect_=bn(),tt(n.eventQueue_,F(),i)}function Nd(n){n.persistentConnection_&&n.persistentConnection_.interrupt(Ed)}function Yl(n,...e){let t="";n.persistentConnection_&&(t=n.persistentConnection_.id+":"),ee(t,...e)}function Xl(n,e,t){return Fl(n.serverSyncTree_,e,t)||L.EMPTY_NODE}function gs(n,e=n.transactionQueueTree_){if(e||Un(n,e),_t(e)){const t=Ql(n,e);A(t.length>0,"Sending zero length transaction queue"),t.every(r=>r.status===0)&&kd(n,Jt(e),t)}else Vl(e)&&Hn(e,t=>{gs(n,t)})}function kd(n,e,t){const i=t.map(f=>f.currentWriteId),r=Xl(n,e,i);let l=r;const a=r.hash();for(let f=0;f{Yl(n,"transaction put response",{path:p.toString(),status:f});let T=[];if(f==="ok"){const w=[];for(let I=0;It[I].onComplete(null,!0,t[I].currentOutputSnapshotResolved)),t[I].unwatcher();Un(n,ds(n.transactionQueueTree_,e)),gs(n,n.transactionQueueTree_),tt(n.eventQueue_,e,T);for(let I=0;Iu.status===0).map(u=>u.currentWriteId);for(let u=0;u=wd)T=!0,w="maxretry",r=r.concat(lt(n.serverSyncTree_,p.currentWriteId,!0));else{const I=Xl(n,p.path,a);p.currentInputSnapshot=I;const N=e[u].update(I.val());if(N!==void 0){zl("transaction failed: Data returned ",N,p.path);let R=te(N);typeof N=="object"&&N!=null&&Ie(N,".priority")||(R=R.updatePriority(I.getPriority()));const D=p.currentWriteId,le=Kl(n),J=ad(R,I,le);p.currentOutputSnapshotRaw=R,p.currentOutputSnapshotResolved=J,p.currentWriteId=Ad(n),a.splice(a.indexOf(D),1),r=r.concat(ed(n.serverSyncTree_,p.path,J,p.currentWriteId,p.applyLocally)),r=r.concat(lt(n.serverSyncTree_,D,!0))}else T=!0,w="nodata",r=r.concat(lt(n.serverSyncTree_,p.currentWriteId,!0))}tt(n.eventQueue_,t,r),r=[],T&&(e[u].status=2,(function(I){setTimeout(I,Math.floor(0))})(e[u].unwatcher),e[u].onComplete&&(w==="nodata"?i.push(()=>e[u].onComplete(null,!1,e[u].currentInputSnapshot)):i.push(()=>e[u].onComplete(new Error(w),!1,null))))}Un(n,n.transactionQueueTree_);for(let u=0;ui.order-r.order),t}function Zl(n,e,t){const i=_t(e);if(i)for(let r=0;r{Zl(n,r,t)})}function Un(n,e){const t=_t(e);if(t){let i=0;for(let r=0;r0?t:void 0)}Hn(e,i=>{Un(n,i)})}function Od(n,e){const t=Jt(Jl(n,e)),i=ds(n.transactionQueueTree_,e);return cd(i,r=>{Ti(n,r)}),Ti(n,i),Gl(i,r=>{Ti(n,r)}),t}function Ti(n,e){const t=_t(e);if(t){const i=[];let r=[],l=-1;for(let a=0;a0){let r=t[i];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch{}e+="/"+r}return e}function Pd(n){const e={};n.charAt(0)==="?"&&(n=n.substring(1));for(const t of n.split("&")){if(t.length===0)continue;const i=t.split("=");i.length===2?e[decodeURIComponent(i[0])]=decodeURIComponent(i[1]):he(`Invalid query segment '${t}' in query '${n}'`)}return e}const vo=function(n,e){const t=xd(n),i=t.namespace;t.domain==="firebase.com"&&Te(t.host+" is no longer supported. Please use .firebaseio.com instead"),(!i||i==="undefined")&&t.domain!=="localhost"&&Te("Cannot parse Firebase url. Please use https://.firebaseio.com"),t.secure||cu();const r=t.scheme==="ws"||t.scheme==="wss";return{repoInfo:new il(t.host,t.secure,i,r,e,"",i!==t.subdomain),path:new $(t.pathString)}},xd=function(n){let e="",t="",i="",r="",l="",a=!0,u="https",p=443;if(typeof n=="string"){let f=n.indexOf("//");f>=0&&(u=n.substring(0,f-1),n=n.substring(f+2));let T=n.indexOf("/");T===-1&&(T=n.length);let w=n.indexOf("?");w===-1&&(w=n.length),e=n.substring(0,Math.min(T,w)),T=0?(a=u==="https"||u==="wss",p=parseInt(e.substring(f+1),10)):f=e.length;const N=e.slice(0,f);if(N.toLowerCase()==="localhost")t="localhost";else if(N.split(".").length<=2)t=N;else{const R=e.indexOf(".");i=e.substring(0,R).toLowerCase(),t=e.substring(R+1),l=i}"ns"in I&&(l=I.ns)}return{host:e,port:p,domain:t,subdomain:i,secure:a,scheme:u,pathString:r,namespace:l}};/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ms{constructor(e,t,i,r){this._repo=e,this._path=t,this._queryParams=i,this._orderByCalled=r}get key(){return O(this._path)?null:fl(this._path)}get ref(){return new mt(this._repo,this._path)}get _queryIdentifier(){const e=io(this._queryParams),t=Ji(e);return t==="{}"?"default":t}get _queryObject(){return io(this._queryParams)}isEqual(e){if(e=Pn(e),!(e instanceof ms))return!1;const t=this._repo===e._repo,i=gl(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return t&&i&&r}toJSON(){return this.toString()}toString(){return this._repo.toString()+qu(this._path)}}class mt extends ms{constructor(e,t){super(e,t,new is,!1)}get parent(){const e=pl(this._path);return e===null?null:new mt(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}}Qf(mt);Zf(mt);/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ld="FIREBASE_DATABASE_EMULATOR_HOST",Gi={};let Fd=!1;function Bd(n,e,t,i){const r=e.lastIndexOf(":"),l=e.substring(0,r),a=On(l);n.repoInfo_=new il(e,a,n.repoInfo_.namespace,n.repoInfo_.webSocketOnly,n.repoInfo_.nodeAdmin,n.repoInfo_.persistenceKey,n.repoInfo_.includeNamespaceInQueryParams,!0,t),i&&(n.authTokenProvider_=i)}function Hd(n,e,t,i,r){let l=i||n.options.databaseURL;l===void 0&&(n.options.projectId||Te("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),ee("Using default host for project ",n.options.projectId),l=`${n.options.projectId}-default-rtdb.firebaseio.com`);let a=vo(l,r),u=a.repoInfo,p;typeof process<"u"&&Br&&(p=Br[Ld]),p?(l=`http://${p}?ns=${u.namespace}`,a=vo(l,r),u=a.repoInfo):a.repoInfo.secure;const f=new Cu(n.name,n.options,e);_d("Invalid Firebase Database URL",a),O(a.path)||Te("Database URL must point to the root of a Firebase Database (not including a child path).");const T=jd(u,n,f,new vu(n,t));return new Wd(T,n)}function Ud(n,e){const t=Gi[e];(!t||t[n.key]!==n)&&Te(`Database ${e}(${n.repoInfo_}) has already been deleted.`),Nd(n),delete t[n.key]}function jd(n,e,t,i){let r=Gi[e.name];r||(r={},Gi[e.name]=r);let l=r[n.toURLString()];return l&&Te("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),l=new Sd(n,Fd,t,i),r[n.toURLString()]=l,l}class Wd{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(Td(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new mt(this._repo,F())),this._rootInternal}_delete(){return this._rootInternal!==null&&(Ud(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&Te("Cannot call "+e+" on a deleted database.")}}function jp(n=Bo(),e){const t=xn(n,"database").getImmediate({identifier:e});if(!t._instanceStarted){const i=bo("database");i&&$d(t,...i)}return t}function $d(n,e,t,i={}){n=Pn(n),n._checkNotDeleted("useEmulator");const r=`${e}:${t}`,l=n._repoInternal;if(n._instanceStarted){if(r===n._repoInternal.repoInfo_.host&&Cn(i,l.repoInfo_.emulatorOptions))return;Te("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let a;if(l.repoInfo_.nodeAdmin)i.mockUserToken&&Te('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),a=new mn(mn.OWNER);else if(i.mockUserToken){const u=typeof i.mockUserToken=="string"?i.mockUserToken:oh(i.mockUserToken,n.app.options.projectId);a=new mn(u)}On(e)&&(Ro(e),No("Database",!0)),Bd(l,r,i,a)}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Vd(n){su(bc),Ke(new Le("database",(e,{instanceIdentifier:t})=>{const i=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),l=e.getProvider("app-check-internal");return Hd(i,r,l,t)},"PUBLIC").setMultipleInstances(!0)),Ce(Hr,Ur,n),Ce(Hr,Ur,"esm2020")}we.prototype.simpleListen=function(n,e){this.sendRequest("q",{p:n},e)};we.prototype.echo=function(n,e){this.sendRequest("echo",{d:n},e)};Vd();const ea="@firebase/installations",ys="0.6.19";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const ta=1e4,na=`w:${ys}`,ia="FIS_v2",Gd="https://firebaseinstallations.googleapis.com/v1",qd=3600*1e3,zd="installations",Kd="Installations";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Yd={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},Qe=new Yi(zd,Kd,Yd);function sa(n){return n instanceof pt&&n.code.includes("request-failed")}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ra({projectId:n}){return`${Gd}/projects/${n}/installations`}function oa(n){return{token:n.token,requestStatus:2,expiresIn:Jd(n.expiresIn),creationTime:Date.now()}}async function la(n,e){const i=(await e.json()).error;return Qe.create("request-failed",{requestName:n,serverCode:i.code,serverMessage:i.message,serverStatus:i.status})}function aa({apiKey:n}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":n})}function Xd(n,{refreshToken:e}){const t=aa(n);return t.append("Authorization",Qd(e)),t}async function ha(n){const e=await n();return e.status>=500&&e.status<600?n():e}function Jd(n){return Number(n.replace("s","000"))}function Qd(n){return`${ia} ${n}`}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function Zd({appConfig:n,heartbeatServiceProvider:e},{fid:t}){const i=ra(n),r=aa(n),l=e.getImmediate({optional:!0});if(l){const f=await l.getHeartbeatsHeader();f&&r.append("x-firebase-client",f)}const a={fid:t,authVersion:ia,appId:n.appId,sdkVersion:na},u={method:"POST",headers:r,body:JSON.stringify(a)},p=await ha(()=>fetch(i,u));if(p.ok){const f=await p.json();return{fid:f.fid||t,registrationStatus:2,refreshToken:f.refreshToken,authToken:oa(f.authToken)}}else throw await la("Create Installation",p)}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ca(n){return new Promise(e=>{setTimeout(e,n)})}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ep(n){return btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_")}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const tp=/^[cdef][\w-]{21}$/,qi="";function np(){try{const n=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(n),n[0]=112+n[0]%16;const t=ip(n);return tp.test(t)?t:qi}catch{return qi}}function ip(n){return ep(n).substr(0,22)}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function jn(n){return`${n.appName}!${n.appId}`}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const ua=new Map;function fa(n,e){const t=jn(n);da(t,e),sp(t,e)}function da(n,e){const t=ua.get(n);if(t)for(const i of t)i(e)}function sp(n,e){const t=rp();t&&t.postMessage({key:n,fid:e}),op()}let ze=null;function rp(){return!ze&&"BroadcastChannel"in self&&(ze=new BroadcastChannel("[Firebase] FID Change"),ze.onmessage=n=>{da(n.data.key,n.data.fid)}),ze}function op(){ua.size===0&&ze&&(ze.close(),ze=null)}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const lp="firebase-installations-database",ap=1,Ze="firebase-installations-store";let Ii=null;function vs(){return Ii||(Ii=Lo(lp,ap,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(Ze)}}})),Ii}async function kn(n,e){const t=jn(n),r=(await vs()).transaction(Ze,"readwrite"),l=r.objectStore(Ze),a=await l.get(t);return await l.put(e,t),await r.done,(!a||a.fid!==e.fid)&&fa(n,e.fid),e}async function pa(n){const e=jn(n),i=(await vs()).transaction(Ze,"readwrite");await i.objectStore(Ze).delete(e),await i.done}async function Wn(n,e){const t=jn(n),r=(await vs()).transaction(Ze,"readwrite"),l=r.objectStore(Ze),a=await l.get(t),u=e(a);return u===void 0?await l.delete(t):await l.put(u,t),await r.done,u&&(!a||a.fid!==u.fid)&&fa(n,u.fid),u}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function Cs(n){let e;const t=await Wn(n.appConfig,i=>{const r=hp(i),l=cp(n,r);return e=l.registrationPromise,l.installationEntry});return t.fid===qi?{installationEntry:await e}:{installationEntry:t,registrationPromise:e}}function hp(n){const e=n||{fid:np(),registrationStatus:0};return ga(e)}function cp(n,e){if(e.registrationStatus===0){if(!navigator.onLine){const r=Promise.reject(Qe.create("app-offline"));return{installationEntry:e,registrationPromise:r}}const t={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},i=up(n,t);return{installationEntry:t,registrationPromise:i}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:fp(n)}:{installationEntry:e}}async function up(n,e){try{const t=await Zd(n,e);return kn(n.appConfig,t)}catch(t){throw sa(t)&&t.customData.serverCode===409?await pa(n.appConfig):await kn(n.appConfig,{fid:e.fid,registrationStatus:0}),t}}async function fp(n){let e=await Co(n.appConfig);for(;e.registrationStatus===1;)await ca(100),e=await Co(n.appConfig);if(e.registrationStatus===0){const{installationEntry:t,registrationPromise:i}=await Cs(n);return i||t}return e}function Co(n){return Wn(n,e=>{if(!e)throw Qe.create("installation-not-found");return ga(e)})}function ga(n){return dp(n)?{fid:n.fid,registrationStatus:0}:n}function dp(n){return n.registrationStatus===1&&n.registrationTime+tafetch(i,u));if(p.ok){const f=await p.json();return oa(f)}else throw await la("Generate Auth Token",p)}function gp(n,{fid:e}){return`${ra(n)}/${e}/authTokens:generate`}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function Es(n,e=!1){let t;const i=await Wn(n.appConfig,l=>{if(!_a(l))throw Qe.create("not-registered");const a=l.authToken;if(!e&&yp(a))return l;if(a.requestStatus===1)return t=_p(n,e),l;{if(!navigator.onLine)throw Qe.create("app-offline");const u=Cp(l);return t=mp(n,u),u}});return t?await t:i.authToken}async function _p(n,e){let t=await Eo(n.appConfig);for(;t.authToken.requestStatus===1;)await ca(100),t=await Eo(n.appConfig);const i=t.authToken;return i.requestStatus===0?Es(n,e):i}function Eo(n){return Wn(n,e=>{if(!_a(e))throw Qe.create("not-registered");const t=e.authToken;return Ep(t)?{...e,authToken:{requestStatus:0}}:e})}async function mp(n,e){try{const t=await pp(n,e),i={...e,authToken:t};return await kn(n.appConfig,i),t}catch(t){if(sa(t)&&(t.customData.serverCode===401||t.customData.serverCode===404))await pa(n.appConfig);else{const i={...e,authToken:{requestStatus:0}};await kn(n.appConfig,i)}throw t}}function _a(n){return n!==void 0&&n.registrationStatus===2}function yp(n){return n.requestStatus===2&&!vp(n)}function vp(n){const e=Date.now();return e{const e=n.getProvider("app").getImmediate(),t=Ip(e),i=xn(e,"heartbeat");return{app:e,appConfig:t,heartbeatServiceProvider:i,_delete:()=>Promise.resolve()}},Rp=n=>{const e=n.getProvider("app").getImmediate(),t=xn(e,ma).getImmediate();return{getId:()=>wp(t),getToken:r=>Sp(t,r)}};function Np(){Ke(new Le(ma,Ap,"PUBLIC")),Ke(new Le(bp,Rp,"PRIVATE"))}Np();Ce(ea,ys);Ce(ea,ys,"esm2020");export{Pp as A,Kc as B,Le as C,zc as D,Yi as E,pt as F,Vc as G,Gc as H,Uc as I,Yc as J,qc as K,Mo as L,jc as M,fh as N,dh as O,Hp as P,xp as Q,Ac as R,bc as S,Up as T,iu as U,jp as V,$c as W,Wc as X,Ke as _,ch as a,Op as b,Fo as c,Pn as d,Bp as e,H as f,kp as g,ko as h,Do as i,Ai as j,On as k,xn as l,rh as m,Bo as n,Cn as o,Ro as p,vh as q,Ce as r,Mp as s,Ir as t,No as u,Lp as v,Fp as w,Dp as x,bo as y,oh as z}; diff --git a/assets/vendor-firebase-core-DQ-pMjxd.js b/assets/vendor-firebase-core-DQ-pMjxd.js deleted file mode 100644 index c7cd9b02cb294be64659c5f983b6aa3b08df6bd0..0000000000000000000000000000000000000000 --- a/assets/vendor-firebase-core-DQ-pMjxd.js +++ /dev/null @@ -1,1916 +0,0 @@ -const yc=()=>{};var $r={};/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const $o={NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const A=function(t,e){if(!t)throw Et(e)},Et=function(t){return new Error("Firebase Database ("+$o.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)};/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Vo=function(t){const e=[];let n=0;for(let i=0;i>6|192,e[n++]=r&63|128):(r&64512)===55296&&i+1>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=r&63|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=r&63|128)}return e},vc=function(t){const e=[];let n=0,i=0;for(;n191&&r<224){const l=t[n++];e[i++]=String.fromCharCode((r&31)<<6|l&63)}else if(r>239&&r<365){const l=t[n++],a=t[n++],h=t[n++],f=((r&7)<<18|(l&63)<<12|(a&63)<<6|h&63)-65536;e[i++]=String.fromCharCode(55296+(f>>10)),e[i++]=String.fromCharCode(56320+(f&1023))}else{const l=t[n++],a=t[n++];e[i++]=String.fromCharCode((r&15)<<12|(l&63)<<6|a&63)}}return e.join("")},cs={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r>2,w=(l&3)<<4|h>>4;let I=(h&15)<<2|d>>6,R=d&63;f||(R=64,a||(I=64)),i.push(n[S],n[w],n[I],n[R])}return i.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Vo(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):vc(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r>4;if(i.push(I),d!==64){const R=h<<4&240|d>>2;if(i.push(R),w!==64){const N=d<<6&192|w;i.push(N)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class wc extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Go=function(t){const e=Vo(t);return cs.encodeByteArray(e,!0)},Rn=function(t){return Go(t).replace(/\./g,"")},Ui=function(t){try{return cs.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Cc(t){return qo(void 0,t)}function qo(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const n=e;return new Date(n.getTime());case Object:t===void 0&&(t={});break;case Array:t=[];break;default:return e}for(const n in e)!e.hasOwnProperty(n)||!Ec(n)||(t[n]=qo(t[n],e[n]));return t}function Ec(t){return t!=="__proto__"}/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Sc(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Tc=()=>Sc().__FIREBASE_DEFAULTS__,Ic=()=>{if(typeof process>"u"||typeof $r>"u")return;const t=$r.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},bc=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&Ui(t[1]);return e&&JSON.parse(e)},$n=()=>{try{return yc()||Tc()||Ic()||bc()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},Ac=t=>$n()?.emulatorHosts?.[t],zo=t=>{const e=Ac(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const i=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),i]:[e.substring(0,n),i]},Ko=()=>$n()?.config,gg=t=>$n()?.[`_${t}`];/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Se{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,i)=>{n?this.reject(n):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,i))}}}/** - * @license - * Copyright 2025 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function sn(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Yo(t){return(await fetch(t,{credentials:"include"})).ok}/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Rc(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},i=e||"demo-project",r=t.iat||0,l=t.sub||t.user_id;if(!l)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a={iss:`https://securetoken.google.com/${i}`,aud:i,iat:r,exp:r+3600,auth_time:r,sub:l,user_id:l,firebase:{sign_in_provider:"custom",identities:{}},...t};return[Rn(JSON.stringify(n)),Rn(JSON.stringify(a)),""].join(".")}const zt={};function Nc(){const t={prod:[],emulator:[]};for(const e of Object.keys(zt))zt[e]?t.emulator.push(e):t.prod.push(e);return t}function kc(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let Vr=!1;function Xo(t,e){if(typeof window>"u"||typeof document>"u"||!sn(window.location.host)||zt[t]===e||zt[t]||Vr)return;zt[t]=e;function n(I){return`__firebase__banner__${I}`}const i="__firebase__banner",l=Nc().prod.length>0;function a(){const I=document.getElementById(i);I&&I.remove()}function h(I){I.style.display="flex",I.style.background="#7faaf0",I.style.position="fixed",I.style.bottom="5px",I.style.left="5px",I.style.padding=".5em",I.style.borderRadius="5px",I.style.alignItems="center"}function f(I,R){I.setAttribute("width","24"),I.setAttribute("id",R),I.setAttribute("height","24"),I.setAttribute("viewBox","0 0 24 24"),I.setAttribute("fill","none"),I.style.marginLeft="-6px"}function d(){const I=document.createElement("span");return I.style.cursor="pointer",I.style.marginLeft="16px",I.style.fontSize="24px",I.innerHTML=" ×",I.onclick=()=>{Vr=!0,a()},I}function S(I,R){I.setAttribute("id",R),I.innerText="Learn more",I.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",I.setAttribute("target","__blank"),I.style.paddingLeft="5px",I.style.textDecoration="underline"}function w(){const I=kc(i),R=n("text"),N=document.getElementById(R)||document.createElement("span"),O=n("learnmore"),M=document.getElementById(O)||document.createElement("a"),he=n("preprendIcon"),ee=document.getElementById(he)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(I.created){const te=I.element;h(te),S(M,O);const me=d();f(ee,he),te.append(ee,N,M,me),document.body.appendChild(te)}l?(N.innerText="Preview backend disconnected.",ee.innerHTML=` - - - - - - -`):(ee.innerHTML=` - - - - - - -`,N.innerText="Preview backend running in this workspace."),N.setAttribute("id",R)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",w):w()}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Jo(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Qo(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Jo())}function Dc(){const t=$n()?.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function _g(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function mg(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function Oc(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function yg(){const t=Jo();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function Pc(){return $o.NODE_ADMIN===!0}function vg(){return!Dc()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Mc(){try{return typeof indexedDB=="object"}catch{return!1}}function xc(){return new Promise((t,e)=>{try{let n=!0;const i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(i),t(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{e(r.error?.message||"")}}catch(n){e(n)}})}function wg(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Lc="FirebaseError";class rt extends Error{constructor(e,n,i){super(n),this.code=e,this.customData=i,this.name=Lc,Object.setPrototypeOf(this,rt.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,hs.prototype.create)}}class hs{constructor(e,n,i){this.service=e,this.serviceName=n,this.errors=i}create(e,...n){const i=n[0]||{},r=`${this.service}/${e}`,l=this.errors[e],a=l?Fc(l,i):"Error",h=`${this.serviceName}: ${a} (${r}).`;return new rt(r,h,i)}}function Fc(t,e){return t.replace(Bc,(n,i)=>{const r=e[i];return r!=null?String(r):`<${i}?>`})}const Bc=/\{\$([^}]+)}/g;/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Qt(t){return JSON.parse(t)}function Q(t){return JSON.stringify(t)}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Zo=function(t){let e={},n={},i={},r="";try{const l=t.split(".");e=Qt(Ui(l[0])||""),n=Qt(Ui(l[1])||""),r=l[2],i=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:i,signature:r}},Hc=function(t){const e=Zo(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},Uc=function(t){const e=Zo(t).claims;return typeof e=="object"&&e.admin===!0};/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Ee(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _t(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function ji(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Nn(t,e,n){const i={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=e.call(n,t[r],r,t));return i}function kn(t,e){if(t===e)return!0;const n=Object.keys(t),i=Object.keys(e);for(const r of n){if(!i.includes(r))return!1;const l=t[r],a=e[r];if(Gr(l)&&Gr(a)){if(!kn(l,a))return!1}else if(l!==a)return!1}for(const r of i)if(!n.includes(r))return!1;return!0}function Gr(t){return t!==null&&typeof t=="object"}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function jc(t){const e=[];for(const[n,i]of Object.entries(t))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function Cg(t){const e={};return t.replace(/^\?/,"").split("&").forEach(i=>{if(i){const[r,l]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(l)}}),e}function Eg(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Wc{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e>>31)&4294967295}let r=this.chain_[0],l=this.chain_[1],a=this.chain_[2],h=this.chain_[3],f=this.chain_[4],d,S;for(let w=0;w<80;w++){w<40?w<20?(d=h^l&(a^h),S=1518500249):(d=l^a^h,S=1859775393):w<60?(d=l&a|h&(l|a),S=2400959708):(d=l^a^h,S=3395469782);const I=(r<<5|r>>>27)+d+f+S+i[w]&4294967295;f=h,h=a,a=(l<<30|l>>>2)&4294967295,l=r,r=I}this.chain_[0]=this.chain_[0]+r&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+h&4294967295,this.chain_[4]=this.chain_[4]+f&4294967295}update(e,n){if(e==null)return;n===void 0&&(n=e.length);const i=n-this.blockSize;let r=0;const l=this.buf_;let a=this.inbuf_;for(;r=56;r--)this.buf_[r]=n&255,n/=256;this.compress_(this.buf_);let i=0;for(let r=0;r<5;r++)for(let l=24;l>=0;l-=8)e[i]=this.chain_[r]>>l&255,++i;return e}}function Sg(t,e){const n=new $c(t,e);return n.subscribe.bind(n)}class $c{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,i){let r;if(e===void 0&&n===void 0&&i===void 0)throw new Error("Missing Observer.");Vc(e,["next","error","complete"])?r=e:r={next:e,error:n,complete:i},r.next===void 0&&(r.next=bi),r.error===void 0&&(r.error=bi),r.complete===void 0&&(r.complete=bi);const l=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),l}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Vc(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function bi(){}function mt(t,e){return`${t} failed: ${e} argument `}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Gc=function(t){const e=[];let n=0;for(let i=0;i=55296&&r<=56319){const l=r-55296;i++,A(i>6|192,e[n++]=r&63|128):r<65536?(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=r&63|128):(e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=r&63|128)}return e},Vn=function(t){let e=0;for(let n=0;n=55296&&i<=56319?(e+=4,n++):e+=3}return e};/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const qc=1e3,zc=2,Kc=14400*1e3,Yc=.5;function Tg(t,e=qc,n=zc){const i=e*Math.pow(n,t),r=Math.round(Yc*i*(Math.random()-.5)*2);return Math.min(Kc,i+r)}/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Ne(t){return t&&t._delegate?t._delegate:t}class Ue{constructor(e,n,i){this.name=e,this.instanceFactory=n,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Ke="[DEFAULT]";/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Xc{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const i=new Se;if(this.instancesDeferred.set(n,i),this.isInitialized(n)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:n});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e?.identifier),i=e?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(r){if(i)return null;throw r}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Qc(e))try{this.getOrInitializeService({instanceIdentifier:Ke})}catch{}for(const[n,i]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(n);try{const l=this.getOrInitializeService({instanceIdentifier:r});i.resolve(l)}catch{}}}}clearInstance(e=Ke){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Ke){return this.instances.has(e)}getOptions(e=Ke){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:i,options:n});for(const[l,a]of this.instancesDeferred.entries()){const h=this.normalizeInstanceIdentifier(l);i===h&&a.resolve(r)}return r}onInit(e,n){const i=this.normalizeInstanceIdentifier(n),r=this.onInitCallbacks.get(i)??new Set;r.add(e),this.onInitCallbacks.set(i,r);const l=this.instances.get(i);return l&&e(l,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,n){const i=this.onInitCallbacks.get(n);if(i)for(const r of i)try{r(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:Jc(e),options:n}),this.instances.set(e,i),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=Ke){return this.component?this.component.multipleInstances?e:Ke:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Jc(t){return t===Ke?void 0:t}function Qc(t){return t.instantiationMode==="EAGER"}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Zc{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new Xc(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var U;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(U||(U={}));const eh={debug:U.DEBUG,verbose:U.VERBOSE,info:U.INFO,warn:U.WARN,error:U.ERROR,silent:U.SILENT},th=U.INFO,nh={[U.DEBUG]:"log",[U.VERBOSE]:"log",[U.INFO]:"info",[U.WARN]:"warn",[U.ERROR]:"error"},ih=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let qr,zr;function rh(){return qr||(qr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function oh(){return zr||(zr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const tl=new WeakMap,Wi=new WeakMap,nl=new WeakMap,Ai=new WeakMap,us=new WeakMap;function lh(t){const e=new Promise((n,i)=>{const r=()=>{t.removeEventListener("success",l),t.removeEventListener("error",a)},l=()=>{n(Fe(t.result)),r()},a=()=>{i(t.error),r()};t.addEventListener("success",l),t.addEventListener("error",a)});return e.then(n=>{n instanceof IDBCursor&&tl.set(n,t)}).catch(()=>{}),us.set(e,t),e}function ah(t){if(Wi.has(t))return;const e=new Promise((n,i)=>{const r=()=>{t.removeEventListener("complete",l),t.removeEventListener("error",a),t.removeEventListener("abort",a)},l=()=>{n(),r()},a=()=>{i(t.error||new DOMException("AbortError","AbortError")),r()};t.addEventListener("complete",l),t.addEventListener("error",a),t.addEventListener("abort",a)});Wi.set(t,e)}let $i={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Wi.get(t);if(e==="objectStoreNames")return t.objectStoreNames||nl.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Fe(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function ch(t){$i=t($i)}function hh(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const i=t.call(Ri(this),e,...n);return nl.set(i,e.sort?e.sort():[e]),Fe(i)}:oh().includes(t)?function(...e){return t.apply(Ri(this),e),Fe(tl.get(this))}:function(...e){return Fe(t.apply(Ri(this),e))}}function uh(t){return typeof t=="function"?hh(t):(t instanceof IDBTransaction&&ah(t),sh(t,rh())?new Proxy(t,$i):t)}function Fe(t){if(t instanceof IDBRequest)return lh(t);if(Ai.has(t))return Ai.get(t);const e=uh(t);return e!==t&&(Ai.set(t,e),us.set(e,t)),e}const Ri=t=>us.get(t);function il(t,e,{blocked:n,upgrade:i,blocking:r,terminated:l}={}){const a=indexedDB.open(t,e),h=Fe(a);return i&&a.addEventListener("upgradeneeded",f=>{i(Fe(a.result),f.oldVersion,f.newVersion,Fe(a.transaction),f)}),n&&a.addEventListener("blocked",f=>n(f.oldVersion,f.newVersion,f)),h.then(f=>{l&&f.addEventListener("close",()=>l()),r&&f.addEventListener("versionchange",d=>r(d.oldVersion,d.newVersion,d))}).catch(()=>{}),h}const fh=["get","getKey","getAll","getAllKeys","count"],dh=["put","add","delete","clear"],Ni=new Map;function Kr(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Ni.get(e))return Ni.get(e);const n=e.replace(/FromIndex$/,""),i=e!==n,r=dh.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!(r||fh.includes(n)))return;const l=async function(a,...h){const f=this.transaction(a,r?"readwrite":"readonly");let d=f.store;return i&&(d=d.index(h.shift())),(await Promise.all([d[n](...h),r&&f.done]))[0]};return Ni.set(e,l),l}ch(t=>({...t,get:(e,n,i)=>Kr(e,n)||t.get(e,n,i),has:(e,n)=>!!Kr(e,n)||t.has(e,n)}));/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class ph{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(gh(n)){const i=n.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(n=>n).join(" ")}}function gh(t){return t.getComponent()?.type==="VERSION"}const Vi="@firebase/app",Yr="0.14.8";/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const be=new el("@firebase/app"),_h="@firebase/app-compat",mh="@firebase/analytics-compat",yh="@firebase/analytics",vh="@firebase/app-check-compat",wh="@firebase/app-check",Ch="@firebase/auth",Eh="@firebase/auth-compat",Sh="@firebase/database",Th="@firebase/data-connect",Ih="@firebase/database-compat",bh="@firebase/functions",Ah="@firebase/functions-compat",Rh="@firebase/installations",Nh="@firebase/installations-compat",kh="@firebase/messaging",Dh="@firebase/messaging-compat",Oh="@firebase/performance",Ph="@firebase/performance-compat",Mh="@firebase/remote-config",xh="@firebase/remote-config-compat",Lh="@firebase/storage",Fh="@firebase/storage-compat",Bh="@firebase/firestore",Hh="@firebase/ai",Uh="@firebase/firestore-compat",jh="firebase",Wh="12.9.0";/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Gi="[DEFAULT]",$h={[Vi]:"fire-core",[_h]:"fire-core-compat",[yh]:"fire-analytics",[mh]:"fire-analytics-compat",[wh]:"fire-app-check",[vh]:"fire-app-check-compat",[Ch]:"fire-auth",[Eh]:"fire-auth-compat",[Sh]:"fire-rtdb",[Th]:"fire-data-connect",[Ih]:"fire-rtdb-compat",[bh]:"fire-fn",[Ah]:"fire-fn-compat",[Rh]:"fire-iid",[Nh]:"fire-iid-compat",[kh]:"fire-fcm",[Dh]:"fire-fcm-compat",[Oh]:"fire-perf",[Ph]:"fire-perf-compat",[Mh]:"fire-rc",[xh]:"fire-rc-compat",[Lh]:"fire-gcs",[Fh]:"fire-gcs-compat",[Bh]:"fire-fst",[Uh]:"fire-fst-compat",[Hh]:"fire-vertex","fire-js":"fire-js",[jh]:"fire-js-all"};/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Dn=new Map,Vh=new Map,qi=new Map;function Xr(t,e){try{t.container.addComponent(e)}catch(n){be.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Ze(t){const e=t.name;if(qi.has(e))return be.debug(`There were multiple attempts to register component ${e}.`),!1;qi.set(e,t);for(const n of Dn.values())Xr(n,t);for(const n of Vh.values())Xr(n,t);return!0}function Gn(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function sl(t){return t==null?!1:t.settings!==void 0}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Gh={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Be=new hs("app","Firebase",Gh);/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class qh{constructor(e,n,i){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new Ue("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Be.create("app-deleted",{appName:this._name})}}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const zh=Wh;function Kh(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const i={name:Gi,automaticDataCollectionEnabled:!0,...e},r=i.name;if(typeof r!="string"||!r)throw Be.create("bad-app-name",{appName:String(r)});if(n||(n=Ko()),!n)throw Be.create("no-options");const l=Dn.get(r);if(l){if(kn(n,l.options)&&kn(i,l.config))return l;throw Be.create("duplicate-app",{appName:r})}const a=new Zc(r);for(const f of qi.values())a.addComponent(f);const h=new qh(n,i,a);return Dn.set(r,h),h}function rl(t=Gi){const e=Dn.get(t);if(!e&&t===Gi&&Ko())return Kh();if(!e)throw Be.create("no-app",{appName:t});return e}function Ce(t,e,n){let i=$h[t]??t;n&&(i+=`-${n}`);const r=i.match(/\s|\//),l=e.match(/\s|\//);if(r||l){const a=[`Unable to register library "${i}" with version "${e}":`];r&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),r&&l&&a.push("and"),l&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),be.warn(a.join(" "));return}Ze(new Ue(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Yh="firebase-heartbeat-database",Xh=1,Zt="firebase-heartbeat-store";let ki=null;function ol(){return ki||(ki=il(Yh,Xh,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(Zt)}catch(n){console.warn(n)}}}}).catch(t=>{throw Be.create("idb-open",{originalErrorMessage:t.message})})),ki}async function Jh(t){try{const n=(await ol()).transaction(Zt),i=await n.objectStore(Zt).get(ll(t));return await n.done,i}catch(e){if(e instanceof rt)be.warn(e.message);else{const n=Be.create("idb-get",{originalErrorMessage:e?.message});be.warn(n.message)}}}async function Jr(t,e){try{const i=(await ol()).transaction(Zt,"readwrite");await i.objectStore(Zt).put(e,ll(t)),await i.done}catch(n){if(n instanceof rt)be.warn(n.message);else{const i=Be.create("idb-set",{originalErrorMessage:n?.message});be.warn(i.message)}}}function ll(t){return`${t.name}!${t.options.appId}`}/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Qh=1024,Zh=30;class eu{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new nu(n),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}async triggerHeartbeat(){try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=Qr();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(r=>r.date===i))return;if(this._heartbeatsCache.heartbeats.push({date:i,agent:n}),this._heartbeatsCache.heartbeats.length>Zh){const r=iu(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(r,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){be.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const e=Qr(),{heartbeatsToSend:n,unsentEntries:i}=tu(this._heartbeatsCache.heartbeats),r=Rn(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=e,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(e){return be.warn(e),""}}}function Qr(){return new Date().toISOString().substring(0,10)}function tu(t,e=Qh){const n=[];let i=t.slice();for(const r of t){const l=n.find(a=>a.agent===r.agent);if(l){if(l.dates.push(r.date),Zr(n)>e){l.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),Zr(n)>e){n.pop();break}i=i.slice(1)}return{heartbeatsToSend:n,unsentEntries:i}}class nu{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Mc()?xc().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await Jh(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const i=await this.read();return Jr(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const i=await this.read();return Jr(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Zr(t){return Rn(JSON.stringify({version:2,heartbeats:t})).length}function iu(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let i=1;inew ph(e),"PRIVATE")),Ze(new Ue("heartbeat",e=>new eu(e),"PRIVATE")),Ce(Vi,Yr,t),Ce(Vi,Yr,"esm2020"),Ce("fire-js","")}su("");var ru="firebase",ou="12.9.0";/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */Ce(ru,ou,"app");var eo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license -Copyright The Closure Library Authors. -SPDX-License-Identifier: Apache-2.0 -*/var lu,au;(function(){var t;/** @license - - Copyright The Closure Library Authors. - SPDX-License-Identifier: Apache-2.0 -*/function e(y,p){function _(){}_.prototype=p.prototype,y.F=p.prototype,y.prototype=new _,y.prototype.constructor=y,y.D=function(v,m,E){for(var g=Array(arguments.length-2),re=2;re>>25),g=E+(m^p&(_^m))+v[1]+3905402710&4294967295,E=p+(g<<12&4294967295|g>>>20),g=m+(_^E&(p^_))+v[2]+606105819&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(p^m&(E^p))+v[3]+3250441966&4294967295,_=m+(g<<22&4294967295|g>>>10),g=p+(E^_&(m^E))+v[4]+4118548399&4294967295,p=_+(g<<7&4294967295|g>>>25),g=E+(m^p&(_^m))+v[5]+1200080426&4294967295,E=p+(g<<12&4294967295|g>>>20),g=m+(_^E&(p^_))+v[6]+2821735955&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(p^m&(E^p))+v[7]+4249261313&4294967295,_=m+(g<<22&4294967295|g>>>10),g=p+(E^_&(m^E))+v[8]+1770035416&4294967295,p=_+(g<<7&4294967295|g>>>25),g=E+(m^p&(_^m))+v[9]+2336552879&4294967295,E=p+(g<<12&4294967295|g>>>20),g=m+(_^E&(p^_))+v[10]+4294925233&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(p^m&(E^p))+v[11]+2304563134&4294967295,_=m+(g<<22&4294967295|g>>>10),g=p+(E^_&(m^E))+v[12]+1804603682&4294967295,p=_+(g<<7&4294967295|g>>>25),g=E+(m^p&(_^m))+v[13]+4254626195&4294967295,E=p+(g<<12&4294967295|g>>>20),g=m+(_^E&(p^_))+v[14]+2792965006&4294967295,m=E+(g<<17&4294967295|g>>>15),g=_+(p^m&(E^p))+v[15]+1236535329&4294967295,_=m+(g<<22&4294967295|g>>>10),g=p+(m^E&(_^m))+v[1]+4129170786&4294967295,p=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(p^_))+v[6]+3225465664&4294967295,E=p+(g<<9&4294967295|g>>>23),g=m+(p^_&(E^p))+v[11]+643717713&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^p&(m^E))+v[0]+3921069994&4294967295,_=m+(g<<20&4294967295|g>>>12),g=p+(m^E&(_^m))+v[5]+3593408605&4294967295,p=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(p^_))+v[10]+38016083&4294967295,E=p+(g<<9&4294967295|g>>>23),g=m+(p^_&(E^p))+v[15]+3634488961&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^p&(m^E))+v[4]+3889429448&4294967295,_=m+(g<<20&4294967295|g>>>12),g=p+(m^E&(_^m))+v[9]+568446438&4294967295,p=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(p^_))+v[14]+3275163606&4294967295,E=p+(g<<9&4294967295|g>>>23),g=m+(p^_&(E^p))+v[3]+4107603335&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^p&(m^E))+v[8]+1163531501&4294967295,_=m+(g<<20&4294967295|g>>>12),g=p+(m^E&(_^m))+v[13]+2850285829&4294967295,p=_+(g<<5&4294967295|g>>>27),g=E+(_^m&(p^_))+v[2]+4243563512&4294967295,E=p+(g<<9&4294967295|g>>>23),g=m+(p^_&(E^p))+v[7]+1735328473&4294967295,m=E+(g<<14&4294967295|g>>>18),g=_+(E^p&(m^E))+v[12]+2368359562&4294967295,_=m+(g<<20&4294967295|g>>>12),g=p+(_^m^E)+v[5]+4294588738&4294967295,p=_+(g<<4&4294967295|g>>>28),g=E+(p^_^m)+v[8]+2272392833&4294967295,E=p+(g<<11&4294967295|g>>>21),g=m+(E^p^_)+v[11]+1839030562&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^p)+v[14]+4259657740&4294967295,_=m+(g<<23&4294967295|g>>>9),g=p+(_^m^E)+v[1]+2763975236&4294967295,p=_+(g<<4&4294967295|g>>>28),g=E+(p^_^m)+v[4]+1272893353&4294967295,E=p+(g<<11&4294967295|g>>>21),g=m+(E^p^_)+v[7]+4139469664&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^p)+v[10]+3200236656&4294967295,_=m+(g<<23&4294967295|g>>>9),g=p+(_^m^E)+v[13]+681279174&4294967295,p=_+(g<<4&4294967295|g>>>28),g=E+(p^_^m)+v[0]+3936430074&4294967295,E=p+(g<<11&4294967295|g>>>21),g=m+(E^p^_)+v[3]+3572445317&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^p)+v[6]+76029189&4294967295,_=m+(g<<23&4294967295|g>>>9),g=p+(_^m^E)+v[9]+3654602809&4294967295,p=_+(g<<4&4294967295|g>>>28),g=E+(p^_^m)+v[12]+3873151461&4294967295,E=p+(g<<11&4294967295|g>>>21),g=m+(E^p^_)+v[15]+530742520&4294967295,m=E+(g<<16&4294967295|g>>>16),g=_+(m^E^p)+v[2]+3299628645&4294967295,_=m+(g<<23&4294967295|g>>>9),g=p+(m^(_|~E))+v[0]+4096336452&4294967295,p=_+(g<<6&4294967295|g>>>26),g=E+(_^(p|~m))+v[7]+1126891415&4294967295,E=p+(g<<10&4294967295|g>>>22),g=m+(p^(E|~_))+v[14]+2878612391&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~p))+v[5]+4237533241&4294967295,_=m+(g<<21&4294967295|g>>>11),g=p+(m^(_|~E))+v[12]+1700485571&4294967295,p=_+(g<<6&4294967295|g>>>26),g=E+(_^(p|~m))+v[3]+2399980690&4294967295,E=p+(g<<10&4294967295|g>>>22),g=m+(p^(E|~_))+v[10]+4293915773&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~p))+v[1]+2240044497&4294967295,_=m+(g<<21&4294967295|g>>>11),g=p+(m^(_|~E))+v[8]+1873313359&4294967295,p=_+(g<<6&4294967295|g>>>26),g=E+(_^(p|~m))+v[15]+4264355552&4294967295,E=p+(g<<10&4294967295|g>>>22),g=m+(p^(E|~_))+v[6]+2734768916&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~p))+v[13]+1309151649&4294967295,_=m+(g<<21&4294967295|g>>>11),g=p+(m^(_|~E))+v[4]+4149444226&4294967295,p=_+(g<<6&4294967295|g>>>26),g=E+(_^(p|~m))+v[11]+3174756917&4294967295,E=p+(g<<10&4294967295|g>>>22),g=m+(p^(E|~_))+v[2]+718787259&4294967295,m=E+(g<<15&4294967295|g>>>17),g=_+(E^(m|~p))+v[9]+3951481745&4294967295,y.g[0]=y.g[0]+p&4294967295,y.g[1]=y.g[1]+(m+(g<<21&4294967295|g>>>11))&4294967295,y.g[2]=y.g[2]+m&4294967295,y.g[3]=y.g[3]+E&4294967295}i.prototype.v=function(y,p){p===void 0&&(p=y.length);const _=p-this.blockSize,v=this.C;let m=this.h,E=0;for(;E>>v&255;return y};function l(y,p){var _=h;return Object.prototype.hasOwnProperty.call(_,y)?_[y]:_[y]=p(y)}function a(y,p){this.h=p;const _=[];let v=!0;for(let m=y.length-1;m>=0;m--){const E=y[m]|0;v&&E==p||(_[m]=E,v=!1)}this.g=_}var h={};function f(y){return-128<=y&&y<128?l(y,function(p){return new a([p|0],p<0?-1:0)}):new a([y|0],y<0?-1:0)}function d(y){if(isNaN(y)||!isFinite(y))return w;if(y<0)return M(d(-y));const p=[];let _=1;for(let v=0;y>=_;v++)p[v]=y/_|0,_*=4294967296;return new a(p,0)}function S(y,p){if(y.length==0)throw Error("number format error: empty string");if(p=p||10,p<2||36=0)throw Error('number format error: interior "-" character');const _=d(Math.pow(p,8));let v=w;for(let E=0;E=0?v:4294967296+v)*p,p*=4294967296}return y},t.toString=function(y){if(y=y||10,y<2||360?_.g[0]:_.h)>>>0).toString(y);if(_=m,N(_))return E+v;for(;E.length<6;)E="0"+E;v=E+v}},t.i=function(y){return y<0?0:y>>16)+(this.i(m)>>>16)+(y.i(m)>>>16);v=g>>>16,E&=65535,g&=65535,_[m]=g<<16|E}return new a(_,_[_.length-1]&-2147483648?-1:0)};function he(y,p){return y.add(M(p))}t.j=function(y){if(N(this)||N(y))return w;if(O(this))return O(y)?M(this).j(M(y)):M(M(this).j(y));if(O(y))return M(this.j(M(y)));if(this.l(R)<0&&y.l(R)<0)return d(this.m()*y.m());const p=this.g.length+y.g.length,_=[];for(var v=0;v<2*p;v++)_[v]=0;for(v=0;v>>16,g=this.i(v)&65535,re=y.i(m)>>>16,We=y.i(m)&65535;_[2*v+2*m]+=g*We,ee(_,2*v+2*m),_[2*v+2*m+1]+=E*We,ee(_,2*v+2*m+1),_[2*v+2*m+1]+=g*re,ee(_,2*v+2*m+1),_[2*v+2*m+2]+=E*re,ee(_,2*v+2*m+2)}for(y=0;y>>16,y[p]&=65535,p++}function te(y,p){this.g=y,this.h=p}function me(y,p){if(N(p))throw Error("division by zero");if(N(y))return new te(w,w);if(O(y))return p=me(M(y),p),new te(M(p.g),M(p.h));if(O(p))return p=me(y,M(p)),new te(M(p.g),p.h);if(y.g.length>30){if(O(y)||O(p))throw Error("slowDivide_ only works with positive integers.");for(var _=I,v=p;v.l(y)<=0;)_=ke(_),v=ke(v);var m=fe(_,1),E=fe(v,1);for(v=fe(v,2),_=fe(_,2);!N(v);){var g=E.add(v);g.l(y)<=0&&(m=m.add(_),E=g),v=fe(v,1),_=fe(_,1)}return p=he(y,m.j(p)),new te(m,p)}for(m=w;y.l(p)>=0;){for(_=Math.max(1,Math.floor(y.m()/p.m())),v=Math.ceil(Math.log(_)/Math.LN2),v=v<=48?1:Math.pow(2,v-48),E=d(_),g=E.j(p);O(g)||g.l(y)>0;)_-=v,E=d(_),g=E.j(p);N(E)&&(E=I),m=m.add(E),y=he(y,g)}return new te(m,y)}t.B=function(y){return me(this,y).h},t.and=function(y){const p=Math.max(this.g.length,y.g.length),_=[];for(let v=0;v>>31;return new a(_,y.h)}function fe(y,p){const _=p>>5;p%=32;const v=y.g.length-_,m=[];for(let E=0;E0?y.i(E+_)>>>p|y.i(E+_+1)<<32-p:y.i(E+_);return new a(m,y.h)}i.prototype.digest=i.prototype.A,i.prototype.reset=i.prototype.u,i.prototype.update=i.prototype.v,au=i,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.B,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=d,a.fromString=S,lu=a}).apply(typeof eo<"u"?eo:typeof self<"u"?self:typeof window<"u"?window:{});var Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license -Copyright The Closure Library Authors. -SPDX-License-Identifier: Apache-2.0 -*/var cu,hu,uu,fu,du,pu,gu,_u;(function(){var t,e=Object.defineProperty;function n(s){s=[typeof globalThis=="object"&&globalThis,s,typeof window=="object"&&window,typeof self=="object"&&self,typeof Tn=="object"&&Tn];for(var o=0;os&&AsyncContext.Snapshot.wrap(s):s=>s;function R(s){const o=s.length;if(o>0){const c=Array(o);for(let u=0;u0?(this.h--,o=this.g,this.g=o.next,o.next=null):o=this.i(),o}}function M(s){a.setTimeout(()=>{throw s},0)}function he(){var s=y;let o=null;return s.g&&(o=s.g,s.g=s.g.next,s.g||(s.h=null),o.next=null),o}class ee{constructor(){this.h=this.g=null}add(o,c){const u=te.get();u.set(o,c),this.h?this.h.next=u:this.g=u,this.h=u}}var te=new O(()=>new me,s=>s.reset());class me{constructor(){this.next=this.g=this.h=null}set(o,c){this.h=o,this.g=c,this.next=null}reset(){this.next=this.g=this.h=null}}let ke,fe=!1,y=new ee,p=()=>{const s=Promise.resolve(void 0);ke=()=>{s.then(_)}};function _(){for(var s;s=he();){try{s.h.call(s.g)}catch(c){M(c)}var o=te;o.j(s),o.h<100&&(o.h++,s.next=o.g,o.g=s)}fe=!1}function v(){this.u=this.u,this.C=this.C}v.prototype.u=!1,v.prototype.dispose=function(){this.u||(this.u=!0,this.N())},v.prototype[Symbol.dispose]=function(){this.dispose()},v.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function m(s,o){this.type=s,this.g=this.target=o,this.defaultPrevented=!1}m.prototype.h=function(){this.defaultPrevented=!0};var E=(function(){if(!a.addEventListener||!Object.defineProperty)return!1;var s=!1,o=Object.defineProperty({},"passive",{get:function(){s=!0}});try{const c=()=>{};a.addEventListener("test",c,o),a.removeEventListener("test",c,o)}catch{}return s})();function g(s){return/^[\s\xa0]*$/.test(s)}function re(s,o){m.call(this,s?s.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,s&&this.init(s,o)}w(re,m),re.prototype.init=function(s,o){const c=this.type=s.type,u=s.changedTouches&&s.changedTouches.length?s.changedTouches[0]:null;this.target=s.target||s.srcElement,this.g=o,o=s.relatedTarget,o||(c=="mouseover"?o=s.fromElement:c=="mouseout"&&(o=s.toElement)),this.relatedTarget=o,u?(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0):(this.clientX=s.clientX!==void 0?s.clientX:s.pageX,this.clientY=s.clientY!==void 0?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0),this.button=s.button,this.key=s.key||"",this.ctrlKey=s.ctrlKey,this.altKey=s.altKey,this.shiftKey=s.shiftKey,this.metaKey=s.metaKey,this.pointerId=s.pointerId||0,this.pointerType=s.pointerType,this.state=s.state,this.i=s,s.defaultPrevented&&re.Z.h.call(this)},re.prototype.h=function(){re.Z.h.call(this);const s=this.i;s.preventDefault?s.preventDefault():s.returnValue=!1};var We="closure_listenable_"+(Math.random()*1e6|0),Ua=0;function ja(s,o,c,u,C){this.listener=s,this.proxy=null,this.src=o,this.type=c,this.capture=!!u,this.ha=C,this.key=++Ua,this.da=this.fa=!1}function cn(s){s.da=!0,s.listener=null,s.proxy=null,s.src=null,s.ha=null}function hn(s,o,c){for(const u in s)o.call(c,s[u],u,s)}function Wa(s,o){for(const c in s)o.call(void 0,s[c],c,s)}function Ws(s){const o={};for(const c in s)o[c]=s[c];return o}const $s="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Vs(s,o){let c,u;for(let C=1;C-1?(o=s[b],c||(o.fa=!1)):(o=new ja(o,this.src,T,!!u,C),o.fa=c,s.push(o)),o};function ni(s,o){const c=o.type;if(c in s.g){var u=s.g[c],C=Array.prototype.indexOf.call(u,o,void 0),T;(T=C>=0)&&Array.prototype.splice.call(u,C,1),T&&(cn(o),s.g[c].length==0&&(delete s.g[c],s.h--))}}function ii(s,o,c,u){for(let C=0;C-1&&(cn(o[c]),Array.prototype.splice.call(o,c,1),o.length==0&&(delete s.g[T],s.h--)))):s&&(s=li(s))&&(o=s.g[o.toString()],s=-1,o&&(s=ii(o,c,u,C)),(c=s>-1?o[s]:null)&&oi(c))}function oi(s){if(typeof s!="number"&&s&&!s.da){var o=s.src;if(o&&o[We])ni(o.i,s);else{var c=s.type,u=s.proxy;o.removeEventListener?o.removeEventListener(c,u,s.capture):o.detachEvent?o.detachEvent(zs(c),u):o.addListener&&o.removeListener&&o.removeListener(u),(c=li(o))?(ni(c,s),c.h==0&&(c.src=null,o[si]=null)):cn(s)}}}function zs(s){return s in ri?ri[s]:ri[s]="on"+s}function Ga(s,o){if(s.da)s=!0;else{o=new re(o,this);const c=s.listener,u=s.ha||s.src;s.fa&&oi(s),s=c.call(u,o)}return s}function li(s){return s=s[si],s instanceof un?s:null}var ai="__closure_events_fn_"+(Math.random()*1e9>>>0);function Ks(s){return typeof s=="function"?s:(s[ai]||(s[ai]=function(o){return s.handleEvent(o)}),s[ai])}function ne(){v.call(this),this.i=new un(this),this.M=this,this.G=null}w(ne,v),ne.prototype[We]=!0,ne.prototype.removeEventListener=function(s,o,c,u){qs(this,s,o,c,u)};function ie(s,o){var c,u=s.G;if(u)for(c=[];u;u=u.G)c.push(u);if(s=s.M,u=o.type||o,typeof o=="string")o=new m(o,s);else if(o instanceof m)o.target=o.target||s;else{var C=o;o=new m(u,s),Vs(o,C)}C=!0;let T,b;if(c)for(b=c.length-1;b>=0;b--)T=o.g=c[b],C=fn(T,u,!0,o)&&C;if(T=o.g=s,C=fn(T,u,!0,o)&&C,C=fn(T,u,!1,o)&&C,c)for(b=0;b2147483647?-1:a.setTimeout(s,o||0)}function Ys(s){s.g=qa(()=>{s.g=null,s.i&&(s.i=!1,Ys(s))},s.l);const o=s.h;s.h=null,s.m.apply(null,o)}class za extends v{constructor(o,c){super(),this.m=o,this.l=c,this.h=null,this.i=!1,this.g=null}j(o){this.h=arguments,this.g?this.i=!0:Ys(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function bt(s){v.call(this),this.h=s,this.g={}}w(bt,v);var Xs=[];function Js(s){hn(s.g,function(o,c){this.g.hasOwnProperty(c)&&oi(o)},s),s.g={}}bt.prototype.N=function(){bt.Z.N.call(this),Js(this)},bt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var ci=a.JSON.stringify,Ka=a.JSON.parse,Ya=class{stringify(s){return a.JSON.stringify(s,void 0)}parse(s){return a.JSON.parse(s,void 0)}};function Qs(){}function Zs(){}var At={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function hi(){m.call(this,"d")}w(hi,m);function ui(){m.call(this,"c")}w(ui,m);var $e={},er=null;function dn(){return er=er||new ne}$e.Ia="serverreachability";function tr(s){m.call(this,$e.Ia,s)}w(tr,m);function Rt(s){const o=dn();ie(o,new tr(o))}$e.STAT_EVENT="statevent";function nr(s,o){m.call(this,$e.STAT_EVENT,s),this.stat=o}w(nr,m);function se(s){const o=dn();ie(o,new nr(o,s))}$e.Ja="timingevent";function ir(s,o){m.call(this,$e.Ja,s),this.size=o}w(ir,m);function Nt(s,o){if(typeof s!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){s()},o)}function kt(){this.g=!0}kt.prototype.ua=function(){this.g=!1};function Xa(s,o,c,u,C,T){s.info(function(){if(s.g)if(T){var b="",k=T.split("&");for(let B=0;B1){const K=z[0];z=z[1];const ve=K.split("_");b=ve.length>=2&&ve[1]=="type"?b+(K+"="+z+"&"):b+(K+"=redacted&")}}}else b=null;else b=T;return"XMLHTTP REQ ("+u+") [attempt "+C+"]: "+o+` -`+c+` -`+b})}function Ja(s,o,c,u,C,T,b){s.info(function(){return"XMLHTTP RESP ("+u+") [ attempt "+C+"]: "+o+` -`+c+` -`+T+" "+b})}function ct(s,o,c,u){s.info(function(){return"XMLHTTP TEXT ("+o+"): "+Za(s,c)+(u?" "+u:"")})}function Qa(s,o){s.info(function(){return"TIMEOUT: "+o})}kt.prototype.info=function(){};function Za(s,o){if(!s.g)return o;if(!o)return null;try{const T=JSON.parse(o);if(T){for(s=0;s0&&s.length;)c.push(s.shift()),o--;return s.length&&c.push(s.join(":")),c}function De(s,o,c,u){this.j=s,this.i=o,this.l=c,this.S=u||1,this.V=new bt(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new or}function or(){this.i=null,this.g="",this.h=!1}var lr={},di={};function pi(s,o,c){s.M=1,s.A=_n(ye(o)),s.u=c,s.R=!0,ar(s,null)}function ar(s,o){s.F=Date.now(),gn(s),s.B=ye(s.A);var c=s.B,u=s.S;Array.isArray(u)||(u=[String(u)]),Cr(c.i,"t",u),s.C=0,c=s.j.L,s.h=new or,s.g=Hr(s.j,c?o:null,!s.u),s.P>0&&(s.O=new za(d(s.Y,s,s.g),s.P)),o=s.V,c=s.g,u=s.ba;var C="readystatechange";Array.isArray(C)||(C&&(Xs[0]=C.toString()),C=Xs);for(let T=0;T0&&!this.W){this.W=!0;var b=this.j;b.g==this&&b.aa&&!b.P&&(b.j.info("Great, no buffering proxy detected. Bytes received: "+c.length),Ti(b),b.P=!0,se(11))}}else ct(this.i,this.l,c,null),_i(this,c);k==4&&Ve(this),this.o&&!this.K&&(k==4?xr(this.j,this):(this.o=!1,gn(this)))}else _c(this.g),o==400&&c.indexOf("Unknown SID")>0?(this.m=3,se(12)):(this.m=0,se(13)),Ve(this),Ot(this)}}}catch{}finally{}};function tc(s){if(!cr(s))return s.g.la();const o=Rr(s.g);if(o==="")return"";let c="";const u=o.length,C=Me(s.g)==4;if(!s.h.i){if(typeof TextDecoder>"u")return Ve(s),Ot(s),"";s.h.i=new a.TextDecoder}for(let T=0;To.length?di:(o=o.slice(u,u+c),s.C=u+c,o)))}De.prototype.cancel=function(){this.K=!0,Ve(this)};function gn(s){s.T=Date.now()+s.H,hr(s,s.H)}function hr(s,o){if(s.D!=null)throw Error("WatchDog timer not null");s.D=Nt(d(s.aa,s),o)}function gi(s){s.D&&(a.clearTimeout(s.D),s.D=null)}De.prototype.aa=function(){this.D=null;const s=Date.now();s-this.T>=0?(Qa(this.i,this.B),this.M!=2&&(Rt(),se(17)),Ve(this),this.m=2,Ot(this)):hr(this,this.T-s)};function Ot(s){s.j.I==0||s.K||xr(s.j,s)}function Ve(s){gi(s);var o=s.O;o&&typeof o.dispose=="function"&&o.dispose(),s.O=null,Js(s.V),s.g&&(o=s.g,s.g=null,o.abort(),o.dispose())}function _i(s,o){try{var c=s.j;if(c.I!=0&&(c.g==s||mi(c.h,s))){if(!s.L&&mi(c.h,s)&&c.I==3){try{var u=c.Ba.g.parse(o)}catch{u=null}if(Array.isArray(u)&&u.length==3){var C=u;if(C[0]==0){e:if(!c.v){if(c.g)if(c.g.F+3e30&&(u=1.5*xe,c.O=u,c.j.info("backChannelRequestTimeoutMs_="+u)),u=c;const Le=s.g;if(Le){const Sn=Le.g?Le.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Sn){var T=u.h;T.g||Sn.indexOf("spdy")==-1&&Sn.indexOf("quic")==-1&&Sn.indexOf("h2")==-1||(T.j=T.l,T.g=new Set,T.h&&(yi(T,T.h),T.h=null))}if(u.G){const Ii=Le.g?Le.g.getResponseHeader("X-HTTP-Session-Id"):null;Ii&&(u.wa=Ii,W(u.J,u.G,Ii))}}c.I=3,c.l&&c.l.ra(),c.aa&&(c.T=Date.now()-s.F,c.j.info("Handshake RTT: "+c.T+"ms")),u=c;var b=s;if(u.na=Br(u,u.L?u.ba:null,u.W),b.L){pr(u.h,b);var k=b,z=u.O;z&&(k.H=z),k.D&&(gi(k),gn(k)),u.g=b}else Pr(u);c.i.length>0&&wn(c)}else B[0]!="stop"&&B[0]!="close"||qe(c,7);else c.I==3&&(B[0]=="stop"||B[0]=="close"?B[0]=="stop"?qe(c,7):Ei(c):B[0]!="noop"&&c.l&&c.l.qa(B),c.A=0)}}Rt(4)}catch{}}var ic=class{constructor(s,o){this.g=s,this.map=o}};function ur(s){this.l=s||10,a.PerformanceNavigationTiming?(s=a.performance.getEntriesByType("navigation"),s=s.length>0&&(s[0].nextHopProtocol=="hq"||s[0].nextHopProtocol=="h2")):s=!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=s?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function fr(s){return s.h?!0:s.g?s.g.size>=s.j:!1}function dr(s){return s.h?1:s.g?s.g.size:0}function mi(s,o){return s.h?s.h==o:s.g?s.g.has(o):!1}function yi(s,o){s.g?s.g.add(o):s.h=o}function pr(s,o){s.h&&s.h==o?s.h=null:s.g&&s.g.has(o)&&s.g.delete(o)}ur.prototype.cancel=function(){if(this.i=gr(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const s of this.g.values())s.cancel();this.g.clear()}};function gr(s){if(s.h!=null)return s.i.concat(s.h.G);if(s.g!=null&&s.g.size!==0){let o=s.i;for(const c of s.g.values())o=o.concat(c.G);return o}return R(s.i)}var _r=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function sc(s,o){if(s){s=s.split("&");for(let c=0;c=0?(C=s[c].substring(0,u),T=s[c].substring(u+1)):C=s[c],o(C,T?decodeURIComponent(T.replace(/\+/g," ")):"")}}}function Oe(s){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let o;s instanceof Oe?(this.l=s.l,Pt(this,s.j),this.o=s.o,this.g=s.g,Mt(this,s.u),this.h=s.h,vi(this,Er(s.i)),this.m=s.m):s&&(o=String(s).match(_r))?(this.l=!1,Pt(this,o[1]||"",!0),this.o=xt(o[2]||""),this.g=xt(o[3]||"",!0),Mt(this,o[4]),this.h=xt(o[5]||"",!0),vi(this,o[6]||"",!0),this.m=xt(o[7]||"")):(this.l=!1,this.i=new Ft(null,this.l))}Oe.prototype.toString=function(){const s=[];var o=this.j;o&&s.push(Lt(o,mr,!0),":");var c=this.g;return(c||o=="file")&&(s.push("//"),(o=this.o)&&s.push(Lt(o,mr,!0),"@"),s.push(Dt(c).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.u,c!=null&&s.push(":",String(c))),(c=this.h)&&(this.g&&c.charAt(0)!="/"&&s.push("/"),s.push(Lt(c,c.charAt(0)=="/"?lc:oc,!0))),(c=this.i.toString())&&s.push("?",c),(c=this.m)&&s.push("#",Lt(c,cc)),s.join("")},Oe.prototype.resolve=function(s){const o=ye(this);let c=!!s.j;c?Pt(o,s.j):c=!!s.o,c?o.o=s.o:c=!!s.g,c?o.g=s.g:c=s.u!=null;var u=s.h;if(c)Mt(o,s.u);else if(c=!!s.h){if(u.charAt(0)!="/")if(this.g&&!this.h)u="/"+u;else{var C=o.h.lastIndexOf("/");C!=-1&&(u=o.h.slice(0,C+1)+u)}if(C=u,C==".."||C==".")u="";else if(C.indexOf("./")!=-1||C.indexOf("/.")!=-1){u=C.lastIndexOf("/",0)==0,C=C.split("/");const T=[];for(let b=0;b1||T.length==1&&T[0]!="")&&T.pop(),u&&b==C.length&&T.push("")):(T.push(k),u=!0)}u=T.join("/")}else u=C}return c?o.h=u:c=s.i.toString()!=="",c?vi(o,Er(s.i)):c=!!s.m,c&&(o.m=s.m),o};function ye(s){return new Oe(s)}function Pt(s,o,c){s.j=c?xt(o,!0):o,s.j&&(s.j=s.j.replace(/:$/,""))}function Mt(s,o){if(o){if(o=Number(o),isNaN(o)||o<0)throw Error("Bad port number "+o);s.u=o}else s.u=null}function vi(s,o,c){o instanceof Ft?(s.i=o,hc(s.i,s.l)):(c||(o=Lt(o,ac)),s.i=new Ft(o,s.l))}function W(s,o,c){s.i.set(o,c)}function _n(s){return W(s,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),s}function xt(s,o){return s?o?decodeURI(s.replace(/%25/g,"%2525")):decodeURIComponent(s):""}function Lt(s,o,c){return typeof s=="string"?(s=encodeURI(s).replace(o,rc),c&&(s=s.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),s):null}function rc(s){return s=s.charCodeAt(0),"%"+(s>>4&15).toString(16)+(s&15).toString(16)}var mr=/[#\/\?@]/g,oc=/[#\?:]/g,lc=/[#\?]/g,ac=/[#\?@]/g,cc=/#/g;function Ft(s,o){this.h=this.g=null,this.i=s||null,this.j=!!o}function Ge(s){s.g||(s.g=new Map,s.h=0,s.i&&sc(s.i,function(o,c){s.add(decodeURIComponent(o.replace(/\+/g," ")),c)}))}t=Ft.prototype,t.add=function(s,o){Ge(this),this.i=null,s=ht(this,s);let c=this.g.get(s);return c||this.g.set(s,c=[]),c.push(o),this.h+=1,this};function yr(s,o){Ge(s),o=ht(s,o),s.g.has(o)&&(s.i=null,s.h-=s.g.get(o).length,s.g.delete(o))}function vr(s,o){return Ge(s),o=ht(s,o),s.g.has(o)}t.forEach=function(s,o){Ge(this),this.g.forEach(function(c,u){c.forEach(function(C){s.call(o,C,u,this)},this)},this)};function wr(s,o){Ge(s);let c=[];if(typeof o=="string")vr(s,o)&&(c=c.concat(s.g.get(ht(s,o))));else for(s=Array.from(s.g.values()),o=0;o0?String(s[0]):o):o};function Cr(s,o,c){yr(s,o),c.length>0&&(s.i=null,s.g.set(ht(s,o),R(c)),s.h+=c.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const s=[],o=Array.from(this.g.keys());for(let u=0;u{u.abort(),Pe(c,"TestPingServer: timeout",!1,o)},1e4);fetch(s,{signal:u.signal}).then(T=>{clearTimeout(C),T.ok?Pe(c,"TestPingServer: ok",!0,o):Pe(c,"TestPingServer: server error",!1,o)}).catch(()=>{clearTimeout(C),Pe(c,"TestPingServer: error",!1,o)})}function Pe(s,o,c,u,C){try{C&&(C.onload=null,C.onerror=null,C.onabort=null,C.ontimeout=null),u(c)}catch{}}function dc(){this.g=new Ya}function wi(s){this.i=s.Sb||null,this.h=s.ab||!1}w(wi,Qs),wi.prototype.g=function(){return new mn(this.i,this.h)};function mn(s,o){ne.call(this),this.H=s,this.o=o,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}w(mn,ne),t=mn.prototype,t.open=function(s,o){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=s,this.D=o,this.readyState=1,Ht(this)},t.send=function(s){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const o={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};s&&(o.body=s),(this.H||a).fetch(new Request(this.D,o)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,Bt(this)),this.readyState=0},t.Pa=function(s){if(this.g&&(this.l=s,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=s.headers,this.readyState=2,Ht(this)),this.g&&(this.readyState=3,Ht(this),this.g)))if(this.responseType==="arraybuffer")s.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in s){if(this.j=s.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;Sr(this)}else s.text().then(this.Oa.bind(this),this.ga.bind(this))};function Sr(s){s.j.read().then(s.Ma.bind(s)).catch(s.ga.bind(s))}t.Ma=function(s){if(this.g){if(this.o&&s.value)this.response.push(s.value);else if(!this.o){var o=s.value?s.value:new Uint8Array(0);(o=this.B.decode(o,{stream:!s.done}))&&(this.response=this.responseText+=o)}s.done?Bt(this):Ht(this),this.readyState==3&&Sr(this)}},t.Oa=function(s){this.g&&(this.response=this.responseText=s,Bt(this))},t.Na=function(s){this.g&&(this.response=s,Bt(this))},t.ga=function(){this.g&&Bt(this)};function Bt(s){s.readyState=4,s.l=null,s.j=null,s.B=null,Ht(s)}t.setRequestHeader=function(s,o){this.A.append(s,o)},t.getResponseHeader=function(s){return this.h&&this.h.get(s.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const s=[],o=this.h.entries();for(var c=o.next();!c.done;)c=c.value,s.push(c[0]+": "+c[1]),c=o.next();return s.join(`\r -`)};function Ht(s){s.onreadystatechange&&s.onreadystatechange.call(s)}Object.defineProperty(mn.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(s){this.m=s?"include":"same-origin"}});function Tr(s){let o="";return hn(s,function(c,u){o+=u,o+=":",o+=c,o+=`\r -`}),o}function Ci(s,o,c){e:{for(u in c){var u=!1;break e}u=!0}u||(c=Tr(c),typeof s=="string"?c!=null&&Dt(c):W(s,o,c))}function V(s){ne.call(this),this.headers=new Map,this.L=s||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}w(V,ne);var pc=/^https?$/i,gc=["POST","PUT"];t=V.prototype,t.Fa=function(s){this.H=s},t.ea=function(s,o,c,u){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+s);o=o?o.toUpperCase():"GET",this.D=s,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():rr.g(),this.g.onreadystatechange=I(d(this.Ca,this));try{this.B=!0,this.g.open(o,String(s),!0),this.B=!1}catch(T){Ir(this,T);return}if(s=c||"",c=new Map(this.headers),u)if(Object.getPrototypeOf(u)===Object.prototype)for(var C in u)c.set(C,u[C]);else if(typeof u.keys=="function"&&typeof u.get=="function")for(const T of u.keys())c.set(T,u.get(T));else throw Error("Unknown input type for opt_headers: "+String(u));u=Array.from(c.keys()).find(T=>T.toLowerCase()=="content-type"),C=a.FormData&&s instanceof a.FormData,!(Array.prototype.indexOf.call(gc,o,void 0)>=0)||u||C||c.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[T,b]of c)this.g.setRequestHeader(T,b);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(s),this.v=!1}catch(T){Ir(this,T)}};function Ir(s,o){s.h=!1,s.g&&(s.j=!0,s.g.abort(),s.j=!1),s.l=o,s.o=5,br(s),yn(s)}function br(s){s.A||(s.A=!0,ie(s,"complete"),ie(s,"error"))}t.abort=function(s){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=s||7,ie(this,"complete"),ie(this,"abort"),yn(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),yn(this,!0)),V.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?Ar(this):this.Xa())},t.Xa=function(){Ar(this)};function Ar(s){if(s.h&&typeof l<"u"){if(s.v&&Me(s)==4)setTimeout(s.Ca.bind(s),0);else if(ie(s,"readystatechange"),Me(s)==4){s.h=!1;try{const T=s.ca();e:switch(T){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break e;default:o=!1}var c;if(!(c=o)){var u;if(u=T===0){let b=String(s.D).match(_r)[1]||null;!b&&a.self&&a.self.location&&(b=a.self.location.protocol.slice(0,-1)),u=!pc.test(b?b.toLowerCase():"")}c=u}if(c)ie(s,"complete"),ie(s,"success");else{s.o=6;try{var C=Me(s)>2?s.g.statusText:""}catch{C=""}s.l=C+" ["+s.ca()+"]",br(s)}}finally{yn(s)}}}}function yn(s,o){if(s.g){s.m&&(clearTimeout(s.m),s.m=null);const c=s.g;s.g=null,o||ie(s,"ready");try{c.onreadystatechange=null}catch{}}}t.isActive=function(){return!!this.g};function Me(s){return s.g?s.g.readyState:0}t.ca=function(){try{return Me(this)>2?this.g.status:-1}catch{return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.La=function(s){if(this.g){var o=this.g.responseText;return s&&o.indexOf(s)==0&&(o=o.substring(s.length)),Ka(o)}};function Rr(s){try{if(!s.g)return null;if("response"in s.g)return s.g.response;switch(s.F){case"":case"text":return s.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in s.g)return s.g.mozResponseArrayBuffer}return null}catch{return null}}function _c(s){const o={};s=(s.g&&Me(s)>=2&&s.g.getAllResponseHeaders()||"").split(`\r -`);for(let u=0;u0&&(this.ia=s.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}t=Nr.prototype,t.ka=8,t.I=1,t.connect=function(s,o,c,u){se(0),this.W=s,this.H=o||{},c&&u!==void 0&&(this.H.OSID=c,this.H.OAID=u),this.F=this.X,this.J=Br(this,null,this.W),wn(this)};function Ei(s){if(kr(s),s.I==3){var o=s.V++,c=ye(s.J);if(W(c,"SID",s.M),W(c,"RID",o),W(c,"TYPE","terminate"),jt(s,c),o=new De(s,s.j,o),o.M=2,o.A=_n(ye(c)),c=!1,a.navigator&&a.navigator.sendBeacon)try{c=a.navigator.sendBeacon(o.A.toString(),"")}catch{}!c&&a.Image&&(new Image().src=o.A,c=!0),c||(o.g=Hr(o.j,null),o.g.ea(o.A)),o.F=Date.now(),gn(o)}Fr(s)}function vn(s){s.g&&(Ti(s),s.g.cancel(),s.g=null)}function kr(s){vn(s),s.v&&(a.clearTimeout(s.v),s.v=null),Cn(s),s.h.cancel(),s.m&&(typeof s.m=="number"&&a.clearTimeout(s.m),s.m=null)}function wn(s){if(!fr(s.h)&&!s.m){s.m=!0;var o=s.Ea;ke||p(),fe||(ke(),fe=!0),y.add(o,s),s.D=0}}function mc(s,o){return dr(s.h)>=s.h.j-(s.m?1:0)?!1:s.m?(s.i=o.G.concat(s.i),!0):s.I==1||s.I==2||s.D>=(s.Sa?0:s.Ta)?!1:(s.m=Nt(d(s.Ea,s,o),Lr(s,s.D)),s.D++,!0)}t.Ea=function(s){if(this.m)if(this.m=null,this.I==1){if(!s){this.V=Math.floor(Math.random()*1e5),s=this.V++;const C=new De(this,this.j,s);let T=this.o;if(this.U&&(T?(T=Ws(T),Vs(T,this.U)):T=this.U),this.u!==null||this.R||(C.J=T,T=null),this.S)e:{for(var o=0,c=0;c4096){o=c;break e}if(o===4096||c===this.i.length-1){o=c+1;break e}}o=1e3}else o=1e3;o=Or(this,C,o),c=ye(this.J),W(c,"RID",s),W(c,"CVER",22),this.G&&W(c,"X-HTTP-Session-Id",this.G),jt(this,c),T&&(this.R?o="headers="+Dt(Tr(T))+"&"+o:this.u&&Ci(c,this.u,T)),yi(this.h,C),this.Ra&&W(c,"TYPE","init"),this.S?(W(c,"$req",o),W(c,"SID","null"),C.U=!0,pi(C,c,null)):pi(C,c,o),this.I=2}}else this.I==3&&(s?Dr(this,s):this.i.length==0||fr(this.h)||Dr(this))};function Dr(s,o){var c;o?c=o.l:c=s.V++;const u=ye(s.J);W(u,"SID",s.M),W(u,"RID",c),W(u,"AID",s.K),jt(s,u),s.u&&s.o&&Ci(u,s.u,s.o),c=new De(s,s.j,c,s.D+1),s.u===null&&(c.J=s.o),o&&(s.i=o.G.concat(s.i)),o=Or(s,c,1e3),c.H=Math.round(s.va*.5)+Math.round(s.va*.5*Math.random()),yi(s.h,c),pi(c,u,o)}function jt(s,o){s.H&&hn(s.H,function(c,u){W(o,u,c)}),s.l&&hn({},function(c,u){W(o,u,c)})}function Or(s,o,c){c=Math.min(s.i.length,c);const u=s.l?d(s.l.Ka,s.l,s):null;e:{var C=s.i;let k=-1;for(;;){const z=["count="+c];k==-1?c>0?(k=C[0].g,z.push("ofs="+k)):k=0:z.push("ofs="+k);let B=!0;for(let K=0;K=3?!1:(s.Y++,s.v=Nt(d(s.Da,s),Lr(s,s.A)),s.A++,!0)}t.Da=function(){if(this.v=null,Mr(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var s=4*this.T;this.j.info("BP detection timer enabled: "+s),this.B=Nt(d(this.Wa,this),s)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,se(10),vn(this),Mr(this))};function Ti(s){s.B!=null&&(a.clearTimeout(s.B),s.B=null)}function Mr(s){s.g=new De(s,s.j,"rpc",s.Y),s.u===null&&(s.g.J=s.o),s.g.P=0;var o=ye(s.na);W(o,"RID","rpc"),W(o,"SID",s.M),W(o,"AID",s.K),W(o,"CI",s.F?"0":"1"),!s.F&&s.ia&&W(o,"TO",s.ia),W(o,"TYPE","xmlhttp"),jt(s,o),s.u&&s.o&&Ci(o,s.u,s.o),s.O&&(s.g.H=s.O);var c=s.g;s=s.ba,c.M=1,c.A=_n(ye(o)),c.u=null,c.R=!0,ar(c,s)}t.Va=function(){this.C!=null&&(this.C=null,vn(this),Si(this),se(19))};function Cn(s){s.C!=null&&(a.clearTimeout(s.C),s.C=null)}function xr(s,o){var c=null;if(s.g==o){Cn(s),Ti(s),s.g=null;var u=2}else if(mi(s.h,o))c=o.G,pr(s.h,o),u=1;else return;if(s.I!=0){if(o.o)if(u==1){c=o.u?o.u.length:0,o=Date.now()-o.F;var C=s.D;u=dn(),ie(u,new ir(u,c)),wn(s)}else Pr(s);else if(C=o.m,C==3||C==0&&o.X>0||!(u==1&&mc(s,o)||u==2&&Si(s)))switch(c&&c.length>0&&(o=s.h,o.i=o.i.concat(c)),C){case 1:qe(s,5);break;case 4:qe(s,10);break;case 3:qe(s,6);break;default:qe(s,2)}}}function Lr(s,o){let c=s.Qa+Math.floor(Math.random()*s.Za);return s.isActive()||(c*=2),c*o}function qe(s,o){if(s.j.info("Error code "+o),o==2){var c=d(s.bb,s),u=s.Ua;const C=!u;u=new Oe(u||"//www.google.com/images/cleardot.gif"),a.location&&a.location.protocol=="http"||Pt(u,"https"),_n(u),C?uc(u.toString(),c):fc(u.toString(),c)}else se(2);s.I=0,s.l&&s.l.pa(o),Fr(s),kr(s)}t.bb=function(s){s?(this.j.info("Successfully pinged google.com"),se(2)):(this.j.info("Failed to ping google.com"),se(1))};function Fr(s){if(s.I=0,s.ja=[],s.l){const o=gr(s.h);(o.length!=0||s.i.length!=0)&&(N(s.ja,o),N(s.ja,s.i),s.h.i.length=0,R(s.i),s.i.length=0),s.l.oa()}}function Br(s,o,c){var u=c instanceof Oe?ye(c):new Oe(c);if(u.g!="")o&&(u.g=o+"."+u.g),Mt(u,u.u);else{var C=a.location;u=C.protocol,o=o?o+"."+C.hostname:C.hostname,C=+C.port;const T=new Oe(null);u&&Pt(T,u),o&&(T.g=o),C&&Mt(T,C),c&&(T.h=c),u=T}return c=s.G,o=s.wa,c&&o&&W(u,c,o),W(u,"VER",s.ka),jt(s,u),u}function Hr(s,o,c){if(o&&!s.L)throw Error("Can't create secondary domain capable XhrIo object.");return o=s.Aa&&!s.ma?new V(new wi({ab:c})):new V(s.ma),o.Fa(s.L),o}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function Ur(){}t=Ur.prototype,t.ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){};function En(){}En.prototype.g=function(s,o){return new ue(s,o)};function ue(s,o){ne.call(this),this.g=new Nr(o),this.l=s,this.h=o&&o.messageUrlParams||null,s=o&&o.messageHeaders||null,o&&o.clientProtocolHeaderRequired&&(s?s["X-Client-Protocol"]="webchannel":s={"X-Client-Protocol":"webchannel"}),this.g.o=s,s=o&&o.initMessageHeaders||null,o&&o.messageContentType&&(s?s["X-WebChannel-Content-Type"]=o.messageContentType:s={"X-WebChannel-Content-Type":o.messageContentType}),o&&o.sa&&(s?s["X-WebChannel-Client-Profile"]=o.sa:s={"X-WebChannel-Client-Profile":o.sa}),this.g.U=s,(s=o&&o.Qb)&&!g(s)&&(this.g.u=s),this.A=o&&o.supportsCrossDomainXhr||!1,this.v=o&&o.sendRawJson||!1,(o=o&&o.httpSessionIdParam)&&!g(o)&&(this.g.G=o,s=this.h,s!==null&&o in s&&(s=this.h,o in s&&delete s[o])),this.j=new ut(this)}w(ue,ne),ue.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},ue.prototype.close=function(){Ei(this.g)},ue.prototype.o=function(s){var o=this.g;if(typeof s=="string"){var c={};c.__data__=s,s=c}else this.v&&(c={},c.__data__=ci(s),s=c);o.i.push(new ic(o.Ya++,s)),o.I==3&&wn(o)},ue.prototype.N=function(){this.g.l=null,delete this.j,Ei(this.g),delete this.g,ue.Z.N.call(this)};function jr(s){hi.call(this),s.__headers__&&(this.headers=s.__headers__,this.statusCode=s.__status__,delete s.__headers__,delete s.__status__);var o=s.__sm__;if(o){e:{for(const c in o){s=c;break e}s=void 0}(this.i=s)&&(s=this.i,o=o!==null&&s in o?o[s]:void 0),this.data=o}else this.data=s}w(jr,hi);function Wr(){ui.call(this),this.status=1}w(Wr,ui);function ut(s){this.g=s}w(ut,Ur),ut.prototype.ra=function(){ie(this.g,"a")},ut.prototype.qa=function(s){ie(this.g,new jr(s))},ut.prototype.pa=function(s){ie(this.g,new Wr)},ut.prototype.oa=function(){ie(this.g,"b")},En.prototype.createWebChannel=En.prototype.g,ue.prototype.send=ue.prototype.o,ue.prototype.open=ue.prototype.m,ue.prototype.close=ue.prototype.close,_u=function(){return new En},gu=function(){return dn()},pu=$e,du={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},pn.NO_ERROR=0,pn.TIMEOUT=8,pn.HTTP_ERROR=6,fu=pn,sr.COMPLETE="complete",uu=sr,Zs.EventType=At,At.OPEN="a",At.CLOSE="b",At.ERROR="c",At.MESSAGE="d",ne.prototype.listen=ne.prototype.J,hu=Zs,V.prototype.listenOnce=V.prototype.K,V.prototype.getLastError=V.prototype.Ha,V.prototype.getLastErrorCode=V.prototype.ya,V.prototype.getStatus=V.prototype.ca,V.prototype.getResponseJson=V.prototype.La,V.prototype.getResponseText=V.prototype.la,V.prototype.send=V.prototype.ea,V.prototype.setWithCredentials=V.prototype.Fa,cu=V}).apply(typeof Tn<"u"?Tn:typeof self<"u"?self:typeof window<"u"?window:{});/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const mu="type.googleapis.com/google.protobuf.Int64Value",yu="type.googleapis.com/google.protobuf.UInt64Value";function al(t,e){const n={};for(const i in t)t.hasOwnProperty(i)&&(n[i]=e(t[i]));return n}function On(t){if(t==null)return null;if(t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&isFinite(t)||t===!0||t===!1||Object.prototype.toString.call(t)==="[object String]")return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(e=>On(e));if(typeof t=="function"||typeof t=="object")return al(t,e=>On(e));throw new Error("Data cannot be encoded in JSON: "+t)}function yt(t){if(t==null)return t;if(t["@type"])switch(t["@type"]){case mu:case yu:{const e=Number(t.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+t);return e}default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map(e=>yt(e)):typeof t=="function"||typeof t=="object"?al(t,e=>yt(e)):t}/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const fs="functions";/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const to={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class oe extends rt{constructor(e,n,i){super(`${fs}/${e}`,n||""),this.details=i,Object.setPrototypeOf(this,oe.prototype)}}function vu(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}function Pn(t,e){let n=vu(t),i=n,r;try{const l=e&&e.error;if(l){const a=l.status;if(typeof a=="string"){if(!to[a])return new oe("internal","internal");n=to[a],i=a}const h=l.message;typeof h=="string"&&(i=h),r=l.details,r!==void 0&&(r=yt(r))}}catch{}return n==="ok"?null:new oe(n,i,r)}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class wu{constructor(e,n,i,r){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,sl(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=n.getImmediate({optional:!0}),this.messaging=i.getImmediate({optional:!0}),this.auth||n.get().then(l=>this.auth=l,()=>{}),this.messaging||i.get().then(l=>this.messaging=l,()=>{}),this.appCheck||r?.get().then(l=>this.appCheck=l,()=>{})}async getAuthToken(){if(this.auth)try{return(await this.auth.getToken())?.accessToken}catch{return}}async getMessagingToken(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return await this.messaging.getToken()}catch{return}}async getAppCheckToken(e){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){const n=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return n.error?null:n.token}return null}async getContext(e){const n=await this.getAuthToken(),i=await this.getMessagingToken(),r=await this.getAppCheckToken(e);return{authToken:n,messagingToken:i,appCheckToken:r}}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const zi="us-central1",Cu=/^data: (.*?)(?:\n|$)/;function Eu(t){let e=null;return{promise:new Promise((n,i)=>{e=setTimeout(()=>{i(new oe("deadline-exceeded","deadline-exceeded"))},t)}),cancel:()=>{e&&clearTimeout(e)}}}class Su{constructor(e,n,i,r,l=zi,a=(...h)=>fetch(...h)){this.app=e,this.fetchImpl=a,this.emulatorOrigin=null,this.contextProvider=new wu(e,n,i,r),this.cancelAllRequests=new Promise(h=>{this.deleteService=()=>Promise.resolve(h())});try{const h=new URL(l);this.customDomain=h.origin+(h.pathname==="/"?"":h.pathname),this.region=zi}catch{this.customDomain=null,this.region=l}}_delete(){return this.deleteService()}_url(e){const n=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${n}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${n}.cloudfunctions.net/${e}`}}function Tu(t,e,n){const i=sn(e);t.emulatorOrigin=`http${i?"s":""}://${e}:${n}`,i&&(Yo(t.emulatorOrigin+"/backends"),Xo("Functions",!0))}function Iu(t,e,n){const i=r=>Au(t,e,r,{});return i.stream=(r,l)=>Nu(t,e,r,l),i}function cl(t){return t.emulatorOrigin&&sn(t.emulatorOrigin)?"include":void 0}async function bu(t,e,n,i,r){n["Content-Type"]="application/json";let l;try{l=await i(t,{method:"POST",body:JSON.stringify(e),headers:n,credentials:cl(r)})}catch{return{status:0,json:null}}let a=null;try{a=await l.json()}catch{}return{status:l.status,json:a}}async function hl(t,e){const n={},i=await t.contextProvider.getContext(e.limitedUseAppCheckTokens);return i.authToken&&(n.Authorization="Bearer "+i.authToken),i.messagingToken&&(n["Firebase-Instance-ID-Token"]=i.messagingToken),i.appCheckToken!==null&&(n["X-Firebase-AppCheck"]=i.appCheckToken),n}function Au(t,e,n,i){const r=t._url(e);return Ru(t,r,n,i)}async function Ru(t,e,n,i){n=On(n);const r={data:n},l=await hl(t,i),a=i.timeout||7e4,h=Eu(a),f=await Promise.race([bu(e,r,l,t.fetchImpl,t),h.promise,t.cancelAllRequests]);if(h.cancel(),!f)throw new oe("cancelled","Firebase Functions instance was deleted.");const d=Pn(f.status,f.json);if(d)throw d;if(!f.json)throw new oe("internal","Response is not valid JSON object.");let S=f.json.data;if(typeof S>"u"&&(S=f.json.result),typeof S>"u")throw new oe("internal","Response is missing data field.");return{data:yt(S)}}function Nu(t,e,n,i){const r=t._url(e);return ku(t,r,n,i||{})}async function ku(t,e,n,i){n=On(n);const r={data:n},l=await hl(t,i);l["Content-Type"]="application/json",l.Accept="text/event-stream";let a;try{a=await t.fetchImpl(e,{method:"POST",body:JSON.stringify(r),headers:l,signal:i?.signal,credentials:cl(t)})}catch(I){if(I instanceof Error&&I.name==="AbortError"){const N=new oe("cancelled","Request was cancelled.");return{data:Promise.reject(N),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(N)}}}}}}const R=Pn(0,null);return{data:Promise.reject(R),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(R)}}}}}}let h,f;const d=new Promise((I,R)=>{h=I,f=R});i?.signal?.addEventListener("abort",()=>{const I=new oe("cancelled","Request was cancelled.");f(I)});const S=a.body.getReader(),w=Du(S,h,f,i?.signal);return{stream:{[Symbol.asyncIterator](){const I=w.getReader();return{async next(){const{value:R,done:N}=await I.read();return{value:R,done:N}},async return(){return await I.cancel(),{done:!0,value:void 0}}}}},data:d}}function Du(t,e,n,i){const r=(a,h)=>{const f=a.match(Cu);if(!f)return;const d=f[1];try{const S=JSON.parse(d);if("result"in S){e(yt(S.result));return}if("message"in S){h.enqueue(yt(S.message));return}if("error"in S){const w=Pn(0,S);h.error(w),n(w);return}}catch(S){if(S instanceof oe){h.error(S),n(S);return}}},l=new TextDecoder;return new ReadableStream({start(a){let h="";return f();async function f(){if(i?.aborted){const d=new oe("cancelled","Request was cancelled");return a.error(d),n(d),Promise.resolve()}try{const{value:d,done:S}=await t.read();if(S){h.trim()&&r(h.trim(),a),a.close();return}if(i?.aborted){const I=new oe("cancelled","Request was cancelled");a.error(I),n(I),await t.cancel();return}h+=l.decode(d,{stream:!0});const w=h.split(` -`);h=w.pop()||"";for(const I of w)I.trim()&&r(I.trim(),a);return f()}catch(d){const S=d instanceof oe?d:Pn(0,null);a.error(S),n(S)}}},cancel(){return t.cancel()}})}const no="@firebase/functions",io="0.13.1";/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Ou="auth-internal",Pu="app-check-internal",Mu="messaging-internal";function xu(t){const e=(n,{instanceIdentifier:i})=>{const r=n.getProvider("app").getImmediate(),l=n.getProvider(Ou),a=n.getProvider(Mu),h=n.getProvider(Pu);return new Su(r,l,a,h,i)};Ze(new Ue(fs,e,"PUBLIC").setMultipleInstances(!0)),Ce(no,io,t),Ce(no,io,"esm2020")}/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Ig(t=rl(),e=zi){const i=Gn(Ne(t),fs).getImmediate({identifier:e}),r=zo("functions");return r&&Lu(i,...r),i}function Lu(t,e,n){Tu(Ne(t),e,n)}function bg(t,e,n){return Iu(Ne(t),e)}xu();var so={};const ro="@firebase/database",oo="1.1.0";/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */let ul="";function Fu(t){ul=t}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Bu{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,n){n==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),Q(n))}get(e){const n=this.domStorage_.getItem(this.prefixedName_(e));return n==null?null:Qt(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Hu{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return Ee(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const fl=function(t){try{if(typeof window<"u"&&typeof window[t]<"u"){const e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new Bu(e)}}catch{}return new Hu},Xe=fl("localStorage"),Uu=fl("sessionStorage");/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const pt=new el("@firebase/database"),ju=(function(){let t=1;return function(){return t++}})(),dl=function(t){const e=Gc(t),n=new Wc;n.update(e);const i=n.digest();return cs.encodeByteArray(i)},rn=function(...t){let e="";for(let n=0;n{document.readyState==="complete"&&n()}),window.attachEvent("onload",n))}},vt="[MIN_NAME]",et="[MAX_NAME]",ot=function(t,e){if(t===e)return 0;if(t===vt||e===et)return-1;if(e===vt||t===et)return 1;{const n=ao(t),i=ao(e);return n!==null?i!==null?n-i===0?t.length-e.length:n-i:-1:i!==null?1:tn?i.push(t.substring(r,n)):i.push(t.substring(r,r+e));return i};function ce(t,e){for(const n in t)t.hasOwnProperty(n)&&e(n,t[n])}const gl=function(t){A(!qn(t),"Invalid JSON number");const e=11,n=52,i=(1<=Math.pow(2,1-i)?(h=Math.min(Math.floor(Math.log(t)/Math.LN2),i),l=h+i,a=Math.round(t*Math.pow(2,n-h)-Math.pow(2,n))):(l=0,a=Math.round(t/Math.pow(2,1-i-n))));const d=[];for(f=n;f;f-=1)d.push(a%2?1:0),a=Math.floor(a/2);for(f=e;f;f-=1)d.push(l%2?1:0),l=Math.floor(l/2);d.push(r?1:0),d.reverse();const S=d.join("");let w="";for(f=0;f<64;f+=8){let I=parseInt(S.substr(f,8),2).toString(16);I.length===1&&(I="0"+I),w=w+I}return w.toLowerCase()},qu=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},zu=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"},Ku=new RegExp("^-?(0*)\\d{1,10}$"),Yu=-2147483648,Xu=2147483647,ao=function(t){if(Ku.test(t)){const e=Number(t);if(e>=Yu&&e<=Xu)return e}return null},St=function(t){try{t()}catch(e){setTimeout(()=>{const n=e.stack||"";throw ae("Exception was thrown by user callback.",n),e},Math.floor(0))}},Ju=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Yt=function(t,e){const n=setTimeout(t,e);return typeof n=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n=="object"&&n.unref&&n.unref(),n};/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Qu{constructor(e,n){this.appCheckProvider=n,this.appName=e.name,sl(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=n?.getImmediate({optional:!0}),this.appCheck||n?.get().then(i=>this.appCheck=i)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((n,i)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(n,i):n(null)},0)})}addTokenChangeListener(e){this.appCheckProvider?.get().then(n=>n.addTokenListener(e))}notifyForInvalidToken(){ae(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Zu{constructor(e,n,i){this.appName_=e,this.firebaseOptions_=n,this.authProvider_=i,this.auth_=null,this.auth_=i.getImmediate({optional:!0}),this.auth_||i.onInit(r=>this.auth_=r)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(n=>n&&n.code==="auth/token-not-initialized"?(J("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(n)):new Promise((n,i)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(n,i):n(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(n=>n.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(n=>n.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',ae(e)}}class An{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}An.OWNER="owner";/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const ps="5",_l="v",ml="s",yl="r",vl="f",wl=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Cl="ls",El="p",Yi="ac",Sl="websocket",Tl="long_polling";/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Il{constructor(e,n,i,r,l=!1,a="",h=!1,f=!1,d=null){this.secure=n,this.namespace=i,this.webSocketOnly=r,this.nodeAdmin=l,this.persistenceKey=a,this.includeNamespaceInQueryParams=h,this.isUsingEmulator=f,this.emulatorOptions=d,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Xe.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Xe.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${n}`}}function ef(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function bl(t,e,n){A(typeof e=="string","typeof type must == string"),A(typeof n=="object","typeof params must == object");let i;if(e===Sl)i=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===Tl)i=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);ef(t)&&(n.ns=t.namespace);const r=[];return ce(n,(l,a)=>{r.push(l+"="+a)}),i+r.join("&")}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class tf{constructor(){this.counters_={}}incrementCounter(e,n=1){Ee(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return Cc(this.counters_)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Di={},Oi={};function gs(t){const e=t.toString();return Di[e]||(Di[e]=new tf),Di[e]}function nf(t,e){const n=t.toString();return Oi[n]||(Oi[n]=e()),Oi[n]}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class sf{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,n){this.closeAfterResponse=e,this.onClose=n,this.closeAfterResponse{this.onMessage_(i[r])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const co="start",rf="close",of="pLPCommand",lf="pRTLPCB",Al="id",Rl="pw",Nl="ser",af="cb",cf="seg",hf="ts",uf="d",ff="dframe",kl=1870,Dl=30,df=kl-Dl,pf=25e3,gf=3e4;class dt{constructor(e,n,i,r,l,a,h){this.connId=e,this.repoInfo=n,this.applicationId=i,this.appCheckToken=r,this.authToken=l,this.transportSessionId=a,this.lastSessionId=h,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=on(e),this.stats_=gs(n),this.urlFn=f=>(this.appCheckToken&&(f[Yi]=this.appCheckToken),bl(n,Tl,f))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new sf(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(gf)),Vu(()=>{if(this.isClosed_)return;this.scriptTagHolder=new _s((...l)=>{const[a,h,f,d,S]=l;if(this.incrementIncomingBytes_(l),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,a===co)this.id=h,this.password=f;else if(a===rf)h?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(h,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+a)},(...l)=>{const[a,h]=l;this.incrementIncomingBytes_(l),this.myPacketOrderer.handleResponse(a,h)},()=>{this.onClosed_()},this.urlFn);const i={};i[co]="t",i[Nl]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(i[af]=this.scriptTagHolder.uniqueCallbackIdentifier),i[_l]=ps,this.transportSessionId&&(i[ml]=this.transportSessionId),this.lastSessionId&&(i[Cl]=this.lastSessionId),this.applicationId&&(i[El]=this.applicationId),this.appCheckToken&&(i[Yi]=this.appCheckToken),typeof location<"u"&&location.hostname&&wl.test(location.hostname)&&(i[yl]=vl);const r=this.urlFn(i);this.log_("Connecting via long-poll to "+r),this.scriptTagHolder.addTag(r,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){dt.forceAllow_=!0}static forceDisallow(){dt.forceDisallow_=!0}static isAvailable(){return dt.forceAllow_?!0:!dt.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!qu()&&!zu()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const n=Q(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const i=Go(n),r=pl(i,df);for(let l=0;ldocument.domain="'+document.domain+'";<\/script>');const a=""+l+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(h){J("frame writing exception"),h.stack&&J(h.stack),J(h)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||J("No IE domain setting required")}catch{const i=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+i+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e[Al]=this.myID,e[Rl]=this.myPW,e[Nl]=this.currentSerial;let n=this.urlFn(e),i="",r=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+Dl+i.length<=kl;){const a=this.pendingSegs.shift();i=i+"&"+cf+r+"="+a.seg+"&"+hf+r+"="+a.ts+"&"+uf+r+"="+a.d,r++}return n=n+i,this.addLongPollTag_(n,this.currentSerial),!0}else return!1}enqueueSegment(e,n,i){this.pendingSegs.push({seg:e,ts:n,d:i}),this.alive&&this.newRequest_()}addLongPollTag_(e,n){this.outstandingRequests.add(n);const i=()=>{this.outstandingRequests.delete(n),this.newRequest_()},r=setTimeout(i,Math.floor(pf)),l=()=>{clearTimeout(r),i()};this.addTag(e,l)}addTag(e,n){setTimeout(()=>{try{if(!this.sendNewPolls)return;const i=this.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){const r=i.readyState;(!r||r==="loaded"||r==="complete")&&(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=()=>{J("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(i)}catch{}},Math.floor(1))}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const _f=16384,mf=45e3;let Mn=null;typeof MozWebSocket<"u"?Mn=MozWebSocket:typeof WebSocket<"u"&&(Mn=WebSocket);class ge{constructor(e,n,i,r,l,a,h){this.connId=e,this.applicationId=i,this.appCheckToken=r,this.authToken=l,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=on(this.connId),this.stats_=gs(n),this.connURL=ge.connectionURL_(n,a,h,r,i),this.nodeAdmin=n.nodeAdmin}static connectionURL_(e,n,i,r,l){const a={};return a[_l]=ps,typeof location<"u"&&location.hostname&&wl.test(location.hostname)&&(a[yl]=vl),n&&(a[ml]=n),i&&(a[Cl]=i),r&&(a[Yi]=r),l&&(a[El]=l),bl(e,Sl,a)}open(e,n){this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Xe.set("previous_websocket_failure",!0);try{let i;Pc(),this.mySock=new Mn(this.connURL,[],i)}catch(i){this.log_("Error instantiating WebSocket.");const r=i.message||i.data;r&&this.log_(r),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=i=>{this.handleIncomingFrame(i)},this.mySock.onerror=i=>{this.log_("WebSocket error. Closing connection.");const r=i.message||i.data;r&&this.log_(r),this.onClosed_()}}start(){}static forceDisallow(){ge.forceDisallow_=!0}static isAvailable(){let e=!1;if(typeof navigator<"u"&&navigator.userAgent){const n=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(n);i&&i.length>1&&parseFloat(i[1])<4.4&&(e=!0)}return!e&&Mn!==null&&!ge.forceDisallow_}static previouslyFailed(){return Xe.isInMemoryStorage||Xe.get("previous_websocket_failure")===!0}markConnectionHealthy(){Xe.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const n=this.frames.join("");this.frames=null;const i=Qt(n);this.onMessage(i)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(A(this.frames===null,"We already have a frame buffer"),e.length<=6){const n=Number(e);if(!isNaN(n))return this.handleNewFrameCount_(n),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;const n=e.data;if(this.bytesReceived+=n.length,this.stats_.incrementCounter("bytes_received",n.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(n);else{const i=this.extractFrameCount_(n);i!==null&&this.appendFrame_(i)}}send(e){this.resetKeepAlive();const n=Q(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const i=pl(n,_f);i.length>1&&this.sendString_(String(i.length));for(let r=0;r{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(mf))}sendString_(e){try{this.mySock.send(e)}catch(n){this.log_("Exception thrown from WebSocket.send():",n.message||n.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}ge.responsesRequiredToBeHealthy=2;ge.healthyTimeout=3e4;/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class en{static get ALL_TRANSPORTS(){return[dt,ge]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const n=ge&&ge.isAvailable();let i=n&&!ge.previouslyFailed();if(e.webSocketOnly&&(n||ae("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[ge];else{const r=this.transports_=[];for(const l of en.ALL_TRANSPORTS)l&&l.isAvailable()&&r.push(l);en.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}en.globalTransportInitialized_=!1;/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const yf=6e4,vf=5e3,wf=10*1024,Cf=100*1024,Pi="t",ho="d",Ef="s",uo="r",Sf="e",fo="o",po="a",go="n",_o="p",Tf="h";class If{constructor(e,n,i,r,l,a,h,f,d,S){this.id=e,this.repoInfo_=n,this.applicationId_=i,this.appCheckToken_=r,this.authToken_=l,this.onMessage_=a,this.onReady_=h,this.onDisconnect_=f,this.onKill_=d,this.lastSessionId=S,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=on("c:"+this.id+":"),this.transportManager_=new en(n),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.conn_),i=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(n,i)},Math.floor(0));const r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=Yt(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>Cf?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>wf?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(r)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return n=>{e===this.conn_?this.onConnectionLost_(n):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return n=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(n):e===this.secondaryConn_?this.onSecondaryMessageReceived_(n):this.log_("message on old connection"))}}sendRequest(e){const n={t:"d",d:e};this.sendData_(n)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(Pi in e){const n=e[Pi];n===po?this.upgradeIfSecondaryHealthy_():n===uo?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===fo&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const n=Wt("t",e),i=Wt("d",e);if(n==="c")this.onSecondaryControl_(i);else if(n==="d")this.pendingDataMessages.push(i);else throw new Error("Unknown protocol layer: "+n)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:_o,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:po,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:go,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const n=Wt("t",e),i=Wt("d",e);n==="c"?this.onControl_(i):n==="d"&&this.onDataMessage_(i)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const n=Wt(Pi,e);if(ho in e){const i=e[ho];if(n===Tf){const r={...i};this.repoInfo_.isUsingEmulator&&(r.h=this.repoInfo_.host),this.onHandshake_(r)}else if(n===go){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let r=0;r{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(yf))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,n){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(n,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Yt(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(vf))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:_o,d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Xe.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Ol{put(e,n,i,r){}merge(e,n,i,r){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,n,i){}onDisconnectMerge(e,n,i){}onDisconnectCancel(e,n){}reportStats(e){}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Pl{constructor(e){this.allowedEvents_=e,this.listeners_={},A(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...n){if(Array.isArray(this.listeners_[e])){const i=[...this.listeners_[e]];for(let r=0;rn===e),"Unknown event: "+e)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class xn extends Pl{static getInstance(){return new xn}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!Qo()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return A(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const mo=32,yo=768;class H{constructor(e,n){if(n===void 0){this.pieces_=e.split("/");let i=0;for(let r=0;r0&&(this.pieces_[i]=this.pieces_[r],i++);this.pieces_.length=i,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}toString(){let e="";for(let n=this.pieceNum_;n=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function je(t){return t.pieces_.length-t.pieceNum_}function j(t){let e=t.pieceNum_;return e=t.pieces_.length)return null;const e=[];for(let n=t.pieceNum_;n0&&n.push(i[r])}return new H(n,0)}function P(t){return t.pieceNum_>=t.pieces_.length}function de(t,e){const n=D(t),i=D(e);if(n===null)return e;if(n===i)return de(j(t),j(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function Af(t,e){const n=tn(t,0),i=tn(e,0);for(let r=0;rje(e))return!1;for(;n0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=Vn(e),Ll(t)}function kf(t){const e=t.parts_.pop();t.byteLength_-=Vn(e),t.parts_.length>0&&(t.byteLength_-=1)}function Ll(t){if(t.byteLength_>yo)throw new Error(t.errorPrefix_+"has a key path longer than "+yo+" bytes ("+t.byteLength_+").");if(t.parts_.length>mo)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+mo+") or object contains a cycle "+Ye(t))}function Ye(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class ys extends Pl{static getInstance(){return new ys}constructor(){super(["visible"]);let e,n;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(n="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(n="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(n="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(n="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,n&&document.addEventListener(n,()=>{const i=!document[e];i!==this.visible_&&(this.visible_=i,this.trigger("visible",i))},!1)}getInitialEvent(e){return A(e==="visible","Unknown event type: "+e),[this.visible_]}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const $t=1e3,Df=300*1e3,vo=30*1e3,Of=1.3,Pf=3e4,Mf="server_kill",wo=3;class Ie extends Ol{constructor(e,n,i,r,l,a,h,f){if(super(),this.repoInfo_=e,this.applicationId_=n,this.onDataUpdate_=i,this.onConnectStatus_=r,this.onServerInfoUpdate_=l,this.authTokenProvider_=a,this.appCheckTokenProvider_=h,this.authOverride_=f,this.id=Ie.nextPersistentConnectionId_++,this.log_=on("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=$t,this.maxReconnectDelay_=Df,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,f)throw new Error("Auth override specified in options, but not supported on non Node.js platforms");ys.getInstance().on("visible",this.onVisible_,this),e.host.indexOf("fblocal")===-1&&xn.getInstance().on("online",this.onOnline_,this)}sendRequest(e,n,i){const r=++this.requestNumber_,l={r,a:e,b:n};this.log_(Q(l)),A(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(l),i&&(this.requestCBHash_[r]=i)}get(e){this.initConnection_();const n=new Se,r={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:a=>{const h=a.d;a.s==="ok"?n.resolve(h):n.reject(h)}};this.outstandingGets_.push(r),this.outstandingGetCount_++;const l=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(l),n.promise}listen(e,n,i,r){this.initConnection_();const l=e._queryIdentifier,a=e._path.toString();this.log_("Listen called for "+a+" "+l),this.listens.has(a)||this.listens.set(a,new Map),A(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),A(!this.listens.get(a).has(l),"listen() called twice for same path/queryId.");const h={onComplete:r,hashFn:n,query:e,tag:i};this.listens.get(a).set(l,h),this.connected_&&this.sendListen_(h)}sendGet_(e){const n=this.outstandingGets_[e];this.sendRequest("g",n.request,i=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),n.onComplete&&n.onComplete(i)})}sendListen_(e){const n=e.query,i=n._path.toString(),r=n._queryIdentifier;this.log_("Listen on "+i+" for "+r);const l={p:i},a="q";e.tag&&(l.q=n._queryObject,l.t=e.tag),l.h=e.hashFn(),this.sendRequest(a,l,h=>{const f=h.d,d=h.s;Ie.warnOnListenWarnings_(f,n),(this.listens.get(i)&&this.listens.get(i).get(r))===e&&(this.log_("listen response",h),d!=="ok"&&this.removeListen_(i,r),e.onComplete&&e.onComplete(d,f))})}static warnOnListenWarnings_(e,n){if(e&&typeof e=="object"&&Ee(e,"w")){const i=_t(e,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){const r='".indexOn": "'+n._queryParams.getIndex().toString()+'"',l=n._path.toString();ae(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${r} at ${l} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||Uc(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=vo)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,n=Hc(e)?"auth":"gauth",i={cred:e};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(n,i,r=>{const l=r.s,a=r.d||"error";this.authToken_===e&&(l==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(l,a))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const n=e.s,i=e.d||"error";n==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(n,i)})}unlisten(e,n){const i=e._path.toString(),r=e._queryIdentifier;this.log_("Unlisten called for "+i+" "+r),A(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,r)&&this.connected_&&this.sendUnlisten_(i,r,e._queryObject,n)}sendUnlisten_(e,n,i,r){this.log_("Unlisten on "+e+" for "+n);const l={p:e},a="n";r&&(l.q=i,l.t=r),this.sendRequest(a,l)}onDisconnectPut(e,n,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,n,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:n,onComplete:i})}onDisconnectMerge(e,n,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,n,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:n,onComplete:i})}onDisconnectCancel(e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:n})}sendOnDisconnect_(e,n,i,r){const l={p:n,d:i};this.log_("onDisconnect "+e,l),this.sendRequest(e,l,a=>{r&&setTimeout(()=>{r(a.s,a.d)},Math.floor(0))})}put(e,n,i,r){this.putInternal("p",e,n,i,r)}merge(e,n,i,r){this.putInternal("m",e,n,i,r)}putInternal(e,n,i,r,l){this.initConnection_();const a={p:n,d:i};l!==void 0&&(a.h=l),this.outstandingPuts_.push({action:e,request:a,onComplete:r}),this.outstandingPutCount_++;const h=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(h):this.log_("Buffering put: "+n)}sendPut_(e){const n=this.outstandingPuts_[e].action,i=this.outstandingPuts_[e].request,r=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,i,l=>{this.log_(n+" response",l),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),r&&r(l.s,l.d)})}reportStats(e){if(this.connected_){const n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,i=>{if(i.s!=="ok"){const l=i.d;this.log_("reportStats","Error sending stats: "+l)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+Q(e));const n=e.r,i=this.requestCBHash_[n];i&&(delete this.requestCBHash_[n],i(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,n){this.log_("handleServerMessage",e,n),e==="d"?this.onDataUpdate_(n.p,n.d,!1,n.t):e==="m"?this.onDataUpdate_(n.p,n.d,!0,n.t):e==="c"?this.onListenRevoked_(n.p,n.q):e==="ac"?this.onAuthRevoked_(n.s,n.d):e==="apc"?this.onAppCheckRevoked_(n.s,n.d):e==="sd"?this.onSecurityDebugPacket_(n):Ki("Unrecognized action received from server: "+Q(e)+` -Are you using the latest client?`)}onReady_(e,n){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=n,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){A(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=$t,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=$t,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>Pf&&(this.reconnectDelay_=$t),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const e=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_);let n=Math.max(0,this.reconnectDelay_-e);n=Math.random()*n,this.log_("Trying to reconnect in "+n+"ms"),this.scheduleConnect_(n),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*Of)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+Ie.nextConnectionId_++,l=this.lastSessionId;let a=!1,h=null;const f=function(){h?h.close():(a=!0,i())},d=function(w){A(h,"sendRequest call when we're not connected not allowed."),h.sendRequest(w)};this.realtime_={close:f,sendRequest:d};const S=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[w,I]=await Promise.all([this.authTokenProvider_.getToken(S),this.appCheckTokenProvider_.getToken(S)]);a?J("getToken() completed but was canceled"):(J("getToken() completed. Creating connection."),this.authToken_=w&&w.accessToken,this.appCheckToken_=I&&I.token,h=new If(r,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,n,i,R=>{ae(R+" ("+this.repoInfo_.toString()+")"),this.interrupt(Mf)},l))}catch(w){this.log_("Failed to get token: "+w),a||(this.repoInfo_.nodeAdmin&&ae(w),f())}}}interrupt(e){J("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){J("Resuming connection for reason: "+e),delete this.interruptReasons_[e],ji(this.interruptReasons_)&&(this.reconnectDelay_=$t,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const n=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:n})}cancelSentTransactions_(){for(let e=0;eds(l)).join("$"):i="default";const r=this.removeListen_(e,i);r&&r.onComplete&&r.onComplete("permission_denied")}removeListen_(e,n){const i=new H(e).toString();let r;if(this.listens.has(i)){const l=this.listens.get(i);r=l.get(n),l.delete(n),l.size===0&&this.listens.delete(i)}else r=void 0;return r}onAuthRevoked_(e,n){J("Auth token revoked: "+e+"/"+n),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e==="invalid_token"||e==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=wo&&(this.reconnectDelay_=vo,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,n){J("App check token revoked: "+e+"/"+n),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e==="invalid_token"||e==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=wo&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace(` -`,` -FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const n of e.values())this.sendListen_(n);for(let e=0;e0}peek(){if(this.nodeStack_.length===0)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class X{constructor(e,n,i,r,l){this.key=e,this.value=n,this.color=i??X.RED,this.left=r??le.EMPTY_NODE,this.right=l??le.EMPTY_NODE}copy(e,n,i,r,l){return new X(e??this.key,n??this.value,i??this.color,r??this.left,l??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,i){let r=this;const l=i(e,r.key);return l<0?r=r.copy(null,null,null,r.left.insert(e,n,i),null):l===0?r=r.copy(null,n,null,null,null):r=r.copy(null,null,null,null,r.right.insert(e,n,i)),r.fixUp_()}removeMin_(){if(this.left.isEmpty())return le.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,n){let i,r;if(i=this,n(e,i.key)<0)!i.left.isEmpty()&&!i.left.isRed_()&&!i.left.left.isRed_()&&(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),!i.right.isEmpty()&&!i.right.isRed_()&&!i.right.left.isRed_()&&(i=i.moveRedRight_()),n(e,i.key)===0){if(i.right.isEmpty())return le.EMPTY_NODE;r=i.right.min_(),i=i.copy(r.key,r.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,X.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,X.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}X.RED=!0;X.BLACK=!1;class xf{copy(e,n,i,r,l){return this}insert(e,n,i){return new X(e,n,null)}remove(e,n){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}class le{constructor(e,n=le.EMPTY_NODE){this.comparator_=e,this.root_=n}insert(e,n){return new le(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,X.BLACK,null,null))}remove(e){return new le(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,X.BLACK,null,null))}get(e){let n,i=this.root_;for(;!i.isEmpty();){if(n=this.comparator_(e,i.key),n===0)return i.value;n<0?i=i.left:n>0&&(i=i.right)}return null}getPredecessorKey(e){let n,i=this.root_,r=null;for(;!i.isEmpty();)if(n=this.comparator_(e,i.key),n===0){if(i.left.isEmpty())return r?r.key:null;for(i=i.left;!i.right.isEmpty();)i=i.right;return i.key}else n<0?i=i.left:n>0&&(r=i,i=i.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new bn(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new bn(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new bn(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new bn(this.root_,null,this.comparator_,!0,e)}}le.EMPTY_NODE=new xf;/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Lf(t,e){return ot(t.name,e.name)}function vs(t,e){return ot(t,e)}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */let Xi;function Ff(t){Xi=t}const Bl=function(t){return typeof t=="number"?"number:"+gl(t):"string:"+t},Hl=function(t){if(t.isLeafNode()){const e=t.val();A(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Ee(e,".sv"),"Priority must be a string or number.")}else A(t===Xi||t.isEmpty(),"priority of unexpected type.");A(t===Xi||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */let Co;class Y{static set __childrenNodeConstructor(e){Co=e}static get __childrenNodeConstructor(){return Co}constructor(e,n=Y.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=n,this.lazyHash_=null,A(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),Hl(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new Y(this.value_,e)}getImmediateChild(e){return e===".priority"?this.priorityNode_:Y.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return P(e)?this:D(e)===".priority"?this.priorityNode_:Y.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,n){return null}updateImmediateChild(e,n){return e===".priority"?this.updatePriority(n):n.isEmpty()&&e!==".priority"?this:Y.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)}updateChild(e,n){const i=D(e);return i===null?n:n.isEmpty()&&i!==".priority"?this:(A(i!==".priority"||je(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(i,Y.__childrenNodeConstructor.EMPTY_NODE.updateChild(j(e),n)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,n){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+Bl(this.priorityNode_.val())+":");const n=typeof this.value_;e+=n+":",n==="number"?e+=gl(this.value_):e+=this.value_,this.lazyHash_=dl(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===Y.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof Y.__childrenNodeConstructor?-1:(A(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const n=typeof e.value_,i=typeof this.value_,r=Y.VALUE_TYPE_ORDER.indexOf(n),l=Y.VALUE_TYPE_ORDER.indexOf(i);return A(r>=0,"Unknown leaf type: "+n),A(l>=0,"Unknown leaf type: "+i),r===l?i==="object"?0:this.value_parseInt(Math.log(l)/jf,10),i=l=>parseInt(Array(l+1).join("1"),2);this.count=n(e+1),this.current_=this.count-1;const r=i(this.count);this.bits_=e+1&r}nextBitIsOne(){const e=!(this.bits_&1<{const a=_t(this.indexSet_,l);if(A(a,"Missing index implementation for "+l),r===ft)if(a.isDefinedOn(e.node)){const h=[],f=n.getIterator(x.Wrap);let d=f.getNext();for(;d;)d.name!==e.name&&h.push(d),d=f.getNext();return h.push(e),Ln(h,a.getCompare())}else return ft;else{const h=n.get(e.name);let f=r;return h&&(f=f.remove(new x(e.name,h))),f.insert(e,e.node)}});return new Te(i,this.indexSet_)}removeFromIndexes(e,n){const i=Nn(this.indexes_,r=>{if(r===ft)return r;{const l=n.get(e.name);return l?r.remove(new x(e.name,l)):r}});return new Te(i,this.indexSet_)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */let Vt;class L{static get EMPTY_NODE(){return Vt||(Vt=new L(new le(vs),null,Te.Default))}constructor(e,n,i){this.children_=e,this.priorityNode_=n,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&Hl(this.priorityNode_),this.children_.isEmpty()&&A(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Vt}updatePriority(e){return this.children_.isEmpty()?this:new L(this.children_,e,this.indexMap_)}getImmediateChild(e){if(e===".priority")return this.getPriority();{const n=this.children_.get(e);return n===null?Vt:n}}getChild(e){const n=D(e);return n===null?this:this.getImmediateChild(n).getChild(j(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(e,n){if(A(n,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(n);{const i=new x(e,n);let r,l;n.isEmpty()?(r=this.children_.remove(e),l=this.indexMap_.removeFromIndexes(i,this.children_)):(r=this.children_.insert(e,n),l=this.indexMap_.addToIndexes(i,this.children_));const a=r.isEmpty()?Vt:this.priorityNode_;return new L(r,a,l)}}updateChild(e,n){const i=D(e);if(i===null)return n;{A(D(e)!==".priority"||je(e)===1,".priority must be the last token in a path");const r=this.getImmediateChild(i).updateChild(j(e),n);return this.updateImmediateChild(i,r)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const n={};let i=0,r=0,l=!0;if(this.forEachChild(Z,(a,h)=>{n[a]=h.val(e),i++,l&&L.INTEGER_REGEXP_.test(a)?r=Math.max(r,Number(a)):l=!1}),!e&&l&&r<2*i){const a=[];for(const h in n)a[h]=n[h];return a}else return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n}hash(){if(this.lazyHash_===null){let e="";this.getPriority().isEmpty()||(e+="priority:"+Bl(this.getPriority().val())+":"),this.forEachChild(Z,(n,i)=>{const r=i.hash();r!==""&&(e+=":"+n+":"+r)}),this.lazyHash_=e===""?"":dl(e)}return this.lazyHash_}getPredecessorChildName(e,n,i){const r=this.resolveIndex_(i);if(r){const l=r.getPredecessorKey(new x(e,n));return l?l.name:null}else return this.children_.getPredecessorKey(e)}getFirstChildName(e){const n=this.resolveIndex_(e);if(n){const i=n.minKey();return i&&i.name}else return this.children_.minKey()}getFirstChild(e){const n=this.getFirstChildName(e);return n?new x(n,this.children_.get(n)):null}getLastChildName(e){const n=this.resolveIndex_(e);if(n){const i=n.maxKey();return i&&i.name}else return this.children_.maxKey()}getLastChild(e){const n=this.getLastChildName(e);return n?new x(n,this.children_.get(n)):null}forEachChild(e,n){const i=this.resolveIndex_(e);return i?i.inorderTraversal(r=>n(r.name,r.node)):this.children_.inorderTraversal(n)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,n){const i=this.resolveIndex_(n);if(i)return i.getIteratorFrom(e,r=>r);{const r=this.children_.getIteratorFrom(e.name,x.Wrap);let l=r.peek();for(;l!=null&&n.compare(l,e)<0;)r.getNext(),l=r.peek();return r}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,n){const i=this.resolveIndex_(n);if(i)return i.getReverseIteratorFrom(e,r=>r);{const r=this.children_.getReverseIteratorFrom(e.name,x.Wrap);let l=r.peek();for(;l!=null&&n.compare(l,e)>0;)r.getNext(),l=r.peek();return r}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===ln?-1:0}withIndex(e){if(e===gt||this.indexMap_.hasIndex(e))return this;{const n=this.indexMap_.addIndex(e,this.children_);return new L(this.children_,this.priorityNode_,n)}}isIndexed(e){return e===gt||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const n=e;if(this.getPriority().equals(n.getPriority()))if(this.children_.count()===n.children_.count()){const i=this.getIterator(Z),r=n.getIterator(Z);let l=i.getNext(),a=r.getNext();for(;l&&a;){if(l.name!==a.name||!l.node.equals(a.node))return!1;l=i.getNext(),a=r.getNext()}return l===null&&a===null}else return!1;else return!1}}resolveIndex_(e){return e===gt?null:this.indexMap_.get(e.toString())}}L.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;class $f extends L{constructor(){super(new le(vs),L.EMPTY_NODE,Te.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return L.EMPTY_NODE}isEmpty(){return!1}}const ln=new $f;Object.defineProperties(x,{MIN:{value:new x(vt,L.EMPTY_NODE)},MAX:{value:new x(et,ln)}});Fl.__EMPTY_NODE=L.EMPTY_NODE;Y.__childrenNodeConstructor=L;Ff(ln);Hf(ln);/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Vf=!0;function q(t,e=null){if(t===null)return L.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),A(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){const n=t;return new Y(n,q(e))}if(!(t instanceof Array)&&Vf){const n=[];let i=!1;if(ce(t,(a,h)=>{if(a.substring(0,1)!=="."){const f=q(h);f.isEmpty()||(i=i||!f.getPriority().isEmpty(),n.push(new x(a,f)))}}),n.length===0)return L.EMPTY_NODE;const l=Ln(n,Lf,a=>a.name,vs);if(i){const a=Ln(n,Z.getCompare());return new L(l,q(e),new Te({".priority":a},{".priority":Z}))}else return new L(l,q(e),Te.Default)}else{let n=L.EMPTY_NODE;return ce(t,(i,r)=>{if(Ee(t,i)&&i.substring(0,1)!=="."){const l=q(r);(l.isLeafNode()||!l.isEmpty())&&(n=n.updateImmediateChild(i,l))}}),n.updatePriority(q(e))}}Bf(q);/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Gf extends zn{constructor(e){super(),this.indexPath_=e,A(!P(e)&&D(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,n){const i=this.extractChild(e.node),r=this.extractChild(n.node),l=i.compareTo(r);return l===0?ot(e.name,n.name):l}makePost(e,n){const i=q(e),r=L.EMPTY_NODE.updateChild(this.indexPath_,i);return new x(n,r)}maxPost(){const e=L.EMPTY_NODE.updateChild(this.indexPath_,ln);return new x(et,e)}toString(){return tn(this.indexPath_,0).join("/")}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class qf extends zn{compare(e,n){const i=e.node.compareTo(n.node);return i===0?ot(e.name,n.name):i}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}minPost(){return x.MIN}maxPost(){return x.MAX}makePost(e,n){const i=q(e);return new x(n,i)}toString(){return".value"}}const zf=new qf;/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Kf(t){return{type:"value",snapshotNode:t}}function Yf(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function Xf(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function Eo(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function Jf(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class ws{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Z}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return A(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return A(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:vt}hasEnd(){return this.endSet_}getIndexEndValue(){return A(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return A(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:et}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return A(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===Z}copy(){const e=new ws;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function So(t){const e={};if(t.isDefault())return e;let n;if(t.index_===Z?n="$priority":t.index_===zf?n="$value":t.index_===gt?n="$key":(A(t.index_ instanceof Gf,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=Q(n),t.startSet_){const i=t.startAfterSet_?"startAfter":"startAt";e[i]=Q(t.indexStartValue_),t.startNameSet_&&(e[i]+=","+Q(t.indexStartName_))}if(t.endSet_){const i=t.endBeforeSet_?"endBefore":"endAt";e[i]=Q(t.indexEndValue_),t.endNameSet_&&(e[i]+=","+Q(t.indexEndName_))}return t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function To(t){const e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_),e.sin=!t.startAfterSet_),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_),e.ein=!t.endBeforeSet_),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;n===""&&(t.isViewFromLeft()?n="l":n="r"),e.vf=n}return t.index_!==Z&&(e.i=t.index_.toString()),e}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Fn extends Ol{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(A(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,n,i,r){super(),this.repoInfo_=e,this.onDataUpdate_=n,this.authTokenProvider_=i,this.appCheckTokenProvider_=r,this.log_=on("p:rest:"),this.listens_={}}listen(e,n,i,r){const l=e._path.toString();this.log_("Listen called for "+l+" "+e._queryIdentifier);const a=Fn.getListenId_(e,i),h={};this.listens_[a]=h;const f=So(e._queryParams);this.restRequest_(l+".json",f,(d,S)=>{let w=S;if(d===404&&(w=null,d=null),d===null&&this.onDataUpdate_(l,w,!1,i),_t(this.listens_,a)===h){let I;d?d===401?I="permission_denied":I="rest_error:"+d:I="ok",r(I,null)}})}unlisten(e,n){const i=Fn.getListenId_(e,n);delete this.listens_[i]}get(e){const n=So(e._queryParams),i=e._path.toString(),r=new Se;return this.restRequest_(i+".json",n,(l,a)=>{let h=a;l===404&&(h=null,l=null),l===null?(this.onDataUpdate_(i,h,!1,null),r.resolve(h)):r.reject(new Error(h))}),r.promise}refreshAuthToken(e){}restRequest_(e,n={},i){return n.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([r,l])=>{r&&r.accessToken&&(n.auth=r.accessToken),l&&l.token&&(n.ac=l.token);const a=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+jc(n);this.log_("Sending REST request for "+a);const h=new XMLHttpRequest;h.onreadystatechange=()=>{if(i&&h.readyState===4){this.log_("REST Response for "+a+" received. status:",h.status,"response:",h.responseText);let f=null;if(h.status>=200&&h.status<300){try{f=Qt(h.responseText)}catch{ae("Failed to parse JSON response for "+a+": "+h.responseText)}i(null,f)}else h.status!==401&&h.status!==404&&ae("Got unsuccessful REST response for "+a+" Status: "+h.status),i(h.status);i=null}},h.open("GET",a,!0),h.send()})}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Qf{constructor(){this.rootNode_=L.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,n){this.rootNode_=this.rootNode_.updateChild(e,n)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Bn(){return{value:null,children:new Map}}function Tt(t,e,n){if(P(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{const i=D(e);t.children.has(i)||t.children.set(i,Bn());const r=t.children.get(i);e=j(e),Tt(r,e,n)}}function Ji(t,e){if(P(e))return t.value=null,t.children.clear(),!0;if(t.value!==null){if(t.value.isLeafNode())return!1;{const n=t.value;return t.value=null,n.forEachChild(Z,(i,r)=>{Tt(t,new H(i),r)}),Ji(t,e)}}else if(t.children.size>0){const n=D(e);return e=j(e),t.children.has(n)&&Ji(t.children.get(n),e)&&t.children.delete(n),t.children.size===0}else return!0}function Qi(t,e,n){t.value!==null?n(e,t.value):Zf(t,(i,r)=>{const l=new H(e.toString()+"/"+i);Qi(r,l,n)})}function Zf(t,e){t.children.forEach((n,i)=>{e(i,n)})}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class ed{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),n={...e};return this.last_&&ce(this.last_,(i,r)=>{n[i]=n[i]-r}),this.last_=e,n}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Io=10*1e3,td=30*1e3,nd=300*1e3;class id{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new ed(e);const i=Io+(td-Io)*Math.random();Yt(this.reportStats_.bind(this),Math.floor(i))}reportStats_(){const e=this.statsListener_.get(),n={};let i=!1;ce(e,(r,l)=>{l>0&&Ee(this.statsToReport_,r)&&(n[r]=l,i=!0)}),i&&this.server_.reportStats(n),Yt(this.reportStats_.bind(this),Math.floor(Math.random()*2*nd))}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var we;(function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(we||(we={}));function Wl(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function $l(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function Vl(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Hn{constructor(e,n,i){this.path=e,this.affectedTree=n,this.revert=i,this.type=we.ACK_USER_WRITE,this.source=Wl()}operationForChild(e){if(P(this.path)){if(this.affectedTree.value!=null)return A(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const n=this.affectedTree.subtree(new H(e));return new Hn(F(),n,this.revert)}}else return A(D(this.path)===e,"operationForChild called for unrelated child."),new Hn(j(this.path),this.affectedTree,this.revert)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class tt{constructor(e,n,i){this.source=e,this.path=n,this.snap=i,this.type=we.OVERWRITE}operationForChild(e){return P(this.path)?new tt(this.source,F(),this.snap.getImmediateChild(e)):new tt(this.source,j(this.path),this.snap)}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class nn{constructor(e,n,i){this.source=e,this.path=n,this.children=i,this.type=we.MERGE}operationForChild(e){if(P(this.path)){const n=this.children.subtree(new H(e));return n.isEmpty()?null:n.value?new tt(this.source,F(),n.value):new nn(this.source,F(),n)}else return A(D(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new nn(this.source,j(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Cs{constructor(e,n,i){this.node_=e,this.fullyInitialized_=n,this.filtered_=i}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(P(e))return this.isFullyInitialized()&&!this.filtered_;const n=D(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}function sd(t,e,n,i){const r=[],l=[];return e.forEach(a=>{a.type==="child_changed"&&t.index_.indexedValueChanged(a.oldSnap,a.snapshotNode)&&l.push(Jf(a.childName,a.snapshotNode))}),Gt(t,r,"child_removed",e,i,n),Gt(t,r,"child_added",e,i,n),Gt(t,r,"child_moved",l,i,n),Gt(t,r,"child_changed",e,i,n),Gt(t,r,"value",e,i,n),r}function Gt(t,e,n,i,r,l){const a=i.filter(h=>h.type===n);a.sort((h,f)=>od(t,h,f)),a.forEach(h=>{const f=rd(t,h,l);r.forEach(d=>{d.respondsTo(h.type)&&e.push(d.createEvent(f,t.query_))})})}function rd(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function od(t,e,n){if(e.childName==null||n.childName==null)throw Et("Should only compare child_ events.");const i=new x(e.childName,e.snapshotNode),r=new x(n.childName,n.snapshotNode);return t.index_.compare(i,r)}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Gl(t,e){return{eventCache:t,serverCache:e}}function Xt(t,e,n,i){return Gl(new Cs(e,n,i),t.serverCache)}function ql(t,e,n,i){return Gl(t.eventCache,new Cs(e,n,i))}function Zi(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function nt(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */let xi;const ld=()=>(xi||(xi=new le(Gu)),xi);class ${static fromObject(e){let n=new $(null);return ce(e,(i,r)=>{n=n.set(new H(i),r)}),n}constructor(e,n=ld()){this.value=e,this.children=n}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,n){if(this.value!=null&&n(this.value))return{path:F(),value:this.value};if(P(e))return null;{const i=D(e),r=this.children.get(i);if(r!==null){const l=r.findRootMostMatchingPathAndValue(j(e),n);return l!=null?{path:G(new H(i),l.path),value:l.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(P(e))return this;{const n=D(e),i=this.children.get(n);return i!==null?i.subtree(j(e)):new $(null)}}set(e,n){if(P(e))return new $(n,this.children);{const i=D(e),l=(this.children.get(i)||new $(null)).set(j(e),n),a=this.children.insert(i,l);return new $(this.value,a)}}remove(e){if(P(e))return this.children.isEmpty()?new $(null):new $(null,this.children);{const n=D(e),i=this.children.get(n);if(i){const r=i.remove(j(e));let l;return r.isEmpty()?l=this.children.remove(n):l=this.children.insert(n,r),this.value===null&&l.isEmpty()?new $(null):new $(this.value,l)}else return this}}get(e){if(P(e))return this.value;{const n=D(e),i=this.children.get(n);return i?i.get(j(e)):null}}setTree(e,n){if(P(e))return n;{const i=D(e),l=(this.children.get(i)||new $(null)).setTree(j(e),n);let a;return l.isEmpty()?a=this.children.remove(i):a=this.children.insert(i,l),new $(this.value,a)}}fold(e){return this.fold_(F(),e)}fold_(e,n){const i={};return this.children.inorderTraversal((r,l)=>{i[r]=l.fold_(G(e,r),n)}),n(e,this.value,i)}findOnPath(e,n){return this.findOnPath_(e,F(),n)}findOnPath_(e,n,i){const r=this.value?i(n,this.value):!1;if(r)return r;if(P(e))return null;{const l=D(e),a=this.children.get(l);return a?a.findOnPath_(j(e),G(n,l),i):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,F(),n)}foreachOnPath_(e,n,i){if(P(e))return this;{this.value&&i(n,this.value);const r=D(e),l=this.children.get(r);return l?l.foreachOnPath_(j(e),G(n,r),i):new $(null)}}foreach(e){this.foreach_(F(),e)}foreach_(e,n){this.children.inorderTraversal((i,r)=>{r.foreach_(G(e,i),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,i)=>{i.value&&e(n,i.value)})}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class _e{constructor(e){this.writeTree_=e}static empty(){return new _e(new $(null))}}function Jt(t,e,n){if(P(e))return new _e(new $(n));{const i=t.writeTree_.findRootMostValueAndPath(e);if(i!=null){const r=i.path;let l=i.value;const a=de(r,e);return l=l.updateChild(a,n),new _e(t.writeTree_.set(r,l))}else{const r=new $(n),l=t.writeTree_.setTree(e,r);return new _e(l)}}}function bo(t,e,n){let i=t;return ce(n,(r,l)=>{i=Jt(i,G(e,r),l)}),i}function Ao(t,e){if(P(e))return _e.empty();{const n=t.writeTree_.setTree(e,new $(null));return new _e(n)}}function es(t,e){return lt(t,e)!=null}function lt(t,e){const n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(de(n.path,e)):null}function Ro(t){const e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(Z,(i,r)=>{e.push(new x(i,r))}):t.writeTree_.children.inorderTraversal((i,r)=>{r.value!=null&&e.push(new x(i,r.value))}),e}function He(t,e){if(P(e))return t;{const n=lt(t,e);return n!=null?new _e(new $(n)):new _e(t.writeTree_.subtree(e))}}function ts(t){return t.writeTree_.isEmpty()}function wt(t,e){return zl(F(),t.writeTree_,e)}function zl(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let i=null;return e.children.inorderTraversal((r,l)=>{r===".priority"?(A(l.value!==null,"Priority writes must always be leaf nodes"),i=l.value):n=zl(G(t,r),l,n)}),!n.getChild(t).isEmpty()&&i!==null&&(n=n.updateChild(G(t,".priority"),i)),n}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Kl(t,e){return Zl(e,t)}function ad(t,e,n,i,r){A(i>t.lastWriteId,"Stacking an older write on top of newer ones"),r===void 0&&(r=!0),t.allWrites.push({path:e,snap:n,writeId:i,visible:r}),r&&(t.visibleWrites=Jt(t.visibleWrites,e,n)),t.lastWriteId=i}function cd(t,e){for(let n=0;nh.writeId===e);A(n>=0,"removeWrite called with nonexistent writeId.");const i=t.allWrites[n];t.allWrites.splice(n,1);let r=i.visible,l=!1,a=t.allWrites.length-1;for(;r&&a>=0;){const h=t.allWrites[a];h.visible&&(a>=n&&ud(h,i.path)?r=!1:pe(i.path,h.path)&&(l=!0)),a--}if(r){if(l)return fd(t),!0;if(i.snap)t.visibleWrites=Ao(t.visibleWrites,i.path);else{const h=i.children;ce(h,f=>{t.visibleWrites=Ao(t.visibleWrites,G(i.path,f))})}return!0}else return!1}function ud(t,e){if(t.snap)return pe(t.path,e);for(const n in t.children)if(t.children.hasOwnProperty(n)&&pe(G(t.path,n),e))return!0;return!1}function fd(t){t.visibleWrites=Yl(t.allWrites,dd,F()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function dd(t){return t.visible}function Yl(t,e,n){let i=_e.empty();for(let r=0;r{i=i.updateImmediateChild(l,a)}),i;if(n){const l=He(t.visibleWrites,e);return n.forEachChild(Z,(a,h)=>{const f=wt(He(l,new H(a)),h);i=i.updateImmediateChild(a,f)}),Ro(l).forEach(a=>{i=i.updateImmediateChild(a.name,a.node)}),i}else{const l=He(t.visibleWrites,e);return Ro(l).forEach(a=>{i=i.updateImmediateChild(a.name,a.node)}),i}}function gd(t,e,n,i,r){A(i||r,"Either existingEventSnap or existingServerSnap must exist");const l=G(e,n);if(es(t.visibleWrites,l))return null;{const a=He(t.visibleWrites,l);return ts(a)?r.getChild(n):wt(a,r.getChild(n))}}function _d(t,e,n,i){const r=G(e,n),l=lt(t.visibleWrites,r);if(l!=null)return l;if(i.isCompleteForChild(n)){const a=He(t.visibleWrites,r);return wt(a,i.getNode().getImmediateChild(n))}else return null}function md(t,e){return lt(t.visibleWrites,e)}function yd(t,e,n,i,r,l,a){let h;const f=He(t.visibleWrites,e),d=lt(f,F());if(d!=null)h=d;else if(n!=null)h=wt(f,n);else return[];if(h=h.withIndex(a),!h.isEmpty()&&!h.isLeafNode()){const S=[],w=a.getCompare(),I=l?h.getReverseIteratorFrom(i,a):h.getIteratorFrom(i,a);let R=I.getNext();for(;R&&S.length0||!t.eventCache.isFullyInitialized()||r&&!i.getNode().equals(l)||!i.getNode().getPriority().equals(l.getPriority()))&&n.push(Kf(Zi(e)))}}function ta(t,e,n,i,r,l){const a=e.eventCache;if(Un(i,n)!=null)return e;{let h,f;if(P(n))if(A(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const d=nt(e),S=d instanceof L?d:L.EMPTY_NODE,w=Jl(i,S);h=t.filter.updateFullNode(e.eventCache.getNode(),w,l)}else{const d=ns(i,nt(e));h=t.filter.updateFullNode(e.eventCache.getNode(),d,l)}else{const d=D(n);if(d===".priority"){A(je(n)===1,"Can't have a priority with additional path components");const S=a.getNode();f=e.serverCache.getNode();const w=No(i,n,S,f);w!=null?h=t.filter.updatePriority(S,w):h=a.getNode()}else{const S=j(n);let w;if(a.isCompleteForChild(d)){f=e.serverCache.getNode();const I=No(i,n,a.getNode(),f);I!=null?w=a.getNode().getImmediateChild(d).updateChild(S,I):w=a.getNode().getImmediateChild(d)}else w=Es(i,d,e.serverCache);w!=null?h=t.filter.updateChild(a.getNode(),d,w,S,r,l):h=a.getNode()}}return Xt(e,h,a.isFullyInitialized()||P(n),t.filter.filtersNodes())}}function jn(t,e,n,i,r,l,a,h){const f=e.serverCache;let d;const S=a?t.filter:t.filter.getIndexedFilter();if(P(n))d=S.updateFullNode(f.getNode(),i,null);else if(S.filtersNodes()&&!f.isFiltered()){const R=f.getNode().updateChild(n,i);d=S.updateFullNode(f.getNode(),R,null)}else{const R=D(n);if(!f.isCompleteForPath(n)&&je(n)>1)return e;const N=j(n),M=f.getNode().getImmediateChild(R).updateChild(N,i);R===".priority"?d=S.updatePriority(f.getNode(),M):d=S.updateChild(f.getNode(),R,M,N,ea,null)}const w=ql(e,d,f.isFullyInitialized()||P(n),S.filtersNodes()),I=new Ss(r,w,l);return ta(t,w,n,r,I,h)}function is(t,e,n,i,r,l,a){const h=e.eventCache;let f,d;const S=new Ss(r,e,l);if(P(n))d=t.filter.updateFullNode(e.eventCache.getNode(),i,a),f=Xt(e,d,!0,t.filter.filtersNodes());else{const w=D(n);if(w===".priority")d=t.filter.updatePriority(e.eventCache.getNode(),i),f=Xt(e,d,h.isFullyInitialized(),h.isFiltered());else{const I=j(n),R=h.getNode().getImmediateChild(w);let N;if(P(I))N=i;else{const O=S.getCompleteChild(w);O!=null?ms(I)===".priority"&&O.getChild(Ml(I)).isEmpty()?N=O:N=O.updateChild(I,i):N=L.EMPTY_NODE}if(R.equals(N))f=e;else{const O=t.filter.updateChild(h.getNode(),w,N,I,S,a);f=Xt(e,O,h.isFullyInitialized(),t.filter.filtersNodes())}}}return f}function ko(t,e){return t.eventCache.isCompleteForChild(e)}function bd(t,e,n,i,r,l,a){let h=e;return i.foreach((f,d)=>{const S=G(n,f);ko(e,D(S))&&(h=is(t,h,S,d,r,l,a))}),i.foreach((f,d)=>{const S=G(n,f);ko(e,D(S))||(h=is(t,h,S,d,r,l,a))}),h}function Do(t,e,n){return n.foreach((i,r)=>{e=e.updateChild(i,r)}),e}function ss(t,e,n,i,r,l,a,h){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let f=e,d;P(n)?d=i:d=new $(null).setTree(n,i);const S=e.serverCache.getNode();return d.children.inorderTraversal((w,I)=>{if(S.hasChild(w)){const R=e.serverCache.getNode().getImmediateChild(w),N=Do(t,R,I);f=jn(t,f,new H(w),N,r,l,a,h)}}),d.children.inorderTraversal((w,I)=>{const R=!e.serverCache.isCompleteForChild(w)&&I.value===null;if(!S.hasChild(w)&&!R){const N=e.serverCache.getNode().getImmediateChild(w),O=Do(t,N,I);f=jn(t,f,new H(w),O,r,l,a,h)}}),f}function Ad(t,e,n,i,r,l,a){if(Un(r,n)!=null)return e;const h=e.serverCache.isFiltered(),f=e.serverCache;if(i.value!=null){if(P(n)&&f.isFullyInitialized()||f.isCompleteForPath(n))return jn(t,e,n,f.getNode().getChild(n),r,l,h,a);if(P(n)){let d=new $(null);return f.getNode().forEachChild(gt,(S,w)=>{d=d.set(new H(S),w)}),ss(t,e,n,d,r,l,h,a)}else return e}else{let d=new $(null);return i.foreach((S,w)=>{const I=G(n,S);f.isCompleteForPath(I)&&(d=d.set(S,f.getNode().getChild(I)))}),ss(t,e,n,d,r,l,h,a)}}function Rd(t,e,n,i,r){const l=e.serverCache,a=ql(e,l.getNode(),l.isFullyInitialized()||P(n),l.isFiltered());return ta(t,a,n,i,ea,r)}function Nd(t,e,n,i,r,l){let a;if(Un(i,n)!=null)return e;{const h=new Ss(i,e,r),f=e.eventCache.getNode();let d;if(P(n)||D(n)===".priority"){let S;if(e.serverCache.isFullyInitialized())S=ns(i,nt(e));else{const w=e.serverCache.getNode();A(w instanceof L,"serverChildren would be complete if leaf node"),S=Jl(i,w)}S=S,d=t.filter.updateFullNode(f,S,l)}else{const S=D(n);let w=Es(i,S,e.serverCache);w==null&&e.serverCache.isCompleteForChild(S)&&(w=f.getImmediateChild(S)),w!=null?d=t.filter.updateChild(f,S,w,j(n),h,l):e.eventCache.getNode().hasChild(S)?d=t.filter.updateChild(f,S,L.EMPTY_NODE,j(n),h,l):d=f,d.isEmpty()&&e.serverCache.isFullyInitialized()&&(a=ns(i,nt(e)),a.isLeafNode()&&(d=t.filter.updateFullNode(d,a,l)))}return a=e.serverCache.isFullyInitialized()||Un(i,F())!=null,Xt(e,d,a,t.filter.filtersNodes())}}function kd(t,e){const n=nt(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!P(e)&&!n.getImmediateChild(D(e)).isEmpty())?n.getChild(e):null}function Oo(t,e,n,i){e.type===we.MERGE&&e.source.queryId!==null&&(A(nt(t.viewCache_),"We should always have a full cache before handling merges"),A(Zi(t.viewCache_),"Missing event cache, even though we have a server cache"));const r=t.viewCache_,l=Td(t.processor_,r,e,n,i);return Sd(t.processor_,l.viewCache),A(l.viewCache.serverCache.isFullyInitialized()||!r.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=l.viewCache,Dd(t,l.changes,l.viewCache.eventCache.getNode())}function Dd(t,e,n,i){const r=t.eventRegistrations_;return sd(t.eventGenerator_,e,n,r)}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */let Po;function Od(t){A(!Po,"__referenceConstructor has already been defined"),Po=t}function Ts(t,e,n,i){const r=e.source.queryId;if(r!==null){const l=t.views.get(r);return A(l!=null,"SyncTree gave us an op for an invalid query."),Oo(l,e,n,i)}else{let l=[];for(const a of t.views.values())l=l.concat(Oo(a,e,n,i));return l}}function Is(t,e){let n=null;for(const i of t.views.values())n=n||kd(i,e);return n}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */let Mo;function Pd(t){A(!Mo,"__referenceConstructor has already been defined"),Mo=t}class xo{constructor(e){this.listenProvider_=e,this.syncPointTree_=new $(null),this.pendingWriteTree_=vd(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function na(t,e,n,i,r){return ad(t.pendingWriteTree_,e,n,i,r),r?Yn(t,new tt(Wl(),e,n)):[]}function Je(t,e,n=!1){const i=cd(t.pendingWriteTree_,e);if(hd(t.pendingWriteTree_,e)){let l=new $(null);return i.snap!=null?l=l.set(F(),!0):ce(i.children,a=>{l=l.set(new H(a),!0)}),Yn(t,new Hn(i.path,l,n))}else return[]}function Kn(t,e,n){return Yn(t,new tt($l(),e,n))}function Md(t,e,n){const i=$.fromObject(n);return Yn(t,new nn($l(),e,i))}function xd(t,e,n,i){const r=ra(t,i);if(r!=null){const l=oa(r),a=l.path,h=l.queryId,f=de(a,e),d=new tt(Vl(h),f,n);return la(t,a,d)}else return[]}function Ld(t,e,n,i){const r=ra(t,i);if(r){const l=oa(r),a=l.path,h=l.queryId,f=de(a,e),d=$.fromObject(n),S=new nn(Vl(h),f,d);return la(t,a,S)}else return[]}function bs(t,e,n){const r=t.pendingWriteTree_,l=t.syncPointTree_.findOnPath(e,(a,h)=>{const f=de(a,e),d=Is(h,f);if(d)return d});return Xl(r,e,l,n,!0)}function Yn(t,e){return ia(e,t.syncPointTree_,null,Kl(t.pendingWriteTree_,F()))}function ia(t,e,n,i){if(P(t.path))return sa(t,e,n,i);{const r=e.get(F());n==null&&r!=null&&(n=Is(r,F()));let l=[];const a=D(t.path),h=t.operationForChild(a),f=e.children.get(a);if(f&&h){const d=n?n.getImmediateChild(a):null,S=Ql(i,a);l=l.concat(ia(h,f,d,S))}return r&&(l=l.concat(Ts(r,t,i,n))),l}}function sa(t,e,n,i){const r=e.get(F());n==null&&r!=null&&(n=Is(r,F()));let l=[];return e.children.inorderTraversal((a,h)=>{const f=n?n.getImmediateChild(a):null,d=Ql(i,a),S=t.operationForChild(a);S&&(l=l.concat(sa(S,h,f,d)))}),r&&(l=l.concat(Ts(r,t,i,n))),l}function ra(t,e){return t.tagToQueryMap.get(e)}function oa(t){const e=t.indexOf("$");return A(e!==-1&&e{const d=Ns(f,e.getImmediateChild(h),n);d!==f&&(l=l.updateImmediateChild(h,d))}),l}}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class ks{constructor(e="",n=null,i={children:{},childCount:0}){this.name=e,this.parent=n,this.node=i}}function Ds(t,e){let n=e instanceof H?e:new H(e),i=t,r=D(n);for(;r!==null;){const l=_t(i.node.children,r)||{children:{},childCount:0};i=new ks(r,i,l),n=j(n),r=D(n)}return i}function It(t){return t.node.value}function ca(t,e){t.node.value=e,rs(t)}function ha(t){return t.node.childCount>0}function jd(t){return It(t)===void 0&&!ha(t)}function Xn(t,e){ce(t.node.children,(n,i)=>{e(new ks(n,t,i))})}function ua(t,e,n,i){n&&e(t),Xn(t,r=>{ua(r,e,!0)})}function Wd(t,e,n){let i=t.parent;for(;i!==null;){if(e(i))return!0;i=i.parent}return!1}function an(t){return new H(t.parent===null?t.name:an(t.parent)+"/"+t.name)}function rs(t){t.parent!==null&&$d(t.parent,t.name,t)}function $d(t,e,n){const i=jd(n),r=Ee(t.node.children,e);i&&r?(delete t.node.children[e],t.node.childCount--,rs(t)):!i&&!r&&(t.node.children[e]=n.node,t.node.childCount++,rs(t))}/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Vd=/[\[\].#$\/\u0000-\u001F\u007F]/,Gd=/[\[\].#$\u0000-\u001F\u007F]/,Li=10*1024*1024,Os=function(t){return typeof t=="string"&&t.length!==0&&!Vd.test(t)},fa=function(t){return typeof t=="string"&&t.length!==0&&!Gd.test(t)},qd=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),fa(t)},da=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!qn(t)||t&&typeof t=="object"&&Ee(t,".sv")},os=function(t,e,n,i){Jn(mt(t,"value"),e,n)},Jn=function(t,e,n){const i=n instanceof H?new Rf(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+Ye(i));if(typeof e=="function")throw new Error(t+"contains a function "+Ye(i)+" with contents = "+e.toString());if(qn(e))throw new Error(t+"contains "+e.toString()+" "+Ye(i));if(typeof e=="string"&&e.length>Li/3&&Vn(e)>Li)throw new Error(t+"contains a string greater than "+Li+" utf8 bytes "+Ye(i)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let r=!1,l=!1;if(ce(e,(a,h)=>{if(a===".value")r=!0;else if(a!==".priority"&&a!==".sv"&&(l=!0,!Os(a)))throw new Error(t+" contains an invalid key ("+a+") "+Ye(i)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Nf(i,a),Jn(t,h,i),kf(i)}),r&&l)throw new Error(t+' contains ".value" child '+Ye(i)+" in addition to actual children.")}},zd=function(t,e){let n,i;for(n=0;n{const f=new H(a);if(Jn(r,h,G(n,f)),ms(f)===".priority"&&!da(h))throw new Error(r+"contains an invalid value for '"+f.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");l.push(f)}),zd(r,l)},Yd=function(t,e,n){if(qn(e))throw new Error(mt(t,"priority")+"is "+e.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!da(e))throw new Error(mt(t,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")},pa=function(t,e,n,i){if(!fa(n))throw new Error(mt(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},Xd=function(t,e,n,i){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),pa(t,e,n)},qt=function(t,e){if(D(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},Jd=function(t,e){const n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!Os(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!qd(n))throw new Error(mt(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Qd{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function ga(t,e){let n=null;for(let i=0;ipe(i,e)||pe(e,i))}function Zd(t,e){t.recursionDepth_++;let n=!0;for(let i=0;i{Fo(t,i,r,l,a)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>Bo(t,!0),0);else{if(typeof n<"u"&&n!==null){if(typeof n!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Q(n)}catch(i){throw new Error("Invalid authOverride provided: "+i)}}t.persistentConnection_=new Ie(t.repoInfo_,e,(i,r,l,a)=>{Fo(t,i,r,l,a)},i=>{Bo(t,i)},i=>{op(t,i)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(i=>{t.server_.refreshAuthToken(i)}),t.appCheckProvider_.addTokenChangeListener(i=>{t.server_.refreshAppCheckToken(i.token)}),t.statsReporter_=nf(t.repoInfo_,()=>new id(t.stats_,t.server_)),t.infoData_=new Qf,t.infoSyncTree_=new xo({startListening:(i,r,l,a)=>{let h=[];const f=t.infoData_.getNode(i._path);return f.isEmpty()||(h=Kn(t.infoSyncTree_,i._path,f),setTimeout(()=>{a("ok")},0)),h},stopListening:()=>{}}),Ms(t,"connected",!1),t.serverSyncTree_=new xo({startListening:(i,r,l,a)=>(t.server_.listen(i,l,r,(h,f)=>{const d=a(h,f);Re(t.eventQueue_,i._path,d)}),[]),stopListening:(i,r)=>{t.server_.unlisten(i,r)}})}function rp(t){const n=t.infoData_.getNode(new H(".info/serverTimeOffset")).val()||0;return new Date().getTime()+n}function Ps(t){return Fd({timestamp:rp(t)})}function Fo(t,e,n,i,r){t.dataUpdateCount++;const l=new H(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let a=[];if(r)if(i){const f=Nn(n,d=>q(d));a=Ld(t.serverSyncTree_,l,f,r)}else{const f=q(n);a=xd(t.serverSyncTree_,l,f,r)}else if(i){const f=Nn(n,d=>q(d));a=Md(t.serverSyncTree_,l,f)}else{const f=q(n);a=Kn(t.serverSyncTree_,l,f)}let h=l;a.length>0&&(h=Qn(t,l)),Re(t.eventQueue_,h,a)}function Bo(t,e){Ms(t,"connected",e),e===!1&&ap(t)}function op(t,e){ce(e,(n,i)=>{Ms(t,n,i)})}function Ms(t,e,n){const i=new H("/.info/"+e),r=q(n);t.infoData_.updateSnapshot(i,r);const l=Kn(t.infoSyncTree_,i,r);Re(t.eventQueue_,i,l)}function _a(t){return t.nextWriteId_++}function lp(t,e,n,i,r){xs(t,"set",{path:e.toString(),value:n,priority:i});const l=Ps(t),a=q(n,i),h=bs(t.serverSyncTree_,e),f=aa(a,h,l),d=_a(t),S=na(t.serverSyncTree_,e,f,d,!0);ga(t.eventQueue_,S),t.server_.put(e.toString(),a.val(!0),(I,R)=>{const N=I==="ok";N||ae("set at "+e+" failed: "+I);const O=Je(t.serverSyncTree_,d,!N);Re(t.eventQueue_,e,O),Ct(t,r,I,R)});const w=Ca(t,e);Qn(t,w),Re(t.eventQueue_,w,[])}function ap(t){xs(t,"onDisconnectEvents");const e=Ps(t),n=Bn();Qi(t.onDisconnect_,F(),(r,l)=>{const a=Ud(r,l,t.serverSyncTree_,e);Tt(n,r,a)});let i=[];Qi(n,F(),(r,l)=>{i=i.concat(Kn(t.serverSyncTree_,r,l));const a=Ca(t,r);Qn(t,a)}),t.onDisconnect_=Bn(),Re(t.eventQueue_,F(),i)}function cp(t,e,n){t.server_.onDisconnectCancel(e.toString(),(i,r)=>{i==="ok"&&Ji(t.onDisconnect_,e),Ct(t,n,i,r)})}function Ho(t,e,n,i){const r=q(n);t.server_.onDisconnectPut(e.toString(),r.val(!0),(l,a)=>{l==="ok"&&Tt(t.onDisconnect_,e,r),Ct(t,i,l,a)})}function hp(t,e,n,i,r){const l=q(n,i);t.server_.onDisconnectPut(e.toString(),l.val(!0),(a,h)=>{a==="ok"&&Tt(t.onDisconnect_,e,l),Ct(t,r,a,h)})}function up(t,e,n,i){if(ji(n)){J("onDisconnect().update() called with empty data. Don't do anything."),Ct(t,i,"ok",void 0);return}t.server_.onDisconnectMerge(e.toString(),n,(r,l)=>{r==="ok"&&ce(n,(a,h)=>{const f=q(h);Tt(t.onDisconnect_,G(e,a),f)}),Ct(t,i,r,l)})}function fp(t){t.persistentConnection_&&t.persistentConnection_.interrupt(tp)}function xs(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),J(n,...e)}function Ct(t,e,n,i){e&&St(()=>{if(n==="ok")e(null);else{const r=(n||"error").toUpperCase();let l=r;i&&(l+=": "+i);const a=new Error(l);a.code=r,e(a)}})}function ma(t,e,n){return bs(t.serverSyncTree_,e,n)||L.EMPTY_NODE}function Ls(t,e=t.transactionQueueTree_){if(e||Zn(t,e),It(e)){const n=va(t,e);A(n.length>0,"Sending zero length transaction queue"),n.every(r=>r.status===0)&&dp(t,an(e),n)}else ha(e)&&Xn(e,n=>{Ls(t,n)})}function dp(t,e,n){const i=n.map(d=>d.currentWriteId),r=ma(t,e,i);let l=r;const a=r.hash();for(let d=0;d{xs(t,"transaction put response",{path:f.toString(),status:d});let S=[];if(d==="ok"){const w=[];for(let I=0;In[I].onComplete(null,!0,n[I].currentOutputSnapshotResolved)),n[I].unwatcher();Zn(t,Ds(t.transactionQueueTree_,e)),Ls(t,t.transactionQueueTree_),Re(t.eventQueue_,e,S);for(let I=0;Ih.status===0).map(h=>h.currentWriteId);for(let h=0;h=np)S=!0,w="maxretry",r=r.concat(Je(t.serverSyncTree_,f.currentWriteId,!0));else{const I=ma(t,f.path,a);f.currentInputSnapshot=I;const R=e[h].update(I.val());if(R!==void 0){Jn("transaction failed: Data returned ",R,f.path);let N=q(R);typeof R=="object"&&R!=null&&Ee(R,".priority")||(N=N.updatePriority(I.getPriority()));const M=f.currentWriteId,he=Ps(t),ee=aa(N,I,he);f.currentOutputSnapshotRaw=N,f.currentOutputSnapshotResolved=ee,f.currentWriteId=_a(t),a.splice(a.indexOf(M),1),r=r.concat(na(t.serverSyncTree_,f.path,ee,f.currentWriteId,f.applyLocally)),r=r.concat(Je(t.serverSyncTree_,M,!0))}else S=!0,w="nodata",r=r.concat(Je(t.serverSyncTree_,f.currentWriteId,!0))}Re(t.eventQueue_,n,r),r=[],S&&(e[h].status=2,(function(I){setTimeout(I,Math.floor(0))})(e[h].unwatcher),e[h].onComplete&&(w==="nodata"?i.push(()=>e[h].onComplete(null,!1,e[h].currentInputSnapshot)):i.push(()=>e[h].onComplete(new Error(w),!1,null))))}Zn(t,t.transactionQueueTree_);for(let h=0;hi.order-r.order),n}function wa(t,e,n){const i=It(e);if(i)for(let r=0;r{wa(t,r,n)})}function Zn(t,e){const n=It(e);if(n){let i=0;for(let r=0;r0?n:void 0)}Xn(e,i=>{Zn(t,i)})}function Ca(t,e){const n=an(ya(t,e)),i=Ds(t.transactionQueueTree_,e);return Wd(i,r=>{Fi(t,r)}),Fi(t,i),ua(i,r=>{Fi(t,r)}),n}function Fi(t,e){const n=It(e);if(n){const i=[];let r=[],l=-1;for(let a=0;a0){let r=n[i];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch{}e+="/"+r}return e}function _p(t){const e={};t.charAt(0)==="?"&&(t=t.substring(1));for(const n of t.split("&")){if(n.length===0)continue;const i=n.split("=");i.length===2?e[decodeURIComponent(i[0])]=decodeURIComponent(i[1]):ae(`Invalid query segment '${n}' in query '${t}'`)}return e}const Uo=function(t,e){const n=mp(t),i=n.namespace;n.domain==="firebase.com"&&Ae(n.host+" is no longer supported. Please use .firebaseio.com instead"),(!i||i==="undefined")&&n.domain!=="localhost"&&Ae("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.secure||$u();const r=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new Il(n.host,n.secure,i,r,e,"",i!==n.subdomain),path:new H(n.pathString)}},mp=function(t){let e="",n="",i="",r="",l="",a=!0,h="https",f=443;if(typeof t=="string"){let d=t.indexOf("//");d>=0&&(h=t.substring(0,d-1),t=t.substring(d+2));let S=t.indexOf("/");S===-1&&(S=t.length);let w=t.indexOf("?");w===-1&&(w=t.length),e=t.substring(0,Math.min(S,w)),S=0?(a=h==="https"||h==="wss",f=parseInt(e.substring(d+1),10)):d=e.length;const R=e.slice(0,d);if(R.toLowerCase()==="localhost")n="localhost";else if(R.split(".").length<=2)n=R;else{const N=e.indexOf(".");i=e.substring(0,N).toLowerCase(),n=e.substring(N+1),l=i}"ns"in I&&(l=I.ns)}return{host:e,port:f,domain:n,subdomain:i,secure:a,scheme:h,pathString:r,namespace:l}};/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class yp{constructor(e,n){this._repo=e,this._path=n}cancel(){const e=new Se;return cp(this._repo,this._path,e.wrapCallback(()=>{})),e.promise}remove(){qt("OnDisconnect.remove",this._path);const e=new Se;return Ho(this._repo,this._path,null,e.wrapCallback(()=>{})),e.promise}set(e){qt("OnDisconnect.set",this._path),os("OnDisconnect.set",e,this._path);const n=new Se;return Ho(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}setWithPriority(e,n){qt("OnDisconnect.setWithPriority",this._path),os("OnDisconnect.setWithPriority",e,this._path),Yd("OnDisconnect.setWithPriority",n);const i=new Se;return hp(this._repo,this._path,e,n,i.wrapCallback(()=>{})),i.promise}update(e){qt("OnDisconnect.update",this._path),Kd("OnDisconnect.update",e,this._path);const n=new Se;return up(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}}/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */class Fs{constructor(e,n,i,r){this._repo=e,this._path=n,this._queryParams=i,this._orderByCalled=r}get key(){return P(this._path)?null:ms(this._path)}get ref(){return new at(this._repo,this._path)}get _queryIdentifier(){const e=To(this._queryParams),n=ds(e);return n==="{}"?"default":n}get _queryObject(){return To(this._queryParams)}isEqual(e){if(e=Ne(e),!(e instanceof Fs))return!1;const n=this._repo===e._repo,i=xl(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return n&&i&&r}toJSON(){return this.toString()}toString(){return this._repo.toString()+bf(this._path)}}class at extends Fs{constructor(e,n){super(e,n,new ws,!1)}get parent(){const e=Ml(this._path);return e===null?null:new at(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}}function Ag(t,e){return t=Ne(t),t._checkNotDeleted("ref"),e!==void 0?vp(t._root,e):t._root}function vp(t,e){return t=Ne(t),D(t._path)===null?Xd("child","path",e):pa("child","path",e),new at(t._repo,G(t._path,e))}function Rg(t){return t=Ne(t),new yp(t._repo,t._path)}function Ng(t,e){t=Ne(t),qt("set",t._path),os("set",e,t._path);const n=new Se;return lp(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}Od(at);Pd(at);/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const wp="FIREBASE_DATABASE_EMULATOR_HOST",ls={};let Cp=!1;function Ep(t,e,n,i){const r=e.lastIndexOf(":"),l=e.substring(0,r),a=sn(l);t.repoInfo_=new Il(e,a,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0,n),i&&(t.authTokenProvider_=i)}function Sp(t,e,n,i,r){let l=i||t.options.databaseURL;l===void 0&&(t.options.projectId||Ae("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),J("Using default host for project ",t.options.projectId),l=`${t.options.projectId}-default-rtdb.firebaseio.com`);let a=Uo(l,r),h=a.repoInfo,f;typeof process<"u"&&so&&(f=so[wp]),f?(l=`http://${f}?ns=${h.namespace}`,a=Uo(l,r),h=a.repoInfo):a.repoInfo.secure;const d=new Zu(t.name,t.options,e);Jd("Invalid Firebase Database URL",a),P(a.path)||Ae("Database URL must point to the root of a Firebase Database (not including a child path).");const S=Ip(h,t,d,new Qu(t,n));return new bp(S,t)}function Tp(t,e){const n=ls[e];(!n||n[t.key]!==t)&&Ae(`Database ${e}(${t.repoInfo_}) has already been deleted.`),fp(t),delete n[t.key]}function Ip(t,e,n,i){let r=ls[e.name];r||(r={},ls[e.name]=r);let l=r[t.toURLString()];return l&&Ae("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),l=new ip(t,Cp,n,i),r[t.toURLString()]=l,l}class bp{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(sp(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new at(this._repo,F())),this._rootInternal}_delete(){return this._rootInternal!==null&&(Tp(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&Ae("Cannot call "+e+" on a deleted database.")}}function kg(t=rl(),e){const n=Gn(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){const i=zo("database");i&&Ap(n,...i)}return n}function Ap(t,e,n,i={}){t=Ne(t),t._checkNotDeleted("useEmulator");const r=`${e}:${n}`,l=t._repoInternal;if(t._instanceStarted){if(r===t._repoInternal.repoInfo_.host&&kn(i,l.repoInfo_.emulatorOptions))return;Ae("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let a;if(l.repoInfo_.nodeAdmin)i.mockUserToken&&Ae('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),a=new An(An.OWNER);else if(i.mockUserToken){const h=typeof i.mockUserToken=="string"?i.mockUserToken:Rc(i.mockUserToken,t.app.options.projectId);a=new An(h)}sn(e)&&(Yo(e),Xo("Database",!0)),Ep(l,r,i,a)}/** - * @license - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Rp(t){Fu(zh),Ze(new Ue("database",(e,{instanceIdentifier:n})=>{const i=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),l=e.getProvider("app-check-internal");return Sp(i,r,l,n)},"PUBLIC").setMultipleInstances(!0)),Ce(ro,oo,t),Ce(ro,oo,"esm2020")}/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Np={".sv":"timestamp"};function Dg(){return Np}Ie.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Ie.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};Rp();const Ea="@firebase/installations",Bs="0.6.19";/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Sa=1e4,Ta=`w:${Bs}`,Ia="FIS_v2",kp="https://firebaseinstallations.googleapis.com/v1",Dp=3600*1e3,Op="installations",Pp="Installations";/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Mp={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},it=new hs(Op,Pp,Mp);function ba(t){return t instanceof rt&&t.code.includes("request-failed")}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Aa({projectId:t}){return`${kp}/projects/${t}/installations`}function Ra(t){return{token:t.token,requestStatus:2,expiresIn:Lp(t.expiresIn),creationTime:Date.now()}}async function Na(t,e){const i=(await e.json()).error;return it.create("request-failed",{requestName:t,serverCode:i.code,serverMessage:i.message,serverStatus:i.status})}function ka({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function xp(t,{refreshToken:e}){const n=ka(t);return n.append("Authorization",Fp(e)),n}async function Da(t){const e=await t();return e.status>=500&&e.status<600?t():e}function Lp(t){return Number(t.replace("s","000"))}function Fp(t){return`${Ia} ${t}`}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */async function Bp({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const i=Aa(t),r=ka(t),l=e.getImmediate({optional:!0});if(l){const d=await l.getHeartbeatsHeader();d&&r.append("x-firebase-client",d)}const a={fid:n,authVersion:Ia,appId:t.appId,sdkVersion:Ta},h={method:"POST",headers:r,body:JSON.stringify(a)},f=await Da(()=>fetch(i,h));if(f.ok){const d=await f.json();return{fid:d.fid||n,registrationStatus:2,refreshToken:d.refreshToken,authToken:Ra(d.authToken)}}else throw await Na("Create Installation",f)}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Oa(t){return new Promise(e=>{setTimeout(e,t)})}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function Hp(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Up=/^[cdef][\w-]{21}$/,as="";function jp(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const n=Wp(t);return Up.test(n)?n:as}catch{return as}}function Wp(t){return Hp(t).substr(0,22)}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function ei(t){return`${t.appName}!${t.appId}`}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const Pa=new Map;function Ma(t,e){const n=ei(t);xa(n,e),$p(n,e)}function xa(t,e){const n=Pa.get(t);if(n)for(const i of n)i(e)}function $p(t,e){const n=Vp();n&&n.postMessage({key:t,fid:e}),Gp()}let Qe=null;function Vp(){return!Qe&&"BroadcastChannel"in self&&(Qe=new BroadcastChannel("[Firebase] FID Change"),Qe.onmessage=t=>{xa(t.data.key,t.data.fid)}),Qe}function Gp(){Pa.size===0&&Qe&&(Qe.close(),Qe=null)}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */const qp="firebase-installations-database",zp=1,st="firebase-installations-store";let Bi=null;function Hs(){return Bi||(Bi=il(qp,zp,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(st)}}})),Bi}async function Wn(t,e){const n=ei(t),r=(await Hs()).transaction(st,"readwrite"),l=r.objectStore(st),a=await l.get(n);return await l.put(e,n),await r.done,(!a||a.fid!==e.fid)&&Ma(t,e.fid),e}async function La(t){const e=ei(t),i=(await Hs()).transaction(st,"readwrite");await i.objectStore(st).delete(e),await i.done}async function ti(t,e){const n=ei(t),r=(await Hs()).transaction(st,"readwrite"),l=r.objectStore(st),a=await l.get(n),h=e(a);return h===void 0?await l.delete(n):await l.put(h,n),await r.done,h&&(!a||a.fid!==h.fid)&&Ma(t,h.fid),h}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */async function Us(t){let e;const n=await ti(t.appConfig,i=>{const r=Kp(i),l=Yp(t,r);return e=l.registrationPromise,l.installationEntry});return n.fid===as?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}function Kp(t){const e=t||{fid:jp(),registrationStatus:0};return Fa(e)}function Yp(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const r=Promise.reject(it.create("app-offline"));return{installationEntry:e,registrationPromise:r}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},i=Xp(t,n);return{installationEntry:n,registrationPromise:i}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:Jp(t)}:{installationEntry:e}}async function Xp(t,e){try{const n=await Bp(t,e);return Wn(t.appConfig,n)}catch(n){throw ba(n)&&n.customData.serverCode===409?await La(t.appConfig):await Wn(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}async function Jp(t){let e=await jo(t.appConfig);for(;e.registrationStatus===1;)await Oa(100),e=await jo(t.appConfig);if(e.registrationStatus===0){const{installationEntry:n,registrationPromise:i}=await Us(t);return i||n}return e}function jo(t){return ti(t,e=>{if(!e)throw it.create("installation-not-found");return Fa(e)})}function Fa(t){return Qp(t)?{fid:t.fid,registrationStatus:0}:t}function Qp(t){return t.registrationStatus===1&&t.registrationTime+Safetch(i,h));if(f.ok){const d=await f.json();return Ra(d)}else throw await Na("Generate Auth Token",f)}function eg(t,{fid:e}){return`${Aa(t)}/${e}/authTokens:generate`}/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */async function js(t,e=!1){let n;const i=await ti(t.appConfig,l=>{if(!Ba(l))throw it.create("not-registered");const a=l.authToken;if(!e&&ig(a))return l;if(a.requestStatus===1)return n=tg(t,e),l;{if(!navigator.onLine)throw it.create("app-offline");const h=rg(l);return n=ng(t,h),h}});return n?await n:i.authToken}async function tg(t,e){let n=await Wo(t.appConfig);for(;n.authToken.requestStatus===1;)await Oa(100),n=await Wo(t.appConfig);const i=n.authToken;return i.requestStatus===0?js(t,e):i}function Wo(t){return ti(t,e=>{if(!Ba(e))throw it.create("not-registered");const n=e.authToken;return og(n)?{...e,authToken:{requestStatus:0}}:e})}async function ng(t,e){try{const n=await Zp(t,e),i={...e,authToken:n};return await Wn(t.appConfig,i),n}catch(n){if(ba(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await La(t.appConfig);else{const i={...e,authToken:{requestStatus:0}};await Wn(t.appConfig,i)}throw n}}function Ba(t){return t!==void 0&&t.registrationStatus===2}function ig(t){return t.requestStatus===2&&!sg(t)}function sg(t){const e=Date.now();return e{const e=t.getProvider("app").getImmediate(),n=hg(e),i=Gn(e,"heartbeat");return{app:e,appConfig:n,heartbeatServiceProvider:i,_delete:()=>Promise.resolve()}},dg=t=>{const e=t.getProvider("app").getImmediate(),n=Gn(e,Ha).getImmediate();return{getId:()=>lg(n),getToken:r=>ag(n,r)}};function pg(){Ze(new Ue(Ha,fg,"PUBLIC")),Ze(new Ue(ug,dg,"PRIVATE"))}pg();Ce(Ea,Bs);Ce(Ea,Bs,"esm2020");export{Ng as $,vg as A,gu as B,Ue as C,pu as D,hs as E,rt as F,uu as G,fu as H,lu as I,_u as J,du as K,el as L,au as M,Mc as N,xc as O,Tg as P,wg as Q,Kh as R,zh as S,Ig as T,Lu as U,kg as V,hu as W,cu as X,bg as Y,Ag as Z,Ze as _,Oc as a,Dg as a0,Rg as a1,mg as b,sl as c,Ne as d,Sg as e,U as f,gg as g,Jo as h,Qo as i,Ui as j,sn as k,Gn as l,Ac as m,rl as n,kn as o,Yo as p,jc as q,Ce as r,yg as s,ji as t,Xo as u,Cg as v,Eg as w,_g as x,zo as y,Rc as z}; diff --git a/assets/vendor-firebase-firestore-BML5nJHm.js b/assets/vendor-firebase-firestore-C0C-blIn.js similarity index 92% rename from assets/vendor-firebase-firestore-BML5nJHm.js rename to assets/vendor-firebase-firestore-C0C-blIn.js index f9456dac6d08a08ef31058800199016bd03d97dc..44e3a0f37727279d272caf4d92a9202fc3d449ba 100644 --- a/assets/vendor-firebase-firestore-BML5nJHm.js +++ b/assets/vendor-firebase-firestore-C0C-blIn.js @@ -1,4 +1,4 @@ -import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k as vs,p as so,u as io,o as Rs,z as oo,A as ao,h as uo,M as co,B as lo,D as ho,X as fo,G as mo,H as fn,W as Pt,J as _o,K as wr,_ as po,C as go,r as vr,S as yo}from"./vendor-firebase-core-DQ-pMjxd.js";/** +import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k as vs,p as so,u as io,o as Rs,z as oo,A as ao,h as uo,M as co,B as lo,D as ho,X as fo,G as mo,H as fn,W as Vt,J as _o,K as wr,_ as po,C as go,r as vr,S as yo}from"./vendor-firebase-core-BireMWc7.js";/** * @license * Copyright 2017 Google LLC * @@ -58,7 +58,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ce=new Xi("@firebase/firestore");function Fe(){return Ce.logLevel}function g(r,...e){if(Ce.logLevel<=ce.DEBUG){const t=e.map(Fn);Ce.debug(`Firestore (${Ke}): ${r}`,...t)}}function he(r,...e){if(Ce.logLevel<=ce.ERROR){const t=e.map(Fn);Ce.error(`Firestore (${Ke}): ${r}`,...t)}}function be(r,...e){if(Ce.logLevel<=ce.WARN){const t=e.map(Fn);Ce.warn(`Firestore (${Ke}): ${r}`,...t)}}function Fn(r){if(typeof r=="string")return r;try{return(function(t){return JSON.stringify(t)})(r)}catch{return r}}/** + */const Ce=new Xi("@firebase/firestore");function Le(){return Ce.logLevel}function g(r,...e){if(Ce.logLevel<=ce.DEBUG){const t=e.map(Ln);Ce.debug(`Firestore (${Ke}): ${r}`,...t)}}function he(r,...e){if(Ce.logLevel<=ce.ERROR){const t=e.map(Ln);Ce.error(`Firestore (${Ke}): ${r}`,...t)}}function be(r,...e){if(Ce.logLevel<=ce.WARN){const t=e.map(Ln);Ce.warn(`Firestore (${Ke}): ${r}`,...t)}}function Ln(r){if(typeof r=="string")return r;try{return(function(t){return JSON.stringify(t)})(r)}catch{return r}}/** * @license * Copyright 2017 Google LLC * @@ -148,7 +148,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Ln{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516);let n="";for(;n.length<20;){const s=Vo(40);for(let i=0;ie?1:0}function Tn(r,e){const t=Math.min(r.length,e.length);for(let n=0;n=Po&&e<=So}function Be(r,e,t){return r.length===e.length&&r.every(((n,s)=>t(n,e[s])))}/** + */class On{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516);let n="";for(;n.length<20;){const s=Vo(40);for(let i=0;ie?1:0}function Tn(r,e){const t=Math.min(r.length,e.length);for(let n=0;n=Po&&e<=So}function Be(r,e,t){return r.length===e.length&&r.every(((n,s)=>t(n,e[s])))}/** * @license * Copyright 2017 Google LLC * @@ -193,7 +193,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Ss(r,e,t){if(!t)throw new p(d.INVALID_ARGUMENT,`Function ${r}() cannot be called with an empty ${e}.`)}function bo(r,e,t,n){if(e===!0&&n===!0)throw new p(d.INVALID_ARGUMENT,`${r} and ${t} cannot be used together.`)}function Pr(r){if(!y.isDocumentKey(r))throw new p(d.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${r} has ${r.length}.`)}function Sr(r){if(y.isDocumentKey(r))throw new p(d.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${r} has ${r.length}.`)}function Cs(r){return typeof r=="object"&&r!==null&&(Object.getPrototypeOf(r)===Object.prototype||Object.getPrototypeOf(r)===null)}function Wt(r){if(r===void 0)return"undefined";if(r===null)return"null";if(typeof r=="string")return r.length>20&&(r=`${r.substring(0,20)}...`),JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean")return""+r;if(typeof r=="object"){if(r instanceof Array)return"an array";{const e=(function(n){return n.constructor?n.constructor.name:null})(r);return e?`a custom ${e} object`:"an object"}}return typeof r=="function"?"a function":E(12329,{type:typeof r})}function K(r,e){if("_delegate"in r&&(r=r._delegate),!(r instanceof e)){if(e.name===r.constructor.name)throw new p(d.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=Wt(r);throw new p(d.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return r}function No(r,e){if(e<=0)throw new p(d.INVALID_ARGUMENT,`Function ${r}() requires a positive number, but it was: ${e}.`)}/** + */function Ss(r,e,t){if(!t)throw new p(d.INVALID_ARGUMENT,`Function ${r}() cannot be called with an empty ${e}.`)}function bo(r,e,t,n){if(e===!0&&n===!0)throw new p(d.INVALID_ARGUMENT,`${r} and ${t} cannot be used together.`)}function Pr(r){if(!y.isDocumentKey(r))throw new p(d.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${r} has ${r.length}.`)}function Sr(r){if(y.isDocumentKey(r))throw new p(d.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${r} has ${r.length}.`)}function Cs(r){return typeof r=="object"&&r!==null&&(Object.getPrototypeOf(r)===Object.prototype||Object.getPrototypeOf(r)===null)}function Kt(r){if(r===void 0)return"undefined";if(r===null)return"null";if(typeof r=="string")return r.length>20&&(r=`${r.substring(0,20)}...`),JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean")return""+r;if(typeof r=="object"){if(r instanceof Array)return"an array";{const e=(function(n){return n.constructor?n.constructor.name:null})(r);return e?`a custom ${e} object`:"an object"}}return typeof r=="function"?"a function":E(12329,{type:typeof r})}function K(r,e){if("_delegate"in r&&(r=r._delegate),!(r instanceof e)){if(e.name===r.constructor.name)throw new p(d.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=Kt(r);throw new p(d.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return r}function No(r,e){if(e<=0)throw new p(d.INVALID_ARGUMENT,`Function ${r}() requires a positive number, but it was: ${e}.`)}/** * @license * Copyright 2025 Google LLC * @@ -208,7 +208,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function O(r,e){const t={typeString:r};return e&&(t.value=e),t}function pt(r,e){if(!Cs(r))throw new p(d.INVALID_ARGUMENT,"JSON must be an object");let t;for(const n in e)if(e[n]){const s=e[n].typeString,i="value"in e[n]?{value:e[n].value}:void 0;if(!(n in r)){t=`JSON missing required field: '${n}'`;break}const o=r[n];if(s&&typeof o!==s){t=`JSON field '${n}' must be a ${s}.`;break}if(i!==void 0&&o!==i.value){t=`Expected '${n}' field to equal '${i.value}'`;break}}if(t)throw new p(d.INVALID_ARGUMENT,t);return!0}/** + */function F(r,e){const t={typeString:r};return e&&(t.value=e),t}function pt(r,e){if(!Cs(r))throw new p(d.INVALID_ARGUMENT,"JSON must be an object");let t;for(const n in e)if(e[n]){const s=e[n].typeString,i="value"in e[n]?{value:e[n].value}:void 0;if(!(n in r)){t=`JSON missing required field: '${n}'`;break}const o=r[n];if(s&&typeof o!==s){t=`JSON field '${n}' must be a ${s}.`;break}if(i!==void 0&&o!==i.value){t=`Expected '${n}' field to equal '${i.value}'`;break}}if(t)throw new p(d.INVALID_ARGUMENT,t);return!0}/** * @license * Copyright 2017 Google LLC * @@ -223,7 +223,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Cr=-62135596800,br=1e6;class b{static now(){return b.fromMillis(Date.now())}static fromDate(e){return b.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor((e-1e3*t)*br);return new b(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new p(d.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new p(d.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e=253402300800)throw new p(d.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/br}_compareTo(e){return this.seconds===e.seconds?R(this.nanoseconds,e.nanoseconds):R(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:b._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(pt(e,b._jsonSchema))return new b(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-Cr;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}b._jsonSchemaVersion="firestore/timestamp/1.0",b._jsonSchema={type:O("string",b._jsonSchemaVersion),seconds:O("number"),nanoseconds:O("number")};/** + */const Cr=-62135596800,br=1e6;class b{static now(){return b.fromMillis(Date.now())}static fromDate(e){return b.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor((e-1e3*t)*br);return new b(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new p(d.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new p(d.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e=253402300800)throw new p(d.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/br}_compareTo(e){return this.seconds===e.seconds?R(this.nanoseconds,e.nanoseconds):R(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:b._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(pt(e,b._jsonSchema))return new b(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-Cr;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}b._jsonSchemaVersion="firestore/timestamp/1.0",b._jsonSchema={type:F("string",b._jsonSchemaVersion),seconds:F("number"),nanoseconds:F("number")};/** * @license * Copyright 2017 Google LLC * @@ -268,7 +268,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Fo="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Lo{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}/** + */const Lo="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Oo{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}/** * @license * Copyright 2017 Google LLC * @@ -283,7 +283,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function We(r){if(r.code!==d.FAILED_PRECONDITION||r.message!==Fo)throw r;g("LocalStore","Unexpectedly lost primary lease")}/** + */async function We(r){if(r.code!==d.FAILED_PRECONDITION||r.message!==Lo)throw r;g("LocalStore","Unexpectedly lost primary lease")}/** * @license * Copyright 2017 Google LLC * @@ -298,7 +298,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class m{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&E(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new m(((n,s)=>{this.nextCallback=i=>{this.wrapSuccess(e,i).next(n,s)},this.catchCallback=i=>{this.wrapFailure(t,i).next(n,s)}}))}toPromise(){return new Promise(((e,t)=>{this.next(e,t)}))}wrapUserFunction(e){try{const t=e();return t instanceof m?t:m.resolve(t)}catch(t){return m.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):m.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):m.reject(t)}static resolve(e){return new m(((t,n)=>{t(e)}))}static reject(e){return new m(((t,n)=>{n(e)}))}static waitFor(e){return new m(((t,n)=>{let s=0,i=0,o=!1;e.forEach((a=>{++s,a.next((()=>{++i,o&&i===s&&t()}),(u=>n(u)))})),o=!0,i===s&&t()}))}static or(e){let t=m.resolve(!1);for(const n of e)t=t.next((s=>s?m.resolve(s):n()));return t}static forEach(e,t){const n=[];return e.forEach(((s,i)=>{n.push(t.call(this,s,i))})),this.waitFor(n)}static mapArray(e,t){return new m(((n,s)=>{const i=e.length,o=new Array(i);let a=0;for(let u=0;u{o[c]=l,++a,a===i&&n(o)}),(l=>s(l)))}}))}static doWhile(e,t){return new m(((n,s)=>{const i=()=>{e()===!0?t().next((()=>{i()}),s):n()};i()}))}}function Oo(r){const e=r.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}function He(r){return r.name==="IndexedDbTransactionError"}/** + */class m{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&E(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new m(((n,s)=>{this.nextCallback=i=>{this.wrapSuccess(e,i).next(n,s)},this.catchCallback=i=>{this.wrapFailure(t,i).next(n,s)}}))}toPromise(){return new Promise(((e,t)=>{this.next(e,t)}))}wrapUserFunction(e){try{const t=e();return t instanceof m?t:m.resolve(t)}catch(t){return m.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):m.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):m.reject(t)}static resolve(e){return new m(((t,n)=>{t(e)}))}static reject(e){return new m(((t,n)=>{n(e)}))}static waitFor(e){return new m(((t,n)=>{let s=0,i=0,o=!1;e.forEach((a=>{++s,a.next((()=>{++i,o&&i===s&&t()}),(u=>n(u)))})),o=!0,i===s&&t()}))}static or(e){let t=m.resolve(!1);for(const n of e)t=t.next((s=>s?m.resolve(s):n()));return t}static forEach(e,t){const n=[];return e.forEach(((s,i)=>{n.push(t.call(this,s,i))})),this.waitFor(n)}static mapArray(e,t){return new m(((n,s)=>{const i=e.length,o=new Array(i);let a=0;for(let u=0;u{o[c]=l,++a,a===i&&n(o)}),(l=>s(l)))}}))}static doWhile(e,t){return new m(((n,s)=>{const i=()=>{e()===!0?t().next((()=>{i()}),s):n()};i()}))}}function Fo(r){const e=r.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}function He(r){return r.name==="IndexedDbTransactionError"}/** * @license * Copyright 2018 Google LLC * @@ -313,7 +313,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Ht{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=n=>this.ae(n),this.ue=n=>t.writeSequenceNumber(n))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}Ht.ce=-1;/** + */class Wt{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=n=>this.ae(n),this.ue=n=>t.writeSequenceNumber(n))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}Wt.ce=-1;/** * @license * Copyright 2017 Google LLC * @@ -328,7 +328,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const On=-1;function Yt(r){return r==null}function Ot(r){return r===0&&1/r==-1/0}function Mo(r){return typeof r=="number"&&Number.isInteger(r)&&!Ot(r)&&r<=Number.MAX_SAFE_INTEGER&&r>=Number.MIN_SAFE_INTEGER}/** + */const Fn=-1;function Ht(r){return r==null}function Ot(r){return r===0&&1/r==-1/0}function Mo(r){return typeof r=="number"&&Number.isInteger(r)&&!Ot(r)&&r<=Number.MAX_SAFE_INTEGER&&r>=Number.MIN_SAFE_INTEGER}/** * @license * Copyright 2017 Google LLC * @@ -373,7 +373,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class N{constructor(e,t){this.comparator=e,this.root=t||B.EMPTY}insert(e,t){return new N(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,B.BLACK,null,null))}remove(e){return new N(this.comparator,this.root.remove(e,this.comparator).copy(null,null,B.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(n===0)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(e,n.key);if(s===0)return t+n.left.size;s<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((t,n)=>(e(t,n),!1)))}toString(){const e=[];return this.inorderTraversal(((t,n)=>(e.push(`${t}:${n}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new St(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new St(this.root,e,this.comparator,!1)}getReverseIterator(){return new St(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new St(this.root,e,this.comparator,!0)}}class St{constructor(e,t,n,s){this.isReverse=s,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&s&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class B{constructor(e,t,n,s,i){this.key=e,this.value=t,this.color=n??B.RED,this.left=s??B.EMPTY,this.right=i??B.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,s,i){return new B(e??this.key,t??this.value,n??this.color,s??this.left,i??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let s=this;const i=n(e,s.key);return s=i<0?s.copy(null,null,null,s.left.insert(e,t,n),null):i===0?s.copy(null,t,null,null,null):s.copy(null,null,null,null,s.right.insert(e,t,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return B.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,s=this;if(t(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,t),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),t(e,s.key)===0){if(s.right.isEmpty())return B.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,t))}return s.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,B.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,B.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw E(43730,{key:this.key,value:this.value});if(this.right.isRed())throw E(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw E(27949);return e+(this.isRed()?0:1)}}B.EMPTY=null,B.RED=!0,B.BLACK=!1;B.EMPTY=new class{constructor(){this.size=0}get key(){throw E(57766)}get value(){throw E(16141)}get color(){throw E(16727)}get left(){throw E(29726)}get right(){throw E(36894)}copy(e,t,n,s,i){return this}insert(e,t,n){return new B(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** + */class N{constructor(e,t){this.comparator=e,this.root=t||B.EMPTY}insert(e,t){return new N(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,B.BLACK,null,null))}remove(e){return new N(this.comparator,this.root.remove(e,this.comparator).copy(null,null,B.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(n===0)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(e,n.key);if(s===0)return t+n.left.size;s<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((t,n)=>(e(t,n),!1)))}toString(){const e=[];return this.inorderTraversal(((t,n)=>(e.push(`${t}:${n}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Pt(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Pt(this.root,e,this.comparator,!1)}getReverseIterator(){return new Pt(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Pt(this.root,e,this.comparator,!0)}}class Pt{constructor(e,t,n,s){this.isReverse=s,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&s&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class B{constructor(e,t,n,s,i){this.key=e,this.value=t,this.color=n??B.RED,this.left=s??B.EMPTY,this.right=i??B.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,s,i){return new B(e??this.key,t??this.value,n??this.color,s??this.left,i??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let s=this;const i=n(e,s.key);return s=i<0?s.copy(null,null,null,s.left.insert(e,t,n),null):i===0?s.copy(null,t,null,null,null):s.copy(null,null,null,null,s.right.insert(e,t,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return B.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,s=this;if(t(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,t),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),t(e,s.key)===0){if(s.right.isEmpty())return B.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,t))}return s.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,B.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,B.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw E(43730,{key:this.key,value:this.value});if(this.right.isRed())throw E(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw E(27949);return e+(this.isRed()?0:1)}}B.EMPTY=null,B.RED=!0,B.BLACK=!1;B.EMPTY=new class{constructor(){this.size=0}get key(){throw E(57766)}get value(){throw E(16141)}get color(){throw E(16727)}get left(){throw E(29726)}get right(){throw E(36894)}copy(e,t,n,s,i){return this}insert(e,t,n){return new B(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** * @license * Copyright 2017 Google LLC * @@ -448,7 +448,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ks="server_timestamp",xs="__type__",Fs="__previous_value__",Ls="__local_write_time__";function Mn(r){return(r?.mapValue?.fields||{})[xs]?.stringValue===ks}function Jt(r){const e=r.mapValue.fields[Fs];return Mn(e)?Jt(e):e}function ct(r){const e=ge(r.mapValue.fields[Ls].timestampValue);return new b(e.seconds,e.nanos)}/** + */const ks="server_timestamp",xs="__type__",Ls="__previous_value__",Os="__local_write_time__";function Mn(r){return(r?.mapValue?.fields||{})[xs]?.stringValue===ks}function Yt(r){const e=r.mapValue.fields[Ls];return Mn(e)?Yt(e):e}function ct(r){const e=ge(r.mapValue.fields[Os].timestampValue);return new b(e.seconds,e.nanos)}/** * @license * Copyright 2017 Google LLC * @@ -463,7 +463,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class zo{constructor(e,t,n,s,i,o,a,u,c,l,h){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=s,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.longPollingOptions=u,this.useFetchStreams=c,this.isUsingEmulator=l,this.apiKey=h}}const Mt="(default)";class lt{constructor(e,t){this.projectId=e,this.database=t||Mt}static empty(){return new lt("","")}get isDefaultDatabase(){return this.database===Mt}isEqual(e){return e instanceof lt&&e.projectId===this.projectId&&e.database===this.database}}function $o(r,e){if(!Object.prototype.hasOwnProperty.apply(r.options,["projectId"]))throw new p(d.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new lt(r.options.projectId,e)}/** + */class zo{constructor(e,t,n,s,i,o,a,u,c,l,h){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=s,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.longPollingOptions=u,this.useFetchStreams=c,this.isUsingEmulator=l,this.apiKey=h}}const Ft="(default)";class lt{constructor(e,t){this.projectId=e,this.database=t||Ft}static empty(){return new lt("","")}get isDefaultDatabase(){return this.database===Ft}isEqual(e){return e instanceof lt&&e.projectId===this.projectId&&e.database===this.database}}function $o(r,e){if(!Object.prototype.hasOwnProperty.apply(r.options,["projectId"]))throw new p(d.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new lt(r.options.projectId,e)}/** * @license * Copyright 2020 Google LLC * @@ -478,7 +478,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Os="__type__",Go="__max__",Ct={mapValue:{}},Ms="__vector__",Ut="value";function Ee(r){return"nullValue"in r?0:"booleanValue"in r?1:"integerValue"in r||"doubleValue"in r?2:"timestampValue"in r?3:"stringValue"in r?5:"bytesValue"in r?6:"referenceValue"in r?7:"geoPointValue"in r?8:"arrayValue"in r?9:"mapValue"in r?Mn(r)?4:jo(r)?9007199254740991:Qo(r)?10:11:E(28295,{value:r})}function ae(r,e){if(r===e)return!0;const t=Ee(r);if(t!==Ee(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return r.booleanValue===e.booleanValue;case 4:return ct(r).isEqual(ct(e));case 3:return(function(s,i){if(typeof s.timestampValue=="string"&&typeof i.timestampValue=="string"&&s.timestampValue.length===i.timestampValue.length)return s.timestampValue===i.timestampValue;const o=ge(s.timestampValue),a=ge(i.timestampValue);return o.seconds===a.seconds&&o.nanos===a.nanos})(r,e);case 5:return r.stringValue===e.stringValue;case 6:return(function(s,i){return ye(s.bytesValue).isEqual(ye(i.bytesValue))})(r,e);case 7:return r.referenceValue===e.referenceValue;case 8:return(function(s,i){return k(s.geoPointValue.latitude)===k(i.geoPointValue.latitude)&&k(s.geoPointValue.longitude)===k(i.geoPointValue.longitude)})(r,e);case 2:return(function(s,i){if("integerValue"in s&&"integerValue"in i)return k(s.integerValue)===k(i.integerValue);if("doubleValue"in s&&"doubleValue"in i){const o=k(s.doubleValue),a=k(i.doubleValue);return o===a?Ot(o)===Ot(a):isNaN(o)&&isNaN(a)}return!1})(r,e);case 9:return Be(r.arrayValue.values||[],e.arrayValue.values||[],ae);case 10:case 11:return(function(s,i){const o=s.mapValue.fields||{},a=i.mapValue.fields||{};if(Dr(o)!==Dr(a))return!1;for(const u in o)if(o.hasOwnProperty(u)&&(a[u]===void 0||!ae(o[u],a[u])))return!1;return!0})(r,e);default:return E(52216,{left:r})}}function ht(r,e){return(r.values||[]).find((t=>ae(t,e)))!==void 0}function ze(r,e){if(r===e)return 0;const t=Ee(r),n=Ee(e);if(t!==n)return R(t,n);switch(t){case 0:case 9007199254740991:return 0;case 1:return R(r.booleanValue,e.booleanValue);case 2:return(function(i,o){const a=k(i.integerValue||i.doubleValue),u=k(o.integerValue||o.doubleValue);return au?1:a===u?0:isNaN(a)?isNaN(u)?0:-1:1})(r,e);case 3:return xr(r.timestampValue,e.timestampValue);case 4:return xr(ct(r),ct(e));case 5:return Tn(r.stringValue,e.stringValue);case 6:return(function(i,o){const a=ye(i),u=ye(o);return a.compareTo(u)})(r.bytesValue,e.bytesValue);case 7:return(function(i,o){const a=i.split("/"),u=o.split("/");for(let c=0;cs+Dt(i)),0)})(r.arrayValue);case 10:case 11:return(function(n){let s=0;return Ae(n.fields,((i,o)=>{s+=i.length+Dt(o)})),s})(r.mapValue);default:throw E(13486,{value:r})}}function Lr(r,e){return{referenceValue:`projects/${r.projectId}/databases/${r.database}/documents/${e.path.canonicalString()}`}}function An(r){return!!r&&"integerValue"in r}function Un(r){return!!r&&"arrayValue"in r}function Or(r){return!!r&&"nullValue"in r}function Mr(r){return!!r&&"doubleValue"in r&&isNaN(Number(r.doubleValue))}function kt(r){return!!r&&"mapValue"in r}function Qo(r){return(r?.mapValue?.fields||{})[Os]?.stringValue===Ms}function st(r){if(r.geoPointValue)return{geoPointValue:{...r.geoPointValue}};if(r.timestampValue&&typeof r.timestampValue=="object")return{timestampValue:{...r.timestampValue}};if(r.mapValue){const e={mapValue:{fields:{}}};return Ae(r.mapValue.fields,((t,n)=>e.mapValue.fields[t]=st(n))),e}if(r.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(r.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=st(r.arrayValue.values[t]);return e}return{...r}}function jo(r){return(((r.mapValue||{}).fields||{}).__type__||{}).stringValue===Go}/** + */const Fs="__type__",Go="__max__",St={mapValue:{}},Ms="__vector__",Mt="value";function Ee(r){return"nullValue"in r?0:"booleanValue"in r?1:"integerValue"in r||"doubleValue"in r?2:"timestampValue"in r?3:"stringValue"in r?5:"bytesValue"in r?6:"referenceValue"in r?7:"geoPointValue"in r?8:"arrayValue"in r?9:"mapValue"in r?Mn(r)?4:jo(r)?9007199254740991:Qo(r)?10:11:E(28295,{value:r})}function ae(r,e){if(r===e)return!0;const t=Ee(r);if(t!==Ee(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return r.booleanValue===e.booleanValue;case 4:return ct(r).isEqual(ct(e));case 3:return(function(s,i){if(typeof s.timestampValue=="string"&&typeof i.timestampValue=="string"&&s.timestampValue.length===i.timestampValue.length)return s.timestampValue===i.timestampValue;const o=ge(s.timestampValue),a=ge(i.timestampValue);return o.seconds===a.seconds&&o.nanos===a.nanos})(r,e);case 5:return r.stringValue===e.stringValue;case 6:return(function(s,i){return ye(s.bytesValue).isEqual(ye(i.bytesValue))})(r,e);case 7:return r.referenceValue===e.referenceValue;case 8:return(function(s,i){return k(s.geoPointValue.latitude)===k(i.geoPointValue.latitude)&&k(s.geoPointValue.longitude)===k(i.geoPointValue.longitude)})(r,e);case 2:return(function(s,i){if("integerValue"in s&&"integerValue"in i)return k(s.integerValue)===k(i.integerValue);if("doubleValue"in s&&"doubleValue"in i){const o=k(s.doubleValue),a=k(i.doubleValue);return o===a?Ot(o)===Ot(a):isNaN(o)&&isNaN(a)}return!1})(r,e);case 9:return Be(r.arrayValue.values||[],e.arrayValue.values||[],ae);case 10:case 11:return(function(s,i){const o=s.mapValue.fields||{},a=i.mapValue.fields||{};if(Dr(o)!==Dr(a))return!1;for(const u in o)if(o.hasOwnProperty(u)&&(a[u]===void 0||!ae(o[u],a[u])))return!1;return!0})(r,e);default:return E(52216,{left:r})}}function ht(r,e){return(r.values||[]).find((t=>ae(t,e)))!==void 0}function ze(r,e){if(r===e)return 0;const t=Ee(r),n=Ee(e);if(t!==n)return R(t,n);switch(t){case 0:case 9007199254740991:return 0;case 1:return R(r.booleanValue,e.booleanValue);case 2:return(function(i,o){const a=k(i.integerValue||i.doubleValue),u=k(o.integerValue||o.doubleValue);return au?1:a===u?0:isNaN(a)?isNaN(u)?0:-1:1})(r,e);case 3:return xr(r.timestampValue,e.timestampValue);case 4:return xr(ct(r),ct(e));case 5:return Tn(r.stringValue,e.stringValue);case 6:return(function(i,o){const a=ye(i),u=ye(o);return a.compareTo(u)})(r.bytesValue,e.bytesValue);case 7:return(function(i,o){const a=i.split("/"),u=o.split("/");for(let c=0;cs+Nt(i)),0)})(r.arrayValue);case 10:case 11:return(function(n){let s=0;return Ae(n.fields,((i,o)=>{s+=i.length+Nt(o)})),s})(r.mapValue);default:throw E(13486,{value:r})}}function Or(r,e){return{referenceValue:`projects/${r.projectId}/databases/${r.database}/documents/${e.path.canonicalString()}`}}function An(r){return!!r&&"integerValue"in r}function Un(r){return!!r&&"arrayValue"in r}function Fr(r){return!!r&&"nullValue"in r}function Mr(r){return!!r&&"doubleValue"in r&&isNaN(Number(r.doubleValue))}function Dt(r){return!!r&&"mapValue"in r}function Qo(r){return(r?.mapValue?.fields||{})[Fs]?.stringValue===Ms}function st(r){if(r.geoPointValue)return{geoPointValue:{...r.geoPointValue}};if(r.timestampValue&&typeof r.timestampValue=="object")return{timestampValue:{...r.timestampValue}};if(r.mapValue){const e={mapValue:{fields:{}}};return Ae(r.mapValue.fields,((t,n)=>e.mapValue.fields[t]=st(n))),e}if(r.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(r.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=st(r.arrayValue.values[t]);return e}return{...r}}function jo(r){return(((r.mapValue||{}).fields||{}).__type__||{}).stringValue===Go}/** * @license * Copyright 2017 Google LLC * @@ -493,7 +493,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Y{constructor(e){this.value=e}static empty(){return new Y({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n{if(!t.isImmediateParentOf(a)){const u=this.getFieldsMap(t);this.applyChanges(u,n,s),n={},s=[],t=a.popLast()}o?n[a.lastSegment()]=st(o):s.push(a.lastSegment())}));const i=this.getFieldsMap(t);this.applyChanges(i,n,s)}delete(e){const t=this.field(e.popLast());kt(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return ae(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;ne[s]=i));for(const s of n)delete e[s]}clone(){return new Y(st(this.value))}}function Us(r){const e=[];return Ae(r.fields,((t,n)=>{const s=new z([t]);if(kt(n)){const i=Us(n.mapValue).fields;if(i.length===0)e.push(s);else for(const o of i)e.push(s.child(o))}else e.push(s)})),new X(e)}/** + */class Y{constructor(e){this.value=e}static empty(){return new Y({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n{if(!t.isImmediateParentOf(a)){const u=this.getFieldsMap(t);this.applyChanges(u,n,s),n={},s=[],t=a.popLast()}o?n[a.lastSegment()]=st(o):s.push(a.lastSegment())}));const i=this.getFieldsMap(t);this.applyChanges(i,n,s)}delete(e){const t=this.field(e.popLast());Dt(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return ae(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;ne[s]=i));for(const s of n)delete e[s]}clone(){return new Y(st(this.value))}}function Us(r){const e=[];return Ae(r.fields,((t,n)=>{const s=new z([t]);if(Dt(n)){const i=Us(n.mapValue).fields;if(i.length===0)e.push(s);else for(const o of i)e.push(s.child(o))}else e.push(s)})),new X(e)}/** * @license * Copyright 2017 Google LLC * @@ -523,7 +523,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class qt{constructor(e,t){this.position=e,this.inclusive=t}}function Ur(r,e,t){let n=0;for(let s=0;s":return e>0;case">=":return e>=0;default:return E(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class ne extends qs{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new ne(e,t)}matches(e){return Bs(this)?this.filters.find((t=>!t.matches(e)))===void 0:this.filters.find((t=>t.matches(e)))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce(((e,t)=>e.concat(t.getFlattenedFilters())),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Bs(r){return r.op==="and"}function zs(r){return Wo(r)&&Bs(r)}function Wo(r){for(const e of r.filters)if(e instanceof ne)return!1;return!0}function wn(r){if(r instanceof L)return r.field.canonicalString()+r.op.toString()+$e(r.value);if(zs(r))return r.filters.map((e=>wn(e))).join(",");{const e=r.filters.map((t=>wn(t))).join(",");return`${r.op}(${e})`}}function $s(r,e){return r instanceof L?(function(n,s){return s instanceof L&&n.op===s.op&&n.field.isEqual(s.field)&&ae(n.value,s.value)})(r,e):r instanceof ne?(function(n,s){return s instanceof ne&&n.op===s.op&&n.filters.length===s.filters.length?n.filters.reduce(((i,o,a)=>i&&$s(o,s.filters[a])),!0):!1})(r,e):void E(19439)}function Gs(r){return r instanceof L?(function(t){return`${t.field.canonicalString()} ${t.op} ${$e(t.value)}`})(r):r instanceof ne?(function(t){return t.op.toString()+" {"+t.getFilters().map(Gs).join(" ,")+"}"})(r):"Filter"}class Ho extends L{constructor(e,t,n){super(e,t,n),this.key=y.fromName(n.referenceValue)}matches(e){const t=y.comparator(e.key,this.key);return this.matchesComparison(t)}}class Yo extends L{constructor(e,t){super(e,"in",t),this.keys=Qs("in",t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class Jo extends L{constructor(e,t){super(e,"not-in",t),this.keys=Qs("not-in",t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function Qs(r,e){return(e.arrayValue?.values||[]).map((t=>y.fromName(t.referenceValue)))}class Xo extends L{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Un(t)&&ht(t.arrayValue,this.value)}}class Zo extends L{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&ht(this.value.arrayValue,t)}}class ea extends L{constructor(e,t){super(e,"not-in",t)}matches(e){if(ht(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&t.nullValue===void 0&&!ht(this.value.arrayValue,t)}}class ta extends L{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Un(t)||!t.arrayValue.values)&&t.arrayValue.values.some((n=>ht(this.value.arrayValue,n)))}}/** + */class qs{}class O extends qs{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,n):new Ho(e,t,n):t==="array-contains"?new Xo(e,n):t==="in"?new Zo(e,n):t==="not-in"?new ea(e,n):t==="array-contains-any"?new ta(e,n):new O(e,t,n)}static createKeyFieldInFilter(e,t,n){return t==="in"?new Yo(e,n):new Jo(e,n)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&t.nullValue===void 0&&this.matchesComparison(ze(t,this.value)):t!==null&&Ee(this.value)===Ee(t)&&this.matchesComparison(ze(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return E(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class ne extends qs{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new ne(e,t)}matches(e){return Bs(this)?this.filters.find((t=>!t.matches(e)))===void 0:this.filters.find((t=>t.matches(e)))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce(((e,t)=>e.concat(t.getFlattenedFilters())),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Bs(r){return r.op==="and"}function zs(r){return Wo(r)&&Bs(r)}function Wo(r){for(const e of r.filters)if(e instanceof ne)return!1;return!0}function wn(r){if(r instanceof O)return r.field.canonicalString()+r.op.toString()+$e(r.value);if(zs(r))return r.filters.map((e=>wn(e))).join(",");{const e=r.filters.map((t=>wn(t))).join(",");return`${r.op}(${e})`}}function $s(r,e){return r instanceof O?(function(n,s){return s instanceof O&&n.op===s.op&&n.field.isEqual(s.field)&&ae(n.value,s.value)})(r,e):r instanceof ne?(function(n,s){return s instanceof ne&&n.op===s.op&&n.filters.length===s.filters.length?n.filters.reduce(((i,o,a)=>i&&$s(o,s.filters[a])),!0):!1})(r,e):void E(19439)}function Gs(r){return r instanceof O?(function(t){return`${t.field.canonicalString()} ${t.op} ${$e(t.value)}`})(r):r instanceof ne?(function(t){return t.op.toString()+" {"+t.getFilters().map(Gs).join(" ,")+"}"})(r):"Filter"}class Ho extends O{constructor(e,t,n){super(e,t,n),this.key=y.fromName(n.referenceValue)}matches(e){const t=y.comparator(e.key,this.key);return this.matchesComparison(t)}}class Yo extends O{constructor(e,t){super(e,"in",t),this.keys=Qs("in",t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class Jo extends O{constructor(e,t){super(e,"not-in",t),this.keys=Qs("not-in",t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function Qs(r,e){return(e.arrayValue?.values||[]).map((t=>y.fromName(t.referenceValue)))}class Xo extends O{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Un(t)&&ht(t.arrayValue,this.value)}}class Zo extends O{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&ht(this.value.arrayValue,t)}}class ea extends O{constructor(e,t){super(e,"not-in",t)}matches(e){if(ht(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&t.nullValue===void 0&&!ht(this.value.arrayValue,t)}}class ta extends O{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Un(t)||!t.arrayValue.values)&&t.arrayValue.values.some((n=>ht(this.value.arrayValue,n)))}}/** * @license * Copyright 2019 Google LLC * @@ -568,7 +568,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class na{constructor(e,t=null,n=[],s=[],i=null,o=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=s,this.limit=i,this.startAt=o,this.endAt=a,this.Te=null}}function Br(r,e=null,t=[],n=[],s=null,i=null,o=null){return new na(r,e,t,n,s,i,o)}function qn(r){const e=I(r);if(e.Te===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((n=>wn(n))).join(","),t+="|ob:",t+=e.orderBy.map((n=>(function(i){return i.field.canonicalString()+i.dir})(n))).join(","),Yt(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((n=>$e(n))).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((n=>$e(n))).join(",")),e.Te=t}return e.Te}function Bn(r,e){if(r.limit!==e.limit||r.orderBy.length!==e.orderBy.length)return!1;for(let t=0;twn(n))).join(","),t+="|ob:",t+=e.orderBy.map((n=>(function(i){return i.field.canonicalString()+i.dir})(n))).join(","),Ht(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((n=>$e(n))).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((n=>$e(n))).join(",")),e.Te=t}return e.Te}function Bn(r,e){if(r.limit!==e.limit||r.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new M(z.comparator);return o.filters.forEach((u=>{u.getFlattenedFilters().forEach((c=>{c.isInequality()&&(a=a.add(c.field))}))})),a})(e).forEach((i=>{t.has(i.canonicalString())||i.isKeyField()||e.Ie.push(new dt(i,n))})),t.has(z.keyField().canonicalString())||e.Ie.push(new dt(z.keyField(),n))}return e.Ie}function se(r){const e=I(r);return e.Ee||(e.Ee=ia(e,it(r))),e.Ee}function ia(r,e){if(r.limitType==="F")return Br(r.path,r.collectionGroup,e,r.filters,r.limit,r.startAt,r.endAt);{e=e.map((s=>{const i=s.dir==="desc"?"asc":"desc";return new dt(s.field,i)}));const t=r.endAt?new qt(r.endAt.position,r.endAt.inclusive):null,n=r.startAt?new qt(r.startAt.position,r.startAt.inclusive):null;return Br(r.path,r.collectionGroup,e,r.filters,r.limit,t,n)}}function Rn(r,e){const t=r.filters.concat([e]);return new Ye(r.path,r.collectionGroup,r.explicitOrderBy.slice(),t,r.limit,r.limitType,r.startAt,r.endAt)}function oa(r,e){const t=r.explicitOrderBy.concat([e]);return new Ye(r.path,r.collectionGroup,t,r.filters.slice(),r.limit,r.limitType,r.startAt,r.endAt)}function Bt(r,e,t){return new Ye(r.path,r.collectionGroup,r.explicitOrderBy.slice(),r.filters.slice(),e,t,r.startAt,r.endAt)}function Zt(r,e){return Bn(se(r),se(e))&&r.limitType===e.limitType}function Ks(r){return`${qn(se(r))}|lt:${r.limitType}`}function Le(r){return`Query(target=${(function(t){let n=t.path.canonicalString();return t.collectionGroup!==null&&(n+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(n+=`, filters: [${t.filters.map((s=>Gs(s))).join(", ")}]`),Yt(t.limit)||(n+=", limit: "+t.limit),t.orderBy.length>0&&(n+=`, orderBy: [${t.orderBy.map((s=>(function(o){return`${o.field.canonicalString()} (${o.dir})`})(s))).join(", ")}]`),t.startAt&&(n+=", startAt: ",n+=t.startAt.inclusive?"b:":"a:",n+=t.startAt.position.map((s=>$e(s))).join(",")),t.endAt&&(n+=", endAt: ",n+=t.endAt.inclusive?"a:":"b:",n+=t.endAt.position.map((s=>$e(s))).join(",")),`Target(${n})`})(se(r))}; limitType=${r.limitType})`}function en(r,e){return e.isFoundDocument()&&(function(n,s){const i=s.key.path;return n.collectionGroup!==null?s.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(i):y.isDocumentKey(n.path)?n.path.isEqual(i):n.path.isImmediateParentOf(i)})(r,e)&&(function(n,s){for(const i of it(n))if(!i.field.isKeyField()&&s.data.field(i.field)===null)return!1;return!0})(r,e)&&(function(n,s){for(const i of n.filters)if(!i.matches(s))return!1;return!0})(r,e)&&(function(n,s){return!(n.startAt&&!(function(o,a,u){const c=Ur(o,a,u);return o.inclusive?c<=0:c<0})(n.startAt,it(n),s)||n.endAt&&!(function(o,a,u){const c=Ur(o,a,u);return o.inclusive?c>=0:c>0})(n.endAt,it(n),s))})(r,e)}function aa(r){return r.collectionGroup||(r.path.length%2==1?r.path.lastSegment():r.path.get(r.path.length-2))}function Ws(r){return(e,t)=>{let n=!1;for(const s of it(r)){const i=ua(s,e,t);if(i!==0)return i;n=n||s.field.isKeyField()}return 0}}function ua(r,e,t){const n=r.field.isKeyField()?y.comparator(e.key,t.key):(function(i,o,a){const u=o.data.field(i),c=a.data.field(i);return u!==null&&c!==null?ze(u,c):E(42886)})(r.field,e,t);switch(r.dir){case"asc":return n;case"desc":return-1*n;default:return E(19790,{direction:r.dir})}}/** + */class Ye{constructor(e,t=null,n=[],s=[],i=null,o="F",a=null,u=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=s,this.limit=i,this.limitType=o,this.startAt=a,this.endAt=u,this.Ie=null,this.Ee=null,this.Re=null,this.startAt,this.endAt}}function ra(r,e,t,n,s,i,o,a){return new Ye(r,e,t,n,s,i,o,a)}function Jt(r){return new Ye(r)}function zr(r){return r.filters.length===0&&r.limit===null&&r.startAt==null&&r.endAt==null&&(r.explicitOrderBy.length===0||r.explicitOrderBy.length===1&&r.explicitOrderBy[0].field.isKeyField())}function sa(r){return y.isDocumentKey(r.path)&&r.collectionGroup===null&&r.filters.length===0}function js(r){return r.collectionGroup!==null}function it(r){const e=I(r);if(e.Ie===null){e.Ie=[];const t=new Set;for(const i of e.explicitOrderBy)e.Ie.push(i),t.add(i.field.canonicalString());const n=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new M(z.comparator);return o.filters.forEach((u=>{u.getFlattenedFilters().forEach((c=>{c.isInequality()&&(a=a.add(c.field))}))})),a})(e).forEach((i=>{t.has(i.canonicalString())||i.isKeyField()||e.Ie.push(new dt(i,n))})),t.has(z.keyField().canonicalString())||e.Ie.push(new dt(z.keyField(),n))}return e.Ie}function se(r){const e=I(r);return e.Ee||(e.Ee=ia(e,it(r))),e.Ee}function ia(r,e){if(r.limitType==="F")return Br(r.path,r.collectionGroup,e,r.filters,r.limit,r.startAt,r.endAt);{e=e.map((s=>{const i=s.dir==="desc"?"asc":"desc";return new dt(s.field,i)}));const t=r.endAt?new Ut(r.endAt.position,r.endAt.inclusive):null,n=r.startAt?new Ut(r.startAt.position,r.startAt.inclusive):null;return Br(r.path,r.collectionGroup,e,r.filters,r.limit,t,n)}}function Rn(r,e){const t=r.filters.concat([e]);return new Ye(r.path,r.collectionGroup,r.explicitOrderBy.slice(),t,r.limit,r.limitType,r.startAt,r.endAt)}function oa(r,e){const t=r.explicitOrderBy.concat([e]);return new Ye(r.path,r.collectionGroup,t,r.filters.slice(),r.limit,r.limitType,r.startAt,r.endAt)}function qt(r,e,t){return new Ye(r.path,r.collectionGroup,r.explicitOrderBy.slice(),r.filters.slice(),e,t,r.startAt,r.endAt)}function Xt(r,e){return Bn(se(r),se(e))&&r.limitType===e.limitType}function Ks(r){return`${qn(se(r))}|lt:${r.limitType}`}function Oe(r){return`Query(target=${(function(t){let n=t.path.canonicalString();return t.collectionGroup!==null&&(n+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(n+=`, filters: [${t.filters.map((s=>Gs(s))).join(", ")}]`),Ht(t.limit)||(n+=", limit: "+t.limit),t.orderBy.length>0&&(n+=`, orderBy: [${t.orderBy.map((s=>(function(o){return`${o.field.canonicalString()} (${o.dir})`})(s))).join(", ")}]`),t.startAt&&(n+=", startAt: ",n+=t.startAt.inclusive?"b:":"a:",n+=t.startAt.position.map((s=>$e(s))).join(",")),t.endAt&&(n+=", endAt: ",n+=t.endAt.inclusive?"a:":"b:",n+=t.endAt.position.map((s=>$e(s))).join(",")),`Target(${n})`})(se(r))}; limitType=${r.limitType})`}function Zt(r,e){return e.isFoundDocument()&&(function(n,s){const i=s.key.path;return n.collectionGroup!==null?s.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(i):y.isDocumentKey(n.path)?n.path.isEqual(i):n.path.isImmediateParentOf(i)})(r,e)&&(function(n,s){for(const i of it(n))if(!i.field.isKeyField()&&s.data.field(i.field)===null)return!1;return!0})(r,e)&&(function(n,s){for(const i of n.filters)if(!i.matches(s))return!1;return!0})(r,e)&&(function(n,s){return!(n.startAt&&!(function(o,a,u){const c=Ur(o,a,u);return o.inclusive?c<=0:c<0})(n.startAt,it(n),s)||n.endAt&&!(function(o,a,u){const c=Ur(o,a,u);return o.inclusive?c>=0:c>0})(n.endAt,it(n),s))})(r,e)}function aa(r){return r.collectionGroup||(r.path.length%2==1?r.path.lastSegment():r.path.get(r.path.length-2))}function Ws(r){return(e,t)=>{let n=!1;for(const s of it(r)){const i=ua(s,e,t);if(i!==0)return i;n=n||s.field.isKeyField()}return 0}}function ua(r,e,t){const n=r.field.isKeyField()?y.comparator(e.key,t.key):(function(i,o,a){const u=o.data.field(i),c=a.data.field(i);return u!==null&&c!==null?ze(u,c):E(42886)})(r.field,e,t);switch(r.dir){case"asc":return n;case"desc":return-1*n;default:return E(19790,{direction:r.dir})}}/** * @license * Copyright 2017 Google LLC * @@ -643,7 +643,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class tn{constructor(){this._=void 0}}function ma(r,e,t){return r instanceof ft?(function(s,i){const o={fields:{[xs]:{stringValue:ks},[Ls]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return i&&Mn(i)&&(i=Jt(i)),i&&(o.fields[Fs]=i),{mapValue:o}})(t,e):r instanceof Ge?ti(r,e):r instanceof mt?ni(r,e):(function(s,i){const o=ei(s,i),a=$r(o)+$r(s.Ae);return An(o)&&An(s.Ae)?Xs(a):zn(s.serializer,a)})(r,e)}function _a(r,e,t){return r instanceof Ge?ti(r,e):r instanceof mt?ni(r,e):t}function ei(r,e){return r instanceof _t?(function(n){return An(n)||(function(i){return!!i&&"doubleValue"in i})(n)})(e)?e:{integerValue:0}:null}class ft extends tn{}class Ge extends tn{constructor(e){super(),this.elements=e}}function ti(r,e){const t=ri(e);for(const n of r.elements)t.some((s=>ae(s,n)))||t.push(n);return{arrayValue:{values:t}}}class mt extends tn{constructor(e){super(),this.elements=e}}function ni(r,e){let t=ri(e);for(const n of r.elements)t=t.filter((s=>!ae(s,n)));return{arrayValue:{values:t}}}class _t extends tn{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function $r(r){return k(r.integerValue||r.doubleValue)}function ri(r){return Un(r)&&r.arrayValue.values?r.arrayValue.values.slice():[]}/** + */class en{constructor(){this._=void 0}}function ma(r,e,t){return r instanceof ft?(function(s,i){const o={fields:{[xs]:{stringValue:ks},[Os]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return i&&Mn(i)&&(i=Yt(i)),i&&(o.fields[Ls]=i),{mapValue:o}})(t,e):r instanceof Ge?ti(r,e):r instanceof mt?ni(r,e):(function(s,i){const o=ei(s,i),a=$r(o)+$r(s.Ae);return An(o)&&An(s.Ae)?Xs(a):zn(s.serializer,a)})(r,e)}function _a(r,e,t){return r instanceof Ge?ti(r,e):r instanceof mt?ni(r,e):t}function ei(r,e){return r instanceof _t?(function(n){return An(n)||(function(i){return!!i&&"doubleValue"in i})(n)})(e)?e:{integerValue:0}:null}class ft extends en{}class Ge extends en{constructor(e){super(),this.elements=e}}function ti(r,e){const t=ri(e);for(const n of r.elements)t.some((s=>ae(s,n)))||t.push(n);return{arrayValue:{values:t}}}class mt extends en{constructor(e){super(),this.elements=e}}function ni(r,e){let t=ri(e);for(const n of r.elements)t=t.filter((s=>!ae(s,n)));return{arrayValue:{values:t}}}class _t extends en{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function $r(r){return k(r.integerValue||r.doubleValue)}function ri(r){return Un(r)&&r.arrayValue.values?r.arrayValue.values.slice():[]}/** * @license * Copyright 2017 Google LLC * @@ -658,7 +658,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class $n{constructor(e,t){this.field=e,this.transform=t}}function pa(r,e){return r.field.isEqual(e.field)&&(function(n,s){return n instanceof Ge&&s instanceof Ge||n instanceof mt&&s instanceof mt?Be(n.elements,s.elements,ae):n instanceof _t&&s instanceof _t?ae(n.Ae,s.Ae):n instanceof ft&&s instanceof ft})(r.transform,e.transform)}class ga{constructor(e,t){this.version=e,this.transformResults=t}}class W{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new W}static exists(e){return new W(void 0,e)}static updateTime(e){return new W(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function xt(r,e){return r.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(r.updateTime):r.exists===void 0||r.exists===e.isFoundDocument()}class nn{}function si(r,e){if(!r.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return r.isNoDocument()?new rn(r.key,W.none()):new gt(r.key,r.data,W.none());{const t=r.data,n=Y.empty();let s=new M(z.comparator);for(let i of e.fields)if(!s.has(i)){let o=t.field(i);o===null&&i.length>1&&(i=i.popLast(),o=t.field(i)),o===null?n.delete(i):n.set(i,o),s=s.add(i)}return new we(r.key,n,new X(s.toArray()),W.none())}}function ya(r,e,t){r instanceof gt?(function(s,i,o){const a=s.value.clone(),u=Qr(s.fieldTransforms,i,o.transformResults);a.setAll(u),i.convertToFoundDocument(o.version,a).setHasCommittedMutations()})(r,e,t):r instanceof we?(function(s,i,o){if(!xt(s.precondition,i))return void i.convertToUnknownDocument(o.version);const a=Qr(s.fieldTransforms,i,o.transformResults),u=i.data;u.setAll(ii(s)),u.setAll(a),i.convertToFoundDocument(o.version,u).setHasCommittedMutations()})(r,e,t):(function(s,i,o){i.convertToNoDocument(o.version).setHasCommittedMutations()})(0,e,t)}function at(r,e,t,n){return r instanceof gt?(function(i,o,a,u){if(!xt(i.precondition,o))return a;const c=i.value.clone(),l=jr(i.fieldTransforms,u,o);return c.setAll(l),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null})(r,e,t,n):r instanceof we?(function(i,o,a,u){if(!xt(i.precondition,o))return a;const c=jr(i.fieldTransforms,u,o),l=o.data;return l.setAll(ii(i)),l.setAll(c),o.convertToFoundDocument(o.version,l).setHasLocalMutations(),a===null?null:a.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map((h=>h.field)))})(r,e,t,n):(function(i,o,a){return xt(i.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a})(r,e,t)}function Ea(r,e){let t=null;for(const n of r.fieldTransforms){const s=e.data.field(n.field),i=ei(n.transform,s||null);i!=null&&(t===null&&(t=Y.empty()),t.set(n.field,i))}return t||null}function Gr(r,e){return r.type===e.type&&!!r.key.isEqual(e.key)&&!!r.precondition.isEqual(e.precondition)&&!!(function(n,s){return n===void 0&&s===void 0||!(!n||!s)&&Be(n,s,((i,o)=>pa(i,o)))})(r.fieldTransforms,e.fieldTransforms)&&(r.type===0?r.value.isEqual(e.value):r.type!==1||r.data.isEqual(e.data)&&r.fieldMask.isEqual(e.fieldMask))}class gt extends nn{constructor(e,t,n,s=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class we extends nn{constructor(e,t,n,s,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=s,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function ii(r){const e=new Map;return r.fieldMask.fields.forEach((t=>{if(!t.isEmpty()){const n=r.data.field(t);e.set(t,n)}})),e}function Qr(r,e,t){const n=new Map;S(r.length===t.length,32656,{Ve:t.length,de:r.length});for(let s=0;s1&&(i=i.popLast(),o=t.field(i)),o===null?n.delete(i):n.set(i,o),s=s.add(i)}return new we(r.key,n,new X(s.toArray()),W.none())}}function ya(r,e,t){r instanceof gt?(function(s,i,o){const a=s.value.clone(),u=Qr(s.fieldTransforms,i,o.transformResults);a.setAll(u),i.convertToFoundDocument(o.version,a).setHasCommittedMutations()})(r,e,t):r instanceof we?(function(s,i,o){if(!kt(s.precondition,i))return void i.convertToUnknownDocument(o.version);const a=Qr(s.fieldTransforms,i,o.transformResults),u=i.data;u.setAll(ii(s)),u.setAll(a),i.convertToFoundDocument(o.version,u).setHasCommittedMutations()})(r,e,t):(function(s,i,o){i.convertToNoDocument(o.version).setHasCommittedMutations()})(0,e,t)}function at(r,e,t,n){return r instanceof gt?(function(i,o,a,u){if(!kt(i.precondition,o))return a;const c=i.value.clone(),l=jr(i.fieldTransforms,u,o);return c.setAll(l),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null})(r,e,t,n):r instanceof we?(function(i,o,a,u){if(!kt(i.precondition,o))return a;const c=jr(i.fieldTransforms,u,o),l=o.data;return l.setAll(ii(i)),l.setAll(c),o.convertToFoundDocument(o.version,l).setHasLocalMutations(),a===null?null:a.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map((h=>h.field)))})(r,e,t,n):(function(i,o,a){return kt(i.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a})(r,e,t)}function Ea(r,e){let t=null;for(const n of r.fieldTransforms){const s=e.data.field(n.field),i=ei(n.transform,s||null);i!=null&&(t===null&&(t=Y.empty()),t.set(n.field,i))}return t||null}function Gr(r,e){return r.type===e.type&&!!r.key.isEqual(e.key)&&!!r.precondition.isEqual(e.precondition)&&!!(function(n,s){return n===void 0&&s===void 0||!(!n||!s)&&Be(n,s,((i,o)=>pa(i,o)))})(r.fieldTransforms,e.fieldTransforms)&&(r.type===0?r.value.isEqual(e.value):r.type!==1||r.data.isEqual(e.data)&&r.fieldMask.isEqual(e.fieldMask))}class gt extends tn{constructor(e,t,n,s=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class we extends tn{constructor(e,t,n,s,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=s,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function ii(r){const e=new Map;return r.fieldMask.fields.forEach((t=>{if(!t.isEmpty()){const n=r.data.field(t);e.set(t,n)}})),e}function Qr(r,e,t){const n=new Map;S(r.length===t.length,32656,{Ve:t.length,de:r.length});for(let s=0;s0&&(this.Oe=!0,this.Me=e)}ke(){let e=V(),t=V(),n=V();return this.Fe.forEach(((s,i)=>{switch(i){case 0:e=e.add(s);break;case 2:t=t.add(s);break;case 1:n=n.add(s);break;default:E(38017,{changeType:i})}})),new yt(this.Me,this.xe,e,t,n)}Ke(){this.Oe=!1,this.Fe=Yr()}qe(e,t){this.Oe=!0,this.Fe=this.Fe.insert(e,t)}Ue(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}$e(){this.ve+=1}We(){this.ve-=1,S(this.ve>=0,3241,{ve:this.ve})}Qe(){this.Oe=!0,this.xe=!0}}class Pa{constructor(e){this.Ge=e,this.ze=new Map,this.je=de(),this.He=bt(),this.Je=bt(),this.Ze=new N(R)}Xe(e){for(const t of e.Se)e.De&&e.De.isFoundDocument()?this.Ye(t,e.De):this.et(t,e.key,e.De);for(const t of e.removedTargetIds)this.et(t,e.key,e.De)}tt(e){this.forEachTarget(e,(t=>{const n=this.nt(t);switch(e.state){case 0:this.rt(t)&&n.Le(e.resumeToken);break;case 1:n.We(),n.Ne||n.Ke(),n.Le(e.resumeToken);break;case 2:n.We(),n.Ne||this.removeTarget(t);break;case 3:this.rt(t)&&(n.Qe(),n.Le(e.resumeToken));break;case 4:this.rt(t)&&(this.it(t),n.Le(e.resumeToken));break;default:E(56790,{state:e.state})}}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ze.forEach(((n,s)=>{this.rt(s)&&t(s)}))}st(e){const t=e.targetId,n=e.Ce.count,s=this.ot(t);if(s){const i=s.target;if(vn(i))if(n===0){const o=new y(i.path);this.et(t,o,j.newNoDocument(o,T.min()))}else S(n===1,20013,{expectedCount:n});else{const o=this._t(t);if(o!==n){const a=this.ut(e),u=a?this.ct(a,e,o):1;if(u!==0){this.it(t);const c=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ze=this.Ze.insert(t,c)}}}}}ut(e){const t=e.Ce.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:n="",padding:s=0},hashCount:i=0}=t;let o,a;try{o=ye(n).toUint8Array()}catch(u){if(u instanceof Ds)return be("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{a=new Qn(o,s,i)}catch(u){return be(u instanceof nt?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return a.ge===0?null:a}ct(e,t,n){return t.Ce.count===n-this.Pt(e,t.targetId)?0:2}Pt(e,t){const n=this.Ge.getRemoteKeysForTarget(t);let s=0;return n.forEach((i=>{const o=this.Ge.ht(),a=`projects/${o.projectId}/databases/${o.database}/documents/${i.path.canonicalString()}`;e.mightContain(a)||(this.et(t,i,null),s++)})),s}Tt(e){const t=new Map;this.ze.forEach(((i,o)=>{const a=this.ot(o);if(a){if(i.current&&vn(a.target)){const u=new y(a.target.path);this.It(u).has(o)||this.Et(o,u)||this.et(o,u,j.newNoDocument(u,e))}i.Be&&(t.set(o,i.ke()),i.Ke())}}));let n=V();this.Je.forEach(((i,o)=>{let a=!0;o.forEachWhile((u=>{const c=this.ot(u);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)})),a&&(n=n.add(i))})),this.je.forEach(((i,o)=>o.setReadTime(e)));const s=new sn(e,t,this.Ze,this.je,n);return this.je=de(),this.He=bt(),this.Je=bt(),this.Ze=new N(R),s}Ye(e,t){if(!this.rt(e))return;const n=this.Et(e,t.key)?2:0;this.nt(e).qe(t.key,n),this.je=this.je.insert(t.key,t),this.He=this.He.insert(t.key,this.It(t.key).add(e)),this.Je=this.Je.insert(t.key,this.Rt(t.key).add(e))}et(e,t,n){if(!this.rt(e))return;const s=this.nt(e);this.Et(e,t)?s.qe(t,1):s.Ue(t),this.Je=this.Je.insert(t,this.Rt(t).delete(e)),this.Je=this.Je.insert(t,this.Rt(t).add(e)),n&&(this.je=this.je.insert(t,n))}removeTarget(e){this.ze.delete(e)}_t(e){const t=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}$e(e){this.nt(e).$e()}nt(e){let t=this.ze.get(e);return t||(t=new Hr,this.ze.set(e,t)),t}Rt(e){let t=this.Je.get(e);return t||(t=new M(R),this.Je=this.Je.insert(e,t)),t}It(e){let t=this.He.get(e);return t||(t=new M(R),this.He=this.He.insert(e,t)),t}rt(e){const t=this.ot(e)!==null;return t||g("WatchChangeAggregator","Detected inactive target",e),t}ot(e){const t=this.ze.get(e);return t&&t.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new Hr),this.Ge.getRemoteKeysForTarget(e).forEach((t=>{this.et(e,t,null)}))}Et(e,t){return this.Ge.getRemoteKeysForTarget(e).has(t)}}function bt(){return new N(y.comparator)}function Yr(){return new N(y.comparator)}const Sa={asc:"ASCENDING",desc:"DESCENDING"},Ca={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ba={and:"AND",or:"OR"};class Na{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Vn(r,e){return r.useProto3Json||Yt(e)?e:{value:e}}function zt(r,e){return r.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function ci(r,e){return r.useProto3Json?e.toBase64():e.toUint8Array()}function Da(r,e){return zt(r,e.toTimestamp())}function ie(r){return S(!!r,49232),T.fromTimestamp((function(t){const n=ge(t);return new b(n.seconds,n.nanos)})(r))}function jn(r,e){return Pn(r,e).canonicalString()}function Pn(r,e){const t=(function(s){return new C(["projects",s.projectId,"databases",s.database])})(r).child("documents");return e===void 0?t:t.child(e)}function li(r){const e=C.fromString(r);return S(_i(e),10190,{key:e.toString()}),e}function Sn(r,e){return jn(r.databaseId,e.path)}function _n(r,e){const t=li(e);if(t.get(1)!==r.databaseId.projectId)throw new p(d.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+r.databaseId.projectId);if(t.get(3)!==r.databaseId.database)throw new p(d.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+r.databaseId.database);return new y(di(t))}function hi(r,e){return jn(r.databaseId,e)}function ka(r){const e=li(r);return e.length===4?C.emptyPath():di(e)}function Cn(r){return new C(["projects",r.databaseId.projectId,"databases",r.databaseId.database]).canonicalString()}function di(r){return S(r.length>4&&r.get(4)==="documents",29091,{key:r.toString()}),r.popFirst(5)}function Jr(r,e,t){return{name:Sn(r,e),fields:t.value.mapValue.fields}}function xa(r,e){let t;if("targetChange"in e){e.targetChange;const n=(function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:E(39313,{state:c})})(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],i=(function(c,l){return c.useProto3Json?(S(l===void 0||typeof l=="string",58123),$.fromBase64String(l||"")):(S(l===void 0||l instanceof Buffer||l instanceof Uint8Array,16193),$.fromUint8Array(l||new Uint8Array))})(r,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&(function(c){const l=c.code===void 0?d.UNKNOWN:oi(c.code);return new p(l,c.message||"")})(o);t=new ui(n,s,i,a||null)}else if("documentChange"in e){e.documentChange;const n=e.documentChange;n.document,n.document.name,n.document.updateTime;const s=_n(r,n.document.name),i=ie(n.document.updateTime),o=n.document.createTime?ie(n.document.createTime):T.min(),a=new Y({mapValue:{fields:n.document.fields}}),u=j.newFoundDocument(s,i,o,a),c=n.targetIds||[],l=n.removedTargetIds||[];t=new Ft(c,l,u.key,u)}else if("documentDelete"in e){e.documentDelete;const n=e.documentDelete;n.document;const s=_n(r,n.document),i=n.readTime?ie(n.readTime):T.min(),o=j.newNoDocument(s,i),a=n.removedTargetIds||[];t=new Ft([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const n=e.documentRemove;n.document;const s=_n(r,n.document),i=n.removedTargetIds||[];t=new Ft([],i,s,null)}else{if(!("filter"in e))return E(11601,{Vt:e});{e.filter;const n=e.filter;n.targetId;const{count:s=0,unchangedNames:i}=n,o=new wa(s,i),a=n.targetId;t=new ai(a,o)}}return t}function Fa(r,e){let t;if(e instanceof gt)t={update:Jr(r,e.key,e.value)};else if(e instanceof rn)t={delete:Sn(r,e.key)};else if(e instanceof we)t={update:Jr(r,e.key,e.data),updateMask:Ga(e.fieldMask)};else{if(!(e instanceof Ta))return E(16599,{dt:e.type});t={verify:Sn(r,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map((n=>(function(i,o){const a=o.transform;if(a instanceof ft)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof Ge)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof mt)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof _t)return{fieldPath:o.field.canonicalString(),increment:a.Ae};throw E(20930,{transform:o.transform})})(0,n)))),e.precondition.isNone||(t.currentDocument=(function(s,i){return i.updateTime!==void 0?{updateTime:Da(s,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:E(27497)})(r,e.precondition)),t}function La(r,e){return r&&r.length>0?(S(e!==void 0,14353),r.map((t=>(function(s,i){let o=s.updateTime?ie(s.updateTime):ie(i);return o.isEqual(T.min())&&(o=ie(i)),new ga(o,s.transformResults||[])})(t,e)))):[]}function Oa(r,e){return{documents:[hi(r,e.path)]}}function Ma(r,e){const t={structuredQuery:{}},n=e.path;let s;e.collectionGroup!==null?(s=n,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=n.popLast(),t.structuredQuery.from=[{collectionId:n.lastSegment()}]),t.parent=hi(r,s);const i=(function(c){if(c.length!==0)return mi(ne.create(c,"and"))})(e.filters);i&&(t.structuredQuery.where=i);const o=(function(c){if(c.length!==0)return c.map((l=>(function(f){return{field:Oe(f.field),direction:Ba(f.dir)}})(l)))})(e.orderBy);o&&(t.structuredQuery.orderBy=o);const a=Vn(r,e.limit);return a!==null&&(t.structuredQuery.limit=a),e.startAt&&(t.structuredQuery.startAt=(function(c){return{before:c.inclusive,values:c.position}})(e.startAt)),e.endAt&&(t.structuredQuery.endAt=(function(c){return{before:!c.inclusive,values:c.position}})(e.endAt)),{ft:t,parent:s}}function Ua(r){let e=ka(r.parent);const t=r.structuredQuery,n=t.from?t.from.length:0;let s=null;if(n>0){S(n===1,65062);const l=t.from[0];l.allDescendants?s=l.collectionId:e=e.child(l.collectionId)}let i=[];t.where&&(i=(function(h){const f=fi(h);return f instanceof ne&&zs(f)?f.getFilters():[f]})(t.where));let o=[];t.orderBy&&(o=(function(h){return h.map((f=>(function(A){return new dt(Me(A.field),(function(w){switch(w){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(A.direction))})(f)))})(t.orderBy));let a=null;t.limit&&(a=(function(h){let f;return f=typeof h=="object"?h.value:h,Yt(f)?null:f})(t.limit));let u=null;t.startAt&&(u=(function(h){const f=!!h.before,_=h.values||[];return new qt(_,f)})(t.startAt));let c=null;return t.endAt&&(c=(function(h){const f=!h.before,_=h.values||[];return new qt(_,f)})(t.endAt)),ra(e,s,o,i,a,"F",u,c)}function qa(r,e){const t=(function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return E(28987,{purpose:s})}})(e.purpose);return t==null?null:{"goog-listen-tags":t}}function fi(r){return r.unaryFilter!==void 0?(function(t){switch(t.unaryFilter.op){case"IS_NAN":const n=Me(t.unaryFilter.field);return L.create(n,"==",{doubleValue:NaN});case"IS_NULL":const s=Me(t.unaryFilter.field);return L.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const i=Me(t.unaryFilter.field);return L.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Me(t.unaryFilter.field);return L.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return E(61313);default:return E(60726)}})(r):r.fieldFilter!==void 0?(function(t){return L.create(Me(t.fieldFilter.field),(function(s){switch(s){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return E(58110);default:return E(50506)}})(t.fieldFilter.op),t.fieldFilter.value)})(r):r.compositeFilter!==void 0?(function(t){return ne.create(t.compositeFilter.filters.map((n=>fi(n))),(function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return E(1026)}})(t.compositeFilter.op))})(r):E(30097,{filter:r})}function Ba(r){return Sa[r]}function za(r){return Ca[r]}function $a(r){return ba[r]}function Oe(r){return{fieldPath:r.canonicalString()}}function Me(r){return z.fromServerFormat(r.fieldPath)}function mi(r){return r instanceof L?(function(t){if(t.op==="=="){if(Mr(t.value))return{unaryFilter:{field:Oe(t.field),op:"IS_NAN"}};if(Or(t.value))return{unaryFilter:{field:Oe(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(Mr(t.value))return{unaryFilter:{field:Oe(t.field),op:"IS_NOT_NAN"}};if(Or(t.value))return{unaryFilter:{field:Oe(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Oe(t.field),op:za(t.op),value:t.value}}})(r):r instanceof ne?(function(t){const n=t.getFilters().map((s=>mi(s)));return n.length===1?n[0]:{compositeFilter:{op:$a(t.op),filters:n}}})(r):E(54877,{filter:r})}function Ga(r){const e=[];return r.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function _i(r){return r.length>=4&&r.get(0)==="projects"&&r.get(2)==="databases"}function pi(r){return!!r&&typeof r._toProto=="function"&&r._protoValueType==="ProtoValue"}/** + */class xt{constructor(e,t,n,s){this.Se=e,this.removedTargetIds=t,this.key=n,this.De=s}}class ai{constructor(e,t){this.targetId=e,this.Ce=t}}class ui{constructor(e,t,n=$.EMPTY_BYTE_STRING,s=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=s}}class Hr{constructor(){this.ve=0,this.Fe=Yr(),this.Me=$.EMPTY_BYTE_STRING,this.xe=!1,this.Oe=!0}get current(){return this.xe}get resumeToken(){return this.Me}get Ne(){return this.ve!==0}get Be(){return this.Oe}Le(e){e.approximateByteSize()>0&&(this.Oe=!0,this.Me=e)}ke(){let e=V(),t=V(),n=V();return this.Fe.forEach(((s,i)=>{switch(i){case 0:e=e.add(s);break;case 2:t=t.add(s);break;case 1:n=n.add(s);break;default:E(38017,{changeType:i})}})),new yt(this.Me,this.xe,e,t,n)}Ke(){this.Oe=!1,this.Fe=Yr()}qe(e,t){this.Oe=!0,this.Fe=this.Fe.insert(e,t)}Ue(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}$e(){this.ve+=1}We(){this.ve-=1,S(this.ve>=0,3241,{ve:this.ve})}Qe(){this.Oe=!0,this.xe=!0}}class Pa{constructor(e){this.Ge=e,this.ze=new Map,this.je=de(),this.He=Ct(),this.Je=Ct(),this.Ze=new N(R)}Xe(e){for(const t of e.Se)e.De&&e.De.isFoundDocument()?this.Ye(t,e.De):this.et(t,e.key,e.De);for(const t of e.removedTargetIds)this.et(t,e.key,e.De)}tt(e){this.forEachTarget(e,(t=>{const n=this.nt(t);switch(e.state){case 0:this.rt(t)&&n.Le(e.resumeToken);break;case 1:n.We(),n.Ne||n.Ke(),n.Le(e.resumeToken);break;case 2:n.We(),n.Ne||this.removeTarget(t);break;case 3:this.rt(t)&&(n.Qe(),n.Le(e.resumeToken));break;case 4:this.rt(t)&&(this.it(t),n.Le(e.resumeToken));break;default:E(56790,{state:e.state})}}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ze.forEach(((n,s)=>{this.rt(s)&&t(s)}))}st(e){const t=e.targetId,n=e.Ce.count,s=this.ot(t);if(s){const i=s.target;if(vn(i))if(n===0){const o=new y(i.path);this.et(t,o,j.newNoDocument(o,T.min()))}else S(n===1,20013,{expectedCount:n});else{const o=this._t(t);if(o!==n){const a=this.ut(e),u=a?this.ct(a,e,o):1;if(u!==0){this.it(t);const c=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ze=this.Ze.insert(t,c)}}}}}ut(e){const t=e.Ce.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:n="",padding:s=0},hashCount:i=0}=t;let o,a;try{o=ye(n).toUint8Array()}catch(u){if(u instanceof Ds)return be("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{a=new Qn(o,s,i)}catch(u){return be(u instanceof nt?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return a.ge===0?null:a}ct(e,t,n){return t.Ce.count===n-this.Pt(e,t.targetId)?0:2}Pt(e,t){const n=this.Ge.getRemoteKeysForTarget(t);let s=0;return n.forEach((i=>{const o=this.Ge.ht(),a=`projects/${o.projectId}/databases/${o.database}/documents/${i.path.canonicalString()}`;e.mightContain(a)||(this.et(t,i,null),s++)})),s}Tt(e){const t=new Map;this.ze.forEach(((i,o)=>{const a=this.ot(o);if(a){if(i.current&&vn(a.target)){const u=new y(a.target.path);this.It(u).has(o)||this.Et(o,u)||this.et(o,u,j.newNoDocument(u,e))}i.Be&&(t.set(o,i.ke()),i.Ke())}}));let n=V();this.Je.forEach(((i,o)=>{let a=!0;o.forEachWhile((u=>{const c=this.ot(u);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)})),a&&(n=n.add(i))})),this.je.forEach(((i,o)=>o.setReadTime(e)));const s=new rn(e,t,this.Ze,this.je,n);return this.je=de(),this.He=Ct(),this.Je=Ct(),this.Ze=new N(R),s}Ye(e,t){if(!this.rt(e))return;const n=this.Et(e,t.key)?2:0;this.nt(e).qe(t.key,n),this.je=this.je.insert(t.key,t),this.He=this.He.insert(t.key,this.It(t.key).add(e)),this.Je=this.Je.insert(t.key,this.Rt(t.key).add(e))}et(e,t,n){if(!this.rt(e))return;const s=this.nt(e);this.Et(e,t)?s.qe(t,1):s.Ue(t),this.Je=this.Je.insert(t,this.Rt(t).delete(e)),this.Je=this.Je.insert(t,this.Rt(t).add(e)),n&&(this.je=this.je.insert(t,n))}removeTarget(e){this.ze.delete(e)}_t(e){const t=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}$e(e){this.nt(e).$e()}nt(e){let t=this.ze.get(e);return t||(t=new Hr,this.ze.set(e,t)),t}Rt(e){let t=this.Je.get(e);return t||(t=new M(R),this.Je=this.Je.insert(e,t)),t}It(e){let t=this.He.get(e);return t||(t=new M(R),this.He=this.He.insert(e,t)),t}rt(e){const t=this.ot(e)!==null;return t||g("WatchChangeAggregator","Detected inactive target",e),t}ot(e){const t=this.ze.get(e);return t&&t.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new Hr),this.Ge.getRemoteKeysForTarget(e).forEach((t=>{this.et(e,t,null)}))}Et(e,t){return this.Ge.getRemoteKeysForTarget(e).has(t)}}function Ct(){return new N(y.comparator)}function Yr(){return new N(y.comparator)}const Sa={asc:"ASCENDING",desc:"DESCENDING"},Ca={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ba={and:"AND",or:"OR"};class Na{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Vn(r,e){return r.useProto3Json||Ht(e)?e:{value:e}}function Bt(r,e){return r.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function ci(r,e){return r.useProto3Json?e.toBase64():e.toUint8Array()}function Da(r,e){return Bt(r,e.toTimestamp())}function ie(r){return S(!!r,49232),T.fromTimestamp((function(t){const n=ge(t);return new b(n.seconds,n.nanos)})(r))}function jn(r,e){return Pn(r,e).canonicalString()}function Pn(r,e){const t=(function(s){return new C(["projects",s.projectId,"databases",s.database])})(r).child("documents");return e===void 0?t:t.child(e)}function li(r){const e=C.fromString(r);return S(_i(e),10190,{key:e.toString()}),e}function Sn(r,e){return jn(r.databaseId,e.path)}function _n(r,e){const t=li(e);if(t.get(1)!==r.databaseId.projectId)throw new p(d.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+r.databaseId.projectId);if(t.get(3)!==r.databaseId.database)throw new p(d.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+r.databaseId.database);return new y(di(t))}function hi(r,e){return jn(r.databaseId,e)}function ka(r){const e=li(r);return e.length===4?C.emptyPath():di(e)}function Cn(r){return new C(["projects",r.databaseId.projectId,"databases",r.databaseId.database]).canonicalString()}function di(r){return S(r.length>4&&r.get(4)==="documents",29091,{key:r.toString()}),r.popFirst(5)}function Jr(r,e,t){return{name:Sn(r,e),fields:t.value.mapValue.fields}}function xa(r,e){let t;if("targetChange"in e){e.targetChange;const n=(function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:E(39313,{state:c})})(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],i=(function(c,l){return c.useProto3Json?(S(l===void 0||typeof l=="string",58123),$.fromBase64String(l||"")):(S(l===void 0||l instanceof Buffer||l instanceof Uint8Array,16193),$.fromUint8Array(l||new Uint8Array))})(r,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&(function(c){const l=c.code===void 0?d.UNKNOWN:oi(c.code);return new p(l,c.message||"")})(o);t=new ui(n,s,i,a||null)}else if("documentChange"in e){e.documentChange;const n=e.documentChange;n.document,n.document.name,n.document.updateTime;const s=_n(r,n.document.name),i=ie(n.document.updateTime),o=n.document.createTime?ie(n.document.createTime):T.min(),a=new Y({mapValue:{fields:n.document.fields}}),u=j.newFoundDocument(s,i,o,a),c=n.targetIds||[],l=n.removedTargetIds||[];t=new xt(c,l,u.key,u)}else if("documentDelete"in e){e.documentDelete;const n=e.documentDelete;n.document;const s=_n(r,n.document),i=n.readTime?ie(n.readTime):T.min(),o=j.newNoDocument(s,i),a=n.removedTargetIds||[];t=new xt([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const n=e.documentRemove;n.document;const s=_n(r,n.document),i=n.removedTargetIds||[];t=new xt([],i,s,null)}else{if(!("filter"in e))return E(11601,{Vt:e});{e.filter;const n=e.filter;n.targetId;const{count:s=0,unchangedNames:i}=n,o=new wa(s,i),a=n.targetId;t=new ai(a,o)}}return t}function La(r,e){let t;if(e instanceof gt)t={update:Jr(r,e.key,e.value)};else if(e instanceof nn)t={delete:Sn(r,e.key)};else if(e instanceof we)t={update:Jr(r,e.key,e.data),updateMask:Ga(e.fieldMask)};else{if(!(e instanceof Ta))return E(16599,{dt:e.type});t={verify:Sn(r,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map((n=>(function(i,o){const a=o.transform;if(a instanceof ft)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof Ge)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof mt)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof _t)return{fieldPath:o.field.canonicalString(),increment:a.Ae};throw E(20930,{transform:o.transform})})(0,n)))),e.precondition.isNone||(t.currentDocument=(function(s,i){return i.updateTime!==void 0?{updateTime:Da(s,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:E(27497)})(r,e.precondition)),t}function Oa(r,e){return r&&r.length>0?(S(e!==void 0,14353),r.map((t=>(function(s,i){let o=s.updateTime?ie(s.updateTime):ie(i);return o.isEqual(T.min())&&(o=ie(i)),new ga(o,s.transformResults||[])})(t,e)))):[]}function Fa(r,e){return{documents:[hi(r,e.path)]}}function Ma(r,e){const t={structuredQuery:{}},n=e.path;let s;e.collectionGroup!==null?(s=n,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=n.popLast(),t.structuredQuery.from=[{collectionId:n.lastSegment()}]),t.parent=hi(r,s);const i=(function(c){if(c.length!==0)return mi(ne.create(c,"and"))})(e.filters);i&&(t.structuredQuery.where=i);const o=(function(c){if(c.length!==0)return c.map((l=>(function(f){return{field:Fe(f.field),direction:Ba(f.dir)}})(l)))})(e.orderBy);o&&(t.structuredQuery.orderBy=o);const a=Vn(r,e.limit);return a!==null&&(t.structuredQuery.limit=a),e.startAt&&(t.structuredQuery.startAt=(function(c){return{before:c.inclusive,values:c.position}})(e.startAt)),e.endAt&&(t.structuredQuery.endAt=(function(c){return{before:!c.inclusive,values:c.position}})(e.endAt)),{ft:t,parent:s}}function Ua(r){let e=ka(r.parent);const t=r.structuredQuery,n=t.from?t.from.length:0;let s=null;if(n>0){S(n===1,65062);const l=t.from[0];l.allDescendants?s=l.collectionId:e=e.child(l.collectionId)}let i=[];t.where&&(i=(function(h){const f=fi(h);return f instanceof ne&&zs(f)?f.getFilters():[f]})(t.where));let o=[];t.orderBy&&(o=(function(h){return h.map((f=>(function(A){return new dt(Me(A.field),(function(w){switch(w){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(A.direction))})(f)))})(t.orderBy));let a=null;t.limit&&(a=(function(h){let f;return f=typeof h=="object"?h.value:h,Ht(f)?null:f})(t.limit));let u=null;t.startAt&&(u=(function(h){const f=!!h.before,_=h.values||[];return new Ut(_,f)})(t.startAt));let c=null;return t.endAt&&(c=(function(h){const f=!h.before,_=h.values||[];return new Ut(_,f)})(t.endAt)),ra(e,s,o,i,a,"F",u,c)}function qa(r,e){const t=(function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return E(28987,{purpose:s})}})(e.purpose);return t==null?null:{"goog-listen-tags":t}}function fi(r){return r.unaryFilter!==void 0?(function(t){switch(t.unaryFilter.op){case"IS_NAN":const n=Me(t.unaryFilter.field);return O.create(n,"==",{doubleValue:NaN});case"IS_NULL":const s=Me(t.unaryFilter.field);return O.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const i=Me(t.unaryFilter.field);return O.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Me(t.unaryFilter.field);return O.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return E(61313);default:return E(60726)}})(r):r.fieldFilter!==void 0?(function(t){return O.create(Me(t.fieldFilter.field),(function(s){switch(s){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return E(58110);default:return E(50506)}})(t.fieldFilter.op),t.fieldFilter.value)})(r):r.compositeFilter!==void 0?(function(t){return ne.create(t.compositeFilter.filters.map((n=>fi(n))),(function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return E(1026)}})(t.compositeFilter.op))})(r):E(30097,{filter:r})}function Ba(r){return Sa[r]}function za(r){return Ca[r]}function $a(r){return ba[r]}function Fe(r){return{fieldPath:r.canonicalString()}}function Me(r){return z.fromServerFormat(r.fieldPath)}function mi(r){return r instanceof O?(function(t){if(t.op==="=="){if(Mr(t.value))return{unaryFilter:{field:Fe(t.field),op:"IS_NAN"}};if(Fr(t.value))return{unaryFilter:{field:Fe(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(Mr(t.value))return{unaryFilter:{field:Fe(t.field),op:"IS_NOT_NAN"}};if(Fr(t.value))return{unaryFilter:{field:Fe(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Fe(t.field),op:za(t.op),value:t.value}}})(r):r instanceof ne?(function(t){const n=t.getFilters().map((s=>mi(s)));return n.length===1?n[0]:{compositeFilter:{op:$a(t.op),filters:n}}})(r):E(54877,{filter:r})}function Ga(r){const e=[];return r.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function _i(r){return r.length>=4&&r.get(0)==="projects"&&r.get(2)==="databases"}function pi(r){return!!r&&typeof r._toProto=="function"&&r._protoValueType==="ProtoValue"}/** * @license * Copyright 2017 Google LLC * @@ -811,7 +811,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Qa{constructor(e){this.yt=e}}function ja(r){const e=Ua({parent:r.parent,structuredQuery:r.structuredQuery});return r.limitType==="LAST"?Bt(e,e.limit,"L"):e}/** + */class Qa{constructor(e){this.yt=e}}function ja(r){const e=Ua({parent:r.parent,structuredQuery:r.structuredQuery});return r.limitType==="LAST"?qt(e,e.limit,"L"):e}/** * @license * Copyright 2019 Google LLC * @@ -886,7 +886,7 @@ import{L as Xi,I as Ve,c as Zi,d as ee,F as eo,f as ce,n as to,l as no,y as ro,k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Zr="LruGarbageCollector",Ha=1048576;function es([r,e],[t,n]){const s=R(r,t);return s===0?R(e,n):s}class Ya{constructor(e){this.Pr=e,this.buffer=new M(es),this.Tr=0}Ir(){return++this.Tr}Er(e){const t=[e,this.Ir()];if(this.buffer.size{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){He(t)?g(Zr,"Ignoring IndexedDB error during garbage collection: ",t):await We(t)}await this.Ar(3e5)}))}}class Xa{constructor(e,t){this.Vr=e,this.params=t}calculateTargetCount(e,t){return this.Vr.dr(e).next((n=>Math.floor(t/100*n)))}nthSequenceNumber(e,t){if(t===0)return m.resolve(Ht.ce);const n=new Ya(t);return this.Vr.forEachTarget(e,(s=>n.Er(s.sequenceNumber))).next((()=>this.Vr.mr(e,(s=>n.Er(s))))).next((()=>n.maxValue))}removeTargets(e,t,n){return this.Vr.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.Vr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(g("LruGarbageCollector","Garbage collection skipped; disabled"),m.resolve(Xr)):this.getCacheSize(e).next((n=>n(h>this.params.maximumSequenceNumbersToCollect?(g("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),s=this.params.maximumSequenceNumbersToCollect):s=h,o=Date.now(),this.nthSequenceNumber(e,s)))).next((h=>(n=h,a=Date.now(),this.removeTargets(e,n,t)))).next((h=>(i=h,u=Date.now(),this.removeOrphanedDocuments(e,n)))).next((h=>(c=Date.now(),Fe()<=ce.DEBUG&&g("LruGarbageCollector",`LRU Garbage Collection + */const Zr="LruGarbageCollector",Ha=1048576;function es([r,e],[t,n]){const s=R(r,t);return s===0?R(e,n):s}class Ya{constructor(e){this.Pr=e,this.buffer=new M(es),this.Tr=0}Ir(){return++this.Tr}Er(e){const t=[e,this.Ir()];if(this.buffer.size{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){He(t)?g(Zr,"Ignoring IndexedDB error during garbage collection: ",t):await We(t)}await this.Ar(3e5)}))}}class Xa{constructor(e,t){this.Vr=e,this.params=t}calculateTargetCount(e,t){return this.Vr.dr(e).next((n=>Math.floor(t/100*n)))}nthSequenceNumber(e,t){if(t===0)return m.resolve(Wt.ce);const n=new Ya(t);return this.Vr.forEachTarget(e,(s=>n.Er(s.sequenceNumber))).next((()=>this.Vr.mr(e,(s=>n.Er(s))))).next((()=>n.maxValue))}removeTargets(e,t,n){return this.Vr.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.Vr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(g("LruGarbageCollector","Garbage collection skipped; disabled"),m.resolve(Xr)):this.getCacheSize(e).next((n=>n(h>this.params.maximumSequenceNumbersToCollect?(g("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),s=this.params.maximumSequenceNumbersToCollect):s=h,o=Date.now(),this.nthSequenceNumber(e,s)))).next((h=>(n=h,a=Date.now(),this.removeTargets(e,n,t)))).next((h=>(i=h,u=Date.now(),this.removeOrphanedDocuments(e,n)))).next((h=>(c=Date.now(),Le()<=ce.DEBUG&&g("LruGarbageCollector",`LRU Garbage Collection Counted targets in ${o-l}ms Determined least recently used ${s} in `+(a-o)+`ms Removed ${i} targets in `+(u-a)+`ms @@ -951,7 +951,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class nu{constructor(e,t,n,s){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=s}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next((s=>(n=s,this.remoteDocumentCache.getEntry(e,t)))).next((s=>(n!==null&&at(n.mutation,s,X.empty(),b.now()),s)))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next((n=>this.getLocalViewOfDocuments(e,n,V()).next((()=>n))))}getLocalViewOfDocuments(e,t,n=V()){const s=Re();return this.populateOverlays(e,s,t).next((()=>this.computeViews(e,t,s,n).next((i=>{let o=tt();return i.forEach(((a,u)=>{o=o.insert(a,u.overlayedDocument)})),o}))))}getOverlayedDocuments(e,t){const n=Re();return this.populateOverlays(e,n,t).next((()=>this.computeViews(e,t,n,V())))}populateOverlays(e,t,n){const s=[];return n.forEach((i=>{t.has(i)||s.push(i)})),this.documentOverlayCache.getOverlays(e,s).next((i=>{i.forEach(((o,a)=>{t.set(o,a)}))}))}computeViews(e,t,n,s){let i=de();const o=ot(),a=(function(){return ot()})();return t.forEach(((u,c)=>{const l=n.get(c.key);s.has(c.key)&&(l===void 0||l.mutation instanceof we)?i=i.insert(c.key,c):l!==void 0?(o.set(c.key,l.mutation.getFieldMask()),at(l.mutation,c,l.mutation.getFieldMask(),b.now())):o.set(c.key,X.empty())})),this.recalculateAndSaveOverlays(e,i).next((u=>(u.forEach(((c,l)=>o.set(c,l))),t.forEach(((c,l)=>a.set(c,new tu(l,o.get(c)??null)))),a)))}recalculateAndSaveOverlays(e,t){const n=ot();let s=new N(((o,a)=>o-a)),i=V();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next((o=>{for(const a of o)a.keys().forEach((u=>{const c=t.get(u);if(c===null)return;let l=n.get(u)||X.empty();l=a.applyToLocalView(c,l),n.set(u,l);const h=(s.get(a.batchId)||V()).add(u);s=s.insert(a.batchId,h)}))})).next((()=>{const o=[],a=s.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),c=u.key,l=u.value,h=Js();l.forEach((f=>{if(!i.has(f)){const _=si(t.get(f),n.get(f));_!==null&&h.set(f,_),i=i.add(f)}})),o.push(this.documentOverlayCache.saveOverlays(e,c,h))}return m.waitFor(o)})).next((()=>n))}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next((n=>this.recalculateAndSaveOverlays(e,n)))}getDocumentsMatchingQuery(e,t,n,s){return sa(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):js(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,s):this.getDocumentsMatchingCollectionQuery(e,t,n,s)}getNextDocuments(e,t,n,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,s).next((i=>{const o=s-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,s-i.size):m.resolve(Re());let a=ut,u=i;return o.next((c=>m.forEach(c,((l,h)=>(a{u=u.insert(l,f)}))))).next((()=>this.populateOverlays(e,c,i))).next((()=>this.computeViews(e,u,c,V()))).next((l=>({batchId:a,changes:Ys(l)})))))}))}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new y(t)).next((n=>{let s=tt();return n.isFoundDocument()&&(s=s.insert(n.key,n)),s}))}getDocumentsMatchingCollectionGroupQuery(e,t,n,s){const i=t.collectionGroup;let o=tt();return this.indexManager.getCollectionParents(e,i).next((a=>m.forEach(a,(u=>{const c=(function(h,f){return new Ye(f,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)})(t,u.child(i));return this.getDocumentsMatchingCollectionQuery(e,c,n,s).next((l=>{l.forEach(((h,f)=>{o=o.insert(h,f)}))}))})).next((()=>o))))}getDocumentsMatchingCollectionQuery(e,t,n,s){let i;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next((o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,i,s)))).next((o=>{i.forEach(((u,c)=>{const l=c.getKey();o.get(l)===null&&(o=o.insert(l,j.newInvalidDocument(l)))}));let a=tt();return o.forEach(((u,c)=>{const l=i.get(u);l!==void 0&&at(l.mutation,c,X.empty(),b.now()),en(t,c)&&(a=a.insert(u,c))})),a}))}}/** + */class nu{constructor(e,t,n,s){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=s}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next((s=>(n=s,this.remoteDocumentCache.getEntry(e,t)))).next((s=>(n!==null&&at(n.mutation,s,X.empty(),b.now()),s)))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next((n=>this.getLocalViewOfDocuments(e,n,V()).next((()=>n))))}getLocalViewOfDocuments(e,t,n=V()){const s=Re();return this.populateOverlays(e,s,t).next((()=>this.computeViews(e,t,s,n).next((i=>{let o=tt();return i.forEach(((a,u)=>{o=o.insert(a,u.overlayedDocument)})),o}))))}getOverlayedDocuments(e,t){const n=Re();return this.populateOverlays(e,n,t).next((()=>this.computeViews(e,t,n,V())))}populateOverlays(e,t,n){const s=[];return n.forEach((i=>{t.has(i)||s.push(i)})),this.documentOverlayCache.getOverlays(e,s).next((i=>{i.forEach(((o,a)=>{t.set(o,a)}))}))}computeViews(e,t,n,s){let i=de();const o=ot(),a=(function(){return ot()})();return t.forEach(((u,c)=>{const l=n.get(c.key);s.has(c.key)&&(l===void 0||l.mutation instanceof we)?i=i.insert(c.key,c):l!==void 0?(o.set(c.key,l.mutation.getFieldMask()),at(l.mutation,c,l.mutation.getFieldMask(),b.now())):o.set(c.key,X.empty())})),this.recalculateAndSaveOverlays(e,i).next((u=>(u.forEach(((c,l)=>o.set(c,l))),t.forEach(((c,l)=>a.set(c,new tu(l,o.get(c)??null)))),a)))}recalculateAndSaveOverlays(e,t){const n=ot();let s=new N(((o,a)=>o-a)),i=V();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next((o=>{for(const a of o)a.keys().forEach((u=>{const c=t.get(u);if(c===null)return;let l=n.get(u)||X.empty();l=a.applyToLocalView(c,l),n.set(u,l);const h=(s.get(a.batchId)||V()).add(u);s=s.insert(a.batchId,h)}))})).next((()=>{const o=[],a=s.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),c=u.key,l=u.value,h=Js();l.forEach((f=>{if(!i.has(f)){const _=si(t.get(f),n.get(f));_!==null&&h.set(f,_),i=i.add(f)}})),o.push(this.documentOverlayCache.saveOverlays(e,c,h))}return m.waitFor(o)})).next((()=>n))}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next((n=>this.recalculateAndSaveOverlays(e,n)))}getDocumentsMatchingQuery(e,t,n,s){return sa(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):js(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,s):this.getDocumentsMatchingCollectionQuery(e,t,n,s)}getNextDocuments(e,t,n,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,s).next((i=>{const o=s-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,s-i.size):m.resolve(Re());let a=ut,u=i;return o.next((c=>m.forEach(c,((l,h)=>(a{u=u.insert(l,f)}))))).next((()=>this.populateOverlays(e,c,i))).next((()=>this.computeViews(e,u,c,V()))).next((l=>({batchId:a,changes:Ys(l)})))))}))}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new y(t)).next((n=>{let s=tt();return n.isFoundDocument()&&(s=s.insert(n.key,n)),s}))}getDocumentsMatchingCollectionGroupQuery(e,t,n,s){const i=t.collectionGroup;let o=tt();return this.indexManager.getCollectionParents(e,i).next((a=>m.forEach(a,(u=>{const c=(function(h,f){return new Ye(f,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)})(t,u.child(i));return this.getDocumentsMatchingCollectionQuery(e,c,n,s).next((l=>{l.forEach(((h,f)=>{o=o.insert(h,f)}))}))})).next((()=>o))))}getDocumentsMatchingCollectionQuery(e,t,n,s){let i;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next((o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,i,s)))).next((o=>{i.forEach(((u,c)=>{const l=c.getKey();o.get(l)===null&&(o=o.insert(l,j.newInvalidDocument(l)))}));let a=tt();return o.forEach(((u,c)=>{const l=i.get(u);l!==void 0&&at(l.mutation,c,X.empty(),b.now()),Zt(t,c)&&(a=a.insert(u,c))})),a}))}}/** * @license * Copyright 2020 Google LLC * @@ -1026,7 +1026,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class ou{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Yn=1,this.Jr=new M(q.Kr)}checkEmpty(e){return m.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,n,s){const i=this.Yn;this.Yn++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new Ia(i,t,n,s);this.mutationQueue.push(o);for(const a of s)this.Jr=this.Jr.add(new q(a.key,i)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return m.resolve(o)}lookupMutationBatch(e,t){return m.resolve(this.Zr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,s=this.Xr(n),i=s<0?0:s;return m.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return m.resolve(this.mutationQueue.length===0?On:this.Yn-1)}getAllMutationBatches(e){return m.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new q(t,0),s=new q(t,Number.POSITIVE_INFINITY),i=[];return this.Jr.forEachInRange([n,s],(o=>{const a=this.Zr(o.Hr);i.push(a)})),m.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new M(R);return t.forEach((s=>{const i=new q(s,0),o=new q(s,Number.POSITIVE_INFINITY);this.Jr.forEachInRange([i,o],(a=>{n=n.add(a.Hr)}))})),m.resolve(this.Yr(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,s=n.length+1;let i=n;y.isDocumentKey(i)||(i=i.child(""));const o=new q(new y(i),0);let a=new M(R);return this.Jr.forEachWhile((u=>{const c=u.key.path;return!!n.isPrefixOf(c)&&(c.length===s&&(a=a.add(u.Hr)),!0)}),o),m.resolve(this.Yr(a))}Yr(e){const t=[];return e.forEach((n=>{const s=this.Zr(n);s!==null&&t.push(s)})),t}removeMutationBatch(e,t){S(this.ei(t.batchId,"removed")===0,55003),this.mutationQueue.shift();let n=this.Jr;return m.forEach(t.mutations,(s=>{const i=new q(s.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)})).next((()=>{this.Jr=n}))}nr(e){}containsKey(e,t){const n=new q(t,0),s=this.Jr.firstAfterOrEqual(n);return m.resolve(t.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,m.resolve()}ei(e,t){return this.Xr(e)}Xr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Zr(e){const t=this.Xr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/** + */class ou{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Yn=1,this.Jr=new M(q.Kr)}checkEmpty(e){return m.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,n,s){const i=this.Yn;this.Yn++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new Ia(i,t,n,s);this.mutationQueue.push(o);for(const a of s)this.Jr=this.Jr.add(new q(a.key,i)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return m.resolve(o)}lookupMutationBatch(e,t){return m.resolve(this.Zr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,s=this.Xr(n),i=s<0?0:s;return m.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return m.resolve(this.mutationQueue.length===0?Fn:this.Yn-1)}getAllMutationBatches(e){return m.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new q(t,0),s=new q(t,Number.POSITIVE_INFINITY),i=[];return this.Jr.forEachInRange([n,s],(o=>{const a=this.Zr(o.Hr);i.push(a)})),m.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new M(R);return t.forEach((s=>{const i=new q(s,0),o=new q(s,Number.POSITIVE_INFINITY);this.Jr.forEachInRange([i,o],(a=>{n=n.add(a.Hr)}))})),m.resolve(this.Yr(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,s=n.length+1;let i=n;y.isDocumentKey(i)||(i=i.child(""));const o=new q(new y(i),0);let a=new M(R);return this.Jr.forEachWhile((u=>{const c=u.key.path;return!!n.isPrefixOf(c)&&(c.length===s&&(a=a.add(u.Hr)),!0)}),o),m.resolve(this.Yr(a))}Yr(e){const t=[];return e.forEach((n=>{const s=this.Zr(n);s!==null&&t.push(s)})),t}removeMutationBatch(e,t){S(this.ei(t.batchId,"removed")===0,55003),this.mutationQueue.shift();let n=this.Jr;return m.forEach(t.mutations,(s=>{const i=new q(s.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)})).next((()=>{this.Jr=n}))}nr(e){}containsKey(e,t){const n=new q(t,0),s=this.Jr.firstAfterOrEqual(n);return m.resolve(t.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,m.resolve()}ei(e,t){return this.Xr(e)}Xr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Zr(e){const t=this.Xr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/** * @license * Copyright 2017 Google LLC * @@ -1041,7 +1041,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class au{constructor(e){this.ti=e,this.docs=(function(){return new N(y.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,s=this.docs.get(n),i=s?s.size:0,o=this.ti(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return m.resolve(n?n.document.mutableCopy():j.newInvalidDocument(t))}getEntries(e,t){let n=de();return t.forEach((s=>{const i=this.docs.get(s);n=n.insert(s,i?i.document.mutableCopy():j.newInvalidDocument(s))})),m.resolve(n)}getDocumentsMatchingQuery(e,t,n,s){let i=de();const o=t.path,a=new y(o.child("__id-9223372036854775808__")),u=this.docs.getIteratorFrom(a);for(;u.hasNext();){const{key:c,value:{document:l}}=u.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||xo(ko(l),n)<=0||(s.has(l.key)||en(t,l))&&(i=i.insert(l.key,l.mutableCopy()))}return m.resolve(i)}getAllFromCollectionGroup(e,t,n,s){E(9500)}ni(e,t){return m.forEach(this.docs,(n=>t(n)))}newChangeBuffer(e){return new uu(this)}getSize(e){return m.resolve(this.size)}}class uu extends eu{constructor(e){super(),this.Mr=e}applyChanges(e){const t=[];return this.changes.forEach(((n,s)=>{s.isValidDocument()?t.push(this.Mr.addEntry(e,s)):this.Mr.removeEntry(n)})),m.waitFor(t)}getFromCache(e,t){return this.Mr.getEntry(e,t)}getAllFromCache(e,t){return this.Mr.getEntries(e,t)}}/** + */class au{constructor(e){this.ti=e,this.docs=(function(){return new N(y.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,s=this.docs.get(n),i=s?s.size:0,o=this.ti(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return m.resolve(n?n.document.mutableCopy():j.newInvalidDocument(t))}getEntries(e,t){let n=de();return t.forEach((s=>{const i=this.docs.get(s);n=n.insert(s,i?i.document.mutableCopy():j.newInvalidDocument(s))})),m.resolve(n)}getDocumentsMatchingQuery(e,t,n,s){let i=de();const o=t.path,a=new y(o.child("__id-9223372036854775808__")),u=this.docs.getIteratorFrom(a);for(;u.hasNext();){const{key:c,value:{document:l}}=u.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||xo(ko(l),n)<=0||(s.has(l.key)||Zt(t,l))&&(i=i.insert(l.key,l.mutableCopy()))}return m.resolve(i)}getAllFromCollectionGroup(e,t,n,s){E(9500)}ni(e,t){return m.forEach(this.docs,(n=>t(n)))}newChangeBuffer(e){return new uu(this)}getSize(e){return m.resolve(this.size)}}class uu extends eu{constructor(e){super(),this.Mr=e}applyChanges(e){const t=[];return this.changes.forEach(((n,s)=>{s.isValidDocument()?t.push(this.Mr.addEntry(e,s)):this.Mr.removeEntry(n)})),m.waitFor(t)}getFromCache(e,t){return this.Mr.getEntry(e,t)}getAllFromCache(e,t){return this.Mr.getEntries(e,t)}}/** * @license * Copyright 2017 Google LLC * @@ -1071,7 +1071,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class yi{constructor(e,t){this._i={},this.overlays={},this.ai=new Ht(0),this.ui=!1,this.ui=!0,this.ci=new iu,this.referenceDelegate=e(this),this.li=new cu(this),this.indexManager=new Ka,this.remoteDocumentCache=(function(s){return new au(s)})((n=>this.referenceDelegate.hi(n))),this.serializer=new Qa(t),this.Pi=new ru(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ui=!1,Promise.resolve()}get started(){return this.ui}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new su,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this._i[e.toKey()];return n||(n=new ou(t,this.referenceDelegate),this._i[e.toKey()]=n),n}getGlobalsCache(){return this.ci}getTargetCache(){return this.li}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Pi}runTransaction(e,t,n){g("MemoryPersistence","Starting transaction:",e);const s=new lu(this.ai.next());return this.referenceDelegate.Ti(),n(s).next((i=>this.referenceDelegate.Ii(s).next((()=>i)))).toPromise().then((i=>(s.raiseOnCommittedEvent(),i)))}Ei(e,t){return m.or(Object.values(this._i).map((n=>()=>n.containsKey(e,t))))}}class lu extends Lo{constructor(e){super(),this.currentSequenceNumber=e}}class Wn{constructor(e){this.persistence=e,this.Ri=new Kn,this.Ai=null}static Vi(e){return new Wn(e)}get di(){if(this.Ai)return this.Ai;throw E(60996)}addReference(e,t,n){return this.Ri.addReference(n,t),this.di.delete(n.toString()),m.resolve()}removeReference(e,t,n){return this.Ri.removeReference(n,t),this.di.add(n.toString()),m.resolve()}markPotentiallyOrphaned(e,t){return this.di.add(t.toString()),m.resolve()}removeTarget(e,t){this.Ri.Gr(t.targetId).forEach((s=>this.di.add(s.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next((s=>{s.forEach((i=>this.di.add(i.toString())))})).next((()=>n.removeTargetData(e,t)))}Ti(){this.Ai=new Set}Ii(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return m.forEach(this.di,(n=>{const s=y.fromPath(n);return this.mi(e,s).next((i=>{i||t.removeEntry(s,T.min())}))})).next((()=>(this.Ai=null,t.apply(e))))}updateLimboDocument(e,t){return this.mi(e,t).next((n=>{n?this.di.delete(t.toString()):this.di.add(t.toString())}))}hi(e){return 0}mi(e,t){return m.or([()=>m.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ei(e,t)])}}class $t{constructor(e,t){this.persistence=e,this.fi=new ke((n=>Uo(n.path)),((n,s)=>n.isEqual(s))),this.garbageCollector=Za(this,t)}static Vi(e,t){return new $t(e,t)}Ti(){}Ii(e){return m.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}dr(e){const t=this.pr(e);return this.persistence.getTargetCache().getTargetCount(e).next((n=>t.next((s=>n+s))))}pr(e){let t=0;return this.mr(e,(n=>{t++})).next((()=>t))}mr(e,t){return m.forEach(this.fi,((n,s)=>this.wr(e,n,s).next((i=>i?m.resolve():t(s)))))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const s=this.persistence.getRemoteDocumentCache(),i=s.newChangeBuffer();return s.ni(e,(o=>this.wr(e,o,t).next((a=>{a||(n++,i.removeEntry(o,T.min()))})))).next((()=>i.apply(e))).next((()=>n))}markPotentiallyOrphaned(e,t){return this.fi.set(t,e.currentSequenceNumber),m.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.fi.set(n,e.currentSequenceNumber),m.resolve()}removeReference(e,t,n){return this.fi.set(n,e.currentSequenceNumber),m.resolve()}updateLimboDocument(e,t){return this.fi.set(t,e.currentSequenceNumber),m.resolve()}hi(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=Dt(e.data.value)),t}wr(e,t,n){return m.or([()=>this.persistence.Ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const s=this.fi.get(t);return m.resolve(s!==void 0&&s>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** + */class yi{constructor(e,t){this._i={},this.overlays={},this.ai=new Wt(0),this.ui=!1,this.ui=!0,this.ci=new iu,this.referenceDelegate=e(this),this.li=new cu(this),this.indexManager=new Ka,this.remoteDocumentCache=(function(s){return new au(s)})((n=>this.referenceDelegate.hi(n))),this.serializer=new Qa(t),this.Pi=new ru(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ui=!1,Promise.resolve()}get started(){return this.ui}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new su,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this._i[e.toKey()];return n||(n=new ou(t,this.referenceDelegate),this._i[e.toKey()]=n),n}getGlobalsCache(){return this.ci}getTargetCache(){return this.li}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Pi}runTransaction(e,t,n){g("MemoryPersistence","Starting transaction:",e);const s=new lu(this.ai.next());return this.referenceDelegate.Ti(),n(s).next((i=>this.referenceDelegate.Ii(s).next((()=>i)))).toPromise().then((i=>(s.raiseOnCommittedEvent(),i)))}Ei(e,t){return m.or(Object.values(this._i).map((n=>()=>n.containsKey(e,t))))}}class lu extends Oo{constructor(e){super(),this.currentSequenceNumber=e}}class Wn{constructor(e){this.persistence=e,this.Ri=new Kn,this.Ai=null}static Vi(e){return new Wn(e)}get di(){if(this.Ai)return this.Ai;throw E(60996)}addReference(e,t,n){return this.Ri.addReference(n,t),this.di.delete(n.toString()),m.resolve()}removeReference(e,t,n){return this.Ri.removeReference(n,t),this.di.add(n.toString()),m.resolve()}markPotentiallyOrphaned(e,t){return this.di.add(t.toString()),m.resolve()}removeTarget(e,t){this.Ri.Gr(t.targetId).forEach((s=>this.di.add(s.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next((s=>{s.forEach((i=>this.di.add(i.toString())))})).next((()=>n.removeTargetData(e,t)))}Ti(){this.Ai=new Set}Ii(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return m.forEach(this.di,(n=>{const s=y.fromPath(n);return this.mi(e,s).next((i=>{i||t.removeEntry(s,T.min())}))})).next((()=>(this.Ai=null,t.apply(e))))}updateLimboDocument(e,t){return this.mi(e,t).next((n=>{n?this.di.delete(t.toString()):this.di.add(t.toString())}))}hi(e){return 0}mi(e,t){return m.or([()=>m.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ei(e,t)])}}class zt{constructor(e,t){this.persistence=e,this.fi=new ke((n=>Uo(n.path)),((n,s)=>n.isEqual(s))),this.garbageCollector=Za(this,t)}static Vi(e,t){return new zt(e,t)}Ti(){}Ii(e){return m.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}dr(e){const t=this.pr(e);return this.persistence.getTargetCache().getTargetCount(e).next((n=>t.next((s=>n+s))))}pr(e){let t=0;return this.mr(e,(n=>{t++})).next((()=>t))}mr(e,t){return m.forEach(this.fi,((n,s)=>this.wr(e,n,s).next((i=>i?m.resolve():t(s)))))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const s=this.persistence.getRemoteDocumentCache(),i=s.newChangeBuffer();return s.ni(e,(o=>this.wr(e,o,t).next((a=>{a||(n++,i.removeEntry(o,T.min()))})))).next((()=>i.apply(e))).next((()=>n))}markPotentiallyOrphaned(e,t){return this.fi.set(t,e.currentSequenceNumber),m.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.fi.set(n,e.currentSequenceNumber),m.resolve()}removeReference(e,t,n){return this.fi.set(n,e.currentSequenceNumber),m.resolve()}updateLimboDocument(e,t){return this.fi.set(t,e.currentSequenceNumber),m.resolve()}hi(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=Nt(e.data.value)),t}wr(e,t,n){return m.or([()=>this.persistence.Ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const s=this.fi.get(t);return m.resolve(s!==void 0&&s>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** * @license * Copyright 2017 Google LLC * @@ -1116,7 +1116,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class du{constructor(){this.Rs=!1,this.As=!1,this.Vs=100,this.ds=(function(){return ao()?8:Oo(uo())>0?6:4})()}initialize(e,t){this.fs=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,n,s){const i={result:null};return this.gs(e,t).next((o=>{i.result=o})).next((()=>{if(!i.result)return this.ps(e,t,s,n).next((o=>{i.result=o}))})).next((()=>{if(i.result)return;const o=new hu;return this.ys(e,t,o).next((a=>{if(i.result=a,this.As)return this.ws(e,t,o,a.size)}))})).next((()=>i.result))}ws(e,t,n,s){return n.documentReadCountthis.ds*s?(Fe()<=ce.DEBUG&&g("QueryEngine","The SDK decides to create cache indexes for query:",Le(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,se(t))):m.resolve())}gs(e,t){if(zr(t))return m.resolve(null);let n=se(t);return this.indexManager.getIndexType(e,n).next((s=>s===0?null:(t.limit!==null&&s===1&&(t=Bt(t,null,"F"),n=se(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next((i=>{const o=V(...i);return this.fs.getDocuments(e,o).next((a=>this.indexManager.getMinOffset(e,n).next((u=>{const c=this.bs(t,a);return this.Ss(t,c,o,u.readTime)?this.gs(e,Bt(t,null,"F")):this.Ds(e,c,t,u)}))))})))))}ps(e,t,n,s){return zr(t)||s.isEqual(T.min())?m.resolve(null):this.fs.getDocuments(e,n).next((i=>{const o=this.bs(t,i);return this.Ss(t,o,n,s)?m.resolve(null):(Fe()<=ce.DEBUG&&g("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),Le(t)),this.Ds(e,o,t,Do(s,ut)).next((a=>a)))}))}bs(e,t){let n=new M(Ws(e));return t.forEach(((s,i)=>{en(e,i)&&(n=n.add(i))})),n}Ss(e,t,n,s){if(e.limit===null)return!1;if(n.size!==t.size)return!0;const i=e.limitType==="F"?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(s)>0)}ys(e,t,n){return Fe()<=ce.DEBUG&&g("QueryEngine","Using full collection scan to execute query:",Le(t)),this.fs.getDocumentsMatchingQuery(e,t,pe.min(),n)}Ds(e,t,n,s){return this.fs.getDocumentsMatchingQuery(e,n,s).next((i=>(t.forEach((o=>{i=i.insert(o.key,o)})),i)))}}/** + */class du{constructor(){this.Rs=!1,this.As=!1,this.Vs=100,this.ds=(function(){return ao()?8:Fo(uo())>0?6:4})()}initialize(e,t){this.fs=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,n,s){const i={result:null};return this.gs(e,t).next((o=>{i.result=o})).next((()=>{if(!i.result)return this.ps(e,t,s,n).next((o=>{i.result=o}))})).next((()=>{if(i.result)return;const o=new hu;return this.ys(e,t,o).next((a=>{if(i.result=a,this.As)return this.ws(e,t,o,a.size)}))})).next((()=>i.result))}ws(e,t,n,s){return n.documentReadCountthis.ds*s?(Le()<=ce.DEBUG&&g("QueryEngine","The SDK decides to create cache indexes for query:",Oe(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,se(t))):m.resolve())}gs(e,t){if(zr(t))return m.resolve(null);let n=se(t);return this.indexManager.getIndexType(e,n).next((s=>s===0?null:(t.limit!==null&&s===1&&(t=qt(t,null,"F"),n=se(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next((i=>{const o=V(...i);return this.fs.getDocuments(e,o).next((a=>this.indexManager.getMinOffset(e,n).next((u=>{const c=this.bs(t,a);return this.Ss(t,c,o,u.readTime)?this.gs(e,qt(t,null,"F")):this.Ds(e,c,t,u)}))))})))))}ps(e,t,n,s){return zr(t)||s.isEqual(T.min())?m.resolve(null):this.fs.getDocuments(e,n).next((i=>{const o=this.bs(t,i);return this.Ss(t,o,n,s)?m.resolve(null):(Le()<=ce.DEBUG&&g("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),Oe(t)),this.Ds(e,o,t,Do(s,ut)).next((a=>a)))}))}bs(e,t){let n=new M(Ws(e));return t.forEach(((s,i)=>{Zt(e,i)&&(n=n.add(i))})),n}Ss(e,t,n,s){if(e.limit===null)return!1;if(n.size!==t.size)return!0;const i=e.limitType==="F"?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(s)>0)}ys(e,t,n){return Le()<=ce.DEBUG&&g("QueryEngine","Using full collection scan to execute query:",Oe(t)),this.fs.getDocumentsMatchingQuery(e,t,pe.min(),n)}Ds(e,t,n,s){return this.fs.getDocumentsMatchingQuery(e,n,s).next((i=>(t.forEach((o=>{i=i.insert(o.key,o)})),i)))}}/** * @license * Copyright 2020 Google LLC * @@ -1131,7 +1131,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Yn="LocalStore",fu=3e8;class mu{constructor(e,t,n,s){this.persistence=e,this.Cs=t,this.serializer=s,this.vs=new N(R),this.Fs=new ke((i=>qn(i)),Bn),this.Ms=new Map,this.xs=e.getRemoteDocumentCache(),this.li=e.getTargetCache(),this.Pi=e.getBundleCache(),this.Os(n)}Os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new nu(this.xs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.xs.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.vs)))}}function _u(r,e,t,n){return new mu(r,e,t,n)}async function Ei(r,e){const t=I(r);return await t.persistence.runTransaction("Handle user change","readonly",(n=>{let s;return t.mutationQueue.getAllMutationBatches(n).next((i=>(s=i,t.Os(e),t.mutationQueue.getAllMutationBatches(n)))).next((i=>{const o=[],a=[];let u=V();for(const c of s){o.push(c.batchId);for(const l of c.mutations)u=u.add(l.key)}for(const c of i){a.push(c.batchId);for(const l of c.mutations)u=u.add(l.key)}return t.localDocuments.getDocuments(n,u).next((c=>({Ns:c,removedBatchIds:o,addedBatchIds:a})))}))}))}function pu(r,e){const t=I(r);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",(n=>{const s=e.batch.keys(),i=t.xs.newChangeBuffer({trackRemovals:!0});return(function(a,u,c,l){const h=c.batch,f=h.keys();let _=m.resolve();return f.forEach((A=>{_=_.next((()=>l.getEntry(u,A))).next((v=>{const w=c.docVersions.get(A);S(w!==null,48541),v.version.compareTo(w)<0&&(h.applyToRemoteDocument(v,c),v.isValidDocument()&&(v.setReadTime(c.commitVersion),l.addEntry(v)))}))})),_.next((()=>a.mutationQueue.removeMutationBatch(u,h)))})(t,n,e,i).next((()=>i.apply(n))).next((()=>t.mutationQueue.performConsistencyCheck(n))).next((()=>t.documentOverlayCache.removeOverlaysForBatchId(n,s,e.batch.batchId))).next((()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(n,(function(a){let u=V();for(let c=0;c0&&(u=u.add(a.batch.mutations[c].key));return u})(e)))).next((()=>t.localDocuments.getDocuments(n,s)))}))}function Ti(r){const e=I(r);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.li.getLastRemoteSnapshotVersion(t)))}function gu(r,e){const t=I(r),n=e.snapshotVersion;let s=t.vs;return t.persistence.runTransaction("Apply remote event","readwrite-primary",(i=>{const o=t.xs.newChangeBuffer({trackRemovals:!0});s=t.vs;const a=[];e.targetChanges.forEach(((l,h)=>{const f=s.get(h);if(!f)return;a.push(t.li.removeMatchingKeys(i,l.removedDocuments,h).next((()=>t.li.addMatchingKeys(i,l.addedDocuments,h))));let _=f.withSequenceNumber(i.currentSequenceNumber);e.targetMismatches.get(h)!==null?_=_.withResumeToken($.EMPTY_BYTE_STRING,T.min()).withLastLimboFreeSnapshotVersion(T.min()):l.resumeToken.approximateByteSize()>0&&(_=_.withResumeToken(l.resumeToken,n)),s=s.insert(h,_),(function(v,w,x){return v.resumeToken.approximateByteSize()===0||w.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=fu?!0:x.addedDocuments.size+x.modifiedDocuments.size+x.removedDocuments.size>0})(f,_,l)&&a.push(t.li.updateTargetData(i,_))}));let u=de(),c=V();if(e.documentUpdates.forEach((l=>{e.resolvedLimboDocuments.has(l)&&a.push(t.persistence.referenceDelegate.updateLimboDocument(i,l))})),a.push(yu(i,o,e.documentUpdates).next((l=>{u=l.Bs,c=l.Ls}))),!n.isEqual(T.min())){const l=t.li.getLastRemoteSnapshotVersion(i).next((h=>t.li.setTargetsMetadata(i,i.currentSequenceNumber,n)));a.push(l)}return m.waitFor(a).next((()=>o.apply(i))).next((()=>t.localDocuments.getLocalViewOfDocuments(i,u,c))).next((()=>u))})).then((i=>(t.vs=s,i)))}function yu(r,e,t){let n=V(),s=V();return t.forEach((i=>n=n.add(i))),e.getEntries(r,n).next((i=>{let o=de();return t.forEach(((a,u)=>{const c=i.get(a);u.isFoundDocument()!==c.isFoundDocument()&&(s=s.add(a)),u.isNoDocument()&&u.version.isEqual(T.min())?(e.removeEntry(a,u.readTime),o=o.insert(a,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),o=o.insert(a,u)):g(Yn,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",u.version)})),{Bs:o,Ls:s}}))}function Eu(r,e){const t=I(r);return t.persistence.runTransaction("Get next mutation batch","readonly",(n=>(e===void 0&&(e=On),t.mutationQueue.getNextMutationBatchAfterBatchId(n,e))))}function Tu(r,e){const t=I(r);return t.persistence.runTransaction("Allocate target","readwrite",(n=>{let s;return t.li.getTargetData(n,e).next((i=>i?(s=i,m.resolve(s)):t.li.allocateTargetId(n).next((o=>(s=new me(e,o,"TargetPurposeListen",n.currentSequenceNumber),t.li.addTargetData(n,s).next((()=>s)))))))})).then((n=>{const s=t.vs.get(n.targetId);return(s===null||n.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(t.vs=t.vs.insert(n.targetId,n),t.Fs.set(e,n.targetId)),n}))}async function bn(r,e,t){const n=I(r),s=n.vs.get(e),i=t?"readwrite":"readwrite-primary";try{t||await n.persistence.runTransaction("Release target",i,(o=>n.persistence.referenceDelegate.removeTarget(o,s)))}catch(o){if(!He(o))throw o;g(Yn,`Failed to update sequence numbers for target ${e}: ${o}`)}n.vs=n.vs.remove(e),n.Fs.delete(s.target)}function ts(r,e,t){const n=I(r);let s=T.min(),i=V();return n.persistence.runTransaction("Execute query","readwrite",(o=>(function(u,c,l){const h=I(u),f=h.Fs.get(l);return f!==void 0?m.resolve(h.vs.get(f)):h.li.getTargetData(c,l)})(n,o,se(e)).next((a=>{if(a)return s=a.lastLimboFreeSnapshotVersion,n.li.getMatchingKeysForTargetId(o,a.targetId).next((u=>{i=u}))})).next((()=>n.Cs.getDocumentsMatchingQuery(o,e,t?s:T.min(),t?i:V()))).next((a=>(Iu(n,aa(e),a),{documents:a,ks:i})))))}function Iu(r,e,t){let n=r.Ms.get(e)||T.min();t.forEach(((s,i)=>{i.readTime.compareTo(n)>0&&(n=i.readTime)})),r.Ms.set(e,n)}class ns{constructor(){this.activeTargetIds=fa()}Qs(e){this.activeTargetIds=this.activeTargetIds.add(e)}Gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Au{constructor(){this.vo=new ns,this.Fo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e,t=!0){return t&&this.vo.Qs(e),this.Fo[e]||"not-current"}updateQueryState(e,t,n){this.Fo[e]=t}removeLocalQueryTarget(e){this.vo.Gs(e)}isLocalQueryTarget(e){return this.vo.activeTargetIds.has(e)}clearQueryState(e){delete this.Fo[e]}getAllActiveQueryTargets(){return this.vo.activeTargetIds}isActiveQueryTarget(e){return this.vo.activeTargetIds.has(e)}start(){return this.vo=new ns,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** + */const Yn="LocalStore",fu=3e8;class mu{constructor(e,t,n,s){this.persistence=e,this.Cs=t,this.serializer=s,this.vs=new N(R),this.Fs=new ke((i=>qn(i)),Bn),this.Ms=new Map,this.xs=e.getRemoteDocumentCache(),this.li=e.getTargetCache(),this.Pi=e.getBundleCache(),this.Os(n)}Os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new nu(this.xs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.xs.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.vs)))}}function _u(r,e,t,n){return new mu(r,e,t,n)}async function Ei(r,e){const t=I(r);return await t.persistence.runTransaction("Handle user change","readonly",(n=>{let s;return t.mutationQueue.getAllMutationBatches(n).next((i=>(s=i,t.Os(e),t.mutationQueue.getAllMutationBatches(n)))).next((i=>{const o=[],a=[];let u=V();for(const c of s){o.push(c.batchId);for(const l of c.mutations)u=u.add(l.key)}for(const c of i){a.push(c.batchId);for(const l of c.mutations)u=u.add(l.key)}return t.localDocuments.getDocuments(n,u).next((c=>({Ns:c,removedBatchIds:o,addedBatchIds:a})))}))}))}function pu(r,e){const t=I(r);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",(n=>{const s=e.batch.keys(),i=t.xs.newChangeBuffer({trackRemovals:!0});return(function(a,u,c,l){const h=c.batch,f=h.keys();let _=m.resolve();return f.forEach((A=>{_=_.next((()=>l.getEntry(u,A))).next((v=>{const w=c.docVersions.get(A);S(w!==null,48541),v.version.compareTo(w)<0&&(h.applyToRemoteDocument(v,c),v.isValidDocument()&&(v.setReadTime(c.commitVersion),l.addEntry(v)))}))})),_.next((()=>a.mutationQueue.removeMutationBatch(u,h)))})(t,n,e,i).next((()=>i.apply(n))).next((()=>t.mutationQueue.performConsistencyCheck(n))).next((()=>t.documentOverlayCache.removeOverlaysForBatchId(n,s,e.batch.batchId))).next((()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(n,(function(a){let u=V();for(let c=0;c0&&(u=u.add(a.batch.mutations[c].key));return u})(e)))).next((()=>t.localDocuments.getDocuments(n,s)))}))}function Ti(r){const e=I(r);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.li.getLastRemoteSnapshotVersion(t)))}function gu(r,e){const t=I(r),n=e.snapshotVersion;let s=t.vs;return t.persistence.runTransaction("Apply remote event","readwrite-primary",(i=>{const o=t.xs.newChangeBuffer({trackRemovals:!0});s=t.vs;const a=[];e.targetChanges.forEach(((l,h)=>{const f=s.get(h);if(!f)return;a.push(t.li.removeMatchingKeys(i,l.removedDocuments,h).next((()=>t.li.addMatchingKeys(i,l.addedDocuments,h))));let _=f.withSequenceNumber(i.currentSequenceNumber);e.targetMismatches.get(h)!==null?_=_.withResumeToken($.EMPTY_BYTE_STRING,T.min()).withLastLimboFreeSnapshotVersion(T.min()):l.resumeToken.approximateByteSize()>0&&(_=_.withResumeToken(l.resumeToken,n)),s=s.insert(h,_),(function(v,w,x){return v.resumeToken.approximateByteSize()===0||w.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=fu?!0:x.addedDocuments.size+x.modifiedDocuments.size+x.removedDocuments.size>0})(f,_,l)&&a.push(t.li.updateTargetData(i,_))}));let u=de(),c=V();if(e.documentUpdates.forEach((l=>{e.resolvedLimboDocuments.has(l)&&a.push(t.persistence.referenceDelegate.updateLimboDocument(i,l))})),a.push(yu(i,o,e.documentUpdates).next((l=>{u=l.Bs,c=l.Ls}))),!n.isEqual(T.min())){const l=t.li.getLastRemoteSnapshotVersion(i).next((h=>t.li.setTargetsMetadata(i,i.currentSequenceNumber,n)));a.push(l)}return m.waitFor(a).next((()=>o.apply(i))).next((()=>t.localDocuments.getLocalViewOfDocuments(i,u,c))).next((()=>u))})).then((i=>(t.vs=s,i)))}function yu(r,e,t){let n=V(),s=V();return t.forEach((i=>n=n.add(i))),e.getEntries(r,n).next((i=>{let o=de();return t.forEach(((a,u)=>{const c=i.get(a);u.isFoundDocument()!==c.isFoundDocument()&&(s=s.add(a)),u.isNoDocument()&&u.version.isEqual(T.min())?(e.removeEntry(a,u.readTime),o=o.insert(a,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),o=o.insert(a,u)):g(Yn,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",u.version)})),{Bs:o,Ls:s}}))}function Eu(r,e){const t=I(r);return t.persistence.runTransaction("Get next mutation batch","readonly",(n=>(e===void 0&&(e=Fn),t.mutationQueue.getNextMutationBatchAfterBatchId(n,e))))}function Tu(r,e){const t=I(r);return t.persistence.runTransaction("Allocate target","readwrite",(n=>{let s;return t.li.getTargetData(n,e).next((i=>i?(s=i,m.resolve(s)):t.li.allocateTargetId(n).next((o=>(s=new me(e,o,"TargetPurposeListen",n.currentSequenceNumber),t.li.addTargetData(n,s).next((()=>s)))))))})).then((n=>{const s=t.vs.get(n.targetId);return(s===null||n.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(t.vs=t.vs.insert(n.targetId,n),t.Fs.set(e,n.targetId)),n}))}async function bn(r,e,t){const n=I(r),s=n.vs.get(e),i=t?"readwrite":"readwrite-primary";try{t||await n.persistence.runTransaction("Release target",i,(o=>n.persistence.referenceDelegate.removeTarget(o,s)))}catch(o){if(!He(o))throw o;g(Yn,`Failed to update sequence numbers for target ${e}: ${o}`)}n.vs=n.vs.remove(e),n.Fs.delete(s.target)}function ts(r,e,t){const n=I(r);let s=T.min(),i=V();return n.persistence.runTransaction("Execute query","readwrite",(o=>(function(u,c,l){const h=I(u),f=h.Fs.get(l);return f!==void 0?m.resolve(h.vs.get(f)):h.li.getTargetData(c,l)})(n,o,se(e)).next((a=>{if(a)return s=a.lastLimboFreeSnapshotVersion,n.li.getMatchingKeysForTargetId(o,a.targetId).next((u=>{i=u}))})).next((()=>n.Cs.getDocumentsMatchingQuery(o,e,t?s:T.min(),t?i:V()))).next((a=>(Iu(n,aa(e),a),{documents:a,ks:i})))))}function Iu(r,e,t){let n=r.Ms.get(e)||T.min();t.forEach(((s,i)=>{i.readTime.compareTo(n)>0&&(n=i.readTime)})),r.Ms.set(e,n)}class ns{constructor(){this.activeTargetIds=fa()}Qs(e){this.activeTargetIds=this.activeTargetIds.add(e)}Gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Au{constructor(){this.vo=new ns,this.Fo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e,t=!0){return t&&this.vo.Qs(e),this.Fo[e]||"not-current"}updateQueryState(e,t,n){this.Fo[e]=t}removeLocalQueryTarget(e){this.vo.Gs(e)}isLocalQueryTarget(e){return this.vo.activeTargetIds.has(e)}clearQueryState(e){delete this.Fo[e]}getAllActiveQueryTargets(){return this.vo.activeTargetIds}isActiveQueryTarget(e){return this.vo.activeTargetIds.has(e)}start(){return this.vo=new ns,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** * @license * Copyright 2019 Google LLC * @@ -1176,7 +1176,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */let Nt=null;function Nn(){return Nt===null?Nt=(function(){return 268435456+Math.round(2147483648*Math.random())})():Nt++,"0x"+Nt.toString(16)}/** + */let bt=null;function Nn(){return bt===null?bt=(function(){return 268435456+Math.round(2147483648*Math.random())})():bt++,"0x"+bt.toString(16)}/** * @license * Copyright 2020 Google LLC * @@ -1191,7 +1191,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const pn="RestConnection",vu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class Ru{get Ko(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.qo=t+"://"+e.host,this.Uo=`projects/${n}/databases/${s}`,this.$o=this.databaseId.database===Mt?`project_id=${n}`:`project_id=${n}&database_id=${s}`}Wo(e,t,n,s,i){const o=Nn(),a=this.Qo(e,t.toUriEncodedString());g(pn,`Sending RPC '${e}' ${o}:`,a,n);const u={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.$o};this.Go(u,s,i);const{host:c}=new URL(a),l=vs(c);return this.zo(e,a,u,n,l).then((h=>(g(pn,`Received RPC '${e}' ${o}: `,h),h)),(h=>{throw be(pn,`RPC '${e}' ${o} failed with error: `,h,"url: ",a,"request:",n),h}))}jo(e,t,n,s,i,o){return this.Wo(e,t,n,s,i)}Go(e,t,n){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Ke})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach(((s,i)=>e[i]=s)),n&&n.headers.forEach(((s,i)=>e[i]=s))}Qo(e,t){const n=vu[e];let s=`${this.qo}/v1/${t}:${n}`;return this.databaseInfo.apiKey&&(s=`${s}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),s}terminate(){}}/** + */const pn="RestConnection",vu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class Ru{get Ko(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.qo=t+"://"+e.host,this.Uo=`projects/${n}/databases/${s}`,this.$o=this.databaseId.database===Ft?`project_id=${n}`:`project_id=${n}&database_id=${s}`}Wo(e,t,n,s,i){const o=Nn(),a=this.Qo(e,t.toUriEncodedString());g(pn,`Sending RPC '${e}' ${o}:`,a,n);const u={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.$o};this.Go(u,s,i);const{host:c}=new URL(a),l=vs(c);return this.zo(e,a,u,n,l).then((h=>(g(pn,`Received RPC '${e}' ${o}: `,h),h)),(h=>{throw be(pn,`RPC '${e}' ${o} failed with error: `,h,"url: ",a,"request:",n),h}))}jo(e,t,n,s,i,o){return this.Wo(e,t,n,s,i)}Go(e,t,n){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Ke})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach(((s,i)=>e[i]=s)),n&&n.headers.forEach(((s,i)=>e[i]=s))}Qo(e,t){const n=vu[e];let s=`${this.qo}/v1/${t}:${n}`;return this.databaseInfo.apiKey&&(s=`${s}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),s}terminate(){}}/** * @license * Copyright 2017 Google LLC * @@ -1221,7 +1221,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const G="WebChannelConnection",et=(r,e,t)=>{r.listen(e,(n=>{try{t(n)}catch(s){setTimeout((()=>{throw s}),0)}}))};class Ue extends Ru{constructor(e){super(e),this.a_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static u_(){if(!Ue.c_){const e=lo();et(e,ho.STAT_EVENT,(t=>{t.stat===wr.PROXY?g(G,"STAT_EVENT: detected buffering proxy"):t.stat===wr.NOPROXY&&g(G,"STAT_EVENT: detected no buffering proxy")})),Ue.c_=!0}}zo(e,t,n,s,i){const o=Nn();return new Promise(((a,u)=>{const c=new fo;c.setWithCredentials(!0),c.listenOnce(mo.COMPLETE,(()=>{try{switch(c.getLastErrorCode()){case fn.NO_ERROR:const h=c.getResponseJson();g(G,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(h)),a(h);break;case fn.TIMEOUT:g(G,`RPC '${e}' ${o} timed out`),u(new p(d.DEADLINE_EXCEEDED,"Request time out"));break;case fn.HTTP_ERROR:const f=c.getStatus();if(g(G,`RPC '${e}' ${o} failed with status:`,f,"response text:",c.getResponseText()),f>0){let _=c.getResponseJson();Array.isArray(_)&&(_=_[0]);const A=_?.error;if(A&&A.status&&A.message){const v=(function(x){const U=x.toLowerCase().replace(/_/g,"-");return Object.values(d).indexOf(U)>=0?U:d.UNKNOWN})(A.status);u(new p(v,A.message))}else u(new p(d.UNKNOWN,"Server responded with status "+c.getStatus()))}else u(new p(d.UNAVAILABLE,"Connection failed."));break;default:E(9055,{l_:e,streamId:o,h_:c.getLastErrorCode(),P_:c.getLastError()})}}finally{g(G,`RPC '${e}' ${o} completed.`)}}));const l=JSON.stringify(s);g(G,`RPC '${e}' ${o} sending request:`,s),c.send(t,"POST",l,n,15)}))}T_(e,t,n){const s=Nn(),i=[this.qo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=this.createWebChannelTransport(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},u=this.longPollingOptions.timeoutSeconds;u!==void 0&&(a.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(a.useFetchStreams=!0),this.Go(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const c=i.join("");g(G,`Creating RPC '${e}' stream ${s}: ${c}`,a);const l=o.createWebChannel(c,a);this.I_(l);let h=!1,f=!1;const _=new Vu({Ho:A=>{f?g(G,`Not sending because RPC '${e}' stream ${s} is closed:`,A):(h||(g(G,`Opening RPC '${e}' stream ${s} transport.`),l.open(),h=!0),g(G,`RPC '${e}' stream ${s} sending:`,A),l.send(A))},Jo:()=>l.close()});return et(l,Pt.EventType.OPEN,(()=>{f||(g(G,`RPC '${e}' stream ${s} transport opened.`),_.i_())})),et(l,Pt.EventType.CLOSE,(()=>{f||(f=!0,g(G,`RPC '${e}' stream ${s} transport closed`),_.o_(),this.E_(l))})),et(l,Pt.EventType.ERROR,(A=>{f||(f=!0,be(G,`RPC '${e}' stream ${s} transport errored. Name:`,A.name,"Message:",A.message),_.o_(new p(d.UNAVAILABLE,"The operation could not be completed")))})),et(l,Pt.EventType.MESSAGE,(A=>{if(!f){const v=A.data[0];S(!!v,16349);const w=v,x=w?.error||w[0]?.error;if(x){g(G,`RPC '${e}' stream ${s} received error:`,x);const U=x.status;let J=(function(Rt){const Vt=F[Rt];if(Vt!==void 0)return oi(Vt)})(U),ve=x.message;U==="NOT_FOUND"&&ve.includes("database")&&ve.includes("does not exist")&&ve.includes(this.databaseId.database)&&be(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),J===void 0&&(J=d.INTERNAL,ve="Unknown error status: "+U+" with message "+x.message),f=!0,_.o_(new p(J,ve)),l.close()}else g(G,`RPC '${e}' stream ${s} received:`,v),_.__(v)}})),Ue.u_(),setTimeout((()=>{_.s_()}),0),_}terminate(){this.a_.forEach((e=>e.close())),this.a_=[]}I_(e){this.a_.push(e)}E_(e){this.a_=this.a_.filter((t=>t===e))}Go(e,t,n){super.Go(e,t,n),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return _o()}}/** + */const G="WebChannelConnection",et=(r,e,t)=>{r.listen(e,(n=>{try{t(n)}catch(s){setTimeout((()=>{throw s}),0)}}))};class Ue extends Ru{constructor(e){super(e),this.a_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static u_(){if(!Ue.c_){const e=lo();et(e,ho.STAT_EVENT,(t=>{t.stat===wr.PROXY?g(G,"STAT_EVENT: detected buffering proxy"):t.stat===wr.NOPROXY&&g(G,"STAT_EVENT: detected no buffering proxy")})),Ue.c_=!0}}zo(e,t,n,s,i){const o=Nn();return new Promise(((a,u)=>{const c=new fo;c.setWithCredentials(!0),c.listenOnce(mo.COMPLETE,(()=>{try{switch(c.getLastErrorCode()){case fn.NO_ERROR:const h=c.getResponseJson();g(G,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(h)),a(h);break;case fn.TIMEOUT:g(G,`RPC '${e}' ${o} timed out`),u(new p(d.DEADLINE_EXCEEDED,"Request time out"));break;case fn.HTTP_ERROR:const f=c.getStatus();if(g(G,`RPC '${e}' ${o} failed with status:`,f,"response text:",c.getResponseText()),f>0){let _=c.getResponseJson();Array.isArray(_)&&(_=_[0]);const A=_?.error;if(A&&A.status&&A.message){const v=(function(x){const U=x.toLowerCase().replace(/_/g,"-");return Object.values(d).indexOf(U)>=0?U:d.UNKNOWN})(A.status);u(new p(v,A.message))}else u(new p(d.UNKNOWN,"Server responded with status "+c.getStatus()))}else u(new p(d.UNAVAILABLE,"Connection failed."));break;default:E(9055,{l_:e,streamId:o,h_:c.getLastErrorCode(),P_:c.getLastError()})}}finally{g(G,`RPC '${e}' ${o} completed.`)}}));const l=JSON.stringify(s);g(G,`RPC '${e}' ${o} sending request:`,s),c.send(t,"POST",l,n,15)}))}T_(e,t,n){const s=Nn(),i=[this.qo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=this.createWebChannelTransport(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},u=this.longPollingOptions.timeoutSeconds;u!==void 0&&(a.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(a.useFetchStreams=!0),this.Go(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const c=i.join("");g(G,`Creating RPC '${e}' stream ${s}: ${c}`,a);const l=o.createWebChannel(c,a);this.I_(l);let h=!1,f=!1;const _=new Vu({Ho:A=>{f?g(G,`Not sending because RPC '${e}' stream ${s} is closed:`,A):(h||(g(G,`Opening RPC '${e}' stream ${s} transport.`),l.open(),h=!0),g(G,`RPC '${e}' stream ${s} sending:`,A),l.send(A))},Jo:()=>l.close()});return et(l,Vt.EventType.OPEN,(()=>{f||(g(G,`RPC '${e}' stream ${s} transport opened.`),_.i_())})),et(l,Vt.EventType.CLOSE,(()=>{f||(f=!0,g(G,`RPC '${e}' stream ${s} transport closed`),_.o_(),this.E_(l))})),et(l,Vt.EventType.ERROR,(A=>{f||(f=!0,be(G,`RPC '${e}' stream ${s} transport errored. Name:`,A.name,"Message:",A.message),_.o_(new p(d.UNAVAILABLE,"The operation could not be completed")))})),et(l,Vt.EventType.MESSAGE,(A=>{if(!f){const v=A.data[0];S(!!v,16349);const w=v,x=w?.error||w[0]?.error;if(x){g(G,`RPC '${e}' stream ${s} received error:`,x);const U=x.status;let J=(function(vt){const Rt=L[vt];if(Rt!==void 0)return oi(Rt)})(U),ve=x.message;U==="NOT_FOUND"&&ve.includes("database")&&ve.includes("does not exist")&&ve.includes(this.databaseId.database)&&be(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),J===void 0&&(J=d.INTERNAL,ve="Unknown error status: "+U+" with message "+x.message),f=!0,_.o_(new p(J,ve)),l.close()}else g(G,`RPC '${e}' stream ${s} received:`,v),_.__(v)}})),Ue.u_(),setTimeout((()=>{_.s_()}),0),_}terminate(){this.a_.forEach((e=>e.close())),this.a_=[]}I_(e){this.a_.push(e)}E_(e){this.a_=this.a_.filter((t=>t===e))}Go(e,t,n){super.Go(e,t,n),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return _o()}}/** * @license * Copyright 2020 Google LLC * @@ -1251,7 +1251,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function on(r){return new Na(r,!0)}/** + */function sn(r){return new Na(r,!0)}/** * @license * Copyright 2017 Google LLC * @@ -1281,7 +1281,7 @@ Total Duration: ${c-l}ms`),m.resolve({didRun:!0,sequenceNumbersCollected:s,targe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const is="PersistentStream";class Ai{constructor(e,t,n,s,i,o,a,u){this.Ci=e,this.b_=n,this.S_=s,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new Ii(e,t)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Ci.enqueueAfterDelay(this.b_,6e4,(()=>this.k_())))}K_(e){this.q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():t&&t.code===d.RESOURCE_EXHAUSTED?(he(t.toString()),he("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):t&&t.code===d.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.t_(t)}W_(){}auth(){this.state=1;const e=this.Q_(this.D_),t=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([n,s])=>{this.D_===t&&this.G_(n,s)}),(n=>{e((()=>{const s=new p(d.UNKNOWN,"Fetching auth token failed: "+n.message);return this.z_(s)}))}))}G_(e,t){const n=this.Q_(this.D_);this.stream=this.j_(e,t),this.stream.Zo((()=>{n((()=>this.listener.Zo()))})),this.stream.Yo((()=>{n((()=>(this.state=2,this.v_=this.Ci.enqueueAfterDelay(this.S_,1e4,(()=>(this.O_()&&(this.state=3),Promise.resolve()))),this.listener.Yo())))})),this.stream.t_((s=>{n((()=>this.z_(s)))})),this.stream.onMessage((s=>{n((()=>++this.F_==1?this.H_(s):this.onNext(s)))}))}N_(){this.state=5,this.M_.p_((async()=>{this.state=0,this.start()}))}z_(e){return g(is,`close with error: ${e}`),this.stream=null,this.close(4,e)}Q_(e){return t=>{this.Ci.enqueueAndForget((()=>this.D_===e?t():(g(is,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Su extends Ai{constructor(e,t,n,s,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,s,o),this.serializer=i}j_(e,t){return this.connection.T_("Listen",e,t)}H_(e){return this.onNext(e)}onNext(e){this.M_.reset();const t=xa(this.serializer,e),n=(function(i){if(!("targetChange"in i))return T.min();const o=i.targetChange;return o.targetIds&&o.targetIds.length?T.min():o.readTime?ie(o.readTime):T.min()})(e);return this.listener.J_(t,n)}Z_(e){const t={};t.database=Cn(this.serializer),t.addTarget=(function(i,o){let a;const u=o.target;if(a=vn(u)?{documents:Oa(i,u)}:{query:Ma(i,u).ft},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=ci(i,o.resumeToken);const c=Vn(i,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(T.min())>0){a.readTime=zt(i,o.snapshotVersion.toTimestamp());const c=Vn(i,o.expectedCount);c!==null&&(a.expectedCount=c)}return a})(this.serializer,e);const n=qa(this.serializer,e);n&&(t.labels=n),this.K_(t)}X_(e){const t={};t.database=Cn(this.serializer),t.removeTarget=e,this.K_(t)}}class Cu extends Ai{constructor(e,t,n,s,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,s,o),this.serializer=i}get Y_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.Y_&&this.ea([])}j_(e,t){return this.connection.T_("Write",e,t)}H_(e){return S(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,S(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){S(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const t=La(e.writeResults,e.commitTime),n=ie(e.commitTime);return this.listener.na(n,t)}ra(){const e={};e.database=Cn(this.serializer),this.K_(e)}ea(e){const t={streamToken:this.lastStreamToken,writes:e.map((n=>Fa(this.serializer,n)))};this.K_(t)}}/** + */const is="PersistentStream";class Ai{constructor(e,t,n,s,i,o,a,u){this.Ci=e,this.b_=n,this.S_=s,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new Ii(e,t)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Ci.enqueueAfterDelay(this.b_,6e4,(()=>this.k_())))}K_(e){this.q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():t&&t.code===d.RESOURCE_EXHAUSTED?(he(t.toString()),he("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):t&&t.code===d.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.t_(t)}W_(){}auth(){this.state=1;const e=this.Q_(this.D_),t=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([n,s])=>{this.D_===t&&this.G_(n,s)}),(n=>{e((()=>{const s=new p(d.UNKNOWN,"Fetching auth token failed: "+n.message);return this.z_(s)}))}))}G_(e,t){const n=this.Q_(this.D_);this.stream=this.j_(e,t),this.stream.Zo((()=>{n((()=>this.listener.Zo()))})),this.stream.Yo((()=>{n((()=>(this.state=2,this.v_=this.Ci.enqueueAfterDelay(this.S_,1e4,(()=>(this.O_()&&(this.state=3),Promise.resolve()))),this.listener.Yo())))})),this.stream.t_((s=>{n((()=>this.z_(s)))})),this.stream.onMessage((s=>{n((()=>++this.F_==1?this.H_(s):this.onNext(s)))}))}N_(){this.state=5,this.M_.p_((async()=>{this.state=0,this.start()}))}z_(e){return g(is,`close with error: ${e}`),this.stream=null,this.close(4,e)}Q_(e){return t=>{this.Ci.enqueueAndForget((()=>this.D_===e?t():(g(is,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Su extends Ai{constructor(e,t,n,s,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,s,o),this.serializer=i}j_(e,t){return this.connection.T_("Listen",e,t)}H_(e){return this.onNext(e)}onNext(e){this.M_.reset();const t=xa(this.serializer,e),n=(function(i){if(!("targetChange"in i))return T.min();const o=i.targetChange;return o.targetIds&&o.targetIds.length?T.min():o.readTime?ie(o.readTime):T.min()})(e);return this.listener.J_(t,n)}Z_(e){const t={};t.database=Cn(this.serializer),t.addTarget=(function(i,o){let a;const u=o.target;if(a=vn(u)?{documents:Fa(i,u)}:{query:Ma(i,u).ft},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=ci(i,o.resumeToken);const c=Vn(i,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(T.min())>0){a.readTime=Bt(i,o.snapshotVersion.toTimestamp());const c=Vn(i,o.expectedCount);c!==null&&(a.expectedCount=c)}return a})(this.serializer,e);const n=qa(this.serializer,e);n&&(t.labels=n),this.K_(t)}X_(e){const t={};t.database=Cn(this.serializer),t.removeTarget=e,this.K_(t)}}class Cu extends Ai{constructor(e,t,n,s,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,s,o),this.serializer=i}get Y_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.Y_&&this.ea([])}j_(e,t){return this.connection.T_("Write",e,t)}H_(e){return S(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,S(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){S(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const t=Oa(e.writeResults,e.commitTime),n=ie(e.commitTime);return this.listener.na(n,t)}ra(){const e={};e.database=Cn(this.serializer),this.K_(e)}ea(e){const t={streamToken:this.lastStreamToken,writes:e.map((n=>La(this.serializer,n)))};this.K_(t)}}/** * @license * Copyright 2017 Google LLC * @@ -1312,7 +1312,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ne="RemoteStore";class xu{constructor(e,t,n,s,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.Ra=[],this.Aa=i,this.Aa.Mo((o=>{n.enqueueAndForget((async()=>{xe(this)&&(g(Ne,"Restarting streams for network reachability change."),await(async function(u){const c=I(u);c.Ea.add(4),await Et(c),c.Va.set("Unknown"),c.Ea.delete(4),await an(c)})(this))}))})),this.Va=new ku(n,s)}}async function an(r){if(xe(r))for(const e of r.Ra)await e(!0)}async function Et(r){for(const e of r.Ra)await e(!1)}function wi(r,e){const t=I(r);t.Ia.has(e.targetId)||(t.Ia.set(e.targetId,e),er(t)?Zn(t):Je(t).O_()&&Xn(t,e))}function Jn(r,e){const t=I(r),n=Je(t);t.Ia.delete(e),n.O_()&&vi(t,e),t.Ia.size===0&&(n.O_()?n.L_():xe(t)&&t.Va.set("Unknown"))}function Xn(r,e){if(r.da.$e(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(T.min())>0){const t=r.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}Je(r).Z_(e)}function vi(r,e){r.da.$e(e),Je(r).X_(e)}function Zn(r){r.da=new Pa({getRemoteKeysForTarget:e=>r.remoteSyncer.getRemoteKeysForTarget(e),At:e=>r.Ia.get(e)||null,ht:()=>r.datastore.serializer.databaseId}),Je(r).start(),r.Va.ua()}function er(r){return xe(r)&&!Je(r).x_()&&r.Ia.size>0}function xe(r){return I(r).Ea.size===0}function Ri(r){r.da=void 0}async function Fu(r){r.Va.set("Online")}async function Lu(r){r.Ia.forEach(((e,t)=>{Xn(r,e)}))}async function Ou(r,e){Ri(r),er(r)?(r.Va.ha(e),Zn(r)):r.Va.set("Unknown")}async function Mu(r,e,t){if(r.Va.set("Online"),e instanceof ui&&e.state===2&&e.cause)try{await(async function(s,i){const o=i.cause;for(const a of i.targetIds)s.Ia.has(a)&&(await s.remoteSyncer.rejectListen(a,o),s.Ia.delete(a),s.da.removeTarget(a))})(r,e)}catch(n){g(Ne,"Failed to remove targets %s: %s ",e.targetIds.join(","),n),await Gt(r,n)}else if(e instanceof Ft?r.da.Xe(e):e instanceof ai?r.da.st(e):r.da.tt(e),!t.isEqual(T.min()))try{const n=await Ti(r.localStore);t.compareTo(n)>=0&&await(function(i,o){const a=i.da.Tt(o);return a.targetChanges.forEach(((u,c)=>{if(u.resumeToken.approximateByteSize()>0){const l=i.Ia.get(c);l&&i.Ia.set(c,l.withResumeToken(u.resumeToken,o))}})),a.targetMismatches.forEach(((u,c)=>{const l=i.Ia.get(u);if(!l)return;i.Ia.set(u,l.withResumeToken($.EMPTY_BYTE_STRING,l.snapshotVersion)),vi(i,u);const h=new me(l.target,u,c,l.sequenceNumber);Xn(i,h)})),i.remoteSyncer.applyRemoteEvent(a)})(r,t)}catch(n){g(Ne,"Failed to raise snapshot:",n),await Gt(r,n)}}async function Gt(r,e,t){if(!He(e))throw e;r.Ea.add(1),await Et(r),r.Va.set("Offline"),t||(t=()=>Ti(r.localStore)),r.asyncQueue.enqueueRetryable((async()=>{g(Ne,"Retrying IndexedDB access"),await t(),r.Ea.delete(1),await an(r)}))}function Vi(r,e){return e().catch((t=>Gt(r,t,e)))}async function un(r){const e=I(r),t=Te(e);let n=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:On;for(;Uu(e);)try{const s=await Eu(e.localStore,n);if(s===null){e.Ta.length===0&&t.L_();break}n=s.batchId,qu(e,s)}catch(s){await Gt(e,s)}Pi(e)&&Si(e)}function Uu(r){return xe(r)&&r.Ta.length<10}function qu(r,e){r.Ta.push(e);const t=Te(r);t.O_()&&t.Y_&&t.ea(e.mutations)}function Pi(r){return xe(r)&&!Te(r).x_()&&r.Ta.length>0}function Si(r){Te(r).start()}async function Bu(r){Te(r).ra()}async function zu(r){const e=Te(r);for(const t of r.Ta)e.ea(t.mutations)}async function $u(r,e,t){const n=r.Ta.shift(),s=Gn.from(n,e,t);await Vi(r,(()=>r.remoteSyncer.applySuccessfulWrite(s))),await un(r)}async function Gu(r,e){e&&Te(r).Y_&&await(async function(n,s){if((function(o){return va(o)&&o!==d.ABORTED})(s.code)){const i=n.Ta.shift();Te(n).B_(),await Vi(n,(()=>n.remoteSyncer.rejectFailedWrite(i.batchId,s))),await un(n)}})(r,e),Pi(r)&&Si(r)}async function os(r,e){const t=I(r);t.asyncQueue.verifyOperationInProgress(),g(Ne,"RemoteStore received new credentials");const n=xe(t);t.Ea.add(3),await Et(t),n&&t.Va.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.Ea.delete(3),await an(t)}async function Qu(r,e){const t=I(r);e?(t.Ea.delete(2),await an(t)):e||(t.Ea.add(2),await Et(t),t.Va.set("Unknown"))}function Je(r){return r.ma||(r.ma=(function(t,n,s){const i=I(t);return i.sa(),new Su(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(r.datastore,r.asyncQueue,{Zo:Fu.bind(null,r),Yo:Lu.bind(null,r),t_:Ou.bind(null,r),J_:Mu.bind(null,r)}),r.Ra.push((async e=>{e?(r.ma.B_(),er(r)?Zn(r):r.Va.set("Unknown")):(await r.ma.stop(),Ri(r))}))),r.ma}function Te(r){return r.fa||(r.fa=(function(t,n,s){const i=I(t);return i.sa(),new Cu(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(r.datastore,r.asyncQueue,{Zo:()=>Promise.resolve(),Yo:Bu.bind(null,r),t_:Gu.bind(null,r),ta:zu.bind(null,r),na:$u.bind(null,r)}),r.Ra.push((async e=>{e?(r.fa.B_(),await un(r)):(await r.fa.stop(),r.Ta.length>0&&(g(Ne,`Stopping write stream with ${r.Ta.length} pending writes`),r.Ta=[]))}))),r.fa}/** + */const Ne="RemoteStore";class xu{constructor(e,t,n,s,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.Ra=[],this.Aa=i,this.Aa.Mo((o=>{n.enqueueAndForget((async()=>{xe(this)&&(g(Ne,"Restarting streams for network reachability change."),await(async function(u){const c=I(u);c.Ea.add(4),await Et(c),c.Va.set("Unknown"),c.Ea.delete(4),await on(c)})(this))}))})),this.Va=new ku(n,s)}}async function on(r){if(xe(r))for(const e of r.Ra)await e(!0)}async function Et(r){for(const e of r.Ra)await e(!1)}function wi(r,e){const t=I(r);t.Ia.has(e.targetId)||(t.Ia.set(e.targetId,e),er(t)?Zn(t):Je(t).O_()&&Xn(t,e))}function Jn(r,e){const t=I(r),n=Je(t);t.Ia.delete(e),n.O_()&&vi(t,e),t.Ia.size===0&&(n.O_()?n.L_():xe(t)&&t.Va.set("Unknown"))}function Xn(r,e){if(r.da.$e(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(T.min())>0){const t=r.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}Je(r).Z_(e)}function vi(r,e){r.da.$e(e),Je(r).X_(e)}function Zn(r){r.da=new Pa({getRemoteKeysForTarget:e=>r.remoteSyncer.getRemoteKeysForTarget(e),At:e=>r.Ia.get(e)||null,ht:()=>r.datastore.serializer.databaseId}),Je(r).start(),r.Va.ua()}function er(r){return xe(r)&&!Je(r).x_()&&r.Ia.size>0}function xe(r){return I(r).Ea.size===0}function Ri(r){r.da=void 0}async function Lu(r){r.Va.set("Online")}async function Ou(r){r.Ia.forEach(((e,t)=>{Xn(r,e)}))}async function Fu(r,e){Ri(r),er(r)?(r.Va.ha(e),Zn(r)):r.Va.set("Unknown")}async function Mu(r,e,t){if(r.Va.set("Online"),e instanceof ui&&e.state===2&&e.cause)try{await(async function(s,i){const o=i.cause;for(const a of i.targetIds)s.Ia.has(a)&&(await s.remoteSyncer.rejectListen(a,o),s.Ia.delete(a),s.da.removeTarget(a))})(r,e)}catch(n){g(Ne,"Failed to remove targets %s: %s ",e.targetIds.join(","),n),await $t(r,n)}else if(e instanceof xt?r.da.Xe(e):e instanceof ai?r.da.st(e):r.da.tt(e),!t.isEqual(T.min()))try{const n=await Ti(r.localStore);t.compareTo(n)>=0&&await(function(i,o){const a=i.da.Tt(o);return a.targetChanges.forEach(((u,c)=>{if(u.resumeToken.approximateByteSize()>0){const l=i.Ia.get(c);l&&i.Ia.set(c,l.withResumeToken(u.resumeToken,o))}})),a.targetMismatches.forEach(((u,c)=>{const l=i.Ia.get(u);if(!l)return;i.Ia.set(u,l.withResumeToken($.EMPTY_BYTE_STRING,l.snapshotVersion)),vi(i,u);const h=new me(l.target,u,c,l.sequenceNumber);Xn(i,h)})),i.remoteSyncer.applyRemoteEvent(a)})(r,t)}catch(n){g(Ne,"Failed to raise snapshot:",n),await $t(r,n)}}async function $t(r,e,t){if(!He(e))throw e;r.Ea.add(1),await Et(r),r.Va.set("Offline"),t||(t=()=>Ti(r.localStore)),r.asyncQueue.enqueueRetryable((async()=>{g(Ne,"Retrying IndexedDB access"),await t(),r.Ea.delete(1),await on(r)}))}function Vi(r,e){return e().catch((t=>$t(r,t,e)))}async function an(r){const e=I(r),t=Te(e);let n=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:Fn;for(;Uu(e);)try{const s=await Eu(e.localStore,n);if(s===null){e.Ta.length===0&&t.L_();break}n=s.batchId,qu(e,s)}catch(s){await $t(e,s)}Pi(e)&&Si(e)}function Uu(r){return xe(r)&&r.Ta.length<10}function qu(r,e){r.Ta.push(e);const t=Te(r);t.O_()&&t.Y_&&t.ea(e.mutations)}function Pi(r){return xe(r)&&!Te(r).x_()&&r.Ta.length>0}function Si(r){Te(r).start()}async function Bu(r){Te(r).ra()}async function zu(r){const e=Te(r);for(const t of r.Ta)e.ea(t.mutations)}async function $u(r,e,t){const n=r.Ta.shift(),s=Gn.from(n,e,t);await Vi(r,(()=>r.remoteSyncer.applySuccessfulWrite(s))),await an(r)}async function Gu(r,e){e&&Te(r).Y_&&await(async function(n,s){if((function(o){return va(o)&&o!==d.ABORTED})(s.code)){const i=n.Ta.shift();Te(n).B_(),await Vi(n,(()=>n.remoteSyncer.rejectFailedWrite(i.batchId,s))),await an(n)}})(r,e),Pi(r)&&Si(r)}async function os(r,e){const t=I(r);t.asyncQueue.verifyOperationInProgress(),g(Ne,"RemoteStore received new credentials");const n=xe(t);t.Ea.add(3),await Et(t),n&&t.Va.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.Ea.delete(3),await on(t)}async function Qu(r,e){const t=I(r);e?(t.Ea.delete(2),await on(t)):e||(t.Ea.add(2),await Et(t),t.Va.set("Unknown"))}function Je(r){return r.ma||(r.ma=(function(t,n,s){const i=I(t);return i.sa(),new Su(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(r.datastore,r.asyncQueue,{Zo:Lu.bind(null,r),Yo:Ou.bind(null,r),t_:Fu.bind(null,r),J_:Mu.bind(null,r)}),r.Ra.push((async e=>{e?(r.ma.B_(),er(r)?Zn(r):r.Va.set("Unknown")):(await r.ma.stop(),Ri(r))}))),r.ma}function Te(r){return r.fa||(r.fa=(function(t,n,s){const i=I(t);return i.sa(),new Cu(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(r.datastore,r.asyncQueue,{Zo:()=>Promise.resolve(),Yo:Bu.bind(null,r),t_:Gu.bind(null,r),ta:zu.bind(null,r),na:$u.bind(null,r)}),r.Ra.push((async e=>{e?(r.fa.B_(),await an(r)):(await r.fa.stop(),r.Ta.length>0&&(g(Ne,`Stopping write stream with ${r.Ta.length} pending writes`),r.Ta=[]))}))),r.fa}/** * @license * Copyright 2017 Google LLC * @@ -1360,7 +1360,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class as{constructor(){this.ga=new N(y.comparator)}track(e){const t=e.doc.key,n=this.ga.get(t);n?e.type!==0&&n.type===3?this.ga=this.ga.insert(t,e):e.type===3&&n.type!==1?this.ga=this.ga.insert(t,{type:n.type,doc:e.doc}):e.type===2&&n.type===2?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):e.type===2&&n.type===0?this.ga=this.ga.insert(t,{type:0,doc:e.doc}):e.type===1&&n.type===0?this.ga=this.ga.remove(t):e.type===1&&n.type===2?this.ga=this.ga.insert(t,{type:1,doc:n.doc}):e.type===0&&n.type===1?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):E(63341,{Vt:e,pa:n}):this.ga=this.ga.insert(t,e)}ya(){const e=[];return this.ga.inorderTraversal(((t,n)=>{e.push(n)})),e}}class je{constructor(e,t,n,s,i,o,a,u,c){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,t,n,s,i){const o=[];return t.forEach((a=>{o.push({type:0,doc:a})})),new je(e,t,qe.emptySet(t),o,n,s,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Zt(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let s=0;s{e.push(n)})),e}}class je{constructor(e,t,n,s,i,o,a,u,c){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,t,n,s,i){const o=[];return t.forEach((a=>{o.push({type:0,doc:a})})),new je(e,t,qe.emptySet(t),o,n,s,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Xt(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let s=0;se.Da()))}}class Ku{constructor(){this.queries=us(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(t,n){const s=I(t),i=s.queries;s.queries=us(),i.forEach(((o,a)=>{for(const u of a.ba)u.onError(n)}))})(this,new p(d.ABORTED,"Firestore shutting down"))}}function us(){return new ke((r=>Ks(r)),Zt)}async function rr(r,e){const t=I(r);let n=3;const s=e.query;let i=t.queries.get(s);i?!i.Sa()&&e.Da()&&(n=2):(i=new ju,n=e.Da()?0:1);try{switch(n){case 0:i.wa=await t.onListen(s,!0);break;case 1:i.wa=await t.onListen(s,!1);break;case 2:await t.onFirstRemoteStoreListen(s)}}catch(o){const a=nr(o,`Initialization of query '${Le(e.query)}' failed`);return void e.onError(a)}t.queries.set(s,i),i.ba.push(e),e.va(t.onlineState),i.wa&&e.Fa(i.wa)&&ir(t)}async function sr(r,e){const t=I(r),n=e.query;let s=3;const i=t.queries.get(n);if(i){const o=i.ba.indexOf(e);o>=0&&(i.ba.splice(o,1),i.ba.length===0?s=e.Da()?0:1:!i.Sa()&&e.Da()&&(s=2))}switch(s){case 0:return t.queries.delete(n),t.onUnlisten(n,!0);case 1:return t.queries.delete(n),t.onUnlisten(n,!1);case 2:return t.onLastRemoteStoreUnlisten(n);default:return}}function Wu(r,e){const t=I(r);let n=!1;for(const s of e){const i=s.query,o=t.queries.get(i);if(o){for(const a of o.ba)a.Fa(s)&&(n=!0);o.wa=s}}n&&ir(t)}function Hu(r,e,t){const n=I(r),s=n.queries.get(e);if(s)for(const i of s.ba)i.onError(t);n.queries.delete(e)}function ir(r){r.Ca.forEach((e=>{e.next()}))}var Dn,cs;(cs=Dn||(Dn={})).Ma="default",cs.Cache="cache";class or{constructor(e,t,n){this.query=e,this.xa=t,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=n||{}}Fa(e){if(!this.options.includeMetadataChanges){const n=[];for(const s of e.docChanges)s.type!==3&&n.push(s);e=new je(e.query,e.docs,e.oldDocs,n,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),t=!0):this.La(e,this.onlineState)&&(this.ka(e),t=!0),this.Na=e,t}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let t=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),t=!0),t}La(e,t){if(!e.fromCache||!this.Da())return!0;const n=t!=="Offline";return(!this.options.Ka||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const t=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}ka(e){e=je.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==Dn.Cache}}/** + */class ju{constructor(){this.wa=void 0,this.ba=[]}Sa(){return this.ba.some((e=>e.Da()))}}class Ku{constructor(){this.queries=us(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(t,n){const s=I(t),i=s.queries;s.queries=us(),i.forEach(((o,a)=>{for(const u of a.ba)u.onError(n)}))})(this,new p(d.ABORTED,"Firestore shutting down"))}}function us(){return new ke((r=>Ks(r)),Xt)}async function rr(r,e){const t=I(r);let n=3;const s=e.query;let i=t.queries.get(s);i?!i.Sa()&&e.Da()&&(n=2):(i=new ju,n=e.Da()?0:1);try{switch(n){case 0:i.wa=await t.onListen(s,!0);break;case 1:i.wa=await t.onListen(s,!1);break;case 2:await t.onFirstRemoteStoreListen(s)}}catch(o){const a=nr(o,`Initialization of query '${Oe(e.query)}' failed`);return void e.onError(a)}t.queries.set(s,i),i.ba.push(e),e.va(t.onlineState),i.wa&&e.Fa(i.wa)&&ir(t)}async function sr(r,e){const t=I(r),n=e.query;let s=3;const i=t.queries.get(n);if(i){const o=i.ba.indexOf(e);o>=0&&(i.ba.splice(o,1),i.ba.length===0?s=e.Da()?0:1:!i.Sa()&&e.Da()&&(s=2))}switch(s){case 0:return t.queries.delete(n),t.onUnlisten(n,!0);case 1:return t.queries.delete(n),t.onUnlisten(n,!1);case 2:return t.onLastRemoteStoreUnlisten(n);default:return}}function Wu(r,e){const t=I(r);let n=!1;for(const s of e){const i=s.query,o=t.queries.get(i);if(o){for(const a of o.ba)a.Fa(s)&&(n=!0);o.wa=s}}n&&ir(t)}function Hu(r,e,t){const n=I(r),s=n.queries.get(e);if(s)for(const i of s.ba)i.onError(t);n.queries.delete(e)}function ir(r){r.Ca.forEach((e=>{e.next()}))}var Dn,cs;(cs=Dn||(Dn={})).Ma="default",cs.Cache="cache";class or{constructor(e,t,n){this.query=e,this.xa=t,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=n||{}}Fa(e){if(!this.options.includeMetadataChanges){const n=[];for(const s of e.docChanges)s.type!==3&&n.push(s);e=new je(e.query,e.docs,e.oldDocs,n,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),t=!0):this.La(e,this.onlineState)&&(this.ka(e),t=!0),this.Na=e,t}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let t=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),t=!0),t}La(e,t){if(!e.fromCache||!this.Da())return!0;const n=t!=="Offline";return(!this.options.Ka||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const t=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}ka(e){e=je.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==Dn.Cache}}/** * @license * Copyright 2017 Google LLC * @@ -1390,7 +1390,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Ci{constructor(e){this.key=e}}class bi{constructor(e){this.key=e}}class Yu{constructor(e,t){this.query=e,this.Za=t,this.Xa=null,this.hasCachedResults=!1,this.current=!1,this.Ya=V(),this.mutatedKeys=V(),this.eu=Ws(e),this.tu=new qe(this.eu)}get nu(){return this.Za}ru(e,t){const n=t?t.iu:new as,s=t?t.tu:this.tu;let i=t?t.mutatedKeys:this.mutatedKeys,o=s,a=!1;const u=this.query.limitType==="F"&&s.size===this.query.limit?s.last():null,c=this.query.limitType==="L"&&s.size===this.query.limit?s.first():null;if(e.inorderTraversal(((l,h)=>{const f=s.get(l),_=en(this.query,h)?h:null,A=!!f&&this.mutatedKeys.has(f.key),v=!!_&&(_.hasLocalMutations||this.mutatedKeys.has(_.key)&&_.hasCommittedMutations);let w=!1;f&&_?f.data.isEqual(_.data)?A!==v&&(n.track({type:3,doc:_}),w=!0):this.su(f,_)||(n.track({type:2,doc:_}),w=!0,(u&&this.eu(_,u)>0||c&&this.eu(_,c)<0)&&(a=!0)):!f&&_?(n.track({type:0,doc:_}),w=!0):f&&!_&&(n.track({type:1,doc:f}),w=!0,(u||c)&&(a=!0)),w&&(_?(o=o.add(_),i=v?i.add(l):i.delete(l)):(o=o.delete(l),i=i.delete(l)))})),this.query.limit!==null)for(;o.size>this.query.limit;){const l=this.query.limitType==="F"?o.last():o.first();o=o.delete(l.key),i=i.delete(l.key),n.track({type:1,doc:l})}return{tu:o,iu:n,Ss:a,mutatedKeys:i}}su(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n,s){const i=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const o=e.iu.ya();o.sort(((l,h)=>(function(_,A){const v=w=>{switch(w){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return E(20277,{Vt:w})}};return v(_)-v(A)})(l.type,h.type)||this.eu(l.doc,h.doc))),this.ou(n),s=s??!1;const a=t&&!s?this._u():[],u=this.Ya.size===0&&this.current&&!s?1:0,c=u!==this.Xa;return this.Xa=u,o.length!==0||c?{snapshot:new je(this.query,e.tu,i,o,e.mutatedKeys,u===0,c,!1,!!n&&n.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new as,mutatedKeys:this.mutatedKeys,Ss:!1},!1)):{au:[]}}uu(e){return!this.Za.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach((t=>this.Za=this.Za.add(t))),e.modifiedDocuments.forEach((t=>{})),e.removedDocuments.forEach((t=>this.Za=this.Za.delete(t))),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Ya;this.Ya=V(),this.tu.forEach((n=>{this.uu(n.key)&&(this.Ya=this.Ya.add(n.key))}));const t=[];return e.forEach((n=>{this.Ya.has(n)||t.push(new bi(n))})),this.Ya.forEach((n=>{e.has(n)||t.push(new Ci(n))})),t}cu(e){this.Za=e.ks,this.Ya=V();const t=this.ru(e.documents);return this.applyChanges(t,!0)}lu(){return je.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Xa===0,this.hasCachedResults)}}const ar="SyncEngine";class Ju{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class Xu{constructor(e){this.key=e,this.hu=!1}}class Zu{constructor(e,t,n,s,i,o){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=s,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.Pu={},this.Tu=new ke((a=>Ks(a)),Zt),this.Iu=new Map,this.Eu=new Set,this.Ru=new N(y.comparator),this.Au=new Map,this.Vu=new Kn,this.du={},this.mu=new Map,this.fu=Qe.ar(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function ec(r,e,t=!0){const n=Li(r);let s;const i=n.Tu.get(e);return i?(n.sharedClientState.addLocalQueryTarget(i.targetId),s=i.view.lu()):s=await Ni(n,e,t,!0),s}async function tc(r,e){const t=Li(r);await Ni(t,e,!0,!1)}async function Ni(r,e,t,n){const s=await Tu(r.localStore,se(e)),i=s.targetId,o=r.sharedClientState.addLocalQueryTarget(i,t);let a;return n&&(a=await nc(r,e,i,o==="current",s.resumeToken)),r.isPrimaryClient&&t&&wi(r.remoteStore,s),a}async function nc(r,e,t,n,s){r.pu=(h,f,_)=>(async function(v,w,x,U){let J=w.view.ru(x);J.Ss&&(J=await ts(v.localStore,w.query,!1).then((({documents:Vt})=>w.view.ru(Vt,J))));const ve=U&&U.targetChanges.get(w.targetId),Ar=U&&U.targetMismatches.get(w.targetId)!=null,Rt=w.view.applyChanges(J,v.isPrimaryClient,ve,Ar);return hs(v,w.targetId,Rt.au),Rt.snapshot})(r,h,f,_);const i=await ts(r.localStore,e,!0),o=new Yu(e,i.ks),a=o.ru(i.documents),u=yt.createSynthesizedTargetChangeForCurrentChange(t,n&&r.onlineState!=="Offline",s),c=o.applyChanges(a,r.isPrimaryClient,u);hs(r,t,c.au);const l=new Ju(e,t,o);return r.Tu.set(e,l),r.Iu.has(t)?r.Iu.get(t).push(e):r.Iu.set(t,[e]),c.snapshot}async function rc(r,e,t){const n=I(r),s=n.Tu.get(e),i=n.Iu.get(s.targetId);if(i.length>1)return n.Iu.set(s.targetId,i.filter((o=>!Zt(o,e)))),void n.Tu.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await bn(n.localStore,s.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(s.targetId),t&&Jn(n.remoteStore,s.targetId),kn(n,s.targetId)})).catch(We)):(kn(n,s.targetId),await bn(n.localStore,s.targetId,!0))}async function sc(r,e){const t=I(r),n=t.Tu.get(e),s=t.Iu.get(n.targetId);t.isPrimaryClient&&s.length===1&&(t.sharedClientState.removeLocalQueryTarget(n.targetId),Jn(t.remoteStore,n.targetId))}async function ic(r,e,t){const n=dc(r);try{const s=await(function(o,a){const u=I(o),c=b.now(),l=a.reduce(((_,A)=>_.add(A.key)),V());let h,f;return u.persistence.runTransaction("Locally write mutations","readwrite",(_=>{let A=de(),v=V();return u.xs.getEntries(_,l).next((w=>{A=w,A.forEach(((x,U)=>{U.isValidDocument()||(v=v.add(x))}))})).next((()=>u.localDocuments.getOverlayedDocuments(_,A))).next((w=>{h=w;const x=[];for(const U of a){const J=Ea(U,h.get(U.key).overlayedDocument);J!=null&&x.push(new we(U.key,J,Us(J.value.mapValue),W.exists(!0)))}return u.mutationQueue.addMutationBatch(_,c,x,a)})).next((w=>{f=w;const x=w.applyToLocalDocumentSet(h,v);return u.documentOverlayCache.saveOverlays(_,w.batchId,x)}))})).then((()=>({batchId:f.batchId,changes:Ys(h)})))})(n.localStore,e);n.sharedClientState.addPendingMutation(s.batchId),(function(o,a,u){let c=o.du[o.currentUser.toKey()];c||(c=new N(R)),c=c.insert(a,u),o.du[o.currentUser.toKey()]=c})(n,s.batchId,t),await Tt(n,s.changes),await un(n.remoteStore)}catch(s){const i=nr(s,"Failed to persist write");t.reject(i)}}async function Di(r,e){const t=I(r);try{const n=await gu(t.localStore,e);e.targetChanges.forEach(((s,i)=>{const o=t.Au.get(i);o&&(S(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1,22616),s.addedDocuments.size>0?o.hu=!0:s.modifiedDocuments.size>0?S(o.hu,14607):s.removedDocuments.size>0&&(S(o.hu,42227),o.hu=!1))})),await Tt(t,n,e)}catch(n){await We(n)}}function ls(r,e,t){const n=I(r);if(n.isPrimaryClient&&t===0||!n.isPrimaryClient&&t===1){const s=[];n.Tu.forEach(((i,o)=>{const a=o.view.va(e);a.snapshot&&s.push(a.snapshot)})),(function(o,a){const u=I(o);u.onlineState=a;let c=!1;u.queries.forEach(((l,h)=>{for(const f of h.ba)f.va(a)&&(c=!0)})),c&&ir(u)})(n.eventManager,e),s.length&&n.Pu.J_(s),n.onlineState=e,n.isPrimaryClient&&n.sharedClientState.setOnlineState(e)}}async function oc(r,e,t){const n=I(r);n.sharedClientState.updateQueryState(e,"rejected",t);const s=n.Au.get(e),i=s&&s.key;if(i){let o=new N(y.comparator);o=o.insert(i,j.newNoDocument(i,T.min()));const a=V().add(i),u=new sn(T.min(),new Map,new N(R),o,a);await Di(n,u),n.Ru=n.Ru.remove(i),n.Au.delete(e),ur(n)}else await bn(n.localStore,e,!1).then((()=>kn(n,e,t))).catch(We)}async function ac(r,e){const t=I(r),n=e.batch.batchId;try{const s=await pu(t.localStore,e);xi(t,n,null),ki(t,n),t.sharedClientState.updateMutationState(n,"acknowledged"),await Tt(t,s)}catch(s){await We(s)}}async function uc(r,e,t){const n=I(r);try{const s=await(function(o,a){const u=I(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",(c=>{let l;return u.mutationQueue.lookupMutationBatch(c,a).next((h=>(S(h!==null,37113),l=h.keys(),u.mutationQueue.removeMutationBatch(c,h)))).next((()=>u.mutationQueue.performConsistencyCheck(c))).next((()=>u.documentOverlayCache.removeOverlaysForBatchId(c,l,a))).next((()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,l))).next((()=>u.localDocuments.getDocuments(c,l)))}))})(n.localStore,e);xi(n,e,t),ki(n,e),n.sharedClientState.updateMutationState(e,"rejected",t),await Tt(n,s)}catch(s){await We(s)}}function ki(r,e){(r.mu.get(e)||[]).forEach((t=>{t.resolve()})),r.mu.delete(e)}function xi(r,e,t){const n=I(r);let s=n.du[n.currentUser.toKey()];if(s){const i=s.get(e);i&&(t?i.reject(t):i.resolve(),s=s.remove(e)),n.du[n.currentUser.toKey()]=s}}function kn(r,e,t=null){r.sharedClientState.removeLocalQueryTarget(e);for(const n of r.Iu.get(e))r.Tu.delete(n),t&&r.Pu.yu(n,t);r.Iu.delete(e),r.isPrimaryClient&&r.Vu.Gr(e).forEach((n=>{r.Vu.containsKey(n)||Fi(r,n)}))}function Fi(r,e){r.Eu.delete(e.path.canonicalString());const t=r.Ru.get(e);t!==null&&(Jn(r.remoteStore,t),r.Ru=r.Ru.remove(e),r.Au.delete(t),ur(r))}function hs(r,e,t){for(const n of t)n instanceof Ci?(r.Vu.addReference(n.key,e),cc(r,n)):n instanceof bi?(g(ar,"Document no longer in limbo: "+n.key),r.Vu.removeReference(n.key,e),r.Vu.containsKey(n.key)||Fi(r,n.key)):E(19791,{wu:n})}function cc(r,e){const t=e.key,n=t.path.canonicalString();r.Ru.get(t)||r.Eu.has(n)||(g(ar,"New document in limbo: "+t),r.Eu.add(n),ur(r))}function ur(r){for(;r.Eu.size>0&&r.Ru.size{o.push(n.pu(u,e,t).then((c=>{if((c||t)&&n.isPrimaryClient){const l=c?!c.fromCache:t?.targetChanges.get(u.targetId)?.current;n.sharedClientState.updateQueryState(u.targetId,l?"current":"not-current")}if(c){s.push(c);const l=Hn.Es(u.targetId,c);i.push(l)}})))})),await Promise.all(o),n.Pu.J_(s),await(async function(u,c){const l=I(u);try{await l.persistence.runTransaction("notifyLocalViewChanges","readwrite",(h=>m.forEach(c,(f=>m.forEach(f.Ts,(_=>l.persistence.referenceDelegate.addReference(h,f.targetId,_))).next((()=>m.forEach(f.Is,(_=>l.persistence.referenceDelegate.removeReference(h,f.targetId,_)))))))))}catch(h){if(!He(h))throw h;g(Yn,"Failed to update sequence numbers: "+h)}for(const h of c){const f=h.targetId;if(!h.fromCache){const _=l.vs.get(f),A=_.snapshotVersion,v=_.withLastLimboFreeSnapshotVersion(A);l.vs=l.vs.insert(f,v)}}})(n.localStore,i))}async function lc(r,e){const t=I(r);if(!t.currentUser.isEqual(e)){g(ar,"User change. New user:",e.toKey());const n=await Ei(t.localStore,e);t.currentUser=e,(function(i,o){i.mu.forEach((a=>{a.forEach((u=>{u.reject(new p(d.CANCELLED,o))}))})),i.mu.clear()})(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,n.removedBatchIds,n.addedBatchIds),await Tt(t,n.Ns)}}function hc(r,e){const t=I(r),n=t.Au.get(e);if(n&&n.hu)return V().add(n.key);{let s=V();const i=t.Iu.get(e);if(!i)return s;for(const o of i){const a=t.Tu.get(o);s=s.unionWith(a.view.nu)}return s}}function Li(r){const e=I(r);return e.remoteStore.remoteSyncer.applyRemoteEvent=Di.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=hc.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=oc.bind(null,e),e.Pu.J_=Wu.bind(null,e.eventManager),e.Pu.yu=Hu.bind(null,e.eventManager),e}function dc(r){const e=I(r);return e.remoteStore.remoteSyncer.applySuccessfulWrite=ac.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=uc.bind(null,e),e}class Qt{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=on(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,t){return null}Mu(e,t){return null}vu(e){return _u(this.persistence,new du,e.initialUser,this.serializer)}Cu(e){return new yi(Wn.Vi,this.serializer)}Du(e){return new Au}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Qt.provider={build:()=>new Qt};class fc extends Qt{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,t){S(this.persistence.referenceDelegate instanceof $t,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new Ja(n,e.asyncQueue,t)}Cu(e){const t=this.cacheSizeBytes!==void 0?H.withCacheSize(this.cacheSizeBytes):H.DEFAULT;return new yi((n=>$t.Vi(n,t)),this.serializer)}}class xn{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=n=>ls(this.syncEngine,n,1),this.remoteStore.remoteSyncer.handleCredentialChange=lc.bind(null,this.syncEngine),await Qu(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new Ku})()}createDatastore(e){const t=on(e.databaseInfo.databaseId),n=Pu(e.databaseInfo);return Du(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return(function(n,s,i,o,a){return new xu(n,s,i,o,a)})(this.localStore,this.datastore,e.asyncQueue,(t=>ls(this.syncEngine,t,0)),(function(){return ss.v()?new ss:new wu})())}createSyncEngine(e,t){return(function(s,i,o,a,u,c,l){const h=new Zu(s,i,o,a,u,c);return l&&(h.gu=!0),h})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){await(async function(t){const n=I(t);g(Ne,"RemoteStore shutting down."),n.Ea.add(5),await Et(n),n.Aa.shutdown(),n.Va.set("Unknown")})(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}xn.provider={build:()=>new xn};/** + */class Ci{constructor(e){this.key=e}}class bi{constructor(e){this.key=e}}class Yu{constructor(e,t){this.query=e,this.Za=t,this.Xa=null,this.hasCachedResults=!1,this.current=!1,this.Ya=V(),this.mutatedKeys=V(),this.eu=Ws(e),this.tu=new qe(this.eu)}get nu(){return this.Za}ru(e,t){const n=t?t.iu:new as,s=t?t.tu:this.tu;let i=t?t.mutatedKeys:this.mutatedKeys,o=s,a=!1;const u=this.query.limitType==="F"&&s.size===this.query.limit?s.last():null,c=this.query.limitType==="L"&&s.size===this.query.limit?s.first():null;if(e.inorderTraversal(((l,h)=>{const f=s.get(l),_=Zt(this.query,h)?h:null,A=!!f&&this.mutatedKeys.has(f.key),v=!!_&&(_.hasLocalMutations||this.mutatedKeys.has(_.key)&&_.hasCommittedMutations);let w=!1;f&&_?f.data.isEqual(_.data)?A!==v&&(n.track({type:3,doc:_}),w=!0):this.su(f,_)||(n.track({type:2,doc:_}),w=!0,(u&&this.eu(_,u)>0||c&&this.eu(_,c)<0)&&(a=!0)):!f&&_?(n.track({type:0,doc:_}),w=!0):f&&!_&&(n.track({type:1,doc:f}),w=!0,(u||c)&&(a=!0)),w&&(_?(o=o.add(_),i=v?i.add(l):i.delete(l)):(o=o.delete(l),i=i.delete(l)))})),this.query.limit!==null)for(;o.size>this.query.limit;){const l=this.query.limitType==="F"?o.last():o.first();o=o.delete(l.key),i=i.delete(l.key),n.track({type:1,doc:l})}return{tu:o,iu:n,Ss:a,mutatedKeys:i}}su(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n,s){const i=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const o=e.iu.ya();o.sort(((l,h)=>(function(_,A){const v=w=>{switch(w){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return E(20277,{Vt:w})}};return v(_)-v(A)})(l.type,h.type)||this.eu(l.doc,h.doc))),this.ou(n),s=s??!1;const a=t&&!s?this._u():[],u=this.Ya.size===0&&this.current&&!s?1:0,c=u!==this.Xa;return this.Xa=u,o.length!==0||c?{snapshot:new je(this.query,e.tu,i,o,e.mutatedKeys,u===0,c,!1,!!n&&n.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new as,mutatedKeys:this.mutatedKeys,Ss:!1},!1)):{au:[]}}uu(e){return!this.Za.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach((t=>this.Za=this.Za.add(t))),e.modifiedDocuments.forEach((t=>{})),e.removedDocuments.forEach((t=>this.Za=this.Za.delete(t))),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Ya;this.Ya=V(),this.tu.forEach((n=>{this.uu(n.key)&&(this.Ya=this.Ya.add(n.key))}));const t=[];return e.forEach((n=>{this.Ya.has(n)||t.push(new bi(n))})),this.Ya.forEach((n=>{e.has(n)||t.push(new Ci(n))})),t}cu(e){this.Za=e.ks,this.Ya=V();const t=this.ru(e.documents);return this.applyChanges(t,!0)}lu(){return je.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Xa===0,this.hasCachedResults)}}const ar="SyncEngine";class Ju{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class Xu{constructor(e){this.key=e,this.hu=!1}}class Zu{constructor(e,t,n,s,i,o){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=s,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.Pu={},this.Tu=new ke((a=>Ks(a)),Xt),this.Iu=new Map,this.Eu=new Set,this.Ru=new N(y.comparator),this.Au=new Map,this.Vu=new Kn,this.du={},this.mu=new Map,this.fu=Qe.ar(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function ec(r,e,t=!0){const n=Oi(r);let s;const i=n.Tu.get(e);return i?(n.sharedClientState.addLocalQueryTarget(i.targetId),s=i.view.lu()):s=await Ni(n,e,t,!0),s}async function tc(r,e){const t=Oi(r);await Ni(t,e,!0,!1)}async function Ni(r,e,t,n){const s=await Tu(r.localStore,se(e)),i=s.targetId,o=r.sharedClientState.addLocalQueryTarget(i,t);let a;return n&&(a=await nc(r,e,i,o==="current",s.resumeToken)),r.isPrimaryClient&&t&&wi(r.remoteStore,s),a}async function nc(r,e,t,n,s){r.pu=(h,f,_)=>(async function(v,w,x,U){let J=w.view.ru(x);J.Ss&&(J=await ts(v.localStore,w.query,!1).then((({documents:Rt})=>w.view.ru(Rt,J))));const ve=U&&U.targetChanges.get(w.targetId),Ar=U&&U.targetMismatches.get(w.targetId)!=null,vt=w.view.applyChanges(J,v.isPrimaryClient,ve,Ar);return hs(v,w.targetId,vt.au),vt.snapshot})(r,h,f,_);const i=await ts(r.localStore,e,!0),o=new Yu(e,i.ks),a=o.ru(i.documents),u=yt.createSynthesizedTargetChangeForCurrentChange(t,n&&r.onlineState!=="Offline",s),c=o.applyChanges(a,r.isPrimaryClient,u);hs(r,t,c.au);const l=new Ju(e,t,o);return r.Tu.set(e,l),r.Iu.has(t)?r.Iu.get(t).push(e):r.Iu.set(t,[e]),c.snapshot}async function rc(r,e,t){const n=I(r),s=n.Tu.get(e),i=n.Iu.get(s.targetId);if(i.length>1)return n.Iu.set(s.targetId,i.filter((o=>!Xt(o,e)))),void n.Tu.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await bn(n.localStore,s.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(s.targetId),t&&Jn(n.remoteStore,s.targetId),kn(n,s.targetId)})).catch(We)):(kn(n,s.targetId),await bn(n.localStore,s.targetId,!0))}async function sc(r,e){const t=I(r),n=t.Tu.get(e),s=t.Iu.get(n.targetId);t.isPrimaryClient&&s.length===1&&(t.sharedClientState.removeLocalQueryTarget(n.targetId),Jn(t.remoteStore,n.targetId))}async function ic(r,e,t){const n=dc(r);try{const s=await(function(o,a){const u=I(o),c=b.now(),l=a.reduce(((_,A)=>_.add(A.key)),V());let h,f;return u.persistence.runTransaction("Locally write mutations","readwrite",(_=>{let A=de(),v=V();return u.xs.getEntries(_,l).next((w=>{A=w,A.forEach(((x,U)=>{U.isValidDocument()||(v=v.add(x))}))})).next((()=>u.localDocuments.getOverlayedDocuments(_,A))).next((w=>{h=w;const x=[];for(const U of a){const J=Ea(U,h.get(U.key).overlayedDocument);J!=null&&x.push(new we(U.key,J,Us(J.value.mapValue),W.exists(!0)))}return u.mutationQueue.addMutationBatch(_,c,x,a)})).next((w=>{f=w;const x=w.applyToLocalDocumentSet(h,v);return u.documentOverlayCache.saveOverlays(_,w.batchId,x)}))})).then((()=>({batchId:f.batchId,changes:Ys(h)})))})(n.localStore,e);n.sharedClientState.addPendingMutation(s.batchId),(function(o,a,u){let c=o.du[o.currentUser.toKey()];c||(c=new N(R)),c=c.insert(a,u),o.du[o.currentUser.toKey()]=c})(n,s.batchId,t),await Tt(n,s.changes),await an(n.remoteStore)}catch(s){const i=nr(s,"Failed to persist write");t.reject(i)}}async function Di(r,e){const t=I(r);try{const n=await gu(t.localStore,e);e.targetChanges.forEach(((s,i)=>{const o=t.Au.get(i);o&&(S(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1,22616),s.addedDocuments.size>0?o.hu=!0:s.modifiedDocuments.size>0?S(o.hu,14607):s.removedDocuments.size>0&&(S(o.hu,42227),o.hu=!1))})),await Tt(t,n,e)}catch(n){await We(n)}}function ls(r,e,t){const n=I(r);if(n.isPrimaryClient&&t===0||!n.isPrimaryClient&&t===1){const s=[];n.Tu.forEach(((i,o)=>{const a=o.view.va(e);a.snapshot&&s.push(a.snapshot)})),(function(o,a){const u=I(o);u.onlineState=a;let c=!1;u.queries.forEach(((l,h)=>{for(const f of h.ba)f.va(a)&&(c=!0)})),c&&ir(u)})(n.eventManager,e),s.length&&n.Pu.J_(s),n.onlineState=e,n.isPrimaryClient&&n.sharedClientState.setOnlineState(e)}}async function oc(r,e,t){const n=I(r);n.sharedClientState.updateQueryState(e,"rejected",t);const s=n.Au.get(e),i=s&&s.key;if(i){let o=new N(y.comparator);o=o.insert(i,j.newNoDocument(i,T.min()));const a=V().add(i),u=new rn(T.min(),new Map,new N(R),o,a);await Di(n,u),n.Ru=n.Ru.remove(i),n.Au.delete(e),ur(n)}else await bn(n.localStore,e,!1).then((()=>kn(n,e,t))).catch(We)}async function ac(r,e){const t=I(r),n=e.batch.batchId;try{const s=await pu(t.localStore,e);xi(t,n,null),ki(t,n),t.sharedClientState.updateMutationState(n,"acknowledged"),await Tt(t,s)}catch(s){await We(s)}}async function uc(r,e,t){const n=I(r);try{const s=await(function(o,a){const u=I(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",(c=>{let l;return u.mutationQueue.lookupMutationBatch(c,a).next((h=>(S(h!==null,37113),l=h.keys(),u.mutationQueue.removeMutationBatch(c,h)))).next((()=>u.mutationQueue.performConsistencyCheck(c))).next((()=>u.documentOverlayCache.removeOverlaysForBatchId(c,l,a))).next((()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,l))).next((()=>u.localDocuments.getDocuments(c,l)))}))})(n.localStore,e);xi(n,e,t),ki(n,e),n.sharedClientState.updateMutationState(e,"rejected",t),await Tt(n,s)}catch(s){await We(s)}}function ki(r,e){(r.mu.get(e)||[]).forEach((t=>{t.resolve()})),r.mu.delete(e)}function xi(r,e,t){const n=I(r);let s=n.du[n.currentUser.toKey()];if(s){const i=s.get(e);i&&(t?i.reject(t):i.resolve(),s=s.remove(e)),n.du[n.currentUser.toKey()]=s}}function kn(r,e,t=null){r.sharedClientState.removeLocalQueryTarget(e);for(const n of r.Iu.get(e))r.Tu.delete(n),t&&r.Pu.yu(n,t);r.Iu.delete(e),r.isPrimaryClient&&r.Vu.Gr(e).forEach((n=>{r.Vu.containsKey(n)||Li(r,n)}))}function Li(r,e){r.Eu.delete(e.path.canonicalString());const t=r.Ru.get(e);t!==null&&(Jn(r.remoteStore,t),r.Ru=r.Ru.remove(e),r.Au.delete(t),ur(r))}function hs(r,e,t){for(const n of t)n instanceof Ci?(r.Vu.addReference(n.key,e),cc(r,n)):n instanceof bi?(g(ar,"Document no longer in limbo: "+n.key),r.Vu.removeReference(n.key,e),r.Vu.containsKey(n.key)||Li(r,n.key)):E(19791,{wu:n})}function cc(r,e){const t=e.key,n=t.path.canonicalString();r.Ru.get(t)||r.Eu.has(n)||(g(ar,"New document in limbo: "+t),r.Eu.add(n),ur(r))}function ur(r){for(;r.Eu.size>0&&r.Ru.size{o.push(n.pu(u,e,t).then((c=>{if((c||t)&&n.isPrimaryClient){const l=c?!c.fromCache:t?.targetChanges.get(u.targetId)?.current;n.sharedClientState.updateQueryState(u.targetId,l?"current":"not-current")}if(c){s.push(c);const l=Hn.Es(u.targetId,c);i.push(l)}})))})),await Promise.all(o),n.Pu.J_(s),await(async function(u,c){const l=I(u);try{await l.persistence.runTransaction("notifyLocalViewChanges","readwrite",(h=>m.forEach(c,(f=>m.forEach(f.Ts,(_=>l.persistence.referenceDelegate.addReference(h,f.targetId,_))).next((()=>m.forEach(f.Is,(_=>l.persistence.referenceDelegate.removeReference(h,f.targetId,_)))))))))}catch(h){if(!He(h))throw h;g(Yn,"Failed to update sequence numbers: "+h)}for(const h of c){const f=h.targetId;if(!h.fromCache){const _=l.vs.get(f),A=_.snapshotVersion,v=_.withLastLimboFreeSnapshotVersion(A);l.vs=l.vs.insert(f,v)}}})(n.localStore,i))}async function lc(r,e){const t=I(r);if(!t.currentUser.isEqual(e)){g(ar,"User change. New user:",e.toKey());const n=await Ei(t.localStore,e);t.currentUser=e,(function(i,o){i.mu.forEach((a=>{a.forEach((u=>{u.reject(new p(d.CANCELLED,o))}))})),i.mu.clear()})(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,n.removedBatchIds,n.addedBatchIds),await Tt(t,n.Ns)}}function hc(r,e){const t=I(r),n=t.Au.get(e);if(n&&n.hu)return V().add(n.key);{let s=V();const i=t.Iu.get(e);if(!i)return s;for(const o of i){const a=t.Tu.get(o);s=s.unionWith(a.view.nu)}return s}}function Oi(r){const e=I(r);return e.remoteStore.remoteSyncer.applyRemoteEvent=Di.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=hc.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=oc.bind(null,e),e.Pu.J_=Wu.bind(null,e.eventManager),e.Pu.yu=Hu.bind(null,e.eventManager),e}function dc(r){const e=I(r);return e.remoteStore.remoteSyncer.applySuccessfulWrite=ac.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=uc.bind(null,e),e}class Gt{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=sn(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,t){return null}Mu(e,t){return null}vu(e){return _u(this.persistence,new du,e.initialUser,this.serializer)}Cu(e){return new yi(Wn.Vi,this.serializer)}Du(e){return new Au}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Gt.provider={build:()=>new Gt};class fc extends Gt{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,t){S(this.persistence.referenceDelegate instanceof zt,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new Ja(n,e.asyncQueue,t)}Cu(e){const t=this.cacheSizeBytes!==void 0?H.withCacheSize(this.cacheSizeBytes):H.DEFAULT;return new yi((n=>zt.Vi(n,t)),this.serializer)}}class xn{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=n=>ls(this.syncEngine,n,1),this.remoteStore.remoteSyncer.handleCredentialChange=lc.bind(null,this.syncEngine),await Qu(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new Ku})()}createDatastore(e){const t=sn(e.databaseInfo.databaseId),n=Pu(e.databaseInfo);return Du(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return(function(n,s,i,o,a){return new xu(n,s,i,o,a)})(this.localStore,this.datastore,e.asyncQueue,(t=>ls(this.syncEngine,t,0)),(function(){return ss.v()?new ss:new wu})())}createSyncEngine(e,t){return(function(s,i,o,a,u,c,l){const h=new Zu(s,i,o,a,u,c);return l&&(h.gu=!0),h})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){await(async function(t){const n=I(t);g(Ne,"RemoteStore shutting down."),n.Ea.add(5),await Et(n),n.Aa.shutdown(),n.Va.set("Unknown")})(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}xn.provider={build:()=>new xn};/** * @license * Copyright 2020 Google LLC * @@ -1435,7 +1435,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ie="FirestoreClient";class mc{constructor(e,t,n,s,i){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this._databaseInfo=s,this.user=Q.UNAUTHENTICATED,this.clientId=Ln.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(n,(async o=>{g(Ie,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o})),this.appCheckCredentials.start(n,(o=>(g(Ie,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user))))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new le;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=nr(t,"Failed to shutdown persistence");e.reject(n)}})),e.promise}}async function yn(r,e){r.asyncQueue.verifyOperationInProgress(),g(Ie,"Initializing OfflineComponentProvider");const t=r.configuration;await e.initialize(t);let n=t.initialUser;r.setCredentialChangeListener((async s=>{n.isEqual(s)||(await Ei(e.localStore,s),n=s)})),e.persistence.setDatabaseDeletedListener((()=>r.terminate())),r._offlineComponents=e}async function ds(r,e){r.asyncQueue.verifyOperationInProgress();const t=await _c(r);g(Ie,"Initializing OnlineComponentProvider"),await e.initialize(t,r.configuration),r.setCredentialChangeListener((n=>os(e.remoteStore,n))),r.setAppCheckTokenChangeListener(((n,s)=>os(e.remoteStore,s))),r._onlineComponents=e}async function _c(r){if(!r._offlineComponents)if(r._uninitializedComponentsProvider){g(Ie,"Using user provided OfflineComponentProvider");try{await yn(r,r._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!(function(s){return s.name==="FirebaseError"?s.code===d.FAILED_PRECONDITION||s.code===d.UNIMPLEMENTED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11})(t))throw t;be("Error using user provided cache. Falling back to memory cache: "+t),await yn(r,new Qt)}}else g(Ie,"Using default OfflineComponentProvider"),await yn(r,new fc(void 0));return r._offlineComponents}async function Oi(r){return r._onlineComponents||(r._uninitializedComponentsProvider?(g(Ie,"Using user provided OnlineComponentProvider"),await ds(r,r._uninitializedComponentsProvider._online)):(g(Ie,"Using default OnlineComponentProvider"),await ds(r,new xn))),r._onlineComponents}function pc(r){return Oi(r).then((e=>e.syncEngine))}async function jt(r){const e=await Oi(r),t=e.eventManager;return t.onListen=ec.bind(null,e.syncEngine),t.onUnlisten=rc.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=tc.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=sc.bind(null,e.syncEngine),t}function gc(r,e,t,n){const s=new cr(n),i=new or(e,s,t);return r.asyncQueue.enqueueAndForget((async()=>rr(await jt(r),i))),()=>{s.Nu(),r.asyncQueue.enqueueAndForget((async()=>sr(await jt(r),i)))}}function yc(r,e,t={}){const n=new le;return r.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,u,c){const l=new cr({next:f=>{l.Nu(),o.enqueueAndForget((()=>sr(i,h)));const _=f.docs.has(a);!_&&f.fromCache?c.reject(new p(d.UNAVAILABLE,"Failed to get document because the client is offline.")):_&&f.fromCache&&u&&u.source==="server"?c.reject(new p(d.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(f)},error:f=>c.reject(f)}),h=new or(Xt(a.path),l,{includeMetadataChanges:!0,Ka:!0});return rr(i,h)})(await jt(r),r.asyncQueue,e,t,n))),n.promise}function Ec(r,e,t={}){const n=new le;return r.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,u,c){const l=new cr({next:f=>{l.Nu(),o.enqueueAndForget((()=>sr(i,h))),f.fromCache&&u.source==="server"?c.reject(new p(d.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(f)},error:f=>c.reject(f)}),h=new or(a,l,{includeMetadataChanges:!0,Ka:!0});return rr(i,h)})(await jt(r),r.asyncQueue,e,t,n))),n.promise}function Tc(r,e){const t=new le;return r.asyncQueue.enqueueAndForget((async()=>ic(await pc(r),e,t))),t.promise}/** + */const Ie="FirestoreClient";class mc{constructor(e,t,n,s,i){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this._databaseInfo=s,this.user=Q.UNAUTHENTICATED,this.clientId=On.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(n,(async o=>{g(Ie,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o})),this.appCheckCredentials.start(n,(o=>(g(Ie,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user))))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new le;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=nr(t,"Failed to shutdown persistence");e.reject(n)}})),e.promise}}async function yn(r,e){r.asyncQueue.verifyOperationInProgress(),g(Ie,"Initializing OfflineComponentProvider");const t=r.configuration;await e.initialize(t);let n=t.initialUser;r.setCredentialChangeListener((async s=>{n.isEqual(s)||(await Ei(e.localStore,s),n=s)})),e.persistence.setDatabaseDeletedListener((()=>r.terminate())),r._offlineComponents=e}async function ds(r,e){r.asyncQueue.verifyOperationInProgress();const t=await _c(r);g(Ie,"Initializing OnlineComponentProvider"),await e.initialize(t,r.configuration),r.setCredentialChangeListener((n=>os(e.remoteStore,n))),r.setAppCheckTokenChangeListener(((n,s)=>os(e.remoteStore,s))),r._onlineComponents=e}async function _c(r){if(!r._offlineComponents)if(r._uninitializedComponentsProvider){g(Ie,"Using user provided OfflineComponentProvider");try{await yn(r,r._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!(function(s){return s.name==="FirebaseError"?s.code===d.FAILED_PRECONDITION||s.code===d.UNIMPLEMENTED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11})(t))throw t;be("Error using user provided cache. Falling back to memory cache: "+t),await yn(r,new Gt)}}else g(Ie,"Using default OfflineComponentProvider"),await yn(r,new fc(void 0));return r._offlineComponents}async function Fi(r){return r._onlineComponents||(r._uninitializedComponentsProvider?(g(Ie,"Using user provided OnlineComponentProvider"),await ds(r,r._uninitializedComponentsProvider._online)):(g(Ie,"Using default OnlineComponentProvider"),await ds(r,new xn))),r._onlineComponents}function pc(r){return Fi(r).then((e=>e.syncEngine))}async function Qt(r){const e=await Fi(r),t=e.eventManager;return t.onListen=ec.bind(null,e.syncEngine),t.onUnlisten=rc.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=tc.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=sc.bind(null,e.syncEngine),t}function gc(r,e,t,n){const s=new cr(n),i=new or(e,s,t);return r.asyncQueue.enqueueAndForget((async()=>rr(await Qt(r),i))),()=>{s.Nu(),r.asyncQueue.enqueueAndForget((async()=>sr(await Qt(r),i)))}}function yc(r,e,t={}){const n=new le;return r.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,u,c){const l=new cr({next:f=>{l.Nu(),o.enqueueAndForget((()=>sr(i,h)));const _=f.docs.has(a);!_&&f.fromCache?c.reject(new p(d.UNAVAILABLE,"Failed to get document because the client is offline.")):_&&f.fromCache&&u&&u.source==="server"?c.reject(new p(d.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(f)},error:f=>c.reject(f)}),h=new or(Jt(a.path),l,{includeMetadataChanges:!0,Ka:!0});return rr(i,h)})(await Qt(r),r.asyncQueue,e,t,n))),n.promise}function Ec(r,e,t={}){const n=new le;return r.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,u,c){const l=new cr({next:f=>{l.Nu(),o.enqueueAndForget((()=>sr(i,h))),f.fromCache&&u.source==="server"?c.reject(new p(d.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(f)},error:f=>c.reject(f)}),h=new or(a,l,{includeMetadataChanges:!0,Ka:!0});return rr(i,h)})(await Qt(r),r.asyncQueue,e,t,n))),n.promise}function Tc(r,e){const t=new le;return r.asyncQueue.enqueueAndForget((async()=>ic(await pc(r),e,t))),t.promise}/** * @license * Copyright 2023 Google LLC * @@ -1480,7 +1480,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ui="firestore.googleapis.com",ms=!0;class _s{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new p(d.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=Ui,this.ssl=ms}else this.host=e.host,this.ssl=e.ssl??ms;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=gi;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new p(d.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(n,s){return n.timeoutSeconds===s.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class cn{constructor(e,t,n,s){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new _s({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new p(d.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new p(d.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new _s(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(n){if(!n)return new To;switch(n.type){case"firstParty":return new vo(n.sessionIndex||"0",n.iamToken||null,n.authTokenFactory||null);case"provider":return n.client;default:throw new p(d.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(t){const n=fs.get(t);n&&(g(Ic,"Removing Datastore"),fs.delete(t),n.terminate())})(this),Promise.resolve()}}function wc(r,e,t,n={}){r=K(r,cn);const s=vs(e),i=r._getSettings(),o={...i,emulatorOptions:r._getEmulatorOptions()},a=`${e}:${t}`;s&&(so(`https://${a}`),io("Firestore",!0)),i.host!==Ui&&i.host!==a&&be("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u={...i,host:a,ssl:s,emulatorOptions:n};if(!Rs(u,o)&&(r._setSettings(u),n.mockUserToken)){let c,l;if(typeof n.mockUserToken=="string")c=n.mockUserToken,l=Q.MOCK_USER;else{c=oo(n.mockUserToken,r._app?.options.projectId);const h=n.mockUserToken.sub||n.mockUserToken.user_id;if(!h)throw new p(d.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new Q(h)}r._authCredentials=new Io(new Ps(c,l))}}/** + */const Ui="firestore.googleapis.com",ms=!0;class _s{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new p(d.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=Ui,this.ssl=ms}else this.host=e.host,this.ssl=e.ssl??ms;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=gi;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new p(d.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(n,s){return n.timeoutSeconds===s.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class un{constructor(e,t,n,s){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new _s({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new p(d.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new p(d.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new _s(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(n){if(!n)return new To;switch(n.type){case"firstParty":return new vo(n.sessionIndex||"0",n.iamToken||null,n.authTokenFactory||null);case"provider":return n.client;default:throw new p(d.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(t){const n=fs.get(t);n&&(g(Ic,"Removing Datastore"),fs.delete(t),n.terminate())})(this),Promise.resolve()}}function wc(r,e,t,n={}){r=K(r,un);const s=vs(e),i=r._getSettings(),o={...i,emulatorOptions:r._getEmulatorOptions()},a=`${e}:${t}`;s&&(so(`https://${a}`),io("Firestore",!0)),i.host!==Ui&&i.host!==a&&be("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u={...i,host:a,ssl:s,emulatorOptions:n};if(!Rs(u,o)&&(r._setSettings(u),n.mockUserToken)){let c,l;if(typeof n.mockUserToken=="string")c=n.mockUserToken,l=Q.MOCK_USER;else{c=oo(n.mockUserToken,r._app?.options.projectId);const h=n.mockUserToken.sub||n.mockUserToken.user_id;if(!h)throw new p(d.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new Q(h)}r._authCredentials=new Io(new Ps(c,l))}}/** * @license * Copyright 2020 Google LLC * @@ -1495,7 +1495,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class fe{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new fe(this.firestore,e,this._query)}}class D{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new _e(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new D(this.firestore,e,this._key)}toJSON(){return{type:D._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,n){if(pt(t,D._jsonSchema))return new D(e,n||null,new y(C.fromString(t.referencePath)))}}D._jsonSchemaVersion="firestore/documentReference/1.0",D._jsonSchema={type:O("string",D._jsonSchemaVersion),referencePath:O("string")};class _e extends fe{constructor(e,t,n){super(e,t,Xt(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new D(this.firestore,null,new y(e))}withConverter(e){return new _e(this.firestore,e,this._path)}}function Mc(r,e,...t){if(r=ee(r),Ss("collection","path",e),r instanceof cn){const n=C.fromString(e,...t);return Sr(n),new _e(r,null,n)}{if(!(r instanceof D||r instanceof _e))throw new p(d.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=r._path.child(C.fromString(e,...t));return Sr(n),new _e(r.firestore,null,n)}}function vc(r,e,...t){if(r=ee(r),arguments.length===1&&(e=Ln.newId()),Ss("doc","path",e),r instanceof cn){const n=C.fromString(e,...t);return Pr(n),new D(r,null,new y(n))}{if(!(r instanceof D||r instanceof _e))throw new p(d.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=r._path.child(C.fromString(e,...t));return Pr(n),new D(r.firestore,r instanceof _e?r.converter:null,new y(n))}}/** + */class fe{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new fe(this.firestore,e,this._query)}}class D{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new _e(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new D(this.firestore,e,this._key)}toJSON(){return{type:D._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,n){if(pt(t,D._jsonSchema))return new D(e,n||null,new y(C.fromString(t.referencePath)))}}D._jsonSchemaVersion="firestore/documentReference/1.0",D._jsonSchema={type:F("string",D._jsonSchemaVersion),referencePath:F("string")};class _e extends fe{constructor(e,t,n){super(e,t,Jt(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new D(this.firestore,null,new y(e))}withConverter(e){return new _e(this.firestore,e,this._path)}}function Mc(r,e,...t){if(r=ee(r),Ss("collection","path",e),r instanceof un){const n=C.fromString(e,...t);return Sr(n),new _e(r,null,n)}{if(!(r instanceof D||r instanceof _e))throw new p(d.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=r._path.child(C.fromString(e,...t));return Sr(n),new _e(r.firestore,null,n)}}function vc(r,e,...t){if(r=ee(r),arguments.length===1&&(e=On.newId()),Ss("doc","path",e),r instanceof un){const n=C.fromString(e,...t);return Pr(n),new D(r,null,new y(n))}{if(!(r instanceof D||r instanceof _e))throw new p(d.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=r._path.child(C.fromString(e,...t));return Pr(n),new D(r.firestore,r instanceof _e?r.converter:null,new y(n))}}/** * @license * Copyright 2020 Google LLC * @@ -1511,7 +1511,7 @@ This typically indicates that your device does not have a healthy Internet conne * See the License for the specific language governing permissions and * limitations under the License. */const ps="AsyncQueue";class gs{constructor(e=Promise.resolve()){this.Yu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new Ii(this,"async_queue_retry"),this._c=()=>{const n=gn();n&&g(ps,"Visibility state changed to "+n.visibilityState),this.M_.w_()},this.ac=e;const t=gn();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const t=gn();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise((()=>{}));const t=new le;return this.cc((()=>this.ec&&this.sc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise))).then((()=>t.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.Yu.push(e),this.lc())))}async lc(){if(this.Yu.length!==0){try{await this.Yu[0](),this.Yu.shift(),this.M_.reset()}catch(e){if(!He(e))throw e;g(ps,"Operation failed with retryable error: "+e)}this.Yu.length>0&&this.M_.p_((()=>this.lc()))}}cc(e){const t=this.ac.then((()=>(this.rc=!0,e().catch((n=>{throw this.nc=n,this.rc=!1,he("INTERNAL UNHANDLED ERROR: ",ys(n)),n})).then((n=>(this.rc=!1,n))))));return this.ac=t,t}enqueueAfterDelay(e,t,n){this.uc(),this.oc.indexOf(e)>-1&&(t=0);const s=tr.createAndSchedule(this,e,t,n,(i=>this.hc(i)));return this.tc.push(s),s}uc(){this.nc&&E(47125,{Pc:ys(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const t of this.tc)if(t.timerId===e)return!0;return!1}Ec(e){return this.Tc().then((()=>{this.tc.sort(((t,n)=>t.targetTimeMs-n.targetTimeMs));for(const t of this.tc)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.Tc()}))}Rc(e){this.oc.push(e)}hc(e){const t=this.tc.indexOf(e);this.tc.splice(t,1)}}function ys(r){let e=r.message||"";return r.stack&&(e=r.stack.includes(r.message)?r.stack:r.message+` -`+r.stack),e}class ue extends cn{constructor(e,t,n,s){super(e,t,n,s),this.type="firestore",this._queue=new gs,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new gs(e),this._firestoreClient=void 0,await e}}}function Uc(r,e){const t=typeof r=="object"?r:to(),n=typeof r=="string"?r:Mt,s=no(t,"firestore").getImmediate({identifier:n});if(!s._initialized){const i=ro("firestore");i&&wc(s,...i)}return s}function It(r){if(r._terminated)throw new p(d.FAILED_PRECONDITION,"The client has already been terminated.");return r._firestoreClient||Rc(r),r._firestoreClient}function Rc(r){const e=r._freezeSettings(),t=Ac(r._databaseId,r._app?.options.appId||"",r._persistenceKey,r._app?.options.apiKey,e);r._componentsProvider||e.localCache?._offlineComponentProvider&&e.localCache?._onlineComponentProvider&&(r._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),r._firestoreClient=new mc(r._authCredentials,r._appCheckCredentials,r._queue,t,r._componentsProvider&&(function(s){const i=s?._online.build();return{_offline:s?._offline.build(i),_online:i}})(r._componentsProvider))}/** +`+r.stack),e}class ue extends un{constructor(e,t,n,s){super(e,t,n,s),this.type="firestore",this._queue=new gs,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new gs(e),this._firestoreClient=void 0,await e}}}function Uc(r,e){const t=typeof r=="object"?r:to(),n=typeof r=="string"?r:Ft,s=no(t,"firestore").getImmediate({identifier:n});if(!s._initialized){const i=ro("firestore");i&&wc(s,...i)}return s}function It(r){if(r._terminated)throw new p(d.FAILED_PRECONDITION,"The client has already been terminated.");return r._firestoreClient||Rc(r),r._firestoreClient}function Rc(r){const e=r._freezeSettings(),t=Ac(r._databaseId,r._app?.options.appId||"",r._persistenceKey,r._app?.options.apiKey,e);r._componentsProvider||e.localCache?._offlineComponentProvider&&e.localCache?._onlineComponentProvider&&(r._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),r._firestoreClient=new mc(r._authCredentials,r._appCheckCredentials,r._queue,t,r._componentsProvider&&(function(s){const i=s?._online.build();return{_offline:s?._offline.build(i),_online:i}})(r._componentsProvider))}/** * @license * Copyright 2020 Google LLC * @@ -1526,7 +1526,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Z{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Z($.fromBase64String(e))}catch(t){throw new p(d.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new Z($.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Z._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(pt(e,Z._jsonSchema))return Z.fromBase64String(e.bytes)}}Z._jsonSchemaVersion="firestore/bytes/1.0",Z._jsonSchema={type:O("string",Z._jsonSchemaVersion),bytes:O("string")};/** + */class Z{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Z($.fromBase64String(e))}catch(t){throw new p(d.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new Z($.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Z._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(pt(e,Z._jsonSchema))return Z.fromBase64String(e.bytes)}}Z._jsonSchemaVersion="firestore/bytes/1.0",Z._jsonSchema={type:F("string",Z._jsonSchemaVersion),bytes:F("string")};/** * @license * Copyright 2020 Google LLC * @@ -1541,7 +1541,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class ln{constructor(...e){for(let t=0;t90)throw new p(d.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new p(d.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return R(this._lat,e._lat)||R(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:oe._jsonSchemaVersion}}static fromJSON(e){if(pt(e,oe._jsonSchema))return new oe(e.latitude,e.longitude)}}oe._jsonSchemaVersion="firestore/geoPoint/1.0",oe._jsonSchema={type:O("string",oe._jsonSchemaVersion),latitude:O("number"),longitude:O("number")};/** + */class oe{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new p(d.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new p(d.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return R(this._lat,e._lat)||R(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:oe._jsonSchemaVersion}}static fromJSON(e){if(pt(e,oe._jsonSchema))return new oe(e.latitude,e.longitude)}}oe._jsonSchemaVersion="firestore/geoPoint/1.0",oe._jsonSchema={type:F("string",oe._jsonSchemaVersion),latitude:F("number"),longitude:F("number")};/** * @license * Copyright 2024 Google LLC * @@ -1586,7 +1586,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class te{constructor(e){this._values=(e||[]).map((t=>t))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(n,s){if(n.length!==s.length)return!1;for(let i=0;itypeof t=="number")))return new te(e.vectorValues);throw new p(d.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}te._jsonSchemaVersion="firestore/vectorValue/1.0",te._jsonSchema={type:O("string",te._jsonSchemaVersion),vectorValues:O("object")};/** + */class te{constructor(e){this._values=(e||[]).map((t=>t))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(n,s){if(n.length!==s.length)return!1;for(let i=0;itypeof t=="number")))return new te(e.vectorValues);throw new p(d.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}te._jsonSchemaVersion="firestore/vectorValue/1.0",te._jsonSchema={type:F("string",te._jsonSchemaVersion),vectorValues:F("object")};/** * @license * Copyright 2017 Google LLC * @@ -1601,7 +1601,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Vc=/^__.*__$/;class Pc{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return this.fieldMask!==null?new we(e,this.data,this.fieldMask,t,this.fieldTransforms):new gt(e,this.data,t,this.fieldTransforms)}}class qi{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new we(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function Bi(r){switch(r){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw E(40011,{dataSource:r})}}class hn{constructor(e,t,n,s,i,o){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=s,i===void 0&&this.validatePath(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}contextWith(e){return new hn({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}childContextForField(e){const t=this.path?.child(e),n=this.contextWith({path:t,arrayElement:!1});return n.validatePathSegment(e),n}childContextForFieldPath(e){const t=this.path?.child(e),n=this.contextWith({path:t,arrayElement:!1});return n.validatePath(),n}childContextForArray(e){return this.contextWith({path:void 0,arrayElement:!0})}createError(e){return Kt(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return this.fieldMask.find((t=>e.isPrefixOf(t)))!==void 0||this.fieldTransforms.find((t=>e.isPrefixOf(t.field)))!==void 0}validatePath(){if(this.path)for(let e=0;eu.covers(h.field)))}else u=null,c=o.fieldTransforms;return new Pc(new Y(a),u,c)}class wt extends Xe{_toFieldTransform(e){if(e.dataSource!==2)throw e.dataSource===1?e.createError(`${this._methodName}() can only appear at the top level of your update data`):e.createError(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof wt}}function Cc(r,e,t){return new hn({dataSource:3,targetDoc:e.settings.targetDoc,methodName:r._methodName,arrayElement:t},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class hr extends Xe{_toFieldTransform(e){return new $n(e.path,new ft)}isEqual(e){return e instanceof hr}}class dr extends Xe{constructor(e,t){super(e),this.Ac=t}_toFieldTransform(e){const t=Cc(this,e,!0),n=this.Ac.map((i=>Ze(i,t))),s=new Ge(n);return new $n(e.path,s)}isEqual(e){return e instanceof dr&&Rs(this.Ac,e.Ac)}}class fr extends Xe{constructor(e,t){super(e),this.Vc=t}_toFieldTransform(e){const t=new _t(e.serializer,Zs(e.serializer,this.Vc));return new $n(e.path,t)}isEqual(e){return e instanceof fr&&this.Vc===e.Vc}}function zi(r,e,t,n){const s=r.createContext(1,e,t);mr("Data must be an object, but it was:",s,n);const i=[],o=Y.empty();Ae(n,((u,c)=>{const l=ji(e,u,t);c=ee(c);const h=s.childContextForFieldPath(l);if(c instanceof wt)i.push(l);else{const f=Ze(c,h);f!=null&&(i.push(l),o.set(l,f))}}));const a=new X(i);return new qi(o,a,s.fieldTransforms)}function $i(r,e,t,n,s,i){const o=r.createContext(1,e,t),a=[De(e,n,t)],u=[s];if(i.length%2!=0)throw new p(d.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f=0;--f)if(!Ki(c,a[f])){const _=a[f];let A=u[f];A=ee(A);const v=o.childContextForFieldPath(_);if(A instanceof wt)c.push(_);else{const w=Ze(A,v);w!=null&&(c.push(_),l.set(_,w))}}const h=new X(c);return new qi(l,h,o.fieldTransforms)}function bc(r,e,t,n=!1){return Ze(t,r.createContext(n?4:3,e))}function Ze(r,e){if(Qi(r=ee(r)))return mr("Unsupported field value:",e,r),Gi(r,e);if(r instanceof Xe)return(function(n,s){if(!Bi(s.dataSource))throw s.createError(`${n._methodName}() can only be used with update() and set()`);if(!s.path)throw s.createError(`${n._methodName}() is not currently supported inside arrays`);const i=n._toFieldTransform(s);i&&s.fieldTransforms.push(i)})(r,e),null;if(r===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),r instanceof Array){if(e.settings.arrayElement&&e.dataSource!==4)throw e.createError("Nested arrays are not supported");return(function(n,s){const i=[];let o=0;for(const a of n){let u=Ze(a,s.childContextForArray(o));u==null&&(u={nullValue:"NULL_VALUE"}),i.push(u),o++}return{arrayValue:{values:i}}})(r,e)}return(function(n,s){if((n=ee(n))===null)return{nullValue:"NULL_VALUE"};if(typeof n=="number")return Zs(s.serializer,n);if(typeof n=="boolean")return{booleanValue:n};if(typeof n=="string")return{stringValue:n};if(n instanceof Date){const i=b.fromDate(n);return{timestampValue:zt(s.serializer,i)}}if(n instanceof b){const i=new b(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:zt(s.serializer,i)}}if(n instanceof oe)return{geoPointValue:{latitude:n.latitude,longitude:n.longitude}};if(n instanceof Z)return{bytesValue:ci(s.serializer,n._byteString)};if(n instanceof D){const i=s.databaseId,o=n.firestore._databaseId;if(!o.isEqual(i))throw s.createError(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:jn(n.firestore._databaseId||s.databaseId,n._key.path)}}if(n instanceof te)return(function(o,a){const u=o instanceof te?o.toArray():o;return{mapValue:{fields:{[Os]:{stringValue:Ms},[Ut]:{arrayValue:{values:u.map((l=>{if(typeof l!="number")throw a.createError("VectorValues must only contain numeric values.");return zn(a.serializer,l)}))}}}}}})(n,s);if(pi(n))return n._toProto(s.serializer);throw s.createError(`Unsupported field value: ${Wt(n)}`)})(r,e)}function Gi(r,e){const t={};return Ns(r)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ae(r,((n,s)=>{const i=Ze(s,e.childContextForField(n));i!=null&&(t[n]=i)})),{mapValue:{fields:t}}}function Qi(r){return!(typeof r!="object"||r===null||r instanceof Array||r instanceof Date||r instanceof b||r instanceof oe||r instanceof Z||r instanceof D||r instanceof Xe||r instanceof te||pi(r))}function mr(r,e,t){if(!Qi(t)||!Cs(t)){const n=Wt(t);throw n==="an object"?e.createError(r+" a custom object"):e.createError(r+" "+n)}}function De(r,e,t){if((e=ee(e))instanceof ln)return e._internalPath;if(typeof e=="string")return ji(r,e);throw Kt("Field path arguments must be of type string or ",r,!1,void 0,t)}const Nc=new RegExp("[~\\*/\\[\\]]");function ji(r,e,t){if(e.search(Nc)>=0)throw Kt(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,r,!1,void 0,t);try{return new ln(...e.split("."))._internalPath}catch{throw Kt(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,r,!1,void 0,t)}}function Kt(r,e,t,n,s){const i=n&&!n.isEmpty(),o=s!==void 0;let a=`Function ${e}() called with invalid data`;t&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(i||o)&&(u+=" (found",i&&(u+=` in field ${n}`),o&&(u+=` in document ${s}`),u+=")"),new p(d.INVALID_ARGUMENT,a+r+u)}function Ki(r,e){return r.some((t=>t.isEqual(e)))}/** + */const Vc=/^__.*__$/;class Pc{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return this.fieldMask!==null?new we(e,this.data,this.fieldMask,t,this.fieldTransforms):new gt(e,this.data,t,this.fieldTransforms)}}class qi{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new we(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function Bi(r){switch(r){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw E(40011,{dataSource:r})}}class ln{constructor(e,t,n,s,i,o){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=s,i===void 0&&this.validatePath(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}contextWith(e){return new ln({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}childContextForField(e){const t=this.path?.child(e),n=this.contextWith({path:t,arrayElement:!1});return n.validatePathSegment(e),n}childContextForFieldPath(e){const t=this.path?.child(e),n=this.contextWith({path:t,arrayElement:!1});return n.validatePath(),n}childContextForArray(e){return this.contextWith({path:void 0,arrayElement:!0})}createError(e){return jt(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return this.fieldMask.find((t=>e.isPrefixOf(t)))!==void 0||this.fieldTransforms.find((t=>e.isPrefixOf(t.field)))!==void 0}validatePath(){if(this.path)for(let e=0;eu.covers(h.field)))}else u=null,c=o.fieldTransforms;return new Pc(new Y(a),u,c)}class hn extends Xe{_toFieldTransform(e){if(e.dataSource!==2)throw e.dataSource===1?e.createError(`${this._methodName}() can only appear at the top level of your update data`):e.createError(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof hn}}function Cc(r,e,t){return new ln({dataSource:3,targetDoc:e.settings.targetDoc,methodName:r._methodName,arrayElement:t},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class hr extends Xe{_toFieldTransform(e){return new $n(e.path,new ft)}isEqual(e){return e instanceof hr}}class dr extends Xe{constructor(e,t){super(e),this.Ac=t}_toFieldTransform(e){const t=Cc(this,e,!0),n=this.Ac.map((i=>Ze(i,t))),s=new Ge(n);return new $n(e.path,s)}isEqual(e){return e instanceof dr&&Rs(this.Ac,e.Ac)}}class fr extends Xe{constructor(e,t){super(e),this.Vc=t}_toFieldTransform(e){const t=new _t(e.serializer,Zs(e.serializer,this.Vc));return new $n(e.path,t)}isEqual(e){return e instanceof fr&&this.Vc===e.Vc}}function zi(r,e,t,n){const s=r.createContext(1,e,t);mr("Data must be an object, but it was:",s,n);const i=[],o=Y.empty();Ae(n,((u,c)=>{const l=ji(e,u,t);c=ee(c);const h=s.childContextForFieldPath(l);if(c instanceof hn)i.push(l);else{const f=Ze(c,h);f!=null&&(i.push(l),o.set(l,f))}}));const a=new X(i);return new qi(o,a,s.fieldTransforms)}function $i(r,e,t,n,s,i){const o=r.createContext(1,e,t),a=[De(e,n,t)],u=[s];if(i.length%2!=0)throw new p(d.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f=0;--f)if(!Ki(c,a[f])){const _=a[f];let A=u[f];A=ee(A);const v=o.childContextForFieldPath(_);if(A instanceof hn)c.push(_);else{const w=Ze(A,v);w!=null&&(c.push(_),l.set(_,w))}}const h=new X(c);return new qi(l,h,o.fieldTransforms)}function bc(r,e,t,n=!1){return Ze(t,r.createContext(n?4:3,e))}function Ze(r,e){if(Qi(r=ee(r)))return mr("Unsupported field value:",e,r),Gi(r,e);if(r instanceof Xe)return(function(n,s){if(!Bi(s.dataSource))throw s.createError(`${n._methodName}() can only be used with update() and set()`);if(!s.path)throw s.createError(`${n._methodName}() is not currently supported inside arrays`);const i=n._toFieldTransform(s);i&&s.fieldTransforms.push(i)})(r,e),null;if(r===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),r instanceof Array){if(e.settings.arrayElement&&e.dataSource!==4)throw e.createError("Nested arrays are not supported");return(function(n,s){const i=[];let o=0;for(const a of n){let u=Ze(a,s.childContextForArray(o));u==null&&(u={nullValue:"NULL_VALUE"}),i.push(u),o++}return{arrayValue:{values:i}}})(r,e)}return(function(n,s){if((n=ee(n))===null)return{nullValue:"NULL_VALUE"};if(typeof n=="number")return Zs(s.serializer,n);if(typeof n=="boolean")return{booleanValue:n};if(typeof n=="string")return{stringValue:n};if(n instanceof Date){const i=b.fromDate(n);return{timestampValue:Bt(s.serializer,i)}}if(n instanceof b){const i=new b(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:Bt(s.serializer,i)}}if(n instanceof oe)return{geoPointValue:{latitude:n.latitude,longitude:n.longitude}};if(n instanceof Z)return{bytesValue:ci(s.serializer,n._byteString)};if(n instanceof D){const i=s.databaseId,o=n.firestore._databaseId;if(!o.isEqual(i))throw s.createError(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:jn(n.firestore._databaseId||s.databaseId,n._key.path)}}if(n instanceof te)return(function(o,a){const u=o instanceof te?o.toArray():o;return{mapValue:{fields:{[Fs]:{stringValue:Ms},[Mt]:{arrayValue:{values:u.map((l=>{if(typeof l!="number")throw a.createError("VectorValues must only contain numeric values.");return zn(a.serializer,l)}))}}}}}})(n,s);if(pi(n))return n._toProto(s.serializer);throw s.createError(`Unsupported field value: ${Kt(n)}`)})(r,e)}function Gi(r,e){const t={};return Ns(r)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ae(r,((n,s)=>{const i=Ze(s,e.childContextForField(n));i!=null&&(t[n]=i)})),{mapValue:{fields:t}}}function Qi(r){return!(typeof r!="object"||r===null||r instanceof Array||r instanceof Date||r instanceof b||r instanceof oe||r instanceof Z||r instanceof D||r instanceof Xe||r instanceof te||pi(r))}function mr(r,e,t){if(!Qi(t)||!Cs(t)){const n=Kt(t);throw n==="an object"?e.createError(r+" a custom object"):e.createError(r+" "+n)}}function De(r,e,t){if((e=ee(e))instanceof cn)return e._internalPath;if(typeof e=="string")return ji(r,e);throw jt("Field path arguments must be of type string or ",r,!1,void 0,t)}const Nc=new RegExp("[~\\*/\\[\\]]");function ji(r,e,t){if(e.search(Nc)>=0)throw jt(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,r,!1,void 0,t);try{return new cn(...e.split("."))._internalPath}catch{throw jt(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,r,!1,void 0,t)}}function jt(r,e,t,n,s){const i=n&&!n.isEmpty(),o=s!==void 0;let a=`Function ${e}() called with invalid data`;t&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(i||o)&&(u+=" (found",i&&(u+=` in field ${n}`),o&&(u+=` in document ${s}`),u+=")"),new p(d.INVALID_ARGUMENT,a+r+u)}function Ki(r,e){return r.some((t=>t.isEqual(e)))}/** * @license * Copyright 2020 Google LLC * @@ -1616,7 +1616,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Dc{convertValue(e,t="none"){switch(Ee(e)){case 0:return null;case 1:return e.booleanValue;case 2:return k(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(ye(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw E(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const n={};return Ae(e,((s,i)=>{n[s]=this.convertValue(i,t)})),n}convertVectorValue(e){const t=e.fields?.[Ut].arrayValue?.values?.map((n=>k(n.doubleValue)));return new te(t)}convertGeoPoint(e){return new oe(k(e.latitude),k(e.longitude))}convertArray(e,t){return(e.values||[]).map((n=>this.convertValue(n,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const n=Jt(e);return n==null?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(ct(e));default:return null}}convertTimestamp(e){const t=ge(e);return new b(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=C.fromString(e);S(_i(n),9688,{name:e});const s=new lt(n.get(1),n.get(3)),i=new y(n.popFirst(5));return s.isEqual(t)||he(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}/** + */class Dc{convertValue(e,t="none"){switch(Ee(e)){case 0:return null;case 1:return e.booleanValue;case 2:return k(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(ye(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw E(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const n={};return Ae(e,((s,i)=>{n[s]=this.convertValue(i,t)})),n}convertVectorValue(e){const t=e.fields?.[Mt].arrayValue?.values?.map((n=>k(n.doubleValue)));return new te(t)}convertGeoPoint(e){return new oe(k(e.latitude),k(e.longitude))}convertArray(e,t){return(e.values||[]).map((n=>this.convertValue(n,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const n=Yt(e);return n==null?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(ct(e));default:return null}}convertTimestamp(e){const t=ge(e);return new b(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=C.fromString(e);S(_i(n),9688,{name:e});const s=new lt(n.get(1),n.get(3)),i=new y(n.popFirst(5));return s.isEqual(t)||he(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}/** * @license * Copyright 2024 Google LLC * @@ -1631,22 +1631,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class _r extends Dc{constructor(e){super(),this.firestore=e}convertBytes(e){return new Z(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new D(this.firestore,null,t)}}/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function qc(){return new wt("deleteField")}function Bc(){return new hr("serverTimestamp")}function zc(...r){return new dr("arrayUnion",r)}function $c(r){return new fr("increment",r)}const Es="@firebase/firestore",Ts="4.11.0";/** + */class _r extends Dc{constructor(e){super(),this.firestore=e}convertBytes(e){return new Z(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new D(this.firestore,null,t)}}function qc(){return new hr("serverTimestamp")}function Bc(...r){return new dr("arrayUnion",r)}function zc(r){return new fr("increment",r)}const Es="@firebase/firestore",Ts="4.11.0";/** * @license * Copyright 2017 Google LLC * @@ -1691,7 +1676,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Hi(r){if(r.limitType==="L"&&r.explicitOrderBy.length===0)throw new p(d.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class pr{}class gr extends pr{}function Gc(r,e,...t){let n=[];e instanceof pr&&n.push(e),n=n.concat(t),(function(i){const o=i.filter((u=>u instanceof yr)).length,a=i.filter((u=>u instanceof dn)).length;if(o>1||o>0&&a>0)throw new p(d.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(n);for(const s of n)r=s._apply(r);return r}class dn extends gr{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new dn(e,t,n)}_apply(e){const t=this._parse(e);return Yi(e._query,t),new fe(e.firestore,e.converter,Rn(e._query,t))}_parse(e){const t=At(e.firestore);return(function(i,o,a,u,c,l,h){let f;if(c.isKeyField()){if(l==="array-contains"||l==="array-contains-any")throw new p(d.INVALID_ARGUMENT,`Invalid Query. You can't perform '${l}' queries on documentId().`);if(l==="in"||l==="not-in"){ws(h,l);const A=[];for(const v of h)A.push(As(u,i,v));f={arrayValue:{values:A}}}else f=As(u,i,h)}else l!=="in"&&l!=="not-in"&&l!=="array-contains-any"||ws(h,l),f=bc(a,o,h,l==="in"||l==="not-in");return L.create(c,l,f)})(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function Qc(r,e,t){const n=e,s=De("where",r);return dn._create(s,n,t)}class yr extends pr{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new yr(e,t)}_parse(e){const t=this._queryConstraints.map((n=>n._parse(e))).filter((n=>n.getFilters().length>0));return t.length===1?t[0]:ne.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:((function(s,i){let o=s;const a=i.getFlattenedFilters();for(const u of a)Yi(o,u),o=Rn(o,u)})(e._query,t),new fe(e.firestore,e.converter,Rn(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class Er extends gr{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Er(e,t)}_apply(e){const t=(function(s,i,o){if(s.startAt!==null)throw new p(d.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(s.endAt!==null)throw new p(d.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new dt(i,o)})(e._query,this._field,this._direction);return new fe(e.firestore,e.converter,oa(e._query,t))}}function jc(r,e="asc"){const t=e,n=De("orderBy",r);return Er._create(n,t)}class Tr extends gr{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new Tr(e,t,n)}_apply(e){return new fe(e.firestore,e.converter,Bt(e._query,this._limit,this._limitType))}}function Kc(r){return No("limit",r),Tr._create("limit",r,"F")}function As(r,e,t){if(typeof(t=ee(t))=="string"){if(t==="")throw new p(d.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!js(e)&&t.indexOf("/")!==-1)throw new p(d.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const n=e.path.child(C.fromString(t));if(!y.isDocumentKey(n))throw new p(d.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);return Lr(r,new y(n))}if(t instanceof D)return Lr(r,t._key);throw new p(d.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Wt(t)}.`)}function ws(r,e){if(!Array.isArray(r)||r.length===0)throw new p(d.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function Yi(r,e){const t=(function(s,i){for(const o of s)for(const a of o.getFlattenedFilters())if(i.indexOf(a.op)>=0)return a.op;return null})(r.filters,(function(s){switch(s){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(t!==null)throw t===e.op?new p(d.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new p(d.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}function Ir(r,e,t){let n;return n=r?t&&(t.merge||t.mergeFields)?r.toFirestore(e,t):r.toFirestore(e):e,n}class rt{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Pe extends Wi{constructor(e,t,n,s,i,o){super(e,t,n,s,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Lt(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(De("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new p(d.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=Pe._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?t:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t)}}Pe._jsonSchemaVersion="firestore/documentSnapshot/1.0",Pe._jsonSchema={type:O("string",Pe._jsonSchemaVersion),bundleSource:O("string","DocumentSnapshot"),bundleName:O("string"),bundle:O("string")};class Lt extends Pe{data(e={}){return super.data(e)}}class Se{constructor(e,t,n,s){this._firestore=e,this._userDataWriter=t,this._snapshot=s,this.metadata=new rt(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const e=[];return this.forEach((t=>e.push(t))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach((n=>{e.call(t,new Lt(this._firestore,this._userDataWriter,n.key,n,new rt(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new p(d.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=(function(s,i){if(s._snapshot.oldDocs.isEmpty()){let o=0;return s._snapshot.docChanges.map((a=>{const u=new Lt(s._firestore,s._userDataWriter,a.doc.key,a.doc,new rt(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);return a.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}}))}{let o=s._snapshot.oldDocs;return s._snapshot.docChanges.filter((a=>i||a.type!==3)).map((a=>{const u=new Lt(s._firestore,s._userDataWriter,a.doc.key,a.doc,new rt(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);let c=-1,l=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),l=o.indexOf(a.doc.key)),{type:xc(a.type),doc:u,oldIndex:c,newIndex:l}}))}})(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new p(d.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=Se._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Ln.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],n=[],s=[];return this.docs.forEach((i=>{i._document!==null&&(t.push(i._document),n.push(this._userDataWriter.convertObjectMap(i._document.data.value.mapValue.fields,"previous")),s.push(i.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function xc(r){switch(r){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return E(61501,{type:r})}}/** + */function Hi(r){if(r.limitType==="L"&&r.explicitOrderBy.length===0)throw new p(d.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class pr{}class gr extends pr{}function $c(r,e,...t){let n=[];e instanceof pr&&n.push(e),n=n.concat(t),(function(i){const o=i.filter((u=>u instanceof yr)).length,a=i.filter((u=>u instanceof dn)).length;if(o>1||o>0&&a>0)throw new p(d.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(n);for(const s of n)r=s._apply(r);return r}class dn extends gr{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new dn(e,t,n)}_apply(e){const t=this._parse(e);return Yi(e._query,t),new fe(e.firestore,e.converter,Rn(e._query,t))}_parse(e){const t=At(e.firestore);return(function(i,o,a,u,c,l,h){let f;if(c.isKeyField()){if(l==="array-contains"||l==="array-contains-any")throw new p(d.INVALID_ARGUMENT,`Invalid Query. You can't perform '${l}' queries on documentId().`);if(l==="in"||l==="not-in"){ws(h,l);const A=[];for(const v of h)A.push(As(u,i,v));f={arrayValue:{values:A}}}else f=As(u,i,h)}else l!=="in"&&l!=="not-in"&&l!=="array-contains-any"||ws(h,l),f=bc(a,o,h,l==="in"||l==="not-in");return O.create(c,l,f)})(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function Gc(r,e,t){const n=e,s=De("where",r);return dn._create(s,n,t)}class yr extends pr{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new yr(e,t)}_parse(e){const t=this._queryConstraints.map((n=>n._parse(e))).filter((n=>n.getFilters().length>0));return t.length===1?t[0]:ne.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:((function(s,i){let o=s;const a=i.getFlattenedFilters();for(const u of a)Yi(o,u),o=Rn(o,u)})(e._query,t),new fe(e.firestore,e.converter,Rn(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class Er extends gr{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Er(e,t)}_apply(e){const t=(function(s,i,o){if(s.startAt!==null)throw new p(d.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(s.endAt!==null)throw new p(d.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new dt(i,o)})(e._query,this._field,this._direction);return new fe(e.firestore,e.converter,oa(e._query,t))}}function Qc(r,e="asc"){const t=e,n=De("orderBy",r);return Er._create(n,t)}class Tr extends gr{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new Tr(e,t,n)}_apply(e){return new fe(e.firestore,e.converter,qt(e._query,this._limit,this._limitType))}}function jc(r){return No("limit",r),Tr._create("limit",r,"F")}function As(r,e,t){if(typeof(t=ee(t))=="string"){if(t==="")throw new p(d.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!js(e)&&t.indexOf("/")!==-1)throw new p(d.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const n=e.path.child(C.fromString(t));if(!y.isDocumentKey(n))throw new p(d.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);return Or(r,new y(n))}if(t instanceof D)return Or(r,t._key);throw new p(d.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Kt(t)}.`)}function ws(r,e){if(!Array.isArray(r)||r.length===0)throw new p(d.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function Yi(r,e){const t=(function(s,i){for(const o of s)for(const a of o.getFlattenedFilters())if(i.indexOf(a.op)>=0)return a.op;return null})(r.filters,(function(s){switch(s){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(t!==null)throw t===e.op?new p(d.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new p(d.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}function Ir(r,e,t){let n;return n=r?t&&(t.merge||t.mergeFields)?r.toFirestore(e,t):r.toFirestore(e):e,n}class rt{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Pe extends Wi{constructor(e,t,n,s,i,o){super(e,t,n,s,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Lt(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(De("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new p(d.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=Pe._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?t:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t)}}Pe._jsonSchemaVersion="firestore/documentSnapshot/1.0",Pe._jsonSchema={type:F("string",Pe._jsonSchemaVersion),bundleSource:F("string","DocumentSnapshot"),bundleName:F("string"),bundle:F("string")};class Lt extends Pe{data(e={}){return super.data(e)}}class Se{constructor(e,t,n,s){this._firestore=e,this._userDataWriter=t,this._snapshot=s,this.metadata=new rt(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const e=[];return this.forEach((t=>e.push(t))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach((n=>{e.call(t,new Lt(this._firestore,this._userDataWriter,n.key,n,new rt(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new p(d.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=(function(s,i){if(s._snapshot.oldDocs.isEmpty()){let o=0;return s._snapshot.docChanges.map((a=>{const u=new Lt(s._firestore,s._userDataWriter,a.doc.key,a.doc,new rt(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);return a.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}}))}{let o=s._snapshot.oldDocs;return s._snapshot.docChanges.filter((a=>i||a.type!==3)).map((a=>{const u=new Lt(s._firestore,s._userDataWriter,a.doc.key,a.doc,new rt(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);let c=-1,l=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),l=o.indexOf(a.doc.key)),{type:xc(a.type),doc:u,oldIndex:c,newIndex:l}}))}})(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new p(d.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=Se._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=On.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],n=[],s=[];return this.docs.forEach((i=>{i._document!==null&&(t.push(i._document),n.push(this._userDataWriter.convertObjectMap(i._document.data.value.mapValue.fields,"previous")),s.push(i.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function xc(r){switch(r){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return E(61501,{type:r})}}/** * @license * Copyright 2022 Google LLC * @@ -1706,7 +1691,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */Se._jsonSchemaVersion="firestore/querySnapshot/1.0",Se._jsonSchema={type:O("string",Se._jsonSchemaVersion),bundleSource:O("string","QuerySnapshot"),bundleName:O("string"),bundle:O("string")};/** + */Se._jsonSchemaVersion="firestore/querySnapshot/1.0",Se._jsonSchema={type:F("string",Se._jsonSchemaVersion),bundleSource:F("string","QuerySnapshot"),bundleName:F("string"),bundle:F("string")};/** * @license * Copyright 2020 Google LLC * @@ -1721,7 +1706,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Fc{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=At(e)}set(e,t,n){this._verifyNotCommitted();const s=En(e,this._firestore),i=Ir(s.converter,t,n),o=lr(this._dataReader,"WriteBatch.set",s._key,i,s.converter!==null,n);return this._mutations.push(o.toMutation(s._key,W.none())),this}update(e,t,n,...s){this._verifyNotCommitted();const i=En(e,this._firestore);let o;return o=typeof(t=ee(t))=="string"||t instanceof ln?$i(this._dataReader,"WriteBatch.update",i._key,t,n,s):zi(this._dataReader,"WriteBatch.update",i._key,t),this._mutations.push(o.toMutation(i._key,W.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=En(e,this._firestore);return this._mutations=this._mutations.concat(new rn(t._key,W.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new p(d.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function En(r,e){if((r=ee(r)).firestore!==e)throw new p(d.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return r}/** + */class Lc{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=At(e)}set(e,t,n){this._verifyNotCommitted();const s=En(e,this._firestore),i=Ir(s.converter,t,n),o=lr(this._dataReader,"WriteBatch.set",s._key,i,s.converter!==null,n);return this._mutations.push(o.toMutation(s._key,W.none())),this}update(e,t,n,...s){this._verifyNotCommitted();const i=En(e,this._firestore);let o;return o=typeof(t=ee(t))=="string"||t instanceof cn?$i(this._dataReader,"WriteBatch.update",i._key,t,n,s):zi(this._dataReader,"WriteBatch.update",i._key,t),this._mutations.push(o.toMutation(i._key,W.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=En(e,this._firestore);return this._mutations=this._mutations.concat(new nn(t._key,W.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new p(d.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function En(r,e){if((r=ee(r)).firestore!==e)throw new p(d.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return r}/** * @license * Copyright 2020 Google LLC * @@ -1736,4 +1721,4 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Wc(r){r=K(r,D);const e=K(r.firestore,ue),t=It(e);return yc(t,r._key).then((n=>Ji(e,r,n)))}function Hc(r){r=K(r,fe);const e=K(r.firestore,ue),t=It(e),n=new _r(e);return Hi(r._query),Ec(t,r._query).then((s=>new Se(e,n,r,s)))}function Yc(r,e,t){r=K(r,D);const n=K(r.firestore,ue),s=Ir(r.converter,e,t),i=At(n);return vt(n,[lr(i,"setDoc",r._key,s,r.converter!==null,t).toMutation(r._key,W.none())])}function Jc(r,e,t,...n){r=K(r,D);const s=K(r.firestore,ue),i=At(s);let o;return o=typeof(e=ee(e))=="string"||e instanceof ln?$i(i,"updateDoc",r._key,e,t,n):zi(i,"updateDoc",r._key,e),vt(s,[o.toMutation(r._key,W.exists(!0))])}function Xc(r){return vt(K(r.firestore,ue),[new rn(r._key,W.none())])}function Zc(r,e){const t=K(r.firestore,ue),n=vc(r),s=Ir(r.converter,e),i=At(r.firestore);return vt(t,[lr(i,"addDoc",n._key,s,r.converter!==null,{}).toMutation(n._key,W.exists(!1))]).then((()=>n))}function el(r,...e){r=ee(r);let t={includeMetadataChanges:!1,source:"default"},n=0;typeof e[n]!="object"||Is(e[n])||(t=e[n++]);const s={includeMetadataChanges:t.includeMetadataChanges,source:t.source};if(Is(e[n])){const c=e[n];e[n]=c.next?.bind(c),e[n+1]=c.error?.bind(c),e[n+2]=c.complete?.bind(c)}let i,o,a;if(r instanceof D)o=K(r.firestore,ue),a=Xt(r._key.path),i={next:c=>{e[n]&&e[n](Ji(o,r,c))},error:e[n+1],complete:e[n+2]};else{const c=K(r,fe);o=K(c.firestore,ue),a=c._query;const l=new _r(o);i={next:h=>{e[n]&&e[n](new Se(o,l,c,h))},error:e[n+1],complete:e[n+2]},Hi(r._query)}const u=It(o);return gc(u,a,s,i)}function vt(r,e){const t=It(r);return Tc(t,e)}function Ji(r,e,t){const n=t.docs.get(e._key),s=new _r(r);return new Pe(r,s,e._key,n,new rt(t.hasPendingWrites,t.fromCache),e.converter)}function tl(r){return r=K(r,ue),It(r),new Fc(r,(e=>vt(r,e)))}(function(e,t=!0){Eo(yo),po(new go("firestore",((n,{instanceIdentifier:s,options:i})=>{const o=n.getProvider("app").getImmediate(),a=new ue(new Ao(n.getProvider("auth-internal")),new Ro(o,n.getProvider("app-check-internal")),$o(o,s),o);return i={useFetchStreams:t,...i},a._setSettings(i),a}),"PUBLIC").setMultipleInstances(!0)),vr(Es,Ts,e),vr(Es,Ts,"esm2020")})();export{Bc as a,Wc as b,Xc as c,vc as d,Mc as e,Hc as f,Uc as g,qc as h,zc as i,el as j,$c as k,Kc as l,Zc as m,tl as n,jc as o,Gc as q,Yc as s,Jc as u,Qc as w}; + */function Kc(r){r=K(r,D);const e=K(r.firestore,ue),t=It(e);return yc(t,r._key).then((n=>Ji(e,r,n)))}function Wc(r){r=K(r,fe);const e=K(r.firestore,ue),t=It(e),n=new _r(e);return Hi(r._query),Ec(t,r._query).then((s=>new Se(e,n,r,s)))}function Hc(r,e,t){r=K(r,D);const n=K(r.firestore,ue),s=Ir(r.converter,e,t),i=At(n);return wt(n,[lr(i,"setDoc",r._key,s,r.converter!==null,t).toMutation(r._key,W.none())])}function Yc(r,e,t,...n){r=K(r,D);const s=K(r.firestore,ue),i=At(s);let o;return o=typeof(e=ee(e))=="string"||e instanceof cn?$i(i,"updateDoc",r._key,e,t,n):zi(i,"updateDoc",r._key,e),wt(s,[o.toMutation(r._key,W.exists(!0))])}function Jc(r){return wt(K(r.firestore,ue),[new nn(r._key,W.none())])}function Xc(r,e){const t=K(r.firestore,ue),n=vc(r),s=Ir(r.converter,e),i=At(r.firestore);return wt(t,[lr(i,"addDoc",n._key,s,r.converter!==null,{}).toMutation(n._key,W.exists(!1))]).then((()=>n))}function Zc(r,...e){r=ee(r);let t={includeMetadataChanges:!1,source:"default"},n=0;typeof e[n]!="object"||Is(e[n])||(t=e[n++]);const s={includeMetadataChanges:t.includeMetadataChanges,source:t.source};if(Is(e[n])){const c=e[n];e[n]=c.next?.bind(c),e[n+1]=c.error?.bind(c),e[n+2]=c.complete?.bind(c)}let i,o,a;if(r instanceof D)o=K(r.firestore,ue),a=Jt(r._key.path),i={next:c=>{e[n]&&e[n](Ji(o,r,c))},error:e[n+1],complete:e[n+2]};else{const c=K(r,fe);o=K(c.firestore,ue),a=c._query;const l=new _r(o);i={next:h=>{e[n]&&e[n](new Se(o,l,c,h))},error:e[n+1],complete:e[n+2]},Hi(r._query)}const u=It(o);return gc(u,a,s,i)}function wt(r,e){const t=It(r);return Tc(t,e)}function Ji(r,e,t){const n=t.docs.get(e._key),s=new _r(r);return new Pe(r,s,e._key,n,new rt(t.hasPendingWrites,t.fromCache),e.converter)}function el(r){return r=K(r,ue),It(r),new Lc(r,(e=>wt(r,e)))}(function(e,t=!0){Eo(yo),po(new go("firestore",((n,{instanceIdentifier:s,options:i})=>{const o=n.getProvider("app").getImmediate(),a=new ue(new Ao(n.getProvider("auth-internal")),new Ro(o,n.getProvider("app-check-internal")),$o(o,s),o);return i={useFetchStreams:t,...i},a._setSettings(i),a}),"PUBLIC").setMultipleInstances(!0)),vr(Es,Ts,e),vr(Es,Ts,"esm2020")})();export{Kc as a,qc as b,Mc as c,vc as d,Qc as e,Wc as f,Uc as g,Xc as h,zc as i,el as j,Jc as k,jc as l,Bc as m,Zc as o,$c as q,Hc as s,Yc as u,Gc as w}; diff --git a/assets/vendor-firebase-storage-BOeKE_0n.js b/assets/vendor-firebase-storage-CnCozLgy.js similarity index 99% rename from assets/vendor-firebase-storage-BOeKE_0n.js rename to assets/vendor-firebase-storage-CnCozLgy.js index ab510e1a0a50036b61d5b6f8894e79cab07af496..021048eab63709d6b30ecdb0fd67dbc2f5589f36 100644 --- a/assets/vendor-firebase-storage-BOeKE_0n.js +++ b/assets/vendor-firebase-storage-CnCozLgy.js @@ -1,4 +1,4 @@ -import{_ as B,C as H,r as w,S as K,c as j,F as q,d as G,l as W,y as X,n as Y,k as z,p as Z,u as J,z as Q}from"./vendor-firebase-core-DQ-pMjxd.js";/** +import{_ as B,C as H,r as w,S as K,c as j,F as q,d as G,l as W,y as X,n as Y,k as z,p as Z,u as J,z as Q}from"./vendor-firebase-core-BireMWc7.js";/** * @license * Copyright 2017 Google LLC * diff --git a/assets/vendor-markdown-C5ikSDMA.js b/assets/vendor-markdown-CDZ6ydrN.js similarity index 99% rename from assets/vendor-markdown-C5ikSDMA.js rename to assets/vendor-markdown-CDZ6ydrN.js index b07d712d49334b48f23c7db7a980e1bd20a7c6cb..856ff0f35ef56e1cb4ae1734896278b9b5daebc1 100644 --- a/assets/vendor-markdown-C5ikSDMA.js +++ b/assets/vendor-markdown-CDZ6ydrN.js @@ -1,4 +1,4 @@ -import{g as ha,j as r0}from"./vendor-react-Dexh7fmo.js";function Ln(t){const e=[],r=String(t||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const l=r.slice(i,n).trim();(l||!a)&&e.push(l),i=n+1,n=r.indexOf(",",i)}return e}function ns(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const is=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,as=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ls={};function Rn(t,e){return(ls.jsx?as:is).test(t)}const ss=/[ \t\n\f\r]/g;function os(t){return typeof t=="object"?t.type==="text"?On(t.value):!1:On(t)}function On(t){return t.replace(ss,"")===""}class gr{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}}gr.prototype.normal={};gr.prototype.property={};gr.prototype.space=void 0;function ma(t,e){const r={},n={};for(const i of t)Object.assign(r,i.property),Object.assign(n,i.normal);return new gr(r,n,e)}function mr(t){return t.toLowerCase()}class Pe{constructor(e,r){this.attribute=r,this.property=e}}Pe.prototype.attribute="";Pe.prototype.booleanish=!1;Pe.prototype.boolean=!1;Pe.prototype.commaOrSpaceSeparated=!1;Pe.prototype.commaSeparated=!1;Pe.prototype.defined=!1;Pe.prototype.mustUseProperty=!1;Pe.prototype.number=!1;Pe.prototype.overloadedBoolean=!1;Pe.prototype.property="";Pe.prototype.spaceSeparated=!1;Pe.prototype.space=void 0;let us=0;const ee=Ft(),Se=Ft(),D0=Ft(),L=Ft(),fe=Ft(),$t=Ft(),Ue=Ft();function Ft(){return 2**++us}const B0=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:Se,commaOrSpaceSeparated:Ue,commaSeparated:$t,number:L,overloadedBoolean:D0,spaceSeparated:fe},Symbol.toStringTag,{value:"Module"})),n0=Object.keys(B0);class J0 extends Pe{constructor(e,r,n,i){let a=-1;if(super(e,r),Pn(this,"space",i),typeof n=="number")for(;++a4&&r.slice(0,4)==="data"&&ps.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(qn,gs);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!qn.test(a)){let l=a.replace(fs,ds);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}i=J0}return new i(n,e)}function ds(t){return"-"+t.toLowerCase()}function gs(t){return t.charAt(1).toUpperCase()}const xa=ma([fa,cs,ga,va,ya],"html"),jr=ma([fa,hs,ga,va,ya],"svg");function Hn(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function vs(t){return t.join(" ").trim()}var Vt={},i0,Vn;function ys(){if(Vn)return i0;Vn=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,o=` +import{g as ha,j as r0}from"./vendor-react-CCIuKUIB.js";function Ln(t){const e=[],r=String(t||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const l=r.slice(i,n).trim();(l||!a)&&e.push(l),i=n+1,n=r.indexOf(",",i)}return e}function ns(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const is=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,as=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ls={};function Rn(t,e){return(ls.jsx?as:is).test(t)}const ss=/[ \t\n\f\r]/g;function os(t){return typeof t=="object"?t.type==="text"?On(t.value):!1:On(t)}function On(t){return t.replace(ss,"")===""}class gr{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}}gr.prototype.normal={};gr.prototype.property={};gr.prototype.space=void 0;function ma(t,e){const r={},n={};for(const i of t)Object.assign(r,i.property),Object.assign(n,i.normal);return new gr(r,n,e)}function mr(t){return t.toLowerCase()}class Pe{constructor(e,r){this.attribute=r,this.property=e}}Pe.prototype.attribute="";Pe.prototype.booleanish=!1;Pe.prototype.boolean=!1;Pe.prototype.commaOrSpaceSeparated=!1;Pe.prototype.commaSeparated=!1;Pe.prototype.defined=!1;Pe.prototype.mustUseProperty=!1;Pe.prototype.number=!1;Pe.prototype.overloadedBoolean=!1;Pe.prototype.property="";Pe.prototype.spaceSeparated=!1;Pe.prototype.space=void 0;let us=0;const ee=Ft(),Se=Ft(),D0=Ft(),L=Ft(),fe=Ft(),$t=Ft(),Ue=Ft();function Ft(){return 2**++us}const B0=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:Se,commaOrSpaceSeparated:Ue,commaSeparated:$t,number:L,overloadedBoolean:D0,spaceSeparated:fe},Symbol.toStringTag,{value:"Module"})),n0=Object.keys(B0);class J0 extends Pe{constructor(e,r,n,i){let a=-1;if(super(e,r),Pn(this,"space",i),typeof n=="number")for(;++a4&&r.slice(0,4)==="data"&&ps.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(qn,gs);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!qn.test(a)){let l=a.replace(fs,ds);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}i=J0}return new i(n,e)}function ds(t){return"-"+t.toLowerCase()}function gs(t){return t.charAt(1).toUpperCase()}const xa=ma([fa,cs,ga,va,ya],"html"),jr=ma([fa,hs,ga,va,ya],"svg");function Hn(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function vs(t){return t.join(" ").trim()}var Vt={},i0,Vn;function ys(){if(Vn)return i0;Vn=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,o=` `,c="/",m="*",f="",v="comment",d="declaration";function S(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var T=1,N=1;function _(Y){var O=Y.match(e);O&&(T+=O.length);var ne=Y.lastIndexOf(o);N=~ne?Y.length-ne:N+Y.length}function $(){var Y={line:T,column:N};return function(O){return O.position=new E(Y),V(),O}}function E(Y){this.start=Y,this.end={line:T,column:N},this.source=A.source}E.prototype.content=C;function G(Y){var O=new Error(A.source+":"+T+":"+N+": "+Y);if(O.reason=Y,O.filename=A.source,O.line=T,O.column=N,O.source=C,!A.silent)throw O}function W(Y){var O=Y.exec(C);if(O){var ne=O[0];return _(ne),C=C.slice(ne.length),O}}function V(){W(r)}function re(Y){var O;for(Y=Y||[];O=j();)O!==!1&&Y.push(O);return Y}function j(){var Y=$();if(!(c!=C.charAt(0)||m!=C.charAt(1))){for(var O=2;f!=C.charAt(O)&&(m!=C.charAt(O)||c!=C.charAt(O+1));)++O;if(O+=2,f===C.charAt(O-1))return G("End of comment missing");var ne=C.slice(2,O-2);return N+=2,_(ne),C=C.slice(O),N+=2,Y({type:v,comment:ne})}}function q(){var Y=$(),O=W(n);if(O){if(j(),!W(i))return G("property missing ':'");var ne=W(a),me=Y({type:d,property:M(O[0].replace(t,f)),value:ne?M(ne[0].replace(t,f)):f});return W(l),me}}function ae(){var Y=[];re(Y);for(var O;O=q();)O!==!1&&(Y.push(O),re(Y));return Y}return V(),ae()}function M(C){return C?C.replace(s,f):f}return i0=S,i0}var Un;function bs(){if(Un)return Vt;Un=1;var t=Vt&&Vt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.default=r;const e=t(ys());function r(n,i){let a=null;if(!n||typeof n!="string")return a;const l=(0,e.default)(n),s=typeof i=="function";return l.forEach(o=>{if(o.type!=="declaration")return;const{property:c,value:m}=o;s?i(c,m,o):m&&(a=a||{},a[c]=m)}),a}return Vt}var nr={},jn;function xs(){if(jn)return nr;jn=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(c){return!c||r.test(c)||t.test(c)},l=function(c,m){return m.toUpperCase()},s=function(c,m){return"".concat(m,"-")},o=function(c,m){return m===void 0&&(m={}),a(c)?c:(c=c.toLowerCase(),m.reactCompat?c=c.replace(i,s):c=c.replace(n,s),c.replace(e,l))};return nr.camelCase=o,nr}var ir,$n;function ws(){if($n)return ir;$n=1;var t=ir&&ir.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(bs()),r=xs();function n(i,a){var l={};return!i||typeof i!="string"||(0,e.default)(i,function(s,o){s&&o&&(l[(0,r.camelCase)(s,a)]=o)}),l}return n.default=n,ir=n,ir}var ks=ws();const Ss=ha(ks),wa=ka("end"),Q0=ka("start");function ka(t){return e;function e(r){const n=r&&r.position&&r.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Ms(t){const e=Q0(t),r=wa(t);if(e&&r)return{start:e,end:r}}function or(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Gn(t.position):"start"in t||"end"in t?Gn(t):"line"in t||"column"in t?F0(t):""}function F0(t){return Yn(t&&t.line)+":"+Yn(t&&t.column)}function Gn(t){return F0(t&&t.start)+"-"+F0(t&&t.end)}function Yn(t){return t&&typeof t=="number"?t:1}class Te extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},l=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof e=="string"?i=e:!a.cause&&e&&(l=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?a.ruleId=n:(a.source=n.slice(0,o),a.ruleId=n.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=or(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Te.prototype.file="";Te.prototype.name="";Te.prototype.reason="";Te.prototype.message="";Te.prototype.stack="";Te.prototype.column=void 0;Te.prototype.line=void 0;Te.prototype.ancestors=void 0;Te.prototype.cause=void 0;Te.prototype.fatal=void 0;Te.prototype.place=void 0;Te.prototype.ruleId=void 0;Te.prototype.source=void 0;const en={}.hasOwnProperty,As=new Map,zs=/[A-Z]/g,Ts=new Set(["table","tbody","thead","tfoot","tr"]),Cs=new Set(["td","th"]),Sa="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Es(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Os(r,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Rs(r,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?jr:xa,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=Ma(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function Ma(t,e,r){if(e.type==="element")return Is(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Ns(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Bs(t,e,r);if(e.type==="mdxjsEsm")return Ds(t,e);if(e.type==="root")return Fs(t,e,r);if(e.type==="text")return Ls(t,e)}function Is(t,e,r){const n=t.schema;let i=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=jr,t.schema=i),t.ancestors.push(e);const a=za(t,e.tagName,!1),l=Ps(t,e);let s=rn(t,e);return Ts.has(e.tagName)&&(s=s.filter(function(o){return typeof o=="string"?!os(o):!0})),Aa(t,l,a,e),tn(l,s),t.ancestors.pop(),t.schema=n,t.create(e,a,l,r)}function Ns(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}fr(t,e.position)}function Ds(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);fr(t,e.position)}function Bs(t,e,r){const n=t.schema;let i=n;e.name==="svg"&&n.space==="html"&&(i=jr,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:za(t,e.name,!0),l=qs(t,e),s=rn(t,e);return Aa(t,l,a,e),tn(l,s),t.ancestors.pop(),t.schema=n,t.create(e,a,l,r)}function Fs(t,e,r){const n={};return tn(n,rn(t,e)),t.create(e,t.Fragment,n,r)}function Ls(t,e){return e.value}function Aa(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function tn(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function Rs(t,e,r){return n;function n(i,a,l,s){const c=Array.isArray(l.children)?r:e;return s?c(a,l,s):c(a,l)}}function Os(t,e){return r;function r(n,i,a,l){const s=Array.isArray(a.children),o=Q0(n);return e(i,a,l,s,{columnNumber:o?o.column-1:void 0,fileName:t,lineNumber:o?o.line:void 0},void 0)}}function Ps(t,e){const r={};let n,i;for(i in e.properties)if(i!=="children"&&en.call(e.properties,i)){const a=Hs(t,i,e.properties[i]);if(a){const[l,s]=a;t.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&Cs.has(e.tagName)?n=s:r[l]=s}}if(n){const a=r.style||(r.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function qs(t,e){const r={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const a=n.data.estree.body[0];a.type;const l=a.expression;l.type;const s=l.properties[0];s.type,Object.assign(r,t.evaluater.evaluateExpression(s.argument))}else fr(t,e.position);else{const i=n.name;let a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const s=n.value.data.estree.body[0];s.type,a=t.evaluater.evaluateExpression(s.expression)}else fr(t,e.position);else a=n.value===null?!0:n.value;r[i]=a}return r}function rn(t,e){const r=[];let n=-1;const i=t.passKeys?new Map:As;for(;++ni?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)l=Array.from(n),l.unshift(e,r),t.splice(...l);else for(r&&t.splice(e,r);a0?(st(t,t.length,0,e),t):e}const Wn={}.hasOwnProperty;function Xs(t){const e={};let r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Gt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const it=Ct(/[A-Za-z]/),$e=Ct(/[\dA-Za-z]/),Zs=Ct(/[#-'*+\--9=?A-Z^-~]/);function L0(t){return t!==null&&(t<32||t===127)}const R0=Ct(/\d/),Js=Ct(/[\dA-Fa-f]/),Qs=Ct(/[!-/:-@[-`{-~]/);function X(t){return t!==null&&t<-2}function Oe(t){return t!==null&&(t<0||t===32)}function oe(t){return t===-2||t===-1||t===32}const eo=Ct(/\p{P}|\p{S}/u),to=Ct(/\s/);function Ct(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Wt(t){const e=[];let r=-1,n=0,i=0;for(;++r55295&&a<57344){const s=t.charCodeAt(r+1);a<56320&&s>56319&&s<57344?(l=String.fromCharCode(a,s),i=1):l="�"}else l=String.fromCharCode(a);l&&(e.push(t.slice(n,r),encodeURIComponent(l)),n=r+i+1,l=""),i&&(r+=i,i=0)}return e.join("")+t.slice(n)}function ue(t,e,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(o){return oe(o)?(t.enter(r),s(o)):e(o)}function s(o){return oe(o)&&a++l))return;const G=e.events.length;let W=G,V,re;for(;W--;)if(e.events[W][0]==="exit"&&e.events[W][1].type==="chunkFlow"){if(V){re=e.events[W][1].end;break}V=!0}for(A(n),E=G;EN;){const $=r[_];e.containerState=$[1],$[0].exit.call(e,t)}r.length=N}function T(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function lo(t,e,r){return ue(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zn(t){if(t===null||Oe(t)||to(t))return 1;if(eo(t))return 2}function an(t,e,r){const n=[];let i=-1;for(;++i1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;const f={...t[n][1].end},v={...t[r][1].start};Jn(f,-o),Jn(v,o),l={type:o>1?"strongSequence":"emphasisSequence",start:f,end:{...t[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:v},a={type:o>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:o>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},t[n][1].end={...l.start},t[r][1].start={...s.end},c=[],t[n][1].end.offset-t[n][1].start.offset&&(c=Xe(c,[["enter",t[n][1],e],["exit",t[n][1],e]])),c=Xe(c,[["enter",i,e],["enter",l,e],["exit",l,e],["enter",a,e]]),c=Xe(c,an(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),c=Xe(c,[["exit",a,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(m=2,c=Xe(c,[["enter",t[r][1],e],["exit",t[r][1],e]])):m=0,st(t,n-1,r-n+3,c),r=n+c.length-m-2;break}}for(r=-1;++r0&&oe(E)?ue(t,T,"linePrefix",a+1)(E):T(E)}function T(E){return E===null||X(E)?t.check(Qn,M,_)(E):(t.enter("codeFlowValue"),N(E))}function N(E){return E===null||X(E)?(t.exit("codeFlowValue"),T(E)):(t.consume(E),N)}function _(E){return t.exit("codeFenced"),e(E)}function $(E,G,W){let V=0;return re;function re(O){return E.enter("lineEnding"),E.consume(O),E.exit("lineEnding"),j}function j(O){return E.enter("codeFencedFence"),oe(O)?ue(E,q,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):q(O)}function q(O){return O===s?(E.enter("codeFencedFenceSequence"),ae(O)):W(O)}function ae(O){return O===s?(V++,E.consume(O),ae):V>=l?(E.exit("codeFencedFenceSequence"),oe(O)?ue(E,Y,"whitespace")(O):Y(O)):W(O)}function Y(O){return O===null||X(O)?(E.exit("codeFencedFence"),G(O)):W(O)}}}function bo(t,e,r){const n=this;return i;function i(l){return l===null?r(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),a)}function a(l){return n.parser.lazy[n.now().line]?r(l):e(l)}}const l0={name:"codeIndented",tokenize:wo},xo={partial:!0,tokenize:ko};function wo(t,e,r){const n=this;return i;function i(c){return t.enter("codeIndented"),ue(t,a,"linePrefix",5)(c)}function a(c){const m=n.events[n.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(c):r(c)}function l(c){return c===null?o(c):X(c)?t.attempt(xo,l,o)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||X(c)?(t.exit("codeFlowValue"),l(c)):(t.consume(c),s)}function o(c){return t.exit("codeIndented"),e(c)}}function ko(t,e,r){const n=this;return i;function i(l){return n.parser.lazy[n.now().line]?r(l):X(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),i):ue(t,a,"linePrefix",5)(l)}function a(l){const s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(l):X(l)?i(l):r(l)}}const So={name:"codeText",previous:Ao,resolve:Mo,tokenize:zo};function Mo(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,r,n){const i=r||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&ar(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),ar(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ar(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(l):t.interrupt(n.parser.constructs.flow,r,e)(l)}}function Ba(t,e,r,n,i,a,l,s,o){const c=o||Number.POSITIVE_INFINITY;let m=0;return f;function f(A){return A===60?(t.enter(n),t.enter(i),t.enter(a),t.consume(A),t.exit(a),v):A===null||A===32||A===41||L0(A)?r(A):(t.enter(n),t.enter(l),t.enter(s),t.enter("chunkString",{contentType:"string"}),M(A))}function v(A){return A===62?(t.enter(a),t.consume(A),t.exit(a),t.exit(i),t.exit(n),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),d(A))}function d(A){return A===62?(t.exit("chunkString"),t.exit(s),v(A)):A===null||A===60||X(A)?r(A):(t.consume(A),A===92?S:d)}function S(A){return A===60||A===62||A===92?(t.consume(A),d):d(A)}function M(A){return!m&&(A===null||A===41||Oe(A))?(t.exit("chunkString"),t.exit(s),t.exit(l),t.exit(n),e(A)):m999||d===null||d===91||d===93&&!o||d===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?r(d):d===93?(t.exit(a),t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):X(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||X(d)||s++>999?(t.exit("chunkString"),m(d)):(t.consume(d),o||(o=!oe(d)),d===92?v:f)}function v(d){return d===91||d===92||d===93?(t.consume(d),s++,f):f(d)}}function La(t,e,r,n,i,a){let l;return s;function s(v){return v===34||v===39||v===40?(t.enter(n),t.enter(i),t.consume(v),t.exit(i),l=v===40?41:v,o):r(v)}function o(v){return v===l?(t.enter(i),t.consume(v),t.exit(i),t.exit(n),e):(t.enter(a),c(v))}function c(v){return v===l?(t.exit(a),o(l)):v===null?r(v):X(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),ue(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===l||v===null||X(v)?(t.exit("chunkString"),c(v)):(t.consume(v),v===92?f:m)}function f(v){return v===l||v===92?(t.consume(v),m):m(v)}}function ur(t,e){let r;return n;function n(i){return X(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):oe(i)?ue(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}const Fo={name:"definition",tokenize:Ro},Lo={partial:!0,tokenize:Oo};function Ro(t,e,r){const n=this;let i;return a;function a(d){return t.enter("definition"),l(d)}function l(d){return Fa.call(n,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=Gt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),o):r(d)}function o(d){return Oe(d)?ur(t,c)(d):c(d)}function c(d){return Ba(t,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function m(d){return t.attempt(Lo,f,f)(d)}function f(d){return oe(d)?ue(t,v,"whitespace")(d):v(d)}function v(d){return d===null||X(d)?(t.exit("definition"),n.parser.defined.push(i),e(d)):r(d)}}function Oo(t,e,r){return n;function n(s){return Oe(s)?ur(t,i)(s):r(s)}function i(s){return La(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return oe(s)?ue(t,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?e(s):r(s)}}const Po={name:"hardBreakEscape",tokenize:qo};function qo(t,e,r){return n;function n(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return X(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}const Ho={name:"headingAtx",resolve:Vo,tokenize:Uo};function Vo(t,e){let r=t.length-2,n=3,i,a;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},a={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},st(t,n,r-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function Uo(t,e,r){let n=0;return i;function i(m){return t.enter("atxHeading"),a(m)}function a(m){return t.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&n++<6?(t.consume(m),l):m===null||Oe(m)?(t.exit("atxHeadingSequence"),s(m)):r(m)}function s(m){return m===35?(t.enter("atxHeadingSequence"),o(m)):m===null||X(m)?(t.exit("atxHeading"),e(m)):oe(m)?ue(t,s,"whitespace")(m):(t.enter("atxHeadingText"),c(m))}function o(m){return m===35?(t.consume(m),o):(t.exit("atxHeadingSequence"),s(m))}function c(m){return m===null||m===35||Oe(m)?(t.exit("atxHeadingText"),s(m)):(t.consume(m),c)}}const jo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ti=["pre","script","style","textarea"],$o={concrete:!0,name:"htmlFlow",resolveTo:_o,tokenize:Xo},Go={partial:!0,tokenize:Ko},Yo={partial:!0,tokenize:Wo};function _o(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Xo(t,e,r){const n=this;let i,a,l,s,o;return c;function c(w){return m(w)}function m(w){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(w),f}function f(w){return w===33?(t.consume(w),v):w===47?(t.consume(w),a=!0,M):w===63?(t.consume(w),i=3,n.interrupt?e:x):it(w)?(t.consume(w),l=String.fromCharCode(w),C):r(w)}function v(w){return w===45?(t.consume(w),i=2,d):w===91?(t.consume(w),i=5,s=0,S):it(w)?(t.consume(w),i=4,n.interrupt?e:x):r(w)}function d(w){return w===45?(t.consume(w),n.interrupt?e:x):r(w)}function S(w){const Ce="CDATA[";return w===Ce.charCodeAt(s++)?(t.consume(w),s===Ce.length?n.interrupt?e:q:S):r(w)}function M(w){return it(w)?(t.consume(w),l=String.fromCharCode(w),C):r(w)}function C(w){if(w===null||w===47||w===62||Oe(w)){const Ce=w===47,Be=l.toLowerCase();return!Ce&&!a&&ti.includes(Be)?(i=1,n.interrupt?e(w):q(w)):jo.includes(l.toLowerCase())?(i=6,Ce?(t.consume(w),A):n.interrupt?e(w):q(w)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(w):a?T(w):N(w))}return w===45||$e(w)?(t.consume(w),l+=String.fromCharCode(w),C):r(w)}function A(w){return w===62?(t.consume(w),n.interrupt?e:q):r(w)}function T(w){return oe(w)?(t.consume(w),T):re(w)}function N(w){return w===47?(t.consume(w),re):w===58||w===95||it(w)?(t.consume(w),_):oe(w)?(t.consume(w),N):re(w)}function _(w){return w===45||w===46||w===58||w===95||$e(w)?(t.consume(w),_):$(w)}function $(w){return w===61?(t.consume(w),E):oe(w)?(t.consume(w),$):N(w)}function E(w){return w===null||w===60||w===61||w===62||w===96?r(w):w===34||w===39?(t.consume(w),o=w,G):oe(w)?(t.consume(w),E):W(w)}function G(w){return w===o?(t.consume(w),o=null,V):w===null||X(w)?r(w):(t.consume(w),G)}function W(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Oe(w)?$(w):(t.consume(w),W)}function V(w){return w===47||w===62||oe(w)?N(w):r(w)}function re(w){return w===62?(t.consume(w),j):r(w)}function j(w){return w===null||X(w)?q(w):oe(w)?(t.consume(w),j):r(w)}function q(w){return w===45&&i===2?(t.consume(w),ne):w===60&&i===1?(t.consume(w),me):w===62&&i===4?(t.consume(w),we):w===63&&i===3?(t.consume(w),x):w===93&&i===5?(t.consume(w),He):X(w)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Go,ye,ae)(w)):w===null||X(w)?(t.exit("htmlFlowData"),ae(w)):(t.consume(w),q)}function ae(w){return t.check(Yo,Y,ye)(w)}function Y(w){return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),O}function O(w){return w===null||X(w)?ae(w):(t.enter("htmlFlowData"),q(w))}function ne(w){return w===45?(t.consume(w),x):q(w)}function me(w){return w===47?(t.consume(w),l="",ze):q(w)}function ze(w){if(w===62){const Ce=l.toLowerCase();return ti.includes(Ce)?(t.consume(w),we):q(w)}return it(w)&&l.length<8?(t.consume(w),l+=String.fromCharCode(w),ze):q(w)}function He(w){return w===93?(t.consume(w),x):q(w)}function x(w){return w===62?(t.consume(w),we):w===45&&i===2?(t.consume(w),x):q(w)}function we(w){return w===null||X(w)?(t.exit("htmlFlowData"),ye(w)):(t.consume(w),we)}function ye(w){return t.exit("htmlFlow"),e(w)}}function Wo(t,e,r){const n=this;return i;function i(l){return X(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),a):r(l)}function a(l){return n.parser.lazy[n.now().line]?r(l):e(l)}}function Ko(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt($r,e,r)}}const Zo={name:"htmlText",tokenize:Jo};function Jo(t,e,r){const n=this;let i,a,l;return s;function s(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),o}function o(x){return x===33?(t.consume(x),c):x===47?(t.consume(x),$):x===63?(t.consume(x),N):it(x)?(t.consume(x),W):r(x)}function c(x){return x===45?(t.consume(x),m):x===91?(t.consume(x),a=0,S):it(x)?(t.consume(x),T):r(x)}function m(x){return x===45?(t.consume(x),d):r(x)}function f(x){return x===null?r(x):x===45?(t.consume(x),v):X(x)?(l=f,me(x)):(t.consume(x),f)}function v(x){return x===45?(t.consume(x),d):f(x)}function d(x){return x===62?ne(x):x===45?v(x):f(x)}function S(x){const we="CDATA[";return x===we.charCodeAt(a++)?(t.consume(x),a===we.length?M:S):r(x)}function M(x){return x===null?r(x):x===93?(t.consume(x),C):X(x)?(l=M,me(x)):(t.consume(x),M)}function C(x){return x===93?(t.consume(x),A):M(x)}function A(x){return x===62?ne(x):x===93?(t.consume(x),A):M(x)}function T(x){return x===null||x===62?ne(x):X(x)?(l=T,me(x)):(t.consume(x),T)}function N(x){return x===null?r(x):x===63?(t.consume(x),_):X(x)?(l=N,me(x)):(t.consume(x),N)}function _(x){return x===62?ne(x):N(x)}function $(x){return it(x)?(t.consume(x),E):r(x)}function E(x){return x===45||$e(x)?(t.consume(x),E):G(x)}function G(x){return X(x)?(l=G,me(x)):oe(x)?(t.consume(x),G):ne(x)}function W(x){return x===45||$e(x)?(t.consume(x),W):x===47||x===62||Oe(x)?V(x):r(x)}function V(x){return x===47?(t.consume(x),ne):x===58||x===95||it(x)?(t.consume(x),re):X(x)?(l=V,me(x)):oe(x)?(t.consume(x),V):ne(x)}function re(x){return x===45||x===46||x===58||x===95||$e(x)?(t.consume(x),re):j(x)}function j(x){return x===61?(t.consume(x),q):X(x)?(l=j,me(x)):oe(x)?(t.consume(x),j):V(x)}function q(x){return x===null||x===60||x===61||x===62||x===96?r(x):x===34||x===39?(t.consume(x),i=x,ae):X(x)?(l=q,me(x)):oe(x)?(t.consume(x),q):(t.consume(x),Y)}function ae(x){return x===i?(t.consume(x),i=void 0,O):x===null?r(x):X(x)?(l=ae,me(x)):(t.consume(x),ae)}function Y(x){return x===null||x===34||x===39||x===60||x===61||x===96?r(x):x===47||x===62||Oe(x)?V(x):(t.consume(x),Y)}function O(x){return x===47||x===62||Oe(x)?V(x):r(x)}function ne(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):r(x)}function me(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),ze}function ze(x){return oe(x)?ue(t,He,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):He(x)}function He(x){return t.enter("htmlTextData"),l(x)}}const ln={name:"labelEnd",resolveAll:ru,resolveTo:nu,tokenize:iu},Qo={tokenize:au},eu={tokenize:lu},tu={tokenize:su};function ru(t){let e=-1;const r=[];for(;++e=3&&(c===null||X(c))?(t.exit("thematicBreak"),e(c)):r(c)}function o(c){return c===i?(t.consume(c),n++,o):(t.exit("thematicBreakSequence"),oe(c)?ue(t,s,"whitespace")(c):s(c))}}const Fe={continuation:{tokenize:vu},exit:bu,name:"list",tokenize:gu},pu={partial:!0,tokenize:xu},du={partial:!0,tokenize:yu};function gu(t,e,r){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(d){const S=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:R0(d)){if(n.containerState.type||(n.containerState.type=S,t.enter(S,{_container:!0})),S==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Br,r,c)(d):c(d);if(!n.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),o(d)}return r(d)}function o(d){return R0(d)&&++l<10?(t.consume(d),o):(!n.interrupt||l<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),c(d)):r(d)}function c(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,t.check($r,n.interrupt?r:m,t.attempt(pu,v,f))}function m(d){return n.containerState.initialBlankLine=!0,a++,v(d)}function f(d){return oe(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),v):r(d)}function v(d){return n.containerState.size=a+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function vu(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check($r,i,a);function i(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ue(t,e,"listItemIndent",n.containerState.size+1)(s)}function a(s){return n.containerState.furtherBlankLines||!oe(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,l(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(du,e,l)(s))}function l(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,ue(t,t.attempt(Fe,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function yu(t,e,r){const n=this;return ue(t,i,"listItemIndent",n.containerState.size+1);function i(a){const l=n.events[n.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===n.containerState.size?e(a):r(a)}}function bu(t){t.exit(this.containerState.type)}function xu(t,e,r){const n=this;return ue(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=n.events[n.events.length-1];return!oe(a)&&l&&l[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}const ri={name:"setextUnderline",resolveTo:wu,tokenize:ku};function wu(t,e){let r=t.length,n,i,a;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!a&&t[r][1].type==="definition"&&(a=r);const l={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",a?(t.splice(i,0,["enter",l,e]),t.splice(a+1,0,["exit",t[n][1],e]),t[n][1].end={...t[a][1].end}):t[n][1]=l,t.push(["exit",l,e]),t}function ku(t,e,r){const n=this;let i;return a;function a(c){let m=n.events.length,f;for(;m--;)if(n.events[m][1].type!=="lineEnding"&&n.events[m][1].type!=="linePrefix"&&n.events[m][1].type!=="content"){f=n.events[m][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=c,l(c)):r(c)}function l(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),oe(c)?ue(t,o,"lineSuffix")(c):o(c))}function o(c){return c===null||X(c)?(t.exit("setextHeadingLine"),e(c)):r(c)}}const Su={tokenize:Mu};function Mu(t){const e=this,r=t.attempt($r,n,t.attempt(this.parser.constructs.flowInitial,i,ue(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Eo,i)),"linePrefix")));return r;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,r}}const Au={resolveAll:Oa()},zu=Ra("string"),Tu=Ra("text");function Ra(t){return{resolveAll:Oa(t==="text"?Cu:void 0),tokenize:e};function e(r){const n=this,i=this.parser.constructs[t],a=r.attempt(i,l,s);return l;function l(m){return c(m)?a(m):s(m)}function s(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),o}function o(m){return c(m)?(r.exit("data"),a(m)):(r.consume(m),o)}function c(m){if(m===null)return!0;const f=i[m];let v=-1;if(f)for(;++v-1){const s=l[0];typeof s=="string"?l[0]=s.slice(n):l.shift()}a>0&&l.push(t[i].slice(0,a))}return l}function Vu(t,e){let r=-1;const n=[];let i;for(;++r0){const et=Q.tokenStack[Q.tokenStack.length-1];(et[1]||ii).call(Q,void 0,et[0])}for(P.position={start:wt(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:wt(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce{let n=!1;const o=e.map(r=>{const i=Tn(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{let{children:i,...s}=o;no(i)&&typeof ot=="function"&&(i=ot(i._payload));const a=c.Children.toArray(i),l=a.find(Ri);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var lu=oo("Slot");function Ci(e){const t=c.forwardRef((n,o)=>{let{children:r,...i}=n;if(no(r)&&typeof ot=="function"&&(r=ot(r._payload)),c.isValidElement(r)){const s=Ti(r),a=Pi(i,r.props);return r.type!==c.Fragment&&(a.ref=o?je(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ei=Symbol("radix.slottable");function Ri(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ei}function Pi(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Ti(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Ai(e,t){const n=c.createContext(t),o=i=>{const{children:s,...a}=i,l=c.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};o.displayName=e+"Provider";function r(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function fe(e,t=[]){let n=[];function o(i,s){const a=c.createContext(s),l=n.length;n=[...n,s];const u=d=>{const{scope:h,children:m,...y}=d,p=h?.[e]?.[l]||a,v=c.useMemo(()=>y,Object.values(y));return g.jsx(p.Provider,{value:v,children:m})};u.displayName=i+"Provider";function f(d,h){const m=h?.[e]?.[l]||a,y=c.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const r=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=a?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return r.scopeName=e,[o,Ii(r,...t)]}function Ii(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var z=globalThis?.document?c.useLayoutEffect:()=>{},Oi=nn[" useId ".trim().toString()]||(()=>{}),Ni=0;function re(e){const[t,n]=c.useState(Oi());return z(()=>{n(o=>o??String(Ni++))},[e]),e||(t?`radix-${t}`:"")}var _i=nn[" useInsertionEffect ".trim().toString()]||z;function me({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,s]=Di({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:r;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,o])}const u=c.useCallback(f=>{if(a){const d=Mi(f)?f(e):f;d!==e&&s.current?.(d)}else i(f)},[a,e,i,s]);return[l,u]}function Di({defaultProp:e,onChange:t}){const[n,o]=c.useState(e),r=c.useRef(n),i=c.useRef(t);return _i(()=>{i.current=t},[t]),c.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function Mi(e){return typeof e=="function"}function Li(e){const t=ji(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(ki);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function ji(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=Bi(r),a=$i(i,r.props);return r.type!==c.Fragment&&(a.ref=o?je(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fi=Symbol("radix.slottable");function ki(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fi}function $i(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Bi(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],N=Wi.reduce((e,t)=>{const n=Li(`Primitive.${t}`),o=c.forwardRef((r,i)=>{const{asChild:s,...a}=r,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Vi(e,t){e&&ut.flushSync(()=>e.dispatchEvent(t))}function ce(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function Hi(e,t=globalThis?.document){const n=ce(e);c.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Ui="DismissableLayer",Ht="dismissableLayer.update",Ki="dismissableLayer.pointerDownOutside",zi="dismissableLayer.focusOutside",An,ro=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ft=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=c.useContext(ro),[f,d]=c.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=c.useState({}),y=$(t,E=>d(E)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(v),w=f?p.indexOf(f):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=x,C=Xi(E=>{const P=E.target,M=[...u.branches].some(_=>_.contains(P));!S||M||(r?.(E),s?.(E),E.defaultPrevented||a?.())},h),R=qi(E=>{const P=E.target;[...u.branches].some(_=>_.contains(P))||(i?.(E),s?.(E),E.defaultPrevented||a?.())},h);return Hi(E=>{w===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(An=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),In(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=An)}},[f,h,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),In())},[f,u]),c.useEffect(()=>{const E=()=>m({});return document.addEventListener(Ht,E),()=>document.removeEventListener(Ht,E)},[]),g.jsx(N.div,{...l,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:O(e.onFocusCapture,R.onFocusCapture),onBlurCapture:O(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,C.onPointerDownCapture)})});ft.displayName=Ui;var Gi="DismissableLayerBranch",Yi=c.forwardRef((e,t)=>{const n=c.useContext(ro),o=c.useRef(null),r=$(t,o);return c.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(N.div,{...e,ref:r})});Yi.displayName=Gi;function Xi(e,t=globalThis?.document){const n=ce(e),o=c.useRef(!1),r=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let l=function(){io(Ki,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function qi(e,t=globalThis?.document){const n=ce(e),o=c.useRef(!1);return c.useEffect(()=>{const r=i=>{i.target&&!o.current&&io(zi,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function In(){const e=new CustomEvent(Ht);document.dispatchEvent(e)}function io(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Vi(r,i):r.dispatchEvent(i)}var Nt="focusScope.autoFocusOnMount",_t="focusScope.autoFocusOnUnmount",On={bubbles:!1,cancelable:!0},Zi="FocusScope",on=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),u=ce(r),f=ce(i),d=c.useRef(null),h=$(t,p=>l(p)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let p=function(b){if(m.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:pe(d.current,{select:!0})},v=function(b){if(m.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||pe(d.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&pe(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[o,a,m.paused]),c.useEffect(()=>{if(a){_n.add(m);const p=document.activeElement;if(!a.contains(p)){const x=new CustomEvent(Nt,On);a.addEventListener(Nt,u),a.dispatchEvent(x),x.defaultPrevented||(Qi(os(so(a)),{select:!0}),document.activeElement===p&&pe(a))}return()=>{a.removeEventListener(Nt,u),setTimeout(()=>{const x=new CustomEvent(_t,On);a.addEventListener(_t,f),a.dispatchEvent(x),x.defaultPrevented||pe(p??document.body,{select:!0}),a.removeEventListener(_t,f),_n.remove(m)},0)}}},[a,u,f,m]);const y=c.useCallback(p=>{if(!n&&!o||m.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(v&&x){const w=p.currentTarget,[b,S]=Ji(w);b&&S?!p.shiftKey&&x===S?(p.preventDefault(),n&&pe(b,{select:!0})):p.shiftKey&&x===b&&(p.preventDefault(),n&&pe(S,{select:!0})):x===w&&p.preventDefault()}},[n,o,m.paused]);return g.jsx(N.div,{tabIndex:-1,...s,ref:h,onKeyDown:y})});on.displayName=Zi;function Qi(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(pe(o,{select:t}),document.activeElement!==n)return}function Ji(e){const t=so(e),n=Nn(t,e),o=Nn(t.reverse(),e);return[n,o]}function so(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nn(e,t){for(const n of e)if(!es(n,{upTo:t}))return n}function es(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ts(e){return e instanceof HTMLInputElement&&"select"in e}function pe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ts(e)&&t&&e.select()}}var _n=ns();function ns(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Dn(e,t),e.unshift(t)},remove(t){e=Dn(e,t),e[0]?.resume()}}}function Dn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function os(e){return e.filter(t=>t.tagName!=="A")}var rs="Portal",dt=c.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=c.useState(!1);z(()=>i(!0),[]);const s=n||r&&globalThis?.document?.body;return s?wi.createPortal(g.jsx(N.div,{...o,ref:t}),s):null});dt.displayName=rs;function is(e,t){return c.useReducer((n,o)=>t[n][o]??n,e)}var ge=e=>{const{present:t,children:n}=e,o=ss(t),r=typeof n=="function"?n({present:o.isPresent}):c.Children.only(n),i=$(o.ref,as(r));return typeof n=="function"||o.isPresent?c.cloneElement(r,{ref:i}):null};ge.displayName="Presence";function ss(e){const[t,n]=c.useState(),o=c.useRef(null),r=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,l]=is(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=Ye(o.current);i.current=a==="mounted"?u:"none"},[a]),z(()=>{const u=o.current,f=r.current;if(f!==e){const h=i.current,m=Ye(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),z(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=m=>{const p=Ye(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&p&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=m=>{m.target===t&&(i.current=Ye(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function Ye(e){return e?.animationName||"none"}function as(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dt=0;function ao(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Mn()),document.body.insertAdjacentElement("beforeend",e[1]??Mn()),Dt++,()=>{Dt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dt--}},[])}function Mn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ne=function(){return ne=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return Es;var t=Rs(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Ts=fo(),_e="data-scroll-locked",As=function(e,t,n,o){var r=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(ls,` { - overflow: hidden `).concat(o,`; - padding-right: `).concat(a,"px ").concat(o,`; - } - body[`).concat(_e,`] { - overflow: hidden `).concat(o,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` - padding-left: `.concat(r,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(o,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),` - } - - .`).concat(et,` { - right: `).concat(a,"px ").concat(o,`; - } - - .`).concat(tt,` { - margin-right: `).concat(a,"px ").concat(o,`; - } - - .`).concat(et," .").concat(et,` { - right: 0 `).concat(o,`; - } - - .`).concat(tt," .").concat(tt,` { - margin-right: 0 `).concat(o,`; - } - - body[`).concat(_e,`] { - `).concat(us,": ").concat(a,`px; - } -`)},jn=function(){var e=parseInt(document.body.getAttribute(_e)||"0",10);return isFinite(e)?e:0},Is=function(){c.useEffect(function(){return document.body.setAttribute(_e,(jn()+1).toString()),function(){var e=jn()-1;e<=0?document.body.removeAttribute(_e):document.body.setAttribute(_e,e.toString())}},[])},Os=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Is();var i=c.useMemo(function(){return Ps(r)},[r]);return c.createElement(Ts,{styles:As(i,!t,r,n?"":"!important")})},Ut=!1;if(typeof window<"u")try{var Xe=Object.defineProperty({},"passive",{get:function(){return Ut=!0,!0}});window.addEventListener("test",Xe,Xe),window.removeEventListener("test",Xe,Xe)}catch{Ut=!1}var Ie=Ut?{passive:!1}:!1,Ns=function(e){return e.tagName==="TEXTAREA"},po=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ns(e)&&n[t]==="visible")},_s=function(e){return po(e,"overflowY")},Ds=function(e){return po(e,"overflowX")},Fn=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=mo(e,o);if(r){var i=ho(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Ms=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Ls=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},mo=function(e,t){return e==="v"?_s(t):Ds(t)},ho=function(e,t){return e==="v"?Ms(t):Ls(t)},js=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fs=function(e,t,n,o,r){var i=js(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,l=t.contains(a),u=!1,f=s>0,d=0,h=0;do{if(!a)break;var m=ho(e,a),y=m[0],p=m[1],v=m[2],x=p-v-i*y;(y||x)&&mo(e,a)&&(d+=x,h+=y);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(h)<1)&&(u=!0),u},qe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kn=function(e){return[e.deltaX,e.deltaY]},$n=function(e){return e&&"current"in e?e.current:e},ks=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$s=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Bs=0,Oe=[];function Ws(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(Bs++)[0],i=c.useState(fo)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var p=cs([e.lockRef.current],(e.shards||[]).map($n),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var x=qe(p),w=n.current,b="deltaX"in p?p.deltaX:w[0]-x[0],S="deltaY"in p?p.deltaY:w[1]-x[1],C,R=p.target,E=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in p&&E==="h"&&R.type==="range")return!1;var P=window.getSelection(),M=P&&P.anchorNode,_=M?M===R||M.contains(R):!1;if(_)return!1;var D=Fn(E,R);if(!D)return!0;if(D?C=E:(C=E==="v"?"h":"v",D=Fn(E,R)),!D)return!1;if(!o.current&&"changedTouches"in p&&(b||S)&&(o.current=C),!C)return!0;var j=o.current||C;return Fs(j,v,p,j==="h"?b:S)},[]),l=c.useCallback(function(p){var v=p;if(!(!Oe.length||Oe[Oe.length-1]!==i)){var x="deltaY"in v?kn(v):qe(v),w=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&ks(C.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(s.current.shards||[]).map($n).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=b.length>0?a(v,b[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=c.useCallback(function(p,v,x,w){var b={name:p,delta:v,target:x,should:w,shadowParent:Vs(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),f=c.useCallback(function(p){n.current=qe(p),o.current=void 0},[]),d=c.useCallback(function(p){u(p.type,kn(p),p.target,a(p,e.lockRef.current))},[]),h=c.useCallback(function(p){u(p.type,qe(p),p.target,a(p,e.lockRef.current))},[]);c.useEffect(function(){return Oe.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ie),document.addEventListener("touchmove",l,Ie),document.addEventListener("touchstart",f,Ie),function(){Oe=Oe.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Ie),document.removeEventListener("touchmove",l,Ie),document.removeEventListener("touchstart",f,Ie)}},[]);var m=e.removeScrollBar,y=e.inert;return c.createElement(c.Fragment,null,y?c.createElement(i,{styles:$s(r)}):null,m?c.createElement(Os,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vs(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hs=gs(uo,Ws);var rn=c.forwardRef(function(e,t){return c.createElement(pt,ne({},e,{ref:t,sideCar:Hs}))});rn.classNames=pt.classNames;var Us=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ne=new WeakMap,Ze=new WeakMap,Qe={},Ft=0,vo=function(e){return e&&(e.host||vo(e.parentNode))},Ks=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=vo(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},zs=function(e,t,n,o){var r=Ks(t,Array.isArray(e)?e:[e]);Qe[n]||(Qe[n]=new WeakMap);var i=Qe[n],s=[],a=new Set,l=new Set(r),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};r.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))f(h);else try{var m=h.getAttribute(o),y=m!==null&&m!=="false",p=(Ne.get(h)||0)+1,v=(i.get(h)||0)+1;Ne.set(h,p),i.set(h,v),s.push(h),p===1&&y&&Ze.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(o,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return f(t),a.clear(),Ft++,function(){s.forEach(function(d){var h=Ne.get(d)-1,m=i.get(d)-1;Ne.set(d,h),i.set(d,m),h||(Ze.has(d)||d.removeAttribute(o),Ze.delete(d)),m||d.removeAttribute(n)}),Ft--,Ft||(Ne=new WeakMap,Ne=new WeakMap,Ze=new WeakMap,Qe={})}},go=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Us(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),zs(o,r,n,"aria-hidden")):function(){return null}};function Gs(e){const t=Ys(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(qs);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Ys(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=Qs(r),a=Zs(i,r.props);return r.type!==c.Fragment&&(a.ref=o?je(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xs=Symbol("radix.slottable");function qs(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xs}function Zs(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Qs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mt="Dialog",[yo]=fe(mt),[Js,te]=yo(mt),wo=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:s=!0}=e,a=c.useRef(null),l=c.useRef(null),[u,f]=me({prop:o,defaultProp:r??!1,onChange:i,caller:mt});return g.jsx(Js,{scope:t,triggerRef:a,contentRef:l,contentId:re(),titleId:re(),descriptionId:re(),open:u,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(d=>!d),[f]),modal:s,children:n})};wo.displayName=mt;var xo="DialogTrigger",ea=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(xo,n),i=$(t,r.triggerRef);return g.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":cn(r.open),...o,ref:i,onClick:O(e.onClick,r.onOpenToggle)})});ea.displayName=xo;var sn="DialogPortal",[ta,bo]=yo(sn,{forceMount:void 0}),So=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=te(sn,t);return g.jsx(ta,{scope:t,forceMount:n,children:c.Children.map(o,s=>g.jsx(ge,{present:n||i.open,children:g.jsx(dt,{asChild:!0,container:r,children:s})}))})};So.displayName=sn;var rt="DialogOverlay",Co=c.forwardRef((e,t)=>{const n=bo(rt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(rt,e.__scopeDialog);return i.modal?g.jsx(ge,{present:o||i.open,children:g.jsx(oa,{...r,ref:t})}):null});Co.displayName=rt;var na=Gs("DialogOverlay.RemoveScroll"),oa=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(rt,n);return g.jsx(rn,{as:na,allowPinchZoom:!0,shards:[r.contentRef],children:g.jsx(N.div,{"data-state":cn(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Ee="DialogContent",Eo=c.forwardRef((e,t)=>{const n=bo(Ee,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(Ee,e.__scopeDialog);return g.jsx(ge,{present:o||i.open,children:i.modal?g.jsx(ra,{...r,ref:t}):g.jsx(ia,{...r,ref:t})})});Eo.displayName=Ee;var ra=c.forwardRef((e,t)=>{const n=te(Ee,e.__scopeDialog),o=c.useRef(null),r=$(t,n.contentRef,o);return c.useEffect(()=>{const i=o.current;if(i)return go(i)},[]),g.jsx(Ro,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:O(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:O(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:O(e.onFocusOutside,i=>i.preventDefault())})}),ia=c.forwardRef((e,t)=>{const n=te(Ee,e.__scopeDialog),o=c.useRef(!1),r=c.useRef(!1);return g.jsx(Ro,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),Ro=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,...s}=e,a=te(Ee,n),l=c.useRef(null),u=$(t,l);return ao(),g.jsxs(g.Fragment,{children:[g.jsx(on,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i,children:g.jsx(ft,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":cn(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(sa,{titleId:a.titleId}),g.jsx(ca,{contentRef:l,descriptionId:a.descriptionId})]})]})}),an="DialogTitle",Po=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(an,n);return g.jsx(N.h2,{id:r.titleId,...o,ref:t})});Po.displayName=an;var To="DialogDescription",Ao=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(To,n);return g.jsx(N.p,{id:r.descriptionId,...o,ref:t})});Ao.displayName=To;var Io="DialogClose",Oo=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(Io,n);return g.jsx(N.button,{type:"button",...o,ref:t,onClick:O(e.onClick,()=>r.onOpenChange(!1))})});Oo.displayName=Io;function cn(e){return e?"open":"closed"}var No="DialogTitleWarning",[uu,_o]=Ai(No,{contentName:Ee,titleName:an,docsSlug:"dialog"}),sa=({titleId:e})=>{const t=_o(No),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aa="DialogDescriptionWarning",ca=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_o(aa).contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},fu=wo,du=So,pu=Co,mu=Eo,hu=Po,vu=Ao,gu=Oo;function Bn(e,[t,n]){return Math.min(n,Math.max(t,e))}function Wn(e){const t=la(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(fa);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function la(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=pa(r),a=da(i,r.props);return r.type!==c.Fragment&&(a.ref=o?je(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ua=Symbol("radix.slottable");function fa(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ua}function da(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function pa(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Do(e){const t=e+"CollectionProvider",[n,o]=fe(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:x}=p,w=Ce.useRef(null),b=Ce.useRef(new Map).current;return g.jsx(r,{scope:v,itemMap:b,collectionRef:w,children:x})};s.displayName=t;const a=e+"CollectionSlot",l=Wn(a),u=Ce.forwardRef((p,v)=>{const{scope:x,children:w}=p,b=i(a,x),S=$(v,b.collectionRef);return g.jsx(l,{ref:S,children:w})});u.displayName=a;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=Wn(f),m=Ce.forwardRef((p,v)=>{const{scope:x,children:w,...b}=p,S=Ce.useRef(null),C=$(v,S),R=i(f,x);return Ce.useEffect(()=>(R.itemMap.set(S,{ref:S,...b}),()=>void R.itemMap.delete(S))),g.jsx(h,{[d]:"",ref:C,children:w})});m.displayName=f;function y(p){const v=i(e+"CollectionConsumer",p);return Ce.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((R,E)=>b.indexOf(R.ref.current)-b.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:m},y,o]}var ma=c.createContext(void 0);function ln(e){const t=c.useContext(ma);return e||t||"ltr"}const ha=["top","right","bottom","left"],he=Math.min,X=Math.max,it=Math.round,Je=Math.floor,ie=e=>({x:e,y:e}),va={left:"right",right:"left",bottom:"top",top:"bottom"},ga={start:"end",end:"start"};function Kt(e,t,n){return X(e,he(t,n))}function le(e,t){return typeof e=="function"?e(t):e}function ue(e){return e.split("-")[0]}function Fe(e){return e.split("-")[1]}function un(e){return e==="x"?"y":"x"}function fn(e){return e==="y"?"height":"width"}const ya=new Set(["top","bottom"]);function oe(e){return ya.has(ue(e))?"y":"x"}function dn(e){return un(oe(e))}function wa(e,t,n){n===void 0&&(n=!1);const o=Fe(e),r=dn(e),i=fn(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=st(s)),[s,st(s)]}function xa(e){const t=st(e);return[zt(e),t,zt(t)]}function zt(e){return e.replace(/start|end/g,t=>ga[t])}const Vn=["left","right"],Hn=["right","left"],ba=["top","bottom"],Sa=["bottom","top"];function Ca(e,t,n){switch(e){case"top":case"bottom":return n?t?Hn:Vn:t?Vn:Hn;case"left":case"right":return t?ba:Sa;default:return[]}}function Ea(e,t,n,o){const r=Fe(e);let i=Ca(ue(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(zt)))),i}function st(e){return e.replace(/left|right|bottom|top/g,t=>va[t])}function Ra(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mo(e){return typeof e!="number"?Ra(e):{top:e,right:e,bottom:e,left:e}}function at(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Un(e,t,n){let{reference:o,floating:r}=e;const i=oe(t),s=dn(t),a=fn(s),l=ue(t),u=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let m;switch(l){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-r.width,y:d};break;default:m={x:o.x,y:o.y}}switch(Fe(t)){case"start":m[s]-=h*(n&&u?-1:1);break;case"end":m[s]+=h*(n&&u?-1:1);break}return m}async function Pa(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=le(t,e),y=Mo(m),v=a[h?d==="floating"?"reference":"floating":d],x=at(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},C=at(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:l}):w);return{top:(x.top-C.top+y.top)/S.y,bottom:(C.bottom-x.bottom+y.bottom)/S.y,left:(x.left-C.left+y.left)/S.x,right:(C.right-x.right+y.right)/S.x}}const Ta=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=Un(u,o,l),h=o,m={},y=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=le(e,t)||{};if(u==null)return{};const d=Mo(f),h={x:n,y:o},m=dn(r),y=fn(m),p=await s.getDimensions(u),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[m]-h[m]-i.floating[y],C=h[m]-i.reference[m],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let E=R?R[b]:0;(!E||!await(s.isElement==null?void 0:s.isElement(R)))&&(E=a.floating[b]||i.floating[y]);const P=S/2-C/2,M=E/2-p[y]/2-1,_=he(d[x],M),D=he(d[w],M),j=_,F=E-p[y]-D,L=E/2-p[y]/2+P,B=Kt(j,L,F),I=!l.arrow&&Fe(r)!=null&&L!==B&&i.reference[y]/2-(LL<=0)){var D,j;const L=(((D=i.flip)==null?void 0:D.index)||0)+1,B=E[L];if(B&&(!(d==="alignment"?w!==oe(B):!1)||_.every(A=>oe(A.placement)===w?A.overflows[0]>0:!0)))return{data:{index:L,overflows:_},reset:{placement:B}};let I=(j=_.filter(k=>k.overflows[0]<=0).sort((k,A)=>k.overflows[1]-A.overflows[1])[0])==null?void 0:j.placement;if(!I)switch(m){case"bestFit":{var F;const k=(F=_.filter(A=>{if(R){const W=oe(A.placement);return W===w||W==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(W=>W>0).reduce((W,Y)=>W+Y,0)]).sort((A,W)=>A[1]-W[1])[0])==null?void 0:F[0];k&&(I=k);break}case"initialPlacement":I=a;break}if(r!==I)return{reset:{placement:I}}}return{}}}};function Kn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zn(e){return ha.some(t=>e[t]>=0)}const Oa=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=le(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=Kn(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:zn(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=Kn(s,n.floating);return{data:{escapedOffsets:a,escaped:zn(a)}}}default:return{}}}}},Lo=new Set(["left","top"]);async function Na(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=ue(n),a=Fe(n),l=oe(n)==="y",u=Lo.has(s)?-1:1,f=i&&l?-1:1,d=le(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),l?{x:m*f,y:h*u}:{x:h*u,y:m*f}}const _a=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await Na(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},Da=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:w,y:b}=x;return{x:w,y:b}}},...u}=le(e,t),f={x:n,y:o},d=await i.detectOverflow(t,u),h=oe(ue(r)),m=un(h);let y=f[m],p=f[h];if(s){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=y+d[x],S=y-d[w];y=Kt(b,y,S)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=p+d[x],S=p-d[w];p=Kt(b,p,S)}const v=l.fn({...t,[m]:y,[h]:p});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[m]:s,[h]:a}}}}}},Ma=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=le(e,t),f={x:n,y:o},d=oe(r),h=un(d);let m=f[h],y=f[d];const p=le(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const b=h==="y"?"height":"width",S=i.reference[h]-i.floating[b]+v.mainAxis,C=i.reference[h]+i.reference[b]-v.mainAxis;mC&&(m=C)}if(u){var x,w;const b=h==="y"?"width":"height",S=Lo.has(ue(r)),C=i.reference[d]-i.floating[b]+(S&&((x=s.offset)==null?void 0:x[d])||0)+(S?0:v.crossAxis),R=i.reference[d]+i.reference[b]+(S?0:((w=s.offset)==null?void 0:w[d])||0)-(S?v.crossAxis:0);yR&&(y=R)}return{[h]:m,[d]:y}}}},La=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=le(e,t),f=await s.detectOverflow(t,u),d=ue(r),h=Fe(r),m=oe(r)==="y",{width:y,height:p}=i.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,v=h==="end"?"top":"bottom");const w=p-f.top-f.bottom,b=y-f.left-f.right,S=he(p-f[v],w),C=he(y-f[x],b),R=!t.middlewareData.shift;let E=S,P=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=w),R&&!h){const _=X(f.left,0),D=X(f.right,0),j=X(f.top,0),F=X(f.bottom,0);m?P=y-2*(_!==0||D!==0?_+D:X(f.left,f.right)):E=p-2*(j!==0||F!==0?j+F:X(f.top,f.bottom))}await l({...t,availableWidth:P,availableHeight:E});const M=await s.getDimensions(a.floating);return y!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}};function ht(){return typeof window<"u"}function ke(e){return jo(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ae(e){var t;return(t=(jo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jo(e){return ht()?e instanceof Node||e instanceof q(e).Node:!1}function J(e){return ht()?e instanceof Element||e instanceof q(e).Element:!1}function se(e){return ht()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Gn(e){return!ht()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const ja=new Set(["inline","contents"]);function Ke(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ja.has(r)}const Fa=new Set(["table","td","th"]);function ka(e){return Fa.has(ke(e))}const $a=[":popover-open",":modal"];function vt(e){return $a.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ba=["transform","translate","scale","rotate","perspective"],Wa=["transform","translate","scale","rotate","perspective","filter"],Va=["paint","layout","strict","content"];function pn(e){const t=mn(),n=J(e)?ee(e):e;return Ba.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Wa.some(o=>(n.willChange||"").includes(o))||Va.some(o=>(n.contain||"").includes(o))}function Ha(e){let t=ve(e);for(;se(t)&&!Me(t);){if(pn(t))return t;if(vt(t))return null;t=ve(t)}return null}function mn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ua=new Set(["html","body","#document"]);function Me(e){return Ua.has(ke(e))}function ee(e){return q(e).getComputedStyle(e)}function gt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ve(e){if(ke(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gn(e)&&e.host||ae(e);return Gn(t)?t.host:t}function Fo(e){const t=ve(e);return Me(t)?e.ownerDocument?e.ownerDocument.body:e.body:se(t)&&Ke(t)?t:Fo(t)}function He(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Fo(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=q(r);if(i){const a=Gt(s);return t.concat(s,s.visualViewport||[],Ke(r)?r:[],a&&n?He(a):[])}return t.concat(r,He(r,[],n))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ko(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=se(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=it(n)!==i||it(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function hn(e){return J(e)?e:e.contextElement}function De(e){const t=hn(e);if(!se(t))return ie(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=ko(t);let s=(i?it(n.width):n.width)/o,a=(i?it(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ka=ie(0);function $o(e){const t=q(e);return!mn()||!t.visualViewport?Ka:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function za(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function Re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=hn(e);let s=ie(1);t&&(o?J(o)&&(s=De(o)):s=De(e));const a=za(i,n,o)?$o(i):ie(0);let l=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,f=r.width/s.x,d=r.height/s.y;if(i){const h=q(i),m=o&&J(o)?q(o):o;let y=h,p=Gt(y);for(;p&&o&&m!==y;){const v=De(p),x=p.getBoundingClientRect(),w=ee(p),b=x.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,S=x.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,d*=v.y,l+=b,u+=S,y=q(p),p=Gt(y)}}return at({width:f,height:d,x:l,y:u})}function yt(e,t){const n=gt(e).scrollLeft;return t?t.left+n:Re(ae(e)).left+n}function Bo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-yt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ga(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=ae(o),a=t?vt(t.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=ie(1);const f=ie(0),d=se(o);if((d||!d&&!i)&&((ke(o)!=="body"||Ke(s))&&(l=gt(o)),se(o))){const m=Re(o);u=De(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const h=s&&!d&&!i?Bo(s,l):ie(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function Ya(e){return Array.from(e.getClientRects())}function Xa(e){const t=ae(e),n=gt(e),o=e.ownerDocument.body,r=X(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=X(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+yt(e);const a=-n.scrollTop;return ee(o).direction==="rtl"&&(s+=X(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const Yn=25;function qa(e,t){const n=q(e),o=ae(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const f=mn();(!f||f&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const u=yt(o);if(u<=0){const f=o.ownerDocument,d=f.body,h=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(o.clientWidth-d.clientWidth-m);y<=Yn&&(i-=y)}else u<=Yn&&(i+=u);return{width:i,height:s,x:a,y:l}}const Za=new Set(["absolute","fixed"]);function Qa(e,t){const n=Re(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=se(e)?De(e):ie(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=r*i.x,u=o*i.y;return{width:s,height:a,x:l,y:u}}function Xn(e,t,n){let o;if(t==="viewport")o=qa(e,n);else if(t==="document")o=Xa(ae(e));else if(J(t))o=Qa(t,n);else{const r=$o(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return at(o)}function Wo(e,t){const n=ve(e);return n===t||!J(n)||Me(n)?!1:ee(n).position==="fixed"||Wo(n,t)}function Ja(e,t){const n=t.get(e);if(n)return n;let o=He(e,[],!1).filter(a=>J(a)&&ke(a)!=="body"),r=null;const i=ee(e).position==="fixed";let s=i?ve(e):e;for(;J(s)&&!Me(s);){const a=ee(s),l=pn(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&Za.has(r.position)||Ke(s)&&!l&&Wo(e,s))?o=o.filter(f=>f!==s):r=a,s=ve(s)}return t.set(e,o),o}function ec(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?vt(t)?[]:Ja(t,this._c):[].concat(n),o],a=s[0],l=s.reduce((u,f)=>{const d=Xn(t,f,r);return u.top=X(d.top,u.top),u.right=he(d.right,u.right),u.bottom=he(d.bottom,u.bottom),u.left=X(d.left,u.left),u},Xn(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tc(e){const{width:t,height:n}=ko(e);return{width:t,height:n}}function nc(e,t,n){const o=se(t),r=ae(t),i=n==="fixed",s=Re(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ie(0);function u(){l.x=yt(r)}if(o||!o&&!i)if((ke(t)!=="body"||Ke(r))&&(a=gt(t)),o){const m=Re(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?Bo(r,a):ie(0),d=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:d,y:h,width:s.width,height:s.height}}function kt(e){return ee(e).position==="static"}function qn(e,t){if(!se(e)||ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ae(e)===n&&(n=n.ownerDocument.body),n}function Vo(e,t){const n=q(e);if(vt(e))return n;if(!se(e)){let r=ve(e);for(;r&&!Me(r);){if(J(r)&&!kt(r))return r;r=ve(r)}return n}let o=qn(e,t);for(;o&&ka(o)&&kt(o);)o=qn(o,t);return o&&Me(o)&&kt(o)&&!pn(o)?n:o||Ha(e)||n}const oc=async function(e){const t=this.getOffsetParent||Vo,n=this.getDimensions,o=await n(e.floating);return{reference:nc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rc(e){return ee(e).direction==="rtl"}const ic={convertOffsetParentRelativeRectToViewportRelativeRect:Ga,getDocumentElement:ae,getClippingRect:ec,getOffsetParent:Vo,getElementRects:oc,getClientRects:Ya,getDimensions:tc,getScale:De,isElement:J,isRTL:rc};function Ho(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sc(e,t){let n=null,o;const r=ae(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:f,top:d,width:h,height:m}=u;if(a||t(),!h||!m)return;const y=Je(d),p=Je(r.clientWidth-(f+h)),v=Je(r.clientHeight-(d+m)),x=Je(f),b={rootMargin:-y+"px "+-p+"px "+-v+"px "+-x+"px",threshold:X(0,he(1,l))||1};let S=!0;function C(R){const E=R[0].intersectionRatio;if(E!==l){if(!S)return s();E?s(!1,E):o=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!Ho(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(e)}return s(!0),i}function ac(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=hn(e),f=r||i?[...u?He(u):[],...He(t)]:[];f.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const d=u&&a?sc(u,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let y,p=l?Re(e):null;l&&v();function v(){const x=Re(e);p&&!Ho(p,x)&&n(),p=x,y=requestAnimationFrame(v)}return n(),()=>{var x;f.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(y)}}const cc=_a,lc=Da,uc=Ia,fc=La,dc=Oa,Zn=Aa,pc=Ma,mc=(e,t,n)=>{const o=new Map,r={platform:ic,...n},i={...r.platform,_c:o};return Ta(e,t,{...r,platform:i})};var hc=typeof document<"u",vc=function(){},nt=hc?c.useLayoutEffect:vc;function ct(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!ct(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!ct(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Uo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qn(e,t){const n=Uo(e);return Math.round(t*n)/n}function $t(e){const t=c.useRef(e);return nt(()=>{t.current=e}),t}function gc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=c.useState(o);ct(h,o)||m(o);const[y,p]=c.useState(null),[v,x]=c.useState(null),w=c.useCallback(A=>{A!==R.current&&(R.current=A,p(A))},[]),b=c.useCallback(A=>{A!==E.current&&(E.current=A,x(A))},[]),S=i||y,C=s||v,R=c.useRef(null),E=c.useRef(null),P=c.useRef(f),M=l!=null,_=$t(l),D=$t(r),j=$t(u),F=c.useCallback(()=>{if(!R.current||!E.current)return;const A={placement:t,strategy:n,middleware:h};D.current&&(A.platform=D.current),mc(R.current,E.current,A).then(W=>{const Y={...W,isPositioned:j.current!==!1};L.current&&!ct(P.current,Y)&&(P.current=Y,ut.flushSync(()=>{d(Y)}))})},[h,t,n,D,j]);nt(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[u]);const L=c.useRef(!1);nt(()=>(L.current=!0,()=>{L.current=!1}),[]),nt(()=>{if(S&&(R.current=S),C&&(E.current=C),S&&C){if(_.current)return _.current(S,C,F);F()}},[S,C,F,_,M]);const B=c.useMemo(()=>({reference:R,floating:E,setReference:w,setFloating:b}),[w,b]),I=c.useMemo(()=>({reference:S,floating:C}),[S,C]),k=c.useMemo(()=>{const A={position:n,left:0,top:0};if(!I.floating)return A;const W=Qn(I.floating,f.x),Y=Qn(I.floating,f.y);return a?{...A,transform:"translate("+W+"px, "+Y+"px)",...Uo(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:Y}},[n,a,I.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:F,refs:B,elements:I,floatingStyles:k}),[f,F,B,I,k])}const yc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Zn({element:o.current,padding:r}).fn(n):{}:o?Zn({element:o,padding:r}).fn(n):{}}}},wc=(e,t)=>({...cc(e),options:[e,t]}),xc=(e,t)=>({...lc(e),options:[e,t]}),bc=(e,t)=>({...pc(e),options:[e,t]}),Sc=(e,t)=>({...uc(e),options:[e,t]}),Cc=(e,t)=>({...fc(e),options:[e,t]}),Ec=(e,t)=>({...dc(e),options:[e,t]}),Rc=(e,t)=>({...yc(e),options:[e,t]});var Pc="Arrow",Ko=c.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return g.jsx(N.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ko.displayName=Pc;var Tc=Ko;function zo(e){const[t,n]=c.useState(void 0);return z(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var vn="Popper",[Go,wt]=fe(vn),[Ac,Yo]=Go(vn),Xo=e=>{const{__scopePopper:t,children:n}=e,[o,r]=c.useState(null);return g.jsx(Ac,{scope:t,anchor:o,onAnchorChange:r,children:n})};Xo.displayName=vn;var qo="PopperAnchor",Zo=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Yo(qo,n),s=c.useRef(null),a=$(t,s),l=c.useRef(null);return c.useEffect(()=>{const u=l.current;l.current=o?.current||s.current,u!==l.current&&i.onAnchorChange(l.current)}),o?null:g.jsx(N.div,{...r,ref:a})});Zo.displayName=qo;var gn="PopperContent",[Ic,Oc]=Go(gn),Qo=c.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...p}=e,v=Yo(gn,n),[x,w]=c.useState(null),b=$(t,T=>w(T)),[S,C]=c.useState(null),R=zo(S),E=R?.width??0,P=R?.height??0,M=o+(i!=="center"?"-"+i:""),_=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(u)?u:[u],j=D.length>0,F={padding:_,boundary:D.filter(_c),altBoundary:j},{refs:L,floatingStyles:B,placement:I,isPositioned:k,middlewareData:A}=gc({strategy:"fixed",placement:M,whileElementsMounted:(...T)=>ac(...T,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[wc({mainAxis:r+P,alignmentAxis:s}),l&&xc({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?bc():void 0,...F}),l&&Sc({...F}),Cc({...F,apply:({elements:T,rects:U,availableWidth:G,availableHeight:V})=>{const{width:H,height:K}=U.reference,Z=T.floating.style;Z.setProperty("--radix-popper-available-width",`${G}px`),Z.setProperty("--radix-popper-available-height",`${V}px`),Z.setProperty("--radix-popper-anchor-width",`${H}px`),Z.setProperty("--radix-popper-anchor-height",`${K}px`)}}),S&&Rc({element:S,padding:a}),Dc({arrowWidth:E,arrowHeight:P}),h&&Ec({strategy:"referenceHidden",...F})]}),[W,Y]=tr(I),xe=ce(y);z(()=>{k&&xe?.()},[k,xe]);const Be=A.arrow?.x,We=A.arrow?.y,de=A.arrow?.centerOffset!==0,[Ae,be]=c.useState();return z(()=>{x&&be(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:k?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ae,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Ic,{scope:n,placedSide:W,onArrowChange:C,arrowX:Be,arrowY:We,shouldHideArrow:de,children:g.jsx(N.div,{"data-side":W,"data-align":Y,...p,ref:b,style:{...p.style,animation:k?void 0:"none"}})})})});Qo.displayName=gn;var Jo="PopperArrow",Nc={top:"bottom",right:"left",bottom:"top",left:"right"},er=c.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=Oc(Jo,o),s=Nc[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(Tc,{...r,ref:n,style:{...r.style,display:"block"}})})});er.displayName=Jo;function _c(e){return e!==null}var Dc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,f]=tr(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(r.arrow?.x??0)+a/2,m=(r.arrow?.y??0)+l/2;let y="",p="";return u==="bottom"?(y=s?d:`${h}px`,p=`${-l}px`):u==="top"?(y=s?d:`${h}px`,p=`${o.floating.height+l}px`):u==="right"?(y=`${-l}px`,p=s?d:`${m}px`):u==="left"&&(y=`${o.floating.width+l}px`,p=s?d:`${m}px`),{data:{x:y,y:p}}}});function tr(e){const[t,n="center"]=e.split("-");return[t,n]}var nr=Xo,or=Zo,rr=Qo,ir=er;function Mc(e){const t=Lc(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(Fc);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Lc(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=$c(r),a=kc(i,r.props);return r.type!==c.Fragment&&(a.ref=o?je(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jc=Symbol("radix.slottable");function Fc(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jc}function kc(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function $c(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function sr(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ar=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Bc="VisuallyHidden",cr=c.forwardRef((e,t)=>g.jsx(N.span,{...e,ref:t,style:{...ar,...e.style}}));cr.displayName=Bc;var Wc=cr,Vc=[" ","Enter","ArrowUp","ArrowDown"],Hc=[" ","Enter"],Pe="Select",[xt,bt,Uc]=Do(Pe),[$e]=fe(Pe,[Uc,wt]),St=wt(),[Kc,ye]=$e(Pe),[zc,Gc]=$e(Pe),lr=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:h,required:m,form:y}=e,p=St(t),[v,x]=c.useState(null),[w,b]=c.useState(null),[S,C]=c.useState(!1),R=ln(u),[E,P]=me({prop:o,defaultProp:r??!1,onChange:i,caller:Pe}),[M,_]=me({prop:s,defaultProp:a,onChange:l,caller:Pe}),D=c.useRef(null),j=v?y||!!v.closest("form"):!0,[F,L]=c.useState(new Set),B=Array.from(F).map(I=>I.props.value).join(";");return g.jsx(nr,{...p,children:g.jsxs(Kc,{required:m,scope:t,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:re(),value:M,onValueChange:_,open:E,onOpenChange:P,dir:R,triggerPointerDownPosRef:D,disabled:h,children:[g.jsx(xt.Provider,{scope:t,children:g.jsx(zc,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(I=>{L(k=>new Set(k).add(I))},[]),onNativeOptionRemove:c.useCallback(I=>{L(k=>{const A=new Set(k);return A.delete(I),A})},[]),children:n})}),j?g.jsxs(Nr,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:M,onChange:I=>_(I.target.value),disabled:h,form:y,children:[M===void 0?g.jsx("option",{value:""}):null,Array.from(F)]},B):null]})})};lr.displayName=Pe;var ur="SelectTrigger",fr=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=St(n),s=ye(ur,n),a=s.disabled||o,l=$(t,s.onTriggerChange),u=bt(n),f=c.useRef("touch"),[d,h,m]=Dr(p=>{const v=u().filter(b=>!b.disabled),x=v.find(b=>b.value===s.value),w=Mr(v,p,x);w!==void 0&&s.onValueChange(w.value)}),y=p=>{a||(s.onOpenChange(!0),m()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return g.jsx(or,{asChild:!0,...i,children:g.jsx(N.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":_r(s.value)?"":void 0,...r,ref:l,onClick:O(r.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&y(p)}),onPointerDown:O(r.onPointerDown,p=>{f.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:O(r.onKeyDown,p=>{const v=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(v&&p.key===" ")&&Vc.includes(p.key)&&(y(),p.preventDefault())})})})});fr.displayName=ur;var dr="SelectValue",pr=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:s="",...a}=e,l=ye(dr,n),{onValueNodeHasChildrenChange:u}=l,f=i!==void 0,d=$(t,l.onValueNodeChange);return z(()=>{u(f)},[u,f]),g.jsx(N.span,{...a,ref:d,style:{pointerEvents:"none"},children:_r(l.value)?g.jsx(g.Fragment,{children:s}):i})});pr.displayName=dr;var Yc="SelectIcon",mr=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return g.jsx(N.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});mr.displayName=Yc;var Xc="SelectPortal",hr=e=>g.jsx(dt,{asChild:!0,...e});hr.displayName=Xc;var Te="SelectContent",vr=c.forwardRef((e,t)=>{const n=ye(Te,e.__scopeSelect),[o,r]=c.useState();if(z(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?ut.createPortal(g.jsx(gr,{scope:e.__scopeSelect,children:g.jsx(xt.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(yr,{...e,ref:t})});vr.displayName=Te;var Q=10,[gr,we]=$e(Te),qc="SelectContentImpl",Zc=Mc("SelectContent.RemoveScroll"),yr=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:v,...x}=e,w=ye(Te,n),[b,S]=c.useState(null),[C,R]=c.useState(null),E=$(t,T=>S(T)),[P,M]=c.useState(null),[_,D]=c.useState(null),j=bt(n),[F,L]=c.useState(!1),B=c.useRef(!1);c.useEffect(()=>{if(b)return go(b)},[b]),ao();const I=c.useCallback(T=>{const[U,...G]=j().map(K=>K.ref.current),[V]=G.slice(-1),H=document.activeElement;for(const K of T)if(K===H||(K?.scrollIntoView({block:"nearest"}),K===U&&C&&(C.scrollTop=0),K===V&&C&&(C.scrollTop=C.scrollHeight),K?.focus(),document.activeElement!==H))return},[j,C]),k=c.useCallback(()=>I([P,b]),[I,P,b]);c.useEffect(()=>{F&&k()},[F,k]);const{onOpenChange:A,triggerPointerDownPosRef:W}=w;c.useEffect(()=>{if(b){let T={x:0,y:0};const U=V=>{T={x:Math.abs(Math.round(V.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(W.current?.y??0))}},G=V=>{T.x<=10&&T.y<=10?V.preventDefault():b.contains(V.target)||A(!1),document.removeEventListener("pointermove",U),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",G,{capture:!0})}}},[b,A,W]),c.useEffect(()=>{const T=()=>A(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[A]);const[Y,xe]=Dr(T=>{const U=j().filter(H=>!H.disabled),G=U.find(H=>H.ref.current===document.activeElement),V=Mr(U,T,G);V&&setTimeout(()=>V.ref.current.focus())}),Be=c.useCallback((T,U,G)=>{const V=!B.current&&!G;(w.value!==void 0&&w.value===U||V)&&(M(T),V&&(B.current=!0))},[w.value]),We=c.useCallback(()=>b?.focus(),[b]),de=c.useCallback((T,U,G)=>{const V=!B.current&&!G;(w.value!==void 0&&w.value===U||V)&&D(T)},[w.value]),Ae=o==="popper"?Yt:wr,be=Ae===Yt?{side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:v}:{};return g.jsx(gr,{scope:n,content:b,viewport:C,onViewportChange:R,itemRefCallback:Be,selectedItem:P,onItemLeave:We,itemTextRefCallback:de,focusSelectedItem:k,selectedItemText:_,position:o,isPositioned:F,searchRef:Y,children:g.jsx(rn,{as:Zc,allowPinchZoom:!0,children:g.jsx(on,{asChild:!0,trapped:w.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:O(r,T=>{w.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:g.jsx(ft,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:g.jsx(Ae,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:T=>T.preventDefault(),...x,...be,onPlaced:()=>L(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:O(x.onKeyDown,T=>{const U=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!U&&T.key.length===1&&xe(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let V=j().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(T.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const H=T.target,K=V.indexOf(H);V=V.slice(K+1)}setTimeout(()=>I(V)),T.preventDefault()}})})})})})})});yr.displayName=qc;var Qc="SelectItemAlignedPosition",wr=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=ye(Te,n),s=we(Te,n),[a,l]=c.useState(null),[u,f]=c.useState(null),d=$(t,E=>f(E)),h=bt(n),m=c.useRef(!1),y=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:x,focusSelectedItem:w}=s,b=c.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&p&&v&&x){const E=i.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),_=x.getBoundingClientRect();if(i.dir!=="rtl"){const H=_.left-P.left,K=M.left-H,Z=E.left-K,Se=E.width+Z,At=Math.max(Se,P.width),It=window.innerWidth-Q,Ot=Bn(K,[Q,Math.max(Q,It-At)]);a.style.minWidth=Se+"px",a.style.left=Ot+"px"}else{const H=P.right-_.right,K=window.innerWidth-M.right-H,Z=window.innerWidth-E.right-K,Se=E.width+Z,At=Math.max(Se,P.width),It=window.innerWidth-Q,Ot=Bn(K,[Q,Math.max(Q,It-At)]);a.style.minWidth=Se+"px",a.style.right=Ot+"px"}const D=h(),j=window.innerHeight-Q*2,F=p.scrollHeight,L=window.getComputedStyle(u),B=parseInt(L.borderTopWidth,10),I=parseInt(L.paddingTop,10),k=parseInt(L.borderBottomWidth,10),A=parseInt(L.paddingBottom,10),W=B+I+F+A+k,Y=Math.min(v.offsetHeight*5,W),xe=window.getComputedStyle(p),Be=parseInt(xe.paddingTop,10),We=parseInt(xe.paddingBottom,10),de=E.top+E.height/2-Q,Ae=j-de,be=v.offsetHeight/2,T=v.offsetTop+be,U=B+I+T,G=W-U;if(U<=de){const H=D.length>0&&v===D[D.length-1].ref.current;a.style.bottom="0px";const K=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(Ae,be+(H?We:0)+K+k),Se=U+Z;a.style.height=Se+"px"}else{const H=D.length>0&&v===D[0].ref.current;a.style.top="0px";const Z=Math.max(de,B+p.offsetTop+(H?Be:0)+be)+G;a.style.height=Z+"px",p.scrollTop=U-de+p.offsetTop}a.style.margin=`${Q}px 0`,a.style.minHeight=Y+"px",a.style.maxHeight=j+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,a,u,p,v,x,i.dir,o]);z(()=>b(),[b]);const[S,C]=c.useState();z(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const R=c.useCallback(E=>{E&&y.current===!0&&(b(),w?.(),y.current=!1)},[b,w]);return g.jsx(el,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:R,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:g.jsx(N.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});wr.displayName=Qc;var Jc="SelectPopperPosition",Yt=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Q,...i}=e,s=St(n);return g.jsx(rr,{...s,...i,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Yt.displayName=Jc;var[el,yn]=$e(Te,{}),Xt="SelectViewport",xr=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,i=we(Xt,n),s=yn(Xt,n),a=$(t,i.onViewportChange),l=c.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(xt.Slot,{scope:n,children:g.jsx(N.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:O(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=s;if(h?.current&&d){const m=Math.abs(l.current-f.scrollTop);if(m>0){const y=window.innerHeight-Q*2,p=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),x=Math.max(p,v);if(x0?S:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});xr.displayName=Xt;var br="SelectGroup",[tl,nl]=$e(br),ol=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=re();return g.jsx(tl,{scope:n,id:r,children:g.jsx(N.div,{role:"group","aria-labelledby":r,...o,ref:t})})});ol.displayName=br;var Sr="SelectLabel",rl=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=nl(Sr,n);return g.jsx(N.div,{id:r.id,...o,ref:t})});rl.displayName=Sr;var lt="SelectItem",[il,Cr]=$e(lt),Er=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...s}=e,a=ye(lt,n),l=we(lt,n),u=a.value===o,[f,d]=c.useState(i??""),[h,m]=c.useState(!1),y=$(t,w=>l.itemRefCallback?.(w,o,r)),p=re(),v=c.useRef("touch"),x=()=>{r||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(il,{scope:n,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(w=>{d(b=>b||(w?.textContent??"").trim())},[]),children:g.jsx(xt.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:g.jsx(N.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:y,onFocus:O(s.onFocus,()=>m(!0)),onBlur:O(s.onBlur,()=>m(!1)),onClick:O(s.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:O(s.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:O(s.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:O(s.onPointerMove,w=>{v.current=w.pointerType,r?l.onItemLeave?.():v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:O(s.onPointerLeave,w=>{w.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:O(s.onKeyDown,w=>{l.searchRef?.current!==""&&w.key===" "||(Hc.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});Er.displayName=lt;var Ve="SelectItemText",Rr=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,s=ye(Ve,n),a=we(Ve,n),l=Cr(Ve,n),u=Gc(Ve,n),[f,d]=c.useState(null),h=$(t,x=>d(x),l.onItemTextChange,x=>a.itemTextRefCallback?.(x,l.value,l.disabled)),m=f?.textContent,y=c.useMemo(()=>g.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return z(()=>(p(y),()=>v(y)),[p,v,y]),g.jsxs(g.Fragment,{children:[g.jsx(N.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ut.createPortal(i.children,s.valueNode):null]})});Rr.displayName=Ve;var Pr="SelectItemIndicator",Tr=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Cr(Pr,n).isSelected?g.jsx(N.span,{"aria-hidden":!0,...o,ref:t}):null});Tr.displayName=Pr;var qt="SelectScrollUpButton",Ar=c.forwardRef((e,t)=>{const n=we(qt,e.__scopeSelect),o=yn(qt,e.__scopeSelect),[r,i]=c.useState(!1),s=$(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?g.jsx(Or,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Ar.displayName=qt;var Zt="SelectScrollDownButton",Ir=c.forwardRef((e,t)=>{const n=we(Zt,e.__scopeSelect),o=yn(Zt,e.__scopeSelect),[r,i]=c.useState(!1),s=$(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?g.jsx(Or,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Ir.displayName=Zt;var Or=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=we("SelectScrollButton",n),s=c.useRef(null),a=bt(n),l=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),z(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),g.jsx(N.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:O(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:O(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:O(r.onPointerLeave,()=>{l()})})}),sl="SelectSeparator",al=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return g.jsx(N.div,{"aria-hidden":!0,...o,ref:t})});al.displayName=sl;var Qt="SelectArrow",cl=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=St(n),i=ye(Qt,n),s=we(Qt,n);return i.open&&s.position==="popper"?g.jsx(ir,{...r,...o,ref:t}):null});cl.displayName=Qt;var ll="SelectBubbleInput",Nr=c.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=c.useRef(null),i=$(o,r),s=sr(t);return c.useEffect(()=>{const a=r.current;if(!a)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&f){const d=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(d)}},[s,t]),g.jsx(N.select,{...n,style:{...ar,...n.style},ref:i,defaultValue:t})});Nr.displayName=ll;function _r(e){return e===""||e===void 0}function Dr(e){const t=ce(e),n=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const a=n.current+s;t(a),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=c.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function Mr(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=ul(e,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function ul(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var yu=lr,wu=fr,xu=pr,bu=mr,Su=hr,Cu=vr,Eu=xr,Ru=Er,Pu=Rr,Tu=Tr,Au=Ar,Iu=Ir;function fl(e,t=[]){let n=[];function o(i,s){const a=c.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const u=d=>{const{scope:h,children:m,...y}=d,p=h?.[e]?.[l]||a,v=c.useMemo(()=>y,Object.values(y));return g.jsx(p.Provider,{value:v,children:m})};u.displayName=i+"Provider";function f(d,h){const m=h?.[e]?.[l]||a,y=c.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const r=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=a?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return r.scopeName=e,[o,dl(r,...t)]}function dl(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var pl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wn=pl.reduce((e,t)=>{const n=oo(`Primitive.${t}`),o=c.forwardRef((r,i)=>{const{asChild:s,...a}=r,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Bt={exports:{}},Wt={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jn;function ml(){if(Jn)return Wt;Jn=1;var e=xi();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,h){var m=h(),y=o({inst:{value:m,getSnapshot:h}}),p=y[0].inst,v=y[1];return i(function(){p.value=m,p.getSnapshot=h,l(p)&&v({inst:p})},[d,m,h]),r(function(){return l(p)&&v({inst:p}),d(function(){l(p)&&v({inst:p})})},[d]),s(m),m}function l(d){var h=d.getSnapshot;d=d.value;try{var m=h();return!n(d,m)}catch{return!0}}function u(d,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Wt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Wt}var eo;function hl(){return eo||(eo=1,Bt.exports=ml()),Bt.exports}var vl=hl();function gl(){return vl.useSyncExternalStore(yl,()=>!0,()=>!1)}function yl(){return()=>{}}var xn="Avatar",[wl]=fl(xn),[xl,Lr]=wl(xn),jr=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[r,i]=c.useState("idle");return g.jsx(xl,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:i,children:g.jsx(wn.span,{...o,ref:t})})});jr.displayName=xn;var Fr="AvatarImage",kr=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:r=()=>{},...i}=e,s=Lr(Fr,n),a=bl(o,i),l=ce(u=>{r(u),s.onImageLoadingStatusChange(u)});return z(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.jsx(wn.img,{...i,ref:t,src:o}):null});kr.displayName=Fr;var $r="AvatarFallback",Br=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...r}=e,i=Lr($r,n),[s,a]=c.useState(o===void 0);return c.useEffect(()=>{if(o!==void 0){const l=window.setTimeout(()=>a(!0),o);return()=>window.clearTimeout(l)}},[o]),s&&i.imageLoadingStatus!=="loaded"?g.jsx(wn.span,{...r,ref:t}):null});Br.displayName=$r;function to(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function bl(e,{referrerPolicy:t,crossOrigin:n}){const o=gl(),r=c.useRef(null),i=o?(r.current||(r.current=new window.Image),r.current):null,[s,a]=c.useState(()=>to(i,e));return z(()=>{a(to(i,e))},[i,e]),z(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),f=l("error");return i.addEventListener("load",u),i.addEventListener("error",f),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",f)}},[i,n,t]),s}var Ou=jr,Nu=kr,_u=Br,Sl=Symbol("radix.slottable");function Cl(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Sl,t}var[Ct]=fe("Tooltip",[wt]),Et=wt(),Wr="TooltipProvider",El=700,Jt="tooltip.open",[Rl,bn]=Ct(Wr),Vr=e=>{const{__scopeTooltip:t,delayDuration:n=El,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,s=c.useRef(!0),a=c.useRef(!1),l=c.useRef(0);return c.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(Rl,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:c.useCallback(u=>{a.current=u},[]),disableHoverableContent:r,children:i})};Vr.displayName=Wr;var Ue="Tooltip",[Pl,ze]=Ct(Ue),Hr=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=bn(Ue,e.__scopeTooltip),u=Et(t),[f,d]=c.useState(null),h=re(),m=c.useRef(0),y=s??l.disableHoverableContent,p=a??l.delayDuration,v=c.useRef(!1),[x,w]=me({prop:o,defaultProp:r??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(Jt))):l.onClose(),i?.(E)},caller:Ue}),b=c.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,w(!0)},[w]),C=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),R=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,w(!0),m.current=0},p)},[p,w]);return c.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),g.jsx(nr,{...u,children:g.jsx(Pl,{scope:t,contentId:h,open:x,stateAttribute:b,trigger:f,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?R():S()},[l.isOpenDelayedRef,R,S]),onTriggerLeave:c.useCallback(()=>{y?C():(window.clearTimeout(m.current),m.current=0)},[C,y]),onOpen:S,onClose:C,disableHoverableContent:y,children:n})})};Hr.displayName=Ue;var en="TooltipTrigger",Ur=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=ze(en,n),i=bn(en,n),s=Et(n),a=c.useRef(null),l=$(t,a,r.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),d=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(or,{asChild:!0,...s,children:g.jsx(N.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:O(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:O(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:O(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:O(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:O(e.onBlur,r.onClose),onClick:O(e.onClick,r.onClose)})})});Ur.displayName=en;var Sn="TooltipPortal",[Tl,Al]=Ct(Sn,{forceMount:void 0}),Kr=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=ze(Sn,t);return g.jsx(Tl,{scope:t,forceMount:n,children:g.jsx(ge,{present:n||i.open,children:g.jsx(dt,{asChild:!0,container:r,children:o})})})};Kr.displayName=Sn;var Le="TooltipContent",zr=c.forwardRef((e,t)=>{const n=Al(Le,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=ze(Le,e.__scopeTooltip);return g.jsx(ge,{present:o||s.open,children:s.disableHoverableContent?g.jsx(Gr,{side:r,...i,ref:t}):g.jsx(Il,{side:r,...i,ref:t})})}),Il=c.forwardRef((e,t)=>{const n=ze(Le,e.__scopeTooltip),o=bn(Le,e.__scopeTooltip),r=c.useRef(null),i=$(t,r),[s,a]=c.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:d}=o,h=c.useCallback(()=>{a(null),d(!1)},[d]),m=c.useCallback((y,p)=>{const v=y.currentTarget,x={x:y.clientX,y:y.clientY},w=Dl(x,v.getBoundingClientRect()),b=Ml(x,w),S=Ll(p.getBoundingClientRect()),C=Fl([...b,...S]);a(C),d(!0)},[d]);return c.useEffect(()=>()=>h(),[h]),c.useEffect(()=>{if(l&&f){const y=v=>m(v,f),p=v=>m(v,l);return l.addEventListener("pointerleave",y),f.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",p)}}},[l,f,m,h]),c.useEffect(()=>{if(s){const y=p=>{const v=p.target,x={x:p.clientX,y:p.clientY},w=l?.contains(v)||f?.contains(v),b=!jl(x,s);w?h():b&&(h(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,f,s,u,h]),g.jsx(Gr,{...e,ref:i})}),[Ol,Nl]=Ct(Ue,{isInside:!1}),_l=Cl("TooltipContent"),Gr=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=ze(Le,n),u=Et(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(Jt,f),()=>document.removeEventListener(Jt,f)),[f]),c.useEffect(()=>{if(l.trigger){const d=h=>{h.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),g.jsx(ft,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:g.jsxs(rr,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(_l,{children:o}),g.jsx(Ol,{scope:n,isInside:!0,children:g.jsx(Wc,{id:l.contentId,role:"tooltip",children:r||o})})]})})});zr.displayName=Le;var Yr="TooltipArrow",Xr=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Et(n);return Nl(Yr,n).isInside?null:g.jsx(ir,{...r,...o,ref:t})});Xr.displayName=Yr;function Dl(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Ml(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Ll(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function jl(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;io!=h>o&&n<(d-u)*(o-f)/(h-f)+u&&(r=!r)}return r}function Fl(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),kl(t)}function kl(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Du=Vr,Mu=Hr,Lu=Ur,ju=Kr,Fu=zr,ku=Xr,Vt="rovingFocusGroup.onEntryFocus",$l={bubbles:!1,cancelable:!0},Ge="RovingFocusGroup",[tn,qr,Bl]=Do(Ge),[Wl,Zr]=fe(Ge,[Bl]),[Vl,Hl]=Wl(Ge),Qr=c.forwardRef((e,t)=>g.jsx(tn.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(tn.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Ul,{...e,ref:t})})}));Qr.displayName=Ge;var Ul=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,h=c.useRef(null),m=$(t,h),y=ln(i),[p,v]=me({prop:s,defaultProp:a??null,onChange:l,caller:Ge}),[x,w]=c.useState(!1),b=ce(u),S=qr(n),C=c.useRef(!1),[R,E]=c.useState(0);return c.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Vt,b),()=>P.removeEventListener(Vt,b)},[b]),g.jsx(Vl,{scope:n,orientation:o,dir:y,loop:r,currentTabStopId:p,onItemFocus:c.useCallback(P=>v(P),[v]),onItemShiftTab:c.useCallback(()=>w(!0),[]),onFocusableItemAdd:c.useCallback(()=>E(P=>P+1),[]),onFocusableItemRemove:c.useCallback(()=>E(P=>P-1),[]),children:g.jsx(N.div,{tabIndex:x||R===0?-1:0,"data-orientation":o,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:O(e.onMouseDown,()=>{C.current=!0}),onFocus:O(e.onFocus,P=>{const M=!C.current;if(P.target===P.currentTarget&&M&&!x){const _=new CustomEvent(Vt,$l);if(P.currentTarget.dispatchEvent(_),!_.defaultPrevented){const D=S().filter(I=>I.focusable),j=D.find(I=>I.active),F=D.find(I=>I.id===p),B=[j,F,...D].filter(Boolean).map(I=>I.ref.current);ti(B,f)}}C.current=!1}),onBlur:O(e.onBlur,()=>w(!1))})})}),Jr="RovingFocusGroupItem",ei=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:s,...a}=e,l=re(),u=i||l,f=Hl(Jr,n),d=f.currentTabStopId===u,h=qr(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:p}=f;return c.useEffect(()=>{if(o)return m(),()=>y()},[o,m,y]),g.jsx(tn.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:g.jsx(N.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:O(e.onMouseDown,v=>{o?f.onItemFocus(u):v.preventDefault()}),onFocus:O(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:O(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=Gl(v,f.orientation,f.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=h().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const S=b.indexOf(v.currentTarget);b=f.loop?Yl(b,S+1):b.slice(S+1)}setTimeout(()=>ti(b))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:p!=null}):s})})});ei.displayName=Jr;var Kl={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zl(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Gl(e,t,n){const o=zl(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Kl[o]}function ti(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Yl(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Xl=Qr,ql=ei,Rt="Tabs",[Zl]=fe(Rt,[Zr]),ni=Zr(),[Ql,Cn]=Zl(Rt),oi=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,f=ln(a),[d,h]=me({prop:o,onChange:r,defaultProp:i??"",caller:Rt});return g.jsx(Ql,{scope:n,baseId:re(),value:d,onValueChange:h,orientation:s,dir:f,activationMode:l,children:g.jsx(N.div,{dir:f,"data-orientation":s,...u,ref:t})})});oi.displayName=Rt;var ri="TabsList",ii=c.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,i=Cn(ri,n),s=ni(n);return g.jsx(Xl,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:o,children:g.jsx(N.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});ii.displayName=ri;var si="TabsTrigger",ai=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...i}=e,s=Cn(si,n),a=ni(n),l=ui(s.baseId,o),u=fi(s.baseId,o),f=o===s.value;return g.jsx(ql,{asChild:!0,...a,focusable:!r,active:f,children:g.jsx(N.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...i,ref:t,onMouseDown:O(e.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?s.onValueChange(o):d.preventDefault()}),onKeyDown:O(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(o)}),onFocus:O(e.onFocus,()=>{const d=s.activationMode!=="manual";!f&&!r&&d&&s.onValueChange(o)})})})});ai.displayName=si;var ci="TabsContent",li=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:i,...s}=e,a=Cn(ci,n),l=ui(a.baseId,o),u=fi(a.baseId,o),f=o===a.value,d=c.useRef(f);return c.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),g.jsx(ge,{present:r||f,children:({present:h})=>g.jsx(N.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&i})})});li.displayName=ci;function ui(e,t){return`${e}-trigger-${t}`}function fi(e,t){return`${e}-content-${t}`}var $u=oi,Bu=ii,Wu=ai,Vu=li,Pt="Collapsible",[Jl]=fe(Pt),[eu,En]=Jl(Pt),di=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:i,onOpenChange:s,...a}=e,[l,u]=me({prop:o,defaultProp:r??!1,onChange:s,caller:Pt});return g.jsx(eu,{scope:n,disabled:i,contentId:re(),open:l,onOpenToggle:c.useCallback(()=>u(f=>!f),[u]),children:g.jsx(N.div,{"data-state":Pn(l),"data-disabled":i?"":void 0,...a,ref:t})})});di.displayName=Pt;var pi="CollapsibleTrigger",tu=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=En(pi,n);return g.jsx(N.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Pn(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:O(e.onClick,r.onOpenToggle)})});tu.displayName=pi;var Rn="CollapsibleContent",nu=c.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=En(Rn,e.__scopeCollapsible);return g.jsx(ge,{present:n||r.open,children:({present:i})=>g.jsx(ou,{...o,ref:t,present:i})})});nu.displayName=Rn;var ou=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...i}=e,s=En(Rn,n),[a,l]=c.useState(o),u=c.useRef(null),f=$(t,u),d=c.useRef(0),h=d.current,m=c.useRef(0),y=m.current,p=s.open||a,v=c.useRef(p),x=c.useRef(void 0);return c.useEffect(()=>{const w=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(w)},[]),z(()=>{const w=u.current;if(w){x.current=x.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const b=w.getBoundingClientRect();d.current=b.height,m.current=b.width,v.current||(w.style.transitionDuration=x.current.transitionDuration,w.style.animationName=x.current.animationName),l(o)}},[s.open,o]),g.jsx(N.div,{"data-state":Pn(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...i,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:p&&r})});function Pn(e){return e?"open":"closed"}var Hu=di,Tt="Switch",[ru]=fe(Tt),[iu,su]=ru(Tt),mi=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,form:f,...d}=e,[h,m]=c.useState(null),y=$(t,b=>m(b)),p=c.useRef(!1),v=h?f||!!h.closest("form"):!0,[x,w]=me({prop:r,defaultProp:i??!1,onChange:u,caller:Tt});return g.jsxs(iu,{scope:n,checked:x,disabled:a,children:[g.jsx(N.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":yi(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:y,onClick:O(e.onClick,b=>{w(S=>!S),v&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})}),v&&g.jsx(gi,{control:h,bubbles:!p.current,name:o,value:l,checked:x,required:s,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});mi.displayName=Tt;var hi="SwitchThumb",vi=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=su(hi,n);return g.jsx(N.span,{"data-state":yi(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});vi.displayName=hi;var au="SwitchBubbleInput",gi=c.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},i)=>{const s=c.useRef(null),a=$(s,i),l=sr(n),u=zo(t);return c.useEffect(()=>{const f=s.current;if(!f)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&m){const y=new Event("click",{bubbles:o});m.call(f,n),f.dispatchEvent(y)}},[l,n,o]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:a,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});gi.displayName=au;function yi(e){return e?"checked":"unchecked"}var Uu=mi,Ku=vi;export{ku as A,mu as C,vu as D,_u as F,Nu as I,Bu as L,pu as O,du as P,fu as R,Au as S,hu as T,xu as V,gu as a,Ou as b,$u as c,Wu as d,Vu as e,Hu as f,tu as g,nu as h,yu as i,wu as j,bu as k,Su as l,Cu as m,Eu as n,Ru as o,Tu as p,Pu as q,Iu as r,Mu as s,Lu as t,ju as u,Fu as v,Du as w,Uu as x,Ku as y,lu as z}; diff --git a/assets/vendor-radix-DkXsqQ-A.js b/assets/vendor-radix-DkXsqQ-A.js new file mode 100644 index 0000000000000000000000000000000000000000..7ecacec2d8c773eab8c04ac6fc53013976afb8f0 --- /dev/null +++ b/assets/vendor-radix-DkXsqQ-A.js @@ -0,0 +1,53 @@ +import{r as c,j as g,a as ut,R as tn,b as pi,c as Se,d as mi}from"./vendor-react-CCIuKUIB.js";function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Cn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fe(...e){return t=>{let n=!1;const o=e.map(r=>{const i=Cn(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{const{children:s,...a}=i,l=c.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};o.displayName=e+"Provider";function r(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function he(e,t=[]){let n=[];function o(i,s){const a=c.createContext(s),l=n.length;n=[...n,s];const u=d=>{const{scope:h,children:m,...y}=d,p=h?.[e]?.[l]||a,v=c.useMemo(()=>y,Object.values(y));return g.jsx(p.Provider,{value:v,children:m})};u.displayName=i+"Provider";function f(d,h){const m=h?.[e]?.[l]||a,y=c.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const r=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=a?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return r.scopeName=e,[o,vi(r,...t)]}function vi(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function gi(e){const t=yi(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(xi);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function yi(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=bi(r),a=Si(i,r.props);return r.type!==c.Fragment&&(a.ref=o?Fe(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wi=Symbol("radix.slottable");function xi(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wi}function Si(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function bi(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ci=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_=Ci.reduce((e,t)=>{const n=gi(`Primitive.${t}`),o=c.forwardRef((r,i)=>{const{asChild:s,...a}=r,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Ei(e,t){e&&ut.flushSync(()=>e.dispatchEvent(t))}function ce(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ri(e,t=globalThis?.document){const n=ce(e);c.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Pi="DismissableLayer",Vt="dismissableLayer.update",Ti="dismissableLayer.pointerDownOutside",Ai="dismissableLayer.focusOutside",En,Qn=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ft=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=c.useContext(Qn),[f,d]=c.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=c.useState({}),y=$(t,E=>d(E)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=p.indexOf(v),x=f?p.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,b=x>=w,C=Ni(E=>{const P=E.target,M=[...u.branches].some(N=>N.contains(P));!b||M||(r?.(E),s?.(E),E.defaultPrevented||a?.())},h),R=_i(E=>{const P=E.target;[...u.branches].some(N=>N.contains(P))||(i?.(E),s?.(E),E.defaultPrevented||a?.())},h);return Ri(E=>{x===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(En=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Rn(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=En)}},[f,h,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Rn())},[f,u]),c.useEffect(()=>{const E=()=>m({});return document.addEventListener(Vt,E),()=>document.removeEventListener(Vt,E)},[]),g.jsx(_.div,{...l,ref:y,style:{pointerEvents:S?b?"auto":"none":void 0,...e.style},onFocusCapture:O(e.onFocusCapture,R.onFocusCapture),onBlurCapture:O(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,C.onPointerDownCapture)})});ft.displayName=Pi;var Ii="DismissableLayerBranch",Oi=c.forwardRef((e,t)=>{const n=c.useContext(Qn),o=c.useRef(null),r=$(t,o);return c.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(_.div,{...e,ref:r})});Oi.displayName=Ii;function Ni(e,t=globalThis?.document){const n=ce(e),o=c.useRef(!1),r=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let l=function(){Jn(Ti,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function _i(e,t=globalThis?.document){const n=ce(e),o=c.useRef(!1);return c.useEffect(()=>{const r=i=>{i.target&&!o.current&&Jn(Ai,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Rn(){const e=new CustomEvent(Vt);document.dispatchEvent(e)}function Jn(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Ei(r,i):r.dispatchEvent(i)}var z=globalThis?.document?c.useLayoutEffect:()=>{},Di=tn[" useId ".trim().toString()]||(()=>{}),Mi=0;function ae(e){const[t,n]=c.useState(Di());return z(()=>{n(o=>o??String(Mi++))},[e]),t?`radix-${t}`:""}const Li=["top","right","bottom","left"],pe=Math.min,X=Math.max,ot=Math.round,Ye=Math.floor,re=e=>({x:e,y:e}),Fi={left:"right",right:"left",bottom:"top",top:"bottom"},ji={start:"end",end:"start"};function Ht(e,t,n){return X(e,pe(t,n))}function le(e,t){return typeof e=="function"?e(t):e}function ue(e){return e.split("-")[0]}function je(e){return e.split("-")[1]}function nn(e){return e==="x"?"y":"x"}function on(e){return e==="y"?"height":"width"}const ki=new Set(["top","bottom"]);function oe(e){return ki.has(ue(e))?"y":"x"}function rn(e){return nn(oe(e))}function $i(e,t,n){n===void 0&&(n=!1);const o=je(e),r=rn(e),i=on(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=rt(s)),[s,rt(s)]}function Wi(e){const t=rt(e);return[Ut(e),t,Ut(t)]}function Ut(e){return e.replace(/start|end/g,t=>ji[t])}const Pn=["left","right"],Tn=["right","left"],Bi=["top","bottom"],Vi=["bottom","top"];function Hi(e,t,n){switch(e){case"top":case"bottom":return n?t?Tn:Pn:t?Pn:Tn;case"left":case"right":return t?Bi:Vi;default:return[]}}function Ui(e,t,n,o){const r=je(e);let i=Hi(ue(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Ut)))),i}function rt(e){return e.replace(/left|right|bottom|top/g,t=>Fi[t])}function Ki(e){return{top:0,right:0,bottom:0,left:0,...e}}function eo(e){return typeof e!="number"?Ki(e):{top:e,right:e,bottom:e,left:e}}function it(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function An(e,t,n){let{reference:o,floating:r}=e;const i=oe(t),s=rn(t),a=on(s),l=ue(t),u=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let m;switch(l){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-r.width,y:d};break;default:m={x:o.x,y:o.y}}switch(je(t)){case"start":m[s]-=h*(n&&u?-1:1);break;case"end":m[s]+=h*(n&&u?-1:1);break}return m}async function zi(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=le(t,e),y=eo(m),v=a[h?d==="floating"?"reference":"floating":d],w=it(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),x=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},C=it(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:S,strategy:l}):x);return{top:(w.top-C.top+y.top)/b.y,bottom:(C.bottom-w.bottom+y.bottom)/b.y,left:(w.left-C.left+y.left)/b.x,right:(C.right-w.right+y.right)/b.x}}const Gi=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=An(u,o,l),h=o,m={},y=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=le(e,t)||{};if(u==null)return{};const d=eo(f),h={x:n,y:o},m=rn(r),y=on(m),p=await s.getDimensions(u),v=m==="y",w=v?"top":"left",x=v?"bottom":"right",S=v?"clientHeight":"clientWidth",b=i.reference[y]+i.reference[m]-h[m]-i.floating[y],C=h[m]-i.reference[m],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let E=R?R[S]:0;(!E||!await(s.isElement==null?void 0:s.isElement(R)))&&(E=a.floating[S]||i.floating[y]);const P=b/2-C/2,M=E/2-p[y]/2-1,N=pe(d[w],M),D=pe(d[x],M),F=N,j=E-p[y]-D,L=E/2-p[y]/2+P,W=Ht(F,L,j),I=!l.arrow&&je(r)!=null&&L!==W&&i.reference[y]/2-(LL<=0)){var D,F;const L=(((D=i.flip)==null?void 0:D.index)||0)+1,W=E[L];if(W&&(!(d==="alignment"?x!==oe(W):!1)||N.every(A=>oe(A.placement)===x?A.overflows[0]>0:!0)))return{data:{index:L,overflows:N},reset:{placement:W}};let I=(F=N.filter(k=>k.overflows[0]<=0).sort((k,A)=>k.overflows[1]-A.overflows[1])[0])==null?void 0:F.placement;if(!I)switch(m){case"bestFit":{var j;const k=(j=N.filter(A=>{if(R){const B=oe(A.placement);return B===x||B==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(B=>B>0).reduce((B,Y)=>B+Y,0)]).sort((A,B)=>A[1]-B[1])[0])==null?void 0:j[0];k&&(I=k);break}case"initialPlacement":I=a;break}if(r!==I)return{reset:{placement:I}}}return{}}}};function In(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function On(e){return Li.some(t=>e[t]>=0)}const qi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=le(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=In(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:On(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=In(s,n.floating);return{data:{escapedOffsets:a,escaped:On(a)}}}default:return{}}}}},to=new Set(["left","top"]);async function Zi(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=ue(n),a=je(n),l=oe(n)==="y",u=to.has(s)?-1:1,f=i&&l?-1:1,d=le(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),l?{x:m*f,y:h*u}:{x:h*u,y:m*f}}const Qi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await Zi(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},Ji=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x,y:S}=w;return{x,y:S}}},...u}=le(e,t),f={x:n,y:o},d=await i.detectOverflow(t,u),h=oe(ue(r)),m=nn(h);let y=f[m],p=f[h];if(s){const w=m==="y"?"top":"left",x=m==="y"?"bottom":"right",S=y+d[w],b=y-d[x];y=Ht(S,y,b)}if(a){const w=h==="y"?"top":"left",x=h==="y"?"bottom":"right",S=p+d[w],b=p-d[x];p=Ht(S,p,b)}const v=l.fn({...t,[m]:y,[h]:p});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[m]:s,[h]:a}}}}}},es=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=le(e,t),f={x:n,y:o},d=oe(r),h=nn(d);let m=f[h],y=f[d];const p=le(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const S=h==="y"?"height":"width",b=i.reference[h]-i.floating[S]+v.mainAxis,C=i.reference[h]+i.reference[S]-v.mainAxis;mC&&(m=C)}if(u){var w,x;const S=h==="y"?"width":"height",b=to.has(ue(r)),C=i.reference[d]-i.floating[S]+(b&&((w=s.offset)==null?void 0:w[d])||0)+(b?0:v.crossAxis),R=i.reference[d]+i.reference[S]+(b?0:((x=s.offset)==null?void 0:x[d])||0)-(b?v.crossAxis:0);yR&&(y=R)}return{[h]:m,[d]:y}}}},ts=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=le(e,t),f=await s.detectOverflow(t,u),d=ue(r),h=je(r),m=oe(r)==="y",{width:y,height:p}=i.floating;let v,w;d==="top"||d==="bottom"?(v=d,w=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,v=h==="end"?"top":"bottom");const x=p-f.top-f.bottom,S=y-f.left-f.right,b=pe(p-f[v],x),C=pe(y-f[w],S),R=!t.middlewareData.shift;let E=b,P=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=S),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=x),R&&!h){const N=X(f.left,0),D=X(f.right,0),F=X(f.top,0),j=X(f.bottom,0);m?P=y-2*(N!==0||D!==0?N+D:X(f.left,f.right)):E=p-2*(F!==0||j!==0?F+j:X(f.top,f.bottom))}await l({...t,availableWidth:P,availableHeight:E});const M=await s.getDimensions(a.floating);return y!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}};function dt(){return typeof window<"u"}function ke(e){return no(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function se(e){var t;return(t=(no(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function no(e){return dt()?e instanceof Node||e instanceof q(e).Node:!1}function J(e){return dt()?e instanceof Element||e instanceof q(e).Element:!1}function ie(e){return dt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Nn(e){return!dt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const ns=new Set(["inline","contents"]);function Ke(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ns.has(r)}const os=new Set(["table","td","th"]);function rs(e){return os.has(ke(e))}const is=[":popover-open",":modal"];function pt(e){return is.some(t=>{try{return e.matches(t)}catch{return!1}})}const ss=["transform","translate","scale","rotate","perspective"],as=["transform","translate","scale","rotate","perspective","filter"],cs=["paint","layout","strict","content"];function sn(e){const t=an(),n=J(e)?ee(e):e;return ss.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||as.some(o=>(n.willChange||"").includes(o))||cs.some(o=>(n.contain||"").includes(o))}function ls(e){let t=me(e);for(;ie(t)&&!Me(t);){if(sn(t))return t;if(pt(t))return null;t=me(t)}return null}function an(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const us=new Set(["html","body","#document"]);function Me(e){return us.has(ke(e))}function ee(e){return q(e).getComputedStyle(e)}function mt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function me(e){if(ke(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nn(e)&&e.host||se(e);return Nn(t)?t.host:t}function oo(e){const t=me(e);return Me(t)?e.ownerDocument?e.ownerDocument.body:e.body:ie(t)&&Ke(t)?t:oo(t)}function He(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=oo(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=q(r);if(i){const a=Kt(s);return t.concat(s,s.visualViewport||[],Ke(r)?r:[],a&&n?He(a):[])}return t.concat(r,He(r,[],n))}function Kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ro(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ie(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=ot(n)!==i||ot(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function cn(e){return J(e)?e:e.contextElement}function _e(e){const t=cn(e);if(!ie(t))return re(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=ro(t);let s=(i?ot(n.width):n.width)/o,a=(i?ot(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const fs=re(0);function io(e){const t=q(e);return!an()||!t.visualViewport?fs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ds(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function be(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=cn(e);let s=re(1);t&&(o?J(o)&&(s=_e(o)):s=_e(e));const a=ds(i,n,o)?io(i):re(0);let l=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,f=r.width/s.x,d=r.height/s.y;if(i){const h=q(i),m=o&&J(o)?q(o):o;let y=h,p=Kt(y);for(;p&&o&&m!==y;){const v=_e(p),w=p.getBoundingClientRect(),x=ee(p),S=w.left+(p.clientLeft+parseFloat(x.paddingLeft))*v.x,b=w.top+(p.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,d*=v.y,l+=S,u+=b,y=q(p),p=Kt(y)}}return it({width:f,height:d,x:l,y:u})}function ht(e,t){const n=mt(e).scrollLeft;return t?t.left+n:be(se(e)).left+n}function so(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ht(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ps(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=se(o),a=t?pt(t.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=re(1);const f=re(0),d=ie(o);if((d||!d&&!i)&&((ke(o)!=="body"||Ke(s))&&(l=mt(o)),ie(o))){const m=be(o);u=_e(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const h=s&&!d&&!i?so(s,l):re(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function ms(e){return Array.from(e.getClientRects())}function hs(e){const t=se(e),n=mt(e),o=e.ownerDocument.body,r=X(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=X(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ht(e);const a=-n.scrollTop;return ee(o).direction==="rtl"&&(s+=X(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const _n=25;function vs(e,t){const n=q(e),o=se(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const f=an();(!f||f&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const u=ht(o);if(u<=0){const f=o.ownerDocument,d=f.body,h=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(o.clientWidth-d.clientWidth-m);y<=_n&&(i-=y)}else u<=_n&&(i+=u);return{width:i,height:s,x:a,y:l}}const gs=new Set(["absolute","fixed"]);function ys(e,t){const n=be(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ie(e)?_e(e):re(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=r*i.x,u=o*i.y;return{width:s,height:a,x:l,y:u}}function Dn(e,t,n){let o;if(t==="viewport")o=vs(e,n);else if(t==="document")o=hs(se(e));else if(J(t))o=ys(t,n);else{const r=io(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return it(o)}function ao(e,t){const n=me(e);return n===t||!J(n)||Me(n)?!1:ee(n).position==="fixed"||ao(n,t)}function ws(e,t){const n=t.get(e);if(n)return n;let o=He(e,[],!1).filter(a=>J(a)&&ke(a)!=="body"),r=null;const i=ee(e).position==="fixed";let s=i?me(e):e;for(;J(s)&&!Me(s);){const a=ee(s),l=sn(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&gs.has(r.position)||Ke(s)&&!l&&ao(e,s))?o=o.filter(f=>f!==s):r=a,s=me(s)}return t.set(e,o),o}function xs(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?pt(t)?[]:ws(t,this._c):[].concat(n),o],a=s[0],l=s.reduce((u,f)=>{const d=Dn(t,f,r);return u.top=X(d.top,u.top),u.right=pe(d.right,u.right),u.bottom=pe(d.bottom,u.bottom),u.left=X(d.left,u.left),u},Dn(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ss(e){const{width:t,height:n}=ro(e);return{width:t,height:n}}function bs(e,t,n){const o=ie(t),r=se(t),i=n==="fixed",s=be(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=re(0);function u(){l.x=ht(r)}if(o||!o&&!i)if((ke(t)!=="body"||Ke(r))&&(a=mt(t)),o){const m=be(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?so(r,a):re(0),d=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:d,y:h,width:s.width,height:s.height}}function Ot(e){return ee(e).position==="static"}function Mn(e,t){if(!ie(e)||ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return se(e)===n&&(n=n.ownerDocument.body),n}function co(e,t){const n=q(e);if(pt(e))return n;if(!ie(e)){let r=me(e);for(;r&&!Me(r);){if(J(r)&&!Ot(r))return r;r=me(r)}return n}let o=Mn(e,t);for(;o&&rs(o)&&Ot(o);)o=Mn(o,t);return o&&Me(o)&&Ot(o)&&!sn(o)?n:o||ls(e)||n}const Cs=async function(e){const t=this.getOffsetParent||co,n=this.getDimensions,o=await n(e.floating);return{reference:bs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Es(e){return ee(e).direction==="rtl"}const Rs={convertOffsetParentRelativeRectToViewportRelativeRect:ps,getDocumentElement:se,getClippingRect:xs,getOffsetParent:co,getElementRects:Cs,getClientRects:ms,getDimensions:Ss,getScale:_e,isElement:J,isRTL:Es};function lo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ps(e,t){let n=null,o;const r=se(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:f,top:d,width:h,height:m}=u;if(a||t(),!h||!m)return;const y=Ye(d),p=Ye(r.clientWidth-(f+h)),v=Ye(r.clientHeight-(d+m)),w=Ye(f),S={rootMargin:-y+"px "+-p+"px "+-v+"px "+-w+"px",threshold:X(0,pe(1,l))||1};let b=!0;function C(R){const E=R[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):o=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!lo(u,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...S,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return s(!0),i}function Ts(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=cn(e),f=r||i?[...u?He(u):[],...He(t)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=u&&a?Ps(u,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(w=>{let[x]=w;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let y,p=l?be(e):null;l&&v();function v(){const w=be(e);p&&!lo(p,w)&&n(),p=w,y=requestAnimationFrame(v)}return n(),()=>{var w;f.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d?.(),(w=m)==null||w.disconnect(),m=null,l&&cancelAnimationFrame(y)}}const As=Qi,Is=Ji,Os=Xi,Ns=ts,_s=qi,Ln=Yi,Ds=es,Ms=(e,t,n)=>{const o=new Map,r={platform:Rs,...n},i={...r.platform,_c:o};return Gi(e,t,{...r,platform:i})};var Ls=typeof document<"u",Fs=function(){},et=Ls?c.useLayoutEffect:Fs;function st(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!st(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!st(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function uo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fn(e,t){const n=uo(e);return Math.round(t*n)/n}function Nt(e){const t=c.useRef(e);return et(()=>{t.current=e}),t}function js(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=c.useState(o);st(h,o)||m(o);const[y,p]=c.useState(null),[v,w]=c.useState(null),x=c.useCallback(A=>{A!==R.current&&(R.current=A,p(A))},[]),S=c.useCallback(A=>{A!==E.current&&(E.current=A,w(A))},[]),b=i||y,C=s||v,R=c.useRef(null),E=c.useRef(null),P=c.useRef(f),M=l!=null,N=Nt(l),D=Nt(r),F=Nt(u),j=c.useCallback(()=>{if(!R.current||!E.current)return;const A={placement:t,strategy:n,middleware:h};D.current&&(A.platform=D.current),Ms(R.current,E.current,A).then(B=>{const Y={...B,isPositioned:F.current!==!1};L.current&&!st(P.current,Y)&&(P.current=Y,ut.flushSync(()=>{d(Y)}))})},[h,t,n,D,F]);et(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[u]);const L=c.useRef(!1);et(()=>(L.current=!0,()=>{L.current=!1}),[]),et(()=>{if(b&&(R.current=b),C&&(E.current=C),b&&C){if(N.current)return N.current(b,C,j);j()}},[b,C,j,N,M]);const W=c.useMemo(()=>({reference:R,floating:E,setReference:x,setFloating:S}),[x,S]),I=c.useMemo(()=>({reference:b,floating:C}),[b,C]),k=c.useMemo(()=>{const A={position:n,left:0,top:0};if(!I.floating)return A;const B=Fn(I.floating,f.x),Y=Fn(I.floating,f.y);return a?{...A,transform:"translate("+B+"px, "+Y+"px)",...uo(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:Y}},[n,a,I.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:j,refs:W,elements:I,floatingStyles:k}),[f,j,W,I,k])}const ks=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Ln({element:o.current,padding:r}).fn(n):{}:o?Ln({element:o,padding:r}).fn(n):{}}}},$s=(e,t)=>({...As(e),options:[e,t]}),Ws=(e,t)=>({...Is(e),options:[e,t]}),Bs=(e,t)=>({...Ds(e),options:[e,t]}),Vs=(e,t)=>({...Os(e),options:[e,t]}),Hs=(e,t)=>({...Ns(e),options:[e,t]}),Us=(e,t)=>({..._s(e),options:[e,t]}),Ks=(e,t)=>({...ks(e),options:[e,t]});var zs="Arrow",fo=c.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return g.jsx(_.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});fo.displayName=zs;var Gs=fo;function po(e){const[t,n]=c.useState(void 0);return z(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var ln="Popper",[mo,vt]=he(ln),[Ys,ho]=mo(ln),vo=e=>{const{__scopePopper:t,children:n}=e,[o,r]=c.useState(null);return g.jsx(Ys,{scope:t,anchor:o,onAnchorChange:r,children:n})};vo.displayName=ln;var go="PopperAnchor",yo=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=ho(go,n),s=c.useRef(null),a=$(t,s),l=c.useRef(null);return c.useEffect(()=>{const u=l.current;l.current=o?.current||s.current,u!==l.current&&i.onAnchorChange(l.current)}),o?null:g.jsx(_.div,{...r,ref:a})});yo.displayName=go;var un="PopperContent",[Xs,qs]=mo(un),wo=c.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...p}=e,v=ho(un,n),[w,x]=c.useState(null),S=$(t,T=>x(T)),[b,C]=c.useState(null),R=po(b),E=R?.width??0,P=R?.height??0,M=o+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(u)?u:[u],F=D.length>0,j={padding:N,boundary:D.filter(Qs),altBoundary:F},{refs:L,floatingStyles:W,placement:I,isPositioned:k,middlewareData:A}=js({strategy:"fixed",placement:M,whileElementsMounted:(...T)=>Ts(...T,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[$s({mainAxis:r+P,alignmentAxis:s}),l&&Ws({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Bs():void 0,...j}),l&&Vs({...j}),Hs({...j,apply:({elements:T,rects:U,availableWidth:G,availableHeight:V})=>{const{width:H,height:K}=U.reference,Z=T.floating.style;Z.setProperty("--radix-popper-available-width",`${G}px`),Z.setProperty("--radix-popper-available-height",`${V}px`),Z.setProperty("--radix-popper-anchor-width",`${H}px`),Z.setProperty("--radix-popper-anchor-height",`${K}px`)}}),b&&Ks({element:b,padding:a}),Js({arrowWidth:E,arrowHeight:P}),h&&Us({strategy:"referenceHidden",...j})]}),[B,Y]=bo(I),ye=ce(y);z(()=>{k&&ye?.()},[k,ye]);const We=A.arrow?.x,Be=A.arrow?.y,fe=A.arrow?.centerOffset!==0,[Ae,we]=c.useState();return z(()=>{w&&we(window.getComputedStyle(w).zIndex)},[w]),g.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:k?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ae,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Xs,{scope:n,placedSide:B,onArrowChange:C,arrowX:We,arrowY:Be,shouldHideArrow:fe,children:g.jsx(_.div,{"data-side":B,"data-align":Y,...p,ref:S,style:{...p.style,animation:k?void 0:"none"}})})})});wo.displayName=un;var xo="PopperArrow",Zs={top:"bottom",right:"left",bottom:"top",left:"right"},So=c.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=qs(xo,o),s=Zs[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(Gs,{...r,ref:n,style:{...r.style,display:"block"}})})});So.displayName=xo;function Qs(e){return e!==null}var Js=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,f]=bo(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(r.arrow?.x??0)+a/2,m=(r.arrow?.y??0)+l/2;let y="",p="";return u==="bottom"?(y=s?d:`${h}px`,p=`${-l}px`):u==="top"?(y=s?d:`${h}px`,p=`${o.floating.height+l}px`):u==="right"?(y=`${-l}px`,p=s?d:`${m}px`):u==="left"&&(y=`${o.floating.width+l}px`,p=s?d:`${m}px`),{data:{x:y,y:p}}}});function bo(e){const[t,n="center"]=e.split("-");return[t,n]}var Co=vo,Eo=yo,Ro=wo,Po=So,ea="Portal",gt=c.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=c.useState(!1);z(()=>i(!0),[]);const s=n||r&&globalThis?.document?.body;return s?pi.createPortal(g.jsx(_.div,{...o,ref:t}),s):null});gt.displayName=ea;function ta(e,t){return c.useReducer((n,o)=>t[n][o]??n,e)}var Te=e=>{const{present:t,children:n}=e,o=na(t),r=typeof n=="function"?n({present:o.isPresent}):c.Children.only(n),i=$(o.ref,oa(r));return typeof n=="function"||o.isPresent?c.cloneElement(r,{ref:i}):null};Te.displayName="Presence";function na(e){const[t,n]=c.useState(),o=c.useRef(null),r=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,l]=ta(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=Xe(o.current);i.current=a==="mounted"?u:"none"},[a]),z(()=>{const u=o.current,f=r.current;if(f!==e){const h=i.current,m=Xe(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),z(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=m=>{const p=Xe(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&p&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=m=>{m.target===t&&(i.current=Xe(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function Xe(e){return e?.animationName||"none"}function oa(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ra=Symbol("radix.slottable");function ia(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ra,t}var sa=tn[" useInsertionEffect ".trim().toString()]||z;function Ce({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,s]=aa({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:r;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,o])}const u=c.useCallback(f=>{if(a){const d=ca(f)?f(e):f;d!==e&&s.current?.(d)}else i(f)},[a,e,i,s]);return[l,u]}function aa({defaultProp:e,onChange:t}){const[n,o]=c.useState(e),r=c.useRef(n),i=c.useRef(t);return sa(()=>{i.current=t},[t]),c.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function ca(e){return typeof e=="function"}var To=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),la="VisuallyHidden",Ao=c.forwardRef((e,t)=>g.jsx(_.span,{...e,ref:t,style:{...To,...e.style}}));Ao.displayName=la;var ua=Ao,[yt]=he("Tooltip",[vt]),wt=vt(),Io="TooltipProvider",fa=700,zt="tooltip.open",[da,fn]=yt(Io),Oo=e=>{const{__scopeTooltip:t,delayDuration:n=fa,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,s=c.useRef(!0),a=c.useRef(!1),l=c.useRef(0);return c.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(da,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:c.useCallback(u=>{a.current=u},[]),disableHoverableContent:r,children:i})};Oo.displayName=Io;var Ue="Tooltip",[pa,ze]=yt(Ue),No=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=fn(Ue,e.__scopeTooltip),u=wt(t),[f,d]=c.useState(null),h=ae(),m=c.useRef(0),y=s??l.disableHoverableContent,p=a??l.delayDuration,v=c.useRef(!1),[w,x]=Ce({prop:o,defaultProp:r??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(zt))):l.onClose(),i?.(E)},caller:Ue}),S=c.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),b=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,x(!0)},[x]),C=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),R=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,x(!0),m.current=0},p)},[p,x]);return c.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),g.jsx(Co,{...u,children:g.jsx(pa,{scope:t,contentId:h,open:w,stateAttribute:S,trigger:f,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?R():b()},[l.isOpenDelayedRef,R,b]),onTriggerLeave:c.useCallback(()=>{y?C():(window.clearTimeout(m.current),m.current=0)},[C,y]),onOpen:b,onClose:C,disableHoverableContent:y,children:n})})};No.displayName=Ue;var Gt="TooltipTrigger",_o=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=ze(Gt,n),i=fn(Gt,n),s=wt(n),a=c.useRef(null),l=$(t,a,r.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),d=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(Eo,{asChild:!0,...s,children:g.jsx(_.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:O(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:O(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:O(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:O(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:O(e.onBlur,r.onClose),onClick:O(e.onClick,r.onClose)})})});_o.displayName=Gt;var dn="TooltipPortal",[ma,ha]=yt(dn,{forceMount:void 0}),Do=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=ze(dn,t);return g.jsx(ma,{scope:t,forceMount:n,children:g.jsx(Te,{present:n||i.open,children:g.jsx(gt,{asChild:!0,container:r,children:o})})})};Do.displayName=dn;var Le="TooltipContent",Mo=c.forwardRef((e,t)=>{const n=ha(Le,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=ze(Le,e.__scopeTooltip);return g.jsx(Te,{present:o||s.open,children:s.disableHoverableContent?g.jsx(Lo,{side:r,...i,ref:t}):g.jsx(va,{side:r,...i,ref:t})})}),va=c.forwardRef((e,t)=>{const n=ze(Le,e.__scopeTooltip),o=fn(Le,e.__scopeTooltip),r=c.useRef(null),i=$(t,r),[s,a]=c.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:d}=o,h=c.useCallback(()=>{a(null),d(!1)},[d]),m=c.useCallback((y,p)=>{const v=y.currentTarget,w={x:y.clientX,y:y.clientY},x=xa(w,v.getBoundingClientRect()),S=Sa(w,x),b=ba(p.getBoundingClientRect()),C=Ea([...S,...b]);a(C),d(!0)},[d]);return c.useEffect(()=>()=>h(),[h]),c.useEffect(()=>{if(l&&f){const y=v=>m(v,f),p=v=>m(v,l);return l.addEventListener("pointerleave",y),f.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",p)}}},[l,f,m,h]),c.useEffect(()=>{if(s){const y=p=>{const v=p.target,w={x:p.clientX,y:p.clientY},x=l?.contains(v)||f?.contains(v),S=!Ca(w,s);x?h():S&&(h(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,f,s,u,h]),g.jsx(Lo,{...e,ref:i})}),[ga,ya]=yt(Ue,{isInside:!1}),wa=ia("TooltipContent"),Lo=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=ze(Le,n),u=wt(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(zt,f),()=>document.removeEventListener(zt,f)),[f]),c.useEffect(()=>{if(l.trigger){const d=h=>{h.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),g.jsx(ft,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:g.jsxs(Ro,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(wa,{children:o}),g.jsx(ga,{scope:n,isInside:!0,children:g.jsx(ua,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Mo.displayName=Le;var Fo="TooltipArrow",jo=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=wt(n);return ya(Fo,n).isInside?null:g.jsx(Po,{...r,...o,ref:t})});jo.displayName=Fo;function xa(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Sa(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function ba(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Ca(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;io!=h>o&&n<(d-u)*(o-f)/(h-f)+u&&(r=!r)}return r}function Ea(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Ra(t)}function Ra(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ql=Oo,Jl=No,eu=_o,tu=Do,nu=Mo,ou=jo,Pa=Symbol.for("react.lazy"),at=tn[" use ".trim().toString()];function Ta(e){return typeof e=="object"&&e!==null&&"then"in e}function ko(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Pa&&"_payload"in e&&Ta(e._payload)}function $o(e){const t=Aa(e),n=c.forwardRef((o,r)=>{let{children:i,...s}=o;ko(i)&&typeof at=="function"&&(i=at(i._payload));const a=c.Children.toArray(i),l=a.find(Oa);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var ru=$o("Slot");function Aa(e){const t=c.forwardRef((n,o)=>{let{children:r,...i}=n;if(ko(r)&&typeof at=="function"&&(r=at(r._payload)),c.isValidElement(r)){const s=_a(r),a=Na(i,r.props);return r.type!==c.Fragment&&(a.ref=o?Fe(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ia=Symbol("radix.slottable");function Oa(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ia}function Na(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function _a(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _t="focusScope.autoFocusOnMount",Dt="focusScope.autoFocusOnUnmount",jn={bubbles:!1,cancelable:!0},Da="FocusScope",pn=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),u=ce(r),f=ce(i),d=c.useRef(null),h=$(t,p=>l(p)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let p=function(S){if(m.paused||!a)return;const b=S.target;a.contains(b)?d.current=b:de(d.current,{select:!0})},v=function(S){if(m.paused||!a)return;const b=S.relatedTarget;b!==null&&(a.contains(b)||de(d.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&de(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const x=new MutationObserver(w);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),x.disconnect()}}},[o,a,m.paused]),c.useEffect(()=>{if(a){$n.add(m);const p=document.activeElement;if(!a.contains(p)){const w=new CustomEvent(_t,jn);a.addEventListener(_t,u),a.dispatchEvent(w),w.defaultPrevented||(Ma($a(Wo(a)),{select:!0}),document.activeElement===p&&de(a))}return()=>{a.removeEventListener(_t,u),setTimeout(()=>{const w=new CustomEvent(Dt,jn);a.addEventListener(Dt,f),a.dispatchEvent(w),w.defaultPrevented||de(p??document.body,{select:!0}),a.removeEventListener(Dt,f),$n.remove(m)},0)}}},[a,u,f,m]);const y=c.useCallback(p=>{if(!n&&!o||m.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,w=document.activeElement;if(v&&w){const x=p.currentTarget,[S,b]=La(x);S&&b?!p.shiftKey&&w===b?(p.preventDefault(),n&&de(S,{select:!0})):p.shiftKey&&w===S&&(p.preventDefault(),n&&de(b,{select:!0})):w===x&&p.preventDefault()}},[n,o,m.paused]);return g.jsx(_.div,{tabIndex:-1,...s,ref:h,onKeyDown:y})});pn.displayName=Da;function Ma(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(de(o,{select:t}),document.activeElement!==n)return}function La(e){const t=Wo(e),n=kn(t,e),o=kn(t.reverse(),e);return[n,o]}function Wo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kn(e,t){for(const n of e)if(!Fa(n,{upTo:t}))return n}function Fa(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ja(e){return e instanceof HTMLInputElement&&"select"in e}function de(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ja(e)&&t&&e.select()}}var $n=ka();function ka(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Wn(e,t),e.unshift(t)},remove(t){e=Wn(e,t),e[0]?.resume()}}}function Wn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function $a(e){return e.filter(t=>t.tagName!=="A")}var Mt=0;function Bo(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bn()),document.body.insertAdjacentElement("beforeend",e[1]??Bn()),Mt++,()=>{Mt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mt--}},[])}function Bn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ne=function(){return ne=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return nc;var t=oc(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},ic=Ko(),De="data-scroll-locked",sc=function(e,t,n,o){var r=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Ba,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(a,"px ").concat(o,`; + } + body[`).concat(De,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` + padding-left: `.concat(r,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(o,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(tt,` { + right: `).concat(a,"px ").concat(o,`; + } + + .`).concat(nt,` { + margin-right: `).concat(a,"px ").concat(o,`; + } + + .`).concat(tt," .").concat(tt,` { + right: 0 `).concat(o,`; + } + + .`).concat(nt," .").concat(nt,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(De,`] { + `).concat(Va,": ").concat(a,`px; + } +`)},Hn=function(){var e=parseInt(document.body.getAttribute(De)||"0",10);return isFinite(e)?e:0},ac=function(){c.useEffect(function(){return document.body.setAttribute(De,(Hn()+1).toString()),function(){var e=Hn()-1;e<=0?document.body.removeAttribute(De):document.body.setAttribute(De,e.toString())}},[])},cc=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;ac();var i=c.useMemo(function(){return rc(r)},[r]);return c.createElement(ic,{styles:sc(i,!t,r,n?"":"!important")})},Yt=!1;if(typeof window<"u")try{var qe=Object.defineProperty({},"passive",{get:function(){return Yt=!0,!0}});window.addEventListener("test",qe,qe),window.removeEventListener("test",qe,qe)}catch{Yt=!1}var Ie=Yt?{passive:!1}:!1,lc=function(e){return e.tagName==="TEXTAREA"},zo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lc(e)&&n[t]==="visible")},uc=function(e){return zo(e,"overflowY")},fc=function(e){return zo(e,"overflowX")},Un=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Go(e,o);if(r){var i=Yo(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},dc=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},pc=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Go=function(e,t){return e==="v"?uc(t):fc(t)},Yo=function(e,t){return e==="v"?dc(t):pc(t)},mc=function(e,t){return e==="h"&&t==="rtl"?-1:1},hc=function(e,t,n,o,r){var i=mc(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,l=t.contains(a),u=!1,f=s>0,d=0,h=0;do{if(!a)break;var m=Yo(e,a),y=m[0],p=m[1],v=m[2],w=p-v-i*y;(y||w)&&Go(e,a)&&(d+=w,h+=y);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Ze=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kn=function(e){return[e.deltaX,e.deltaY]},zn=function(e){return e&&"current"in e?e.current:e},vc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gc=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},yc=0,Oe=[];function wc(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(yc++)[0],i=c.useState(Ko)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var p=Wa([e.lockRef.current],(e.shards||[]).map(zn),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var w=Ze(p),x=n.current,S="deltaX"in p?p.deltaX:x[0]-w[0],b="deltaY"in p?p.deltaY:x[1]-w[1],C,R=p.target,E=Math.abs(S)>Math.abs(b)?"h":"v";if("touches"in p&&E==="h"&&R.type==="range")return!1;var P=window.getSelection(),M=P&&P.anchorNode,N=M?M===R||M.contains(R):!1;if(N)return!1;var D=Un(E,R);if(!D)return!0;if(D?C=E:(C=E==="v"?"h":"v",D=Un(E,R)),!D)return!1;if(!o.current&&"changedTouches"in p&&(S||b)&&(o.current=C),!C)return!0;var F=o.current||C;return hc(F,v,p,F==="h"?S:b)},[]),l=c.useCallback(function(p){var v=p;if(!(!Oe.length||Oe[Oe.length-1]!==i)){var w="deltaY"in v?Kn(v):Ze(v),x=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&vc(C.delta,w)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var S=(s.current.shards||[]).map(zn).filter(Boolean).filter(function(C){return C.contains(v.target)}),b=S.length>0?a(v,S[0]):!s.current.noIsolation;b&&v.cancelable&&v.preventDefault()}}},[]),u=c.useCallback(function(p,v,w,x){var S={name:p,delta:v,target:w,should:x,shadowParent:xc(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(b){return b!==S})},1)},[]),f=c.useCallback(function(p){n.current=Ze(p),o.current=void 0},[]),d=c.useCallback(function(p){u(p.type,Kn(p),p.target,a(p,e.lockRef.current))},[]),h=c.useCallback(function(p){u(p.type,Ze(p),p.target,a(p,e.lockRef.current))},[]);c.useEffect(function(){return Oe.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ie),document.addEventListener("touchmove",l,Ie),document.addEventListener("touchstart",f,Ie),function(){Oe=Oe.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Ie),document.removeEventListener("touchmove",l,Ie),document.removeEventListener("touchstart",f,Ie)}},[]);var m=e.removeScrollBar,y=e.inert;return c.createElement(c.Fragment,null,y?c.createElement(i,{styles:gc(r)}):null,m?c.createElement(cc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Sc=Xa(Uo,wc);var mn=c.forwardRef(function(e,t){return c.createElement(xt,ne({},e,{ref:t,sideCar:Sc}))});mn.classNames=xt.classNames;var bc=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ne=new WeakMap,Qe=new WeakMap,Je={},kt=0,Xo=function(e){return e&&(e.host||Xo(e.parentNode))},Cc=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Xo(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ec=function(e,t,n,o){var r=Cc(t,Array.isArray(e)?e:[e]);Je[n]||(Je[n]=new WeakMap);var i=Je[n],s=[],a=new Set,l=new Set(r),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};r.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))f(h);else try{var m=h.getAttribute(o),y=m!==null&&m!=="false",p=(Ne.get(h)||0)+1,v=(i.get(h)||0)+1;Ne.set(h,p),i.set(h,v),s.push(h),p===1&&y&&Qe.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),a.clear(),kt++,function(){s.forEach(function(d){var h=Ne.get(d)-1,m=i.get(d)-1;Ne.set(d,h),i.set(d,m),h||(Qe.has(d)||d.removeAttribute(o),Qe.delete(d)),m||d.removeAttribute(n)}),kt--,kt||(Ne=new WeakMap,Ne=new WeakMap,Qe=new WeakMap,Je={})}},qo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=bc(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Ec(o,r,n,"aria-hidden")):function(){return null}};function Rc(e){const t=Pc(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(Ac);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Pc(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=Oc(r),a=Ic(i,r.props);return r.type!==c.Fragment&&(a.ref=o?Fe(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tc=Symbol("radix.slottable");function Ac(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tc}function Ic(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Oc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var St="Dialog",[Zo]=he(St),[Nc,te]=Zo(St),Qo=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:s=!0}=e,a=c.useRef(null),l=c.useRef(null),[u,f]=Ce({prop:o,defaultProp:r??!1,onChange:i,caller:St});return g.jsx(Nc,{scope:t,triggerRef:a,contentRef:l,contentId:ae(),titleId:ae(),descriptionId:ae(),open:u,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(d=>!d),[f]),modal:s,children:n})};Qo.displayName=St;var Jo="DialogTrigger",_c=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(Jo,n),i=$(t,r.triggerRef);return g.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":gn(r.open),...o,ref:i,onClick:O(e.onClick,r.onOpenToggle)})});_c.displayName=Jo;var hn="DialogPortal",[Dc,er]=Zo(hn,{forceMount:void 0}),tr=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=te(hn,t);return g.jsx(Dc,{scope:t,forceMount:n,children:c.Children.map(o,s=>g.jsx(Te,{present:n||i.open,children:g.jsx(gt,{asChild:!0,container:r,children:s})}))})};tr.displayName=hn;var ct="DialogOverlay",nr=c.forwardRef((e,t)=>{const n=er(ct,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(ct,e.__scopeDialog);return i.modal?g.jsx(Te,{present:o||i.open,children:g.jsx(Lc,{...r,ref:t})}):null});nr.displayName=ct;var Mc=Rc("DialogOverlay.RemoveScroll"),Lc=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(ct,n);return g.jsx(mn,{as:Mc,allowPinchZoom:!0,shards:[r.contentRef],children:g.jsx(_.div,{"data-state":gn(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Ee="DialogContent",or=c.forwardRef((e,t)=>{const n=er(Ee,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(Ee,e.__scopeDialog);return g.jsx(Te,{present:o||i.open,children:i.modal?g.jsx(Fc,{...r,ref:t}):g.jsx(jc,{...r,ref:t})})});or.displayName=Ee;var Fc=c.forwardRef((e,t)=>{const n=te(Ee,e.__scopeDialog),o=c.useRef(null),r=$(t,n.contentRef,o);return c.useEffect(()=>{const i=o.current;if(i)return qo(i)},[]),g.jsx(rr,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:O(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:O(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:O(e.onFocusOutside,i=>i.preventDefault())})}),jc=c.forwardRef((e,t)=>{const n=te(Ee,e.__scopeDialog),o=c.useRef(!1),r=c.useRef(!1);return g.jsx(rr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),rr=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,...s}=e,a=te(Ee,n),l=c.useRef(null),u=$(t,l);return Bo(),g.jsxs(g.Fragment,{children:[g.jsx(pn,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i,children:g.jsx(ft,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":gn(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(kc,{titleId:a.titleId}),g.jsx(Wc,{contentRef:l,descriptionId:a.descriptionId})]})]})}),vn="DialogTitle",ir=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(vn,n);return g.jsx(_.h2,{id:r.titleId,...o,ref:t})});ir.displayName=vn;var sr="DialogDescription",ar=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(sr,n);return g.jsx(_.p,{id:r.descriptionId,...o,ref:t})});ar.displayName=sr;var cr="DialogClose",lr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(cr,n);return g.jsx(_.button,{type:"button",...o,ref:t,onClick:O(e.onClick,()=>r.onOpenChange(!1))})});lr.displayName=cr;function gn(e){return e?"open":"closed"}var ur="DialogTitleWarning",[iu,fr]=hi(ur,{contentName:Ee,titleName:vn,docsSlug:"dialog"}),kc=({titleId:e})=>{const t=fr(ur),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$c="DialogDescriptionWarning",Wc=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fr($c).contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},su=Qo,au=tr,cu=nr,lu=or,uu=ir,fu=ar,du=lr;function Gn(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yn(e){const t=Bc(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(Hc);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Bc(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=Kc(r),a=Uc(i,r.props);return r.type!==c.Fragment&&(a.ref=o?Fe(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vc=Symbol("radix.slottable");function Hc(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vc}function Uc(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Kc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function dr(e){const t=e+"CollectionProvider",[n,o]=he(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:w}=p,x=Se.useRef(null),S=Se.useRef(new Map).current;return g.jsx(r,{scope:v,itemMap:S,collectionRef:x,children:w})};s.displayName=t;const a=e+"CollectionSlot",l=Yn(a),u=Se.forwardRef((p,v)=>{const{scope:w,children:x}=p,S=i(a,w),b=$(v,S.collectionRef);return g.jsx(l,{ref:b,children:x})});u.displayName=a;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=Yn(f),m=Se.forwardRef((p,v)=>{const{scope:w,children:x,...S}=p,b=Se.useRef(null),C=$(v,b),R=i(f,w);return Se.useEffect(()=>(R.itemMap.set(b,{ref:b,...S}),()=>void R.itemMap.delete(b))),g.jsx(h,{[d]:"",ref:C,children:x})});m.displayName=f;function y(p){const v=i(e+"CollectionConsumer",p);return Se.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const S=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((R,E)=>S.indexOf(R.ref.current)-S.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:m},y,o]}var zc=c.createContext(void 0);function yn(e){const t=c.useContext(zc);return e||t||"ltr"}function Gc(e){const t=Yc(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),l=a.find(qc);if(l){const u=l.props.children,f=a.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return g.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Yc(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=Qc(r),a=Zc(i,r.props);return r.type!==c.Fragment&&(a.ref=o?Fe(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xc=Symbol("radix.slottable");function qc(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xc}function Zc(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const l=i(...a);return r(...a),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Qc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pr(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Jc=[" ","Enter","ArrowUp","ArrowDown"],el=[" ","Enter"],Re="Select",[bt,Ct,tl]=dr(Re),[$e]=he(Re,[tl,vt]),Et=vt(),[nl,ve]=$e(Re),[ol,rl]=$e(Re),mr=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:h,required:m,form:y}=e,p=Et(t),[v,w]=c.useState(null),[x,S]=c.useState(null),[b,C]=c.useState(!1),R=yn(u),[E,P]=Ce({prop:o,defaultProp:r??!1,onChange:i,caller:Re}),[M,N]=Ce({prop:s,defaultProp:a,onChange:l,caller:Re}),D=c.useRef(null),F=v?y||!!v.closest("form"):!0,[j,L]=c.useState(new Set),W=Array.from(j).map(I=>I.props.value).join(";");return g.jsx(Co,{...p,children:g.jsxs(nl,{required:m,scope:t,trigger:v,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:ae(),value:M,onValueChange:N,open:E,onOpenChange:P,dir:R,triggerPointerDownPosRef:D,disabled:h,children:[g.jsx(bt.Provider,{scope:t,children:g.jsx(ol,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(I=>{L(k=>new Set(k).add(I))},[]),onNativeOptionRemove:c.useCallback(I=>{L(k=>{const A=new Set(k);return A.delete(I),A})},[]),children:n})}),F?g.jsxs(Fr,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:M,onChange:I=>N(I.target.value),disabled:h,form:y,children:[M===void 0?g.jsx("option",{value:""}):null,Array.from(j)]},W):null]})})};mr.displayName=Re;var hr="SelectTrigger",vr=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=Et(n),s=ve(hr,n),a=s.disabled||o,l=$(t,s.onTriggerChange),u=Ct(n),f=c.useRef("touch"),[d,h,m]=kr(p=>{const v=u().filter(S=>!S.disabled),w=v.find(S=>S.value===s.value),x=$r(v,p,w);x!==void 0&&s.onValueChange(x.value)}),y=p=>{a||(s.onOpenChange(!0),m()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return g.jsx(Eo,{asChild:!0,...i,children:g.jsx(_.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":jr(s.value)?"":void 0,...r,ref:l,onClick:O(r.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&y(p)}),onPointerDown:O(r.onPointerDown,p=>{f.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:O(r.onKeyDown,p=>{const v=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(v&&p.key===" ")&&Jc.includes(p.key)&&(y(),p.preventDefault())})})})});vr.displayName=hr;var gr="SelectValue",yr=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:s="",...a}=e,l=ve(gr,n),{onValueNodeHasChildrenChange:u}=l,f=i!==void 0,d=$(t,l.onValueNodeChange);return z(()=>{u(f)},[u,f]),g.jsx(_.span,{...a,ref:d,style:{pointerEvents:"none"},children:jr(l.value)?g.jsx(g.Fragment,{children:s}):i})});yr.displayName=gr;var il="SelectIcon",wr=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return g.jsx(_.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});wr.displayName=il;var sl="SelectPortal",xr=e=>g.jsx(gt,{asChild:!0,...e});xr.displayName=sl;var Pe="SelectContent",Sr=c.forwardRef((e,t)=>{const n=ve(Pe,e.__scopeSelect),[o,r]=c.useState();if(z(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?ut.createPortal(g.jsx(br,{scope:e.__scopeSelect,children:g.jsx(bt.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(Cr,{...e,ref:t})});Sr.displayName=Pe;var Q=10,[br,ge]=$e(Pe),al="SelectContentImpl",cl=Gc("SelectContent.RemoveScroll"),Cr=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:v,...w}=e,x=ve(Pe,n),[S,b]=c.useState(null),[C,R]=c.useState(null),E=$(t,T=>b(T)),[P,M]=c.useState(null),[N,D]=c.useState(null),F=Ct(n),[j,L]=c.useState(!1),W=c.useRef(!1);c.useEffect(()=>{if(S)return qo(S)},[S]),Bo();const I=c.useCallback(T=>{const[U,...G]=F().map(K=>K.ref.current),[V]=G.slice(-1),H=document.activeElement;for(const K of T)if(K===H||(K?.scrollIntoView({block:"nearest"}),K===U&&C&&(C.scrollTop=0),K===V&&C&&(C.scrollTop=C.scrollHeight),K?.focus(),document.activeElement!==H))return},[F,C]),k=c.useCallback(()=>I([P,S]),[I,P,S]);c.useEffect(()=>{j&&k()},[j,k]);const{onOpenChange:A,triggerPointerDownPosRef:B}=x;c.useEffect(()=>{if(S){let T={x:0,y:0};const U=V=>{T={x:Math.abs(Math.round(V.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(B.current?.y??0))}},G=V=>{T.x<=10&&T.y<=10?V.preventDefault():S.contains(V.target)||A(!1),document.removeEventListener("pointermove",U),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",G,{capture:!0})}}},[S,A,B]),c.useEffect(()=>{const T=()=>A(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[A]);const[Y,ye]=kr(T=>{const U=F().filter(H=>!H.disabled),G=U.find(H=>H.ref.current===document.activeElement),V=$r(U,T,G);V&&setTimeout(()=>V.ref.current.focus())}),We=c.useCallback((T,U,G)=>{const V=!W.current&&!G;(x.value!==void 0&&x.value===U||V)&&(M(T),V&&(W.current=!0))},[x.value]),Be=c.useCallback(()=>S?.focus(),[S]),fe=c.useCallback((T,U,G)=>{const V=!W.current&&!G;(x.value!==void 0&&x.value===U||V)&&D(T)},[x.value]),Ae=o==="popper"?Xt:Er,we=Ae===Xt?{side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:v}:{};return g.jsx(br,{scope:n,content:S,viewport:C,onViewportChange:R,itemRefCallback:We,selectedItem:P,onItemLeave:Be,itemTextRefCallback:fe,focusSelectedItem:k,selectedItemText:N,position:o,isPositioned:j,searchRef:Y,children:g.jsx(mn,{as:cl,allowPinchZoom:!0,children:g.jsx(pn,{asChild:!0,trapped:x.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:O(r,T=>{x.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:g.jsx(ft,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g.jsx(Ae,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:T=>T.preventDefault(),...w,...we,onPlaced:()=>L(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:O(w.onKeyDown,T=>{const U=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!U&&T.key.length===1&&ye(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let V=F().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(T.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const H=T.target,K=V.indexOf(H);V=V.slice(K+1)}setTimeout(()=>I(V)),T.preventDefault()}})})})})})})});Cr.displayName=al;var ll="SelectItemAlignedPosition",Er=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=ve(Pe,n),s=ge(Pe,n),[a,l]=c.useState(null),[u,f]=c.useState(null),d=$(t,E=>f(E)),h=Ct(n),m=c.useRef(!1),y=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:w,focusSelectedItem:x}=s,S=c.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&p&&v&&w){const E=i.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),N=w.getBoundingClientRect();if(i.dir!=="rtl"){const H=N.left-P.left,K=M.left-H,Z=E.left-K,xe=E.width+Z,Tt=Math.max(xe,P.width),At=window.innerWidth-Q,It=Gn(K,[Q,Math.max(Q,At-Tt)]);a.style.minWidth=xe+"px",a.style.left=It+"px"}else{const H=P.right-N.right,K=window.innerWidth-M.right-H,Z=window.innerWidth-E.right-K,xe=E.width+Z,Tt=Math.max(xe,P.width),At=window.innerWidth-Q,It=Gn(K,[Q,Math.max(Q,At-Tt)]);a.style.minWidth=xe+"px",a.style.right=It+"px"}const D=h(),F=window.innerHeight-Q*2,j=p.scrollHeight,L=window.getComputedStyle(u),W=parseInt(L.borderTopWidth,10),I=parseInt(L.paddingTop,10),k=parseInt(L.borderBottomWidth,10),A=parseInt(L.paddingBottom,10),B=W+I+j+A+k,Y=Math.min(v.offsetHeight*5,B),ye=window.getComputedStyle(p),We=parseInt(ye.paddingTop,10),Be=parseInt(ye.paddingBottom,10),fe=E.top+E.height/2-Q,Ae=F-fe,we=v.offsetHeight/2,T=v.offsetTop+we,U=W+I+T,G=B-U;if(U<=fe){const H=D.length>0&&v===D[D.length-1].ref.current;a.style.bottom="0px";const K=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(Ae,we+(H?Be:0)+K+k),xe=U+Z;a.style.height=xe+"px"}else{const H=D.length>0&&v===D[0].ref.current;a.style.top="0px";const Z=Math.max(fe,W+p.offsetTop+(H?We:0)+we)+G;a.style.height=Z+"px",p.scrollTop=U-fe+p.offsetTop}a.style.margin=`${Q}px 0`,a.style.minHeight=Y+"px",a.style.maxHeight=F+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,a,u,p,v,w,i.dir,o]);z(()=>S(),[S]);const[b,C]=c.useState();z(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const R=c.useCallback(E=>{E&&y.current===!0&&(S(),x?.(),y.current=!1)},[S,x]);return g.jsx(fl,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:R,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:g.jsx(_.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Er.displayName=ll;var ul="SelectPopperPosition",Xt=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Q,...i}=e,s=Et(n);return g.jsx(Ro,{...s,...i,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xt.displayName=ul;var[fl,wn]=$e(Pe,{}),qt="SelectViewport",Rr=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,i=ge(qt,n),s=wn(qt,n),a=$(t,i.onViewportChange),l=c.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(bt.Slot,{scope:n,children:g.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:O(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=s;if(h?.current&&d){const m=Math.abs(l.current-f.scrollTop);if(m>0){const y=window.innerHeight-Q*2,p=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),w=Math.max(p,v);if(w0?b:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Rr.displayName=qt;var Pr="SelectGroup",[dl,pl]=$e(Pr),ml=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ae();return g.jsx(dl,{scope:n,id:r,children:g.jsx(_.div,{role:"group","aria-labelledby":r,...o,ref:t})})});ml.displayName=Pr;var Tr="SelectLabel",hl=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=pl(Tr,n);return g.jsx(_.div,{id:r.id,...o,ref:t})});hl.displayName=Tr;var lt="SelectItem",[vl,Ar]=$e(lt),Ir=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...s}=e,a=ve(lt,n),l=ge(lt,n),u=a.value===o,[f,d]=c.useState(i??""),[h,m]=c.useState(!1),y=$(t,x=>l.itemRefCallback?.(x,o,r)),p=ae(),v=c.useRef("touch"),w=()=>{r||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(vl,{scope:n,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(x=>{d(S=>S||(x?.textContent??"").trim())},[]),children:g.jsx(bt.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:g.jsx(_.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:y,onFocus:O(s.onFocus,()=>m(!0)),onBlur:O(s.onBlur,()=>m(!1)),onClick:O(s.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:O(s.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:O(s.onPointerDown,x=>{v.current=x.pointerType}),onPointerMove:O(s.onPointerMove,x=>{v.current=x.pointerType,r?l.onItemLeave?.():v.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:O(s.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:O(s.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(el.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})})})})});Ir.displayName=lt;var Ve="SelectItemText",Or=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,s=ve(Ve,n),a=ge(Ve,n),l=Ar(Ve,n),u=rl(Ve,n),[f,d]=c.useState(null),h=$(t,w=>d(w),l.onItemTextChange,w=>a.itemTextRefCallback?.(w,l.value,l.disabled)),m=f?.textContent,y=c.useMemo(()=>g.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return z(()=>(p(y),()=>v(y)),[p,v,y]),g.jsxs(g.Fragment,{children:[g.jsx(_.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ut.createPortal(i.children,s.valueNode):null]})});Or.displayName=Ve;var Nr="SelectItemIndicator",_r=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Ar(Nr,n).isSelected?g.jsx(_.span,{"aria-hidden":!0,...o,ref:t}):null});_r.displayName=Nr;var Zt="SelectScrollUpButton",Dr=c.forwardRef((e,t)=>{const n=ge(Zt,e.__scopeSelect),o=wn(Zt,e.__scopeSelect),[r,i]=c.useState(!1),s=$(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?g.jsx(Lr,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Dr.displayName=Zt;var Qt="SelectScrollDownButton",Mr=c.forwardRef((e,t)=>{const n=ge(Qt,e.__scopeSelect),o=wn(Qt,e.__scopeSelect),[r,i]=c.useState(!1),s=$(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?g.jsx(Lr,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Mr.displayName=Qt;var Lr=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=ge("SelectScrollButton",n),s=c.useRef(null),a=Ct(n),l=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),z(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),g.jsx(_.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:O(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:O(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:O(r.onPointerLeave,()=>{l()})})}),gl="SelectSeparator",yl=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return g.jsx(_.div,{"aria-hidden":!0,...o,ref:t})});yl.displayName=gl;var Jt="SelectArrow",wl=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Et(n),i=ve(Jt,n),s=ge(Jt,n);return i.open&&s.position==="popper"?g.jsx(Po,{...r,...o,ref:t}):null});wl.displayName=Jt;var xl="SelectBubbleInput",Fr=c.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=c.useRef(null),i=$(o,r),s=pr(t);return c.useEffect(()=>{const a=r.current;if(!a)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&f){const d=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(d)}},[s,t]),g.jsx(_.select,{...n,style:{...To,...n.style},ref:i,defaultValue:t})});Fr.displayName=xl;function jr(e){return e===""||e===void 0}function kr(e){const t=ce(e),n=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const a=n.current+s;t(a),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=c.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function $r(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Sl(e,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Sl(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var pu=mr,mu=vr,hu=yr,vu=wr,gu=xr,yu=Sr,wu=Rr,xu=Ir,Su=Or,bu=_r,Cu=Dr,Eu=Mr;function bl(e,t=[]){let n=[];function o(i,s){const a=c.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const u=d=>{const{scope:h,children:m,...y}=d,p=h?.[e]?.[l]||a,v=c.useMemo(()=>y,Object.values(y));return g.jsx(p.Provider,{value:v,children:m})};u.displayName=i+"Provider";function f(d,h){const m=h?.[e]?.[l]||a,y=c.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const r=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=a?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return r.scopeName=e,[o,Cl(r,...t)]}function Cl(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var El=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xn=El.reduce((e,t)=>{const n=$o(`Primitive.${t}`),o=c.forwardRef((r,i)=>{const{asChild:s,...a}=r,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),$t={exports:{}},Wt={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Xn;function Rl(){if(Xn)return Wt;Xn=1;var e=mi();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,h){var m=h(),y=o({inst:{value:m,getSnapshot:h}}),p=y[0].inst,v=y[1];return i(function(){p.value=m,p.getSnapshot=h,l(p)&&v({inst:p})},[d,m,h]),r(function(){return l(p)&&v({inst:p}),d(function(){l(p)&&v({inst:p})})},[d]),s(m),m}function l(d){var h=d.getSnapshot;d=d.value;try{var m=h();return!n(d,m)}catch{return!0}}function u(d,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Wt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Wt}var qn;function Pl(){return qn||(qn=1,$t.exports=Rl()),$t.exports}var Tl=Pl();function Al(){return Tl.useSyncExternalStore(Il,()=>!0,()=>!1)}function Il(){return()=>{}}var Sn="Avatar",[Ol]=bl(Sn),[Nl,Wr]=Ol(Sn),Br=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[r,i]=c.useState("idle");return g.jsx(Nl,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:i,children:g.jsx(xn.span,{...o,ref:t})})});Br.displayName=Sn;var Vr="AvatarImage",Hr=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:r=()=>{},...i}=e,s=Wr(Vr,n),a=_l(o,i),l=ce(u=>{r(u),s.onImageLoadingStatusChange(u)});return z(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.jsx(xn.img,{...i,ref:t,src:o}):null});Hr.displayName=Vr;var Ur="AvatarFallback",Kr=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...r}=e,i=Wr(Ur,n),[s,a]=c.useState(o===void 0);return c.useEffect(()=>{if(o!==void 0){const l=window.setTimeout(()=>a(!0),o);return()=>window.clearTimeout(l)}},[o]),s&&i.imageLoadingStatus!=="loaded"?g.jsx(xn.span,{...r,ref:t}):null});Kr.displayName=Ur;function Zn(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function _l(e,{referrerPolicy:t,crossOrigin:n}){const o=Al(),r=c.useRef(null),i=o?(r.current||(r.current=new window.Image),r.current):null,[s,a]=c.useState(()=>Zn(i,e));return z(()=>{a(Zn(i,e))},[i,e]),z(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),f=l("error");return i.addEventListener("load",u),i.addEventListener("error",f),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",f)}},[i,n,t]),s}var Ru=Br,Pu=Hr,Tu=Kr,Bt="rovingFocusGroup.onEntryFocus",Dl={bubbles:!1,cancelable:!0},Ge="RovingFocusGroup",[en,zr,Ml]=dr(Ge),[Ll,Gr]=he(Ge,[Ml]),[Fl,jl]=Ll(Ge),Yr=c.forwardRef((e,t)=>g.jsx(en.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(en.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(kl,{...e,ref:t})})}));Yr.displayName=Ge;var kl=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,h=c.useRef(null),m=$(t,h),y=yn(i),[p,v]=Ce({prop:s,defaultProp:a??null,onChange:l,caller:Ge}),[w,x]=c.useState(!1),S=ce(u),b=zr(n),C=c.useRef(!1),[R,E]=c.useState(0);return c.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Bt,S),()=>P.removeEventListener(Bt,S)},[S]),g.jsx(Fl,{scope:n,orientation:o,dir:y,loop:r,currentTabStopId:p,onItemFocus:c.useCallback(P=>v(P),[v]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>E(P=>P+1),[]),onFocusableItemRemove:c.useCallback(()=>E(P=>P-1),[]),children:g.jsx(_.div,{tabIndex:w||R===0?-1:0,"data-orientation":o,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:O(e.onMouseDown,()=>{C.current=!0}),onFocus:O(e.onFocus,P=>{const M=!C.current;if(P.target===P.currentTarget&&M&&!w){const N=new CustomEvent(Bt,Dl);if(P.currentTarget.dispatchEvent(N),!N.defaultPrevented){const D=b().filter(I=>I.focusable),F=D.find(I=>I.active),j=D.find(I=>I.id===p),W=[F,j,...D].filter(Boolean).map(I=>I.ref.current);Zr(W,f)}}C.current=!1}),onBlur:O(e.onBlur,()=>x(!1))})})}),Xr="RovingFocusGroupItem",qr=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:s,...a}=e,l=ae(),u=i||l,f=jl(Xr,n),d=f.currentTabStopId===u,h=zr(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:p}=f;return c.useEffect(()=>{if(o)return m(),()=>y()},[o,m,y]),g.jsx(en.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:g.jsx(_.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:O(e.onMouseDown,v=>{o?f.onItemFocus(u):v.preventDefault()}),onFocus:O(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:O(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=Bl(v,f.orientation,f.dir);if(w!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let S=h().filter(b=>b.focusable).map(b=>b.ref.current);if(w==="last")S.reverse();else if(w==="prev"||w==="next"){w==="prev"&&S.reverse();const b=S.indexOf(v.currentTarget);S=f.loop?Vl(S,b+1):S.slice(b+1)}setTimeout(()=>Zr(S))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:p!=null}):s})})});qr.displayName=Xr;var $l={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Wl(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bl(e,t,n){const o=Wl(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return $l[o]}function Zr(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Vl(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Hl=Yr,Ul=qr,Rt="Tabs",[Kl]=he(Rt,[Gr]),Qr=Gr(),[zl,bn]=Kl(Rt),Jr=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,f=yn(a),[d,h]=Ce({prop:o,onChange:r,defaultProp:i??"",caller:Rt});return g.jsx(zl,{scope:n,baseId:ae(),value:d,onValueChange:h,orientation:s,dir:f,activationMode:l,children:g.jsx(_.div,{dir:f,"data-orientation":s,...u,ref:t})})});Jr.displayName=Rt;var ei="TabsList",ti=c.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,i=bn(ei,n),s=Qr(n);return g.jsx(Hl,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:o,children:g.jsx(_.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});ti.displayName=ei;var ni="TabsTrigger",oi=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...i}=e,s=bn(ni,n),a=Qr(n),l=si(s.baseId,o),u=ai(s.baseId,o),f=o===s.value;return g.jsx(Ul,{asChild:!0,...a,focusable:!r,active:f,children:g.jsx(_.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...i,ref:t,onMouseDown:O(e.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?s.onValueChange(o):d.preventDefault()}),onKeyDown:O(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(o)}),onFocus:O(e.onFocus,()=>{const d=s.activationMode!=="manual";!f&&!r&&d&&s.onValueChange(o)})})})});oi.displayName=ni;var ri="TabsContent",ii=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:i,...s}=e,a=bn(ri,n),l=si(a.baseId,o),u=ai(a.baseId,o),f=o===a.value,d=c.useRef(f);return c.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),g.jsx(Te,{present:r||f,children:({present:h})=>g.jsx(_.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&i})})});ii.displayName=ri;function si(e,t){return`${e}-trigger-${t}`}function ai(e,t){return`${e}-content-${t}`}var Au=Jr,Iu=ti,Ou=oi,Nu=ii,Pt="Switch",[Gl]=he(Pt),[Yl,Xl]=Gl(Pt),ci=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,form:f,...d}=e,[h,m]=c.useState(null),y=$(t,S=>m(S)),p=c.useRef(!1),v=h?f||!!h.closest("form"):!0,[w,x]=Ce({prop:r,defaultProp:i??!1,onChange:u,caller:Pt});return g.jsxs(Yl,{scope:n,checked:w,disabled:a,children:[g.jsx(_.button,{type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":di(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:y,onClick:O(e.onClick,S=>{x(b=>!b),v&&(p.current=S.isPropagationStopped(),p.current||S.stopPropagation())})}),v&&g.jsx(fi,{control:h,bubbles:!p.current,name:o,value:l,checked:w,required:s,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});ci.displayName=Pt;var li="SwitchThumb",ui=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Xl(li,n);return g.jsx(_.span,{"data-state":di(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});ui.displayName=li;var ql="SwitchBubbleInput",fi=c.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},i)=>{const s=c.useRef(null),a=$(s,i),l=pr(n),u=po(t);return c.useEffect(()=>{const f=s.current;if(!f)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&m){const y=new Event("click",{bubbles:o});m.call(f,n),f.dispatchEvent(y)}},[l,n,o]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:a,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});fi.displayName=ql;function di(e){return e?"checked":"unchecked"}var _u=ci,Du=ui;export{ou as A,nu as C,fu as D,Tu as F,vu as I,Iu as L,cu as O,tu as P,Jl as R,ru as S,eu as T,hu as V,Ql as a,su as b,lu as c,du as d,uu as e,au as f,pu as g,mu as h,gu as i,yu as j,wu as k,xu as l,bu as m,Su as n,Cu as o,Eu as p,Ru as q,Pu as r,Au as s,Ou as t,Nu as u,_u as v,Du as w}; diff --git a/assets/vendor-react-Dexh7fmo.js b/assets/vendor-react-CCIuKUIB.js similarity index 99% rename from assets/vendor-react-Dexh7fmo.js rename to assets/vendor-react-CCIuKUIB.js index f31dbb1c0cfb24b52e79da1c2e57dbf589785d3e..20ff663bec5ca52641123d466de510b9c470c09a 100644 --- a/assets/vendor-react-Dexh7fmo.js +++ b/assets/vendor-react-CCIuKUIB.js @@ -37,4 +37,4 @@ function Rc(T,W){for(var m=0;m")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=i);break}}}finally{O=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?h(e):""}function F(e){switch(e.tag){case 5:return h(e.type);case 16:return h("Lazy");case 13:return h("Suspense");case 19:return h("SuspenseList");case 0:case 2:case 15:return e=M(e.type,!1),e;case 11:return e=M(e.type.render,!1),e;case 1:return e=M(e.type,!0),e;default:return""}}function j(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ze:return"Fragment";case Ce:return"Portal";case xt:return"Profiler";case Qe:return"StrictMode";case Fe:return"Suspense";case be:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $t:return(e.displayName||"Context")+".Consumer";case ht:return(e._context.displayName||"Context")+".Provider";case st:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case at:return t=e.displayName||null,t!==null?t:j(e.type)||"Memo";case Te:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}function Q(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return j(t);case 8:return t===Qe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function A(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function je(e){var t=Z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,u.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){e._valueTracker||(e._valueTracker=je(e))}function zo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Z(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function zl(e,t){var n=t.checked;return _({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function To(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=A(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Lo(e,t){t=t.checked,t!=null&&Je(e,"checked",t,!1)}function Tl(e,t){Lo(e,t);var n=A(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ll(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ll(e,t.type,A(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ro(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ll(e,t,n){(t!=="number"||gr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Rn=Array.isArray;function un(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function On(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Dn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ma=["Webkit","ms","Moz","O"];Object.keys(Dn).forEach(function(e){Ma.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Dn[t]=Dn[e]})});function jo(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Dn.hasOwnProperty(e)&&Dn[e]?(""+t).trim():t+"px"}function Uo(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=jo(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ia=_({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dl(e,t){if(t){if(Ia[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(m(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(m(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(m(61))}if(t.style!=null&&typeof t.style!="object")throw Error(m(62))}}function Ml(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Il=null;function Fl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jl=null,on=null,sn=null;function Ao(e){if(e=tr(e)){if(typeof jl!="function")throw Error(m(280));var t=e.stateNode;t&&(t=Hr(t),jl(e.stateNode,e.type,t))}}function Vo(e){on?sn?sn.push(e):sn=[e]:on=e}function Bo(){if(on){var e=on,t=sn;if(sn=on=null,Ao(e),t)for(e=0;e>>=0,e===0?32:31-(Ka(e)/Ya|0)|0}var Cr=64,xr=4194304;function jn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,o=n&268435455;if(o!==0){var i=o&~l;i!==0?r=jn(i):(u&=o,u!==0&&(r=jn(u)))}else o=n&~l,o!==0?r=jn(o):u!==0&&(r=jn(u));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Un(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-et(t),e[t]=n}function Ja(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Kn),vi=" ",hi=!1;function yi(e,t){switch(e){case"keyup":return Pf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gi(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cn=!1;function zf(e,t){switch(e){case"compositionend":return gi(t);case"keypress":return t.which!==32?null:(hi=!0,vi);case"textInput":return e=t.data,e===vi&&hi?null:e;default:return null}}function Tf(e,t){if(cn)return e==="compositionend"||!tu&&yi(e,t)?(e=ai(),Rr=Gl=Lt=null,cn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xi(n)}}function Ni(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ni(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zi(){for(var e=window,t=gr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gr(e.document)}return t}function lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Uf(e){var t=zi(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ni(n.ownerDocument.documentElement,n)){if(r!==null&&lu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=Pi(n,u);var o=Pi(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,dn=null,uu=null,Zn=null,ou=!1;function Ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ou||dn==null||dn!==gr(r)||(r=dn,"selectionStart"in r&&lu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zn&&Gn(Zn,r)||(Zn=r,r=Ar(uu,"onSelect"),0yn||(e.current=gu[yn],gu[yn]=null,yn--)}function $(e,t){yn++,gu[yn]=e.current,e.current=t}var Mt={},we=Dt(Mt),Le=Dt(!1),Xt=Mt;function gn(e,t){var n=e.type.contextTypes;if(!n)return Mt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Re(e){return e=e.childContextTypes,e!=null}function Wr(){Y(Le),Y(we)}function Qi(e,t,n){if(we.current!==Mt)throw Error(m(168));$(we,t),$(Le,n)}function $i(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(m(108,Q(e)||"Unknown",l));return _({},n,r)}function Qr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mt,Xt=we.current,$(we,e),$(Le,Le.current),!0}function Ki(e,t,n){var r=e.stateNode;if(!r)throw Error(m(169));n?(e=$i(e,t,Xt),r.__reactInternalMemoizedMergedChildContext=e,Y(Le),Y(we),$(we,e)):Y(Le),$(Le,n)}var gt=null,$r=!1,wu=!1;function Yi(e){gt===null?gt=[e]:gt.push(e)}function Zf(e){$r=!0,Yi(e)}function It(){if(!wu&>!==null){wu=!0;var e=0,t=V;try{var n=gt;for(V=1;e>=o,l-=o,wt=1<<32-et(t)+l|n<R?(de=z,z=null):de=z.sibling;var U=v(c,z,d[R],w);if(U===null){z===null&&(z=de);break}e&&z&&U.alternate===null&&t(c,z),a=u(U,a,R),N===null?P=U:N.sibling=U,N=U,z=de}if(R===d.length)return n(c,z),J&&Zt(c,R),P;if(z===null){for(;RR?(de=z,z=null):de=z.sibling;var Qt=v(c,z,U.value,w);if(Qt===null){z===null&&(z=de);break}e&&z&&Qt.alternate===null&&t(c,z),a=u(Qt,a,R),N===null?P=Qt:N.sibling=Qt,N=Qt,z=de}if(U.done)return n(c,z),J&&Zt(c,R),P;if(z===null){for(;!U.done;R++,U=d.next())U=g(c,U.value,w),U!==null&&(a=u(U,a,R),N===null?P=U:N.sibling=U,N=U);return J&&Zt(c,R),P}for(z=r(c,z);!U.done;R++,U=d.next())U=k(z,c,R,U.value,w),U!==null&&(e&&U.alternate!==null&&z.delete(U.key===null?R:U.key),a=u(U,a,R),N===null?P=U:N.sibling=U,N=U);return e&&z.forEach(function(Lc){return t(c,Lc)}),J&&Zt(c,R),P}function le(c,a,d,w){if(typeof d=="object"&&d!==null&&d.type===ze&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case qe:e:{for(var P=d.key,N=a;N!==null;){if(N.key===P){if(P=d.type,P===ze){if(N.tag===7){n(c,N.sibling),a=l(N,d.props.children),a.return=c,c=a;break e}}else if(N.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Te&&bi(P)===N.type){n(c,N.sibling),a=l(N,d.props),a.ref=nr(c,N,d),a.return=c,c=a;break e}n(c,N);break}else t(c,N);N=N.sibling}d.type===ze?(a=ln(d.props.children,c.mode,w,d.key),a.return=c,c=a):(w=wl(d.type,d.key,d.props,null,c.mode,w),w.ref=nr(c,a,d),w.return=c,c=w)}return o(c);case Ce:e:{for(N=d.key;a!==null;){if(a.key===N)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){n(c,a.sibling),a=l(a,d.children||[]),a.return=c,c=a;break e}else{n(c,a);break}else t(c,a);a=a.sibling}a=yo(d,c.mode,w),a.return=c,c=a}return o(c);case Te:return N=d._init,le(c,a,N(d._payload),w)}if(Rn(d))return C(c,a,d,w);if(L(d))return x(c,a,d,w);Gr(c,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(n(c,a.sibling),a=l(a,d),a.return=c,c=a):(n(c,a),a=ho(d,c.mode,w),a.return=c,c=a),o(c)):n(c,a)}return le}var En=es(!0),ts=es(!1),Zr=Dt(null),Jr=null,_n=null,xu=null;function Pu(){xu=_n=Jr=null}function Nu(e){var t=Zr.current;Y(Zr),e._currentValue=t}function zu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Cn(e,t){Jr=e,xu=_n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Oe=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(xu!==e)if(e={context:e,memoizedValue:t,next:null},_n===null){if(Jr===null)throw Error(m(308));_n=e,Jr.dependencies={lanes:0,firstContext:e}}else _n=_n.next=e;return t}var Jt=null;function Tu(e){Jt===null?Jt=[e]:Jt.push(e)}function ns(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Tu(t)):(n.next=l.next,l.next=n),t.interleaved=n,kt(e,r)}function kt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ft=!1;function Lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Et(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(I&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,kt(e,n)}return l=r.interleaved,l===null?(t.next=t,Tu(r)):(t.next=l.next,l.next=t),r.interleaved=t,kt(e,n)}function qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ql(e,n)}}function ls(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?l=u=o:u=u.next=o,n=n.next}while(n!==null);u===null?l=u=t:u=u.next=t}else l=u=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function br(e,t,n,r){var l=e.updateQueue;Ft=!1;var u=l.firstBaseUpdate,o=l.lastBaseUpdate,i=l.shared.pending;if(i!==null){l.shared.pending=null;var s=i,p=s.next;s.next=null,o===null?u=p:o.next=p,o=s;var y=e.alternate;y!==null&&(y=y.updateQueue,i=y.lastBaseUpdate,i!==o&&(i===null?y.firstBaseUpdate=p:i.next=p,y.lastBaseUpdate=s))}if(u!==null){var g=l.baseState;o=0,y=p=s=null,i=u;do{var v=i.lane,k=i.eventTime;if((r&v)===v){y!==null&&(y=y.next={eventTime:k,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var C=e,x=i;switch(v=t,k=n,x.tag){case 1:if(C=x.payload,typeof C=="function"){g=C.call(k,g,v);break e}g=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=x.payload,v=typeof C=="function"?C.call(k,g,v):C,v==null)break e;g=_({},g,v);break e;case 2:Ft=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,v=l.effects,v===null?l.effects=[i]:v.push(i))}else k={eventTime:k,lane:v,tag:i.tag,payload:i.payload,callback:i.callback,next:null},y===null?(p=y=k,s=g):y=y.next=k,o|=v;if(i=i.next,i===null){if(i=l.shared.pending,i===null)break;v=i,i=v.next,v.next=null,l.lastBaseUpdate=v,l.shared.pending=null}}while(!0);if(y===null&&(s=g),l.baseState=s,l.firstBaseUpdate=p,l.lastBaseUpdate=y,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);en|=o,e.lanes=o,e.memoizedState=g}}function us(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Iu.transition;Iu.transition={};try{e(!1),t()}finally{V=n,Iu.transition=r}}function Cs(){return Xe().memoizedState}function ec(e,t,n){var r=Bt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xs(e))Ps(t,n);else if(n=ns(e,t,n,r),n!==null){var l=Pe();ot(n,e,r,l),Ns(n,t,r)}}function tc(e,t,n){var r=Bt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xs(e))Ps(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var o=t.lastRenderedState,i=u(o,n);if(l.hasEagerState=!0,l.eagerState=i,tt(i,o)){var s=t.interleaved;s===null?(l.next=l,Tu(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=ns(e,t,l,r),n!==null&&(l=Pe(),ot(n,e,r,l),Ns(n,t,r))}}function xs(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Ps(e,t){or=nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ql(e,n)}}var ul={readContext:Ye,useCallback:Se,useContext:Se,useEffect:Se,useImperativeHandle:Se,useInsertionEffect:Se,useLayoutEffect:Se,useMemo:Se,useReducer:Se,useRef:Se,useState:Se,useDebugValue:Se,useDeferredValue:Se,useTransition:Se,useMutableSource:Se,useSyncExternalStore:Se,useId:Se,unstable_isNewReconciler:!1},nc={readContext:Ye,useCallback:function(e,t){return pt().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:hs,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,rl(4194308,4,ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return rl(4,2,e,t)},useMemo:function(e,t){var n=pt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=pt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ec.bind(null,ee,e),[r.memoizedState,e]},useRef:function(e){var t=pt();return e={current:e},t.memoizedState=e},useState:ms,useDebugValue:Hu,useDeferredValue:function(e){return pt().memoizedState=e},useTransition:function(){var e=ms(!1),t=e[0];return e=bf.bind(null,e[1]),pt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ee,l=pt();if(J){if(n===void 0)throw Error(m(407));n=n()}else{if(n=t(),ce===null)throw Error(m(349));(bt&30)!==0||as(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,hs(cs.bind(null,r,u,e),[e]),r.flags|=2048,ar(9,fs.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=pt(),t=ce.identifierPrefix;if(J){var n=St,r=wt;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ir++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ct]=t,e[er]=r,Ys(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ml(n,r),n){case"dialog":K("cancel",e),K("close",e),l=r;break;case"iframe":case"object":case"embed":K("load",e),l=r;break;case"video":case"audio":for(l=0;lTn&&(t.flags|=128,r=!0,fr(u,!1),t.lanes=4194304)}else{if(!r)if(e=el(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!J)return ke(t),null}else 2*re()-u.renderingStartTime>Tn&&n!==1073741824&&(t.flags|=128,r=!0,fr(u,!1),t.lanes=4194304);u.isBackwards?(o.sibling=t.child,t.child=o):(n=u.last,n!==null?n.sibling=o:t.child=o,u.last=o)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=re(),t.sibling=null,n=b.current,$(b,r?n&1|2:n&1),t):(ke(t),null);case 22:case 23:return po(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Be&1073741824)!==0&&(ke(t),t.subtreeFlags&6&&(t.flags|=8192)):ke(t),null;case 24:return null;case 25:return null}throw Error(m(156,t.tag))}function fc(e,t){switch(ku(t),t.tag){case 1:return Re(t.type)&&Wr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(),Y(Le),Y(we),Mu(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ou(t),null;case 13:if(Y(b),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(m(340));kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(b),null;case 4:return xn(),null;case 10:return Nu(t.type._context),null;case 22:case 23:return po(),null;case 24:return null;default:return null}}var al=!1,Ee=!1,cc=typeof WeakSet=="function"?WeakSet:Set,E=null;function Nn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ne(e,t,r)}else n.current=null}function eo(e,t,n){try{n()}catch(r){ne(e,t,r)}}var Zs=!1;function dc(e,t){if(du=Tr,e=zi(),lu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var o=0,i=-1,s=-1,p=0,y=0,g=e,v=null;t:for(;;){for(var k;g!==n||l!==0&&g.nodeType!==3||(i=o+l),g!==u||r!==0&&g.nodeType!==3||(s=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(k=g.firstChild)!==null;)v=g,g=k;for(;;){if(g===e)break t;if(v===n&&++p===l&&(i=o),v===u&&++y===r&&(s=o),(k=g.nextSibling)!==null)break;g=v,v=g.parentNode}g=k}n=i===-1||s===-1?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(pu={focusedElem:e,selectionRange:n},Tr=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var C=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var x=C.memoizedProps,le=C.memoizedState,c=t.stateNode,a=c.getSnapshotBeforeUpdate(t.elementType===t.type?x:rt(t.type,x),le);c.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(m(163))}}catch(w){ne(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return C=Zs,Zs=!1,C}function cr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&eo(t,n,u)}l=l.next}while(l!==r)}}function fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function to(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Js(e){var t=e.alternate;t!==null&&(e.alternate=null,Js(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ct],delete t[er],delete t[yu],delete t[Xf],delete t[Gf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qs(e){return e.tag===5||e.tag===3||e.tag===4}function bs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qs(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function no(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Br));else if(r!==4&&(e=e.child,e!==null))for(no(e,t,n),e=e.sibling;e!==null;)no(e,t,n),e=e.sibling}function ro(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ro(e,t,n),e=e.sibling;e!==null;)ro(e,t,n),e=e.sibling}var ve=null,lt=!1;function Ut(e,t,n){for(n=n.child;n!==null;)ea(e,t,n),n=n.sibling}function ea(e,t,n){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(_r,n)}catch{}switch(n.tag){case 5:Ee||Nn(n,t);case 6:var r=ve,l=lt;ve=null,Ut(e,t,n),ve=r,lt=l,ve!==null&&(lt?(e=ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ve.removeChild(n.stateNode));break;case 18:ve!==null&&(lt?(e=ve,n=n.stateNode,e.nodeType===8?hu(e.parentNode,n):e.nodeType===1&&hu(e,n),Wn(e)):hu(ve,n.stateNode));break;case 4:r=ve,l=lt,ve=n.stateNode.containerInfo,lt=!0,Ut(e,t,n),ve=r,lt=l;break;case 0:case 11:case 14:case 15:if(!Ee&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&((u&2)!==0||(u&4)!==0)&&eo(n,t,o),l=l.next}while(l!==r)}Ut(e,t,n);break;case 1:if(!Ee&&(Nn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){ne(n,t,i)}Ut(e,t,n);break;case 21:Ut(e,t,n);break;case 22:n.mode&1?(Ee=(r=Ee)||n.memoizedState!==null,Ut(e,t,n),Ee=r):Ut(e,t,n);break;default:Ut(e,t,n)}}function ta(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cc),t.forEach(function(r){var l=kc.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mc(r/1960))-r,10e?16:e,Vt===null)var r=!1;else{if(e=Vt,Vt=null,vl=0,(I&6)!==0)throw Error(m(331));var l=I;for(I|=4,E=e.current;E!==null;){var u=E,o=u.child;if((E.flags&16)!==0){var i=u.deletions;if(i!==null){for(var s=0;sre()-oo?nn(e,0):uo|=n),Me(e,t)}function ma(e,t){t===0&&((e.mode&1)===0?t=1:(t=xr,xr<<=1,(xr&130023424)===0&&(xr=4194304)));var n=Pe();e=kt(e,t),e!==null&&(Un(e,t,n),Me(e,n))}function Sc(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ma(e,n)}function kc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(m(314))}r!==null&&r.delete(t),ma(e,n)}var va;va=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Le.current)Oe=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Oe=!1,sc(e,t,n);Oe=(e.flags&131072)!==0}else Oe=!1,J&&(t.flags&1048576)!==0&&Xi(t,Yr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;sl(e,t),e=t.pendingProps;var l=gn(t,we.current);Cn(t,n),l=ju(null,t,r,e,l,n);var u=Uu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Re(r)?(u=!0,Qr(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Lu(t),l.updater=ol,t.stateNode=l,l._reactInternals=t,Qu(t,r,e,n),t=Xu(null,t,r,!0,u,n)):(t.tag=0,J&&u&&Su(t),xe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(sl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=_c(r),e=rt(r,e),l){case 0:t=Yu(null,t,r,e,n);break e;case 1:t=Bs(null,t,r,e,n);break e;case 11:t=Fs(null,t,r,e,n);break e;case 14:t=js(null,t,r,rt(r.type,e),n);break e}throw Error(m(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),Yu(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),Bs(e,t,r,l,n);case 3:e:{if(Hs(t),e===null)throw Error(m(387));r=t.pendingProps,u=t.memoizedState,l=u.element,rs(e,t),br(t,r,null,n);var o=t.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=Pn(Error(m(423)),t),t=Ws(e,t,r,n,l);break e}else if(r!==l){l=Pn(Error(m(424)),t),t=Ws(e,t,r,n,l);break e}else for(Ve=Ot(t.stateNode.containerInfo.firstChild),Ae=t,J=!0,nt=null,n=ts(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(kn(),r===l){t=_t(e,t,n);break e}xe(e,t,r,n)}t=t.child}return t;case 5:return os(t),e===null&&_u(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,mu(r,l)?o=null:u!==null&&mu(r,u)&&(t.flags|=32),Vs(e,t),xe(e,t,o,n),t.child;case 6:return e===null&&_u(t),null;case 13:return Qs(e,t,n);case 4:return Ru(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=En(t,null,r,n):xe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),Fs(e,t,r,l,n);case 7:return xe(e,t,t.pendingProps,n),t.child;case 8:return xe(e,t,t.pendingProps.children,n),t.child;case 12:return xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,o=l.value,$(Zr,r._currentValue),r._currentValue=o,u!==null)if(tt(u.value,o)){if(u.children===l.children&&!Le.current){t=_t(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=Et(-1,n&-n),s.tag=2;var p=u.updateQueue;if(p!==null){p=p.shared;var y=p.pending;y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),zu(u.return,n,t),i.lanes|=n;break}s=s.next}}else if(u.tag===10)o=u.type===t.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(m(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),zu(o,n,t),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===t){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}xe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Cn(t,n),l=Ye(l),r=r(l),t.flags|=1,xe(e,t,r,n),t.child;case 14:return r=t.type,l=rt(r,t.pendingProps),l=rt(r.type,l),js(e,t,r,l,n);case 15:return Us(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),sl(e,t),t.tag=1,Re(r)?(e=!0,Qr(t)):e=!1,Cn(t,n),Ts(t,r,l),Qu(t,r,l,n),Xu(null,t,r,!0,e,n);case 19:return Ks(e,t,n);case 22:return As(e,t,n)}throw Error(m(156,t.tag))};function ha(e,t){return Go(e,t)}function Ec(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ze(e,t,n,r){return new Ec(e,t,n,r)}function vo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _c(e){if(typeof e=="function")return vo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===st)return 11;if(e===at)return 14}return 2}function Wt(e,t){var n=e.alternate;return n===null?(n=Ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wl(e,t,n,r,l,u){var o=2;if(r=e,typeof e=="function")vo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ze:return ln(n.children,l,u,t);case Qe:o=8,l|=8;break;case xt:return e=Ze(12,n,t,l|2),e.elementType=xt,e.lanes=u,e;case Fe:return e=Ze(13,n,t,l),e.elementType=Fe,e.lanes=u,e;case be:return e=Ze(19,n,t,l),e.elementType=be,e.lanes=u,e;case te:return Sl(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ht:o=10;break e;case $t:o=9;break e;case st:o=11;break e;case at:o=14;break e;case Te:o=16,r=null;break e}throw Error(m(130,e==null?e:typeof e,""))}return t=Ze(o,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function ln(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function Sl(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=te,e.lanes=n,e.stateNode={isHidden:!1},e}function ho(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function yo(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cc(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wl(0),this.expirationTimes=Wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function go(e,t,n,r,l,u,o,i,s){return e=new Cc(e,t,n,i,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Ze(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lu(u),e}function xc(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T)}catch(W){console.error(W)}}return T(),Co.exports=jc(),Co.exports}var La;function Uc(){if(La)return Nl;La=1;var T=Oa();return Nl.createRoot=T.createRoot,Nl.hydrateRoot=T.hydrateRoot,Nl}var Wc=Uc(),Da=No();const Ac=Ra(Da),Qc=Rc({__proto__:null,default:Ac},[Da]);var Vc=Oa();const $c=Ra(Vc);export{Qc as R,Vc as a,$c as b,Ac as c,No as d,Wc as e,Bc as f,Ra as g,Hc as j,Da as r}; +`+u.stack}return{value:e,source:t,stack:l,digest:null}}function $u(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ku(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var uc=typeof WeakMap=="function"?WeakMap:Map;function Rs(e,t,n){n=Et(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pl||(pl=!0,io=r),Ku(e,t)},n}function Os(e,t,n){n=Et(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Ku(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(n.callback=function(){Ku(e,t),typeof r!="function"&&(At===null?At=new Set([this]):At.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ds(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new uc;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=wc.bind(null,e,t,n),t.then(e,e))}function Ms(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Is(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Et(-1,1),t.tag=2,jt(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var oc=ge.ReactCurrentOwner,Oe=!1;function xe(e,t,n,r){t.child=e===null?ts(t,null,n,r):En(t,e.child,n,r)}function Fs(e,t,n,r,l){n=n.render;var u=t.ref;return Cn(t,l),r=ju(e,t,n,r,u,l),n=Uu(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,_t(e,t,l)):(J&&n&&Su(t),t.flags|=1,xe(e,t,r,l),t.child)}function js(e,t,n,r,l){if(e===null){var u=n.type;return typeof u=="function"&&!vo(u)&&u.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=u,Us(e,t,u,r,l)):(e=wl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,(e.lanes&l)===0){var o=u.memoizedProps;if(n=n.compare,n=n!==null?n:Gn,n(o,r)&&e.ref===t.ref)return _t(e,t,l)}return t.flags|=1,e=Wt(u,r),e.ref=t.ref,e.return=t,t.child=e}function Us(e,t,n,r,l){if(e!==null){var u=e.memoizedProps;if(Gn(u,r)&&e.ref===t.ref)if(Oe=!1,t.pendingProps=r=u,(e.lanes&l)!==0)(e.flags&131072)!==0&&(Oe=!0);else return t.lanes=e.lanes,_t(e,t,l)}return Yu(e,t,n,r,l)}function As(e,t,n){var r=t.pendingProps,l=r.children,u=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},$(zn,Be),Be|=n;else{if((n&1073741824)===0)return e=u!==null?u.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,$(zn,Be),Be|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=u!==null?u.baseLanes:n,$(zn,Be),Be|=r}else u!==null?(r=u.baseLanes|n,t.memoizedState=null):r=n,$(zn,Be),Be|=r;return xe(e,t,l,n),t.child}function Vs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Yu(e,t,n,r,l){var u=Re(n)?Xt:we.current;return u=gn(t,u),Cn(t,l),n=ju(e,t,n,r,u,l),r=Uu(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,_t(e,t,l)):(J&&r&&Su(t),t.flags|=1,xe(e,t,n,l),t.child)}function Bs(e,t,n,r,l){if(Re(n)){var u=!0;Qr(t)}else u=!1;if(Cn(t,l),t.stateNode===null)sl(e,t),Ts(t,n,r),Qu(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,i=t.memoizedProps;o.props=i;var s=o.context,p=n.contextType;typeof p=="object"&&p!==null?p=Ye(p):(p=Re(n)?Xt:we.current,p=gn(t,p));var y=n.getDerivedStateFromProps,g=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function";g||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==r||s!==p)&&Ls(t,o,r,p),Ft=!1;var v=t.memoizedState;o.state=v,br(t,r,o,l),s=t.memoizedState,i!==r||v!==s||Le.current||Ft?(typeof y=="function"&&(Wu(t,n,y,r),s=t.memoizedState),(i=Ft||zs(t,n,i,r,v,s,p))?(g||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),o.props=r,o.state=s,o.context=p,r=i):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,rs(e,t),i=t.memoizedProps,p=t.type===t.elementType?i:rt(t.type,i),o.props=p,g=t.pendingProps,v=o.context,s=n.contextType,typeof s=="object"&&s!==null?s=Ye(s):(s=Re(n)?Xt:we.current,s=gn(t,s));var k=n.getDerivedStateFromProps;(y=typeof k=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==g||v!==s)&&Ls(t,o,r,s),Ft=!1,v=t.memoizedState,o.state=v,br(t,r,o,l);var C=t.memoizedState;i!==g||v!==C||Le.current||Ft?(typeof k=="function"&&(Wu(t,n,k,r),C=t.memoizedState),(p=Ft||zs(t,n,p,r,v,C,s)||!1)?(y||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,C,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,C,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=C),o.props=r,o.state=C,o.context=s,r=p):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),r=!1)}return Xu(e,t,n,r,u,l)}function Xu(e,t,n,r,l,u){Vs(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&Ki(t,n,!1),_t(e,t,u);r=t.stateNode,oc.current=t;var i=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=En(t,e.child,null,u),t.child=En(t,null,i,u)):xe(e,t,i,u),t.memoizedState=r.state,l&&Ki(t,n,!0),t.child}function Hs(e){var t=e.stateNode;t.pendingContext?Qi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Qi(e,t.context,!1),Ru(e,t.containerInfo)}function Ws(e,t,n,r,l){return kn(),Cu(l),t.flags|=256,xe(e,t,n,r),t.child}var Gu={dehydrated:null,treeContext:null,retryLane:0};function Zu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qs(e,t,n){var r=t.pendingProps,l=b.current,u=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(l&2)!==0),i?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),$(b,l&1),e===null)return _u(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(o=r.children,e=r.fallback,u?(r=t.mode,u=t.child,o={mode:"hidden",children:o},(r&1)===0&&u!==null?(u.childLanes=0,u.pendingProps=o):u=Sl(o,r,0,null),e=ln(e,r,n,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=Zu(n),t.memoizedState=Gu,e):Ju(t,o));if(l=e.memoizedState,l!==null&&(i=l.dehydrated,i!==null))return ic(e,t,o,r,i,l,n);if(u){u=r.fallback,o=t.mode,l=e.child,i=l.sibling;var s={mode:"hidden",children:r.children};return(o&1)===0&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=Wt(l,s),r.subtreeFlags=l.subtreeFlags&14680064),i!==null?u=Wt(i,u):(u=ln(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,r=u,u=t.child,o=e.child.memoizedState,o=o===null?Zu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},u.memoizedState=o,u.childLanes=e.childLanes&~n,t.memoizedState=Gu,r}return u=e.child,e=u.sibling,r=Wt(u,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ju(e,t){return t=Sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function il(e,t,n,r){return r!==null&&Cu(r),En(t,e.child,null,n),e=Ju(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ic(e,t,n,r,l,u,o){if(n)return t.flags&256?(t.flags&=-257,r=$u(Error(m(422))),il(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=r.fallback,l=t.mode,r=Sl({mode:"visible",children:r.children},l,0,null),u=ln(u,l,o,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,(t.mode&1)!==0&&En(t,e.child,null,o),t.child.memoizedState=Zu(o),t.memoizedState=Gu,u);if((t.mode&1)===0)return il(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var i=r.dgst;return r=i,u=Error(m(419)),r=$u(u,r,void 0),il(e,t,o,r)}if(i=(o&e.childLanes)!==0,Oe||i){if(r=ce,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(r.suspendedLanes|o))!==0?0:l,l!==0&&l!==u.retryLane&&(u.retryLane=l,kt(e,l),ot(r,e,l,-1))}return mo(),r=$u(Error(m(421))),il(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Sc.bind(null,e),l._reactRetry=t,null):(e=u.treeContext,Ve=Ot(l.nextSibling),Ae=t,J=!0,nt=null,e!==null&&($e[Ke++]=wt,$e[Ke++]=St,$e[Ke++]=Gt,wt=e.id,St=e.overflow,Gt=t),t=Ju(t,r.children),t.flags|=4096,t)}function $s(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zu(e.return,t,n)}function qu(e,t,n,r,l){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=r,u.tail=n,u.tailMode=l)}function Ks(e,t,n){var r=t.pendingProps,l=r.revealOrder,u=r.tail;if(xe(e,t,r.children,n),r=b.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$s(e,n,t);else if(e.tag===19)$s(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($(b,r),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&el(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),qu(t,!1,l,n,u);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&el(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}qu(t,!0,n,null,u);break;case"together":qu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _t(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),en|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(m(153));if(t.child!==null){for(e=t.child,n=Wt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sc(e,t,n){switch(t.tag){case 3:Hs(t),kn();break;case 5:os(t);break;case 1:Re(t.type)&&Qr(t);break;case 4:Ru(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;$(Zr,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?($(b,b.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Qs(e,t,n):($(b,b.current&1),e=_t(e,t,n),e!==null?e.sibling:null);$(b,b.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Ks(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),$(b,b.current),r)break;return null;case 22:case 23:return t.lanes=0,As(e,t,n)}return _t(e,t,n)}var Ys,bu,Xs,Gs;Ys=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},bu=function(){},Xs=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,qt(dt.current);var u=null;switch(n){case"input":l=zl(e,l),r=zl(e,r),u=[];break;case"select":l=_({},l,{value:void 0}),r=_({},r,{value:void 0}),u=[];break;case"textarea":l=Rl(e,l),r=Rl(e,r),u=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Br)}Dl(n,r);var o;n=null;for(p in l)if(!r.hasOwnProperty(p)&&l.hasOwnProperty(p)&&l[p]!=null)if(p==="style"){var i=l[p];for(o in i)i.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else p!=="dangerouslySetInnerHTML"&&p!=="children"&&p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(ue.hasOwnProperty(p)?u||(u=[]):(u=u||[]).push(p,null));for(p in r){var s=r[p];if(i=l?.[p],r.hasOwnProperty(p)&&s!==i&&(s!=null||i!=null))if(p==="style")if(i){for(o in i)!i.hasOwnProperty(o)||s&&s.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in s)s.hasOwnProperty(o)&&i[o]!==s[o]&&(n||(n={}),n[o]=s[o])}else n||(u||(u=[]),u.push(p,n)),n=s;else p==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,i=i?i.__html:void 0,s!=null&&i!==s&&(u=u||[]).push(p,s)):p==="children"?typeof s!="string"&&typeof s!="number"||(u=u||[]).push(p,""+s):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&(ue.hasOwnProperty(p)?(s!=null&&p==="onScroll"&&K("scroll",e),u||i===s||(u=[])):(u=u||[]).push(p,s))}n&&(u=u||[]).push("style",n);var p=u;(t.updateQueue=p)&&(t.flags|=4)}},Gs=function(e,t,n,r){n!==r&&(t.flags|=4)};function fr(e,t){if(!J)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ke(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ac(e,t,n){var r=t.pendingProps;switch(ku(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ke(t),null;case 1:return Re(t.type)&&Wr(),ke(t),null;case 3:return r=t.stateNode,xn(),Y(Le),Y(we),Mu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Xr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,nt!==null&&(fo(nt),nt=null))),bu(e,t),ke(t),null;case 5:Ou(t);var l=qt(ur.current);if(n=t.type,e!==null&&t.stateNode!=null)Xs(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(m(166));return ke(t),null}if(e=qt(dt.current),Xr(t)){r=t.stateNode,n=t.type;var u=t.memoizedProps;switch(r[ct]=t,r[er]=u,e=(t.mode&1)!==0,n){case"dialog":K("cancel",r),K("close",r);break;case"iframe":case"object":case"embed":K("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ct]=t,e[er]=r,Ys(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ml(n,r),n){case"dialog":K("cancel",e),K("close",e),l=r;break;case"iframe":case"object":case"embed":K("load",e),l=r;break;case"video":case"audio":for(l=0;lTn&&(t.flags|=128,r=!0,fr(u,!1),t.lanes=4194304)}else{if(!r)if(e=el(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!J)return ke(t),null}else 2*re()-u.renderingStartTime>Tn&&n!==1073741824&&(t.flags|=128,r=!0,fr(u,!1),t.lanes=4194304);u.isBackwards?(o.sibling=t.child,t.child=o):(n=u.last,n!==null?n.sibling=o:t.child=o,u.last=o)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=re(),t.sibling=null,n=b.current,$(b,r?n&1|2:n&1),t):(ke(t),null);case 22:case 23:return po(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Be&1073741824)!==0&&(ke(t),t.subtreeFlags&6&&(t.flags|=8192)):ke(t),null;case 24:return null;case 25:return null}throw Error(m(156,t.tag))}function fc(e,t){switch(ku(t),t.tag){case 1:return Re(t.type)&&Wr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(),Y(Le),Y(we),Mu(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ou(t),null;case 13:if(Y(b),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(m(340));kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(b),null;case 4:return xn(),null;case 10:return Nu(t.type._context),null;case 22:case 23:return po(),null;case 24:return null;default:return null}}var al=!1,Ee=!1,cc=typeof WeakSet=="function"?WeakSet:Set,E=null;function Nn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ne(e,t,r)}else n.current=null}function eo(e,t,n){try{n()}catch(r){ne(e,t,r)}}var Zs=!1;function dc(e,t){if(du=Tr,e=zi(),lu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var o=0,i=-1,s=-1,p=0,y=0,g=e,v=null;t:for(;;){for(var k;g!==n||l!==0&&g.nodeType!==3||(i=o+l),g!==u||r!==0&&g.nodeType!==3||(s=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(k=g.firstChild)!==null;)v=g,g=k;for(;;){if(g===e)break t;if(v===n&&++p===l&&(i=o),v===u&&++y===r&&(s=o),(k=g.nextSibling)!==null)break;g=v,v=g.parentNode}g=k}n=i===-1||s===-1?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(pu={focusedElem:e,selectionRange:n},Tr=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var C=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var x=C.memoizedProps,le=C.memoizedState,c=t.stateNode,a=c.getSnapshotBeforeUpdate(t.elementType===t.type?x:rt(t.type,x),le);c.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(m(163))}}catch(w){ne(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return C=Zs,Zs=!1,C}function cr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&eo(t,n,u)}l=l.next}while(l!==r)}}function fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function to(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Js(e){var t=e.alternate;t!==null&&(e.alternate=null,Js(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ct],delete t[er],delete t[yu],delete t[Xf],delete t[Gf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qs(e){return e.tag===5||e.tag===3||e.tag===4}function bs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qs(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function no(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Br));else if(r!==4&&(e=e.child,e!==null))for(no(e,t,n),e=e.sibling;e!==null;)no(e,t,n),e=e.sibling}function ro(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ro(e,t,n),e=e.sibling;e!==null;)ro(e,t,n),e=e.sibling}var ve=null,lt=!1;function Ut(e,t,n){for(n=n.child;n!==null;)ea(e,t,n),n=n.sibling}function ea(e,t,n){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(_r,n)}catch{}switch(n.tag){case 5:Ee||Nn(n,t);case 6:var r=ve,l=lt;ve=null,Ut(e,t,n),ve=r,lt=l,ve!==null&&(lt?(e=ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ve.removeChild(n.stateNode));break;case 18:ve!==null&&(lt?(e=ve,n=n.stateNode,e.nodeType===8?hu(e.parentNode,n):e.nodeType===1&&hu(e,n),Wn(e)):hu(ve,n.stateNode));break;case 4:r=ve,l=lt,ve=n.stateNode.containerInfo,lt=!0,Ut(e,t,n),ve=r,lt=l;break;case 0:case 11:case 14:case 15:if(!Ee&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&((u&2)!==0||(u&4)!==0)&&eo(n,t,o),l=l.next}while(l!==r)}Ut(e,t,n);break;case 1:if(!Ee&&(Nn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){ne(n,t,i)}Ut(e,t,n);break;case 21:Ut(e,t,n);break;case 22:n.mode&1?(Ee=(r=Ee)||n.memoizedState!==null,Ut(e,t,n),Ee=r):Ut(e,t,n);break;default:Ut(e,t,n)}}function ta(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cc),t.forEach(function(r){var l=kc.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mc(r/1960))-r,10e?16:e,Vt===null)var r=!1;else{if(e=Vt,Vt=null,vl=0,(I&6)!==0)throw Error(m(331));var l=I;for(I|=4,E=e.current;E!==null;){var u=E,o=u.child;if((E.flags&16)!==0){var i=u.deletions;if(i!==null){for(var s=0;sre()-oo?nn(e,0):uo|=n),Me(e,t)}function ma(e,t){t===0&&((e.mode&1)===0?t=1:(t=xr,xr<<=1,(xr&130023424)===0&&(xr=4194304)));var n=Pe();e=kt(e,t),e!==null&&(Un(e,t,n),Me(e,n))}function Sc(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ma(e,n)}function kc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(m(314))}r!==null&&r.delete(t),ma(e,n)}var va;va=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Le.current)Oe=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Oe=!1,sc(e,t,n);Oe=(e.flags&131072)!==0}else Oe=!1,J&&(t.flags&1048576)!==0&&Xi(t,Yr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;sl(e,t),e=t.pendingProps;var l=gn(t,we.current);Cn(t,n),l=ju(null,t,r,e,l,n);var u=Uu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Re(r)?(u=!0,Qr(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Lu(t),l.updater=ol,t.stateNode=l,l._reactInternals=t,Qu(t,r,e,n),t=Xu(null,t,r,!0,u,n)):(t.tag=0,J&&u&&Su(t),xe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(sl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=_c(r),e=rt(r,e),l){case 0:t=Yu(null,t,r,e,n);break e;case 1:t=Bs(null,t,r,e,n);break e;case 11:t=Fs(null,t,r,e,n);break e;case 14:t=js(null,t,r,rt(r.type,e),n);break e}throw Error(m(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),Yu(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),Bs(e,t,r,l,n);case 3:e:{if(Hs(t),e===null)throw Error(m(387));r=t.pendingProps,u=t.memoizedState,l=u.element,rs(e,t),br(t,r,null,n);var o=t.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=Pn(Error(m(423)),t),t=Ws(e,t,r,n,l);break e}else if(r!==l){l=Pn(Error(m(424)),t),t=Ws(e,t,r,n,l);break e}else for(Ve=Ot(t.stateNode.containerInfo.firstChild),Ae=t,J=!0,nt=null,n=ts(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(kn(),r===l){t=_t(e,t,n);break e}xe(e,t,r,n)}t=t.child}return t;case 5:return os(t),e===null&&_u(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,mu(r,l)?o=null:u!==null&&mu(r,u)&&(t.flags|=32),Vs(e,t),xe(e,t,o,n),t.child;case 6:return e===null&&_u(t),null;case 13:return Qs(e,t,n);case 4:return Ru(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=En(t,null,r,n):xe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),Fs(e,t,r,l,n);case 7:return xe(e,t,t.pendingProps,n),t.child;case 8:return xe(e,t,t.pendingProps.children,n),t.child;case 12:return xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,o=l.value,$(Zr,r._currentValue),r._currentValue=o,u!==null)if(tt(u.value,o)){if(u.children===l.children&&!Le.current){t=_t(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=Et(-1,n&-n),s.tag=2;var p=u.updateQueue;if(p!==null){p=p.shared;var y=p.pending;y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),zu(u.return,n,t),i.lanes|=n;break}s=s.next}}else if(u.tag===10)o=u.type===t.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(m(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),zu(o,n,t),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===t){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}xe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Cn(t,n),l=Ye(l),r=r(l),t.flags|=1,xe(e,t,r,n),t.child;case 14:return r=t.type,l=rt(r,t.pendingProps),l=rt(r.type,l),js(e,t,r,l,n);case 15:return Us(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:rt(r,l),sl(e,t),t.tag=1,Re(r)?(e=!0,Qr(t)):e=!1,Cn(t,n),Ts(t,r,l),Qu(t,r,l,n),Xu(null,t,r,!0,e,n);case 19:return Ks(e,t,n);case 22:return As(e,t,n)}throw Error(m(156,t.tag))};function ha(e,t){return Go(e,t)}function Ec(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ze(e,t,n,r){return new Ec(e,t,n,r)}function vo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _c(e){if(typeof e=="function")return vo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===st)return 11;if(e===at)return 14}return 2}function Wt(e,t){var n=e.alternate;return n===null?(n=Ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wl(e,t,n,r,l,u){var o=2;if(r=e,typeof e=="function")vo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ze:return ln(n.children,l,u,t);case Qe:o=8,l|=8;break;case xt:return e=Ze(12,n,t,l|2),e.elementType=xt,e.lanes=u,e;case Fe:return e=Ze(13,n,t,l),e.elementType=Fe,e.lanes=u,e;case be:return e=Ze(19,n,t,l),e.elementType=be,e.lanes=u,e;case te:return Sl(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ht:o=10;break e;case $t:o=9;break e;case st:o=11;break e;case at:o=14;break e;case Te:o=16,r=null;break e}throw Error(m(130,e==null?e:typeof e,""))}return t=Ze(o,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function ln(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function Sl(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=te,e.lanes=n,e.stateNode={isHidden:!1},e}function ho(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function yo(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cc(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wl(0),this.expirationTimes=Wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function go(e,t,n,r,l,u,o,i,s){return e=new Cc(e,t,n,i,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Ze(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lu(u),e}function xc(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T)}catch(W){console.error(W)}}return T(),Co.exports=jc(),Co.exports}var La;function Uc(){if(La)return Nl;La=1;var T=Oa();return Nl.createRoot=T.createRoot,Nl.hydrateRoot=T.hydrateRoot,Nl}var Wc=Uc(),Da=No();const Ac=Ra(Da),Qc=Rc({__proto__:null,default:Ac},[Da]);var Vc=Oa();const $c=Ra(Vc);export{Qc as R,Vc as a,$c as b,Ac as c,No as d,Bc as e,Wc as f,Ra as g,Hc as j,Da as r}; diff --git a/assets/video-CS-NQBfT.js b/assets/video-CS-NQBfT.js deleted file mode 100644 index fccad376579ce5c3222b6c1d19c04bf954f49607..0000000000000000000000000000000000000000 --- a/assets/video-CS-NQBfT.js +++ /dev/null @@ -1,26 +0,0 @@ -import{c as e}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],s=e("database",t);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],y=e("file-text",a);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],i=e("info",c);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],n=e("refresh-cw",o);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const d=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],k=e("video",d);export{s as D,y as F,i as I,n as R,k as V}; diff --git a/assets/x-BONnp2RF.js b/assets/x-BONnp2RF.js deleted file mode 100644 index fd5b45685955312c29f7966f9043e59a35e2012f..0000000000000000000000000000000000000000 --- a/assets/x-BONnp2RF.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as o}from"./index-D4nJsLyx.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],t=o("x",c);export{t as X}; diff --git a/avatar/avatar_body.png b/avatar/avatar_body.png index f349092856ea6eb32193950791c3ae3b62e4a934..b57ed998fc2acb8fb9d58145d277d7d37d1d70a5 100644 --- a/avatar/avatar_body.png +++ b/avatar/avatar_body.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:124da04f53f64ebe47d83d1c54b15559dbe10696fdfd2d51d33c7a5d30ee92ef -size 56620 +oid sha256:8c7c377876a377a78705723f5d7186747478d2d371023e94d23a39f37a0c1d43 +size 71960 diff --git a/avatar/left_horn.png b/avatar/left_horn.png index 33230b0f9dce1093811f0392d1d9f844aed94597..db592cd40349ec08cd48353dd294926d38e42970 100644 --- a/avatar/left_horn.png +++ b/avatar/left_horn.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3cac81061607192756ed8098c1544cae786b5acfa9790a68d1e5c102b1a5d4c -size 6518 +oid sha256:7ced0c469cb01e975a9f6d510e51360b88bc7046785c19db2cd76e54bb602982 +size 11119 diff --git a/avatar/pants_black.png b/avatar/pants_black.png index a6c6196e4ce0f2814d78716b62e3bb3110130bc5..e3ce4e08511d99c9d1fe8cfa32244b2861cfc71f 100644 --- a/avatar/pants_black.png +++ b/avatar/pants_black.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d8a08786143368d7cecc39803bb557d3c5fa1015f72cf3c886ff4d90c70f297a -size 7336 +oid sha256:18a7767c3e45a862d7384ecadafab6af892632ba93ff4f5e31401479f0c03644 +size 11818 diff --git a/avatar/pants_black_thumbnail.png b/avatar/pants_black_thumbnail.png index cbf60df6e7413e804370f4e9f1b4eec17b10baae..880c721e5e2c0420208366d9ea07b716df2d21ac 100644 --- a/avatar/pants_black_thumbnail.png +++ b/avatar/pants_black_thumbnail.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a06a41e2504a4a76a301e6996422c108e4d22156ea0b040ea4dc664a8abaabc9 -size 13116 +oid sha256:1eb90c7fae2bdd2acea0c44ea2cae90efc962103fca4246714d0741d9430a635 +size 21451 diff --git a/avatar/right_horn.png b/avatar/right_horn.png index 94843fa3bb79d290baba0453de0f857ee6c5b484..a7ed1ee3bab5721b56d9ff4a175cb2828df1ea2d 100644 --- a/avatar/right_horn.png +++ b/avatar/right_horn.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:10e4ff20e4a454c2ada728d1352303ed9530121ada859b3886a15d339fdef68f -size 6603 +oid sha256:400d22ce0574c79366363613b60946f0701e61399a1acb6addc87300599747dd +size 11162 diff --git a/avatar/shoes_black.png b/avatar/shoes_black.png index a1dd4c9f565042361863ab02cafc32e156835cb8..044655aacc257e53b7bebd2c2f8f9245e3afb2d9 100644 --- a/avatar/shoes_black.png +++ b/avatar/shoes_black.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6418ace3ccd3b6510e1c32cfa6d3aabd7c43b1bddeb1fe9550c641fb4dda2260 -size 4276 +oid sha256:695ce9813a10b3ea5e10a9eec2adfa9cf7fe9e169cbf8c3123db1a229f1aa95c +size 10112 diff --git a/avatar/shoes_black_thumbnail.png b/avatar/shoes_black_thumbnail.png index 6b27f9edf0305c3d5709272f4f8bf61509e77f97..a5c76d9527122b97083aba3e25afdaf2c9f3e6bc 100644 --- a/avatar/shoes_black_thumbnail.png +++ b/avatar/shoes_black_thumbnail.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3628dfa57c92db318bfe6ae70b3a96014b2c85727d09c5979bf658eb25d5a18c -size 6477 +oid sha256:52d88af92003f5fac54b2b8e53ac69e9c5a13ee0d57ab2ec0a536721cf8678ec +size 16803 diff --git a/avatar/uniform_blue.png b/avatar/uniform_blue.png index 00c89be751fdcd9bc8c84ad8d53b3bb5654759dd..a978d063ff6b985831cd357351a177f08ab54310 100644 --- a/avatar/uniform_blue.png +++ b/avatar/uniform_blue.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a3abc069b165c4e29bb698aee15808d085d0c03c76efe35aa1eb4504fdfbb17 -size 18726 +oid sha256:298b6cddd53e4b3637738ff276af958bd70dc63d3360f7d6a2243414f7a2fd1a +size 26395 diff --git a/avatar/uniform_blue_thumbnail.png b/avatar/uniform_blue_thumbnail.png index 944fb904d511a92ab8b619c2de75d548ee4f3a74..2c551d7581163a4be335816bd1aa4494378930b8 100644 --- a/avatar/uniform_blue_thumbnail.png +++ b/avatar/uniform_blue_thumbnail.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:926bb5477274120560bb1d59bb18dcc17e7c37514461a627d0cf061a6fafc29a -size 26481 +oid sha256:89630a6282382b214d4b10023dd7b54de8a9ccfb086f61d031e2c6f119aa165c +size 40816 diff --git a/avatar/uniform_pink.png b/avatar/uniform_pink.png index 5f23d47931180361f4a45e5c94f1e81b387dfbd3..eb05f686ac9dc916351d0bf0eaa9c66ff98f020b 100644 --- a/avatar/uniform_pink.png +++ b/avatar/uniform_pink.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1bb58cc098d59f93d57090c3ca92ff7f2313b009b89516b326c90cde7c873a30 -size 19030 +oid sha256:efa53dcbfa106c0d093720eeb74256c7f15200bab4ce907b259ca39a005d82e4 +size 25986 diff --git a/avatar/uniform_pink_thumbnail.png b/avatar/uniform_pink_thumbnail.png index 339269ffde357345b2207c1532ba22c7434d88d4..29218beebc352544e3abd151a857a523d032ff09 100644 --- a/avatar/uniform_pink_thumbnail.png +++ b/avatar/uniform_pink_thumbnail.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f4c1b0d3287bb7f34305ddffc7be103f81dce64f0bc0d73b4a0c4baec24fb7dc -size 26710 +oid sha256:daba15cf59ed92bfc8c7913fe4b43e349beecdc4598b6b1aac3a48a0cfb8a69a +size 41071 diff --git a/index.html b/index.html index 2f787ca40bc7413ceffc30d983ab008c4a42cbec..04640fc37d91e70bf18725676aa8f810a189b97e 100644 --- a/index.html +++ b/index.html @@ -25,13 +25,16 @@ #pp-static-loader .pp-spinner{width:1rem;height:1rem;border-radius:999px;border:2px solid #0284c7;border-top-color:transparent;animation:pp-spin 1.5s linear infinite} #pp-static-loader .pp-msg{margin:0;font-size:.875rem;font-weight:600;color:#64748b} - - - - - - - + + + + + + + + + +