import{b as o,c as l}from"./NcNoteCard-ChweF_5Q-DZCruKzr.chunk.mjs";import{N as n}from"./NcCheckboxRadioSwitch-ip_mRd2T-kNk9kCSa.chunk.mjs";import{n as a}from"./_plugin-vue2_normalizer-wd1ZAbRr.chunk.mjs";import{A as u}from"./AvatarWrapper-CXaRHwzj.chunk.mjs";import{C as c,a as p}from"./Editor-COCuKOj6.chunk.mjs";import{l as m}from"./index-DfiDB3im.chunk.mjs";import{c as d,g as h}from"./index-Dtu68Mmq.chunk.mjs";import"./modulepreload-polyfill-nb9XBeg7.chunk.mjs";import"./emoji-picker-DlAAdvrL.chunk.mjs";import"./NcLoadingIcon-CHw5fok5.chunk.mjs";import"./vue.runtime.esm-C7aVrvtW.chunk.mjs";import"./NcColorPicker-CXHUHxQL.chunk.mjs";import"./index-DqP6CuPc.chunk.mjs";import"./MediaHandler.provider-BJ1SsG4D.chunk.mjs";import"./logger-Bu78VaEB.chunk.mjs";import"./index-_QHNqdwt.chunk.mjs";import"./index-DRiraEpW.chunk.mjs";import"./MenuBar-D2fziTHe.chunk.mjs";import"./Wrapper-B2WhJG1q.chunk.mjs";const f={name:"AccountMultipleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var _=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon account-multiple-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},v=[],g=a(f,_,v,!1,null,null);const C=g.exports,b={name:"SessionList",components:{AccountMultipleIcon:C,AvatarWrapper:u,NcButton:o,NcPopover:l,NcCheckboxRadioSwitch:n},props:{sessions:{type:Object,default:()=>({})}},data(){return{myName:"",isFullWidth:m("text","is_full_width_editor",!1)}},computed:{label(){return t("text","Active people")},participantsPopover(){return this.currentSession?.guestName?this.participantsWithoutCurrent:this.participants},participantsWithoutCurrent(){return this.participants.filter(e=>!e.isCurrent)},participants(){return Object.values(this.sessions).filter(e=>e.lastContact>Date.now()/1e3-c&&(e.userId!==null||e.guestName!==null)).sort((e,i)=>e.lastContact<i.lastContact)},currentSession(){return Object.values(this.sessions).find(e=>e.isCurrent)},avatarStyle(){return e=>({opacity:e.lastContact>Date.now()/1e3-p?1:.5})},sessionsVisible(){return this.participantsWithoutCurrent.slice(0,3)}},methods:{onWidthToggle(e){this.isFullWidth=e,this.$emit("editor-width-change",e?"100%":"80ch"),d.post(h("/apps/text/settings"),{key:"is_full_width_editor",value:e?"1":"0"})}}};var y=function(){var e=this,i=e._self._c;return i("NcPopover",{staticClass:"session-list",attrs:{placement:"bottom"},scopedSlots:e._u([{key:"trigger",fn:function({attrs:s}){return[i("div",[i("NcButton",e._b({staticClass:"avatar-list",attrs:{title:e.label,"aria-label":e.label,type:"tertiary"},scopedSlots:e._u([{key:"icon",fn:function(){return[i("AccountMultipleIcon",{attrs:{size:20}}),e._l(e.sessionsVisible,function(r){return i("AvatarWrapper",{key:r.id,attrs:{session:r,size:28}})})]},proxy:!0}],null,!0)},"NcButton",s,!1))],1)]}},{key:"default",fn:function(){return[i("div",{staticClass:"session-menu"},[e._t("lastSaved"),i("ul",[e._t("default"),e._l(e.participantsPopover,function(s){return i("li",{key:s.id,style:e.avatarStyle(s)},[i("AvatarWrapper",{attrs:{session:s,size:36}}),i("span",{staticClass:"session-label"},[e._v(" "+e._s(s.userId?s.displayName:s.guestName?s.guestName:e.t("text","Guest"))+" ")]),s.userId===null?i("span",{staticClass:"guest-label"},[e._v("("+e._s(e.t("text","guest"))+")")]):e._e()],1)}),i("li",[i("NcCheckboxRadioSwitch",{attrs:{checked:e.isFullWidth},on:{"update:checked":e.onWidthToggle}},[e._v(" "+e._s(e.t("text","Full width editor"))+" ")])],1)],2)],2)]},proxy:!0}],null,!0)})},x=[],A=a(b,y,x,!1,null,"b102370b");const G=A.exports;export{G as default};
//# sourceMappingURL=SessionList-BUoyJfPj.chunk.mjs.map
