"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const n=require("../../../../../common/assets.js"),o=require("../../../../constant.js"),r=require("../../../../utils/env.js"),i=require("../../utils/utils.js"),u=require("../../emoji-config/index.js"),l=require("../../config.js");Math||t();const t=()=>"../../../common/Icon.js",s=e.defineComponent({__name:"emoji-picker-dialog",emits:["insertEmoji","onClose","sendMessage"],setup(t,{emit:s}){var a;const v="dark"===l.ChatConfig.getTheme()?n.faceIconDark:n.faceIconLight,f=s,d=e.ref(0),c=e.ref();e.ref();const I=e.ref(),p=l.ChatConfig.getFeatureConfig(),E=e.ref(u.EMOJI_GROUP_LIST.filter((e=>e.type===o.EMOJI_TYPE.BASIC?p.InputEmoji:e.type===o.EMOJI_TYPE.BIG||e.type===o.EMOJI_TYPE.CUSTOM?p.InputStickers:void 0))),m=e.ref(null==E?void 0:E.value[0]),_=e.ref(null==(a=null==E?void 0:E.value[0])?void 0:a.list);e.onMounted((()=>{e.Jt.watch(e.o.CONV,{currentConversation:P})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.CONV,{currentConversation:P})}));const C=(n,o)=>{var r,u,l,t,s;const a={to:(null==(u=null==(r=null==c?void 0:c.value)?void 0:r.groupProfile)?void 0:u.groupID)||(null==(t=null==(l=null==c?void 0:c.value)?void 0:l.userProfile)?void 0:t.userID),conversationType:null==(s=null==c?void 0:c.value)?void 0:s.type,payload:{index:o.emojiGroupID,data:o.list[n]},needReadReceipt:i.isEnabledMessageReadReceiptGlobal()};e.Qt.sendFaceMessage(a)};function M(){e.index.$emit("send-message-in-emoji-picker")}function P(e){c.value=e}return(n,i)=>e.e({a:e.f(e.unref(_),((n,i,l)=>e.e(e.unref(m).type===e.unref(o.EMOJI_TYPE).BASIC?{a:e.unref(m).url+e.unref(u.BASIC_EMOJI_URL_MAPPING)[n]}:e.unref(m).type===e.unref(o.EMOJI_TYPE).BIG?{b:e.unref(m).url+n+"@2x.png"}:{c:e.unref(m).url+n},{d:i,e:e.o$1((l=>((n,i)=>{var l,t,s;const a={emoji:{key:n,name:u.convertKeyToEmojiName(n)},type:null==(l=null==m?void 0:m.value)?void 0:l.type};switch(null==(t=null==m?void 0:m.value)?void 0:t.type){case o.EMOJI_TYPE.BASIC:a.url=(null==(s=null==m?void 0:m.value)?void 0:s.url)+u.BASIC_EMOJI_URL_MAPPING[n],r.isUniFrameWork?e.index.$emit("insert-emoji",a):f("insertEmoji",a);break;case o.EMOJI_TYPE.BIG:case o.EMOJI_TYPE.CUSTOM:C(i,m.value)}r.isPC&&f("onClose")})(n,i)),i)}))),b:e.unref(m).type===e.unref(o.EMOJI_TYPE).BASIC,c:e.unref(m).type===e.unref(o.EMOJI_TYPE).BIG,d:e.n(!e.unref(r.isPC)&&"emoji-picker-h5-list"),e:e.f(e.unref(E),((n,i,u)=>e.e({a:n.type===e.unref(o.EMOJI_TYPE).BASIC},n.type===e.unref(o.EMOJI_TYPE).BASIC?{b:"023770ee-0-"+u,c:e.p({file:e.unref(v)})}:n.type===e.unref(o.EMOJI_TYPE).BIG?{e:n.url+n.list[0]+"@2x.png"}:{f:n.url+n.list[0]},{d:n.type===e.unref(o.EMOJI_TYPE).BIG,g:i,h:e.o$1((e=>(e=>{var n;d.value=e,m.value=null==E?void 0:E.value[e],_.value=null==(n=null==E?void 0:E.value[e])?void 0:n.list,r.isUniFrameWork||(null==I?void 0:I.value)&&(I.value.scrollTop=0)})(i)),i)}))),f:e.unref(r.isUniFrameWork)},e.unref(r.isUniFrameWork)?{g:e.o$1(M)}:{},{h:e.unref(r.isPC)?"":1})}}),a=e._export_sfc(s,[["__scopeId","data-v-023770ee"]]);wx.createComponent(a);
