PageSourceSearch

https://kanu.us/_next/static/chunks/pages/network-admin/classrooms/[classroomId]/students-08debf4ea5da44ed.js

js kanu.us collected 2026-10-07 03:01:47 UTC 65,872 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8177],{2216:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/network-admin/classrooms/[classroomId]/students",function(){return s(49601)}])},13548:()=>{},23694:(e,t,s)=>{"use strict";s.d(t,{S:()=>o});var a=s(84108),r=s(62544),n=s(6608),l=s(39772),i=s(54382);function o(e){let{tabs:t,isLoading:s,search:o,searchResults:c,refresh:d,applyLastMessage:u}=(0,a.RL)(),{subscribeLastMessage:h,subscribeUsersTyping:m}=(0,l._Q)(),p=(0,a.TA)();(0,r.useEffect)(()=>{let e=()=>void d();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[d]);let{mutate:x,cache:f}=(0,n.iX)();(0,r.useEffect)(()=>{let t,s=h(s=>{let r=u(s,{openChatId:e,selfId:p}),n=s.chat?`chat/${s.chat}`:null;(n&&f.get(n)?.data&&x(n,e=>e&&{...e,messages:(0,a.xz)(e.messages??[],s)},{revalidate:!1}),clearTimeout(t),r)?t=setTimeout(()=>void d(),1500):d()});return()=>{clearTimeout(t),s()}},[u,f,e,x,d,p,h]);let[g,b]=(0,r.useState)({}),v=(0,r.useRef)({});(0,r.useEffect)(()=>{let e=v.current,t=t=>{clearTimeout(e[t]),delete e[t],b(e=>{if(!(t in e))return e;let s={...e};return delete s[t],s})},s=m(s=>{if(!s?.chat)return;let a=s.chat;s.typing?(b(e=>({...e,[a]:`${s.user||"Someone"} is typing`})),clearTimeout(e[a]),e[a]=setTimeout(()=>t(a),6e3)):t(a)});return()=>{for(let t of(s(),Object.keys(e)))clearTimeout(e[t]);v.current={}}},[m]);let j=(e,t)=>e.map(e=>({row:g[e.id]?{...e,typingLabel:g[e.id]}:e,tab:t})),y=(e,t)=>(0,a.DD)(e.row,t.row);return{sections:[{key:"marketplace",label:"Marketplace",icon:i.p.marketplace,rows:[...j(t.consumer,"consumer"),...j(t.provider,"provider")].sort(y)},{key:"team",label:"My Team",icon:i.p.team,rows:j(t.team,"team").sort(y)},{key:"classroom",label:"Classroom",icon:i.p.classroom,rows:j(t.classroom,"classroom").sort(y)},{key:"staff",label:"Staff",icon:i.p.staff,rows:j(t.staff,"staff").sort(y)}],isLoading:s,search:o,searchResults:c,refresh:d}}},26473:()=>{},29675:()=>{},35681:e=>{e.exports={empty:"not-logged-in_empty__2_uZ3",empty_image:"not-logged-in_empty_image__dPx8j",empty_title:"not-logged-in_empty_title__jU94e",empty_message:"not-logged-in_empty_message__VLBGf"}},35687:(e,t,s)=>{"use strict";s.d(t,{L:()=>a.Q});var a=s(68686)},37472:(e,t,s)=>{"use strict";function a(e){let t={};for(let s of e)s.unread&&s.classroomId&&(t[s.classroomId]=(t[s.classroomId]??0)+s.unread);return t}function r(e,t){return t?a(e)[t]??0:0}function n(e){let t={};for(let s of e)if(s.unread)for(let e of s.participantIds??[])t[e]=(t[e]??0)+s.unread;return t}s.d(t,{VT:()=>r,ZY:()=>n,nc:()=>a})},39968:(e,t,s)=>{"use strict";s.d(t,{e:()=>j});var a=s(10940),r=s(62544),n=s(43652),l=s(27965),i=s(69789),o=s(76255),c=s(7684),d=s(35295),u=s(20788),h=s(58704),m=s(93176),p=s(21818),x=s(11461),f=s(99994),g=s(50316);let b=({networkName:e,collapsed:t,onToggle:s})=>{let r=(0,d.useRouter)(),{isLoading:n,classrooms:l}=(0,h.O)(),i=r.asPath.split("?")[0],o="string"==typeof r.query.classroomId?r.query.classroomId:void 0;return(0,a.jsxs)(g.n,{collapsed:t,onToggle:s,children:[(0,a.jsx)(p.m,{label:"Network",entityName:e,entityHref:"/network-admin",activeHref:r.pathname,links:[{label:"Training",href:"/network-admin/training",icon:u.z7B},{label:"People",href:"/network-admin/people",icon:u.SrR}]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,a.jsx)(f.H,{label:"Products",activeHref:r.pathname,items:[{label:"Marketplace",href:"/network-admin/marketplace",icon:u.$H1},{label:"Competitions",href:"/network-admin/competitions",icon:u.pyc}]}),(0,a.jsx)(x.y,{label:"Classrooms",groupHeader:{href:"/network-admin/classrooms",icon:u.Tb7},activeItemId:o,activeHref:i,items:n?[]:(0,m.c)(l,"/network-admin/classrooms")})]})]})};function v({breadcrumbSuffix:e,trailingBadge:t,actions:s,children:i}){let{networkAdmin:d}=(0,n.F)(),u=d?.networkName??"Your Network",{collapsed:h,onToggle:m}=(0,l.X)("network-admin-sidebar-collapsed"),[p,x]=(0,r.useState)(!1);return(0,a.jsxs)(c.N,{sidebar:(0,a.jsx)(b,{networkName:u,collapsed:h,onToggle:m}),breadcrumbs:[{label:u},...e],trailingBadge:t,extraActions:s,onMessagesClick:()=>x(!0),children:[i,p&&(0,a.jsx)(o._u,{onClose:()=>x(!1)})]})}let j=e=>(0,a.jsx)(i.n,{children:(0,a.jsx)(n.L,{children:(0,a.jsx)(v,{...e})})})},43652:(e,t,s)=>{"use strict";s.d(t,{F:()=>d,L:()=>c});
1var a=s(10940),r=s(62544),n=s(21072),l=s(25298),i=s(82887);let o=(0,r.createContext)({networkAdmin:null,isLoading:!1,error:void 0}),c=({children:e})=>{let{data:t,isLoading:s,error:r}=(0,n.Ay)("users/me/navigation",i.hS,{revalidateOnFocus:!1}),c=t?.role===l.tz.NETWORK_ADMIN?{networkId:t.network?._id,networkName:t.network?.title,moduleZero:t.moduleZero,moduleZeroRedirectId:t.voyageRedirect?.moduleZeroId,moduleZeroRedirectStepId:t.voyageRedirect?.stepId}:null;return(0,a.jsx)(o.Provider,{value:{networkAdmin:c,isLoading:s,error:r},children:e})},d=()=>(0,r.useContext)(o)},45269:(e,t,s)=>{"use strict";s.d(t,{Q:()=>r});var a=s(62544);function r(){let[e,t]=(0,a.useState)(0);return(0,a.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let s=()=>{let s=window.innerHeight-(e.height+e.offsetTop);t(s>80?Math.round(s):0)};return s(),e.addEventListener("resize",s),e.addEventListener("scroll",s),()=>{e.removeEventListener("resize",s),e.removeEventListener("scroll",s)}},[]),e}},49601:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(10940),r=s(38740),n=s.n(r),l=s(88359),i=s(39968),o=s(35687);let c=function(){let{classroomId:e,classroomTitle:t}=(0,o.L)();return(0,a.jsxs)(i.e,{breadcrumbSuffix:[{label:"Classrooms",href:"/network-admin/classrooms"},{label:t,href:`/network-admin/classrooms/${e}`},{label:"Students"}],children:[(0,a.jsx)(n(),{children:(0,a.jsxs)("title",{children:["Students \xb7 ",t," | KANU"]})}),(0,a.jsxs)("h1",{className:"sr-only",children:["Students \xb7 ",t]}),(0,a.jsx)(l.A,{classroomId:e})]})}},53950:()=>{},54382:(e,t,s)=>{"use strict";s.d(t,{Y:()=>i,p:()=>l});var a=s(10940),r=s(61913),n=s(62544);let l={marketplace:(0,a.jsx)(function(){return(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3 9.5 4.5 4h15L21 9.5M3 9.5h18M3 9.5v10h18v-10M3 9.5a2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 3 0",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},{}),team:(0,a.jsx)(function(){return(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"9",cy:"8",r:"3.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,a.jsx)("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0M16 5.5a3 3 0 0 1 0 5.6M17.5 19a5.4 5.4 0 0 0-2-4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})},{}),classroom:(0,a.jsx)(function(){return(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M12 4 2 8.5 12 13l10-4.5L12 4Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M6 10.5V16c0 1.4 2.7 2.5 6 2.5s6-1.1 6-2.5v-5.5M20 8.5V15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},{}),staff:(0,a.jsx)(function(){return(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M5 20V6.5L12 3l7 3.5V20",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M9 20v-5h6v5M9 11h.01M15 11h.01M12 11h.01",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},{})};function i({sections:e,hrefFor:t,selectedId:s,onSelect:l,linkComponent:o,onSearch:c,searchResults:d,hrefForSearch:u,isLoading:h}){let[m,p]=(0,n.useState)(""),[x,f]=(0,n.useState)({}),g=m.trim().length>0;(0,n.useEffect)(()=>{let e=m.trim();if(!e)return void c("");let t=setTimeout(()=>c(e),1e3);return()=>clearTimeout(t)},[m,c]);let b=(e,t)=>e.map(({row:e,tab:n})=>(0,a.jsx)(r.gG,{item:e,href:t({row:e,tab:n}),linkComponent:o,selected:s===e.id,onSelect:l},`${n}-${e.id}`));return(0,a.jsxs)("div",{className:"flex flex-col h-full min-h-0 bg-white",children:[(0,a.jsx)("div",{className:"px-4 pt-4 pb-3",children:(0,a.jsx)("h2",{className:"text-lg font-bold text-black1 tracking-[0.4px]",children:"Message"})}),(0,a.jsx)("div",{className:"px-4 pb-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-softgrey1 px-3 py-2",children:[(0,a.jsx)("img",{src:"/assets/icon/search.svg",alt:"","aria-hidden":"true",className:"w-4 h-4"}),(0,a.jsx)("input",{className:"flex-1 bg-transparent text-sm outline-none placeholder:text-placeholder",type:"text",placeholder:"Search","aria-label":"Search conversations",value:m,onChange:e=>p(e.target.value),"data-e2e":"chats-search"})]})}),(0,a.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto pb-4",children:h?(0,a.jsx)("div",{role:"status",className:"px-4 py-3 text-sm text-text","data-e2e":"chats-loading",children:"Loading conversations…"}):g?d?0===d.users.length&&0===d.messages.length?(0,a.jsx)("div",{role:"status",className:"px-4 py-6 text-sm text-text","data-e2e":"chats-empty",children:"Nothing found!"}):(0,a.jsxs)(a.Fragment,{children:[d.users.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{className:"px-4 pt-2 pb-1 text-xs font-bold text-placeholder",children:"Users"}),b(d.users.map(e=>({row:e,tab:"team"})),({row:e})=>u(e.id))]}),d.messages.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{className:"px-4 pt-2 pb-1 text-xs font-bold text-placeholder",children:"Messages"}),b(d.messages.map(e=>({row:e,tab:"team"})),({row:e})=>u(e.id))]})]}):(0,a.jsx)("div",{role:"status",className:"px-4 py-3 text-sm text-text","data-e2e":"chats-loading",children:"Searching…"}):e.every(e=>0===e.rows.length)?(0,a.jsx)("div",{role:"status",className:"px-4 py-6 text-sm text-text","data-e2e":"chats-empty",children:"No conversation yet"}):e.filter(e=>e.rows.length>0).map(e=>{let s=x[e.key],r=e.rows.reduce((e,{row:t})=>e+(t.unread??0),0);return(0,a.jsxs)("section",{children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center gap-3 px-4 py-2.5 text-left text-black1 hover:bg-softgrey2","aria-expanded":!s,"aria-label":r>0?`${e.label}, ${r} unread`:e.label,"data-e2e":`chats-section-${e.key}`,onClick:()=>f(t=>({...t,[e.key]:!t[e.key]})),children:[(0,a.jsx)("span",{className:"text-text",children:e.icon}),(0,a.jsx)("span",{className:"flex-1 text-sm font-semibold tracking-[0.4px]",children:e.label}),r>0&&(0,a.jsx)("span",{"aria-hidden":"true",className:"min-w-[20px] rounded-full bg-red px-1.5 text-center text-xs font-bold leading-5 text-white",children:r}),(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:`transition-transform ${s?"":"rotate-180"}`,children:(0,a.jsx)("path",{d:"m6 9 6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),!s&&b(e.rows,t)]},e.key)})})]})}},55445:(e,t,s)=>{"use strict";s.d(t,{f:()=>l});var a=s(21072),r=s(82887);let n=e=>(0,r.Ay)().get(e).then(e=>e.data),l=e=>{let{data:t,isLoading:s,error:r}=(0,a.Ay)(e&&"[slug]"!==e?`admin/classroom/${e}`:null,n,{revalidateOnFocus:!1});return{isLoading:s,data:t??void 0,statistic:t?.statistic??void 0,classroom:t?.classroom??void 0,error:r}}},58704:(e,t,s)=>{"use strict";s.d(t,{O:()=>n});var a=s(21072),r=s(82887);let n=()=>{let{data:e,isLoading:t,error:s,mutate:n}=(0,a.Ay)("admin/classrooms",r.hS,{revalidateOnFocus:!0,revalidateIfStale:!0});return{isLoading:t,data:e,classrooms:e?e.classrooms:[],error:s,mutate:n}}},61913:(e,t,s)=>{"use strict";s.d(t,{u6:()=>c,RB:()=>u,gG:()=>i});
1var a=s(10940),r=s(62544);function n(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function l({href:e,children:t,...s}){return(0,a.jsx)("a",{href:e,...s,children:t})}function i({item:e,href:t,linkComponent:s=l,selected:r,onSelect:n}){let o=n?s=>{s.defaultPrevented||0!==s.button||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),n(e.id,t))}:void 0;return(0,a.jsxs)(s,{href:t,onClick:o,className:`dialog-item${r?" dialog-item--selected":""}`,"aria-current":r?"true":void 0,"data-e2e":"chat-list-item",children:[(0,a.jsx)("div",{className:"dialog-item__photo",children:e.photoUrl?(0,a.jsx)("img",{src:e.photoUrl,alt:""}):null}),(0,a.jsxs)("div",{className:"dialog-item__body",children:[e.requestReferenceId?(0,a.jsxs)("span",{className:"dialog-item__meta","data-e2e":"chat-request-id",children:["ID: ",e.requestReferenceId]}):null,(0,a.jsxs)("div",{className:"dialog-item__row",children:[(0,a.jsx)("span",{className:"dialog-item__name",children:e.name}),(0,a.jsx)("span",{className:"dialog-item__time",children:function(e,t=new Date){if(!e)return"";let s=new Date(e);return Number.isNaN(s.getTime())?"":s.getFullYear()===t.getFullYear()&&s.getMonth()===t.getMonth()&&s.getDate()===t.getDate()?s.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):s.getFullYear()===t.getFullYear()?s.toLocaleDateString([],{day:"numeric",month:"short"}):s.toLocaleDateString([],{day:"numeric",month:"short",year:"numeric"})}(e.timestamp)})]}),e.businessName?(0,a.jsx)("span",{className:"dialog-item__meta","data-e2e":"chat-row-business",children:e.businessName}):null,(0,a.jsxs)("div",{className:"dialog-item__row",children:[e.typingLabel?(0,a.jsx)("span",{className:"dialog-item__last dialog-item__last--typing","data-e2e":"chat-row-typing",children:e.typingLabel}):(0,a.jsx)("span",{className:"dialog-item__last",children:e.lastMessage||"Tap to start conversation"}),e.unread?(0,a.jsx)("span",{className:"dialog-item__unread",children:e.unread}):null]})]})]})}function o({images:e,index:t,onClose:s}){let[n,l]=(0,r.useState)(t),i=e.length-1;return(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&s(),"ArrowLeft"===e.key&&l(e=>e>0?e-1:e),"ArrowRight"===e.key&&l(e=>e<i?e+1:e)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s,i]),(0,a.jsxs)("div",{className:"chat-gallery",role:"dialog","aria-modal":"true","data-e2e":"chat-gallery",onClick:s,children:[(0,a.jsx)("img",{className:"chat-gallery__img",src:e[n],alt:"",onClick:e=>e.stopPropagation()}),(0,a.jsxs)("div",{className:"chat-gallery__controls",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("span",{className:"chat-gallery__counter",children:[n+1," of ",e.length]}),(0,a.jsxs)("div",{className:"chat-gallery__nav",children:[(0,a.jsx)("button",{type:"button","aria-label":"Previous photo",disabled:0===n,onClick:()=>l(e=>e>0?e-1:e),children:"‹"}),(0,a.jsx)("button",{type:"button","aria-label":"Next photo",disabled:n===i,onClick:()=>l(e=>e<i?e+1:e),children:"›"}),(0,a.jsx)("button",{type:"button",className:"chat-gallery__close","aria-label":"Close","data-e2e":"chat-gallery-close",onClick:s,children:"\xd7"})]})]})]})}function c({message:e}){return(0,a.jsx)("div",{className:"chat-thread-placeholder","data-e2e":"chat-thread-placeholder",children:(0,a.jsx)("p",{children:e??"Select a conversation to start messaging"})})}function d({message:e,onOpenPhoto:t,onReply:s,onRetry:r}){let n=["message",e.isMine?"message--mine":"",e.pending?"message--pending":"",e.failed?"message--failed":""].filter(Boolean).join(" ");return(0,a.jsxs)("div",{className:n,"data-e2e":"chat-message",children:[e.isMine?null:(0,a.jsx)("div",{className:"message__avatar",children:(0,a.jsx)("img",{src:e.avatarUrl||"/assets/default/user.svg",alt:""})}),(0,a.jsxs)("div",{className:"message__content",children:[(0,a.jsx)("span",{className:"message__time",children:function(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}(e.timestamp)}),e.quote?(0,a.jsxs)("div",{className:"message__quote","data-e2e":"chat-message-quote",children:[e.quote.author?(0,a.jsx)("span",{className:"message__quote-author",children:e.quote.author}):null,(0,a.jsx)("span",{className:"message__quote-text",children:e.quote.text})]}):null,e.text?(0,a.jsx)("p",{className:"message__text","data-e2e":"chat-message-text",children:e.text}):null,e.photos&&e.photos.length>0?(0,a.jsx)("div",{className:"message__photos","data-e2e":"chat-message-photos",children:e.photos.slice(0,4).map((s,r)=>(0,a.jsxs)("button",{type:"button",className:"message__photo","aria-label":"Open photo",onClick:()=>t?.(e.photos??[],r),children:[(0,a.jsx)("img",{src:s,alt:""}),3===r&&e.photos&&e.photos.length>4?(0,a.jsxs)("span",{className:"message__photo-more",children:["+",e.photos.length-4]}):null]},r))}):null,e.failed?(0,a.jsxs)("span",{className:"message__status message__status--failed",children:["Not sent",r?(0,a.jsx)("button",{type:"button",className:"message__retry","data-e2e":"chat-message-retry",onClick:()=>r(e.id),children:"Try again"}):null]}):null]}),!s||e.pending||e.failed?null:(0,a.jsx)("button",{type:"button",className:"message__reply","aria-label":"Reply","data-e2e":"chat-message-reply",onClick:()=>s(e.id),children:"↩"})]})}
1function u({title:e,subtitle:t,requestId:s,onRequestClick:l,typingLabel:i,messages:c,isLoading:h,isRefreshing:m,isSending:p,onSend:x,onType:f,onAttachFiles:g,attachments:b,onRemoveAttachment:v,replyTo:j,onReplyTo:y,onRetryMessage:w,onCancelReply:N,onBack:_,keyboardInset:k=0}){let[C,S]=(0,r.useState)(""),I=b??[],A=I.some(e=>void 0!==e.progress&&!e.failed),$=(C.trim().length>0||I.length>0)&&!p&&!A,[R,M]=(0,r.useState)(null),T=(0,r.useRef)(null),L=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=L.current;if(!e)return;let t=()=>{e.scrollTop=e.scrollHeight};t();let s=Array.from(e.querySelectorAll("img"));return s.forEach(e=>{e.complete||e.addEventListener("load",t,{once:!0})}),()=>s.forEach(e=>e.removeEventListener("load",t))},[c,k]);let E=()=>{$&&(x(C.trim()),S(""))};return(0,a.jsxs)("div",{className:"chat-thread",children:[(0,a.jsxs)("div",{className:"chat-thread__header",children:[_?(0,a.jsx)("button",{type:"button",className:"chat-thread__back","aria-label":"Back",onClick:_,children:(0,a.jsx)("img",{src:"/assets/icon/chevron-left.svg",alt:"","aria-hidden":"true"})}):null,(0,a.jsxs)("div",{className:"chat-thread__heading",children:[(0,a.jsx)("p",{className:"chat-thread__name","data-e2e":"chat-thread-name",children:e}),i?(0,a.jsxs)("p",{className:"chat-thread__typing","data-e2e":"chat-typing",children:[i,(0,a.jsxs)("span",{className:"chat-thread__typing-dots","aria-hidden":"true",children:[(0,a.jsx)("span",{className:"chat-thread__typing-dot"}),(0,a.jsx)("span",{className:"chat-thread__typing-dot"}),(0,a.jsx)("span",{className:"chat-thread__typing-dot"})]})]}):t?(0,a.jsx)("p",{className:"chat-thread__role",children:t}):null]})]}),s?(0,a.jsxs)("button",{type:"button",className:"chat-thread__banner","data-e2e":"chat-request-banner",onClick:l,children:[(0,a.jsx)("img",{src:"/assets/navigation-tabs/checklist-active.svg",alt:"","aria-hidden":"true"}),(0,a.jsxs)("span",{className:"chat-thread__banner-text",children:[(0,a.jsx)("span",{className:"chat-thread__banner-title",children:"Tap to check your Request"}),(0,a.jsxs)("span",{className:"chat-thread__banner-id",children:["ID: ",s]})]})]}):null,m?(0,a.jsxs)("div",{className:"chat-thread__refreshing",role:"status","data-e2e":"chat-thread-refreshing",children:[(0,a.jsx)("span",{className:"chat-thread__refreshing-bar","aria-hidden":"true"}),(0,a.jsx)("span",{className:"chat-thread__sr-only",children:"Checking for new messages"})]}):null,(0,a.jsxs)("div",{className:"chat-thread__messages",ref:L,"data-e2e":"chat-thread-messages",children:[c.map((e,t)=>{let s=n(e.timestamp)!==n(c[t-1]?.timestamp);return(0,a.jsxs)(r.Fragment,{children:[s&&e.timestamp?(0,a.jsx)("div",{className:"chat-thread__day","data-e2e":"chat-thread-day",children:(0,a.jsx)("span",{className:"chat-thread__day-label",children:function(e,t=new Date){if(!e)return"";let s=new Date(e);if(Number.isNaN(s.getTime()))return"";if(n(e)===n(t.toISOString()))return"Today";let a=new Date(t);return(a.setDate(t.getDate()-1),n(e)===n(a.toISOString()))?"Yesterday":s.getFullYear()===t.getFullYear()?s.toLocaleDateString([],{day:"numeric",month:"short"}):s.toLocaleDateString([],{day:"numeric",month:"short",year:"numeric"})}(e.timestamp)})}):null,(0,a.jsx)(d,{message:e,onOpenPhoto:(e,t)=>M({images:e,index:t}),onReply:y,onRetry:w})]},e.id)}),h||0!==c.length?null:(0,a.jsx)("div",{className:"chat-thread__empty","data-e2e":"chat-thread-empty",children:(0,a.jsx)("span",{children:"No messages yet. Say hello!"})})]}),(0,a.jsxs)("div",{className:"chat-thread__footer",style:k?{paddingBottom:k+12}:void 0,children:[j?(0,a.jsxs)("div",{className:"chat-thread__reply","data-e2e":"chat-reply-preview",children:[(0,a.jsxs)("div",{className:"chat-thread__reply-body",children:[j.author?(0,a.jsx)("span",{className:"chat-thread__reply-author",children:j.author}):null,(0,a.jsx)("span",{className:"chat-thread__reply-text",children:j.preview})]}),(0,a.jsx)("button",{type:"button",className:"chat-thread__reply-cancel","aria-label":"Cancel reply",onClick:N,children:"\xd7"})]}):null,I.length?(0,a.jsx)("div",{className:"chat-thread__attachments","data-e2e":"chat-attachments",children:I.map(e=>(0,a.jsxs)("div",{className:`chat-thread__thumb${e.failed?" chat-thread__thumb--failed":""}`,"data-e2e":"chat-attachment",children:[(0,a.jsx)("img",{src:e.previewUrl,alt:""}),void 0===e.progress||e.failed?null:(0,a.jsx)("span",{className:"chat-thread__thumb-progress",role:"progressbar","aria-valuenow":e.progress,"aria-label":"Uploading photo",children:(0,a.jsx)("span",{style:{width:`${e.progress}%`}})}),e.failed?(0,a.jsx)("span",{className:"chat-thread__thumb-failed",children:"Failed"}):null,(0,a.jsx)("button",{type:"button",className:"chat-thread__thumb-remove","aria-label":"Remove photo",onClick:()=>v?.(e.id),children:"\xd7"})]},e.id))}):null,(0,a.jsxs)("div",{className:"chat-thread__compose-row",children:[g?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{ref:T,type:"file",accept:"image/png,image/jpeg",multiple:!0,hidden:!0,"data-e2e":"chat-attach-input",onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&g(t),e.target.value=""}}),(0,a.jsx)("button",{type:"button",className:"chat-thread__attach","aria-label":"Attach photo",onClick:()=>T.current?.click(),children:(0,a.jsx)("img",{src:"/assets/icon/attachment.svg",alt:"","aria-hidden":"true"})})]}):null,(0,a.jsxs)("div",{className:"chat-thread__composer",children:[(0,a.jsx)("textarea",{className:"chat-thread__input","aria-label":"Message",placeholder:"Type a message",rows:1,value:C,onChange:e=>{S(e.target.value),f?.()},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),E())},"data-e2e":"chat-input"}),(0,a.jsx)("button",{type:"button",className:"chat-thread__send","aria-label":"Send",disabled:!$,onClick:E,"data-e2e":"chat-send",children:p?(0,a.jsx)("span",{className:"chat-thread__send-spinner","aria-hidden":"true"}):(0,a.jsx)("img",{src:"/assets/icon/send.svg",alt:"","aria-hidden":"true"})})]})]})]}),R?(0,a.jsx)(o,{images:R.images,index:R.index,onClose:()=>M(null)}):null]})}s(26473),s(94445),s(13548),s(90354),s(29675),s(53950)},62612:(e,t,s)=>{"use strict";s.d(t,{E:()=>i});var a=s(88073),r=s(21072),n=s(82887);let l=e=>(0,n.Ay)().get(e).then(e=>e.data),i=()=>{let e=(0,a.hasCookie)("accessToken"),{data:t,error:s,isLoading:n}=(0,r.Ay)(e?"notification?page=0&limit=20":null,l);return{items:t??[],error:s,isLoading:n,isLoggedIn:e}}},63540:(e,t,s)=>{"use strict";s.d(t,{M:()=>u});
1var a=s(10940),r=s(81772),n=s(11230),l=s.n(n),i=s(35295),o=s(62544),c=s(74619),d=s.n(c);let u=({id:e,open:t,onClose:s,children:n,anchorOriginVertical:c="bottom",anchorOriginHorizontal:u="right",transformOriginHorizontal:h="center",transformOriginVertical:m="top",width:p="276px",title:x,headerIcon:f,customContent:g})=>{let b=(0,i.useRouter)();return(0,o.useEffect)(()=>{let e=()=>{s()};return b.events.on("routeChangeStart",e),()=>{b.events.off("routeChangeStart",e)}},[b,s]),(0,a.jsx)(r.Ay,{id:e,open:!!t,anchorEl:t,onClose:s,elevation:2,anchorOrigin:{vertical:c,horizontal:u},transformOrigin:{vertical:m,horizontal:h},children:(0,a.jsxs)("div",{className:d().popover,style:{width:`${p}`},role:"dialog","aria-labelledby":x?`${e}-title`:void 0,"aria-label":x?void 0:e,children:[(x||f)&&(0,a.jsxs)("div",{className:d().header,children:[f,(0,a.jsx)("span",{id:`${e}-title`,children:x})]}),g?n:(0,a.jsx)("div",{className:l()(d().content,"scrollbar"),children:n})]})})}},67387:(e,t,s)=>{"use strict";s.d(t,{X8:()=>f,d3:()=>j});var a=s(10940),r=s(61913),n=s(84108),l=s(45269),i=s(90122),o=s.n(i),c=s(35295),d=s(62544),u=s(20788),h=s(41795),m=s(69789),p=s(54382),x=s(23694);function f(e){return"consumer"===e?"provider":"provider"===e?"consumer":"classroom"===e?"classroom":"team"}function g({chatId:e,type:t}){let s=(0,c.useRouter)(),{title:i,subtitle:o,request:u,messages:m,isLoading:p,isRefreshing:x,isSending:f,sendMessage:b,retrySend:v,typingLabel:j,notifyTyping:y,attachments:w,attachFiles:N,removeAttachment:_,replyTo:k,startReply:C,cancelReply:S,error:I}=(0,n.UU)(e,t),A=(0,l.Q)();return((0,d.useEffect)(()=>{(0,h.hE)({placements:"classroom"===t?[h.pE.CLASSROOM_CHAT]:[h.pE.CONSUMER_CHAT,h.pE.PROVIDER_CHAT,h.pE.TEAM_CHAT],modelId:e})},[e,t]),!I||m.length||p)?(0,a.jsx)(r.RB,{title:i,subtitle:o,requestId:u?.requestId,onRequestClick:u?()=>s.push(u.requestUrl):void 0,typingLabel:j,messages:m,isLoading:p,isRefreshing:x,isSending:f,onSend:b,onType:y,onAttachFiles:N,attachments:w,onRemoveAttachment:_,replyTo:k,onReplyTo:C,onRetryMessage:v,onCancelReply:S,onBack:()=>window.history.length>1?s.back():s.push("/chat"),keyboardInset:A}):(0,a.jsx)(r.u6,{message:"This conversation could not be opened."})}let b={student:"/student",admin:"/admin",networkAdmin:"/network-admin",coordinator:"/coordinator"};function v({chatId:e,type:t}){let s=(0,c.useRouter)(),l=function(e){var t;if(e.backHref&&(t=e.backHref).startsWith("/")&&!t.startsWith("//")&&!t.startsWith("/\\"))return{href:e.backHref,label:"Back to dashboard"};let s=e.from?b[e.from]:void 0;return s?{href:s,label:"Back to dashboard"}:{href:"/marketplace",label:"Explore Marketplace"}}({from:s.query.from,backHref:s.query.backHref}),{sections:i,isLoading:d,search:h,searchResults:m}=(0,x.S)(e),j=(0,n._h)(),y=s.query.from,w=e=>y?`${e}&from=${y}`:e,N=(0,a.jsx)(p.Y,{sections:i,hrefFor:({row:e,tab:t})=>w(`/chat/${e.id}?type=${f(t)}`),hrefForSearch:e=>w(`/chat/${e}?type=team`),onSearch:h,searchResults:m,isLoading:d,linkComponent:j,selectedId:e,onSelect:(e,t)=>s.push(t)});return(0,a.jsxs)("div",{className:"flex flex-col h-[100dvh] overflow-hidden bg-webapp",children:[(0,a.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-1/2 focus:-translate-x-1/2 focus:z-[100] focus:px-4 focus:py-2 focus:bg-white focus:text-green focus:rounded-lg focus:shadow-lg focus:outline-none",children:"Skip to main content"}),(0,a.jsxs)("header",{className:"flex flex-none items-center gap-4 border-b border-softgrey1 bg-white px-4 py-3",children:[(0,a.jsx)(o(),{href:"/","aria-label":"KANU home",className:"flex shrink-0 items-center",children:(0,a.jsx)(u.VTb,{className:"h-6 w-auto"})}),(0,a.jsx)("h1",{className:"min-w-0 truncate text-sm font-bold tracking-[0.4px] text-black1",children:"Inbox"}),(0,a.jsx)(o(),{href:l.href,className:"ml-auto shrink-0 whitespace-nowrap rounded-full border border-softgrey1 px-3 py-1.5 text-sm font-semibold text-black1 hover:bg-softgrey2",children:l.label})]}),(0,a.jsxs)("div",{className:"flex-1 min-h-0 desktop:grid desktop:grid-cols-[360px_1fr] desktop:gap-4 desktop:p-4",children:[(0,a.jsx)("aside",{"aria-label":"Conversations",className:`min-h-0 h-full overflow-hidden rounded-2xl bg-white ${e?"hidden desktop:block":"block"}`,children:N}
1),(0,a.jsx)("main",{id:"main-content",tabIndex:-1,className:`min-h-0 h-full overflow-hidden rounded-2xl bg-white outline-none ${e?"block":"hidden desktop:block"}`,children:e?(0,a.jsx)("div",{className:"kanu-chat-thread h-full",children:(0,a.jsx)(g,{chatId:e,type:t},e)}):(0,a.jsx)(r.u6,{})})]})]})}function j(e){return(0,a.jsx)(m.n,{children:(0,a.jsx)(v,{...e})})}},68686:(e,t,s)=>{"use strict";s.d(t,{Q:()=>n});var a=s(35295),r=s(55445);function n(){let e=(0,a.useRouter)(),t="string"==typeof e.query.classroomId?e.query.classroomId:"",{classroom:s,isLoading:n}=(0,r.f)(t);return{classroomId:t,classroomTitle:s?.abbreviation??s?.name??"Classroom",isLoading:n}}},69789:(e,t,s)=>{"use strict";s.d(t,{n:()=>x});var a=s(10940),r=s(88063),n=s(88073),l=s(90122),i=s.n(l),o=s(62544),c=s(82887),d=s(15755),u=s(49007);function h({href:e,children:t,...s}){return(0,a.jsx)(i(),{href:e,...s,children:t})}let m={async get(e){let t=await (0,c.Qg)(e);return t?.data??t},async post(e,t){let s=await (0,c.I9)(e,t);return s?.data??s}},p={requestUrl:(e,t)=>`/requests/${e}s/${t}`};function x({children:e}){let{data:t}=(0,d.J)(),s=t?._id??null,l=(0,o.useCallback)(()=>(0,n.getCookie)("accessToken")??null,[]),i=(0,o.useCallback)(()=>s,[s]),c=(0,o.useMemo)(u.N,[]);return(0,a.jsx)(r.g,{http:m,getToken:l,getUserId:i,wsBaseUrl:c,routes:p,linkComponent:h,children:e})}},74619:e=>{e.exports={popover:"basic-popover_popover__bZNRl",header:"basic-popover_header__dTSb_",content:"basic-popover_content__R2ouy"}},76255:(e,t,s)=>{"use strict";s.d(t,{_u:()=>p});var a=s(10940),r=s(61913),n=s(84108),l=s(62544),i=s(61682),o=s(69789),c=s(96246),d=s(54382),u=s(67387),h=s(23694);function m(){let[e,t]=(0,l.useState)(),{sections:s,isLoading:i,search:o,searchResults:m}=(0,h.S)(e?.chatId),p=(0,n._h)(),x=(0,a.jsx)(d.Y,{sections:s,hrefFor:({row:e,tab:t})=>`/chat/${e.id}?type=${(0,u.X8)(t)}`,hrefForSearch:e=>`/chat/${e}?type=team`,onSearch:o,searchResults:m,isLoading:i,linkComponent:p,selectedId:e?.chatId,onSelect:(e,s)=>t({chatId:e,type:new URLSearchParams(s.split("?")[1]).get("type")??void 0})});return(0,a.jsxs)("div",{className:"flex w-[860px] max-w-[100vw] h-screen overflow-hidden bg-white",children:[(0,a.jsx)("div",{className:"w-[340px] shrink-0 h-full overflow-hidden border-r border-softgrey1",children:x}),(0,a.jsx)("div",{className:"flex-1 h-full overflow-hidden",children:e?(0,a.jsx)(c.q,{chatId:e.chatId,type:e.type,onClose:()=>t(void 0)},e.chatId):(0,a.jsx)(r.u6,{})})]})}function p({onClose:e}){return(0,a.jsx)(i.w,{onClose:e,children:(0,a.jsx)(o.n,{children:(0,a.jsx)(m,{})})})}},80688:(e,t,s)=>{"use strict";s.d(t,{n:()=>a});let a=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")},84108:(e,t,s)=>{"use strict";s.d(t,{DD:()=>u,xz:()=>w,_h:()=>k,UU:()=>_,RL:()=>m,TA:()=>l});var a=s(62544),r=s(21072),n=s(88063);function l(){let{getUserId:e}=(0,n.q)(),[t,s]=(0,a.useState)(()=>{let t=e();return"string"==typeof t?t:null});return(0,a.useEffect)(()=>{let t=!0;return Promise.resolve(e()).then(e=>{t&&s(e??null)}),()=>{t=!1}},[e]),t}function i(e){return`${e?.firstName??""} ${e?.lastName??""}`.trim()}function o(e){return"products"===e.businessType?e.businessLogoUrl||e.businessPhotoUrl||void 0:e.businessPhotoUrl??void 0}function c(e,t){let s=e.chat??{},a=s.group??[],r=a.map(i).filter(Boolean).join(", "),n={id:s._id??"",requestReferenceId:s.requestReferenceId,lastMessage:e.lastMessage?.content,timestamp:e.lastMessage?.createdAt,unread:e.unreadMessage,participantIds:a.map(e=>e._id).filter(e=>!!e),participants:a.filter(e=>!!e._id).map(e=>({id:e._id,name:i(e)})),classroomId:s.classroomId,ecosystemId:s.ecosystemId};if("provider"===t){let e=a[1],t=i(e);return{...n,name:t||(s.businessName?`${s.businessName} team`:r||"Chat"),photoUrl:e?.photoUrl??void 0,businessName:s.businessName}}return"team"===t?{...n,name:s.businessName?`${s.businessName} team`:r||"Chat",photoUrl:o(s)}:"classroom"===t||"staff"===t?{...n,name:r||"Chat"}:{...n,name:s.businessName||r||"Chat",photoUrl:o(s)}}let d={consumer:[],provider:[],team:[],classroom:[],staff:[]};function u(e,t){return new Date(t.timestamp??0).getTime()-new Date(e.timestamp??0).getTime()}function h(e,t){return t?e.map(e=>{let s=e.participants?.find(e=>e.id!==t&&e.name);return s&&s.name!==e.name?{...e,name:s.name}:e}):e}function m(){let{http:e}=(0,n.q)(),{data:t,error:s,isLoading:i,mutate:o}=(0,r.Ay)("chat",async t=>{let s=await e.get(t);return{consumer:(s?.preparedConsumer??[]).map(e=>c(e,"consumer")),provider:(s?.preparedProvider??[]).map(e=>c(e,"provider")),team:(s?.preparedTeam??[]).map(e=>c(e,"team")),classroom:(s?.preparedClassroom??[]).map(e=>c(e,"classroom")),staff:(s?.preparedStaff??[]).map(e=>c(e,"staff"))}}),u=l(),m=t??d,p=(0,a.useMemo)(()=>0===m.classroom.length&&0===m.staff.length?m:{...m,classroom:h(m.classroom,u),staff:h(m.staff,u)},[m,u]),x=(0,a.useRef)(p);x.current=p;let f=(0,a.useCallback)((e,t)=>{let s=function(e,t,s){let a=t?.chat;if(!a)return null;let r="object"==typeof t.owner&&null!==t.owner?String(t.owner._id??""):String(t.owner??""),n=(!s?.selfId||r!==s.selfId)&&a!==s?.openChatId,l=!1,i={};for(let s of["consumer","provider","team","classroom","staff"]){let r=e[
1s],o=r.findIndex(e=>e.id===a);if(-1===o){i[s]=r;continue}l=!0;let c={...r[o],lastMessage:t.content??r[o].lastMessage,timestamp:t.createdAt??r[o].timestamp,unread:n?(r[o].unread??0)+1:r[o].unread};i[s]=[c,...r.slice(0,o),...r.slice(o+1)]}return l?i:null}(x.current,e,t);return s&&o(s,{revalidate:!1}),null!==s},[o]),[g,b]=(0,a.useState)(null),v=(0,a.useRef)(0),j=(0,a.useRef)(""),y=(0,a.useCallback)(async t=>{let s=t.trim();j.current=s;let a=++v.current;if(b(null),s)try{let t=await e.get(`chat/find/messages?searchText=${encodeURIComponent(s)}`);if(a!==v.current)return;let r=new Map;for(let e of[...x.current.consumer,...x.current.provider,...x.current.team,...x.current.classroom,...x.current.staff])r.has(e.id)||r.set(e.id,e.name);b({users:(t?.users??[]).map(e=>c(e,"team")),messages:(t?.messages??[]).map(e=>({id:e.chat??"",name:r.get(e.chat??"")??"Chat",lastMessage:e.content,timestamp:e.createdAt}))})}catch{a===v.current&&b({users:[],messages:[]})}},[e]),w=(0,a.useCallback)(()=>j.current?y(j.current):Promise.resolve(),[y]);return{tabs:p,error:s,isLoading:i,refresh:o,applyLastMessage:f,search:y,searchResults:g,refreshSearch:w}}var p=s(6608),x=s(24767);function f(e){return e?.toLowerCase()||void 0}function g(e){return`${e?.firstName??""} ${e?.lastName??""}`.trim()}function b(e){return e._id??(null!=e.id?String(e.id):void 0)}function v(e){return"string"==typeof e.owner?e.owner:e.owner?._id}function j(e){return"string"==typeof e.owner?void 0:e.owner}function y(e){return"string"==typeof e.quote?e.quote:e.quote?._id}function w(e,t){let s=b(t);if(s&&e.some(e=>b(e)===s))return e.map(e=>b(e)===s?{...e,pending:!1}:e);let a=v(t),r=e.findIndex(e=>e.pending&&!e._id&&e.content===t.content&&v(e)===a&&void 0!==a);return -1!==r?e.map((e,s)=>s===r?{...e,_id:t._id,pending:!1}:e):[...e,t]}function N(e){return(e.photos??[]).map(e=>"string"==typeof e?e:e.webviewPath||e.s3Url).filter(e=>!!e)}function _(e,t,s){var i;let o,c,{http:d,routes:u}=(0,n.q)(),h=l(),m=s?`?guestIdentifier=${encodeURIComponent(s)}`:"",_=e?`chat/${e}${m}`:null,k=(0,a.useRef)(!1),{data:C,error:S,isLoading:I,isValidating:A,mutate:$}=(0,r.Ay)(_,async e=>{let t=await d.get(e);return{messages:t?.message??[],chat:t?.chat??{},businessName:t?.business?.businessName,request:t?.request,viewerId:t?.viewerId}},s&&!h?{refreshInterval:12e3,isPaused:()=>k.current}:void 0),R=h??C?.viewerId??null,[M,T]=(0,a.useState)(!1),[L,E]=(0,a.useState)(null),U=function(e,t){let{http:s}=(0,n.q)(),[r,l]=(0,a.useState)([]),i=(0,a.useRef)(new Map),o=(0,a.useRef)([]);(0,a.useEffect)(()=>()=>{for(let e of o.current)URL.revokeObjectURL(e)},[]);let c=(0,a.useCallback)(a=>{for(let r of a){let a=`${r.name}-${r.size}-${o.current.length}-${Math.random().toString(36).slice(2)}`,n=URL.createObjectURL(r);o.current.push(n),l(e=>[...e,{id:a,previewUrl:n,progress:0}]),(async()=>{try{let n=function(e){let t=e.name.includes(".")?e.name.split(".").pop():void 0,s=`${Date.now()}-${Math.random().toString(36).slice(2,14)}`;return t?`${s}.${t}`:s}(r),{presigned:o}=await s.post("upload-credential",{path:e?`chat/${e}`:"chat",...t&&e?{chatId:e,guestIdentifier:t}:{}}),c=await function(e,t,s,a){let{url:r,key:n,...l}=e,i=new FormData;for(let[e,t]of(i.append("key",n),Object.entries(l)))i.append(e,t);return i.append("file",t,s),new Promise((e,t)=>{let l=new XMLHttpRequest;l.open("POST",r),l.timeout=6e4,l.upload.onprogress=e=>{e.lengthComputable&&a(Math.round(e.loaded/e.total*100))},l.onload=()=>{let a,i,o;return l.status>=200&&l.status<300?e((i=(a=n.includes("${filename}")?n.replace("${filename}",s):n).startsWith("/")?a.slice(1):a,o=r.endsWith("/")?r:`${r}/`,`${o}${i}`)):t(Error(`S3 upload failed (${l.status})`))},l.onerror=()=>t(Error("S3 upload failed")),l.ontimeout=()=>t(Error("S3 upload timed out")),l.send(i)})}(o,r,n,e=>l(t=>t.map(t=>t.id===a?{...t,progress:e}:t)));i.current.set(a,c),l(e=>e.map(e=>e.id===a?{id:e.id,previewUrl:e.previewUrl}:e))}catch{l(e=>e.map(e=>e.id===a?{...e,progress:void 0,failed:!0}:e))}})()}},[s,e,t]),d=(0,a.useCallback)(e=>{i.current.delete(e),l(t=>{let s=t.find(t=>t.id===e);return s&&(URL.revokeObjectURL(s.previewUrl),o.current=o.current.filter(e=>e!==s.previewUrl)),t.filter(t=>t.id!==e)})},[]),u=(0,a.useCallback)(()=>{let e=r.filter(e=>i.current.has(e.id)),t=e.map(e=>i.current.get(e.id));for(let t of e)URL.revokeObjectURL(t.previewUrl),i.current.delete(t.id);let s=new Set(e.map(e=>e.previewUrl));return o.current=o.current.filter(e=>!s.has(e)),l(t=>t.filter(t=>!e.some(e=>e.id===t.id))),t},[r]),h=r.filter(e=>i.current.has(e.id)).length;return{attachments:r,add:c,remove:d,takeUrls:u,readyCount:h}}(e,s);(0,a.useEffect)(()=>{E(null)},[e]);
1let{mutate:q,cache:D}=(0,p.iX)();(0,a.useEffect)(()=>{if(!e||!D.get("chat")?.data)return;let t=(t=[])=>t.map(t=>t.id===e?{...t,unread:0}:t);q("chat",e=>e&&{consumer:t(e.consumer),provider:t(e.provider),team:t(e.team),classroom:t(e.classroom),staff:t(e.staff)},{revalidate:!1})},[e,q,D]);let O=(0,a.useMemo)(()=>{let e=(C?.messages??[]).slice().sort((e,t)=>new Date(e.createdAt??0).getTime()-new Date(t.createdAt??0).getTime()),t=new Map;for(let s of e)s._id&&t.set(s._id,s);return e.map((e,s)=>{let a,r;return a=e._id??(null!=e.id?String(e.id):void 0)??`idx-${s}`,r=y(e)?t.get(y(e)):void 0,{id:a,text:e.content??"",timestamp:e.createdAt,isMine:!!R&&v(e)===R,avatarUrl:j(e)?.photoUrl??void 0,author:g(j(e))||void 0,photos:N(e),pending:e.pending,failed:e.failed,quote:r?{author:g(j(r))||void 0,text:r.content||(N(r).length?"Photo":"")}:void 0}})},[C,R]),{typing:z,notifyTyping:F,stopTyping:P}=function(e,t){let{userId:s}=t,{getToken:r,wsBaseUrl:l}=(0,n.q)(),i=(0,a.useRef)(null),[o,c]=(0,a.useState)(null),d=(0,a.useRef)(!1),u=(0,a.useRef)(void 0),h=(0,a.useRef)(t.onMessage);h.current=t.onMessage;let m=(0,a.useRef)(t.onReconnect);m.current=t.onReconnect;let p=(0,a.useRef)(t.userId);p.current=t.userId;let f=(0,a.useRef)(r);f.current=r;let g=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!e)return;let t=!1;g.current=null;let s=new x.$({baseUrl:l,getToken:()=>f.current(),namespace:"message",onReconnect:a=>{if(t)return;let r=p.current??void 0;g.current=r??null,s.emit("enter-chat-room",{chatId:e,owner:r}),s.emit("read-message",{chatId:e,owner:r}),a&&m.current?.()}});return i.current=s,s.on("message",e=>h.current(e)),s.on("users-typing",e=>{c(e?.typing?e:null)}),s.connect().catch(()=>{}),()=>{t=!0,clearTimeout(u.current),d.current&&(d.current=!1,s.emit("is-typing",{chatId:e,owner:p.current??void 0,typing:!1})),s.emit("leave-chat-room",{chatId:e,owner:p.current??void 0}),s.disconnect(),i.current=null}},[e,l]),(0,a.useEffect)(()=>{e&&s&&g.current!==s&&(g.current=s,i.current?.emit("enter-chat-room",{chatId:e,owner:s}),i.current?.emit("read-message",{chatId:e,owner:s}))},[e,s]);let b=(0,a.useCallback)(t=>{i.current?.emit("is-typing",{chatId:e,owner:p.current??void 0,typing:t})},[e]);return{typing:o,notifyTyping:(0,a.useCallback)(()=>{d.current||(d.current=!0,b(!0)),clearTimeout(u.current),u.current=setTimeout(()=>{d.current=!1,b(!1)},600)},[b]),stopTyping:(0,a.useCallback)(()=>{clearTimeout(u.current),d.current&&(d.current=!1,b(!1))},[b])}}(e,{userId:R,onMessage:(0,a.useCallback)(e=>{e&&$(t=>{let s=t??{messages:[],chat:{}};return{...s,messages:w(s.messages,e)}},{revalidate:!1})},[$]),onReconnect:()=>void $()}),B=(0,a.useCallback)(async(t,s)=>{T(!0),k.current=!0;try{let a=await d.post(`chat/${e}${m}`,{type:s.type,content:s.content??"",...s.photos?.length?{photos:s.photos}:{},...s.quote?{quote:s.quote}:{}}),r=a?.created?.message;await $(e=>{var s;let a;return{...e??{chat:{}},messages:(s=(e?.messages??[]).map(e=>e.id===t?{...e,_id:r?._id,pending:!1}:e),a=new Set,s.filter(e=>!e._id||!a.has(e._id)&&(a.add(e._id),!0)))}},{revalidate:!1})}catch{await $(e=>({...e??{chat:{}},messages:(e?.messages??[]).map(e=>e.id===t?{...e,pending:!1,failed:!0}:e)}),{revalidate:!1})}finally{k.current=!1,T(!1)}},[e,m,d,$]),H=(0,a.useCallback)(async t=>{let s=t.trim();if(!e||!s&&!U.readyCount)return;let a=U.takeUrls();P();let r=L?.id;E(null);let n=`tmp-${Date.now()}`,l={id:n,content:s,owner:{_id:R??void 0},createdAt:new Date().toISOString(),type:a.length?"picture":"text",photos:a,quote:r,pending:!0};await $(e=>({...e??{chat:{}},messages:[...e?.messages??[],l]}),{revalidate:!1}),await B(n,{type:a.length?"picture":"text",content:s,photos:a,quote:r})},[e,R,$,P,L,U,B]),V=(0,a.useCallback)(async e=>{let t=(C?.messages??[]).find(t=>b(t)===e&&t.failed&&!t.pending);t&&(await $(t=>({...t??{chat:{}},messages:(t?.messages??[]).map(t=>b(t)===e?{...t,pending:!0,failed:!1}:t)}),{revalidate:!1}),await B(e,{type:t.type??(N(t).length?"picture":"text"),content:t.content,photos:N(t),quote:y(t)}))},[C,$,B]),W=(0,a.useCallback)(e=>{let t=O.find(t=>t.id===e);t&&E({id:e,author:t.isMine?"You":t.author,preview:t.text||(t.photos?.length?"Photo":"")}
1)},[O]),Y=z?.typing?`${z.user||"Someone"} is typing`:void 0;return{title:C?(c=(o=C.chat.group??[]).filter(e=>e._id!==R).map(g).filter(Boolean).join(", "),"consumer"===f(t)?g(o[1])||c||C.businessName||"Chat":C.businessName||c||"Chat"):"",subtitle:(i=f(t))?i.charAt(0).toUpperCase()+i.slice(1):void 0,request:C?function(e,t,s){if("provider"!==f(t)||!e?._id)return;let a="service"===e.type||"product"===e.type?e.type:void 0;if(!a)return;let r=s.requestUrl(a,e._id);if(r)return{requestId:e.referenceId||e._id,requestUrl:r}}(C.request,t,u):void 0,messages:O,isLoading:I,isRefreshing:A&&!I&&!!C,isSending:M,error:S,sendMessage:H,retrySend:V,typingLabel:Y,notifyTyping:F,attachments:U.attachments,attachFiles:U.add,removeAttachment:U.remove,replyTo:L,startReply:W,cancelReply:(0,a.useCallback)(()=>E(null),[])}}function k(){return(0,n.q)().linkComponent}},84437:(e,t,s)=>{"use strict";s.d(t,{f:()=>i});let a=(e,t)=>`/student/experience/${e}/${t}`,r=[{pattern:/^\/voyage\/([^/]+)\/badges\/?$/,to:e=>a(e,"todo")},{pattern:/^\/voyage\/([^/]+)\/milestones\/?$/,to:e=>a(e,"todo")},{pattern:/^\/voyage\/([^/]+)\/leaderboard\/?$/,to:e=>a(e,"leaderboard")},{pattern:/^\/voyage\/([^/]+)\/chatbot(?:\/.*)?$/,to:e=>a(e,"voyage")}],n={"/account/badges":"/student/badges","/account/classrooms":"/student"},l=[{prefix:"/roadmap/chatbot",to:"/student"}];function i(e){let t=e,s="";try{let a=new URL(e);t=a.pathname,s=a.search}catch{let a=e.indexOf("?");-1!==a&&(t=e.slice(0,a),s=e.slice(a))}t.startsWith("/")||(t=`/${t}`);let a=t.length>1?t.replace(/\/+$/,""):t,i=n[a];if(i)return`${i}${s}`;for(let{prefix:e,to:t}of l)if(a===e||a.startsWith(`${e}/`))return`${t}${s}`;for(let{pattern:e,to:t}of r){let r=a.match(e)?.[1];if(r)return`${t(r)}${s}`}return`${t}${s}`}},88063:(e,t,s)=>{"use strict";s.d(t,{g:()=>n,q:()=>l});var a=s(62544);let r=(0,a.createContext)(null);function n({children:e,http:t,getToken:s,getUserId:l,wsBaseUrl:i,routes:o,linkComponent:c}){let d=(0,a.useMemo)(()=>({http:t,getToken:s,getUserId:l,wsBaseUrl:i,routes:o,linkComponent:c}),[t,s,l,i,o,c]);return(0,a.createElement)(r.Provider,{value:d},e)}function l(){let e=(0,a.useContext)(r);if(!e)throw Error("Messaging runtime used outside a <MessagingUiProvider>. Wrap the chat screens in one and pass the app's http, token, user-id, ws and route adapters.");return e}},88359:(e,t,s)=>{"use strict";s.d(t,{A:()=>z});var a=s(10940),r=s(84108),n=s(12525),l=s(62544),i=s(69789),o=s(37472),c=s(39772),d=s(49369),u=s(11230),h=s.n(u);let m=function({selected:e,onToggle:t,options:s,showDotIndicator:r}){return(0,a.jsxs)("button",{className:"relative flex h-[42px] w-[194px] bg-[#053B4C33] rounded-full px-[2px] items-center justify-between cursor-pointer",onClick:t,type:"button",children:[(0,a.jsx)("div",{className:h()("absolute top-[2px] left-[2px] h-[38px] w-[92px] rounded-full bg-white transition-transform duration-300 ease-in-out",{"transform translate-x-[96px]":"Ventures"===e,"transform translate-x-0":"Students"===e}),children:(0,a.jsx)("span",{"aria-hidden":"true",className:h()("absolute -top-[3px] -right-[3px] h-4 w-4 rounded-full bg-trophyborder pointer-events-none transition-all duration-300 ease-out",{"opacity-100 scale-100":r,"opacity-0 scale-25":!r})})}),s.map(e=>(0,a.jsx)(n.A,{className:"relative z-10 w-[92px] h-[38px] rounded-[28px] px-[17.5px] py-[10.5px] text-sm leading-[17px] font-bold transition-all text-black",children:e},e))]})};var p=s(45723),x=s(31786),f=s(24454),g=s(28636),b=s(73496),v=s(29225),j=s(20123),y=s(9116),w=s(13222),N=s(71537),_=s(67120),k=s(96246),C=s(91891),S=s(87439),I=s.n(S),A=s(20788);let $=function(){let[e,t]=l.useState(!1);return(0,a.jsxs)("div",{className:"flex flex-col justify-center gap-10 items-center w-full h-[calc(100vh-305px)] py-[48px] bg-white bg-opacity-40",children:[(0,a.jsxs)("div",{className:"w-[317px] h-[187px] flex flex-col items-center",children:[(0,a.jsx)("img",{src:"static/classroom-participants-awaiting.svg",alt:""}),(0,a.jsxs)("div",{className:"w-full h-[67px]",children:[(0,a.jsx)(n.A,{className:"w-full h-[21px] text-center text-[#053B4C] font-semibold text-sm leading-[21px]",children:"Awaiting Students"}),(0,a.jsx)(n.A,{className:"w-full h-[42px] text-center text-sm leading-[21px] text-black3",children:"Your table will populate with student data once they join the voyage"})]})]}),(0,a.jsxs)("div",{className:"w-[972px] h-[232px] flex justify-between",children:[(0,a.jsxs)("div",{className:"h-full w-[460px] flex flex-col gap-4 bg-white bg-opacity-40 border-[1px] border-b-0 border-white rounded-2xl p-4",children:[(0,a.jsxs)("div",{className:"w-full h-[146px] flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"w-full h-[79px] flex flex-col gap-3",children:[(0,a.jsx)(I(),{src:"static/classroom-house-icon.png",alt:"Bookstore",width:40,height:40}),(0,a.jsx)(n.A,{className:"w-full h-[27px] font-bold text-[17.5px] leading-[26.25px] text-black1",children:"My students purchased through the bookstore"})]}),(0,a.jsx)(n.A,{className:"w-[428px] h-[63px] text-sm leading-[21px] text-black3",children:"Your students have purchased access through the bookstore. No further action is required. Just remind them to activate their card and follow the steps."})]}),(0,a.jsx)("button",{type:"button",className:"h-[38px] w-[129px] rounded-[28px] px-[17.5px] py-[10.5px] border-[1px] border-green",onClick:()=>{window.open("https://docsend.com/view/9r6bncnxqsi5p62s","_blank","noopener,noreferrer")},children:(0,a.jsx)(n.A,{className:"w-[94px] h-[17px] text-sm leading-[17px] font-bold text-green",children:"See LMS Copy"})})]}),(0,a.jsxs)("div",{className:"h-full w-[460px] flex flex-col gap-4 bg-white bg-opacity-40 border-[1px] border-b-0 border-white rounded-2xl p-4",children:[(0,a.jsxs)("div",{className:"w-full h-[146px] flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"w-full h-[79px] flex flex-col gap-3",children:[(0,a.jsx)(A.HVq,{className:"size-10"}),(0,a.jsx)(n.A,{className:"w-full h-[27px] font-bold text-[17.5px] leading-[26.25px] text-black1",children:"My students will purchase directly from KANU"})]}),(0,a.jsx)(n.A,{className:"w-[428px] h-[63px] text-sm leading-[21px] text-black3",children:"Your students will purchase access directly from KANU. Copy your classroom link and add it to your LMS."})]}),(0,a.jsx)("button",{type:"button",className:"h-[38px] w-[172px] rounded-[28px] px-[17.5px] py-[10.5px] border-[1px] border-green",onClick:()=>{let e=window.location.href.split("/").slice(0,-1).join("/");navigator.clipboard.writeText(e),t(!0)},children:(0,a.jsx)(n.A,{className:"w-[137px] h-[17px] text-sm leading-[17px] font-bold text-green",children:e?"Copied!":"Copy Classroom Link"})})]})]})]})};var R=s(3839),M=s(56152),T=s(80688),L=s(76787);let E=({classroomId:e,userId:t,name:s,students:r})=>{let[n,i]=(0,l.useState)(!1),o=r.filter(e=>e.canMessage&&e.userId);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button","aria-label":`View ${s}'s scorecard`,className:"flex flex-row shrink-0 items-center whitespace-nowrap border border-tealdark bg-softgrey2 px-4 py-2.5 rounded-md gap-3 cursor-pointer",onClick:()=>i(!0),children:[(0,a.jsx)(A.WfV,{className:"size-[14px] fill-green"}),(0,a.jsx)("span",{className:"text-sm font-bold text-green",children:"View"})]}),n&&(0,a.jsx)(L.B,{classroomId:e,businessId:"",businessIds:[],asParticipant:{userId:t,students:o},onClose:()=>i(!1)})]})},U=({classroomId:e,businessId:t,businessIds:s})=>{let[r,n]=(0,l.useState)(!1),i=e=>()=>{n(e)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-row items-center border border-tealdark bg-softgrey2 px-4 py-2.5 rounded-md gap-3 cursor-pointer",onClick:i(!0),onKeyDown:i(!0),children:[(0,a.jsx)(A.WfV,{className:"size-[14px] fill-green"}),(0,a.jsx)("span",{className:"text-sm font-bold text-green",children:"View"})]}),r&&(0,a.jsx)(L.B,{classroomId:e,businessId:t,businessIds:s,onClose:i(!1)})]})},q=({classroomId:e,row:t,index:s,selectedTable:r,columns:i,options:o,moduleTitleThatContainsSelectBusiness:c,newDotIndicators:d,unreadMessageCounts:u,onMessage:m})=>{let[p,x]=l.useState(!1),f=o.map(e=>e.businessId),g="Students"===r?t.photoUrl:t.logoUrl,b=(0,_.BS)(t.status,c),v="Students"===r?!!t.businessRole:!!t.isTeam;return(0,a.jsxs)(l.Fragment,{children:[(0,a.jsxs)(j.A,{className:"bg-white border-none",children:[(0,a.jsx)(y.A,{align:"left",sx:i[0].sx,children:(0,a.jsx)(n.A,{className:"text-sm leading-[17px] font-bold text-black3",children:s+1})}),(0,a.jsx)(y.A,{align:"left",className:"px-3 py-0",sx:i[1].sx,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:["members"in t&&(0,a.jsx)(w.A,{"aria-label":"exp
1and row",size:"small",onClick:()=>x(!p),children:p?(0,a.jsx)(A.tmh,{className:"size-6"}):(0,a.jsx)(A.gZN,{className:"size-6"})}),g?(0,a.jsx)("img",{src:g,alt:t.name,className:"size-[42px] shrink-0 rounded-md object-cover"}):(0,a.jsx)("div",{className:"size-[42px] bg-[#DEE2E6] p-[10.5px] rounded-md",children:(0,a.jsx)(A.tR0,{className:"size-[21px]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)(n.A,{className:"h-[21px] text-sm leading-[21px] font-semibold text-black1",children:(0,T.n)(t.name)}),"invited"!==t.status&&(0,a.jsx)(n.A,{className:h()("h-4 text-[10.5px] leading-[15.75px] text-black3","Ventures"===r&&"hidden"),children:"Students"===r&&"venture"in t?(0,T.n)(t.venture.name):"(No business yet)"})]}),v&&(0,a.jsx)(n.A,{className:"h-5 px-[6px] py-[2px] text-[10.5px] leading-[15.75px] font-semibold rounded-md",style:{backgroundColor:"Students"===r?(0,_.sm)(t.businessRole).background:(0,_.Cj)(t).background,color:"Students"===r?(0,_.sm)(t.businessRole).color:(0,_.Cj)(t).color},children:"Students"===r?(0,_.sm)(t.businessRole).name:(0,_.Cj)(t).name}),d?.includes(t.email??t.businessId)&&(0,a.jsx)("div",{className:"size-[10px] rounded-full bg-trophyborder"})]})}),(0,a.jsx)(y.A,{align:"left",sx:i[2].sx,children:(0,a.jsx)(n.A,{className:"text-sm leading-[21px] text-black2",children:t.lastActive&&new Date(t.lastActive).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})})}),(0,a.jsx)(y.A,{align:"left",sx:i[3].sx,children:(0,a.jsx)(n.A,{className:"text-sm leading-[21px] text-black2",children:(0,a.jsx)(M.rK,{content:b.info,side:"bottom",className:h()("p-[10.5px] rounded-md text-sm leading-[20px] tracking-[0.5px] font-semibold cursor-pointer",b.styles,b.width,"text-black1"),children:(0,a.jsx)("span",{className:h()("h-5 rounded-md px-[6px] py-[2px] text-[10.5px] leading-[15.8px] cursor-pointer w-fit",b.styles),children:b.name})})})}),(0,a.jsx)(y.A,{align:"left",className:"py-0",sx:i[4].sx,children:(0,a.jsxs)("div",{className:"flex items-center gap-8",children:["Ventures"===r&&(0,a.jsx)(U,{classroomId:e,businessIds:f,businessId:t.businessId}),"Students"===r&&t.canMessage&&t.userId&&(0,a.jsx)(E,{classroomId:e,userId:t.userId,name:(0,T.n)(t.name),students:o})]})}),(0,a.jsx)(y.A,{align:"left",className:"py-0",sx:i[5].sx,children:"Students"===r&&m&&(0,a.jsx)(M.rK,{content:t.canMessage?u?.[t.userId]?`Message (${u[t.userId]} unread)`:"Message":"Hasn't joined the classroom yet — invited but not enrolled, so they can't be messaged until they do.",side:"bottom",children:(0,a.jsx)("span",{children:(0,a.jsxs)(w.A,{"aria-label":t.canMessage?`Message ${t.name}`:`${t.name} hasn't joined the classroom yet`,size:"small",disabled:!t.canMessage,onClick:t.canMessage?()=>m(t.userId):void 0,className:h()("relative",t.canMessage?"hover:bg-softgrey2":"opacity-40"),children:[(0,a.jsx)(A.yN_,{className:"size-[18px] fill-green"}),t.canMessage&&!!u?.[t.userId]&&(0,a.jsx)("span",{className:"absolute -right-1 -top-1 flex size-4 items-center justify-center rounded-full bg-[#5ac88e] text-[9px] font-bold leading-none text-white",children:u[t.userId]})]})})})})]},`${t.userId??t.businessId}-${s}`),(0,a.jsx)(j.A,{className:"bg-white",children:(0,a.jsx)(y.A,{style:{paddingBottom:0,paddingTop:0},colSpan:6,children:(0,a.jsx)(R.A,{in:p,timeout:"auto",unmountOnExit:!0,children:t.members?t.members.map(e=>(0,a.jsxs)("div",{className:"h-[44px] flex ml-36 items-center gap-2",children:[e.photoUrl?(0,a.jsx)("img",{src:e.photoUrl,alt:e.name,className:"size-[28px] shrink-0 rounded-md object-cover"}):(0,a.jsx)("div",{className:"size-[28px] flex items-center justify-center bg-[#DEE2E6] rounded-md",children:(0,a.jsx)(A.tR0,{className:"size-[14px]"})}),(0,a.jsx)(n.A,{className:"h-[21px] text-sm leading-[21px] font-semibold text-black1",children:(0,T.n)(e.name)}),(0,a.jsx)(n.A,{className:h()("h-5 px-[6px] py-[2px] text-[10.5px] leading-[15.75px] font-semibold rounded-md",(0,_.sm)(e.businessRole).style),children:(0,_.sm)(e.businessRole).name}),d?.includes(e.userId)&&(0,a.jsx)("div",{className:"size-[10px] rounded-full bg-trophyborder"})]},`${e.userId}-${t.businessId}`)):null})})})]})},D=function({classroomId:e,selectedTable:t,loading:s,participantsData:r,sortOptions:i,setSortOptions:o,newDotIndicators:c,unreadMessageCounts:d}){let u=l.useMemo(()=>r?"Students"===t?r.students:r.ventures:[],[r,t]),{startChat:m}=(0,C.r)(e),[p,S]=l.useState(void 0),I=async e=>{try{let t=await m(e);S(t.chatId)}catch{alert("Couldn't start this conversation. Please try again.")}},A=(0,_.G8)(t);return(0,a.jsxs)("div",{className:"relative w-full bg-white h-[calc(100vh-256px)] rounded-b-2xl overflow-y-auto scrollbar",children:[s&&(0,a.jsx)("div",{className:"absolute size-6 top-2 right-2 z-40",children:(0,a.jsx)(x.A,{size:24,className:"text-green"})}),(0,a.jsx)(f.A,{component:g.A,className:"scrollbar w-full border-none",children:(0,a.jsxs)(b.A,{stickyHeader:!0,"aria-label":"sticky table",children:[(0,a.jsx)(v.A,{children:(0,a.jsx)(j.A,{className:"bg-softgrey2",children:A.map(e=>(0,a.jsx)(y.A,{align:"left",sx:e.sx,className:h()("px-[14px] py-2"),children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(n.A,{className:"text-sm leading-[21px] font-bold text-[#343A40]",children:e.label}),e.icon?(0,a.jsx)(w.A,{"aria-label":"Sort",className:"hover:bg-transparent",onClick:()=>{var t;"no"===(t=e.id)?o({...i,sortOrder:"asc"===i.sortOrder?"desc":"asc"}):t===i.sortField?o({sortField:t,sortOrder:"asc"===i.sortOrder?"desc":"asc"}):o({sortField:t,sortOrder:"asc"})},children:(0,a.jsx)(e.icon,{className:"w-[18px] h-[14px]"})}):null]})},e.id))})}),(0,a.jsx)(N.A,{className:"w-full overflow-y-auto border-none shadow-none",children:u?.map((s,n)=>(0,a.jsx)(q,{classroomId:e,row:s,index:n,selectedTable:t,columns:A,options:u,moduleTitleThatContainsSelectBusiness:r.moduleTitleThatContainsSelectBusiness,newDotIndicators:c,unreadMessageCounts:d,onMessage:"Students"===t?I:void 0},`${s.userId??s.businessId}-${n}`))})]})}),!u||0===u.length&&(0,a.jsx)($,{}),p&&(0,a.jsx)(k.I,{chatId:p,type:"classroom",onClose:()=>S(void 0)})]})};function O({classroomId:e}){let[t,s]=l.useState({sortField:"name",sortOrder:"asc"}),[i,d]=l.useState("Students"),{isLoading:u,participantsData:h}=(0,p.L)({id:e,...t}),{placements:x}=(0,c._Q)(),{tabs:f}=(0,r.RL)(),g=(0,l.useMemo)(()=>(0,o.ZY)(f.classroom),[f.classroom]),b=(0,l.useMemo)(()=>{let t=x?.educatorDashboardClassroomStudents?.find(t=>t.classroomId===e);return t?[...t.studentIds??[],...t.businessIds??[]]:[]},[x,e]),v=(0,l.useMemo)(()=>{let t=x?.educatorDashboardClassroomStudents?.find(t=>t.classroomId===e);return!!t&&("Students"===i?!!t.studentIds?.length:"Ventures"===i&&!!t.businessIds?.length)},[x,i,e]);return(0,a.jsxs)("div",{className:"flex-grow h-full m-4 mb-0 border-[1px] border-[#
1E4E7EB] rounded-2xl",children:[(0,a.jsxs)("div",{className:"w-full flex border-b-[1px] bg-white bg-opacity-40 px-4 py-3 items-center justify-between rounded-t-2xl",children:[(0,a.jsxs)(n.A,{className:"w-[440px] h-[25px] text-[21px] leading-[25px] font-bold text-black1",children:[h?.[i.toLowerCase()]?.length||"0"," ","Participant(s)"]}),(0,a.jsx)(m,{selected:i,onToggle:()=>{d("Students"===i?"Ventures":"Students")},options:["Students","Ventures"],showDotIndicator:v}),(0,a.jsx)("span",{className:"w-[440px]"})]}),(0,a.jsx)(D,{classroomId:e,selectedTable:i,participantsData:h,loading:u,sortOptions:t,setSortOptions:s,newDotIndicators:b,unreadMessageCounts:g})]})}let z=function(e){return(0,a.jsx)(d.p,{children:(0,a.jsx)(i.n,{children:(0,a.jsx)(O,{...e})})})}},90354:()=>{},91891:(e,t,s)=>{"use strict";s.d(t,{r:()=>n});var a=s(38789),r=s(82887);function n(e){let{trigger:t,isMutating:s}=(0,a.A)(`classroom/${e}/chat/with`,(t,{arg:s})=>{let a;return a=`classroom/${e}/chat/with/${s}`,(0,r.I9)(a,{})});return{startChat:t,isStarting:s}}},93176:(e,t,s)=>{"use strict";s.d(t,{c:()=>n});var a=s(10940),r=s(20788);function n(e,t){return e.map(e=>({id:e._id,label:e.abbreviation??e.name,href:`${t}/${e._id}`,subLinks:[{label:"Activity",href:`${t}/${e._id}/activity`,icon:(0,a.jsx)(r.p3o,{className:"fill-black1"})},{label:"Students",href:`${t}/${e._id}/students`,icon:(0,a.jsx)(r.hjP,{className:"fill-black1"})},{label:"Grades",href:`${t}/${e._id}/grades`,icon:(0,a.jsx)(r.WfV,{className:"fill-black1"})},{label:"Insights",href:`${t}/${e._id}/insights`,icon:(0,a.jsx)(r.YCQ,{className:"fill-black1"})}]}))}},94445:()=>{},96246:(e,t,s)=>{"use strict";s.d(t,{I:()=>h,q:()=>u});var a=s(10940),r=s(61913),n=s(84108),l=s(45269),i=s(62544),o=s(61682),c=s(41795),d=s(69789);function u({chatId:e,type:t,guestIdentifier:s,onClose:o}){let{title:d,subtitle:h,request:m,messages:p,isLoading:x,isRefreshing:f,isSending:g,sendMessage:b,retrySend:v,typingLabel:j,notifyTyping:y,attachments:w,attachFiles:N,removeAttachment:_,replyTo:k,startReply:C,cancelReply:S,error:I}=(0,n.UU)(e,t,s),A=(0,l.Q)();return((0,i.useEffect)(()=>{(0,c.hE)({placements:"classroom"===t?[c.pE.CLASSROOM_CHAT]:"staff"===t?[c.pE.STAFF_CHAT]:[c.pE.CONSUMER_CHAT,c.pE.PROVIDER_CHAT,c.pE.TEAM_CHAT],modelId:e})},[e,t]),!I||p.length||x)?(0,a.jsx)(r.RB,{title:d,subtitle:h,requestId:m?.requestId,onRequestClick:void 0,typingLabel:j,messages:p,isLoading:x,isRefreshing:f,isSending:g,onSend:b,onType:y,onAttachFiles:N,attachments:w,onRemoveAttachment:_,replyTo:k,onReplyTo:C,onRetryMessage:v,onCancelReply:S,onBack:o,keyboardInset:A}):(0,a.jsx)(r.u6,{message:"This conversation could not be opened."})}let h=({chatId:e,type:t,guestIdentifier:s,onClose:r})=>(0,a.jsx)(o.w,{onClose:r,children:(0,a.jsx)("div",{className:"w-screen max-w-[480px] h-screen flex flex-col bg-white overflow-hidden",children:(0,a.jsx)(d.n,{children:(0,a.jsx)(u,{chatId:e,type:t,guestIdentifier:s,onClose:r},e)})})})},97518:(e,t,s)=>{"use strict";s.d(t,{p:()=>A});var a,r=s(10940),n=s(11610),l=s(32209),i=s(62544),o=s(20788),c=s(39772),d=s(40784),u=s(63540),h=s(29229),m=s(11230),p=s.n(m),x=s(51304),f=s.n(x),g=s(87439),b=s.n(g),v=((a={}).booking="static/notifications/booking.svg",a.warning="static/notifications/warning.svg",a.reminder="static/notifications/reminder.svg",a.team="static/notifications/team.svg",a.performance="static/notifications/performance.svg",a.chat="static/notifications/chat.svg",a.rating="static/notifications/star.svg",a.time="static/notifications/time.svg",a.extraCost="static/notifications/money.svg",a.cancel="static/notifications/cancel.svg",a.badge="static/notifications/badge.svg",a),j=s(62612),y=s(78859),w=s(52827),N=s(35681),_=s.n(N);let k=()=>(0,r.jsxs)("div",{className:_().empty,children:[(0,r.jsx)("div",{className:_().empty_image,children:(0,r.jsx)(b(),{src:"/static/empty-order.svg",alt:"",width:0,height:0,style:{width:"100%",height:"100%"}})}),(0,r.jsx)("span",{className:_().empty_title,children:"Not logged in"}),(0,r.jsx)("span",{className:_().empty_message,children:"Login to see notifications and stay connected with Kanu."}),(0,r.jsx)(w.$,{href:"/login",variant:"contained",color:"primary",sx:{width:"180px"},children:"Login"}),(0,r.jsx)(w.$,{href:"/register",variant:"outlined",color:"primary",sx:{width:"180px"},children:"Register"})]}),C=()=>(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center w-full min-h-[300px] gap-2 mb-8",children:[(0,r.jsx)("div",{className:"w-28 max-w-28 mb-4",children:(0,r.jsx)(b(),{src:"/static/notification-empty.svg",alt:"",width:0,height:0,style:{width:"100%",height:"100%"}})}),(0,r.jsx)("span",{className:"text-2xl text-center text-black2",children:"You don’t have any notifications right now"}),(0,r.jsx)("span",{className:"text-base text-center text-black3",children:"Find your school to get started"})]});var S=s(84437);let I=()=>{let{items:e,isLoading:t,isLoggedIn:s}=(0,j.E)(),a=()=>{(0,y.$F)("notification_open")};return(0,r.jsx)("div",{className:"flex flex-col w-full",children:t?(0,r.jsx)("div",{className:"flex flex-col py-4 overflow-auto",children:[0,1,2].map((e,t)=>({index:t+1})).map(e=>(0,r.jsxs)("div",{className:"flex items-center cursor-pointer p-2 gap-4 hover:bg-softgrey2 roun
1ded-md",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-12 min-w-12 bg-aeroteal rounded-full",children:(0,r.jsx)(h.A,{variant:"circular",width:48,height:48})}),(0,r.jsxs)("div",{className:"flex flex-col flex-1 gap-1 pt-2 pb-4 border-b border-softgrey1 line-clamp-1 overflow-hidden",children:[(0,r.jsx)(h.A,{variant:"rounded",width:0,height:14}),(0,r.jsx)(h.A,{variant:"rounded",width:"40%",height:12})]})]},e.index))}):(0,r.jsx)("div",{className:"flex flex-col py-4 overflow-auto",children:s?e.length>0?e.map(e=>{let t;return(0,r.jsx)("a",{href:(t=e.urlArgs,(0,S.f)(t)),onClick:a,children:(0,r.jsxs)("div",{className:"flex items-center cursor-pointer p-2 gap-4 hover:bg-softgrey2 hover:rounded-md",children:[(0,r.jsx)("div",{className:p()("flex items-center justify-center size-12 min-w-12 bg-aeroteal rounded-full",{"bg-softgrey1":e.read}),children:(0,r.jsx)(b(),{src:v[e.type],alt:e.title,width:24,height:24})}),(0,r.jsxs)("div",{className:"flex flex-col flex-1 gap-1 pt-2 pb-4 border-b border-softgrey1 line-clamp-1 overflow-hidden",children:[(0,r.jsx)("span",{className:"text-sm font-bold text-black2",children:e.title}),(0,r.jsx)("span",{className:"text-xs font-bold text-black3",children:f()(f()(e.time).utc(!0)).from(f().utc())})]})]})},e._id)}):(0,r.jsx)(C,{}):(0,r.jsx)(k,{})})})},A=()=>{let e=(0,n.A)("(min-width:1180px)"),{placements:t}=(0,c._Q)(),s=t?.notification?.length??0,[a,h]=(0,i.useState)(null),m=e=>h(e.currentTarget),p=()=>h(null);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{role:"button",tabIndex:0,"aria-label":"Notifications","aria-expanded":!!a,"aria-controls":"notification-popover","aria-haspopup":"dialog",className:"cursor-pointer",onClick:m,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&m(e)},children:(0,r.jsx)(l.A,{color:"error",variant:"dot",invisible:0===s,children:(0,r.jsx)(o.Hec,{className:"size-4 xxs:size-6"})})}),e?(0,r.jsx)(u.M,{id:"notification-popover",open:a,onClose:p,transformOriginHorizontal:"center",width:"376px",title:"Notifications",headerIcon:(0,r.jsx)(o.Hec,{}),children:(0,r.jsx)(I,{})}):(0,r.jsx)(d.I,{open:!!a,onClose:p,title:"Notifications",children:(0,r.jsx)(I,{})})]})}},99994:(e,t,s)=>{"use strict";s.d(t,{H:()=>d});var a=s(10940),r=s(90122),n=s.n(r),l=s(64052),i=s(56152),o=s(81448);function c(e,t){return e===t||e?.startsWith(`${t}/`)}let d=({label:e,items:t,activeHref:s})=>(0,o.h)()?(0,a.jsx)("div",{className:"flex flex-col gap-1 items-center w-full",children:t.map(e=>{let t=c(s,e.href);return(0,a.jsx)(i.rK,{content:e.label,side:"right",sideOffset:8,delayDuration:0,children:(0,a.jsx)(n(),{href:e.href,"aria-label":e.label,className:(0,l.cn)("flex items-center justify-center p-2 rounded-lg",t?"bg-softgrey2":"hover:bg-softgrey2"),children:(0,a.jsx)(e.icon,{className:"size-5 shrink-0 fill-black1"})})},e.href)})}):(0,a.jsxs)("div",{className:"flex flex-col items-start w-full",children:[(0,a.jsx)("div",{className:"flex items-center p-2 rounded-lg w-full",children:(0,a.jsx)("p",{className:"flex-1 text-sm font-semibold text-gray-700",children:e})}),(0,a.jsx)("div",{className:"flex flex-col gap-1 items-start w-full",children:t.map(e=>{let t=c(s,e.href);return(0,a.jsxs)(n(),{href:e.href,className:(0,l.cn)("flex gap-2 items-center p-2 rounded-lg w-full",t?"bg-softgrey2":"hover:bg-softgrey2"),children:[(0,a.jsx)(e.icon,{className:"size-5 shrink-0 fill-black1"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-black1",children:e.label})]},e.href)})})]})}},e=>{e.O(0,[4906,4095,122,5302,7267,7536,4465,1359,1250,8357,9229,1772,3460,3234,5754,438,4308,2224,2543,5529,7595,8997,2395,1152,5076,7752,9200,5886,8137,9362,6506,4319,3253,636,6593,8792],()=>e(e.s=2216)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.