"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const n=require("../../../../../common/assets.js"),s=require("../../utils/utils.js"),t=require("../../../../utils/env.js");Math||(f+l+u+o+r+i+a)();const u=()=>"../../../common/Icon.js",o=()=>"./read-status/index.js",a=()=>"./message-quote/index.js",l=()=>"../../../common/Avatar/index.js",r=()=>"./message-translate/index.js",i=()=>"./message-convert/index.js",f=()=>"../../../common/RadioSelect/index.js",c=e.defineComponent({__name:"message-bubble",props:{messageItem:{default:()=>({})},content:{default:()=>({})},classNameList:{default:()=>[]},blinkMessageIDList:{default:()=>[]},isMultipleSelectMode:{type:Boolean,default:!1},isAudioPlayed:{type:Boolean,default:!1},multipleSelectedMessageIDList:{default:()=>[]}},emits:["resendMessage","blinkMessage","setReadReceiptPanelVisible","changeSelectMessageIDList","scrollTo"],setup(u,{emit:o}){const a=o,l=u,r=e.qt.TYPES,i=[r.MSG_LOCATION,r.MSG_TEXT,r.MSG_CUSTOM,r.MSG_MERGER,r.MSG_FACE],{blinkMessageIDList:f,messageItem:c}=e.toRefs(l),d=e.computed((()=>l.multipleSelectedMessageIDList.includes(c.value.ID))),p=e.computed((()=>"in"===c.value.flow&&"success"===c.value.status&&c.value.type===r.MSG_AUDIO&&!l.isAudioPlayed)),m=e.computed((()=>["message-bubble",d.value?"multiple-selected":"",...l.classNameList])),M=e.computed((()=>[r.MSG_IMAGE,r.MSG_VIDEO,r.MSG_MERGER].includes(c.value.type))),v=e.computed((()=>{let n=e.Wt.t("TUIChat.涉及敏感内容")+", ";return"out"===c.value.flow?n+=e.Wt.t("TUIChat.发送失败"):n+=e.Wt.t(c.value.type===r.MSG_AUDIO?"TUIChat.无法收听":"TUIChat.无法查看"),n})),g=e.computed((()=>{var e,n;return!!(null==(e=c.value)?void 0:e.ID)&&(null==(n=null==f?void 0:f.value)?void 0:n.includes(c.value.ID))}));function I(e){a("changeSelectMessageIDList",{type:e?"add":"remove",messageID:c.value.ID})}function S(e){a("blinkMessage",e)}function h(e){a("scrollTo",e)}function G(){a("setReadReceiptPanelVisible",!0,c.value)}return(u,o)=>e.e({a:l.isMultipleSelectMode},l.isMultipleSelectMode?{b:e.o$1(I),c:e.p({isSelected:e.unref(d)})}:{},{d:e.p({useSkeletonAnimation:!0,url:e.unref(c).avatar||""}),e:"in"===e.unref(c).flow&&"GROUP"===e.unref(c).conversationType},"in"===e.unref(c).flow&&"GROUP"===e.unref(c).conversationType?{f:e.t(l.content.showName)}:{},{g:(e.unref(c).type===e.unref(r).MSG_IMAGE||e.unref(c).type===e.unref(r).MSG_VIDEO)&&e.unref(c).hasRiskContent},e.unref(c).type!==e.unref(r).MSG_IMAGE&&e.unref(c).type!==e.unref(r).MSG_VIDEO||!e.unref(c).hasRiskContent?{}:{h:e.n(!e.unref(t.isPC)&&"message-risk-replace-h5"),i:"https://web.sdk.qcloud.com/component/TUIKit/assets/has_risk_default.png"},{j:e.unref(c).hasRiskContent},e.unref(c).hasRiskContent?{k:e.t(e.unref(v))}:{},{l:e.n("out"===e.unref(c).flow?"content-out":"content-in"),m:e.n(e.unref(c).hasRiskContent&&"content-has-risk"),n:e.n(e.unref(M)?"content-no-padding":""),o:e.n(e.unref(M)&&e.unref(g)?"blink-shadow":""),p:e.n(!e.unref(M)&&e.unref(g)?"blink-content":""),q:e.unref(p)},(e.unref(p),{}),{r:"fail"===e.unref(c).status||e.unref(c).hasRiskContent},"fail"===e.unref(c).status||e.unref(c).hasRiskContent?{s:e.o$1((e=>{var n;(null==(n=c.value)?void 0:n.hasRiskContent)||a("resendMessage")}))}:{},{t:"unSend"===e.unref(c).status&&i.includes(e.unref(c).type)},"unSend"===e.unref(c).status&&i.includes(e.unref(c).type)?{v:e.p({file:e.unref(n.loadingIcon),width:"15px",height:"15px"})}:{},{w:e.o$1(G),x:e.p({message:e.unref(s.shallowCopyMessage)(e.unref(c))}),y:e.n("out"===e.unref(c).flow&&"message-body-main-reverse"),z:e.o$1((()=>{})),A:e.n("in"===e.unref(c).flow?"":"reverse"),B:e.n("out"===e.unref(c).flow?"reverse":"flex-row"),C:e.p({message:e.unref(c)}),D:e.n("out"===e.unref(c).flow?"reverse":"flex-row"),E:e.p({message:e.unref(c)}),F:e.n("out"===e.unref(c).flow?"reverse":"flex-row"),G:e.o$1(S),H:e.o$1(h),I:e.p({message:e.unref(c)}),J:"out"===e.unref(c).flow?1:"",K:e.n(e.unref(m))})}}),d=e._export_sfc(c,[["__scopeId","data-v-0db740be"]]);wx.createComponent(d);
