"use strict";const e=require("../../../../../../common/vendor.js");require("../../../../../adapter-vue.js");const t=require("../../../config.js"),n=e.defineComponent({__name:"index",props:{message:{default:()=>({})}},emits:["openReadUserPanel"],setup(n,{emit:a}){const s=a,o=n,r=t.ChatConfig.getFeatureConfig("ReadStatus"),u=e.qt.TYPES,c=e.ref(e.Jt.getData(e.o.USER,"displayMessageReadReceipt"));e.onMounted((()=>{e.Jt.watch(e.o.USER,{displayMessageReadReceipt:g})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.USER,{displayMessageReadReceipt:g})}));const i=e.computed((()=>{if(!r)return!1;if(!c.value)return!1;const{ID:t,type:n,flow:a,status:s,hasRiskContent:i,conversationID:d,conversationType:p,needReadReceipt:R=!1}=o.message;if(i)return!1;const{groupProfile:l}=e.Jt.getConversationModel(d)||{};if((null==l?void 0:l.type)===u.GRP_AVCHATROOM||(null==l?void 0:l.type)===u.GRP_COMMUNITY)return!1;if(n===u.MSG_CUSTOM){const n=e.Jt.getMessageModel(t);if(null!==(null==n?void 0:n.getSignalingInfo()))return!1}return"out"===a&&"success"===s&&("GROUP"===p?R:"C2C"===p)})),d=e.computed((()=>{const{conversationType:e,needReadReceipt:t=!1,isPeerRead:n=!1}=o.message,{readCount:a=0,unreadCount:s=0,isPeerRead:r=!1}=o.message.readReceiptInfo;return"C2C"===e?t?r?0:1:n?0:1:"GROUP"===e?t?0===a?1:0===s?2:4:3:1})),p=e.computed((()=>{const{readCount:t=0}=o.message.readReceiptInfo;switch(d.value){case 0:return e.Wt.t("TUIChat.已读");case 1:return e.Wt.t("TUIChat.未读");case 2:return e.Wt.t("TUIChat.全部已读");case 4:return`${t}${e.Wt.t("TUIChat.人已读")}`;default:return""}})),R=e.computed((()=>{const{conversationType:e}=o.message;return"C2C"===e?0!==d.value:"GROUP"===e&&2!==d.value})),l=e.computed((()=>o.message.needReadReceipt&&"GROUP"===o.message.conversationType&&(4===d.value||1===d.value)));function f(){l.value&&s("openReadUserPanel")}function g(e){c.value=e}return(t,n)=>({a:e.t(e.unref(p)),b:e.unref(i),c:e.unref(R)?1:"",d:e.unref(l)?1:"",e:e.o$1(f)})}}),a=e._export_sfc(n,[["__scopeId","data-v-3007312d"]]);wx.createComponent(a);
