PageSourceSearch

https://uicdn.lingu.com/messages/production/main-87139b19.js

js lingu.com collected 2026-10-01 23:56:54 UTC 135,603 bytes, 3 lines download raw bytes

1var ss=Object.defineProperty;var as=(t,e,s)=>e in t?ss(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var Re=(t,e,s)=>(as(t,typeof e!="symbol"?e+"":e,s),s);import{i as rs,a as Ge,c as Ne,o as os,u as Ye,C as ct,d as Ve,b as ns,s as Ee,w as Z,e as Be,t as Pe,I as is,f as ls,n as oe,g as R,h as $,j as c,k as p,l as o,m as x,p as I,q as ge,r as _,v as d,x as S,y as J,z as E,F as Y,A as ae,B as ie,D as De,E as dt,G as He,H as ye,J as ut,K as Fe,L as pt,M as ht,N as cs,O as V,P as ce,Q as ds,R as us,S as ve,T as ps,U as hs,V as We,W as re,X as ms,Y as fs,Z as gs,_ as vs,$ as ws,a0 as bs,a1 as qe,a2 as _s,a3 as xs,a4 as ys,a5 as xe,a6 as Qe,a7 as ks,a8 as Cs,a9 as $s,aa as Ms,ab as Ue}from"./vendor-60554a9d.js";import{_ as te}from"./loader.js";const Je={}.VITE_SENTRY_DSN!==void 0?{}.VITE_SENTRY_DSN:"https://9749a4c148ac847f1370a5cb9bfdc575@o4507066572079104.ingest.de.sentry.io/4511778373369936",Ss=()=>{Je&&rs({dsn:Je,environment:"production",ignoreErrors:["AbortError","The user aborted a request","BodyStreamBuffer was aborted","signal is aborted without reason"],allowUrls:[/uicdn\.lingu\.com\/messages\//],beforeSend:t=>{var a;const e=(a=t.exception)==null?void 0:a.values;return e!=null&&e.length?e.some(r=>{var n,i;return(i=(n=r.stacktrace)==null?void 0:n.frames)==null?void 0:i.some(h=>(h.filename??h.abs_path??"").includes("uicdn.lingu.com/messages/"))})?t:null:t},release:"0.0.1",allowUrls:[/uicdn\.lingu\.com\/messages\//],denyUrls:[/fast\.wistia\.com/]})},Xe=()=>{os((t,e,s)=>{Ne(t,{extra:{lifecycleHook:s}})})},mt=Symbol("sentryReported"),Ts=t=>{!t||typeof t!="object"||Object.defineProperty(t,mt,{value:!0,enumerable:!1,configurable:!0})},Ls=t=>!!t&&typeof t=="object"&&mt in t,N=(t,e,s)=>{if(Ls(t)){Ge({category:"error",message:e,level:"error",data:s});return}Ne(t,{tags:{action:e},extra:s})},de=(t,e)=>{Ge({category:"action",message:t,level:"info",data:e})}
1,fe=Ye("globalBus"),Ae={inputFocus:"input:focus",reconnect:"reconnect"},be=Ye("mainChannel"),Oe={createPrivateChat:"chat:private:create",newPrivateChat:"chat:private:new",subscribeToChat:"chat:subscribe"};class ft extends ct{receive(e){if(e.type==="group_chats")return this.emit("group_chats",e);if(e.type==="private_chats")return this.emit("private_chats",e);if(e.type==="support_chats")return this.emit("support_chats",e);if(e.type==="new_message")return this.emit("new_message",e.payload);if(e.type==="profile")return this.emit("profile",e.payload);if(e.type==="new_chat")return this.emit("new_chat",e.payload);if(e.type==="chat:restarted")return this.emit("chat:restarted",e.payload);super.receive(e)}createPrivateChat(e){return this.perform("create_private_chat",{uid:e})}subscribeToChat(e){return this.perform("subscribe_to_chat",{id:e})}}Re(ft,"identifier","Messages::MainChannel");var U=(t=>(t.Group="Messages::GroupChat",t.Private="Messages::PrivateChat",t.Support="Messages::SupportChat",t))(U||{}),Te=(t=>(t.AUDIO_TYPE="audio/webm",t.AUDIO="audio",t))(Te||{});const X=Ye("datailChannel"),W={updateChatList:"chatlist:update",sendMessage:"message:create",newMessage:"message:update:new",unreadMessage:"message:update:unread",messageRead:"message:update:read",deleteMessage:"message:delete",loadMoreMessages:"message:load-more",markAllMessagesRead:"message:mark_all_read",restartChat:"chat:restart"},Es=8e3,Ds=3e4,As=()=>({chatsList:{groupChats:[],archivedGroupChats:[],privateChats:[],archivedPrivateChats:[],supportChats:[]},chatsListLoaded:!1,isUserTeacherInChat:!1,messageToReply:null,selectedChatID:null,chatLoaded:!1,messages:[],messagesToDelete:[],eventMessageUpdate:null,counterpartTyping:!1,counterpartTypingTimer:null,counterpartReadAt:null}),F=Ve("chats",{state:As,actions:{async openChat(t,e){if(this.forceDeleteMessages(),await new Promise(s=>setTimeout(s,0)),!t){this.selectedChatID=null,this.isUserTeacherInChat=!1;return}this.selectedChatID!==t&&(this.isUserTeacherInChat=e||!1,this.selectedChatID=t,this.chatLoaded=!1)},updateMessages(t){const e=t.map(s=>({...s,checkToDelete:this.messagesToDelete.some(({messageId:a})=>a===s.id)}));this.messages.unshift(...e),this.eventMessageUpdate="load_more_messages",this.chatLoaded=!0,t.forEach(s=>{s.unread&&s.deleted&&this.markMessageAsRead(s.id)})},addMessage(t){var s,a;this.eventMessageUpdate="new_message";const e=se();((s=t.sender)==null?void 0:s.uid)!==((a=e.user)==null?void 0:a.uid)&&this.setCounterpartTyping(!1),this.messages.push(t),this.activeChat&&t.unread&&(this.activeChat.unread_messages_count+=1)},setCounterpartTyping(t,e){if(this.counterpartTypingTimer&&(clearTimeout(this.counterpartTypingTimer),this.counterpartTypingTimer=null),this.counterpartTyping=t,t){const s=e==="agent"||e==="assistant"?Ds:Es;this.counterpartTypingTimer=setTimeout(()=>{this.counterpartTyping=!1},s)}},setCounterpartReadAt(t){this.counterpartReadAt=t},addReplyMessage(t=null){this.messageToReply=t},clearReplyMessage(t){const e=this.messages.findIndex(s=>{var a;return((a=s.parent_message)==null?void 0:a.id)===t});e!==-1&&this.messages[e].parent_message&&(this.messages[e].parent_message.content="")},removeMessage(t,e){this.clearReplyMessage(t);const s=this.messages.findIndex(n=>n.id===t),a=this.messagesToDelete.findIndex(({messageId:n})=>n===t);if(s===-1){this.messagesToDelete.splice(a,1);return}if(a!==-1){clearTimeout(this.messagesToDelete[a].timer),this.messages[s].checkToDelete=!1,this.messagesToDelete.splice(a,1);return}if(this.messages[s].unread&&this.markMessageAsRead(t),!e){this.messages.splice(s,1);return}const r={messageId:t,timer:setTimeout(()=>{this.messages.splice(s,1),X.emit(W.deleteMessage,t),this.messagesToDelete.splice(a,1)},e)};this.messages[s].checkToDelete=!0,this.messagesToDelete.push(r)},forceDeleteMessages(){this.messagesToDelete.forEach(({messageId:t,timer:e})=>{clearTimeout(e),X.emit(W.deleteMessage,t)})},setGroupChatList(t){this.chatsList.archivedGroupChats=t.filter(e=>e.archived),this.chatsList.groupChats=t.filter(e=>!e.archived),this.chatsListLoaded=!0},setPrivateChatList(t){this.chatsList.archivedPrivateChats=t.filter(e=>e.archived),this.chatsList.privateChats=t.filter(e=>
1!e.archived),this.chatsListLoaded=!0},setSupportChatList(t){this.chatsList.supportChats=t,this.chatsListLoaded=!0},addSupportChatToList(t){this.chatsList.supportChats.some(e=>e.id===t.id)||this.chatsList.supportChats.unshift(t)},moveChat(t){if(t.type!==U.Support)if(t.type===U.Group){if(t.archived){this.chatsList.archivedGroupChats=this.chatsList.archivedGroupChats.filter(e=>e.id!==t.id),this.chatsList.groupChats.unshift({...t,archived:!1});return}this.chatsList.groupChats=this.chatsList.groupChats.filter(e=>e.id!==t.id),this.chatsList.archivedGroupChats.unshift({...t,archived:!0});return}else{if(t.archived){this.chatsList.archivedPrivateChats=this.chatsList.archivedPrivateChats.filter(e=>e.id!==t.id),this.chatsList.privateChats.unshift({...t,archived:!1});return}this.chatsList.privateChats=this.chatsList.privateChats.filter(e=>e.id!==t.id),this.chatsList.archivedPrivateChats.unshift({...t,archived:!0})}},addGroupChatToList(t){this.chatsList.groupChats.unshift(t)},addPrivateChatToList(t){const e=this.chatsList.privateChats.findIndex(s=>s.id===`draft_${t.uid}`);e!==-1?this.chatsList.privateChats[e]=t:this.chatsList.privateChats.unshift(t),this.selectedChatID===`draft_${t.uid}`&&(this.selectedChatID=t.id)},newDraftPrivateChat(t){const e=this.chatsList.privateChats.find(r=>t.uid===r.uid);if(e){const r=this.chatsList.privateChats.indexOf(e);this.chatsList.privateChats.splice(r,1),this.chatsList.privateChats.unshift(e),this.openChat(e.id);return}const s=se(),a={id:`draft_${t.uid}`,uid:t.uid,title:t.full_name,subtitle:t.email,type:U.Private,picture_url:t.avatar_url,teachers_count:1,students_count:1,unread_messages_count:0,isNew:!0};this.chatsList.privateChats.some(r=>a.id===r.id)||this.chatsList.privateChats.unshift(a),this.openChat(a.id,s.user.is_teacher)},updateCountMessageForChannel(t){var s;if(((s=this.activeChat)==null?void 0:s.id)===t)return;const e=[...Object.values(this.chatsList).flat()].find(a=>(a==null?void 0:a.id)===t);e&&(e.unread_messages_count+=1)},markMessageAsRead(t){const e=this.messages.find(s=>s.id===t);!this.activeChat||!(e!=null&&e.unread)||(e.unread=!1,this.activeChat.unread_messages_count=Math.max(0,this.activeChat.unread_messages_count-1),X.emit(W.messageRead,t))},markAllMessagesRead(){this.activeChat&&(this.activeChat.unread_messages_count=0,X.emit(W.markAllMessagesRead))},clearChatList(){this.chatsList={groupChats:[],privateChats:[],supportChats:[],archivedGroupChats:[],archivedPrivateChats:[]}},clearMessagesState(){this.eventMessageUpdate=null,this.messages=[],this.setCounterpartTyping(!1),this.counterpartReadAt=null},clearThread(){this.clearMessagesState(),this.messageToReply=null,this.activeChat&&(this.activeChat.unread_messages_count=0)},resetUnreadCount(t){const e=this.allChatsList.find(s=>
1(s==null?void 0:s.id)===t);e&&(e.unread_messages_count=0)},setUserRole(t){this.isUserTeacherInChat=t==null?void 0:t.is_teacher}},getters:{chats(t){return t.chatsList},allChatsList(t){return[...Object.values(t.chatsList).flat()]},activeChat(t){var e,s,a,r,n;return(((e=t.chatsList.groupChats)==null?void 0:e.find(i=>(i==null?void 0:i.id)===t.selectedChatID))||((s=t.chatsList.privateChats)==null?void 0:s.find(i=>(i==null?void 0:i.id)===t.selectedChatID))||((a=t.chatsList.supportChats)==null?void 0:a.find(i=>(i==null?void 0:i.id)===t.selectedChatID))||((r=t.chatsList.archivedGroupChats)==null?void 0:r.find(i=>(i==null?void 0:i.id)===t.selectedChatID))||((n=t.chatsList.archivedPrivateChats)==null?void 0:n.find(i=>(i==null?void 0:i.id)===t.selectedChatID)))??null},isActiveChatDraft(){var t;return!!((t=this.activeChat)!=null&&t.isNew)},newMessages(t){return[...Object.values(t.chatsList).flat()].reduce((e,s)=>e+((s==null?void 0:s.unread_messages_count)||0),0)},eventOfMessageUpdate(t){return t.eventMessageUpdate},chatMessages(t){return t.messages.filter(e=>!e.deleted)},enableOneWayCommunicationState(t){var e;return!((e=this.activeChat)!=null&&e.broadcast)||t.isUserTeacherInChat}}}),Rs={modalOpen:!1,searchUserModalOpen:!1,membersModalOpen:!1},le=Ve("global",{state:()=>Rs,actions:{openModal(){this.modalOpen=!0},closeModal(){this.modalOpen=!1},openSearchUserModal(){this.searchUserModalOpen=!0},closeSearchUserModal(){this.searchUserModalOpen=!1},openMembersModal(){this.membersModalOpen=!0},closeMembersUserModal(){this.membersModalOpen=!1},clearStore(){this.modalOpen=!1,this.searchUserModalOpen=!1,this.membersModalOpen=!1}},getters:{isModalOpen(t){return t.modalOpen}}}),Us={userInfo:{}},se=Ve("user",{state:()=>Us,actions:{updateUserInfo(t){this.userInfo=t},clearUserInfo(){this.userInfo={}}},getters:{user(t){return t.userInfo}}}),Is=({cable:t})=>{const e=F(),s=se(),a=new ft;a.on("profile",l=>{s.updateUserInfo(l)}),a.on("new_message",l=>{e.updateCountMessageForChannel(l.chat_id)}),a.on("chat:restarted",l=>{e.resetUnreadCount(l.chat_id)}),a.on("group_chats",l=>{e.setGroupChatList(l.payload.group_chats)}),a.on("private_chats",l=>{e.setPrivateChatList(l.payload.private_chats)}),a.on("support_chats",l=>{e.setSupportChatList(l.payload.support_chats)}),a.on("new_chat",l=>{a.subscribeToChat(l.id).catch(u=>{N(u,"subscribe_to_chat")}),l.type===U.Private&&e.addPrivateChatToList(l),l.type===U.Group&&e.addGroupChatToList(l),l.type===U.Support&&e.addSupportChatToList(l)});const r=async()=>{s.clearUserInfo(),e.clearChatList(),a.state==="connected"&&(a.disconnect(),t.unsubscribe(a)),be&&be.off(h)};try{t.subscribe(a)}catch(l){console.error("Error while subscribing to main channel",l),N(l,"subscribe_main_channel")}const n=l=>{a&&a.createPrivateChat(l).catch(u=>{N(u,"create_private_chat")})},i=l=>{a&&a.subscribeToChat(l).catch(u=>{N(u,"subscribe_to_chat")})},h=(l,u)=>{switch(l){case Oe.createPrivateChat:n(u);break;case Oe.subscribeToChat:i(u);break}};return be&&be.on(h),r};class gt extends ct{receive(e){if(e.type==="new_message")return this.emit("new_message",e.payload.message);if(e.type==="messages")return this.emit("messages",e.payload.messages);if(e.type==="profile")return this.emit("profile",e.payload);if(e.type==="message:delete")return this.emit("message:delete",e.payload.message);if(e.type==="typing")return this.emit("typing",e.payload);if(e.type==="message:read")return this.emit("message:read",e.payload);if(e.type==="chat:restarted")return this.emit("chat:restarted",e.payload);super.receive(e)}sendMessage({content:e,broadcast:s,attachments:a,parent_message_id:r}){return this.perform("send_message",{content:e,attachments:a,parent_message_id:r,broadcast:s})}loadMore(e){return this.perform("load_more_messages",{before:e})}markRead(e){return this.perform("mark_read",{message_id:e})}deleteMessage(e){return this.perform("delete_message",{message_id:e})}markAllRead(){return this.perform("mark_all_read")}restartChat(){return this.perform("restart_chat")}}Re(gt,"identifier","Messages::DetailedChatChannel");let $e=!1;const zs=({cable:t,chatID:e})=>{const s=F(),a=se();if($e=!1,s!=null&&s.isActiveChatDraft)return;const r=new gt({id:e});r.on("messages",f=>{$e=!1,s.updateMessages(f)}),r.on("new_message",f=>{a.user.uid!==f.sender.uid&&(f.unread=!0),s.addMessage(f)}),r.on("profile",f=>{s.setUserRole(f)}),r.on("message:delete",f=>{s.removeMessage(f.id)}),r.on("typing",f=>{var w;f.chat_id===((w=s.activeChat)==null?void 0:w.id)&&s.setCounterpartTyping(f.state!==!1,f.author_role)}),r.on("message:read",f=>{var w;f.chat_id===((w=s.activeChat)==null?void 0:w.id)&&s.setCounterpartReadAt(f.at)}),r.on("chat:restarted",f=>{var w;f.chat_id===((w=s.activeChat)==null?void 0:w.id)&&s.clearThread()});try{t.subscribe(r)}catch(f){console.error("Error while subscribing to detailed channel",f),N(f,"subscribe_detailed_channel")}const n=async({content:f,attachments:w,broadcast:b,onResult:k})=>{var K;if(!r){k==null||k(!1);return}const D=(K=s.messageToReply)==null?void 0:K.id,C=!!D,z=C?"reply_message":"send_message",j={chatId:e,broadcast:!!b,attachments:w.length,isReply:C};try{de(z,j),await r.sendMessage({content:f,broadcast:b,attachments:w,parent_message_id:D}),k==null||k(!0)}catch(G){console.error("Error while sending message",G),N(G,z,j),k==null||k(!1)}},i=f=>{r&&r.markRead(f).catch(w=>{N(w,"mark_read")})},h=()=>{r&&r.markAllRead().catch(f=>{N(f,"mark_all_read")})},l=f=>{r&&(s.removeMessage(f),r.deleteMessage(f).catch(w=>{N(w,"delete_message")}))},u=f=>{!r||$e||($e=!0,r.loadMore(f).catch(w=>{N(w,"load_more")}))},g=()=>{r&&(de("restart_chat",{chatId:e}
1),r.restartChat().catch(f=>{N(f,"restart_chat")}))},m=()=>{s.clearMessagesState(),r&&t.unsubscribe(r),X.off(y)},y=(f,w)=>{switch(f){case W.messageRead:i(w);break;case W.markAllMessagesRead:h();break;case W.sendMessage:n(w);break;case W.deleteMessage:l(w);break;case W.loadMoreMessages:u(w);break;case W.restartChat:g();break}};return X&&X.on(y),m},Bs=t=>{const e=document.querySelector(`meta[name="${t}"]`);if(e instanceof HTMLMetaElement)return e.content},Ps=()=>{var r;const t=document.querySelector("script[data-lm-url]"),e=((r=t==null?void 0:t.dataset)==null?void 0:r.lmUrl)||Bs("action-cable-url")||"wss://ws.lingu.com/cable",s=window.apiToken||null;let a=e;if(s){const n=s.replace("Bearer","").trim();n&&(a=`${e}?api_token=${n}`)}return ns(a)};let Ie,_e,ne=null;const et=()=>{Ie&&Ie(),_e&&_e(),ne&&ne.disconnect(),ne=Ps(),Ie=Is({cable:ne})},Fs=()=>{const t=F();et();const{activeChat:e}=Ee(t);Z(()=>{var a;return((a=e.value)==null?void 0:a.id)??null},(a,r)=>{a!==r&&(r&&_e&&_e(),!(!a||!ne)&&(_e=zs({cable:ne,chatID:a})))});const s=a=>{switch(a){case Ae.reconnect:{ne&&ne.state==="connected"&&et();break}}};fe&&fe.on(s)},Os="https://lingu.com/",js={baseURL:Os,headers:{"Content-Type":"application/json",Accept:"application/json"}},Gs=()=>{const t=Be.create(js);return t.interceptors.request.use(e=>{let s=window.apiToken||null;return s&&!String(s).includes("Bearer")&&(s=`Bearer ${s}`),s?e.headers.Authorization=s:e.withCredentials=!0,e}),t.interceptors.response.use(e=>e,e=>{var s,a,r,n,i;if(!Be.isCancel(e)){const h=(s=e==null?void 0:e.response)==null?void 0:s.status,l=(r=(a=e==null?void 0:e.config)==null?void 0:a.method)==null?void 0:r.toUpperCase(),u=(i=(n=e==null?void 0:e.config)==null?void 0:n.url)==null?void 0:i.split(/[?#]/)[0],g=u==null?void 0:u.replace(/\/\d+(?=\/|$)/g,"/:id").replace(/\/[0-9a-f][0-9a-f-]{7,}(?=\/|$)/gi,"/:id");if(Ge({category:"http",type:"http",level:"error",data:{url:u,method:l,status_code:h}}),!(e!=null&&e.response)||h>=500||h===403||h===404){const m=new Error(`API request failed: ${l??"REQUEST"} ${g??"unknown"} (${h??"network"})`);m.name="ApiRequestError",Ne(m,{tags:{action:"api_request"},extra:{url:u,method:l,status:h},fingerprint:["api_request",l??"",g??"",String(h??"network")]}),Ts(e)}}return Promise.reject(e)}),t},ue=Gs(),Ns=async(t,e)=>{const{data:s}=await ue.get("/messages/api/students",{params:{q:{fname_or_lname_cont:t}},signal:e});return s.students},Ys=t=>Be.isCancel(t),Vs=async t=>{const{data:e}=await ue.get(`/messages/api/students/${t}`);return e.student};var vt=(t=>(t.modalOpen="modal:open",t.modalClose="modal:close",t))(vt||{});const Hs=t=>{if(document.querySelector(t))return;const e=document.createElement(t);document.body.appendChild(e)},Le=[],Ws=(t,e)=>{Le.forEach(s=>{s.event===t&&s.callback(e)})},qs=()=>{const t=F(),e=le(),{newMessages:s,chats:a}=Ee(t),{modalOpen:r}=Ee(e);Z(s,(i,h)=>{i!==h&&(n.countUnread=i>0?i:0,X.emit(W.unreadMessage,i))}),Z(a,i=>{n.chats=Pe(i),X.emit(W.updateChatList,i)}),Z(r,i=>{const h=i?"modal:open":"modal:close";X.emit(h)});const n={countUnread:0,chats:Pe(t.chats),reconnect:()=>{fe.emit(Ae.reconnect)},openChat:async({chatID:i=null,studentUID:h=null}={chatID:null,studentUID:null})=>{if(e.openModal(),i&&t.openChat(i),h){const l=t.allChatsList.find(u=>u.uid===h);if(l){t.openChat(l.id);return}try{const u=await Vs(h);t.newDraftPrivateChat(u)}catch(u){console.error("Error: ",u),e.openModal()}}},openModal:()=>{e.openModal()},closeModal:()=>{e.closeModal()},on:(i,h)=>Le.push({event:i,callback:h}),off:(i,h)=>{const l=Le.findIndex(u=>u.event===i&&u.callback===h);l!==-1&&Le.splice(l,1)}};X.on(Ws),window.LINGU_MESSAGES=n||{}};({...vt,...W});const Xs=(t,{locale:e,key:s,onError:a})=>{if(typeof t=="string")try{const r=new is(t,e);return n=>String(r.format(n.values??{}))}catch(r){return a==null||a(r),()=>s}return a==null||a(new Error("AST messages are not supported")),()=>s},wt="Archive chat",bt="Archived chats",_t="Back to chats",xt="Cancel",yt={close_chat:"Close chat",group_chats:"Group chats",input:{add_file:"Add file",also_send_as_email:"Also send as email",input_message_for_submit:"Write a message to send",placeholder:"Post a new message",send_message:"Send message",upload_file:{error:"File upload failed. Please try again.",error_size:"File size is too large",error_type:"File type is not supported"}},message_from:"Message from {user}, {time}: {message}",new_private_messages:"{value, plural, one {# new private message} other {# new private messages}}",no_messages:"No messages here yet...",no_select:"Select chat to start messaging",open_attachment:"Open attachment",private_chats:"Private chats",student:{first_message:"Be the first one to post a message. Feel free to share your ideas or ask a question. Be curious:)"},teacher:{first_message:"This is where your teacher will share exciting tasks, helpful materials, and expert tips to enhance your learning journey. Stay tuned!"}},kt="Close modal",Ct="Close search",$t="Group members",Mt="Loading list of chats...",St="{value, plural, zero {No members} one {# member} other {# members} }",Tt="No chats found",Lt="Open chat",Et="Open group members modal",Dt="Remove",At="Reply",Rt="Reply to",Ut="Restore chat",It="Scroll to bottom",zt="Search",Bt="Search chat",Pt="Search user",Ft="Sent as email",Ot="Start private chat",jt="Start private chat with",Gt="Teacher",Nt="You",Yt={archive_chat:wt,archived_chats:bt,back_to_chats:_t,cancel:xt,chat:yt,close_modal:kt,close_search:Ct,delete:"Delete",group_members:$t,loading_list_chats:Mt,members:St,no_chats_found:Tt,open_chat:Lt,open_group_members_modal:Et,remove:Dt,reply:At,reply_to:Rt,restore_chat:Ut,scroll_to_bottom:It,search:zt,search_chat:Bt,search_user:Pt,sent_as_email:Ft,start_private_chat:Ot,start_private_chat_with:jt,teacher:Gt,you:Nt},Zs=Object.freeze(Object.defineProperty({__proto__:null,archive_chat:wt,archived_chats:bt,back_to_chats:_t,cancel:xt,chat:yt,close_modal:kt,close_search:Ct,default:Yt,group_members:$t,loading_list_chats:Mt,members:St,no_chats_found:Tt,open_chat:Lt,open_group_members_modal:Et,remove:Dt,reply:At,reply_to:Rt,restore_chat:Ut,scroll_to_bottom:It,search:zt,search_chat:Bt,search_user:Pt,sent_as_email:Ft,start_private_chat:Ot,start_private_chat_with:jt,teacher:Gt,you:Nt},Symbol.toStringTag,{value:"Module"})),je="en",Vt=()=>document.documentElement.lang||je,q=ls({legacy:!1,locale:Vt(),fallbackLocale:je,messageCompiler:Xs,messages:{[je]:Yt}});if(typeof window<"u"){const t=document.documentElement;new MutationObserver(()=>{const s=t.getAttribute("lang"),a=typeof q.global.locale=="object"&&"value"in q.global.locale?q.global.locale.value:q.global.locale;s&&s!==a&&(Ht(s),typeof q.global.locale=="object"&&"value"in q.global.locale?q.global.locale.value=s:q.global.locale=s)}).observe(t,{attributes:!0,attributeFilter:["lang"]})}(async()=>{const t=Vt();q.global.availableLocales.includes(t)||await Ht(t)})();async function Ht(t){if(!q.global.availableLocales.includes(t)){try{const s=Object.assign({
1"./translations/ar.json":()=>te(()=>import("./ar-792d5bcd.js"),[]),
1"./translations/de.json":()=>te(()=>import("./de-c4d38c6e.js"),[]),
1"./translations/en.json":()=>te(()=>Promise.resolve().then(()=>Zs),void 0),
1"./translations/es.json":()=>te(()=>import("./es-094f88e6.js"),[]),
1"./translations/fa.json":()=>te(()=>import("./fa-6e982c2e.js"),[]),
1"./translations/fr.json":()=>te(()=>import("./fr-b8def29b.js"),[]),
1"./translations/nb.json":()=>te(()=>import("./nb-9157b2d8.js"),[]),
1"./translations/nn.json":()=>te(()=>import("./nn-23313f1b.js"),[]),
1"./translations/ru.json":()=>te(()=>import("./ru-83f8cfbb.js"),[]),
1"./translations/uk.json":()=>te(()=>import("./uk-b76c3551.js"),[]),
1"./translations/zh.json":()=>te(()=>import("./zh-c668484c.js"),[])
1})[`./translations/${t}.json`];if(!s){console.warn(`Locale file not found: ${t}`);return}const a=await s();q.global.setLocaleMessage(t,a.default)}catch(e){console.error(`❌ Error loading ${t}.json`,e),N(e,"load_locale_messages")}return oe()}}const B=()=>{const t=(a,r)=>q.global.t(a,r),e=q.global.locale;return{t,locale:e,setLocale:a=>{q.global.locale.value=a}}},we=()=>{const{t}=B();return(e,s)=>{const a=t(e);return a===e?s:a}},tt=["#00A5D7","#66D6F3","#A99BE8","#7996FF","#FBBC25","#FC804B","#F96960","#FF7080","#FF7ABF","#C77BEE","#9BCE54","#29AC5F"],Wt=t=>{let e=0;for(let a=0;a<t.length;a++)e=t.charCodeAt(a)+((e<<5)-e);const s=Math.abs(e%tt.length);return tt[s]},Ks=t=>{const e=t.replace("#",""),[s,a,r]=[0,2,4].map(i=>parseInt(e.slice(i,i+2),16)/255).map(i=>i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4));return .2126*s+.7152*a+.0722*r>.183?"#2D2D3A":"#FFFFFF"},Qs=["src","alt"],Ze=R({__name:"UserAvatar",props:{image:{},fallback:{},fontSize:{}},setup(t){const e=t,s=$(()=>{var n,i;const r=e.fallback.split(" ");return((n=r[0].charAt(0))==null?void 0:n.toUpperCase())+(((i=r[r.length-1].charAt(0))==null?void 0:i.toUpperCase())||"")}),a=$(()=>{const r=e.fallback?Wt(e.fallback):"#FFBD5A";return{backgroundColor:r,color:Ks(r)}});return(r,n)=>r.image?(c(),p("img",{key:0,src:r.image,alt:r.fallback,class:"h-full w-full object-cover"},null,8,Qs)):(c(),p("span",{key:1,class:I(["flex justify-center items-center h-full w-full rounded-full font-bold",r.fontSize]),style:ge(a.value)},[o("span",null,x(s.value),1)],6))}}),Js=["aria-label","aria-current"],ea={key:0,class:"absolute inset-y-1.5 start-0 w-1 rounded-full bg-custom-yellow","aria-hidden":"true"},ta={key:1,class:"text-[10px] text-white/60"},sa={key:0,class:"relative"},aa={class:"overflow-hidden rounded-full h-8 w-8"},ra={class:"flex-1 min-w-0"},oa=["title"],na=["title"],ia={key:1,"aria-hidden":"true",class:"flex-none ms-auto h-4 min-w-4 px-0.5 flex items-center justify-center bg-custom-yellow rounded-full text-[#2D2D3A] font-bold text-[10px]"},ze=R({__name:"ItemChat",props:{chat:{}},setup(t){const{t:e}=B(),s=we(),a=F(),r=t,n=$(()=>r.chat.type===U.Support?s("chat.support","Support"):r.chat.title??""),i=$(()=>r.chat.type===U.Private||r.chat.type===U.Support),h=$(()=>r.chat.type===U.Support?r.chat.subtitle??n.value:n.value),l=$(()=>{var m;return((m=a.activeChat)==null?void 0:m.id)===r.chat.id}),u=$(()=>(r.chat.unread_messages_count??0)>0),g=$(()=>{const m=`${e("open_chat")} ${n.value}`;return u.value?`${m}, ${r.chat.unread_messages_count} ${s("chat.unread","unread")}`:m});return(m,y)=>{var f,w;return c(),p("div",null,[o("button",{type:"button",onClick:y[0]||(y[0]=b=>d(a).openChat(m.chat.id)),class:I(["relative px-3 py-2 w-full rounded-[10px] text-start focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/80 transition-colors",[u.value?"font-semibold":"",l.value||u.value?"text-white":"text-white/60",l.value?"bg-white/10":"hover:bg-white/5 hover:text-white"]]),"aria-label":g.value,"aria-current":l.value?"true":void 0},[l.value?(c(),p("span",ea)):_("",!0),m.chat.type===d(U).Group&&((f=m.chat)!=null&&f.subtitle)?(c(),p("div",ta,x(m.chat.subtitle),1)):_("",!0),o("div",{class:I(["justify-start items-center gap-2 flex max-w-full min-w-0 w-full",i.value&&"min-h-[32px]"])},[i.value?(c(),p("div",sa,[o("div",aa,[S(Ze,{image:m.chat.picture_url,fallback:h.value,"font-size":"text-xs"},null,8,["image","fallback"])])])):_("",!0),o("div",ra,[o("div",{class:"whitespace-nowrap max-w-full text-15px sm:text-base !leading-tight truncate me-auto",title:n.value},x(n.value),9,oa),(m.chat.type===d(U).Private||m.chat.type===d(U).Support)&&((w=m.chat)!=null&&w.subtitle)?(c(),p("div",{key:0,class:"text-[10px]/tight text-white/60 truncate",title:m.chat.subtitle},x(m.chat.subtitle),9,na)):_("",!0)]),u.value?(c(),p("div",ia,x(m.chat.unread_messages_count>99?"99+":m.chat.unread_messages_count),1)):_("",!0)],2)],10,Js)])}}}),la=o("path",{d:"M10.6673 6.16663L6.00065 1.49996L1.33398 6.16663",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),ca=[la],da=R({__name:"CollapseIcon",props:{isExpanded:{type:Boolean}}
1,setup(t){return(e,s)=>(c(),p("svg",{class:I(e.isExpanded?"rotate-0 transition-transform":"rotate-180 transition-transform"),width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ca,2))}}),ua={role:"status"},pa={key:0,type:"button",class:"flex flex-row justify-center items-center px-[10px] py-[1px] gap-[8px] w-[100%] min-h-[36px] rounded-[10px] text-sm font-medium bg-[#E1FF6A] text-black cursor-pointer"},ha={class:"font-[700] flex justify-center items-center gap-2"},ma=o("span",{class:"w-2 h-2 bg-black rounded-full","aria-hidden":"true"},null,-1),fa=R({__name:"ToastComponent",props:{isVisible:{type:Boolean}},setup(t){const e=F(),{t:s}=B(),a=$(()=>{var r;return(((r=e.chats)==null?void 0:r.privateChats)??[]).reduce((n,{unread_messages_count:i=0})=>n+i,0)});return(r,n)=>(c(),p("div",ua,[r.isVisible&&a.value>0?(c(),p("button",pa,[o("span",ha,[ma,J(" "+x(d(s)("chat.new_private_messages",{value:a.value})),1)])])):_("",!0)]))}}),Q=(t,e)=>{const s=t.__vccOpts||t;for(const[a,r]of e)s[a]=r;return s},ga={},va={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},wa=o("path",{d:"M4 8.96437C3.83599 8.96014 3.7169 8.95064 3.60982 8.92934C2.81644 8.77153 2.19624 8.15134 2.03843 7.35795C2 7.16476 2 6.93243 2 6.46777C2 6.00312 2 5.77079 2.03843 5.57759C2.19624 4.78421 2.81644 4.16402 3.60982 4.0062C3.80302 3.96777 4.03534 3.96777 4.5 3.96777H19.5C19.9647 3.96777 20.197 3.96777 20.3902 4.0062C21.1836 4.16402 21.8038 4.78421 21.9616 5.57759C22 5.77079 22 6.00312 22 6.46777C22 6.93243 22 7.16476 21.9616 7.35795C21.8038 8.15134 21.1836 8.77153 20.3902 8.92934C20.2831 8.95064 20.164 8.96014 20 8.96437M10 13.9678H14M4 8.96777H20V17.1678C20 18.8479 20 19.688 19.673 20.3297C19.3854 20.8942 18.9265 21.3532 18.362 21.6408C17.7202 21.9678 16.8802 21.9678 15.2 21.9678H8.8C7.11984 21.9678 6.27976 21.9678 5.63803 21.6408C5.07354 21.3532 4.6146 20.8942 4.32698 20.3297C4 19.688 4 18.8479 4 17.1678V8.96777Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),ba=[wa];function _a(t,e){return c(),p("svg",va,ba)}const xa=Q(ga,[["render",_a]]),ya={},ka={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},Ca=o("g",{opacity:"0.5"},[o("path",{d:"M5 12.9678H19M19 12.9678L12 5.96777M19 12.9678L12 19.9678",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),$a=[Ca];function Ma(t,e){return c(),p("svg",ka,$a)}const qt=Q(ya,[["render",Ma]]),Sa={key:0,type:"button",class:"w-full px-2 py-1.5 flex justify-between items-center gap-2 cursor-pointer rounded-2xl bg-white/10 text-start"},Ta={class:"flex items-center gap-2"},La={class:"p-2 rounded-full bg-[#FF5858]"},Ea={class:"text-sm font-[600] text-[#FF8A93] flex items-center"},Da={key:0,class:"flex-none ms-auto h-4 min-w-4 px-0.5 flex items-center justify-center bg-custom-yellow rounded-full text-[#2D2D3A] font-bold text-[10px]"},Aa={class:"flex items-center"},Ra=R({__name:"ArchivedBadge",setup(t){const{t:e}=B(),s=F(),a=$(()=>{const n=s.chats.archivedGroupChats.filter(h=>h.unread_messages_count>0).length,i=s.chats.archivedPrivateChats.filter(h=>h.unread_messages_count>0).length;return n+i}),r=$(()=>s.chats.archivedGroupChats.length>0||s.chats.archivedPrivateChats.length>0);return(n,i)=>r.value?(c(),p("button",Sa,[o("span",Ta,[o("span",La,[S(xa,{"aria-hidden":"true"})]),o("span",Ea,x(d(e)("archived_chats")),1)]),a.value>0?(c(),p("span",Da,x(a.value>99?"99+":a.value),1)):_("",!0),o("span",Aa,[S(qt,{"aria-hidden":"true"})])])):_("",!0)}}),Ua={key:0,role:"status",class:"px-2 text-center text-white/50 pt-20"},Ia={key:1,class:"h-full flex flex-col min-h-0"},za={key:0,role:"status",class:"text-center text-white/50 px-1 pt-3"},Ba={key:0,class:"flex-none overscroll-none sm:overscroll-auto px-3"},Pa={class:"sticky top-0 ps-3 pt-3 pb-2 text-white/60 text-13px sm:text-sm font-normal bg-primary z-10"},Fa={key:1,class:"border-top border-white/10 mx-3"},Oa={class:"sticky top-0 ps-3 pt-3 pb-2 text-white/60 text-13px sm:text-sm bg-primary z-10"},ja={class:"font-normal text-13px sm:text-sm"},Ga=["aria-expanded"],Na={class:"text-xs text-white/60 hover:text-white pr-3"},Ya={key:3,class:"border-top border-white/10 mx-3"},Va={key:4,class:"flex-1 min-h-0 overflow-y-auto overscroll-none sm:overscroll-auto px-3 pb-2"},Ha={class:"sticky top-0 ps-3 pt-3 pb-2 text-white/60 text-13px sm:text-sm font-normal bg-primary z-10"},Wa={key:5,class:"px-3 pb-2 mt-auto"},st=R({__name:"SidebarWrapper",props:{filteredGroupChats:{},filteredPrivateChats:{},filteredSupportChats:{}
1,chatsListLoaded:{type:Boolean},isMobileState:{type:Boolean},isArchivedChats:{type:Boolean}},emits:["toggleArchived"],setup(t,{emit:e}){const{t:s}=B(),a=we(),r=F(),n=$(()=>r.chats.archivedGroupChats.length>0||r.chats.archivedPrivateChats.length>0),i=e,h=()=>{i("toggleArchived")},l=E(!0);return(u,g)=>u.chatsListLoaded?(c(),p("div",Ia,[u.filteredGroupChats.length===0&&u.filteredPrivateChats.length===0&&u.filteredSupportChats.length===0?(c(),p("div",za,x(d(s)("no_chats_found")),1)):(c(),p(Y,{key:1},[u.filteredSupportChats.length>0?(c(),p("div",Ba,[o("h3",Pa,x(d(a)("chat.support_chats","Support")),1),o("ul",null,[(c(!0),p(Y,null,ae(u.filteredSupportChats,m=>(c(),p("li",{key:m.id},[S(ze,{chat:m},null,8,["chat"])]))),128))])])):_("",!0),u.filteredSupportChats.length>0&&(u.filteredGroupChats.length>0||u.filteredPrivateChats.length>0)?(c(),p("hr",Fa)):_("",!0),u.filteredGroupChats.length>0?(c(),p("div",{key:2,class:I([u.filteredPrivateChats.length>0?"max-h-[50%] min-h-0 overflow-y-auto":"flex-none","overscroll-none sm:overscroll-auto px-3"])},[o("div",Oa,[o("h3",ja,[o("button",{type:"button",class:"w-full flex justify-between items-center cursor-pointer text-start","aria-expanded":l.value,onClick:g[0]||(g[0]=m=>l.value=!l.value)},[o("span",null,x(d(s)("chat.group_chats")),1),o("span",Na,[S(da,{isExpanded:l.value,"aria-hidden":"true"},null,8,["isExpanded"])])],8,Ga)])]),ie(o("ul",null,[(c(!0),p(Y,null,ae(u.filteredGroupChats,m=>(c(),p("li",{key:m.id},[S(ze,{chat:m},null,8,["chat"])]))),128))],512),[[De,l.value]])],2)):_("",!0),u.filteredGroupChats.length>0&&u.filteredPrivateChats.length>0?(c(),p("hr",Ya)):_("",!0),u.filteredPrivateChats.length>0?(c(),p("div",Va,[o("h3",Ha,x(d(s)("chat.private_chats")),1),o("ul",null,[(c(!0),p(Y,null,ae(u.filteredPrivateChats,m=>(c(),p("li",{key:m.id},[S(ze,{chat:m},null,8,["chat"])]))),128))])])):_("",!0),u.isArchivedChats?_("",!0):(c(),p("div",Wa,[S(Ra,{onClick:h})]))],64)),u.isArchivedChats?_("",!0):(c(),p("div",{key:2,class:I(["absolute z-[11] w-[calc(100%_-_24px)] left-[12px]",n.value?"bottom-[65px]":"bottom-0"])},[S(fa,{isVisible:l.value&&u.filteredGroupChats.length<10,onClick:g[1]||(g[1]=m=>l.value=!l.value)},null,8,["isVisible"])],2))])):(c(),p("div",Ua,x(d(s)("loading_list_chats")),1))}}),qa={},Xa={class:"pointer-events-none",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}
1,Za=o("path",{d:"M6 18 18 6M6 6l12 12",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),Ka=[Za];function Qa(t,e){return c(),p("svg",Xa,Ka)}const ke=Q(qa,[["render",Qa]]),Ja={},er={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tr=o("path",{d:"m14.57 15.289 4.51 4.51",stroke:"#fff","stroke-width":"2","stroke-linecap":"round"},null,-1),sr=o("circle",{cx:"9.714",cy:"10.432",r:"5.869",transform:"rotate(-45 9.714 10.432)",stroke:"#fff","stroke-width":"2","stroke-linecap":"round"},null,-1),ar=[tr,sr];function rr(t,e){return c(),p("svg",er,ar)}const Xt=Q(Ja,[["render",rr]]),or={class:"relative overflow-hidden ms-6 me-3"},nr=["aria-label","placeholder"],ir={class:"absolute top-1/2 -translate-y-1/2 start-2 opacity-0 peer-focus:opacity-0 peer-placeholder-shown:-translate-x-0 peer-placeholder-shown:opacity-50 -translate-x-4 peer-focus:-translate-x-4 transition-all"},lr=["aria-label"],cr=R({__name:"SearchChat",emits:["on-filter"],setup(t,{emit:e}){const{t:s}=B(),a=E(""),r=E(!1),n=e;dt(a,()=>{n("on-filter",a.value)},{throttle:500});const i=()=>{r.value=!1,a.value="",n("on-filter","")};return(h,l)=>(c(),p("div",or,[ie(o("input",{type:"search","onUpdate:modelValue":l[0]||(l[0]=u=>a.value=u),onFocus:l[1]||(l[1]=u=>r.value=!0),onBlur:l[2]||(l[2]=u=>r.value=!1),class:"w-full py-3 ps-2 pe-2 rounded-lg bg-white/10 text-white placeholder:text-white/60 focus:placeholder:opacity-0 peer placeholder-shown:ps-10 focus:ps-2 transition-[padding] outline-none focus-visible:ring-2 focus-visible:ring-white/70","aria-label":d(s)("search_chat"),placeholder:`${d(s)("search_chat")}...`},null,40,nr),[[He,a.value]]),o("span",ir,[S(Xt)]),r.value||a.value?(c(),p("button",{key:0,type:"button","aria-label":d(s)("close_search"),onClick:i,class:"absolute end-2 top-1/2 -translate-y-1/2 bg-white/20 h-7 w-7 rounded-full flex items-center justify-center hover:bg-white/10 transition-colors"},[S(ke,{class:"h-5 w-5"})],8,lr)):_("",!0)]))}}),dr={class:"px-4 flex items-center justify-center h-full w-full text-xl font-bold text-center"},ur=R({__name:"EmptyWindow",setup(t){const{t:e}=B();return(s,a)=>(c(),p("div",dr,x(d(e)("chat.no_select")),1))}}),pr=async t=>{const{data:{private_chat:e}}=await ue.post("/messages/api/private_chats",{uid:t});return e},hr=async t=>{const{data:{members:e}}=await ue.get(`messages/api/group_chats/${t}/members`);return e},mr=async t=>{await ue.post(`/messages/api/chats/${t}/archive`)},fr=async t=>{await ue.delete(`/messages/api/chats/${t}/archive`)},gr={key:0},vr=["aria-label"],wr={key:1,class:"text-sm text-white/50 whitespace-nowrap"},br=R({__name:"ChatMembers",setup(t){const{t:e}=B(),s=F(),a=se(),r=le(),{width:n}=ye(),i=$(()=>{if(!s.activeChat)return 0;const u=s.activeChat;return u.students_count+u.teachers_count}),h=$(()=>{var u;return((u=s.activeChat)==null?void 0:u.type)===U.Group&&n.value>=640&&s.enableOneWayCommunicationState}),l=()=>{a.user.is_teacher&&r.openMembersModal()};return(u,g)=>h.value?(c(),p("div",gr,[d(a).user.is_teacher?(c(),p("button",{key:0,type:"button",class:"text-sm text-white/50 whitespace-nowrap transition cursor-pointer hover:text-white",onClick:l,"aria-label":d(e)("open_group_members_modal")},x(d(e)("members",{value:i.value})),9,vr)):(c(),p("div",wr,x(d(e)("members",{value:i.value})),1))])):_("",!0)}}),_r={key:0,class:"flex items-center py-3 ps-4 sm:ps-6 pe-20 bg-primary gap-3 z-10"},xr=["aria-label"],yr=o("svg",{width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[o("path",{stroke:"#fff","stroke-linecap":"round","stroke-width":"1.6",d:"m9.429 6-6 6m0 0 6 6m-6-6h16.714",opacity:".5"})],-1),kr=[yr],Cr=["title"],$r={key:1,class:"flex items-center gap-2 flex-none"},Mr={class:"text-xs sm:text-sm text-white/70 hidden sm:inline",role:"status"},Sr=["aria-label"],Tr=o("svg",{class:"flex-shrink-0",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M13.65 2.35A7.96 7.96 0 0 0 8 0a8 8 0 1 0 8 8h-2a6 6 0 1 1-1.76-4.24L9.5 6.5H16V0l-2.35 2.35Z",fill:"currentColor"})],-1),Lr={class:"hidden sm:inline"},Er=R({__name:"ChatHeader",setup(t){const e=F(),{width:s}=ye(),{t:a}=B(),r=we(),n=$(()=>{const u=e.activeChat;if(!u)return"";if(u.type!==U.Support)return u.title??"";
1const g=r("chat.support","Support");return u.subtitle?`${g} — ${u.subtitle}`:g}),i=$(()=>{var u;return((u=e.activeChat)==null?void 0:u.type)===U.Support}),h=E(!1),l=()=>{h.value=!1,X.emit(W.restartChat)};return Z(()=>{var u;return(u=e.activeChat)==null?void 0:u.id},()=>{h.value=!1}),(u,g)=>{var m;return(m=d(e))!=null&&m.activeChat?(c(),p("div",_r,[d(s)<640?(c(),p("button",{key:0,onClick:g[0]||(g[0]=y=>d(e).openChat(null)),class:"dir-auto","aria-label":d(a)("chat.close_chat")},kr,8,xr)):_("",!0),o("h2",{class:"text-lg sm:text-xl font-bold overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",title:n.value},x(n.value),9,Cr),i.value?(c(),p("div",$r,[h.value?(c(),p(Y,{key:0},[o("span",Mr,x(d(r)("chat.restart_confirm","Start a new conversation? The current one will be cleared.")),1),o("button",{type:"button",class:"px-2.5 py-1.5 rounded-lg text-xs sm:text-sm font-semibold bg-custom-yellow text-[#2D2D3A] hover:opacity-90 focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/80 transition",onClick:l},x(d(r)("chat.restart_confirm_yes","Start new")),1),o("button",{type:"button",class:"px-2.5 py-1.5 rounded-lg text-xs sm:text-sm text-white/70 hover:text-white hover:bg-white/10 focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/80 transition",onClick:g[1]||(g[1]=y=>h.value=!1)},x(d(a)("cancel")),1)],64)):(c(),p("button",{key:1,type:"button",class:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs sm:text-sm text-white/70 hover:text-white hover:bg-white/10 focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/80 transition","aria-label":d(r)("chat.restart","New conversation"),onClick:g[2]||(g[2]=y=>h.value=!0)},[Tr,o("span",Lr,x(d(r)("chat.restart","New conversation")),1)],8,Sr))])):_("",!0),S(br)])):_("",!0)}}}),Dr=["p","br","strong","b","em","i","s","u","a","ul","ol","li","code","pre","blockquote"],Ar=["href","target","rel"],Me=/(?:https?:\/\/|www\.)[^\s<>"']+/gi,Rr=/[.,!?;:)\]]+$/,Ur=t=>{var r;const e=t.textContent??"";if(Me.lastIndex=0,!Me.test(e))return;const s=t.ownerDocument.createDocumentFragment();let a=0;Me.lastIndex=0;for(const n of e.matchAll(Me)){let i=n[0];const h=((r=i.match(Rr))==null?void 0:r[0])??"",u=h.startsWith(")")&&i.includes("(")&&!i.includes(")")?h.slice(1):h;u&&(i=i.slice(0,-u.length));const g=n.index??0;g>a&&s.append(t.ownerDocument.createTextNode(e.slice(a,g)));const m=t.ownerDocument.createElement("a");m.setAttribute("href",i.toLowerCase().startsWith("www.")?`https://${i}`:i),m.textContent=i,s.append(m),a=g+n[0].length-u.length}a<e.length&&s.append(t.ownerDocument.createTextNode(e.slice(a))),t.replaceWith(s)},Ir=t=>{var r;const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT),s=[];let a=e.nextNode();for(;a;){const n=(r=a.parentElement)==null?void 0:r.tagName;n!=="A"&&n!=="CODE"&&n!=="PRE"&&s.push(a),a=e.nextNode()}s.forEach(Ur)},zr=t=>{t.querySelectorAll("a").forEach(e=>{const s=e.getAttribute("href")??"";if(!/^(https?:|mailto:|tel:)/i.test(s)){e.replaceWith(...e.childNodes);return}e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer")})},Br=t=>{if(!t)return"";const e=ut.sanitize(t,{ALLOWED_TAGS:Dr,ALLOWED_ATTR:Ar}),s=document.createElement("div");return s.innerHTML=e,Ir(s),zr(s),s.innerHTML},Zt=t=>{if(!t)return"";const e=document.createElement("div");return e.innerHTML=ut.sanitize(t,{ALLOWED_TAGS:[],ALLOWED_ATTR:[]}),e.textContent??""},Pr={key:0,class:"flex gap-2 bg-blue-secondary/10 p-2 rounded-xl mb-1"},Fr=o("div",{class:"w-1 rounded-lg bg-blue-secondary flex-shrink-0"},null,-1),Or={class:"min-w-0"},jr={key:0,class:"flex items-center gap-1 text-blue-secondary font-semibold text-sm leading-none"},Gr=o("div",{class:"dir-auto"},[o("svg",{width:"20",height:"20",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M2.5 8.533h8.333A6.667 6.667 0 0 1 17.5 15.2v1.667m-15-8.334 5 5m-5-5 5-5",stroke:"currentColor","stroke-width":"1.667","stroke-linecap":"round","stroke-linejoin":"round"})])],-1),Nr={class:"text-white text-sm truncate"}
1,Yr=R({__name:"ReplyParentMessage",props:{message:{}},setup(t){const e=F();return(s,a)=>{var r,n,i;return s.message.parent_message?(c(),p("div",Pr,[Fr,o("div",Or,[((n=(r=d(e))==null?void 0:r.activeChat)==null?void 0:n.type)===d(U).Group?(c(),p("div",jr,[Gr,J(" "+x(((i=s.message.parent_message.sender)==null?void 0:i.full_name)||""),1)])):_("",!0),o("div",Nr,x(d(Zt)(s.message.parent_message.content??null)),1)])])):_("",!0)}}}),Vr=["title"],Hr=o("div",{class:"flex-shrink-0"},[o("svg",{width:"39",height:"39",viewBox:"0 0 39 39",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10 0C4.477 0 0 4.477 0 10v19c0 5.523 4.477 10 10 10h19c5.523 0 10-4.477 10-10V10c0-5.523-4.477-10-10-10H10Zm5.333 11C14.045 11 13 12.007 13 13.25v13.5c0 1.243 1.045 2.25 2.333 2.25h9.334C25.955 29 27 27.993 27 26.75v-9.659a2.21 2.21 0 0 0-.683-1.591l-3.984-3.841a2.378 2.378 0 0 0-1.65-.659h-5.35Z",fill:"#fff"})])],-1),Wr={class:"text-white flex-1 min-w-0"},qr={class:"text-sm font-bold truncate"},Xr={class:"text-xs opacity-50"},Zr={key:0,class:"flex-shrink-0 ms-3"},Kr=["aria-label"],Kt=R({__name:"ItemFile",props:{file:{}},setup(t){const{t:e}=B(),s=t,r=(i=>{const h=Math.floor(Math.log(i)/Math.log(1024));return`${Number((i/Math.pow(1024,h)).toFixed(2))*1} ${["B","kB","MB","GB","TB"][h]}`})(s.file.size),n=$(()=>"name"in s.file?s.file.name:s.file.filename);return(i,h)=>(c(),p("div",{class:"flex items-center gap-2 min-w-0",title:n.value},[Hr,o("div",Wr,[o("div",qr,x(n.value),1),o("div",Xr,x(d(r)),1)]),"canEdit"in i.file&&i.file.canEdit?(c(),p("div",Zr,[o("button",{type:"button",class:"flex items-center justify-center h-6 w-6 rounded-full bg-black/20 group hover:bg-black/10 transition-colors",onClick:h[0]||(h[0]=l=>i.$emit("remove",i.file.id||"")),"aria-label":d(e)("remove")},[S(ke,{class:"h-3 w-3 opacity-50 group-hover:opacity-100 transition-opacity"})],8,Kr)])):_("",!0)],8,Vr))}}),Qt=t=>(pt("data-v-b3f34d08"),t=t(),ht(),t),Qr={class:"relative h-full w-full flex items-center gap-3"},Jr=["aria-label"],eo={class:"inner text-current",tabindex:"-1"},to={key:0,class:"size-8 text-current",width:"32",height:"32",viewBox:"0 0 32 32"},so=Qt(()=>o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16ZM9.6 10.133c0-.589.477-1.066 1.066-1.066h2.522c.589 0 1.066.477 1.066 1.066v11.734c0 .589-.477 1.066-1.066 1.066h-2.522c-.589 0-1.066-.477-1.066-1.066V10.133Zm8.145 0c0-.589.478-1.066 1.067-1.066h2.521c.59 0 1.067.477 1.067 1.066v11.734c0 .589-.478 1.066-1.067 1.066h-2.52c-.59 0-1.068-.477-1.068-1.066V10.133Z",fill:"currentColor"},null,-1)),ao=[so],ro={key:1,class:"size-8 text-current",width:"32",height:"32",viewBox:"0 0 32 32"},oo=Qt(()=>o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16Zm6.454-15.833c0-.578-.667-.963-2-1.732l-5.75-3.32c-1.333-.77-2-1.155-2.5-.866-.5.288-.5 1.058-.5 2.598v6.64c0 1.539 0 2.309.5 2.598.5.288 1.167-.097 2.5-.867l5.75-3.32c1.333-.77 2-1.154 2-1.731Z",fill:"currentColor"},null,-1)),no=[oo],io={class:"block flex-1 relative"},lo=["aria-label","aria-valuetext"],co={class:"absolute inset-0 pointer-events-none flex items-center rounded-xl peer-focus-visible:ring-2 peer-focus-visible:ring-white"},uo={class:"block h-1.5 rounded-xl bg-[#757A92] w-full overflow-hidden"},po=1e101,ho=R({__name:"AudioFile",props:{src:{}},setup(t){const{t:e}=B(),s=t,a=E(null),r=E(!1),n=E(0),i=E(0),h=E(!1),l=b=>b===1/0||Number.isNaN(b)?0:Number(b);if(s.src instanceof Blob){const b=URL.createObjectURL(s.src);a.value=new Audio(b),Fe(()=>URL.revokeObjectURL(b))}else a.value=new Audio(s.src);a.value.onloadedmetadata=()=>{if(!(a!=null&&a.value))return;const b=a.value;b.duration===1/0||Number.isNaN(b.duration)?(b.currentTime=po,b.ontimeupdate=()=>{n.value=l(b.duration),b.currentTime=0,i.value=0,setTimeout(()=>{r.value=!0},0)}):(n.value=l(b.duration),r.value=!0)},Z(r,()=>{!a.value||!r.value||(a.value.ontimeupdate=()=>{const b=a.value;!b||b.paused||(i.value=b.currentTime/(n.value===0?b.currentTime:n.value))})}),Fe(()=>{var b;(b=a.value)==null||b.pause()}),a.value.onended=()=>{const b=a.value;!b||!r.value||(h.value=!1,i.value=1,n.value=l(b.duration))};const u=()=>{var b,k;
1a.value&&(a.value.paused?((b=a.value)==null||b.play(),h.value=!0):((k=a.value)==null||k.pause(),h.value=!1))},g=$(()=>{if(n.value===0)return"00:00";const b=n.value*(1-Number(i.value)),k=Math.floor(b/60),D=Math.floor(b%60);return`${k.toString().padStart(2,"0")}:${D.toString().padStart(2,"0")}`}),m=()=>{const b=a.value;b&&(b.pause(),setTimeout(()=>{b.currentTime=Number(i.value)*b.duration,h.value&&b.play()},200))},y=()=>{var b;(b=a.value)==null||b.pause()},f=b=>{const k=Number.isFinite(b)&&b>0?b:0,D=Math.floor(k/60),C=Math.floor(k%60);return`${D.toString().padStart(2,"0")}:${C.toString().padStart(2,"0")}`},w=$(()=>`${f(Number(i.value)*n.value)} / ${f(n.value)}`);return(b,k)=>(c(),p("div",Qr,[o("button",{class:"transition hover:scale-105",type:"button","aria-label":h.value?d(e)("pause"):d(e)("play"),onClick:u},[o("div",eo,[h.value?(c(),p("svg",to,ao)):(c(),p("svg",ro,no))])],8,Jr),o("div",{class:I(["text-current text-sm font-semibold select-none min-w-10 text-end",r.value?"":"opacity-0"])},x(g.value),3),o("label",io,[ie(o("input",{class:"peer block w-full ln-audio-range opacity-0",step:"any",min:"0",max:"0.999999",type:"range","onUpdate:modelValue":k[0]||(k[0]=D=>i.value=D),"aria-label":d(e)("chat.audio.seek"),"aria-valuetext":w.value,onChange:m,onInput:y},null,40,lo),[[He,i.value]]),o("span",co,[o("span",uo,[o("span",{class:"block h-full bg-current rounded-xl transition-all ease-linear",style:ge({width:i.value*100+"%"})},null,4)])])])]))}});const Jt=Q(ho,[["__scopeId","data-v-b3f34d08"]]),mo={},fo={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none"},go=o("path",{d:"M1.33301 5.13452L6.77629 8.94482C7.21707 9.25336 7.43746 9.40764 7.67718 9.46739C7.88894 9.52018 8.11041 9.52018 8.32216 9.46739C8.56189 9.40764 8.78228 9.25336 9.22306 8.94482L14.6663 5.13452M4.53301 13.8012H11.4663C12.5864 13.8012 13.1465 13.8012 13.5743 13.5832C13.9506 13.3915 14.2566 13.0855 14.4484 12.7092C14.6663 12.2813 14.6663 11.7213 14.6663 10.6012V6.33452C14.6663 5.21442 14.6663 4.65436 14.4484 4.22654C14.2566 3.85022 13.9506 3.54426 13.5743 3.35251C13.1465 3.13452 12.5864 3.13452 11.4663 3.13452H4.53301C3.4129 3.13452 2.85285 3.13452 2.42503 3.35251C2.0487 3.54426 1.74274 3.85022 1.55099 4.22654C1.33301 4.65436 1.33301 5.21442 1.33301 6.33452V10.6012C1.33301 11.7213 1.33301 12.2813 1.55099 12.7092C1.74274 13.0855 2.0487 13.3915 2.42503 13.5832C2.85285 13.8012 3.4129 13.8012 4.53301 13.8012Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),vo=[go];function wo(t,e){return c(),p("svg",fo,vo)}const at=Q(mo,[["render",wo]]),bo=["data-id"],_o={class:"flex items-center"},xo=["aria-label"],yo=o("svg",{class:"flex-shrink-0",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M2 6.667h6.667A5.333 5.333 0 0 1 14 12v1.333M2 6.667l4 4m-4-4 4-4",stroke:"currentColor","stroke-width":"1.333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),ko=o("div",{class:"mx-0.5 w-[1px] h-5 bg-black/10"},null,-1),Co=["aria-label"],$o={class:"flex-shrink-0",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Mo=["stroke-dashoffset"],So={d:"M10.667 4v-.533c0-.747 0-1.12-.146-1.406a1.333 1.333 0 0 0-.582-.582c-.286-.146-.659-.146-1.406-.146H7.467c-.747 0-1.12 0-1.406.146-.25.127-.455.331-.582.582-.146.285-.146.659-.146 1.406V4M2 4h12m-1.333 0v7.467c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874c-.428.218-.988.218-2.108.218H6.533c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874c-.218-.428-.218-.988-.218-2.108V4",stroke:"currentColor","stroke-width":"1.333","stroke-linecap":"round","stroke-linejoin":"round"},To={key:0,class:"flex-shrink-0 w-[11px] dir-auto"},Lo={key:0},Eo=o("svg",{width:"11",height:"12",viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M0 12H11V-9.10312e-06C9.76204 6.57013 3.612 11.0583 0 12Z",fill:"currentColor"})],-1),Do=[Eo],Ao={class:"relative text-white"},Ro={key:0,class:"text-xs text-white font-[300] opacity-50"},Uo={key:1,class:"text-xs text-white font-[300] opacity-50"},Io={key:2,class:"text-xs text-white font-[300] opacity-50 ml-4 flex items-center gap-1"},zo=["innerHTML"],Bo={key:1,class:"block leading-none space-y-2"},Po=["href","aria-label"],Fo={key:2,class:"text-xs text-white font-[300] opacity-50 mt-1 flex items-center gap-1"},Oo={class:"relative float-end ms-3 -me-1 text-white/60 text-[10px] leading-none pointer-events-none select-none align-middle mt
1-[6px]"},jo={class:"absolute -bottom-1 end-0 whitespace-nowrap"},Go={key:1,class:"flex-shrink-0 w-[11px] dir-auto"},No={key:0},Yo=o("svg",{width:"11",height:"12",viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M11 12H0V0c1.238 6.57 7.388 11.058 11 12Z",fill:"currentColor"})],-1),Vo=[Yo],Ho=R({__name:"ItemMessage",props:{message:{},isOwnMessage:{type:Boolean},user:{},isFirstMessage:{type:Boolean},isLastMessage:{type:Boolean}},setup(t){const e=t,s=E(null),{t:a,locale:r}=B(),n=F(),i=se(),h=$(()=>Br(e.message.content)),l=$(()=>e.user?{color:Wt(e.user.full_name)}:{color:"#FFBD5A"}),u=$(()=>{const C=new Date(e.message.created_at),z=typeof r=="string"?r:r.value;return C.toLocaleTimeString(z,{hour:"numeric",minute:"numeric",hour12:!1})});if(e.message.unread){const{stop:C}=cs(s,([{isIntersecting:z}])=>{z&&(n.markMessageAsRead(e.message.id),C())})}const g=$(()=>e.message.attachments.length>0),m=$(()=>{const C=new Date(e.message.deletable_before);return new Date().getTime()<C.getTime()&&e.isOwnMessage}),y=()=>{n.removeMessage(e.message.id,5e3)},f=$(()=>{var C;return((C=n.activeChat)==null?void 0:C.type)===U.Group&&(i.user.is_teacher||e.user.is_teacher)}),w=$(()=>e.message.author_name||e.user.full_name),b=$(()=>e.message.author_role==="agent"),k=we(),D=$(()=>k("ai_assistant","AI assistant"));return(C,z)=>{var j,K;return c(),p("div",{class:I(["relative group w-fit max-w-full",{"ms-auto":C.isOwnMessage}]),"data-id":C.message.id},[o("div",{class:I(["absolute top-2 sm:-top-2 opacity-0 pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 bg-white p-0.5 rounded-lg transition z-10",[e.message.checkToDelete&&"!opacity-100 !pointer-events-auto",C.isOwnMessage?"-end-2 sm:end-4":"-end-0.5 sm:end-1.5"]])},[o("div",_o,[o("button",{type:"button",onClick:z[0]||(z[0]=G=>!e.message.checkToDelete&&d(n).addReplyMessage(C.message)),class:I(["flex items-center gap-1.5 text-[#2D2D3A] text-xs min-w-[70px] leading-none font-medium p-1.5 hover:bg-black/5 focus-visible:bg-black/5 transition",e.message.checkToDelete&&"opacity-40 pointer-events-none"]),"aria-label":d(a)("reply")},[yo,J(" "+x(d(a)("reply")),1)],10,xo),m.value&&(d(n).isUserTeacherInChat||((j=d(n).activeChat)==null?void 0:j.type)===d(U).Private||((K=d(n).activeChat)==null?void 0:K.type)===d(U).Support)?(c(),p(Y,{key:0},[ko,o("button",{type:"button",class:"flex items-center gap-1.5 text-[#2D2D3A] text-xs min-w-[70px] leading-none font-medium p-1.5 hover:bg-black/5 focus-visible:bg-black/5 transition","aria-label":e.message.checkToDelete?d(a)("cancel"):d(a)("delete"),onClick:y},[(c(),p("svg",$o,[o("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor","stroke-dasharray":"50","stroke-dashoffset":e.message.checkToDelete?0:50,class:I(e.message.checkToDelete&&"transition-[stroke-dashoffset] duration-[5s] ease-linear")},null,10,Mo),ie(o("path",So,null,512),[[De,!e.message.checkToDelete]])])),e.message.checkToDelete?(c(),p(Y,{key:0},[J(x(d(a)("cancel")),1)],64)):(c(),p(Y,{key:1},[J(x(d(a)("delete")),1)],64))],8,Co)],64)):_("",!0)])],2),o("div",{class:I(["flex items-end text-white text-opacity-10 landscape:max-w-full landscape:lg:max-w-[510px] sm:max-w-[510px] w-fit max-w-full group-hover:text-opacity-[0.16] transition-colors",{"blur-sm":e.message.checkToDelete}]),ref_key:"target",ref:s},[C.isOwnMessage?_("",!0):(c(),p("div",To,[C.isLastMessage?(c(),p("span",Lo,Do)):_("",!0)])),o("div",{class:I(["relative rounded-se-2xl rounded-ss-2xl sm:rounded-se-[20px] sm:rounded-ss-[20px] bg-current px-3 py-2.5 sm:py-3 min-w-[120px]",[C.isLastMessage?C.isOwnMessage?"rounded-es-2xl sm:rounded-es-[20px]":"rounded-ee-2xl sm:rounded-ee-[20px]":"rounded-2xl sm:rounded-[20px]"]])},[o("div",Ao,[!C.isOwnMessage&&C.isFirstMessage?(c(),V(ds(f.value?"button":"div"),{key:0,type:f.value?"button":void 0,class:I(["mb-2 text-sm font-semibold leading-none flex items-center gap-1",f.value&&"cursor-pointer"]),style:ge(l.value),"aria-label":f.value?`${d(a)("start_private_chat_with")} ${C.user.full_name}`:void 0,onClick:z[1]||(z[1]=G=>f.value?d(n).newDraftPrivateChat(C.user):null)},{default:ce(()=>[J(x(w.value)+" ",1),b.value?(c(),p("span",Ro,x(D.value),1)):C.user.is_teacher?(c(),p("span",Uo,x(d(a)("teacher")),1)):_("",!0),C.message.broadcasted?(c(),p("span",Io,[S(at),J(" "+x(d(a)("sent_as_email")),1)])):_("",!0)]),_:1},8,["type","class","style","aria-label"])):_("",!0),S(Yr,{message:C.message},null,8,["message"]),o("div",{class:I(["text-white text-15px sm:text-base",C.message.content&&!g.value?"leading-snug whitespace-pre-wrap break-words":"!leading-none"])},[C.message.content?(c(),p("div",{key:0,class:I([g.value&&"block mb-1","leading-snug [&_a]:underline [&_a]:text-blue-primary [&_a:hover]:no-underline [&_a]:break-all"]),innerHTML:h.value},null,10,zo)):_("",!0),g.value?(c(),p("div",Bo,[(c(!0),p(Y,null,ae(C.message.attachments,G=>(c(),p("div",{key:G.id,class:"block"},[G.mime_type.startsWith("audio/")?(c(),V(Jt,{key:0,src:G.attachment_url},null,8,["src"])):(c(),p("a",{key:1,href:G.attachment_url,target:"_blank",class:"block hover:contrast-75 transition-all","aria-label":`${d(a)("chat.open_attachment")} ${G.filename}`},[S(Kt,{file:G},null,8,["file"])],8,Po))]))),128))])):_("",!0),C.message.broadcasted&&C.isOwnMessage?(c(),p("span",Fo,[S(at),J(" "+x(d(a)("sent_as_email")),1)])):_("",!0),o("span",Oo,[o("span",jo,x(u.value),1)])],2)])],2),C.isOwnMessage?(c(),p("div",Go,[C.isLastMessage?(c(),p("span",No,Vo)):_("",!0)])):_("",!0)],2)],10,bo)}}}),Wo={class:"flex items-end relative"},qo=R({__name:"UserMessage",props:{messages:{},sender:{}},setup(t){const e=t,s=se(),a=F(),r=$(()=>{var n;return e.sender.uid===((n=s.user)==null?void 0:n.uid)});return(n,i)=>{var h,l,u,g;return c(),p("div",Wo,[!r.value&&(((h=d(a).activeChat)==null?void 0:h.type)===d(U).Group||((l=d(a).activeChat)==null?void 0:l.type)===d(U).Support)?(c(),p("div",{key:0,class:I(["w-10 h-10 sm:w-12 sm:h-12 rounded-full overflow-hidden flex-shrink-0 sticky bottom-2",((u=d(a).activeChat)==null?void 0:u.type)===d(U).Group&&(d(s).user.is_teacher||n.sender.is_teacher)&&"cursor-pointer"]),onClick:i[0]||(i[0]=m=>{var y;return((y=d(a).activeChat)==null?void 0:y.type)===d(U).Group&&(d(s).user.is_teacher||n.sender.is_teacher)?d(a).newDraftPrivateChat(n.sender):null})},[S(Ze,{image:(g=n.sender)==null?void 0:g.avatar_url,fallback:n.sender.full_name},null,8,["image","fallback"])],2)):_("",!0),o("div",{class:I(["space-y-1 w-fit min-w-0",[r.value?"ms-auto":"me-auto"]])},[(c(!0),p(Y,null,ae(n.messages,(m,y)=>(c(),V(Ho,{key:m.id,message:m,isOwnMessage:r.value,user:n.sender,isFirstMessage:y===0,isLastMessage:n.messages.length-1===y},null,8,["message","isOwnMessage","user","isFirstMessage","isLastMessage"]))),128))],2)])}}}),Xo=t=>(pt("data-v-691a5300"),t=t(),ht(),t),Zo={class:"mt-3 flex items-center gap-2 text-sm text-white/60",role:"status","aria-live":"polite"},Ko=Xo(()=>o("span",{class:"typing-dots inline-flex gap-1","aria-hidden":"true"},[o("span",{class:"typing-dot"}),o("span",{class:"typing-dot"}),o("span",{class:"typing-dot"})],-1)),Qo=R({__name:"TypingIndicator",setup(t){const e=we();return(s,a)=>
1(c(),p("div",Zo,[Ko,J(" "+x(d(e)("chat.support_typing","Support is typing…")),1)]))}});const rt=Q(Qo,[["__scopeId","data-v-691a5300"]]),Jo=(t,e)=>{const s=[];for(const a of t){const r=new Date(a.created_at),n=r.getDate(),i=r.getMonth()+1,h=r.getFullYear(),l=us(new Date(a.created_at),"D MMM, YY",{locales:e}),u=s.find(g=>g.date===`${n}-${i}-${h}`);u?u.messages?u.messages.push(a):u.messages=[a]:s.push({date:`${n}-${i}-${h}`,timestamp:r,outputDate:l.value,messages:[a]})}return s},en=(t,e)=>{let s=null,a=[];const r=[];for(const n of e.messages)s&&(s==null?void 0:s.sender.uid)===n.sender.uid?a.push(n):(a.length>0&&(r.push({id:t,sender:a[0].sender,messages:a}),t++),a=[n]),s=n;return r.push({id:t,sender:a[0].sender,messages:a}),{date:e.date,outputDate:e.outputDate,timestamp:e.timestamp,group:r}},tn=R({__name:"ChatDate",props:{outputDate:{}},setup(t){const e=E(!0),s=E(),a=new IntersectionObserver(([r])=>{e.value=r.intersectionRatio<1},{threshold:[1]});return ve(()=>{a.observe(s.value)}),(r,n)=>(c(),p("div",{class:"sticky top-[-1px] pt-[2px] flex items-center gap-2.5 text-xs text-white/50 text-center my-6 pointer-events-none z-0",ref_key:"target",ref:s},[o("span",{class:I(["border-t border-white/10 flex-1",e.value?"opacity-0":""])},null,2),o("span",{class:I(["inline-block transition-all rounded-lg px-2",e.value?"bg-primary text-white/60":""])},x(r.outputDate),3),o("span",{class:I(["border-t border-white/10 flex-1",e.value?"opacity-0":""])},null,2)],512))}}),sn={key:0,class:"px-4 sm:px-6 py-6 sm:pt-8 sm:pb-9"},an={class:"space-y-3 sm:space-y-5"},rn={key:0,class:"text-right text-[11px] text-white/50 mt-1 pe-1"},on={key:1,class:"flex items-center justify-center h-full w-full"},nn={class:"text-center max-w-sm px-3"},ln={class:"mb-5 text-2xl font-bold"},cn={class:"text-sm text-white/80 space-y-2"},dn=R({__name:"ChatContent",props:{messages:{}},setup(t){const{t:e,locale:s}=B(),a=t,r=F(),n=se(),i=we(),h=$(()=>{var f;return((f=r.activeChat)==null?void 0:f.type)===U.Support}),l=$(()=>h.value&&r.counterpartTyping),u=$(()=>{var w;if(!h.value||!r.counterpartReadAt)return!1;const f=a.messages[a.messages.length-1];return!f||f.sender.uid!==((w=n.user)==null?void 0:w.uid)?!1:new Date(r.counterpartReadAt).getTime()>=new Date(f.created_at).getTime()}),g=$(()=>Jo(a.messages,typeof s=="string"?s:s.value)),m=$(()=>{let f=[];for(let w=0;w<g.value.length;w++){const b=g.value[w],k=en(w,b);f=[...f,k]}return f}),y=$(()=>{var f;return(f=r.activeChat)!=null&&f.broadcast?r.isUserTeacherInChat?"":e("chat.teacher.first_message"):e("chat.student.first_message")});return(f,w)=>m.value.length>0?(c(),p("div",sn,[(c(!0),p(Y,null,ae(m.value,b=>(c(),p("div",{key:b.date},[S(tn,{outputDate:b.outputDate},null,8,["outputDate"]),o("div",an,[(c(!0),p(Y,null,ae(b.group,k=>(c(),V(qo,{key:k.id,messages:k.messages,sender:k.sender},null,8,["messages","sender"]))),128))])]))),128)),u.value?(c(),p("p",rn,x(d(i)("chat.seen","Seen")),1)):_("",!0),l.value?(c(),V(rt,{key:1})):_("",!0)])):(c(),p("div",on,[o("div",nn,[o("div",ln,x(d(e)("chat.no_messages")),1),o("div",cn,[o("p",null,x(y.value),1),l.value?(c(),V(rt,{key:0,class:"justify-center"})):_("",!0)])])]))}}),es=async t=>{const e=new FormData;e.append("files[]",t);const{data:s}=await ue.post("/messages/attachments",e,{headers:{"Content-Type":"multipart/form-data"}});return s},un=["aria-label"],pn=ps('<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_39274_1136)"><path d="m17.172 9-6.586 6.586a2 2 0 1 0 2.828 2.828l6.414-6.586a4 4 0 1 0-5.656-5.656l-6.415 6.585a6 6 0 1 0 8.486 8.486L22.5 15" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_39274_1136"><path fill="#fff" d="M0 0h28v28H0z"></path></clipPath></defs></svg>',1),hn=[pn],mn=R({__name:"ChatFileButton",setup(t){const{t:e}=B();return(s,a)=>(c(),p("button",{type:"button",class:"text-white/40 hover:text-white transition-all","aria-label":d(e)("chat.input.add_file")},hn,8,un))}}),fn=25,gn=["text/plain","application/pdf","application/epub+zip","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.presentation","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.text","image/jpeg","image/png","image/gif","
1image/tiff","image/svg+xml","image/webp","audio/mpeg","audio/wav","audio/ogg","audio/webm"],ot=R({__name:"FileUpload",props:{filesList:{}},emits:["upload-files","upload-files-error"],setup(t,{emit:e}){const{t:s}=B(),{open:a,reset:r,onChange:n}=hs({accept:gn.join(", "),reset:!1}),i=e,h=t;return n(async l=>{if(!l)return;if([...l].reduce((f,w)=>f+w.size,0)>fn*1024*1024){r(),i("upload-files-error",s("chat.input.upload_file.error_size"));return}const g=[...l].filter(f=>!h.filesList.some(w=>w.id===f.name+f.size));if(g.length===0)return;let m;try{m=await Promise.all(g.map(f=>es(f)))}catch{r(),i("upload-files-error",s("chat.input.upload_file.error"));return}const y=m.map(f=>f.data).map(f=>({name:f.metadata.filename,id:f.metadata.filename+f.metadata.size,size:f.metadata.size,canEdit:!0,data:f}));i("upload-files",y)}),Z(h.filesList,l=>{l.length===0&&r()}),(l,u)=>(c(),V(mn,{onClick:d(a)},null,8,["onClick"]))}}),vn={},wn={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor"},bn=o("path",{d:"M19 10V12C19 15.866 15.866 19 12 19M5 10V12C5 15.866 8.13401 19 12 19M12 19V22M8 22H16M12 15C10.3431 15 9 13.6569 9 12V5C9 3.34315 10.3431 2 12 2C13.6569 2 15 3.34315 15 5V12C15 13.6569 13.6569 15 12 15Z",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_n=[bn];function xn(t,e){return c(),p("svg",wn,_n)}const yn=Q(vn,[["render",xn]]),kn={},Cn={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},$n=o("g",{"clip-path":"url(#clip0_40045_5941)"},[o("path",{d:"M16 0.882812C24.3488 0.882812 31.1172 7.65118 31.1172 16C31.1172 24.3488 24.3488 31.1172 16 31.1172C7.65118 31.1172 0.882812 24.3488 0.882812 16C0.882839 7.6512 7.6512 0.882839 16 0.882812ZM12.3721 9.95312C11.5254 9.95312 11.1017 9.9534 10.7783 10.1182C10.4942 10.263 10.263 10.4942 10.1182 10.7783C9.9534 11.1017 9.95312 11.5254 9.95312 12.3721V19.6279C9.95312 20.4746 9.9534 20.8983 10.1182 21.2217C10.263 21.5059 10.4941 21.7369 10.7783 21.8818C11.1017 22.0466 11.5254 22.0469 12.3721 22.0469H19.6279C20.4746 22.0469 20.8983 22.0466 21.2217 21.8818C21.5059 21.7369 21.7369 21.5059 21.8818 21.2217C22.0466 20.8983 22.0469 20.4746 22.0469 19.6279V12.3721C22.0469 11.5254 22.0466 11.1017 21.8818 10.7783C21.7369 10.4941 21.5059 10.263 21.2217 10.1182C20.8983 9.9534 20.4746 9.95312 19.6279 9.95312H12.3721Z",fill:"white"})],-1),Mn=o("defs",null,[o("clipPath",{id:"clip0_40045_5941"},[o("rect",{width:"32",height:"32",fill:"white"})])],-1),Sn=[$n,Mn];function Tn(t,e){return c(),p("svg",Cn,Sn)}const Ln=Q(kn,[["render",Tn]]),En={class:"flex items-center"},Dn=["onTouchstart","aria-label"],An={key:1,class:"flex items-center gap-2 bg-red-700 rounded-xl pt-2 pr-[6px] pb-2 pl-2"},Rn={class:"text-white text-base font-semibold min-w-[50px]"},Un=["onTouchend","disabled","aria-label"],Se="audio/webm;codecs=opus",In=R({__name:"AudioRecord",props:{externalRecorder:{}},emits:["upload","error","handleStart"],setup(t,{emit:e}){const{t:s}=B(),a=t,r=e,n=E(!1),i=E(!1),h=E(0),l=E("00:00"),u=$(()=>n.value),g=E(null);let m=null,y=null,f=[],w=null;const b=E(!1);let k=null,D=null,C=null;const z=$(()=>!!a.externalRecorder);function j(){const T=Date.now()-h.value,v=String(Math.floor(T/6e4)).padStart(2,"0"),O=String(Math.floor(T%6e4/1e3)).padStart(2,"0");l.value=`${v}:${O}`}async function K(){if(r("handleStart",!0),!n.value){if(console.log("[DEBUG] Start recording. External recorder:",z.value),console.log("[DEBUG] External recorder object:",a.externalRecorder),z.value&&a.externalRecorder){console.log("[DEBUG] Using external native recorder");try{const T=await a.externalRecorder.startRecording();if(!T.success)throw new Error(T.error||"Failed to start recording");h.value=Date.now(),j(),g.value=setInterval(j,1e3),n.value=!0,console.log("[DEBUG] External recorder started successfully");return}catch(T){console.error("[DEBUG] External recorder failed:",T),r("error",T),H();return}}if(console.log("[DEBUG] Using web MediaRecorder"),!window.MediaRecorder){r("error",new Error("MediaRecorder API is not supported"));return}try{y=await navigator.mediaDevices.getUserMedia({audio:!0});const T={};
1MediaRecorder.isTypeSupported(Se)&&(T.mimeType=Se),m=new MediaRecorder(y,T),f=[],b.value=!1;const v=m.mimeType||Se;k=O=>{var A;console.log("[DEBUG] Data available:",(A=O.data)==null?void 0:A.size),O.data&&O.data.size&&(b.value=!0,f.push(O.data))},D=()=>{console.log("[DEBUG] MediaRecorder stopped. Chunks:",f.length),w&&(clearTimeout(w),w=null);const O=new Blob(f,{type:v});console.log("[DEBUG] Created blob:",O.size,"bytes"),r("upload",O),H(),i.value=!1,n.value=!1},C=O=>{console.error("[DEBUG] MediaRecorder error event:",O);const A=O.error||new Error("MediaRecorder error");r("error",A),H(),i.value=!1,n.value=!1},m.addEventListener("dataavailable",k),m.addEventListener("stop",D),m.addEventListener("error",C),m.start(1e3),h.value=Date.now(),j(),g.value=setInterval(j,1e3),n.value=!0,console.log("[DEBUG] MediaRecorder started")}catch(T){console.error("[DEBUG] MediaRecorder error:",T),r("error",T),H()}}}async function G(){if(!n.value)return;if(i.value=!0,console.log("[DEBUG] Stop recording. External:",z.value),z.value&&a.externalRecorder){console.log("[DEBUG] Stopping external recorder");try{const v=await a.externalRecorder.stopRecording();if(!v.success)throw new Error(v.error||"Failed to stop recording");if(v.blob)console.log("[DEBUG] External recorder stopped successfully",v.blob),console.log("[DEBUG] External recorder blob:",v.blob.size,"bytes, duration:",v.duration),r("upload",v.blob);else throw new Error("No audio blob received from native recorder");H(),i.value=!1,n.value=!1;return}catch(v){console.error("[DEBUG] External recorder stop error:",v),r("error",v),H(),i.value=!1,n.value=!1;return}}if(console.log("[DEBUG] Stopping MediaRecorder"),!m){H(),i.value=!1,n.value=!1;return}const T=m.mimeType||Se;try{if(m.state==="recording"){if(!b.value){console.warn("[DEBUG] No chunks yet. Requesting data...");try{m.requestData()}catch(v){console.warn("[DEBUG] requestData failed:",v)}await new Promise(v=>setTimeout(v,400))}console.log("[DEBUG] Calling mediaRecorder.stop()"),m.stop(),w=setTimeout(()=>
1{console.warn("[DEBUG] stop event did not fire within 5 seconds");const v=new Blob(f,{type:T});console.log("[DEBUG] Fallback blob:",v.size,"bytes"),r("upload",v),H(),i.value=!1,n.value=!1},5e3)}else console.warn("[DEBUG] MediaRecorder not in recording state:",m.state),H(),i.value=!1,n.value=!1}catch(v){console.error("[DEBUG] MediaRecorder stop error:",v),r("error",v),H(),i.value=!1,n.value=!1}}function H(){g.value&&(clearInterval(g.value),g.value=null),w&&(clearTimeout(w),w=null),m&&(k&&m.removeEventListener("dataavailable",k),D&&m.removeEventListener("stop",D),C&&m.removeEventListener("error",C)),k=null,D=null,C=null;try{y==null||y.getTracks().forEach(T=>T.stop())}catch(T){console.warn("[DEBUG] Error stopping tracks:",T)}y=null,m=null,f=[],l.value="00:00"}return We(()=>{if(n.value){if(z.value&&a.externalRecorder)a.externalRecorder.stopRecording().catch(console.error);else if(m)try{m.stop()}catch{}}H()}),(T,v)=>(c(),p("div",En,[n.value?_("",!0):(c(),p("button",{key:0,onClick:K,onTouchstart:re(K,["prevent"]),class:"text-white/40 hover:text-white transition-all disabled:opacity-50 disabled:cursor-not-allowed",style:{"touch-action":"manipulation","-webkit-user-select":"none","user-select":"none"},"aria-label":d(s)("start_recording")},[S(yn,{"aria-hidden":"true"})],40,Dn)),u.value?(c(),p("div",An,[o("span",Rn,x(l.value),1),n.value?(c(),p("button",{key:0,onClick:G,onTouchend:re(G,["prevent"]),onTouchstart:v[0]||(v[0]=re(()=>{},["prevent"])),disabled:i.value,class:"text-white disabled:opacity-50 disabled:cursor-not-allowed",style:{"touch-action":"manipulation","-webkit-user-select":"none","user-select":"none"},"aria-label":d(s)("stop_recording")},[S(Ln,{"aria-hidden":"true"})],40,Un)):_("",!0)])):_("",!0)]))}}),nt=R({__name:"AudioUpload",props:{audioRecorder:{}},emits:["upload-files","upload-files-error","recording"],setup(t,{emit:e}){const{t:s}=B(),a=e,r=async h=>{console.log("[DEBUG] handleUpload called with blob:",{size:h.size,type:h.type,hasType:!!h.type}),a("recording",!1);let l=h.type,u="audio.webm",g="webm";!l||l===""?(l="audio/mp4",u="audio.m4a",g="m4a",console.log("[DEBUG] No blob type detected, assuming iOS format:",l)):l.includes("webm")?(u="audio.webm",g="webm"):l.includes("mp4")||l.includes("m4a")?(u="audio.m4a",g="m4a"):l.includes("aac")&&(u="audio.aac",g="aac"),console.log("[DEBUG] Using:",{fileName:u,mimeType:l,extension:g});const m=new File([h],u,{type:l});console.log("[DEBUG] Created File:",{name:m.name,type:m.type,size:m.size});let y;try{({data:y}=await es(m))}catch{a("upload-files-error",s("chat.input.upload_file.error"));return}const f=[{name:u,id:y.metadata.filename,size:y.metadata.size,canEdit:!1,data:y,preview:m}];console.log("[DEBUG] Emitting upload-files:",f),a("upload-files",f)},n=()=>a("recording",!0),i=h=>{console.error("Recorder error:",h),N(h,"audio_recorder"),a("recording",!1),a("upload-files-error",s("chat.input.microphone_error"))};return(h,l)=>(c(),V(In,{externalRecorder:h.audioRecorder,onUpload:r,onError:i,onHandleStart:n,class:"w-full h-[40px]"},null,8,["externalRecorder"]))}}),zn=["disabled","aria-label"],Bn=o("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M23.309 15.118a1.25 1.25 0 0 0 0-2.236l-17.5-8.75a1.25 1.25 0 0 0-1.76 1.461l1.785 6.25a1.25 1.25 0 0 0 1.202.907h5.714a1.25 1.25 0 1 1 0 2.5H7.036a1.25 1.25 0 0 0-1.202.907l-1.786 6.25a1.25 1.25 0 0 0 1.761 1.461l17.5-8.75Z",fill:"currentColor"})],-1),Pn=[Bn],it=R({__name:"ChatSubmit",props:{input:{type:Boolean,required:!0}},emits:["submit-message"],setup(t,{emit:e}){const{t:s}=B(),a=t,r=e,n=$(()=>({"dir-auto":!0,"hover:text-white/90 transition-all":a.input,"pointer-events-none text-white/30":!a.input,"text-white":a.input})),i=()=>{r("submit-message")};return(h,l)=>(c(),p("button",{type:"button",class:I(n.value),disabled:!t.input,"aria-label":t.input?d(s)("chat.input.send_message"):d(s)("chat.input.input_message_for_submit"),onClick:i},Pn,10,zn))}}),Fn={},On={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10",viewBox:"0 0 14 10",fill:"none"},jn=o("path",{d:"M5.53651 9.80733C5.41716 9.93095 5.2544 10 5.08527 10C4.91613 10 4.75338 9.93095 4.63403 9.80733L1.03051 6.09403C0.656497 5.7087 0.656497 5.084 1.03051 4.69933L1.48175 4.23442C1.85576 3.84909 2.46145 3.84909 2.83546 4.23442L5.08527 6.55236L11.1645 0.289002C11.5386 -0.096334 12.1449 -0.096334 12.5183 0.289002L12.9695 0.753904C13.3435 1.13924 13.3435 1.76393 12.9695 2.14861L5.53651 9.80733Z",fill:"#0B1420"},null,-1),Gn=[jn];
1function Nn(t,e){return c(),p("svg",On,Gn)}const Yn=Q(Fn,[["render",Nn]]),Vn={class:"relative"},Hn={class:"absolute start-0 end-0 bottom-0 flex justify-center bg-primary border-b border-[#11142C] px-3 sm:ps-4 sm:pe-5 py-3"},Wn=o("div",{class:"flex-shrink-0 me-2 bg-blue-secondary w-1 rounded-lg"},null,-1),qn={class:"space-y-1 min-w-0"},Xn={class:"flex items-center gap-3 text-[15px] sm:text-base text-blue-secondary font-semibold leading-none"},Zn=o("div",{class:"dir-auto"},[o("svg",{width:"20",height:"20",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M2.5 9.13281H10.8333C12.6014 9.13281 14.2971 9.83519 15.5474 11.0854C16.7976 12.3357 17.5 14.0314 17.5 15.7995V17.4661M2.5 9.13281L7.5 14.1328M2.5 9.13281L7.5 4.13281",stroke:"currentColor","stroke-width":"1.66667","stroke-linecap":"round","stroke-linejoin":"round"})])],-1),Kn={class:"text-white truncate text-[15px] sm:text-base !leading-tight"},Qn={class:"flex-shrink-0 ms-auto ps-3 self-center"},Jn=["aria-label"],ei=o("svg",{class:"pointer-events-none",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}
1,[o("path",{d:"M6 18 18 6M6 6l12 12",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),ti=[ei],si=R({__name:"ReplyComponent",setup(t){const{t:e}=B(),s=F(),a=E(s.messageToReply),r=()=>{s.addReplyMessage(),a.value=null},n=()=>{a.value=s.messageToReply,fe.emit(Ae.inputFocus)};return(i,h)=>(c(),p("div",Vn,[S(d(ms),{show:!!d(s).messageToReply,as:"template",enter:"transform transition duration-[400ms]","enter-from":"opacity-0 translate-y-[40px]","enter-to":"opacity-100 translate-y-0",leave:"transform duration-200 transition ease-in-out","leave-from":"opacity-100 translate-y-0","leave-to":"opacity-0 translate-y-[40px]",onBeforeEnter:n,onAfterLeave:r},{default:ce(()=>{var l,u,g;return[o("div",Hn,[Wn,o("div",qn,[o("div",Xn,[Zn,J(" "+x(d(e)("reply_to"))+" "+x((u=(l=a.value)==null?void 0:l.sender)==null?void 0:u.full_name),1)]),o("div",Kn,x(d(Zt)(((g=a.value)==null?void 0:g.content)??null)),1)]),o("div",Qn,[o("button",{type:"button",onClick:r,class:"text-white/40 hover:text-white transition","aria-label":d(e)("cancel")},ti,8,Jn)])])]}),_:1},8,["show"])]))}}),ai={class:"relative px-4 sm:px-5 py-3 sm:py-4 bg-primary"},ri={class:"flex gap-2 sm:gap-3"},oi={class:"self-center w-full min-w-0 relative [&_a]:underline [&_a]:text-blue-primary [&_a]:hover:no-underline whitespace-pre-wrap"},ni={key:0,role:"alert",class:"flex gap-1.5 items-center text-red-400 text-xs font-bold leading-none my-1"},ii=o("span",{class:"flex items-center justify-center rounded-full border border-red-400 h-4 w-4 text-[10px]"},"!",-1),li={key:1,role:"alert",class:"flex gap-1.5 items-center text-red-400 text-xs font-bold leading-none my-1"},ci=o("span",{class:"flex items-center justify-center rounded-full border border-red-400 h-4 w-4 text-[10px]"},"!",-1),di={key:0,class:"flex self-end gap-4"},ui={class:"flex self-end gap-1.5"},pi={key:1,class:"flex gap-1.5 self-end"},hi={key:0,class:"flex items-center mt-2"},mi={class:"flex items-center cursor-pointer"},fi={class:"ml-2 text-sm text-white opacity-80"},gi={key:1,class:"flex items-center gap-2 -mx-4 mt-4 max-h-[200px] pb-2 overflow-auto"},vi=["title"],wi={key:0,class:"py-1"},bi=R({__name:"ChatInput",props:{audioRecorder:{}},emits:["submit-message"],setup(t,{emit:e}){var H;const{t:s}=B(),{input:a}=fs(),r=E([]),n=E(""),i=E(""),h=E(!1),l=E(!1),u=E(!1),g=F(),{width:m}=ye(),y=m.value<640,f=(H=g==null?void 0:g.activeChat)==null?void 0:H.id,w=gs({content:"",editorProps:{attributes:{"aria-label":s("chat.input.placeholder"),role:"textbox","aria-multiline":"true"}},extensions:[vs,ws.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),bs.configure({placeholder:s("chat.input.placeholder")})],onUpdate:({editor:T})=>{if(requestAnimationFrame(()=>T.commands.scrollIntoView()),!f)return;const v=T.getText();if(!v){localStorage.removeItem(`draft_${f}`);return}localStorage.setItem(`draft_${f}`,v)}}),b=e,k=T=>{var v;T===Ae.inputFocus&&((v=w.value)==null||v.commands.focus())};ve(()=>{if(!f||!w.value)return;const T=localStorage.getItem(`draft_${f}`);T&&w.value.chain().insertContent(T).run(),fe.on(k)}),Fe(()=>{fe.off(k)});const D=()=>{if(!w.value||l.value||h.value||!w.value.getText()&&r.value.length===0)return;const T=r.value.map(M=>Pe(M.data)),v=w.value.getText().trim(),O=u.value&&v.length?{broadcast:!0}:{};i.value="",h.value=!0;let A=!1;const Ce=M=>{var P;if(!A){if(A=!0,h.value=!1,!M){i.value=s("chat.input.send_error");return}u.value=!1,r.value=[],n.value="",(P=w.value)==null||P.chain().clearContent(!0).focus().run(),g.addReplyMessage()}},L=setTimeout(()=>Ce(!1),1e4);b("submit-message",{content:w.value.getHTML(),attachments:T,...O,onResult:M=>{clearTimeout(L),Ce(M)}})},C=T=>{const v=r.value.findIndex(O=>O.id===T);v!==-1&&r.value.splice(v,1)},z=$(()=>{var T;return!l.value&&(!!((T=w.value)!=null&&T.getText())||r.value.length>0)}),j=$(()=>{var T;return!!((T=w.value)!=null&&T.getText().trim())}),K=T=>T.filter(v=>!v.name.startsWith(Te.AUDIO)),G=T=>{if(T.name.startsWith(Te.AUDIO))return!0;const v=T.data.metadata.mime_type;return v===Te.AUDIO_TYPE||v==="audio/mp4"||v==="audio/m4a"||v==="audio/aac"||(v==null?void 0:v.startsWith("audio/"))};return(T,v)=>{var O;return c(),p(Y,null,[S(si),o("div",ai,[o("div",ri,[o("div",oi,[S(d(_s),{editor:d(w),editable:!l.value,class:I({"pointer-events-none opacity-50":l.value}),onKeydown:qe(re(D,["exact","prevent"]),["enter"])},null,8,["editor","editable","class","onKeydown"]),n.value?(c(),p("div",ni,[ii,J(" "+x(n.value),1)])):_("",!0),i.value?(c(),p("div",li,[ci,J(" "+x(i.value),1)])):_("",!0)]),y?(c(),p("div",pi,[S(nt,{audioRecorder:T.audioRecorder,onUploadFiles:v[5]||(v[5]=A=>r.value.push(...A)),onUploadFilesError:v[6]||(v[6]=A=>n.value=A),onRecording:v[7]||(v[7]=A=>l.value=A)},null,8,["audioRecorder"]),!l.value&&(z.value||!d(g).isUserTeacherInChat)?(c(),V(it,{key:0,input:z.value,onClick:D},null,8,["input"])):_("",!0),!l.value&&(!d(a)||r.value.length>0)?(c(),V(ot,{key:1,filesList:K(r.value),onUploadFilesError:v[8]||(v[8]=A=>n.value=A),onUploadFiles:v[9]||(v[9]=A=>r.value.push(...A))},null,8,["filesList"])):_("",!0)])):(c(),p("div",di,[o("div",ui,[ie(S(ot,{filesList:K(r.value),onUploadFilesError:v[0]||(v[0]=A=>n.value=A),onUploadFiles:v[1]||(v[1]=A=>r.value.push(...A))},null,8,["filesList"]),[[De,!l.value]]),S(nt,{audioRecorder:T.audioRecorder,onUploadFiles:v[2]||(v[2]=A=>r.value.push(...A)),onUploadFilesError:v[3]||(v[3]=A=>n.value=A),onRecording:v[4]||(v[4]=A=>l.value=A)},null,8,["audioRecorder"])]),ie(S(it,{input:z.value,onClick:D},null,8,["input"]),[[De,!l.value]])]))]),((O=d(g).activeChat)==null?void 0:O.type)===d(U).Group&&d(g).isUserTeacherInChat&&j.value?(c(),p("div",hi,[o("label",mi,[ie(o("input",{type:"checkbox",id:"sendEmail","onUpdate:modelValue":v[10]||(v[10]=A=>u.value=A),class:"peer sr-only"},null,512),[[xs,u.value]]),o("span",{class:I(["w-5 h-5 flex items-center justify-center border-1 border-gray-400 rounded-md peer-focus-visible:ring-2 peer-focus-visible:ring-white peer-focus-visible:ring-offset-1",u.value?"bg-blue-secondary border-blue-secondary":"bg-white"])},[u.value?(c(),V(Yn,{key:0})):_("",!0)],2),o("span",fi,x(d(s)("chat.input.also_send_as_email")),1)])])):_("",!0),r.value.length?(c(),p("div",gi,[(c(!0),p(Y,null,ae(r.value,A=>(c(),p("div",{key:A.id,class:"w-fit max-w-md first:ps-4 last:pe-4"},[o("div",{class:"flex items-center gap-2 min-w-0 rounded-xl bg-white/10 p-1.5",title:A.name},["preview"in A&&G(A)?(c(),p("div",wi,[S(Jt,{src:A==null?void 0:A.preview},null,8,["src"])])):(c(),V(Kt,{key:1,file:A,onRemove:C},null,8,["file"]))],8,vi)]))),128))])):_("",!0)])],64)}}}),_i={class:"flex flex-col h-full bg-[#11142C]"},xi=["aria-label"],yi={key:1,class:"flex items-center justify-center h-full"},ki={class:"text-white",role:"status"},Ci=o("span",{"aria-hidden":"true"},"...",-1),$i={class:"sr-only"},Mi=["aria-label"],Si=o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"
1currentColor",height:"12",width:"12",viewBox:"0 0 330 330","xml:space":"preserve"},[o("path",{d:"M325.607 79.393c-5.857-5.857-15.355-5.858-21.213.001l-139.39 139.393L25.607 79.393c-5.857-5.857-15.355-5.858-21.213.001-5.858 5.858-5.858 15.355 0 21.213l150.004 150a14.999 14.999 0 0 0 21.212-.001l149.996-150c5.859-5.857 5.859-15.355.001-21.213z"})],-1),Ti=[Si],Li={key:0,class:"relative z-20"},Ei=R({__name:"ChatWindow",props:{audioRecorder:{}},setup(t){const{t:e}=B(),s=F(),a=E(null),r=E(!1),{y:n,isScrolling:i,directions:h}=ys(a),l=E(0),u=E(!1),g=async()=>{if(await oe(),!a.value)return;const k=a.value.offsetHeight,D=a.value.scrollHeight;if(u.value){a.value.scrollTop=D,u.value=!1;return}let C=n.value;D-C-k<k/2?C=D:s.eventOfMessageUpdate==="load_more_messages"&&(C=D-l.value),a.value.scrollTop=C};ve(()=>{g(),s.markAllMessagesRead()}),Z(()=>s.chatMessages.length,(k,D)=>{k!==D&&g()});const m=async k=>{const D=await pr(k);s.addPrivateChatToList(D),be.emit(Oe.subscribeToChat,D.id),await oe(),s.openChat(D.id),await oe()},y=async k=>{var D;if(a!=null&&a.value){if(s.isActiveChatDraft){const C=s.activeChat.uid;try{de("start_chat",{uid:C}),await m(C)}catch(z){N(z,"create_private_chat",{uid:C}),(D=k.onResult)==null||D.call(k,!1);return}}u.value=!0,X.emit(W.sendMessage,k)}},f=$(()=>[...s.chatMessages].sort((k,D)=>new Date(k.created_at).getTime()-new Date(D.created_at).getTime())[0]);Z(n,()=>{a.value&&(l.value=a.value.scrollHeight-n.value),i.value&&a.value&&(h.top&&n.value<a.value.offsetHeight?r.value||(r.value=!0):r.value=!1)}),Z(r,()=>{r.value&&X.emit(W.loadMoreMessages,f.value.created_at)});const w=$(()=>{if(!a.value)return!1;const k=a.value.offsetHeight;return a.value.scrollHeight-n.value-k>k/2}),b=()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)};return(k,D)=>(c(),p("div",_i,[S(Er),o("div",{class:"flex-1 overflow-auto",ref_key:"chatWindow",ref:a,role:"log",tabindex:"0","aria-label":d(e)("messages")},[S(xe,{mode:"out-in","enter-from-class":"scale-95 opacity-30","enter-to-class":"scale-100 opacity-100","enter-active-class":"transition-all duration-100 ease-out","leave-to-class":"scale-90 opacity-10","leave-from-class":"scale-100 opacity-100","leave-active-class":"transition-all duration-50 ease-out",onEnter:g},{default:ce(()=>[d(s).chatLoaded||d(s).isActiveChatDraft?(c(),V(dn,{key:0,messages:d(s).chatMessages},null,8,["messages"])):(c(),p("div",yi,[o("div",ki,[Ci,o("span",$i,x(d(e)("loading")),1)])]))]),_:1}),w.value?(c(),p("button",{key:0,type:"button",onClick:b,class:"sticky ms-auto end-5 bottom-5 flex items-center justify-center h-10 w-10 rounded-full hover:bg-primary bg-primary/50 backdrop-blur-sm text-white transition-all z-10","aria-label":d(e)("scroll_to_bottom")},Ti,8,Mi)):_("",!0)],8,xi),d(s).enableOneWayCommunicationState?(c(),p("div",Li,[S(bi,{onSubmitMessage:y,audioRecorder:k.audioRecorder},null,8,["audioRecorder"])])):_("",!0)]))}}),Di={class:"relative h-full"},Ai=R({__name:"ChatWrapper",props:{audioRecorder:{}},setup(t){const e=F(),{width:s}=ye();return(a,r)=>(c(),p("div",Di,[S(xe,{mode:"out-in","enter-from-class":"translate-x-1 opacity-30","enter-to-class":"translate-x-0 opacity-100","enter-active-class":"transition-all duration-200 ease-out","leave-to-class":"-translate-x-8 opacity-10","leave-from-class":"translate-x-0 opacity-100","leave-active-class":"transition-all duration-100 ease-out"},{default:ce(()=>{var n;return[d(e).activeChat?(c(),V(Ei,{key:(n=d(e).activeChat)==null?void 0:n.uid,audioRecorder:a.audioRecorder},null,8,["audioRecorder"])):!d(e).activeChat&&d(s)>=640?(c(),V(ur,{key:1})):_("",!0)]}),_:1})]))}}),Ri={class:"space-y-1 py-4 sm:py-3 overflow-auto max-h-[75vh] sm:max-h-[500px]"},Ui=["onClick","disabled","aria-label"],Ii={class:"size-8 flex-shrink-0 overflow-hidden rounded-full"},zi={class:"text-start flex-1 min-w-0"},Bi=["title"],Pi=["title"],Fi={key:0,class:"text-xs text-custom-yellow"},Oi={key:1,class:"text-xs text-custom-yellow"},ts=R({__name:"StudentsList",props:{users:{}},setup(t){const{t:e}=B(),s=le(),a=F(),r=se(),n=i=>{a.newDraftPrivateChat(i),s.closeSearchUserModal(),s.closeMembersUserModal()};return(i,h)=>(c(),p("ul",Ri,[(c(!0),p(Y,null,ae(i.users,l=>(c(),p("li",{key:l.uid,class:"px-6"},[o("button",{type:"button",onClick:u=>n(l),class:"flex items-center gap-3 text-sm hover:bg-white/10 transition-all p-1 rounded-xl w-full disabled:pointer-events-none",disabled:l.uid===d(r).user.uid,"aria-label":`${d(e)("start_private_chat_with")} ${l.full_name}`},[o("div",Ii,[S(Ze,{image:l.avatar_url,fallback:l.full_name,"font-size":"text-xs"},null,8,["image","fallback"])]),o("div",zi,[o("div",{class:"truncate",title:l.full_name},x(l.full_name),9,Bi),o("div",{class:"text-xs text-white/70 truncate",title:l.email??void 0},x(l.email),9,Pi)]),l.is_teacher?(c(),p("span",Fi,x(d(e)("teacher")),1)):_("",!0),l.uid===d(r).user.uid?(c(),p("span",Oi,x(d(e)("you")),1)):_("",!0)],8,Ui)]))),128))]))}}),ji={class:"pt-4"},Gi={id:"search-user-title",class:"text-2xl sm:text-lg font-bold text-white ms-6 me-3 sm:me-6 mb-9 sm:mb-3 leading-none"},Ni={class:"absolute top-4 end-4 z-50 p-safe"},Yi=["aria-label"],Vi={class:"relative overflow-hidden mx-6"},Hi=["placeholder","aria-label"],Wi={class:"absolute top-1/2 -translate-y-1/2 start-2 opacity-0 peer-focus:opacity-0 peer-placeholder-shown:-translate-x-0 peer-placeholder-shown:opacity-100 -translate-x-4 peer-focus:-translate-x-4 transition-all"},qi={class:""},Xi=R({__name:"SearchUser",setup(t){const{t:e}=B(),s=E(""),a=E(null),r=F(),n=le(),i=E([]);let h=null;const l=async g=>{h==null||h.abort(),h=new AbortController;try{de("load_users",{hasQuery:!!g}),i.value=await Ns(g,h.signal)}catch(m){Ys(m)||(console.error("Error fetching users:",m),N(m,"load_users",{hasQuery:!!g}))}};ve(async()=>{var g;
1await oe(),(g=a.value)==null||g.focus(),l()}),We(()=>{h==null||h.abort()}),dt(s,(g,m)=>{g!==m&&l(g)},{throttle:300});const u=$(()=>i.value.filter(g=>!r.chatsList.privateChats.some(m=>m.uid===g.uid)));return(g,m)=>(c(),p("div",{class:"w-full sm:w-80 sm:rounded-3xl bg-[#292B43] h-full sm:h-auto p-safe",ref_key:"modal",ref:a,tabindex:"-1",role:"dialog","aria-modal":"true","aria-labelledby":"search-user-title"},[o("div",ji,[o("h2",Gi,x(d(e)("start_private_chat_with")),1),o("div",Ni,[o("button",{type:"button",onClick:m[0]||(m[0]=y=>d(n).closeSearchUserModal()),class:"flex justify-center items-center","aria-label":d(e)("close_modal")},[S(ke,{"aria-hidden":"true"})],8,Yi)]),o("div",Vi,[ie(o("input",{type:"search","onUpdate:modelValue":m[1]||(m[1]=y=>s.value=y),class:"w-full py-3 ps-2 pe-2 rounded-lg bg-white/10 text-white placeholder:text-white/60 focus:placeholder:opacity-0 peer placeholder-shown:ps-10 focus:ps-2 transition-[padding] outline-none focus-visible:ring-2 focus-visible:ring-white/70",placeholder:`${d(e)("search")}...`,"aria-label":d(e)("search_user")},null,8,Hi),[[He,s.value]]),o("span",Wi,[S(Xt)])]),o("div",qi,[S(ts,{users:u.value},null,8,["users"])])])],512))}}),Zi={class:"pt-4"},Ki={class:"absolute end-4 top-4 z-50 p-safe"},Qi=["aria-label"],Ji={class:"space-y-3 mb-2"},el={id:"chat-members-title",class:"px-6 text-xl text-white font-bold"},tl={class:"px-6 text-sm text-white/70"},sl={key:0,role:"alert",class:"px-6 pb-6 text-sm text-red-400"},al=R({__name:"ChatMembers",setup(t){const{t:e}=B(),s=F(),a=se(),r=le(),n=E(null),i=E([]),h=E(!1),l=E(!1);return(async()=>{var m;if(!a.user.is_teacher||!((m=s.activeChat)!=null&&m.id))return;const g=s.activeChat.id;try{de("load_chat_members",{chatId:g});const y=await hr(g);y&&(i.value=y.sort(f=>f.is_teacher?-1:1))}catch(y){l.value=!0,N(y,"load_chat_members",{chatId:g})}h.value=!0})(),Z(h,async g=>{var m;g&&(await oe(),(m=n.value)==null||m.focus())}),(g,m)=>h.value?(c(),p("div",{key:0,class:"w-full sm:w-96 sm:rounded-3xl bg-[#292B43] h-full sm:h-auto relative p-safe",ref_key:"modal",ref:n,tabindex:"-1",role:"dialog","aria-modal":"true","aria-labelledby":"chat-members-title"},[o("div",Zi,[o("div",Ki,[o("button",{type:"button",onClick:m[0]||(m[0]=y=>d(r).closeMembersUserModal()),class:"flex justify-center items-center","aria-label":d(e)("close_modal")},[S(ke,{"aria-hidden":"true"})],8,Qi)]),o("div",Ji,[o("h2",el,x(d(e)("group_members")),1),o("div",tl,x(d(e)("members",{value:i.value.length})),1)]),l.value?(c(),p("div",sl,x(d(e)("loading_error")),1)):(c(),V(ts,{key:1,users:i.value},null,8,["users"]))])],512)):_("",!0)}}),rl={},ol={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},nl=o("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),il=o("path",{d:"M12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),ll=o("path",{d:"M12 20C12.5523 20 13 19.5523 13 19C13 18.4477 12.5523 18 12 18C11.4477 18 11 18.4477 11 19C11 19.5523 11.4477 20 12 20Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),cl=[nl,il,ll];function dl(t,e){return c(),p("svg",ol,cl)}const ul=Q(rl,[["render",dl]]),pl=["onKeydown"],hl=["aria-expanded","aria-label"],ml={class:"space-y-1"},fl=["onClick"],gl=R({__name:"PopoverMenu",props:{items:{type:Array}},setup(t){const{t:e}=B(),s=E(!1),a=E(null),r=E(null);function n(m){m.stopPropagation(),m.preventDefault(),s.value=!s.value,s.value&&oe(()=>{var y,f;(f=(y=a.value)==null?void 0:y.querySelector("ul button"))==null||f.focus()})}function i(){s.value=!1}function h(){var m;s.value&&(i(),(m=r.value)==null||m.focus())}function l(m){var f;const y=m.relatedTarget;y&&((f=a.value)!=null&&f.contains(y))||i()}function u(m){s.value&&a.value&&!m.composedPath().includes(a.value)&&i()}function g(m){m.action(),h()}return ve(()=>{document.addEventListener("click",u)}),We(()=>{document.removeEventListener("click",u)}),(m,y)=>(c(),p("div",{ref_key:"wrapper",ref:a,class:"relative h-[24px]",onKeydown:qe(re(h,["stop"]),["esc"]),onFocusout:l},[o("button",{ref_key:"trigger",ref:r,type:"button",onClick:n,"aria-expanded":s.value,"aria-label":d(e)("chat_options")},[S(ul,{"aria-hidden":"true"})],8,hl),S(xe,{"enter-active-class":"transition transform duration-150","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"transition transform duration-100","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:ce(()=>[s.value?(c(),p("div",{key:0,class:"absolute top-0 right-0 w-40 rounded-2xl bg-white shadow-xl ring-1 ring-black/5 p-2",onClick:y[0]||(y[0]=re(()=>{},["stop"]))},[o("ul",ml,[(c(!0),p(Y,null,ae(t.items,(f,w)=>(c(),p("li",{key:w},[o("button",{type:"button",class:"w-full flex items-center px-3 py-2 rounded-xl text-left text-gray-800 hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:outline focus-visible:outline-1 focus-visible:outline-gray-800 z-10",onClick:re(b=>g(f),["stop"])},x(f.label),9,fl)]))),128))])])):_("",!0)]),_:1})],40,pl))}}),vl={key:0,class:"fixed inset-0 bg-black/50 z-[9999]"},wl={key:0,class:"fixed inset-0 z-[9999]"},bl=["aria-label","onKeydown"],_l={class:"flex justify-center items-center gap-2 absolute top-4 end-4 z-50 p-safe"},xl=["aria-label"],yl={class:"text-[13px] leading-[130%] text-white"},kl={class:"min-h-0 relative w-full min-w-0 overflow-hidden"},Cl={class:"sm:pt-5 bg-primary pb-4 z-10 max-h-[120px]"},$l={key:0,class:"ps-6 mb-4 pt-4 text-2xl font-bold text-white leading-none"},Ml={class:"min-h-0 relative w-full min-w-0 overflow-hidden"},Sl=["aria-label"],Tl=o("div",{class:"h-7 w-7"},[o("svg",{width:"32",height:"28",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("rect",{x:"2",width:"28",height:"28",rx:"8",fill:"#fff","fill-opacity":".1"}),o("path",{d:"M16 7.333v13.334M22.667 14H9.333",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1),Ll={class:"flex-none sm:flex-1 text-15px sm:text-base"},El={key:2,class:"flex-1 w-full sm:w-3/5 lg:w-[700px] lg:max-w-2xl sm:flex-1 overflow-hidden bg-[#11142C]"},Dl=R({__name:"ModalComponent",props:{audioRecorder:{}},setup(t){const{t:e}=B(),s=F(),a=le(),r=se(),{width:n,height:i}
1=ye(),h=E(null),l=E(""),u=$(()=>n.value<640),g=E(!1),m=()=>{g.value=!g.value},y=()=>{a.clearStore()},f=()=>{if(a.searchUserModalOpen){a.closeSearchUserModal();return}if(a.membersModalOpen){a.closeMembersUserModal();return}y()};ve(async()=>{var L;await oe(),h.value&&((L=h.value)==null||L.focus())});const w=()=>{var L;(L=h.value)==null||L.focus()},b=()=>{var L,M;return((M=(L=h.value)==null?void 0:L.getRootNode())==null?void 0:M.activeElement)??null},k=E(null);Z(()=>a.isModalOpen,L=>{var M,P;L?k.value=document.activeElement:((P=(M=k.value)==null?void 0:M.focus)==null||P.call(M),k.value=null)});const D=E(null);Z(()=>[a.searchUserModalOpen,a.membersModalOpen],([L,M],[P,ee])=>{var me,Ke;const pe=L||M,he=P||ee;pe&&!he?D.value=b():!pe&&he&&(a.isModalOpen&&((Ke=(me=D.value)==null?void 0:me.focus)==null||Ke.call(me)),D.value=null)});const C=L=>{if(L.key!=="Tab"||!h.value)return;const M=h.value.querySelector('[role="dialog"][aria-modal="true"]')??h.value,P=Array.from(M.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')).filter(me=>me.offsetParent!==null);if(!P.length)return;const ee=P[0],pe=P[P.length-1],he=b();L.shiftKey&&(he===ee||he===M)?(L.preventDefault(),pe.focus()):!L.shiftKey&&he===pe&&(L.preventDefault(),ee.focus())},z=$(()=>n.value>=640?Math.min(760,i.value*.95):i.value),j=L=>[...L].sort((M,P)=>{const ee=M.unread_messages_count>0?1:0;return(P.unread_messages_count>0?1:0)-ee}),K=$(()=>{const L=l.value?s.chats.groupChats.filter(M=>(M.title??"").toLowerCase().includes(l.value.toLowerCase())):s.chats.groupChats;return j(L)}),G=$(()=>{const L=l.value?s.chats.privateChats.filter(M=>(M.title??"").toLowerCase().includes(l.value.toLowerCase())):s.chats.privateChats;return j(L)}),H=$(()=>{const L=l.value?s.chats.supportChats.filter(M=>(M.subtitle??"").toLowerCase().includes(l.value.toLowerCase())):s.chats.supportChats;return j(L)}),T=$(()=>j(s.chats.archivedGroupChats)),v=$(()=>j(s.chats.archivedPrivateChats)),O=async L=>{var P;const M=s.selectedChatID===L.id;s.moveChat(L),M&&(await s.openChat(null),await oe(),(P=h.value)==null||P.focus())},A=async()=>{const L=s.activeChat;if(!(L!=null&&L.id)||s.isActiveChatDraft)return;const M=L.id;try{de("archive_chat",{chatId:M}),await mr(M),await O(L)}catch(P){console.error("Error archiving chat:",P),N(P,"archive_chat",{chatId:M})}},Ce=async()=>{const L=s.activeChat;if(!(L!=null&&L.id)||s.isActiveChatDraft)return;const M=L.id;try{de("restore_chat",{chatId:M}),await fr(M),await O(L)}catch(P){console.error("Error restoring chat:",P),N(P,"restore_chat",{chatId:M})}};return(L,M)=>(c(),p(Y,null,[S(xe,{"enter-from-class":"opacity-0","enter-to-class":"opacity-100","enter-active-class":"transition-all duration-100 ease-out","leave-to-class":"opacity-0","leave-from-class":"opacity-100","leave-active-class":"transition-all duration-150 ease-out"},{default:ce(()=>[d(a).isModalOpen?(c(),p("div",vl)):_("",!0)]),_:1}),S(xe,{"enter-from-class":"scale-90 opacity-0","enter-to-class":"scale-100 opacity-100","enter-active-class":"transition-all duration-200 ease-out","leave-to-class":"scale-90 opacity-0","leave-from-class":"scale-100 opacity-100","leave-active-class":"transition-all duration-100 ease-out",onAfterEnter:w},{default:ce(()=>{var P;return[d(a).isModalOpen?(c(),p("div",wl,[o("div",{class:"flex h-full sm:items-center justify-center sm:p-4 overflow-hidden",onClick:y},[o("div",{class:"lg:px-5 lg:pt-5 lg:pb-10 w-full lg:w-auto",onClick:M[6]||(M[6]=re(()=>{},["stop"]))},[o("div",{class:"relative w-full lg:w-fit h-full sm:h-auto overflow-hidden sm:rounded-[32px] bg-primary transition-all outline-none",tabindex:"-1",ref_key:"modal",ref:h,role:"dialog","aria-modal":"true","aria-label":d(e)("messages"),onKeydown:[qe(f,["esc"]),C]},[o("div",{class:"relative flex items-stretch p-safe",style:ge({height:`${z.value}px`})},[o("div",_l,[d(s).activeChat&&d(s).activeChat.type!==d(U).Support&&!d(s).isActiveChatDraft?(c(),V(gl,{key:0,items:d(s).activeChat.archived?[{label:d(e)("restore_chat"),action:Ce}]:[{label:d(e)("archive_chat"),action:A}]},null,8,["items"])):_("",!0),o("button",{type:"button",onClick:y,"aria-label":d(e)("close_modal")},[S(ke)],8,xl)]),g.value&&(!d(s).activeChat||!u.value)?(c(),p("div",{key:0,class:I(["sm:w-2/5 lg:w-72 sm:border-e sm:border-white/10 grid h-full min-h-0 [grid-template-rows:40px_1fr] sm:py-5 w-full",u.value?"pt-3":""])},[o("button",{type:"button",class:I(["mx-3 p-2 rounded-2xl bg-white/10 cursor-pointer flex items-center gap-1 text-start",u.value?"mr-12":""]),onClick:m},[S(qt,{class:"transform rotate-180","aria-hidden":"true"}),o("span",yl,x(d(e)("back_to_chats")),1)],2),o("div",kl,[S(st,{isMobileState:u.value,filteredGroupChats:T.value,filteredPrivateChats:v.value,filteredSupportChats:[],isArchivedChats:!0,chatsListLo
1aded:d(s).chatsListLoaded},null,8,["isMobileState","filteredGroupChats","filteredPrivateChats","chatsListLoaded"])])],2)):_("",!0),!g.value&&(!d(s).activeChat||!u.value)?(c(),p("div",{key:1,class:I(["sm:w-2/5 lg:w-72 sm:border-e sm:border-white/10 grid h-full min-h-0 [grid-template-rows:auto_1fr_auto]",d(s).activeChat?"w-auto":"w-full"])},[o("div",Cl,[u.value?(c(),p("h2",$l,x(d(e)("messages")),1)):_("",!0),S(cr,{onOnFilter:M[0]||(M[0]=ee=>l.value=ee)})]),o("div",Ml,[S(st,{isMobileState:u.value,filteredGroupChats:K.value,filteredPrivateChats:G.value,filteredSupportChats:H.value,chatsListLoaded:d(s).chatsListLoaded,isArchivedChats:g.value,onToggleArchived:m},null,8,["isMobileState","filteredGroupChats","filteredPrivateChats","filteredSupportChats","chatsListLoaded","isArchivedChats"])]),o("div",{class:I(["pt-3.5 pb-3.5 px-3 bg-primary z-10",d(r).user.is_teacher&&((P=d(s).activeChat)==null?void 0:P.type)===d(U).Group&&"pt-[18px] pb-[18px]"])},[o("ul",null,[o("li",null,[o("button",{type:"button",onClick:M[1]||(M[1]=ee=>d(a).openSearchUserModal()),class:"px-3 py-2 w-full rounded-[10px] justify-start items-center gap-2 inline-flex text text-start focus:outline-none focus-visible:outline-1 focus-visible:outline focus-visible:outline-white text-white/60 hover:text-white transition-all","aria-label":d(e)("start_private_chat")},[Tl,o("span",Ll,x(d(e)("start_private_chat")),1)],8,Sl)])])],2)],2)):_("",!0),d(s).activeChat||!u.value?(c(),p("div",El,[S(Ai,{audioRecorder:L.audioRecorder},null,8,["audioRecorder"])])):_("",!0)],4),d(a).searchUserModalOpen?(c(),p("div",{key:0,class:"absolute inset-0 bg-black/50 z-50 flex items-stretch sm:items-center justify-center",onClick:M[3]||(M[3]=ee=>d(a).closeSearchUserModal())},[o("div",{onClick:M[2]||(M[2]=re(()=>{},["stop"])),class:"w-full sm:w-auto"},[S(Xi)])])):_("",!0),d(a).membersModalOpen?(c(),p("div",{key:1,class:"absolute inset-0 bg-black/50 z-50 flex items-stretch sm:items-center justify-center",onClick:M[5]||(M[5]=ee=>d(a).closeMembersUserModal())},[o("div",{onClick:M[4]||(M[4]=re(()=>{},["stop"])),class:"w-full sm:w-auto"},[S(al)])])):_("",!0)],40,bl)])])])):_("",!0)]}),_:1})],64))}}),Al=["dir"],Rl=R({__name:"MessageComponent.ce",props:{audioRecorder:{}},setup(t){Xe();const e=E(null),s=le(),a=F(),{isModalOpen:r}=Ee(s),n=document.documentElement.dir,i=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,h=()=>{const l=e.value||document.body;if(i){Qe(l);return}r.value?ks(l,{reserveScrollBarGap:!0}):(a.openChat(null),Qe(l))};return h(),Z(r,()=>{h()}),(l,u)=>(c(),p("div",{class:"lingu-message whitespace-normal",ref_key:"modal",ref:e,part:"modal",dir:d(n)},[S(Dl,{audioRecorder:l.audioRecorder},null,8,["audioRecorder"])],8,Al))}}),Ul=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}
1button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.\\!pointer-events-auto{pointer-events:auto!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-1{top:.25rem;bottom:.25rem}.inset-y-1\\.5{top:.375rem;bottom:.375rem}.-bottom-1{bottom:-.25rem}.-end-0{inset-inline-end:-0px}.-end-0\\.5{inset-inline-end:-.125rem}.-end-1{inset-inline-end:-.25rem}.-end-2{inset-inline-end:-.5rem}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.bottom-5{bottom:1.25rem}.bottom-\\[65px\\]{bottom:65px}.end-0{inset-inline-end:0px}.end-2{inset-inline-end:.5rem}.end-4{inset-inline-end:1rem}.end-5{inset-inline-end:1.25rem}.left-\\[12px\\]{left:12px}.right-0{right:0}.start-0{inset-inline-start:0px}.start-2{inset-inline-start:.5rem}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:.5rem}.top-4{top:1rem}.top-\\[-1px\\]{top:-1px}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[11\\]{z-index:11}.z-\\[9999\\]{z-index:9999}.float-end{float:inline-end}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-0{margin-left:0;margin-right:0}.mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-me-1{margin-inline-end:-.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-9{margin-bottom:2.25rem}.me-2{margin-inline-end:.5rem}.me-3{margin-inline-end:.75rem}.me-auto{margin-inline-end:auto}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mr-12{margin-right:3rem}.ms-3{margin-inline-start:.75rem}.ms-6{margin-inline-start:1.5rem}.ms-auto{margin-inline-start:auto}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-\\[6px\\]{margin-top:6px}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}
1.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-8{width:2rem;height:2rem}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\\[24px\\]{height:24px}.h-\\[40px\\]{height:40px}.h-full{height:100%}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[200px\\]{max-height:200px}.max-h-\\[50\\%\\]{max-height:50%}.max-h-\\[75vh\\]{max-height:75vh}.min-h-0{min-height:0px}.min-h-\\[32px\\]{min-height:32px}.min-h-\\[36px\\]{min-height:36px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100\\%\\]{width:100%}.w-\\[11px\\]{width:11px}.w-\\[1px\\]{width:1px}.w-\\[calc\\(100\\%_-_24px\\)\\]{width:calc(100% - 24px)}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-10{min-width:2.5rem}.min-w-4{min-width:1rem}.min-w-\\[120px\\]{min-width:120px}.min-w-\\[50px\\]{min-width:50px}.min-w-\\[70px\\]{min-width:70px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.-translate-x-4{--tw-translate-x: -1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-8{--tw-translate-x: -2rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[40px\\]{--tw-translate-y: 40px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\\[8px\\]{gap:8px}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-none{overscroll-behavior:none}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:9999px}
1.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-ee-2xl{border-end-end-radius:1rem}.rounded-es-2xl{border-end-start-radius:1rem}.rounded-se-2xl{border-start-end-radius:1rem}.rounded-ss-2xl{border-start-start-radius:1rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-\\[\\#11142C\\]{--tw-border-opacity: 1;border-color:rgb(17 20 44 / var(--tw-border-opacity))}.border-blue-secondary{--tw-border-opacity: 1;border-color:rgb(97 222 255 / var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(255 112 128 / var(--tw-border-opacity))}.border-white\\/10{border-color:rgba(255,255,255,.1)}.\\!bg-\\[\\#515365\\]{--tw-bg-opacity: 1 !important;background-color:rgb(81 83 101 / var(--tw-bg-opacity))!important}.bg-\\[\\#11142C\\]{--tw-bg-opacity: 1;background-color:rgb(17 20 44 / var(--tw-bg-opacity))}.bg-\\[\\#292B43\\]{--tw-bg-opacity: 1;background-color:rgb(41 43 67 / var(--tw-bg-opacity))}.bg-\\[\\#757A92\\]{--tw-bg-opacity: 1;background-color:rgb(117 122 146 / var(--tw-bg-opacity))}.bg-\\[\\#E1FF6A\\]{--tw-bg-opacity: 1;background-color:rgb(225 255 106 / var(--tw-bg-opacity))}.bg-\\[\\#FF5858\\]{--tw-bg-opacity: 1;background-color:rgb(255 88 88 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(45 45 58 / var(--tw-bg-opacity))}.bg-black\\/10{background-color:rgba(45,45,58,.1)}.bg-black\\/20{background-color:rgba(45,45,58,.2)}.bg-black\\/50{background-color:rgba(45,45,58,.5)}.bg-blue-secondary{--tw-bg-opacity: 1;background-color:rgb(97 222 255 / var(--tw-bg-opacity))}.bg-blue-secondary\\/10{background-color:rgba(97,222,255,.1)}.bg-current{background-color:currentColor}.bg-custom-yellow{--tw-bg-opacity: 1;background-color:rgb(215 223 33 / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(27 31 56 / var(--tw-bg-opacity))}.bg-primary\\/50{background-color:rgba(27,31,56,.5)}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(214 0 31 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\\/10{background-color:rgba(255,255,255,.1)}.bg-white\\/20{background-color:rgba(255,255,255,.2)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.px-0{padding-left:0;padding-right:0}.px-0\\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-\\[1px\\]{padding-top:1px;padding-bottom:1px}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-3\\.5{padding-bottom:.875rem}.pb-4{padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pb-\\[18px\\]{padding-bottom:18px}.pe-1{padding-inline-end:.25rem}.pe-2{padding-inline-end:.5rem}.pe-20{padding-inline-end:5rem}.pl-2{padding-left:.5rem}.pr-3{padding-right:.75rem}.pr-\\[6px\\]{padding-right:6px}.ps-2{padding-inline-start:.5rem}.ps-3{padding-inline-start:.75rem}.ps-4{padding-inline-start:1rem}.ps-6{padding-inline-start:1.5rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-3{padding-top:.75rem}.pt-3\\.5{padding-top:.875rem}.pt-4{padding-top:1rem}.pt-\\[18px\\]{padding-top:18px}.pt-\\[2px\\]{padding-top:2px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-start{text-align:start}.text-end{text-align:end}.align-middle{vertical-align:middle}.text-13px{font-size:13px}.text-15px{font-size:15px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[10px\\]{font-size:10px}.text-\\[10px\\]\\/tight{font-size:10px;line-height:1.25}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-\\[300\\]{font-weight:300}.font-\\[600\\]{font-weight:600}.font-\\[700\\],.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.\\!leading-none{line-height:1!important}.\\!leading-tight{line-height:1.25!important}.leading-\\[130\\%\\]{line-height:130%}.leading-none{line-height:1}.leading-snug{line-height:1.375}.text-\\[\\#2D2D3A\\]{--tw-text-opacity: 1;color:rgb(45 45 58 / var(--tw-text-opacity))}.text-\\[\\#FF8A93\\]{--tw-text-opacity: 1;color:rgb(255 138 147 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(45 45 58 / var(--tw-text-opacity))}.text-blue-secondary{--tw-text-opacity: 1;color:rgb(97 222 255 / var(--tw-text-opacity))}.text-current{color:currentColor}.text-custom-yellow{--tw-text-opacity: 1;color:rgb(215 223 33 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(255 112 128 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white\\/30{color:rgba(255,255,255,.3)}.text-white\\/40{color:rgba(255,255,255,.4)}.text-white\\/50{color:rgba(255,255,255,.5)}.text-white\\/60{color:rgba(255,255,255,.6)}.text-white\\/70{color:rgba(255,255,255,.7)}.text-white\\/80{color:rgba(255,255,255,.8)}.text-opacity-10{--tw-text-opacity: .1}.\\!opacity-100{opacity:1!important}.opacity-0{opacity:0}
1.opacity-10{opacity:.1}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-sha
1dow, 0 0 #0000)}.ring-black\\/5{--tw-ring-color: rgb(45 45 58 / .05)}.blur-sm{--tw-blur: blur(4px);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-sm{--tw-backdrop-blur: blur(4px);-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,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[padding\\]{transition-property:padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[stroke-dashoffset\\]{transition-property:stroke-dashoffset;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-\\[400ms\\]{transition-duration:.4s}.duration-\\[5s\\]{transition-duration:5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.p-safe{padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}.\\[grid-template-rows\\:40px_1fr\\]{grid-template-rows:40px 1fr}.\\[grid-template-rows\\:auto_1fr_auto\\]{grid-template-rows:auto 1fr auto}@font-face{font-family:Inter;src:url(https://uicdn.lingu.com/messages/production/Inter-Regular-3127f0b8.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:Inter;src:url(https://uicdn.lingu.com/messages/production/Inter-Medium-a645f554.ttf) format("truetype");font-weight:500;font-style:normal}@font-face{font-family:Inter;src:url(https://uicdn.lingu.com/messages/production/Inter-SemiBold-b0b540e6.ttf) format("truetype");font-weight:600;font-style:normal}@font-face{font-family:Inter;src:url(https://uicdn.lingu.com/messages/production/Inter-Bold-412c068e.ttf) format("truetype");font-weight:700;font-style:normal}.lingu-message{font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}[dir=rtl] .dir-auto{transform:scaleX(-1)}input[type=search]::-webkit-search-cancel-button{display:none!important}.tiptap p.is-editor-empty:first-child:before{color:rgba(255,255,255,.5);content:attr(data-placeholder);float:inline-start;height:0;pointer-events:none}.ProseMirror{line-height:1.5;min-height:6em;max-height:15em;outline:none;overflow:auto}.ProseMirror:focus-visible{outline:2px solid rgba(255,255,255,.7);outline-offset:2px;border-radius:4px}[dir=rtl] .tiptap.ProseMirror{direction:rtl}.placeholder\\:text-white\\/60::-moz-placeholder{color:rgba(255,255,255,.6)}.placeholder\\:text-white\\/60::placeholder{color:rgba(255,255,255,.6)}.first\\:ps-4:first-child{padding-inline-start:1rem}.last\\:pe-4:last-child{padding-inline-end:1rem}.placeholder-shown\\:ps-10:-moz-placeholder-shown{padding-inline-start:2.5rem}.placeholder-shown\\:ps-10:placeholder-shown{padding-inline-start:2.5rem}.hover\\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:bg-black\\/10:hover{background-color:rgba(45,45,58,.1)}.hover\\:bg-black\\/5:hover{background-color:rgba(45,45,58,.05)}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:bg-primary:hover{--tw-bg-opacity: 1;background-color:rgb(27 31 56 / var(--tw-bg-opacity))}.hover\\:bg-white\\/10:hover{background-color:rgba(255,255,255,.1)}.hover\\:bg-white\\/5:hover{background-color:rgba(255,255,255,.05)}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\\:text-white\\/90:hover{color:rgba(255,255,255,.9)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:contrast-75:hover{--tw-contrast: contrast(.75);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)}.focus\\:ps-2:focus{padding-inline-start:.5rem}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:placeholder\\:opacity-0:focus::-moz-placeholder{opacity:0}
1.focus\\:placeholder\\:opacity-0:focus::placeholder{opacity:0}.focus-visible\\:bg-black\\/5:focus-visible{background-color:rgba(45,45,58,.05)}.focus-visible\\:bg-gray-100:focus-visible{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-1:focus-visible{outline-width:1px}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-gray-800:focus-visible{outline-color:#1f2937}.focus-visible\\:outline-white:focus-visible{outline-color:#fff}.focus-visible\\:outline-white\\/80:focus-visible{outline-color:rgba(255,255,255,.8)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-sha
1dow, 0 0 #0000)}.focus-visible\\:ring-white\\/70:focus-visible{--tw-ring-color: rgb(255 255 255 / .7)}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:focus-within .group-focus-within\\:pointer-events-auto{pointer-events:auto}.group:focus-within .group-focus-within\\:opacity-100{opacity:1}.group:hover .group-hover\\:pointer-events-auto{pointer-events:auto}.group:hover .group-hover\\:text-opacity-\\[0\\.16\\]{--tw-text-opacity: .16}.group:hover .group-hover\\:opacity-100{opacity:1}.peer:-moz-placeholder-shown~.peer-placeholder-shown\\:-translate-x-0{--tw-translate-x: -0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:placeholder-shown~.peer-placeholder-shown\\:-translate-x-0{--tw-translate-x: -0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:-moz-placeholder-shown~.peer-placeholder-shown\\:opacity-100{opacity:1}.peer:placeholder-shown~.peer-placeholder-shown\\:opacity-100{opacity:1}.peer:-moz-placeholder-shown~.peer-placeholder-shown\\:opacity-50{opacity:.5}.peer:placeholder-shown~.peer-placeholder-shown\\:opacity-50{opacity:.5}.peer:focus~.peer-focus\\:-translate-x-4{--tw-translate-x: -1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:focus~.peer-focus\\:opacity-0{opacity:0}.peer:focus-visible~.peer-focus-visible\\:ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-sha
1dow, 0 0 #0000)}.peer:focus-visible~.peer-focus-visible\\:ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.peer:focus-visible~.peer-focus-visible\\:ring-offset-1{--tw-ring-offset-width: 1px}@media (min-width: 640px){.sm\\:-top-2{top:-.5rem}.sm\\:end-1{inset-inline-end:.25rem}.sm\\:end-1\\.5{inset-inline-end:.375rem}.sm\\:end-4{inset-inline-end:1rem}.sm\\:mb-3{margin-bottom:.75rem}.sm\\:me-6{margin-inline-end:1.5rem}.sm\\:inline{display:inline}.sm\\:h-12{height:3rem}.sm\\:h-auto{height:auto}.sm\\:max-h-\\[500px\\]{max-height:500px}.sm\\:w-12{width:3rem}.sm\\:w-2\\/5{width:40%}.sm\\:w-3\\/5{width:60%}.sm\\:w-80{width:20rem}.sm\\:w-96{width:24rem}.sm\\:w-auto{width:auto}.sm\\:max-w-\\[510px\\]{max-width:510px}.sm\\:flex-1{flex:1 1 0%}.sm\\:items-center{align-items:center}.sm\\:gap-3{gap:.75rem}.sm\\:space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.sm\\:overscroll-auto{overscroll-behavior:auto}.sm\\:rounded-3xl{border-radius:1.5rem}.sm\\:rounded-\\[20px\\]{border-radius:20px}.sm\\:rounded-\\[32px\\]{border-radius:32px}.sm\\:rounded-ee-\\[20px\\]{border-end-end-radius:20px}.sm\\:rounded-es-\\[20px\\]{border-end-start-radius:20px}.sm\\:rounded-se-\\[20px\\]{border-start-end-radius:20px}.sm\\:rounded-ss-\\[20px\\]{border-start-start-radius:20px}.sm\\:border-e{border-inline-end-width:1px}.sm\\:border-white\\/10{border-color:rgba(255,255,255,.1)}.sm\\:p-4{padding:1rem}.sm\\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.sm\\:pb-9{padding-bottom:2.25rem}.sm\\:pe-5{padding-inline-end:1.25rem}.sm\\:ps-4{padding-inline-start:1rem}.sm\\:ps-6{padding-inline-start:1.5rem}.sm\\:pt-5{padding-top:1.25rem}.sm\\:pt-8{padding-top:2rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:w-72{width:18rem}.lg\\:w-\\[700px\\]{width:700px}.lg\\:w-auto{width:auto}.lg\\:w-fit{width:-moz-fit-content;width:fit-content}.lg\\:max-w-2xl{max-width:42rem}.lg\\:px-5{padding-left:1.25rem;padding-right:1.25rem}.lg\\:pb-10{padding-bottom:2.5rem}.lg\\:pt-5{padding-top:1.25rem}}@media (orientation: landscape){.landscape\\:max-w-full{max-width:100%}@media (min-width: 1024px){.landscape\\:lg\\:max-w-\\[510px\\]{max-width:510px}}}.\\[\\&_a\\:hover\\]\\:no-underline a:hover{text-decoration-line:none}.\\[\\&_a\\]\\:break-all a{word-break:break-all}.\\[\\&_a\\]\\:text-blue-primary a{--tw-text-opacity: 1;color:rgb(0 165 215 / var(--tw-text-opacity))}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_a\\]\\:hover\\:no-underline:hover a{text-decoration-line:none}
2`,Il=Q(Rl,[["styles",[Ul]]]),zl=R({__name:"ButtonComponent.ce",props:{styles:{}},setup(t){Xe();const e=le();return(s,a)=>(c(),p("button",{type:"button",part:"button",style:ge(s.styles),onClick:a[0]||(a[0]=r=>d(e).openModal())},[Cs(s.$slots,"default")],4))}}),Bl=`button{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0;text-transform:none;cursor:pointer;-webkit-appearance:button;background-color:transparent;background-image:none;box-sizing:border-box;border-width:0;border-style:solid}
3`,Pl=Q(zl,[["styles",[Bl]]]),Fl={role:"status"},Ol=R({__name:"BadgeComponent.ce",props:{styles:{},dataChatId:{}},setup(t){Xe();const{t:e}=B(),s=F(),a={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"},r=t,n=$(()=>r.dataChatId),i=$(()=>{var h;return n.value?((h=s.chats.groupChats.find(l=>l.id===n.value))==null?void 0:h.unread_messages_count)||0:s.newMessages});
3return(h,l)=>(c(),p("span",Fl,[i.value>0?(c(),p("span",{key:0,style:ge(h.styles),part:"badge","aria-hidden":"true"},x(i.value>99?"99+":i.value),5)):_("",!0),i.value>0?(c(),p("span",{key:1,style:a},x(d(e)("chat.new_private_messages",{value:i.value})),1)):_("",!0)]))}}),lt="lingu-chat",jl="lingu-button",Gl="lingu-badge";if("LINGU_MESSAGES"in window)console.warn("Lingu messages component already loaded.");else{try{Ss()}catch(a){console.error("Sentry init failed",a)}$s(Ms()),Fs(),Hs(lt),qs();const t=Ue(Il),e=Ue(Pl),s=Ue(Ol);customElements.define(lt,t),customElements.define(jl,e),customElements.define(Gl,s)}

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.