"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const t=require("../../../../utils/env.js");Math||l();const l=()=>"../../../common/BottomPopup/index.js",u=e.defineComponent({__name:"index",emits:["onAtListOpen","insertAt"],setup(l,{expose:u,emit:a}){const s=a,n=e.ref(),i=e.ref(),o=e.ref(!1),v=e.ref(),r=e.ref(),d=e.ref(),c=e.ref(!1),f=e.ref({left:0,top:0}),p=e.ref(0),m=e.ref(""),h={userID:e.qt.TYPES.MSG_AT_ALL,nick:"所有人",isAll:!0,avatar:"https://web.sdk.qcloud.com/im/assets/images/at.svg"};e.Jt.watch(e.o.CONV,{currentConversationID:t=>{var l,u;if(t!==m.value)if(m.value=t,v.value=[],r.value=[],d.value=[],c.value=!1,e.Jt.update(e.o.CUSTOM,"memberList",v.value),null==(l=null==m?void 0:m.value)?void 0:l.startsWith("GROUP")){c.value=!0;const t=null==(u=null==m?void 0:m.value)?void 0:u.substring(5);e.es.switchGroup(t)}else e.es.switchGroup("")}}),e.Jt.watch(e.o.GRP,{currentGroupMemberList:t=>{v.value=t,r.value=[h,...v.value],d.value=r.value,e.Jt.update(e.o.CUSTOM,"memberList",v.value)}});const g=e=>{c.value&&(o.value=e,o.value&&s("onAtListOpen"))};e.i.toggleAtList=g,e.i.handleAtListPosition=e=>{f.value=e},e.i.setCurrentSelectIndex=e=>{var t,l;p.value=e,null==(l=null==(t=i.value)?void 0:t[p.value])||l.scrollIntoView(!1)},e.i.setShowMemberList=e=>{d.value=e},u({toggleAtList:g}),e.watch((()=>[f.value,null==n?void 0:n.value]),(()=>{var e;!t.isH5&&(null==n?void 0:n.value)&&(null==(e=null==n?void 0:n.value)?void 0:e.style)&&(n.value.style.left=f.value.left+"px",n.value.style.top=f.value.top-n.value.clientHeight+"px")}));const C=()=>{o.value=!1,d.value=r.value,f.value={left:0,top:0}},I=e=>(null==e?void 0:e.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",b=e=>(null==e?void 0:e.nick)?null==e?void 0:e.nick:null==e?void 0:e.userID;return(l,u)=>e.e({a:!e.unref(t.isPC)},e.unref(t.isPC)?{}:{b:e.t(e.unref(e.Wt).t("TUIChat.选择提醒的人"))},{c:e.f(e.unref(d),((l,u,a)=>({a:I(l),b:e.t(b(l)),c:u,d:e.n(u===e.unref(p)&&"selected"),e:e.o$1((l=>(l=>{var u;if(t.isPC&&e.i.selectItem)e.i.selectItem(l);else if(null==(u=null==d?void 0:d.value)?void 0:u.length){const e=null==d?void 0:d.value[l];s("insertAt",{id:null==e?void 0:e.userID,label:(null==e?void 0:e.nick)||(null==e?void 0:e.userID)})}C()})(u)),u)}))),d:e.n(e.unref(t.isPC)?"message-input-at":"message-input-at-h5"),e:e.o$1(C),f:e.p({show:e.unref(o)})})}}),a=e._export_sfc(u,[["__scopeId","data-v-08dbad30"]]);wx.createComponent(a);
