/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@tencentcloud/chat-uikit-wechat@2.4.4/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import constant from"./utils/constant";import TUICore,{TUIConstants}from"@tencentcloud/tui-core";const app=getApp();Component({properties:{conversationID:{type:String,value:"",observer(t){this.setData({outsideConversation:!0,currentConversationID:t})}}},data:{isShowConversation:!1,isShowConversationList:!1,currentConversationID:"",unreadCount:0,hasCallKit:!1,config:{userID:"",userSig:"",type:1,tim:null,SDKAppID:0},outsideConversation:!1},methods:{init(){const{config:t}=this.data;t.userID=wx.$chat_userID,t.userSig=wx.$chat_userSig,t.tim=wx.$TUIKit,t.SDKAppID=wx.$chat_SDKAppID,this.data.outsideConversation?this.createConversation({detail:{currentConversationID:this.data.currentConversationID,unreadCount:0}}):this.showConversationList(),this.setData({config:t},(()=>{this.initCallKit()}))},initCallKit(){TUICore.getService(TUIConstants.TUICalling.SERVICE.NAME)&&this.setData({hasCallKit:!0})},createConversation(t){this.setData({isShowConversation:!0,currentConversationID:t.detail.currentConversationID,unreadCount:t.detail.unreadCount},(()=>{this.selectComponent("#TUIChat").init();const t=setTimeout((()=>{this.selectComponent("#TUIConversation").destroy(),clearTimeout(t)}),300)}))},showConversationList(){if(this.data.outsideConversation)this.handleBack();else{this.selectComponent("#TUIConversation").init(),this.setData({isShowConversation:!1})}},async handleCall(t){let{userIDList:e=[]}=t.detail;const{groupID:n="",userID:s="",type:a}=t.detail;s&&(e=[s]),TUICore.callService({serviceName:TUIConstants.TUICalling.SERVICE.NAME,method:TUIConstants.TUICalling.SERVICE.METHOD.START_CALL,params:{groupID:n,userIDList:e,type:a}})},handleBack(){app.globalData&&app.globalData.reportType!==constant.OPERATING_ENVIRONMENT?wx.navigateBack({delta:1}):wx.switchTab({url:"/pages/TUI-Index/index"})},sendMessage(t){this.selectComponent("#TUIChat").sendMessage(t)}}});
//# sourceMappingURL=/sm/7e3d313975870f435b2183fd26d0305cd2ee83f10406e38d2536da0583ded413.map