import{u as k}from"./vue-i18n-90d534a9.js";import{l as D,o as b,I,q as g,_ as G}from"./index-ae60edf9.js";import{F as w}from"./index-fc073ec7.js";import{_ as $}from"./index.vue_vue_type_script_setup_true_lang-1170722e.js";import{d as S}from"./dayjs-4460abc8.js";import{d as U,b as u,k as N,ar as T,w as V,o as n,c as a,$ as c,bj as B,aX as i,P as p,a as l,u as M}from"./@vue-cb50a1c4.js";import{s as Y}from"./function-call-079e4448.js";import"./@intlify-1c0af683.js";import"./vue-router-7f882520.js";import"./open-im-sdk-wasm-f19f04ec.js";import"./pinia-de4079f2.js";import"./axios-7d5a0a64.js";import"./form-data-497f8b5e.js";import"./@amap-aca98dec.js";import"./uuid-a960c1f4.js";import"./date-fns-f56f60e6.js";import"./@babel-7fd5df1e.js";import"./mitt-f7ef348c.js";import"./@vueuse-19adab01.js";import"./livekit-client-ca552de3.js";import"./@livekit-3058dbe8.js";import"./loglevel-e40a507a.js";import"./rxjs-2154ddb2.js";import"./tslib-8dbab242.js";import"./@vuemap-5ebdc63e.js";import"./lodash-es-91418b19.js";import"./use-id-22cfdfcf.js";import"./index-597402db.js";import"./arrows_left-f963ef62.js";import"./index-e4a7d928.js";const A={class:"page_container"},E={class:"mx-[10px] mt-[10px] mb-[30px] flex flex-1 flex-col overflow-hidden rounded-md bg-white px-[22px] py-3"},F={key:0,class:"flex flex-row"},j={class:"ml-4 flex flex-col"},z={class:"text-xs text-[#999]"},H={class:"relative flex-1"},L={key:0,class:"absolute bottom-6 left-1/2 -translate-x-1/2 text-xs text-[#999]"},P=U({__name:"index",props:{isNomal:{type:Boolean}},setup(f){const{t:d}=k(),t=D(),r=u(),m=u(t.storeCurrentGroupInfo.notification),o=u(!1),v=u(!1),h=N(()=>t.storeCurrentGroupInfo.notificationUpdateTime?S(t.storeCurrentGroupInfo.notificationUpdateTime).format("YYYY-M-D HH:mm"):""),C=()=>{Y({title:"",message:"该公告会通知全部群成员是否发布?"}).then(()=>{v.value=!0,I.setGroupInfo({groupID:t.storeCurrentGroupInfo.groupID,notification:m.value}).then(()=>g({message:d("messageTip.changeSuccess"),duration:200,onClose:()=>o.value=!1})).catch(e=>g({message:d("messageTip.changeFailed"),error:e})).finally(()=>v.value=!1)}).catch(()=>{})},_=e=>{I.getSpecifiedGroupMembersInfo({groupID:t.storeCurrentGroupInfo.groupID,userIDList:[e]}).then(({data:s})=>{r.value=s[0]})};return T(()=>{t.storeCurrentGroupInfo.notificationUserID&&_(t.storeCurrentGroupInfo.notificationUserID)}),V(()=>t.storeCurrentGroupInfo.notificationUserID,e=>{_(e)}),(e,s)=>{const y=w;return n(),a("div",A,[c($,{title:e.$t("popover.groupAnnouncement")},{default:B(()=>[!o.value&&!f.isNomal?(n(),a("span",{key:0,onClick:s[0]||(s[0]=x=>o.value=!0)},i(e.$t("buttons.edit")),1)):p("",!0),o.value?(n(),a("span",{key:1,onClick:C},i(e.$t("buttons.release")),1)):p("",!0)]),_:1},8,["title"]),l("div",E,[!o.value&&r.value?(n(),a("div",F,[c(b,{src:r.value.faceURL,desc:r.value.nickname,size:42},null,8,["src","desc"]),l("div",j,[l("div",null,i(r.value.nickname),1),l("div",z,i(M(h)),1)])])):p("",!0),l("div",H,[c(y,{class:"!px-0",modelValue:m.value,"onUpdate:modelValue":s[1]||(s[1]=x=>m.value=x),autosize:"",type:"textarea",readonly:!o.value,placeholder:""},null,8,["modelValue","readonly"]),!o.value&&f.isNomal?(n(),a("div",L,i(e.$t("ownerAndAdminCanEdit")),1)):p("",!0)])])])}}});const Ce=G(P,[["__scopeId","data-v-76e7844f"]]);export{Ce as default};
