import{n as i}from"./_plugin-vue2_normalizer-khdWz7r2.chunk.mjs";import{l as o}from"./public-BSZ20KYR.chunk.mjs";import"./modulepreload-polyfill-DE-oIJqv.chunk.mjs";import"./index-BGFdrNqh.chunk.mjs";import{A as n}from"./AvatarWrapper-DZqmzjf2.chunk.mjs";import{C as p,a as l}from"./Editor-CeNGp2mq.chunk.mjs";import"./vue.runtime.esm-DO2cz8pp.chunk.mjs";import"./index-DfiDB3im.chunk.mjs";import"./emoji-picker-KVqjnXYv.chunk.mjs";import"./index-Bc2S5k6V.chunk.mjs";import"./index-BdNd3WSV.chunk.mjs";import"./_plugin-vue2_normalizer-CQ6iBklL-C2xaZ2hl.chunk.mjs";import"./RichText-QukHfQba.chunk.mjs";import"./index-Ct2iTpP3.chunk.mjs";import"./MediaHandler.provider-DkklcpwC.chunk.mjs";import"./logger-BOSm1sVH.chunk.mjs";import"./Wrapper-2XEOnMa9.chunk.mjs";import"./index-C4crf4p_.chunk.mjs";import"./_commonjs-dynamic-modules-Cdb4quZm.chunk.mjs";const u={name:"SessionList",components:{AvatarWrapper:n,NcPopover:o},props:{sessions:{type:Object,default:()=>({})}},data(){return{myName:""}},computed:{label(){return t("text","Active people")},participantsPopover(){return this.currentSession?.guestName?this.participantsWithoutCurrent:this.participants},participantsWithoutCurrent(){return this.participants.filter(s=>!s.isCurrent)},participants(){return Object.values(this.sessions).filter(s=>s.lastContact>Date.now()/1e3-p&&(s.userId!==null||s.guestName!==null)).sort((s,e)=>s.lastContact<e.lastContact)},currentSession(){return Object.values(this.sessions).find(s=>s.isCurrent)},avatarStyle(){return s=>({opacity:s.lastContact>Date.now()/1e3-l?1:.5})},sessionsVisible(){return this.participantsWithoutCurrent.slice(0,3)}}};var c=function(){var s=this,e=s._self._c;return e("NcPopover",{staticClass:"session-list",attrs:{placement:"bottom"},scopedSlots:s._u([{key:"trigger",fn:function({attrs:r}){return[e("div",[e("button",s._b({staticClass:"avatar-list",attrs:{title:s.label,"aria-label":s.label}},"button",r,!1),[e("div",{staticClass:"avatardiv icon-group"}),s._l(s.sessionsVisible,function(a){return e("AvatarWrapper",{key:a.id,attrs:{session:a,size:30}})})],2)])]}},{key:"default",fn:function(){return[e("div",{staticClass:"session-menu"},[s._t("lastSaved"),e("ul",[s._t("default"),s._l(s.participantsPopover,function(r){return e("li",{key:r.id,style:s.avatarStyle(r)},[e("AvatarWrapper",{attrs:{session:r,size:36}}),e("span",{staticClass:"session-label"},[s._v(" "+s._s(r.userId?r.displayName:r.guestName?r.guestName:s.t("text","Guest"))+" ")]),r.userId===null?e("span",{staticClass:"guest-label"},[s._v("("+s._s(s.t("text","guest"))+")")]):s._e()],1)})],2)],2)]},proxy:!0}],null,!0)})},m=[],v=i(u,c,m,!1,null,"6c8e0995");const z=v.exports;export{z as default};
//# sourceMappingURL=SessionList-JVUK4aeT.chunk.mjs.map
