"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const t=require("../../../../../common/assets.js"),n=require("../../../../utils/env.js");Math||(a+o+r)();const a=()=>"../../../common/Icon.js",o=()=>"../../../common/Avatar/index.js",r=()=>"../../../common/Drawer/index.js",i=e.defineComponent({__name:"index",props:{groupID:{default:""}},setup(a){const o=a,r=e.ref(),i=e.ref(0),u=e.ref(!1),s=e.ref([]);async function c(){return(await e.es.getGroupApplicationList()).data.applicationList.filter((e=>e.groupID===o.groupID))}function p(){u.value=!u.value}async function l(){const t=await c();if(0===t.length)return[];const n=t.map((e=>0===e.applicationType?e.applicant:e.userID)),{data:a}=await e.Zt.getUserProfile({userIDList:n}),o={};a.forEach((e=>{o[e.userID]=e}));return t.map((e=>{const t=o[0===e.applicationType?e.applicant:e.userID];return{nick:t.nick||t.userID||"anonymous",avatar:t.avatar||"",isRemoved:!1,application:e}}))}function f(t,n,a){e.es.handleGroupApplication({handleAction:n,application:t.application}).then((()=>{s.value[a].isRemoved=!0,setTimeout((()=>{s.value.splice(a,1),i.value-=1}),150)})).catch((()=>{}))}function d(){l().then((e=>{s.value=e,i.value=e.length}))}return e.watch(u,(e=>{e&&l().then((e=>{s.value=e,i.value=e.length}))})),e.watch((()=>s.value.length),((e,t)=>{t>0&&0===e&&(u.value=!1)})),e.onMounted((()=>{c().then((e=>{i.value=e.length})),e.Jt.watch(e.o.GRP,{groupSystemNoticeList:d})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.GRP,{groupSystemNoticeList:d})})),(a,o)=>e.e({a:e.unref(i)>0},e.unref(i)>0?{b:e.t(e.unref(i)),c:e.t(e.unref(e.Wt).t("TUIChat.条入群申请")),d:e.t(e.unref(e.Wt).t("TUIChat.点击处理")),e:e.o$1(p)}:{},{f:e.unref(n.isPC)},e.unref(n.isPC)?{g:e.p({file:e.unref(t.closeIcon$1),size:"16px"})}:{h:e.t(e.unref(e.Wt).t("关闭"))},{i:e.o$1(p),j:e.f(e.unref(s),((t,n,a)=>({a:"50f8ddf9-2-"+a+",50f8ddf9-0",b:e.p({url:t.avatar,useSkeletonAnimation:!0}),c:e.t(t.nick),d:e.o$1((e=>f(t,"Agree",n)),t.nick),e:e.o$1((e=>f(t,"Reject",n)),t.nick),f:t.nick,g:t.isRemoved?1:""}))),k:e.t(e.unref(e.Wt).t("TUIChat.申请加入")),l:e.t(e.unref(e.Wt).t("TUIChat.同意")),m:e.t(e.unref(e.Wt).t("TUIChat.拒绝")),n:e.sr(r,"50f8ddf9-0",{k:"drawerDomInstanceRef"}),o:e.o$1(p),p:e.p({visible:e.unref(u),zIndex:998,popDirection:e.unref(n.isMobile)?"bottom":"right",isFullScreen:e.unref(n.isMobile),overlayColor:e.unref(n.isMobile)?void 0:"transparent",drawerStyle:{bottom:{minHeight:"60vh",maxHeight:"80vh",borderRadius:"12px 12px 0 0"},right:{width:"360px",borderRadius:"12px 0 0 12px",boxShadow:"0 0 10px 0 #d0d0d0"}}})})}}),u=e._export_sfc(i,[["__scopeId","data-v-50f8ddf9"]]);wx.createComponent(u);
