1import{aL as f,b6 as n,aN as p,aO as m,aJ as r,aK as o}from"./DGfe1mPV.js";import{u as _,p as h,v as d,i,g as l,s as a,C as v,w as E,x as w,M as u,y as c,z as g,A as P}from"./eylzXaxE.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"[email protected]"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cf8be44e-81a1-4ce4-b30f-02ba4ad12e59",e._sentryDebugIdIdentifier="sentry-dbid-cf8be44e-81a1-4ce4-b30f-02ba4ad12e59")}catch{}})();const b={name:"DmGlobalPresenceBridge",data(){return{authStore:n(),echoPresence:null,echoPresenceChannelName:null}},computed:{logged(){return this.authStore.logged}},watch:{logged(e){e?this.setupPresence():this.teardownPresence()}},mounted(){this.logged&&this.setupPresence()},beforeUnmount(){this.teardownPresence()},methods:{async setupPresence(){},teardownPresence(){if(typeof window<"u"&&window.$echo&&this.echoPresenceChannelName)try{window.$echo.leave(this.echoPresenceChannelName)}catch{}_().clear(),this.echoPresence=null,this.echoPresenceChannelName=null}}},S={class:"hidden","aria-hidden":"true"};function y(e,t,s,I,T,N){return p(),m("span",S)}const B=f(b,[["render",y]]),k={name:"DmContactPresenceHeartbeat",data(){return{authStore:n(),apiBase:"",sessionId:"",interval:null,onVisibility:null,onOnline:null,onPageHide:null}},computed:{logged(){return this.authStore.logged},active(){return!1}},watch:{logged(e){e?this.start():this.stop()}},mounted(){this.logged&&this.start()},beforeUnmount(){this.stop()},methods:{start(){!this.active||i()||this.interval||(this.apiBase=r(o()),this.sessionId=l(),this.heartbeat(),this.interval=a(()=>this.heartbeat(),()=>document.visibilityState==="hidden"?E:w,v),this.onOnline=()=>this.heartbeat(),window.addEventListener("online",this.onOnline),this.onPageHide=()=>this.sessionEnd(),window.addEventListener("pagehide",this.onPageHide))},stop(){this.interval&&(this.interval.stop(),this.interval=null),this.onOnline&&(window.removeEventListener("online",this.onOnline),this.onOnline=null),this.onPageHide&&(window.removeEventListener("pagehide",this.onPageHide),this.onPageHide=null)},async heartbeat(){if(!(!this.active||!this.authStore.token))try{await d(this.apiBase,this.authStore.token,"user/messages/presence/heartbeat",{sessionId:this.sessionId})}catch{}},sessionEnd(){this.sessionId&&h(this.apiBase,this.authStore.token,"user/messages/presence/session-end",{sessionId:this.sessionId})}},render(){return null}},H={name:"DmPresenceTickBridge",data(){return{authStore:n(),apiBase:"",sessionId:"",interval:null,onPageHide:null}},computed:{logged(){return this.authStore.logged},active(){return P()}},watch:{logged(e){e?this.start():this.stop()}},mounted(){this.logged&&this.start()},beforeUnmount(){this.stop()},methods:{start(){!this.active||i()||this.interval||(this.apiBase=r(o()),this.sessionId=l(),this.tick(),this.interval=a(()=>this.tick(),()=>g,c),this.onPageHide=()=>this.sessionEnd(),window.addEventListener("pagehide",this.onPageHide))},stop(){this.interval&&(this.interval.stop(),this.interval=null),this.onPageHide&&(window.removeEventListener("pagehide",this.onPageHide),this.onPageHide=null)},async tick(){if(!(!this.active||!this.authStore.token))try{const{status:e,data:t}=await d(this.apiBase,this.authStore.token,"user/messages/presence/tick",{sessionId:this.sessionId});if(e===429)return;const s=t?.unread_tabs;s&&typeof document<"u"&&document.dispatchEvent(new CustomEvent(u,{detail:s}))}catch{}},sessionEnd(){this.sessionId&&h(this.apiBase,this.authStore.token,"user/messages/presence/session-end",{sessionId:this.sessionId})}},render(){return null}},R={name:"NavUnreadPollingBridge",data(){return{authStore:n(),interval:null}},computed:{logged(){return this.authStore.logged},active(){return!1}},watch:{logged(e){e?this.start():this.stop()}},mounted(){this.logged&&this.start()},beforeUnmount(){this.stop()},methods:{start(){!this.active||i()||this.interval||(this.poll(),this.interval=a(()=>this.poll(),()=>g,c))},stop(){this.interval&&(this.interval.stop(),this.interval=null)},async poll(){if(!(!this.active||!this.authStore.token))try{const{data:e}=await this.$axios.get("user/messages/unread-summary"),t=e?.unread_tabs;t&&typeof document<"u"&&document.dispatchEvent(new CustomEvent(u,{detail:t}))}catch{}}},render(){return null}};export{R as _,H as a,k as b,B as c};
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.