{ "version": 3, "sources": ["../../../../../node_modules/@tencentcloud/chat/index.js"], "sourcesContent": ["\"use strict\";!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).TencentCloudChat=t()}(this,function(){function o(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function y(t){for(var e=1;ee.length)&&(t=e.length);for(var n=0,o=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t};throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var i,a=!0,s=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(s)throw i}}}}var G={SDK_READY:\"sdkStateReady\",SDK_NOT_READY:\"sdkStateNotReady\",SDK_DESTROY:\"sdkDestroy\",MESSAGE_RECEIVED:\"onMessageReceived\",ROOM_CUSTOM_DATA_RECEIVED:\"onRoomCustomDataReceived\",MESSAGE_MODIFIED:\"onMessageModified\",MESSAGE_REVOKED:\"onMessageRevoked\",MESSAGE_READ_BY_PEER:\"onMessageReadByPeer\",MESSAGE_READ_RECEIPT_RECEIVED:\"onMessageReadReceiptReceived\",MESSAGE_EXTENSIONS_UPDATED:\"onMessageExtensionsUpdated\",MESSAGE_EXTENSIONS_DELETED:\"onMessageExtensionsDeleted\",MESSAGE_REACTIONS_UPDATED:\"onMessageReactionsUpdated\",CONVERSATION_LIST_UPDATED:\"onConversationListUpdated\",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:\"onTotalUnreadMessageCountUpdated\",CONVERSATION_GROUP_LIST_UPDATED:\"onConversationGroupListUpdated\",CONVERSATION_IN_GROUP_UPDATED:\"onConversationInGroupUpdated\",GROUP_LIST_UPDATED:\"onGroupListUpdated\",GROUP_ATTRIBUTES_UPDATED:\"groupAttributesUpdated\",GROUP_COUNTER_UPDATED:\"onGroupCounterUpdated\",TOPIC_CREATED:\"onTopicCreated\",TOPIC_DELETED:\"onTopicDeleted\",TOPIC_UPDATED:\"onTopicUpdated\",PROFILE_UPDATED:\"onProfileUpdated\",USER_STATUS_UPDATED:\"onUserStatusUpdated\",BLACKLIST_UPDATED:\"blacklistUpdated\",FRIEND_LIST_UPDATED:\"onFriendListUpdated\",FRIEND_GROUP_LIST_UPDATED:\"onFriendGroupListUpdated\",FRIEND_APPLICATION_LIST_UPDATED:\"onFriendApplicationListUpdated\",MY_FOLLOWERS_LIST_UPDATED:\"onMyFollowersListUpdated\",MY_FOLLOWING_LIST_UPDATED:\"onMyFollowingListUpdated\",MUTUAL_FOLLOWERS_LIST_UPDATED:\"onMutualFollowersListUpdated\",KICKED_OUT:\"kickedOut\",ERROR:\"error\",NET_STATE_CHANGE:\"netStateChange\",ALL_RECEIVE_MESSAGE_OPT_UPDATED:\"onAllReceiveMessageOptUpdated\"},R={MSG_TEXT:\"TIMTextElem\",MSG_IMAGE:\"TIMImageElem\",MSG_SOUND:\"TIMSoundElem\",MSG_AUDIO:\"TIMSoundElem\",MSG_FILE:\"TIMFileElem\",MSG_FACE:\"TIMFaceElem\",MSG_VIDEO:\"TIMVideoFileElem\",MSG_GEO:\"TIMLocationElem\",MSG_LOCATION:\"TIMLocationElem\",MSG_GRP_TIP:\"TIMGroupTipElem\",MSG_GRP_SYS_NOTICE:\"TIMGroupSystemNoticeElem\",MSG_CUSTOM:\"TIMCustomElem\",MSG_MERGER:\"TIMRelayElem\",MSG_PRIORITY_HIGH:\"High\",MSG_PRIORITY_NORMAL:\"Normal\",MSG_PRIORITY_LOW:\"Low\",MSG_PRIORITY_LOWEST:\"Lowest\",CONV_C2C:\"C2C\",CONV_GROUP:\"GROUP\",CONV_TOPIC:\"TOPIC\",CONV_SYSTEM:\"@TIM#SYSTEM\",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:\"Private\",GRP_WORK:\"Private\",GRP_PUBLIC:\"Public\",GRP_CHATROOM:\"ChatRoom\",GRP_MEETING:\"ChatRoom\",GRP_AVCHATROOM:\"AVChatRoom\",GRP_COMMUNITY:\"Community\",GRP_ROOM:\"Room\",GRP_LIVE:\"Live\",GRP_MBR_ROLE_OWNER:\"Owner\",GRP_MBR_ROLE_ADMIN:\"Admin\",GRP_MBR_ROLE_MEMBER:\"Member\",GRP_MBR_ROLE_CUSTOM:\"Custom\",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:\"AcceptAndNotify\",MSG_REMIND_ACPT_NOT_NOTE:\"AcceptNotNotify\",MSG_REMIND_DISCARD:\"Discard\",RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT:\"AcceptNotNotifyExceptAt\",NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT:\"AcceptNotNotifyExceptAt\",NOT_RECEIVE_MSG_EXCEPT_AT:\"NotReceiveMsgExceptAt\",GENDER_UNKNOWN:\"Gender_Type_Unknown\",GENDER_FEMALE:\"Gender_Type_Female\",GENDER_MALE:\"Gender_Type_Male\",KICKED_OUT_MULT_ACCOUNT:\"multipleAccount\",KICKED_OUT_MULT_DEVICE:\"multipleDevice\",KICKED_OUT_USERSIG_EXPIRED:\"userSigExpired\",KICKED_OUT_REST_API:\"REST_API_Kick\",ALLOW_TYPE_ALLOW_ANY:\"AllowType_Type_AllowAny\",ALLOW_TYPE_NEED_CONFIRM:\"AllowType_Type_NeedConfirm\",ALLOW_TYPE_DENY_ANY:\"AllowType_Type_DenyAny\",FORBID_TYPE_NONE:\"AdminForbid_Type_None\",FORBID_TYPE_SEND_OUT:\"AdminForbid_Type_SendOut\",JOIN_OPTIONS_FREE_ACCESS:\"FreeAccess\",JOIN_OPTIONS_NEED_PERMISSION:\"NeedPermission\",JOIN_OPTIONS_DISABLE_APPLY:\"DisableApply\",JOIN_STATUS_SUCCESS:\"JoinedSuccess\",JOIN_STATUS_ALREADY_IN_GROUP:\"AlreadyInGroup\",JOIN_STATUS_WAIT_APPROVAL:\"WaitAdminApproval\",INVITE_OPTIONS_DISABLE_INVITE:\"DisableInvite\",INVITE_OPTIONS_NEED_PERMISSION:\"NeedPermission\",INVITE_OPTIONS_FREE_ACCESS:\"FreeAccess\",GRP_PROFILE_OWNER_ID:\"ownerID\",GRP_PROFILE_CREATE_TIME:\"createTime\",GRP_PROFILE_LAST_INFO_TIME:\"lastInfoTime\",GRP_PROFILE_MEMBER_NUM:\"memberNum\",GRP_PROFILE_MAX_MEMBER_NUM:\"maxMemberNum\",GRP_PROFILE_JOIN_OPTION:\"joinOption\",GRP_PROFILE_INVITE_OPTION:\"inviteOption\",GRP_PROFILE_INTRODUCTION:\"introduction\",GRP_PROFILE_NOTIFICATION:\"notification\",GRP_PROFILE_MUTE_ALL_MBRS:\"muteAllMembers\",SNS_ADD_TYPE_SINGLE:\"Add_Type_Single\",SNS_ADD_TYPE_BOTH:\"Add_Type_Both\",SNS_DELETE_TYPE_SINGLE:\"Delete_Type_Single\",SNS_DELETE_TYPE_BOTH:\"Delete_Type_Both\",SNS_APPLICATION_TYPE_BOTH:\"Pendency_Type_Both\",SNS_APPLICATION_SENT_TO_ME:\"Pendency_Type_ComeIn\",SNS_APPLICATION_SENT_BY_ME:\"Pendency_Type_SendOut\",SNS_APPLICATION_AGREE:\"Response_Action_Agree\",SNS_APPLICATION_AGREE_AND_ADD:\"Response_Action_AgreeAndAdd\",SNS_CHECK_TYPE_BOTH:\"CheckResult_Type_Both\",SNS_CHECK_TYPE_SINGLE:\"CheckResult_Type_Single\",SNS_TYPE_NO_RELATION:\"CheckResult_Type_NoRelation\",SNS_TYPE_A_WITH_B:\"CheckResult_Type_AWithB\",SNS_TYPE_B_WITH_A:\"CheckResult_Type_BWithA\",SNS_TYPE_BOTH_WAY:\"CheckResult_Type_BothWay\",NET_STATE_CONNECTED:\"connected\",NET_STATE_CONNECTING:\"connecting\",NET_STATE_DISCONNECTED:\"disconnected\",MSG_AT_ALL:\"__kImSDK_MesssageAtALL__\",READ_ALL_C2C_MSG:\"readAllC2CMessage\",READ_ALL_GROUP_MSG:\"readAllGroupMessage\",READ_ALL_MSG:\"readAllMessage\",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3,IOS_OFFLINE_PUSH_NO_SOUND:\"push.no_sound\",IOS_OFFLINE_PUSH_DEFAULT_SOUND:\"default\"},P={NEW_INVITATION_RECEIVED:\"newInvitationReceived\",INVITEE_ACCEPTED:\"ts_invitee_accepted\",INVITEE_REJECTED:\"ts_invitee_rejected\",INVITATION_CANCELLED:\"ts_invitation_cancelled\",INVITATION_TIMEOUT:\"ts_invitation_timeout\",INVITATION_MODIFIED:\"ts_invitation_modified\",ACTION_TYPE_UNKNOWN:0,ACTION_TYPE_INVITE:1,ACTION_TYPE_CANCEL_INVITE:2,ACTION_TYPE_ACCEPT_INVITE:3,ACTION_TYPE_REJECT_INVITE:4,ACTION_TYPE_INVITE_TIMEOUT:5},U=(e(j,[{key:\"use\",value:function(e){if(\"function\"!=typeof e)throw\"middleware must be a function\";return this.cache.push(e),this}},{key:\"next\",value:function(e){if(this.middlewares&&0o&&(s({api:t,paramName:n,desc:xn(\"MaximumArrayLengthLog\",n,o)}),1)):(s({api:t,paramName:n,desc:un()}),!1)}function Ln(e,t,n,o){var i=o.allowUndefined,a=o.min,o=o.max;return A(e)?!!i||(s({api:t,paramName:n,desc:sn()}),!1):Qe(e)?Qe(a)&&e=Math.pow(2,64)&&(s({api:t,paramName:n,desc:xn(\"NumberLessThanLog\",n,\"Math.pow(2,64)\")}),1)):(s({api:t,paramName:n,desc:an()}),!1)}},enableMark:y({},wn)},createConversationGroup:{conversationIDList:y({},se),groupName:y(y({},oe),{},{validator:function(e,t,n){return!(!e||32=this.TOPIC_MSG_LIMIT&&this._convM.clearMemMsg(i,!0)}}catch(e){n.e(e)}finally{n.f()}}}},{key:\"pushIn\",value:function(e){var t=1>(-2*a&6))))i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(i);try{return decodeURIComponent(escape(n))}catch(e){return\"\"}}var ei,ti,ni,oi,ii,ai=[\"jpg\",\"jpeg\",\"gif\",\"png\",\"bmp\",\"image\",\"webp\"],si=[\"mp4\",\"quicktime\",\"mov\"],ri=(e(la,[{key:\"validate\",value:function(e){var t,n=!0,o=\"\";if(Je(e))return{valid:!1,tips:\"empty options\"};if(e.profileCustomField)for(var i=e.profileCustomField.length,a=null,s=0;s=this.MAX_LENGTH&&(t=this.map.entries().next().value[0],this.map.delete(t)),this.map.set(e,1)}},{key:\"has\",value:function(e){return this.map.has(e)}},{key:\"delete\",value:function(e){this.has(e)&&this.map.delete(e)}},{key:\"reset\",value:function(){this.map.clear()}}]),ua),ui=[\"groupID\",\"name\",\"avatar\",\"type\",\"introduction\",\"notification\",\"ownerID\",\"selfInfo\",\"createTime\",\"infoSequence\",\"lastInfoTime\",\"lastMessage\",\"nextMessageSeq\",\"memberNum\",\"maxMemberNum\",\"memberList\",\"joinOption\",\"groupCustomField\",\"muteAllMembers\",\"isSupportTopic\",\"inviteOption\",\"_lastRevokedTime\"],li=(e(ca,[{key:\"memberNum\",get:function(){return this.memberCount},set:function(e){}},{key:\"maxMemberNum\",get:function(){return this.maxMemberCount},set:function(e){}},{key:\"_initGroup\",value:function(e){for(var t in e)ui.indexOf(t)<0||(\"selfInfo\"!==t?(\"memberNum\"===t&&(this.memberCount=e[t]),\"maxMemberNum\"===t&&(this.maxMemberCount=e[t]),\"isSupportTopic\"!==t?this[t]=e[t]:this.isSupportTopic=1===e[t]):this.updateSelfInfo(e[t]))}},{key:\"updateGroup\",value:function(e){var t=this,e=(e.appid=void 0,e.grossTopicNextMsgSeq=void 0,e.selfInfo&&(e.selfInfo.grossTopicReadSeq=void 0),JSON.parse(JSON.stringify(e)));e.lastMsgTime&&(this.lastMessage.lastTime=e.lastMsgTime),A(e.muteAllMembers)||(\"On\"===e.muteAllMembers?e.muteAllMembers=!0:e.muteAllMembers=!1),e.groupCustomField&&Tt(this.groupCustomField,e.groupCustomField),A(e.memberNum)||(this.memberCount=e.memberNum),A(e.maxMemberNum)||(this.maxMemberCount=e.maxMemberNum),A(e.isSupportTopic)||(this.isSupportTopic=Qe(e.isSupportTopic)?1===e.isSupportTopic:e.isSupportTopic),rt(this,e,[\"members\",\"errorCode\",\"lastMsgTime\",\"groupCustomField\",\"memberNum\",\"maxMemberNum\",\"isSupportTopic\"]),nt(e.members)&&0e?(c.messageList=i.slice(r-e,r),c.nextReqMessageID=s?i[r-e].ID:i[r-e].sequence+\"\"):(c.messageList=i.slice(0,r),c.isCompleted=!0):eo||n&&a.sequence>n)){if(\"in\"===a.flow&&a.isRead)break;a.setIsRead(!0)}}},{key:\"updateUnreadCount\",value:function(e){var t,n=!(1c&&e.sequence<=r:e.sequence>c&&e.sequencec&&i.length<60?u._recursiveGetMsgList(i,a,s,r,c,e):u._emitMsgReceived(a,i)})}},{key:\"_emitMsgReceived\",value:function(e,t){var n,o,i=this;0=i.MAX_CHECK_COUNT?(i._deleteCachedGroupTips(t),i._checkCountMap.delete(t)):i._checkCountMap.set(t,++n)})}},{key:\"onNewGroupTips\",value:function(e){v.l(\"\".concat(this._n,\".onNewGroupTips options:\").concat(JSON.stringify(e.dataList)));var e=this._assembly(e),t=e.eventDataList,n=e.result,e=e.AVChatRoomMessageList;0=i.MAX_CHECK_COUNT?(i._deleteCachedGroupMessage(t),i._checkCountMap.delete(t)):i._checkCountMap.set(t,++n)})}},{key:\"updateLastMsg\",value:function(e){var t=\"\".concat(this._n,\".updateLastMsg\");if(0!==this._grpM.getGroupMap().size){for(var n,o,i,a,s=!1,r=e.length,c=0;c=this.CACHE_EXPIRE_TIME||r=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:o,avChatRoomKey:a}).then(function(e){s.setMoreMessage(\"from remote. count:\".concat(e.length)).end(),v.l(\"\".concat(n,\" from remote. groupID:\").concat(o));e=t._getLocalCounters(o,i);return Sn({counters:e})}).catch(function(e){return s.setError(e).end(),C(e)});s.setMoreMessage(\"from cache\").end(),v.l(\"\".concat(n,\" from cache. groupID:\").concat(o));e=this._getLocalCounters(o,i);return kn({counters:e})}},{key:\"_getRemoteGroupCounters\",value:function(n){var o=this;return this._grpM.req({P:I.GET_GRP_COUNTER,data:y({},n)}).then(function(e){var e=e.data,t=e.counterList,t=void 0===t?[]:t,e=e.groupCounterSeq;return o._updateLocalGroupCounters({groupID:n.groupID,counterList:t,groupCounterSeq:e}),v.l(\"\".concat(o._n,\"._getRemoteGroupCounters ok. groupID:\").concat(n.groupID)),t}).catch(function(e){return C(e)})}},{key:\"_convertObjectToList\",value:function(t){var n=[];return Object.keys(t).forEach(function(e){n.push({key:e,value:t[e]})}),n}},{key:\"_updateGroupCounters\",value:function(e){var t=\"\".concat(this._n,\"._updateGroupCounters\"),n=e.groupID,o=e.avChatRoomKey,i=e.mode;return v.l(\"\".concat(t,\". groupID:\").concat(n,\" avChatRoomKey:\").concat(o,\" mode:\").concat(i)),this._grpM.req({P:I.UPDATE_GRP_COUNTER,data:y({},e)}).then(function(e){v.l(\"\".concat(t,\" ok.\"));var e=e.data.counterList,n={};return(void 0===e?[]:e).forEach(function(e){var t=e.key,e=e.value;n[t]=e}),n}).catch(function(e){return C(e)})}},{key:\"_hasLocalGroupCounters\",value:function(e){return this._groupCountersMap.has(e)}},{key:\"_getLocalGroupCounters\",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:\"_updateLocalGroupCounters\",value:function(e){var n,t,o,i=e.groupID,a=e.counterList,a=void 0===a?[]:a,e=e.groupCounterSeq;this._hasLocalGroupCounters(i)&&(o=this._getLocalGroupCounters(i),n=o.counters,t=o.avChatRoomKey,o=o.groupCounterSeq,0this._startBroadcastSeq&&(this._startBroadcastSeq=c),nt(s)&&01e3*t.expireTime&&1e4=i&&t.messageList.push(e)}),(kt({groupID:n})||Rt(n))&&0===t.messageList.length&&a[0].sequencei.nextMessageSeq&&(i.updateNextMessageSeq(n),i.updateLastMessage(e),i.updateSelfInfo({readedSequence:t}),i.updateUnreadCount(0),this.emitOEvt(G.TOPIC_UPDATED,{groupID:o,topic:i}))}},{key:\"onMessageModified\",value:function(e){var t,n=e.to,o=e.time,i=e.sequence,a=e.elements,s=e.cloudCustomData,r=e.messageVersion,c=Kt(n),u=this.getLocalTopic(c,n);u&&(t=u.lastMessage,v.d(\"\".concat(this._n,\".onMessageModified topicID:\").concat(n,\" lastMessage:\"),JSON.stringify(t),\"options:\",JSON.stringify(e)),t&&(null===t.payload||t.lastTime===o&&t.lastSequence===i&&t.version!==r)&&(t.type=a[0].type,t.payload=a[0].content,t.messageForShow=Yt(t.type,t.payload,this.isIntl()),t.cloudCustomData=s,t.version=r,t.lastSequence=i,t.lastTime=o,this.emitOEvt(G.TOPIC_UPDATED,{groupID:c,topic:u})))}},{key:\"onMessageRevoked\",value:function(e){var n,o,i,a=this;0!==e.length&&(o=n=null,i=!1,e.forEach(function(e){var t=e.to;o=Kt(t),(n=a.getLocalTopic(o,t))&&(n.reduceUnreadCount()&&(i=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(e.revoker),i=!0),(t=n.selfInfo.excludedUnreadSequenceList||[]).push(e.sequence),n.updateSelfInfo({excludedUnreadSequenceList:t}))}),i&&this.emitOEvt(G.TOPIC_UPDATED,{groupID:o,topic:n}))}},{key:\"isLastMessageRevoked\",value:function(e){var t=e.topicID,e=e.sequence,n=Kt(t),n=this.getLocalTopic(n,t),t=!1;return t=n?n.isLastMessageRevoked({sequence:e}):t}},{key:\"updateUnreadCountAndLastMsg\",value:function(e,t,n){var o,i=Kt(e),a=this.getLocalTopic(i,e);a&&(o=a.selfInfo.excludedUnreadSequenceList||[],A(n)||(o=n),t._isExcludedFromUnreadCount&&o.push(t.sequence),a.updateSelfInfo({excludedUnreadSequenceList:o}),v.l(\"\".concat(this._n,\".updateUnreadCountAndLastMsg seq:\").concat(t.sequence,\" lastSeq:\").concat(a.lastMessage.lastSequence)),t.sequence>a.lastMessage.lastSequence&&(a.updateLastMessage(t),n=t.sequence+1,a.updateNextMessageSeq(n),o=this._computeUnreadCount(a),a.updateUnreadCount(o),(t=this.get(11).getLocalConversation(\"\".concat(R.CONV_GROUP).concat(e)))&&t.updateUnreadCount({nextUnreadCount:o,isFromGetConversations:!0}),this.emitOEvt(G.TOPIC_UPDATED,{groupID:i,topic:a})))}},{key:\"getJoinedCommunityList\",value:function(){return this.get(7).syncCommunityWithTopic()}},{key:\"createTopicInCommunity\",value:function(t){var n=this,o=\"\".concat(this._n,\".\").concat(\"createTopicInCommunity\"),e=t.topicID;if(!A(e)&&!Rt(e))return C({code:T.ILLEGAL_TOPIC_ID});if(t.topicName&&!1===this._filterProfanity(\"topicName\",t))return C({code:T.PROFANITY_FOUND});if(t.introduction&&!1===this._filterProfanity(\"introduction\",t))return C({code:T.PROFANITY_FOUND});if(t.notification&&!1===this._filterProfanity(\"notification\",t))return C({code:T.PROFANITY_FOUND});var i=new M(\"createTopicInCommunity\");return this.req({P:I.CREATE_TOPIC,data:y({},t)}).then(function(e){e=e.data.topicID;return i.setMessage(\"topicID:\".concat(e)).end(),v.l(\"\".concat(o,\" ok. topicID:\").concat(e)),n._updateTopicMap([y(y({},t),{},{topicID:e})]),Sn({topicID:e})}).catch(function(e){return i.setError(e).end(),v.e(\"\".concat(o,\" failed. error:\"),e),C(e)})}},{key:\"deleteTopicFromCommunity\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteTopicFromCommunity\"),a=e.groupID,e=e.topicIDList,e=void 0===e?[]:e,s=new M(\"deleteTopicFromCommunity\");return s.setMessage(\"groupID:\".concat(a,\" topicIDList:\").concat(e)),this.req({P:I.DEL_TOPIC,data:{groupID:a,topicIDList:e}}).then(function(e){var e=e.data.resultList,o=[],i=[],e=((void 0===e?[]:e).forEach(function(e){var t=e.topicID,n=e.errorCode,e=e.errorInfo;0===n?o.push({topicID:t}):i.push({topicID:t,code:n,message:e})}),\"success count:\".concat(o.length,\", fail count:\").concat(i.length));return s.setMoreMessage(e).end(),v.l(\"\".concat(n,\" ok. \").concat(e)),o.forEach(function(e){t._deleteLocalTopic(a,e.topicID)}),Sn({successTopicList:o,failureTopicList:i})}).catch(function(e){return s.setError(e).end(),v.e(\"\".concat(n,\" failed. error:\"),e),C(e)})}},{key:\"updateTopicProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"updateTopicProfile\");if(v.l(\"\".concat(n,\" options:\"),e),e.topicName&&!1===this._filterProfanity(\"topicName\",e))return C({code:T.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return C({code:T.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return C({code:T.PROFANITY_FOUND});var o=new M(\"updateTopicProfile\");return o.setMessage(\"groupID:\".concat(e.groupID,\" topicID:\").concat(e.topicID)),A(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?\"On\":\"Off\"),this.req({P:I.UPDATE_TOPIC_PROFILE,data:y({},e)}).then(function(){return o.end(),v.l(\"\".concat(n,\" ok\")),t._updateTopicMap([e]),Sn({topic:t.getLocalTopic(e.groupID,e.topicID)})}).catch(function(e){return o.setError(e).end(),v.e(\"\".concat(n,\" failed. error:\"),e),C(e)})}},{key:\"getTopicList\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getTopicList\"),o=e.groupID,e=e.topicIDList,e=void 0===e?[]:e,i=0===e.length,c=new M(\"getTopicList\");if(c.setMessage(\"groupID:\".concat(o)),this._getTopicTimeMap.has(o)){var a=this._getTopicTimeMap.get(o),s=a.isGetAll,a=a.time;if((s||!s&&!i)&&Date.now()-a<1e3*this.TOPIC_CACHE_TIME){s=this._getLocalTopicList(o,e);if(i||s.length===e.length)return c.setMoreMessage(\"from cache, topic count:\".concat(s.length)).end(),v.l(\"\".concat(n,\" groupID:\").concat(o,\" from cache, topic count:\").concat(s.length)),kn({successTopicList:s,failureTopicList:[]})}}return this.req({P:I.GET_TOPIC_LIST,data:{groupID:o,topicIDList:e}}).then(function(e){var e=e.data.topicInfoList,a=[],s=[],r=[],e=((void 0===e?[]:e).forEach(function(e){var t=e.topic,n=e.selfInfo,o=e.errorCode,e=e.errorInfo,i=t.topicID;0===o?(a.push(y(y({},t),{},{selfInfo:n})),s.push(i)):r.push({topicID:i,code:o,message:e})}),t._updateTopicMap(a),t._handleTopicAtInfo(a),\"success count:\".concat(s.length,\", fail count:\").concat(r.length)),e=(c.setMoreMessage(e).end(),v.l(\"\".concat(n,\" groupID:\").concat(o,\" from remote, \").concat(e)),[]);return Je(s)||(t._getTopicTimeMap.set(o,{time:Date.now(),isGetAll:i}),e=t._getLocalTopicList(o,s)),Sn({successTopicList:e,failureTopicList:r})}).catch(function(e){return c.setError(e).end(),v.e(\"\".concat(n,\" failed. error:\"),e),C(e)})}},{key:\"hasLocalTopic\",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:\"getLocalTopic\",value:function(e,t){var n=null;return n=this._topicMap.has(e)?this._topicMap.get(e).get(t):n}},{key:\"_getLocalTopicList\",value:function(e){var t=1this.MAX_QUERY_USER_COUNT&&(v.w(\"\".concat(o,\" \").concat(zt(this.MAX_QUERY_USER_COUNT))),t=i.slice(0,this.MAX_QUERY_USER_COUNT));var s=new M(\"getUserStatus\");return this._userM.req({P:I.GET_USER_STATUS,data:{userIDList:t}}).then(function(e){var e=e.data,t=e.successUserList,t=void 0===t?[]:t,e=e.failureUserList,e=void 0===e?[]:e,t=t.map(function(e){var t=e.userID,n=e.statusType,e=e.customStatus;return{userID:t,statusType:n,customStatus:$o(e)}}),e=e.map(function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,e=e.errorInfo;return{userID:Je(n)?t:n,code:o,message:e}}),n=(A(a)||t.unshift(a),\"userID count:\".concat(i.length,\", success count:\").concat(t.length,\", fail count:\").concat(e.length));return s.setMessage(\"\".concat(n)).end(),v.l(\"\".concat(o,\" ok. \").concat(n,\".\")),Sn({successUserList:t,failureUserList:e})}).catch(function(e){return s.setMessage(\"userID count:\".concat(i.length)).setError(e).end(),v.e(\"\".concat(o,\" failed. error:\"),e),C(e)})}},{key:\"subscribeUserStatus\",value:function(e){var t=\"subscribeUserStatus\";if(!this._userM.canIUse(H.USER_STATUS))return this._userM.noUse(t);var n=\"\".concat(this._n,\".\").concat(t),e=e.userIDList,e=void 0===e?[]:e,o=D(e),i=(o.length>this.MAX_SUBSCRIBE_USER_COUNT&&(v.w(\"\".concat(n,\" \").concat(zt(this.MAX_SUBSCRIBE_USER_COUNT))),o=e.slice(0,this.MAX_SUBSCRIBE_USER_COUNT)),new M(t)),a=\"userID count:\".concat(e.length);return v.l(\"\".concat(n,\" \").concat(a)),this._userM.req({P:I.SUB_USER_STATUS,data:{userIDList:o}}).then(function(e){e=e.data.failureUserList,e=(void 0===e?[]:e).map(function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,e=e.errorInfo;return{userID:Je(n)?t:n,code:o,message:e}});return i.setMessage(\"\".concat(a,\" fail count:\").concat(e.length)).end(),v.l(\"\".concat(n,\" ok. fail count:\").concat(e.length,\".\")),Sn({failureUserList:e})}).catch(function(e){return i.setMessage(a).setError(e).end(),v.e(\"\".concat(n,\" failed. error:\"),e),C(e)})}},{key:\"unsubscribeUserStatus\",value:function(e){var t=\"unsubscribeUserStatus\";if(!this._userM.canIUse(H.USER_STATUS))return this._userM.noUse(t);var n=\"\".concat(this._n,\".\").concat(t),e=(e||{}).userIDList,e=void 0===e?[]:e,o=D(e),i=(e.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(v.w(\"\".concat(n,\" \").concat(zt(this.MAX_UNSUBSCRIBE_USER_COUNT))),o=e.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT)),new M(t)),a=\"userID count:\".concat(e.length),t=(v.l(\"\".concat(n,\" \").concat(a)),{userIDList:o});return 0===o.length&&(t.userIDList=void 0,t.unsubscribeAll=1),this._userM.req({P:I.UNSUB_USER_STATUS,data:t}).then(function(e){e=e.data.failureUserList,e=(void 0===e?[]:e).map(function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,e=e.errorInfo;return{userID:Je(n)?t:n,code:o,message:e}});return i.setMessage(\"\".concat(a,\" fail count:\").concat(e.length)).end(),v.l(\"\".concat(n,\" ok. fail count:\").concat(e.length,\".\")),Sn({failureUserList:e})}).catch(function(e){return i.setMessage(\"\".concat(a)).setError(e).end(),v.e(\"\".concat(n,\" failed. error:\"),e),C(e)})}},{key:\"reset\",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),Bi),bi=(t(Hi,Fn),ti=f(Hi),e(Hi,[{key:\"onContextUpdated\",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:\"mockOnNickAvatarModified\",value:function(e,t){v.l(\"\".concat(this._n,\"._mockOnNickAvatarModified nick:\").concat(e,\" avatar:\").concat(t)),this.onProfileModified({dataList:[{pushType:1,userID:this.getMyUserID(),profileList:[{tag:qe.NICK,value:e},{tag:qe.AVATAR,value:t}]}]})}},{key:\"onProfileModified\",value:function(e){this._profileHandler.onProfileModified(e)}},{key:\"onRelationChainModified\",value:function(e){var t,n,e=e.dataList;Je(e)||(t=[],e.forEach(function(e){e.blackListDelAccount&&t.push.apply(t,D(e.blackListDelAccount))}),0=this.MIN_THRESHOLD&&this._report())}},{key:\"onCheckTimer\",value:function(){Date.now()n.MAX_THRESHOLD&&n._flushAtOnce()})):this._lastReportTime=Date.now())}},{key:\"_flushAtOnce\",value:function(){var e=this.get(13),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o=\"\".concat(this._n,\"._flushAtOnce\");Je(t)?(v.l(\"\".concat(o,\" count:\").concat(n.length)),e.setItem(this.TAG,n,!0,!1)):((n=n.concat(t)).length>this.MAX_THRESHOLD&&(n=n.slice(0,this.MAX_THRESHOLD)),v.l(\"\".concat(o,\" count:\").concat(n.length)),e.setItem(this.TAG,n,!0,!1))}},{key:\"reset\",value:function(){v.l(\"\".concat(this._n,\".reset\")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),ya),ma=\"none\",va=\"online\",Ia=(e(Ma,[{key:\"_startRN\",value:function(){var e,n=this;!re||(e=this._m.get(18).getPlugin(\"chat-network-monitor\"))&&(this._removeListener=e.addEventListener(function(e){var t=e.isConnected,e=e.type;n._networkType!==e&&n._onNetworkStatusChange({isConnected:void 0!==t&&t,networkType:e})}))}},{key:\"start\",value:function(){var t=this,n=\"\".concat(this._n,\".start\");ae?(ue.getNetworkType({success:function(e){t._networkType=e.networkType||e.subtype||\"\",e.networkType===ma?v.w(\"\".concat(n,\" no network, please check!\")):v.i(\"\".concat(n,\" networkType:\").concat(e.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),ue.onNetworkStatusChange(this._mpNetworkStatusCallback)):ce&&(this._networkType=va,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window.addEventListener(\"online\",this._webOnlineCallback),window.addEventListener(\"offline\",this._webOfflineCallback))}},{key:\"_onWebOnline\",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:va})}},{key:\"_onWebOffline\",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:ma})}},{key:\"_onNetworkStatusChange\",value:function(e){var t=e.isConnected,e=e.networkType,n=\"\".concat(this._n,\"._onNetworkStatusChange\"),o=!1,i=\"previous:\".concat(this._networkType,\" current:\").concat(e);t?(v.i(\"\".concat(n,\" \").concat(i)),this._networkType!==e&&(o=!0,this._networkType=e,this._m.get(21).reConnect(!0))):this._networkType!==e&&(o=!0,this._networkType=e,v.w(\"\".concat(n,\" no network, please check!\")),this._m.get(21).offline()),o&&new M(\"networkChange\").setMessage(\"isConnected:\".concat(t,\" \").concat(i)).end()}},{key:\"isOnline\",value:function(){return this._networkType!==ma}},{key:\"getNetworkType\",value:function(){return this._networkType}},{key:\"reset\",value:function(){v.l(\"\".concat(this._n,\".reset\")),ae?null!==this._mpNetworkStatusCallback&&(ue.offNetworkStatusChange&&ue.offNetworkStatusChange(this._mpNetworkStatusCallback),this._mpNetworkStatusCallback=null):ce?(null!==this._webOnlineCallback&&(window.removeEventListener(\"online\",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener(\"offline\",this._webOfflineCallback),this._webOfflineCallback=null)):re&&this._removeListener&&(this._removeListener(),this._removeListener=null)}}]),Ma);function Ma(e){d(this,Ma),this._m=e,this._networkType=va,this._n=\"NetMonitorModule\",this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null,this._removeListener=null,this._m.getIEmitInst().on(Wo.A2KEY_AND_TINYID_UPDATED,this._startRN,this)}function ya(e){d(this,ya),(e=_a.call(this,e))._n=\"EventStatModule\",e.TAG=\"im-ssolog-event\",e._reportBody=new ga,e.MIN_THRESHOLD=20,e.MAX_THRESHOLD=100,e.WAITING_TIME=6e4,e.REPORT_LEVEL=[4,5,6],e.REPORT_SDKAPPID_BLACKLIST=[],e.REPORT_TINYID_WHITELIST=[],e._lastReportTime=Date.now();var t=e.getIEmitInst();return t.on(Wo.A2KEY_AND_TINYID_UPDATED,e._onLoginSuccess,h(e)),t.on(Wo.CLOUD_CONFIG,e._onCloudConfig,h(e)),e}function Ca(e){d(this,Ca),this._n=\"SSOLogBody\",this._report=[]}function Ta(e){d(this,Ta),this._m=e,this._n=\"StorageModule\",this._storageQueue=new Map,this._errorTolerantHandle()}function Da(e,t){return e(t={exports:{}},t.exports),t.exports}var Ea,La=Da(function(e){var o=Object.prototype.hasOwnProperty,_=\"~\";function n(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,n,o,i){if(\"function\"!=typeof n)throw new TypeError(\"The listener must be a function\");n=new a(n,o||e,i),o=_?_+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],n]:e._events[o].push(n):(e._events[o]=n,e._eventsCount++),e}function c(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function t(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(_=!1)),t.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)o.call(e,t)&&n.push(_?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},t.prototype.listeners=function(e){var e=_?_+e:e,t=this._events[e];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,o=t.length,i=new Array(o);n=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:\"getFileDNList\",value:function(){return this._fileDNList}},{key:\"_getAuthorization\",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:\"upload\",value:function(e){if(!0===e._relayFlag)return Promise.resolve();var t=this.get(26);switch(e.type){case R.MSG_IMAGE:return t.addTotalCount(Zn),this._uploadImage(e);case R.MSG_FILE:return t.addTotalCount(Zn),this._uploadFile(e);case R.MSG_AUDIO:return t.addTotalCount(Zn),this._uploadAudio(e);case R.MSG_VIDEO:return t.addTotalCount(Zn),this._uploadVideo(e);default:return Promise.resolve()}}},{key:\"_uploadImage\",value:function(v){var I=this,e=this.get(2),M=v.getElements()[0],t=e.getMessageOption(v.clientSequence);return this.doUploadImage({file:t.payload.file,to:t.to,message:v,onProgress:function(e){if(M.updatePercent(e),it(t.onProgress))try{t.onProgress(e)}catch(e){return C({code:T.MSG_ONPROGRESS_ERR})}}}).then(function(e){var t=e.location,l=e.fileType,d=e.fileSize,n=e.width,o=e.height,p=e.smallImageUrl,_=e.smallImageWidth,h=e.smallImageHeight,g=e.largeImageUrl,f=e.largeImageWidth,m=e.largeImageHeight,i=e.imageInfoArray,e=I.isPrivateNetWork()?t:_t(t);M.updateImageFormat(l);var a,s,r={size:d,url:e,width:n,height:o};if(i&&0this.UPLOAD_SIZE_LIMIT.F?this._checkSizeError(\"F\"):0===e.file.files[0].size?C({code:T.MSG_F_IS_EMPTY}):(this._setUploadFileType(255),this.uploadByCOS(e))}},{key:\"doUploadVideo\",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.V?this._checkSizeError(\"V\"):0===e.file.videoFile.size?C({code:T.MSG_F_IS_EMPTY}):-1===si.indexOf(e.file.videoFile.type)?C({code:T.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(2),ae||re?this.handleVideoUpload(y(y({},e),{},{file:e.file.videoFile})):ce?this.handleVideoUpload(e):void 0)}},{key:\"handleVideoUpload\",value:function(n){var o=this;return new Promise(function(t,e){o.uploadByCOS(n).then(function(e){t(e)}).catch(function(){o.uploadByCOS(n).then(function(e){t(e)}).catch(function(){e(new Bn({code:T.MSG_V_UPLOAD_FAIL}))})})})}},{key:\"doUploadAudio\",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.A?this._checkSizeError(\"A\"):0===e.file.size?C({code:T.MSG_F_IS_EMPTY}):(this._setUploadFileType(3),this.uploadByCOS(e)):C({code:T.MSG_A_UPLOAD_FAIL})}},{key:\"uploadByCOS\",value:function(t){var c=this;if(!it(this._cosUploadMethod))return this.warn(\"PluginUndetected\"),C({code:T.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(t);var u=new M(\"upload\"),l=\"\".concat(this._n,\".uploadByCOS\"),d=Date.now(),p=this._getFile(t);return new Promise(function(a,s){var e=ae?c._createCosOptionsWXMiniApp(t):c._createCosOptionsWeb(t),r=c;c._cosUploadMethod(e,function(e,t){var n=Object.create(null);if(t){if(e||nt(t.files)&&t.files[0].error)return o=new Bn({code:T.MSG_F_UPLOAD_FAIL}),u.setError(o).end(),v.l(\"\".concat(l,\" failed. error:\"),t.files[0].error),403===t.files[0].error.statusCode&&c._getAuthorizationKey(),void s(o);n.fileName=p.name,n.fileSize=p.size,n.fileType=p.type.slice(p.type.indexOf(\"/\")+1).toLowerCase(),n.location=(ae?t:t.files[0].data).Location;var o=Date.now()-d,t=r._formatFileSize(p.size),i=r._formatSpeed(1e3*p.size/o),t=\"size:\".concat(t,\" time:\").concat(o,\"ms speed:\").concat(i),i=(v.l(\"\".concat(l,\" success. name:\").concat(p.name,\" \").concat(t)),a(n),c.get(26));return i.addCost(Zn,o),i.addFileSize(Zn,p.size),void u.setMessage(t).end()}n=new Bn({code:T.MSG_F_UPLOAD_FAIL});u.setError(n).end(),v.w(\"\".concat(l,\" failed. error:\"),e),403===e.statusCode&&c._getAuthorizationKey(),s(n)})})}},{key:\"_uploadWithPreSigUrl\",value:function(e){var p=this,_=\"\".concat(this._n,\"._uploadWithPreSigUrl\"),h=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then(function(d){return new Promise(function(a,s){var r=new M(\"upload\"),e=d.requestSnapshotUrl,c=void 0===e?void 0:e,u=g(d,ka),l=Date.now();p._cosUploadMethod(u,function(e,t){var n,o,i;return e||403===t.statusCode?(r.setError(new Bn(e)).end(),o={HttpStatusCode:9999,CostTime:Qt(l,!1),error:e,url:d.url},t.data&&t.data.uploadIP&&(o.uploadIP=t.data.uploadIP),p._uploadSSOLog(o),v.l(\"\".concat(_,\" failed, error:\"),e),void s(new Bn({code:T.MSG_F_UPLOAD_FAIL}))):(n=Object.create(null),o=t.data.location||\"\",p.isPrivateNetWork()||0!==o.indexOf(\"https://\")&&0!==o.indexOf(\"http://\")||(o=o.split(\"//\")[1]),n.fileName=h.name,n.fileSize=h.size,n.fileType=h.type.slice(h.type.indexOf(\"/\")+1).toLowerCase(),n.location=o,e=Qt(l,!1),o=p._formatFileSize(h.size),i=p._formatSpeed(1e3*h.size/e),o=\"size:\".concat(o,\" time:\").concat(e,\"ms speed:\").concat(i,\" res:\").concat(JSON.stringify(t.data)),v.l(\"\".concat(_,\" ok. name:\").concat(h.name,\" \").concat(o)),r.setMessage(o).end(),i={HttpStatusCode:t.statusCode,FileSize:h.size,CostTime:e,url:d.url},t.data&&t.data.uploadIP&&(i.uploadIP=t.data.uploadIP),p._uploadSSOLog(i),(o=p.get(26)).addCost(Zn,e),o.addFileSize(Zn,h.size),i=[],u.thumbUrl&&u.largeUrl&&i.push.apply(i,[p._getSmallImageInfoByUrl(u.thumbUrl,n),p._getLargeImageInfoByUrl(u.largeUrl,n)]),1===p.uploadFileType&&p.isSimpleCos&&!p.isPrivateNetWork()&&(i.push(p._getImageInfoArray(u.downloadUrl,n)),t.data.uploadIP&&i.push(p._getDownloadIP(u.downloadUrl.split(\"//\")[1].split(\"/\")[0],n))),c&&i.push(p._getSnapshotInfoByUrl(c,n)),0>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533}else t<=57343&&(t=65533);return t<=2047?ss(192|t>>>6,128|63&t):ss(224|t>>>12,128|t>>>6&63,128|63&t)},cs=function(e){for(var t=void 0===e?\"\":(\"\"+e).replace(/[\\x80-\\uD7ff\\uDC00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,rs),n=0|t.length,o=new Uint8Array(n),i=0;i=i&&(v.l(\"\".concat(a._n,\"._checkPromiseMap request timeout, delete requestID:\").concat(t)),a._promiseMap.delete(t),n(new Bn({code:T.NETWORK_TIMEOUT,data:{headSeq:e}})),a._chM.onRequestTimeout())})}},{key:\"_checkNativeAppWS\",value:function(){ne&&!this.isConnected()&&this._reConnect()}},{key:\"onOpen\",value:function(e){var t,n;this._readyState!==hs&&(this._onOpenTs=Date.now(),n=e.id,e=e.res,this._socketID=n,t=Qt(this._startTs,!1),n=\"socketID:\".concat(n,\" res:\").concat(e),v.l(\"\".concat(this._n,\"._onOpen cost:\").concat(t,\" ms. \").concat(n)),new M(\"wsOnOpen\").setMessage(t).setCostTime(t).setMoreMessage(n).end(),this._readyState=ps,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._chM.onReconnected(),this._reConnectFlag=!1),this._chM.onOpen())}},{key:\"onClose\",value:function(e){var t=new M(\"wsOnClose\"),n=e.id,e=e.e,o=\"sourceSocketID:\".concat(n,\" currentSocketID:\").concat(this._socketID,\" code:\").concat(e.code,\" reason:\").concat(e.reason),i=0;0!==this._onOpenTs&&(i=Date.now()-this._onOpenTs),t.setMessage(i).setCostTime(i).setMoreMessage(o).setCode(e.code).end(!0),v.l(\"\".concat(this._n,\"._onClose \").concat(o,\" onlineTime:\").concat(i)),n===this._socketID&&(this._readyState=hs,i<1e3?this._chM.onReconnectFailed():this._chM.onClose())}},{key:\"onError\",value:function(e){var t=e.id,e=e.e,n=\"sourceSocketID:\".concat(t,\" currentSocketID:\").concat(this._socketID);new M(\"wsOnError\").setMessage(e.errMsg||JSON.stringify(e,[\"message\",\"code\"])).setMoreMessage(n).setLevel(\"error\").end(!0),v.w(\"\".concat(this._n,\"._onError\"),e,n),t===this._socketID&&(this._readyState=hs,this._chM.onError())}},{key:\"onMessage\",value:function(t){var e;try{e=JSON.parse(t.data)}catch(e){new M(\"jsonParseError\").setMessage(t.data).end()}if(e&&e.head){var n,o,i,a,t=this._getRequestIDFromHead(e.head),s=e.body;if(this._chM.get(30).isTRTCCommand(t)||(a=xt(e.head),s=function t(e,n){return nt(e)?e.map(function(e){return $e(e)?t(e,n):e}):$e(e)?(o=e,i=function(e,t){return A(n[t])?ns(t):n[t]},a={},Object.keys(o).forEach(function(e){a[i(o[e],e)]=o[e]}),Gt(a,function(e){return nt(e)||$e(e)?t(e,n):e})):void 0;var o,i,a}(e.body,this._getResKeyMap(a))),v.d(\"\".concat(this._n,\".onMessage ret:\").concat(JSON.stringify(s),\" requestID:\").concat(t,\" has:\").concat(this._promiseMap.has(t))),this._setNextPingTs(),this._promiseMap.has(t))return n=(a=this._promiseMap.get(t)).resolve,o=a.reject,i=a.timestamp,a=a.headSeq,this._promiseMap.delete(t),this._calcRTT(i),void(s.errorCode&&0!==s.errorCode?(this._chM.onErrorCodeNotZero(s),o(new Bn({code:s.errorCode,message:s.errorInfo||\"\",data:t.includes(I.MODIFY_C2C_MSG)||t.includes(I.MODIFY_GRP_MSG)?{elements:s.elements,messageVersion:s.messageVersion,cloudCustomData:s.cloudCustomData,headSeq:a}:{headSeq:a}}))):n(Sn(s)));this._chM.onMessage({head:e.head,body:s})}}},{key:\"_calcRTT\",value:function(e){e=Date.now()-e;this._chM.get(26).addRTT(e)}},{key:\"_connect\",value:function(){this._readyState!==_s&&this._readyState!==ps&&(this._startTs=Date.now(),this._onOpenTs=0,this._readyState=_s,this._socket=new us(this),this._socketID=this._socket.getID(),v.l(\"\".concat(this._n,\"._connect isWorkerEnabled:\").concat(this.getIsWorkerEnabled(),\" socketID:\").concat(this._socketID,\" url:\").concat(this.getURL())),new M(\"wsConnect\").setMessage(\"socketID:\".concat(this._socketID,\" url:\").concat(this.getURL())).end())}},{key:\"getURL\",value:function(){this._chM.isDevMode()&&(this._canIUseBinaryFrame=!1);var e=bt(),t=((ee||z&&\"windows\"===e||ne)&&(this._canIUseBinaryFrame=!1),-1),n=(\"ios\"===e?t=_e||-1:\"android\"===e&&(t=ge||-1),this._chM.get(12)),o=this._chM.getPlatform(),i=n.getSDKAppID(),n=n.getInstanceID(),i=\"sdkappid=\".concat(i,\"&instanceid=\").concat(n,\"&random=\").concat(this._getRandom(),\"&platform=\").concat(o,\"&host=\").concat(e)+\"&version=\".concat(t,\"&sdkversion=\").concat(\"3.5.2\");return X&&(i+=\"&isminigame=1\"),this._chM.canIUseInflate()&&(i+=\"&compress=gzip\"),(this._canIUseBinaryFrame?\"\".concat(this._url,\"/binfo?\"):\"\".concat(this._url,\"/info?\")).concat(i)}},{key:\"_closeConnection\",value:function(e){v.l(\"\".concat(this._n,\"._closeConnection socketID:\").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=hs)}},{key:\"_resend\",value:function(){var i=this;if(v.l(\"\".concat(this._n,\"._resend reConnectFlag:\").concat(this._reConnectFlag),\"promiseMap.size:\".concat(this._promiseMap.size,\" simpleRequestMap.size:\").concat(this._simpleRequestMap.size)),0>>1^3988292384:o>>>=1}return(4294967295^o)>>>0}},{key:\"close\",value:function(){v.l(\"\".concat(this._n,\".close\")),this._closeConnection(4e3),this._promiseMap.clear(),this._startSequence=lt(),this._readyState=hs,this._simpleRequestMap.clear(),this._reConnectFlag=!1,this._reConnectCount=0,this._onOpenTs=0,this._url=\"\",this._random=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0}}]),Os),fs=function(a,s,r){return new Promise(function(t,e){var n,o,i=\"application/x-www-form-urlencoded;charset=UTF-8\";ae?ue.request({url:s,data:r,method:a,timeout:3e3,header:{\"content-type\":i},success:function(e){e&&e.data&&e.data.NetCheckInfo&&v.l(\"\".concat(\"getconninfo ok in\",\" miniapp. ret:\"),e.data),t()},fail:function(){e(new Bn({code:T.NETWORK_ERROR}))}}):(n=new XMLHttpRequest,o=setTimeout(function(){n.abort(),e(new Bn({code:T.NETWORK_TIMEOUT}))},3e3),n.onreadystatechange=function(){4===n.readyState&&(o&&clearTimeout(o),200===n.status||304===n.status?(n.responseText&&-1=this._socketHandler.getNextPingTs()&&this._ping()}},{key:\"dealloc\",value:function(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),-1>>30-e}function Us(e,t){for(var n=e.toString(16),o=t-n.length,i=\"0\";0>>=1,i+=i)1&o&&(n=i+n);return n}t(ec,Fn),Ws=f(ec),e(ec,[{key:\"_init\",value:function(){this._updateCmdFreqLimitMap(Ts)}},{key:\"_onCloudConfig\",value:function(){var e=this.getCloudConfig(\"cmd_frequency_limit\");A(e)||(e=JSON.parse(e),this._updateCmdFreqLimitMap(e))}},{key:\"_updateCmdFreqLimitMap\",value:function(e){var t=this;e.forEach(function(e){t._cmdFreqLimitMap.set(e.cmd,{interval:e.interval,count:e.count})})}},{key:\"updateProtocolConfig\",value:function(){this._pHandler.update()}},{key:\"req\",value:function(e){v.d(\"\".concat(this._n,\".req options:\"),e);var t=e.P;if(!this._pHandler.has(t))return v.w(\"\".concat(this._n,\".req unknown P:\").concat(t)),C({code:T.NO_PROTOCOL});var e=this.getProtocolData(e),n=e.head.servcmd;if(this._isFreqOverLimit(n))return C({code:o=T.OVER_FREQUENCY_LIMIT,message:this.getErrMsg(o,this._getCmd(n))});if(this._isServerOverload(n))return C({code:o=T.OPEN_SERVICE_OVERLOAD_ERROR,message:this.getErrMsg(o,this._getCmd(n))});var o=this.get(21);return ys.includes(t)?o.simplySend(e):o.send(e)}},{key:\"getKeyMap\",value:function(e){return this._pHandler.getKeyMap(e)}},{key:\"genCommonHead\",value:function(){var e=this.get(12);return{ver:\"v4\",platform:this._platform,websdkappid:x,websdkversion:q,a2:e.getA2Key()||void 0,tinyid:e.getTinyID()||void 0,status_instid:e.getStatusInstanceID(),sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getA2Key()?void 0:e.getUserID(),usersig:e.getA2Key()?void 0:e.getUserSig(),sdkability:12775283,sdkability_ext:Gs(\"\"),cappid:e.getApplicationID(),cs:0}}},{key:\"genCosSpecifiedHead\",value:function(){var e=this.get(12);return{ver:\"v4\",platform:this._platform,websdkappid:x,websdkversion:q,sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getUserID(),usersig:e.getUserSig(),status_instid:e.getStatusInstanceID(),sdkability:12775283,sdkability_ext:Gs(\"\"),cappid:e.getApplicationID(),cs:0}}},{key:\"genSSOReportHead\",value:function(){var e=this.get(12);return{ver:\"v4\",platform:this._platform,websdkappid:x,websdkversion:q,sdkappid:e.getSDKAppID(),contenttype:\"\",reqtime:0,identifier:\"\",usersig:\"\",status_instid:e.getStatusInstanceID(),sdkability:12775283,sdkability_ext:Gs(\"\"),cappid:e.getApplicationID(),cs:0}}},{key:\"getProtocolData\",value:function(e){return this._pHandler.getProtocolData(e)}},{key:\"trans\",value:function(e){var t=e.servcmd,e=e.data,t={head:y(y({},this.genCommonHead()),{},{servcmd:t}),body:e};return this.get(21).send(t)}},{key:\"sendComboMessage\",value:function(e){var t=e.servcmd,e=e.data,t={head:y(y({},this.genCommonHead()),{},{servcmd:t}),body:e};return this.get(21).send(t)}},{key:\"onErrorCodeNotZero\",value:function(e){var t,n=e.errorCode;n===T.HELLO_ANSWER_KICKED_OUT&&(t=e.kickType,e=void 0===(e=e.newInstanceInfo)?{}:e,1===t?this.onMultipleAccountKickedOut(e):2===t?this.onMultipleDeviceKickedOut(e):3===t&&this.onRestApiKickedOut(e)),n!==T.MSG_A2KEY_EXPIRED&&n!==T.ACCOUNT_A2KEY_EXPIRED||(this._onUserSigExpired(),this.get(21).reConnect())}},{key:\"onMessage\",value:function(e){var t=e.body,n=t.needAck,t=t.sessionData;1===(void 0===n?0:n)&&this._sendACK(t),this._msgDispatcher.onMessage(e)}},{key:\"onReconnected\",value:function(e){this._incrementalPullContactFlag=e<=300,this._reLoginOnReconnected()}},{key:\"reLoginOnKickOther\",value:function(){v.l(\"\".concat(this._n,\".reLoginOnKickOther\")),this._reLogin()}},{key:\"_reLoginOnReconnected\",value:function(){v.l(\"\".concat(this._n,\"._reLoginOnReconnected\")),this._reLogin()}},{key:\"_reLogin\",value:function(){var e,t,s,r=this,c=\"\".concat(this._n,\"._reLogin\");this.isLoggedIn()&&(e=0,(t=this.get(1).getPushModule())&&(e=t.getUniAppPlatform()),s=new M(\"reLogin\"),this.req({P:I.LOGIN,data:{isWebUniapp:e,customInfo:this.get(12).getCustomLoginInfo()}}).then(function(e){var e=e.data,t=e.instanceID,e=e.customStatus,n=r.get(12),o=$o(e),i=(n.setStatusInstanceID(t),r.get(21)),a=i.getSocketID(),a=\"socketID:\".concat(a,\" instanceID:\").concat(t,\" customStatus:\").concat(o),t=(s.setMessage(a).end(!0),v.l(\"\".concat(c,\" ok. \").concat(a)),n.getCustomStatus()!==o&&r.get(4).onUserStatusUpdated({dataList:[{to:r.getMyUserID(),statusType:R.USER_STATUS_ONLINE,customStatus:e}]}),i.diagnose(),r.get(11).syncConvList(r._incrementalPullContactFlag).then(function(){v.l(\"\".concat(c,\", sync conv list ok.\")),r.get(25).start()}),r.get(7)),a=(t&&t.updateLocalMainSequenceOnReconnected(),r.get(10)),n=(a.resetGetTopicTime(),a.getTopicListOnReconnected(),r.get(35));n&&n.clearCacheOnReconnected()}))}},{key:\"onMultipleAccountKickedOut\",value:function(e){this.get(1).onMultipleAccountKickedOut(e)}},{key:\"onMultipleDeviceKickedOut\",value:function(e){this.get(1).onMultipleDeviceKickedOut(e)}},{key:\"_onUserSigExpired\",value:function(){this.get(1).onUserSigExpired()}},{key:\"onRestApiKickedOut\",value:function(e){this.get(1).onRestApiKickedOut(e)}},{key:\"_sendACK\",value:function(e){this.req({P:I.MSG_PUSH_ACK,data:{sessionData:e}})}},{key:\"_isFreqOverLimit\",value:function(e){e=e.split(\".\")[1];if(!this._cmdFreqLimitMap.has(e))return!1;if(!this._cmdReqInfoMap.has(e))return this._cmdReqInfoMap.set(e,{startTime:Date.now(),requestCount:1}),!1;var t=this._cmdFreqLimitMap.get(e),n=t.count,t=t.interval,o=this._cmdReqInfoMap.get(e),i=o.startTime,o=o.requestCount;return Date.now()-i>1e3*t?(this._cmdReqInfoMap.set(e,{startTime:Date.now(),requestCount:1}),!1):(this._cmdReqInfoMap.set(e,{startTime:i,requestCount:o+=1}),n=this._expiredTime}},{key:\"fetchConfig\",value:function(){var o,i=this,a=\"\".concat(this._n,\".fetchConfig\"),e=this._canFetch();v.l(\"\".concat(a,\" canFetch:\").concat(e)),e&&(o=new M(\"fetchCloudCtrlConfig\"),e=this.get(12).getSDKAppID(),this._isFetching=!0,this.req({P:I.FETCH_CLOUD_CTRL_CONFIG,data:{SDKAppID:e,version:this._version}}).then(function(e){i._isFetching=!1;var t=e.data,n=t.version,t=t.cloudControlConfig;o.setMessage(\"version:\".concat(i._version,\" newVersion:\").concat(n,\" config:\").concat(t)).end(),v.l(\"\".concat(a,\" ok\")),i._parse(e.data)}).catch(function(e){i._isFetching=!1,o.setError(e).end(),v.l(\"\".concat(a,\" failed. error:\"),e),i._setExpiredTime(12e4)}))}},{key:\"onPushedConfig\",value:function(e){v.l(\"\".concat(this._n,\".onPushedConfig config:\"),e),new M(\"pushedCloudCtrlConfig\").setMessage(\"newVersion:\".concat(e.version,\" config:\").concat(e.cloudControlConfig)).end(),this._parse(e)}},{key:\"onCheckTimer\",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:\"_parse\",value:function(e){var t=this,n=\"\".concat(this._n,\"._parse\"),o=e.errorCode,i=e.errorMessage,a=e.cloudControlConfig,s=e.version,r=e.expiredTime;if(0===o){if(this._version!==s){var c=null;try{c=JSON.parse(a)}catch(e){this.isPrivateNetWork()||v.e(\"\".concat(n,\" failed. config:\"),a)}c&&(this._cloudConfig.clear(),Object.keys(c).forEach(function(e){t._cloudConfig.set(e,c[e])}),this._version=s,this.emitIEvt(Wo.CLOUD_CONFIG))}this._setExpiredTime(1e3*r)}else A(o)?(v.l(\"\".concat(n,\" failed. Invalid message format:\"),e),this._setExpiredTime(36e5)):(v.e(\"\".concat(n,\" errorCode:\").concat(o,\" errorMessage:\").concat(i)),this._setExpiredTime(12e4))}},{key:\"_setExpiredTime\",value:function(e){this._expiredTime=Date.now()+e}},{key:\"reset\",value:function(){v.l(\"\".concat(this._n,\".reset\")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),$r),zs=(t(Qr,Fn),Ks=f(Qr),e(Qr,[{key:\"start\",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:\"_recoverGroupChat\",value:function(){var n,o,i,a,s=this,e=this._getLocalConvList().filter(function(e){return e.type===R.CONV_GROUP&&e.groupProfile.type!==R.GRP_AVCHATROOM}),r=this.get(11),c=[];e.forEach(function(e){var t=e.conversationID,e=e.lastMessage;n=t.replace(R.CONV_GROUP,\"\"),o=r.getLocalLastMessage(t),e&&0!==e.lastSequence&&o?(i=e.lastSequence,o=o.sequence,a=i-o,0o[0]&&n\",e[i].tag)}this.timestamp=Date.now(),o.length=0}},{key:\"updateProfile\",value:function(e){this.profile=JSON.parse(JSON.stringify(e)),this.timestamp=Date.now()}},{key:\"addToGroupList\",value:function(e){-1===this.groupList.indexOf(e)&&(this.groupList.push(e),this.count=this.groupList.length)}},{key:\"removeFromGroupList\",value:function(e){e=this.groupList.indexOf(e);-1 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(\"\"); }, 1000); postMessage(interval); } else if (event.data === \"stop\") { clearInterval(interval); interval = -1; }};'],{type:\"application/javascript; charset=utf-8\"})),this._workerTimer=new Worker(e),(t=this)._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,v.l(\"\".concat(t._n,\"._init seed:\").concat(t._timerID))):t._m.onCheckTimer()})}},{key:\"_onCloudConfig\",value:function(){var e=this.getCloudConfig(\"enable_worker\");v.l(\"\".concat(this._n,\"._onCloudConfig enableWorker:\").concat(e)),A(e)||\"1\"===e?!this._isWorkerEnabled&&ye&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&ye&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:\"terminate\",value:function(){v.l(\"\".concat(this._n,\".terminate\")),this._workerTimer&&(this._workerTimer.terminate(),this._workerTimer=null,this._timerID=-1)}},{key:\"getTimerID\",value:function(){return this._timerID}},{key:\"reset\",value:function(){v.l(\"\".concat(this._n,\".reset\"))}}]),xr),ur=(e(qr,[{key:\"isValidPurchaseBits\",value:function(e){return e&&\"string\"==typeof e&&1<=e.length&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:\"parsePurchaseBits\",value:function(e){if(this.isValidPurchaseBits(e)){this._featureMap.clear();for(var t,n=e.length-1,o=0;0<=n;n--,o++)t=(o<32?new b(0,Math.pow(2,o)):new b(Math.pow(2,o-32),0)).toString(),\"1\"===e[n]?this._featureMap.set(t,!0):this._featureMap.set(t,!1)}else v.w(\"\".concat(this._n,\".parsePurchaseBits invalid purchasebits:\").concat(e))}},{key:\"hasPurchasedFeature\",value:function(e){return!!this._featureMap.get(e)}},{key:\"isFeatureEnabled\",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,i=t.length-1,a=0;0<=i;i--,a++)if(\"1\"===t.charAt(i)&&(n=(a<32?new b(0,Math.pow(2,a)):new b(Math.pow(2,a-32),0)).toString(),!this._featureMap.get(n))){o=!1;break}return v.l(\"\".concat(this._n,\".isFeatureEnabled decimalNumber:\").concat(e,\" key:\").concat(n,\" ret:\").concat(o)),kn({enabled:o})}},{key:\"isFeatureEnabledForStat\",value:function(e){for(var t=parseInt(e).toString(2),n=t.length-1,o=0;0<=n;n--,o++)if(\"1\"===t.charAt(n)){if(i=(o<32?new b(0,Math.pow(2,o)):new b(Math.pow(2,o-32),0)).toString(),!this._featureMap.get(i))break;var i,a=\"\",s=0;i===H.PLUGIN_TRANSLATE?(a=\"plugin_translate\",s=16):i===H.PLUGIN_VOICE_TO_TEXT?(a=\"plugin_voice_to_text\",s=17):i===H.PLUGIN_CS?(a=\"plugin_cs\",s=14):i===H.PLUGIN_PUSH?(a=\"plugin_push\",s=13):i===H.PLUGIN_BOT?(a=\"plugin_bot\",s=15):i===H.MSG_REACTION&&(a=\"plugin_emoji_reaction\",s=18),\"\"!==a&&(i=this._commercialConfigM.get(12).getUIPlatform(),new M(a).setCode(s).setUIPlatform(i).end(),v.l(\"\".concat(this._n,\".isFeatureEnabledForStat \").concat(a,\" code:\").concat(s,\" uiPlatform:\").concat(i)))}}},{key:\"isCSPluginEnabled\",value:function(){var e;this._isCSPluginReported||(e=this._commercialConfigM.get(12).getUIPlatform(),new M(\"plugin_search\").setCode(6).setUIPlatform(e).end(),this._isCSPluginReported=!0)}},{key:\"clear\",value:function(){this._featureMap.clear(),this._isCSPluginReported=!1}}]),qr),lr=(e(Fr,[{key:\"_canFetch\",value:function(){return this.get(12).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:\"onCheckTimer\",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:\"fetchConfig\",value:function(){var t,e,n=this,o=this._canFetch(),i=\"\".concat(this._n,\".fetchConfig\");v.l(\"\".concat(i,\" canFetch:\").concat(o)),o&&(t=new M(\"fetchCommercialConfig\"),o=this.get(12).getSDKAppID(),e=this.get(20),this._isFetching=!0,e.req({P:I.FETCH_COMMERCIAL_CONFIG,data:{SDKAppID:o}}).then(function(e){t.setMessage(\"purchaseBits:\".concat(e.data.purchaseBits)).end(),v.l(\"\".concat(i,\" ok.\")),n._parseConfig(e.data),n._isFetching=!1}).catch(function(e){t.setError(e).end(),n._isFetching=!1}))}},{key:\"onPushedConfig\",value:function(e){var t=\"\".concat(this._n,\".onPushedConfig data:\").concat(JSON.stringify(e));v.l(\"\".concat(t)),new M(\"pushedCommercialConfig\").setMessage(\"purchaseBits:\".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:\"_parseConfig\",value:function(e){var t=\"\".concat(this._n,\"._parseConfig\"),n=e.errorCode,o=e.errorMessage,i=e.purchaseBits,a=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(i),this._expiredTime=Date.now()+1e3*a):A(n)?(v.l(\"\".concat(t,\" failed. Invalid message format:\"),e),this._setExpiredTimeOnResponseError(36e5)):(v.e(\"\".concat(t,\" errorCode:\").concat(n,\" errorMessage:\").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:\"_setExpiredTimeOnResponseError\",value:function(e){this._expiredTime=Date.now()+e}},{key:\"canIUse\",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:\"isFeatureEnabled\",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:\"isFeatureEnabledForStat\",value:function(e){this._purchasedFeatureHandler.isFeatureEnabledForStat(e)}},{key:\"isCSPluginEnabled\",value:function(){this._purchasedFeatureHandler.isCSPluginEnabled()}},{key:\"get\",value:function(e){return this._m.get(e)}},{key:\"reset\",value:function(){v.l(\"\".concat(this._n,\".reset\")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),Fr),dr=(t(wr,Fn),xs=f(wr),e(wr,[{key:\"registerPlugin\",value:function(e){var t,n,o,i,a,s,r,c,l,d,p,_,u;ne?(this._offlinePushPlugin=e[\"tim-offline-push-plugin\"],t=(u=e.offlinePushConfig||{}).huaweiBusinessID,n=u.xiaomiBusinessID,o=u.xiaomiAppID,i=u.xiaomiAppKey,a=u.meizuBusinessID,s=u.meizuAppID,r=u.meizuAppKey,c=u.vivoBusinessID,l=u.oppoBusinessID,d=u.oppoAppKey,p=u.oppoAppSecret,_=u.honorBusinessID,u=u.iosBusinessID,this._androidPushConfig.huaweiPushBussinessId=t,this._androidPushConfig.xiaomiPushBussinessId=n,this._androidPushConfig.xiaomiPushAppId=o,this._androidPushConfig.xiaomiPushAppKey=i,this._androidPushConfig.meizuPushBussinessId=a,this._androidPushConfig.meizuPushAppId=s,this._androidPushConfig.meizuPushAppKey=r,this._androidPushConfig.vivoPushBussinessId=c,this._androidPushConfig.oppoPushBussinessId=l,this._androidPushConfig.oppoPushAppKey=d,this._androidPushConfig.oppoPushAppSecret=p,this._androidPushConfig.honorPushBussinessId=_,new M(\"registerPlugin\").setMessage(\"tim-offline-push-plugin\").setMoreMessage(\"isExist:\".concat(!A(this._offlinePushPlugin))).end(!0),v.l(\"\".concat(this._n,\".\").concat(\"registerPlugin\",\" ok. offlinePushConfig:\").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=u,this._setAppShowListener()):this.warn(\"OfflinePushInUniapp\")}},{key:\"init\",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:\"_getDeviceToken\",value:function(){var c,u=this,l=\"\".concat(this._n,\".\").concat(\"_getDeviceToken\");it(this._offlinePushPlugin.getDeviceToken)?(c=\"androidPushConfig:\".concat(JSON.stringify(this._androidPushConfig),\", iosBusinessID:\").concat(this._iosBusinessID),v.l(\"\".concat(l,\" start. \").concat(c)),new M(\"_getDeviceToken\").setMessage(\"\".concat(c)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,function(e){var t,n,o,i,a=new M(\"getDeviceTokenRes\"),s=e.code,r=e.msg;0===s?(t=(i=e.data).deviceToken,n=i.deviceBrand,o=i.deviceType,i=i.bussinessId,u._deviceToken=t,u._businessID=i||u._iosBusinessID,c=\"deviceToken:\".concat(t,\", deviceBrand:\").concat(n||o,\", businessID:\").concat(u._businessID),v.l(\"\".concat(l,\" ok. \").concat(c)),a.setMessage(c).end(!0),u._setToken()):(a.setMessage(\"code:\".concat(s,\", msg:\").concat(r)).end(!0),v.e(\"\".concat(l,\" failed. error:\"),e))})):v.e(\"\".concat(l,\" getDeviceToken is not a function\"))}},{key:\"canIUseOfflinePush\",value:function(){return ne&&!A(this._offlinePushPlugin)}},{key:\"_setAppShowListener\",value:function(){var t=this,n=\"\".concat(this._n,\".\").concat(\"_setAppShowListener\");A(this._offlinePushPlugin)?v.e(\"\".concat(n,\" offlinePushPlugin is undefined\")):it(this._offlinePushPlugin.setAppShowListener)?(new M(\"_setAppShowListener\").end(!0),v.l(\"\".concat(n,\" start\")),this._offlinePushPlugin.setAppShowListener(function(e){e=(e||{}).appShow;new M(\"setAppShowListenerRes\").setMessage(\"appShow:\".concat(e)).end(!0),v.l(\"\".concat(n,\" ok. appShow:\").concat(e)),t._m.isReady()&&(0===e?(t._getConvUnreadCount(),t._onBackground()):1===e&&t._onForeground())})):v.e(\"\".concat(n,\" setAppShowListener is not a function\"))}},{key:\"getDeviceBrand\",value:function(){var e;if(!A(this._offlinePushPlugin)&&it(this._offlinePushPlugin.getDeviceType))return e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType,v.l(\"\".concat(this._n,\".getDeviceBrand ok. deviceType:\").concat(e)),e}},{key:\"_setToken\",value:function(){var t=\"\".concat(this._n,\"._setToken\"),e=this.get(12),n=1,o=\"\",i=\"\",a=(Je(this._deviceToken)&&(n=0),this.getUniAppPlatform()),s=this.getDeviceBrand(),r=(a===F.IOS||a===F.IPAD||a===F.MAC?i=this._deviceToken:a===F.ANDROID&&(o=this._deviceToken),new M(\"offlinePushSetToken\")),a=\"deviceToken:\".concat(i||o,\", businessID:\").concat(this._businessID,\", \")+\"deviceBrand:\".concat(s,\", isWebUniapp:\").concat(this._isWebUniapp,\", pushMsg:\").concat(n,\", platform:\").concat(a);return r.setMessage(\"\".concat(a)),v.l(\"\".concat(t,\" \").concat(a)),this.req({P:I.SET_TOKEN,data:{tokenID:o,pushMsg:n,sdkAppID:e.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:s,deviceToken:i,isWebUniapp:this._isWebUniapp}}).then(function(e){return r.end(),v.l(\"\".concat(t,\" ok\")),e}).catch(function(e){return r.setError(e).end(),v.e(\"\".concat(t,\" failed. error:\"),e),C(e)})}},{key:\"_getConvUnreadCount\",value:function(){var t=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.get(11).getLocalConvList().forEach(function(e){e.type===R.CONV_C2C&&(t._c2cUnreadCount+=e.unreadCount),e.type===R.CONV_GROUP&&(t._groupUnreadCount+=e.unreadCount)})}},{key:\"_onBackground\",value:function(){var t=this,n=\"\".concat(this._n,\".\").concat(\"_onBackground\"),o=new M(\"_onBackground\");this.req({P:I.STAT_BACKGROUND,data:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then(function(e){return o.setMessage(\"c2cUnreadCount: \".concat(t._c2cUnreadCount,\", groupUnreadCount: \").concat(t._groupUnreadCount)).end(),v.l(\"\".concat(n,\" ok\")),e}).catch(function(e){o.setError(e).end(),v.e(\"\".concat(n,\" failed. error:\"),e)})}},{key:\"_onForeground\",value:function(){var t=\"\".concat(this._n,\".\").concat(\"_onForeground\"),n=new M(\"_onForeground\");this.req({P:I.STAT_FOREGROUND,data:{isWebUniapp:this._isWebUniapp}}).then(function(e){return n.end(),v.l(\"\".concat(t,\" ok\")),e}).catch(function(e){n.setError(e).end(),v.e(\"\".concat(t,\" failed. error:\"),e)})}},{key:\"getUniAppPlatform\",value:function(){var e=uni.getSystemInfoSync().platform,t=this.getDeviceBrand();return\"ios\"===e?F.IOS:\"android\"===e?F.ANDROID:1002===t?F.IPAD:1001===t?F.MAC:void 0}},{key:\"reset\",value:function(){this._deviceToken=\"\",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,v.l(\"\".concat(this._n,\".reset\"))}}]),wr),pr=(t(br,Fn),qs=f(br),e(br,[{key:\"registerPlugin\",value:function(e){var t,n,o;ne?(t=\"\".concat(this._n,\".\").concat(\"registerPlugin\"),this._pushPlugin=e[\"tim-push\"],this._getDeviceInfo(),n=(o=e.pushConfig||{}).androidConfig,o=o.iOSConfig,$e(n)&&(this._androidPushConfig=n[this._deviceInfo.packageName]),n=(o||{}).iOSBusinessID,this._iOSBusinessID=n,o=!A(this._pushPlugin),new M(\"registerPlugin\").setMessage(this._pluginName).setMoreMessage(\"isExisted:\".concat(o)).end(!0),v.l(\"\".concat(t,\" ok. pushConfig:\").concat(JSON.stringify(e.pushConfig))),o?(this._setAppShowListener(),this._setPushEventReportListener()):v.e(\"\".concat(t,\" \").concat(this._pluginName,\" is undefined\"))):this.warn(\"TIMPushInUniapp\")}},{key:\"init\",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._reportEventCacheList(),this._getDeviceToken(),this.get(27).isFeatureEnabledForStat(Math.pow(2,41))}},{key:\"_reportEventCacheList\",value:function(){var a=this,s=\"\".concat(this._n,\".\").concat(\"_reportEventCacheList\");it(this._pushPlugin.getPushEventCacheList)?(new M(\"_reportEventCacheList\").end(!0),this._pushPlugin.getPushEventCacheList(function(e){var t=e.code,n=e.data.eventList,o=new M(\"getPushEventCacheListRes\");if(o.setCode(t),0!==t)o.setMessage(\"res:\".concat(JSON.stringify(e))).end(!0),v.e(\"\".concat(s,\" failed. error:\").concat(JSON.stringify(e)));else{t=n.length<10?\"eventList:\".concat(JSON.stringify(n)):\"eventList.length:\".concat(n.length);v.l(\"\".concat(s,\" ok. \").concat(t)),o.setMessage(t).end(!0);for(var i=y(y({},e.data),{},{eventList:[]});0=this._expiredTime&&this._getLexicon()}},{key:\"filterMessage\",value:function(e,t){var n=!0;if(!this._plugin||!this._canIUseLexicon)return n;if(t&&t.messageControlInfo&&!0===t.messageControlInfo.excludedFromContentModeration)return n;var t=e.type,o=e.conversationType;if(t!==R.MSG_TEXT&&t!==R.MSG_CUSTOM)return n;var i,a=\"\".concat(this._n,\".filterMessage\");if(v.l(\"\".concat(a)),t===R.MSG_TEXT){if(o===R.CONV_C2C?i=\"c2c_text_message\":o===R.CONV_GROUP&&(i=\"group_text_message\"),!this._isConfigOn(i))return n;var s=this._plugin.filter(e.payload.text),r=s.type,s=s.modifiedText;1===r?n=!1:2===r&&(e.payload.text=s)}else if(t===R.MSG_CUSTOM){if(o===R.CONV_C2C?i=\"c2c_custom_message\":o===R.CONV_GROUP&&(i=\"group_custom_message\"),!this._isConfigOn(i))return n;r=this._plugin.filter(e.payload.data),s=this._plugin.filter(e.payload.description),t=this._plugin.filter(e.payload.extension);1===r.type||1===s.type||1===t.type?n=!1:(2===r.type&&(e.payload.data=r.modifiedText),2===s.type&&(e.payload.description=s.modifiedText),2===t.type&&(e.payload.extension=t.modifiedText))}return v.l(\"\".concat(a,\" done. isAllowedToSend:\").concat(n)),n}},{key:\"filterText\",value:function(e,t){var n=\"\".concat(this._n,\".filterText\"),o={isAllowedToSend:!0,modifiedText:e};if(!this._plugin||!this._canIUseLexicon)return o;if(!this._isConfigOn(t))return o;v.l(\"\".concat(n));t=this._plugin.filter(e),e=t.type,t=t.modifiedText;return 1===e?o.isAllowedToSend=!1:2===e&&(o.modifiedText=t),v.l(\"\".concat(n,\" done. ret:\"),o),o}},{key:\"_getLexicon\",value:function(){var l=this,d=new M(\"profanityFilter\"),p=\"\".concat(this._n,\"._getLexicon\");this._isFetching=!0,this.req({P:I.GET_PROFANITY_LIST,data:{startIndex:this._startIndex,version:this._version}}).then(function(e){var e=e.data,t=e.errorInfo,n=e.filterConfig,o=e.lexicon,i=e.strToken,a=e.completeFlag,s=e.nextStartIndex,r=e.version,e=e.expiredTime,c=t.errorCode,u=t.errorMessage;return 0!==c?(l._isFetching=!1,v.w(\"\".concat(p,\" failed. error:\"),t),void d.setCode(c).setMessage(u).end()):(l._onFilterConfig(n),l._getToken(i),1===a?(v.l(\"\".concat(p,\" done. version:\").concat(r,\" expiredTime:\").concat(e)),l._version=r,l._canIUseLexicon=!0,l._isFetching=!1,l._expiredTime=Date.now()+1e3*e,void l._plugin.onLexiconCompleted(o)):(l._startIndex=s,l._plugin.onLexiconSliced(o),void l._getLexicon()))}).catch(function(e){d.setError(e).end(),l._isFetching=!1,v.l(\"\".concat(p,\" failed. error:\"),e)})}},{key:\"_onFilterConfig\",value:function(t){var n=this;Je(t)||(this._filterConfigMap.clear(),Object.keys(t).forEach(function(e){n._filterConfigMap.set(e,t[e])}),v.l(\"\".concat(this._n,\"._onFilterConfig. keys:\").concat(Array.from(this._filterConfigMap.keys()),\" values:\").concat(Array.from(this._filterConfigMap.values()))))}},{key:\"_isConfigOn\",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:\"_getToken\",value:function(e){if(ft(e)){var t=e.length,n=\"\";if(t%2==0)for(var o=0;o<=t-1;o+=2)n=(n+=e[o+1])+e[o];else{for(var i=0;i=this.STORAGE_EXPIRES_TIME,e=!e||\"3.5.2\"!==e;return v.l(\"\".concat(this._n,\"._needToUpdate isTimeout:\").concat(t,\" isDifferentVersion:\").concat(e)),t||e}},{key:\"_fetch\",value:function(){var e,t,n,o,i,a;this._m.get(12).isPrivateNetWork()||(e=\"https://web.sdk.qcloud.com/im/download/error-message/v3/0.0.7/tim-error-message.txt\",t=\"application/x-www-form-urlencoded;charset=UTF-8\",n=\"\".concat(this._n,\"._fetch ok in\"),o=this,ae?ue.request({url:e,method:\"GET\",timeout:3e3,header:{\"content-type\":t},dataType:\"text\",success:function(e){o._fillAndSave(e.data),v.l(\"\".concat(n,\" mini program\"))},fail:function(){}}):(i=new XMLHttpRequest,a=setTimeout(function(){i.abort()},3e3),i.onreadystatechange=function(){4===i.readyState&&(a&&clearTimeout(a),200!==i.status&&304!==i.status||(v.l(\"\".concat(n,\" browser\")),o._fillAndSave(i.responseText)))},i.open(\"GET\",e,!0),i.setRequestHeader(\"Content-type\",t),i.send()))}},{key:\"_fillAndSave\",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:\"3.5.2\"}),!0,!1)}},{key:\"_getStorageModule\",value:function(){return this._m.get(13)}},{key:\"_fillMap\",value:function(e){this._map.clear();for(var t,n,o=e.split(\";\\n\"),i=o.length,a=new RegExp(/'/g),s=0;sOe()-this.EXPIRED_TIME}},{key:\"_createPromiseList\",value:function(e){for(var t=[],n=0;nthis.MAX_COUNT?this.MAX_COUNT:e,this._clearFollowList())}},{key:\"clearCacheOnReconnected\",value:function(){this._clearFollowList()}},{key:\"onFollowNotify\",value:function(e){var a=this,e=e.dataList||[];v.l(\"\".concat(this._n,\".onFollowNotify followChangeList:\").concat(e.length)),e.forEach(function(e){var t=e.followDiffList,t=void 0===t?[]:t,e=g(e,Tr),o=e.from,i=g(e,Dr);t.forEach(function(e){var t=e.isAdd,e=e.followType,e=void 0===e?0:e,n=a._initFollowInfo();1===t?(i.userID=o,n[e].userInfoList.push(i),n[e].isAdd=!0):(n[e].userInfoList.push(o),n[e].isAdd=!1),a._emitEvent(n)})})}},{key:\"_initFollowInfo\",value:function(){var t={};return Object.values(Er).forEach(function(e){e!==Er.NONE&&(t[e]={userInfoList:[],isAdd:!1})}),t}},{key:\"_emitEvent\",value:function(n){var o=this;Object.keys(n).forEach(function(e){var e=Number(e),t=n[e];0\",t[s].tag)}this.profile=new ri(y(y({},n),{},{profileCustomField:o}))}function Wr(e){d(this,Wr),this._snsM=e,this._n=\"FriendApplicationHandler\",this._startTime=0,this._maxLimited=100,this._currentSeq=0,this._map=new Map,this._unreadCount=0}function jr(e){d(this,jr),(e=Bs.call(this,e))._n=\"QualityStatModule\",e.TAG=\"im-ssolog-quality-stat\",e.reportIndex=0,e.wholePeriod=!1,e._qualityItems=[Yn,Wn,jn,Jn,zn,Xn,Zn,Qn,$n,eo],e._messageSentItems=[jn,Jn,zn,Xn,Zn],e._messageReceivedItems=[Qn,$n,eo],e.REPORT_INTERVAL=120,e.REPORT_SDKAPPID_BLACKLIST=[],e.REPORT_TINYID_WHITELIST=[],e._statInfoArr=[],e._avgRTT=new Zs,e._avgE2EDelay=new Xs,e._rateMessageSent=new Qs,e._rateMessageReceived=new $s;var t=e.getIEmitInst();return t.on(Wo.A2KEY_AND_TINYID_UPDATED,e._onLoginSuccess,h(e)),t.on(Wo.CLOUD_CONFIG,e._onCloudConfig,h(e)),e}function Jr(){d(this,Jr),this._lastMap=new Map,this._currentMap=new Map}function zr(){d(this,zr),this._map=new Map}function Xr(){d(this,Xr),this._n=\"AvgRTT\",this._requestCount=0,this._rttArray=[]}function Zr(){d(this,Zr),this._n=\"AvgE2EDelay\",this._e2eDelayArray=[]}function Qr(e){return d(this,Qr),(e=Ks.call(this,e))._n=\"RecoverMsgModule\",e.PULL_LIMIT_COUNT=15,e}function $r(e){return d(this,$r),(e=Ys.call(this,e))._n=\"CloudControlModule\",e._cloudConfig=new Map,e._expiredTime=0,e._version=0,e._isFetching=!1,e}function ec(e){return d(this,ec),(e=Ws.call(this,e))._n=\"SessionModule\",e._platform=e.getPlatform(),e._pHandler=new Ms(h(e)),e._msgDispatcher=new Cs(h(e)),e._cmdFreqLimitMap=new Map,e._cmdReqInfoMap=new Map,e._serverOverloadInfoMap=new Map,e._incrementalPullContactFlag=!0,e._init(),e.getIEmitInst().on(Wo.CLOUD_CONFIG,e._onCloudConfig,h(e)),e}Sr.assign,Sr.shrinkBuf,Sr.setTyped,Sr.Buf8,Sr.Buf16,Sr.Buf32;function tc(e,t,n,o){for(var i=65535&e|0,a=e>>>16&65535|0,s=0;0!==n;){for(n-=s=2e3>>8^i[255&(e^t[s])];return-1^e}function oc(l,d,p,_,h,g,e,f){for(var t,m,v,I,M,y,C,T,D,E=f.bits,n=0,o=0,i=0,a=0,s=0,r=0,c=0,L=0,S=0,u=0,k=null,R=0,A=new Sr.Buf16(16),O=new Sr.Buf16(16),N=null,G=0,n=0;n<=15;n++)A[n]=0;for(o=0;o<_;o++)A[d[p+o]]++;for(s=E,a=15;1<=a&&0===A[a];a--);if(ay?(T=N[G+e[o]],k[R+e[o]]):(T=96,0),t=1<<(C=n-c),i=m=1<>c)+(m-=t)]=C<<24|T<<16|D|0,0!==m;);for(t=1<>=1;if(0!==t?u=(u&t-1)+t:u=0,o++,0==--A[n]){if(n===a)break;n=d[p+e[o]]}if(s>>1:n>>>1;e[t]=n}return e}(),ac=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],sc=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],rc=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],cc=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function uc(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function lc(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Sr.Buf16(320),this.work=new Sr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function dc(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Sr.Buf32(852),t.distcode=t.distdyn=new Sr.Buf32(592),t.sane=1,t.back=-1,0):-2}function pc(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,dc(e)):-2}function _c(e,t){var n,o;return e&&e.state?(o=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(Sr.arraySet(e.window,t,n-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>o&&(i=o),Sr.arraySet(e.window,t,n-o,i,e.wnext),(o-=i)?(Sr.arraySet(e.window,t,n-o,o,0),e.wnext=o,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,t.check=nc(t.check,R,2,0),s=a=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&a)<<8)+(a>>8))%31){e.msg=\"incorrect header check\",t.mode=30;break}if(8!=(15&a)){e.msg=\"unknown compression method\",t.mode=30;break}if(s-=4,D=8+(15&(a>>>=4)),0===t.wbits)t.wbits=D;else if(D>t.wbits){e.msg=\"invalid window size\",t.mode=30;break}t.dmax=1<>8&1),512&t.flags&&(R[0]=255&a,R[1]=a>>>8&255,t.check=nc(t.check,R,2,0)),s=a=0,t.mode=3;case 3:for(;s<32;){if(0===i)break e;i--,a+=n[o++]<>>8&255,R[2]=a>>>16&255,R[3]=a>>>24&255,t.check=nc(t.check,R,4,0)),s=a=0,t.mode=4;case 4:for(;s<16;){if(0===i)break e;i--,a+=n[o++]<>8),512&t.flags&&(R[0]=255&a,R[1]=a>>>8&255,t.check=nc(t.check,R,2,0)),s=a=0,t.mode=5;case 5:if(1024&t.flags){for(;s<16;){if(0===i)break e;i--,a+=n[o++]<>>8&255,t.check=nc(t.check,R,2,0)),s=a=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((r=(r=t.length)>i?i:r)&&(t.head&&(D=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),Sr.arraySet(t.head.extra,n,o,r,D)),512&t.flags&&(t.check=nc(t.check,n,r,o)),i-=r,o+=r,t.length-=r),t.length))break e;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===i)break e;for(r=0;D=n[o+r++],t.head&&D&&t.length<65536&&(t.head.name+=String.fromCharCode(D)),D&&r>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=12;break;case 10:for(;s<32;){if(0===i)break e;i--,a+=n[o++]<>>=7&s,s-=7&s,t.mode=27;break}for(;s<3;){if(0===i)break e;i--,a+=n[o++]<>>=1)){case 0:t.mode=14;break;case 1:O=N=void 0;var O,N=t;if(mc){for(gc=new Sr.Buf32(512),fc=new Sr.Buf32(32),O=0;O<144;)N.lens[O++]=8;for(;O<256;)N.lens[O++]=9;for(;O<280;)N.lens[O++]=7;for(;O<288;)N.lens[O++]=8;for(oc(1,N.lens,0,288,gc,0,N.work,{bits:9}),O=0;O<32;)N.lens[O++]=5;oc(2,N.lens,0,32,fc,0,N.work,{bits:5}),mc=!1}if(N.lencode=gc,N.lenbits=9,N.distcode=fc,N.distbits=5,t.mode=20,6!==l)break;a>>>=2,s-=2;break e;case 2:t.mode=17;break;case 3:e.msg=\"invalid block type\",t.mode=30}a>>>=2,s-=2;break;case 14:for(a>>>=7&s,s-=7&s;s<32;){if(0===i)break e;i--,a+=n[o++]<>>16^65535)){e.msg=\"invalid stored block lengths\",t.mode=30;break}if(t.length=65535&a,s=a=0,t.mode=15,6===l)break e;case 15:t.mode=16;case 16:if(r=t.length){if(0===(r=_<(r=i>>=5,s-=5,t.ndist=1+(31&a),a>>>=5,s-=5,t.ncode=4+(15&a),a>>>=4,s-=4,286>>=3,s-=3}for(;t.have<19;)t.lens[A[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,L={bits:t.lenbits},E=oc(0,t.lens,0,19,t.lencode,0,t.work,L),t.lenbits=L.bits,E){e.msg=\"invalid code lengths set\",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,M=65535&k,!((v=k>>>24)<=s);){if(0===i)break e;i--,a+=n[o++]<>>=v,s-=v,t.lens[t.have++]=M;else{if(16===M){for(S=v+2;s>>=v,s-=v,0===t.have){e.msg=\"invalid bit length repeat\",t.mode=30;break}D=t.lens[t.have-1],r=3+(3&a),a>>>=2,s-=2}else if(17===M){for(S=v+3;s>>=v)),a>>>=3,s=s-v-3}else{for(S=v+7;s>>=v)),a>>>=7,s=s-v-7}if(t.have+r>t.nlen+t.ndist){e.msg=\"invalid bit length repeat\",t.mode=30;break}for(;r--;)t.lens[t.have++]=D}}if(30===t.mode)break;if(0===t.lens[256]){e.msg=\"invalid code -- missing end-of-block\",t.mode=30;break}if(t.lenbits=9,L={bits:t.lenbits},E=oc(1,t.lens,0,t.nlen,t.lencode,0,t.work,L),t.lenbits=L.bits,E){e.msg=\"invalid literal/lengths set\",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,L={bits:t.distbits},E=oc(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,L),t.distbits=L.bits,E){e.msg=\"invalid distances set\",t.mode=30;break}if(t.mode=20,6===l)break e;case 20:t.mode=21;case 21:if(6<=i&&258<=_){e.next_out=p,e.avail_out=_,e.next_in=o,e.avail_in=i,t.hold=a,t.bits=s,K=H=w=b=U=P=c=G=oe=ne=te=ee=$=Q=Z=X=z=J=j=W=Y=u=B=V=x=void 0;var G,c,P,U,b,w,F=e,q=g,x=F.state,V=F.next_in,H=F.input,B=V+(F.avail_in-5),u=F.next_out,K=F.output,Y=u-(q-F.avail_out),W=u+(F.avail_out-257),j=x.dmax,J=x.wsize,z=x.whave,X=x.wnext,Z=x.window,Q=x.hold,$=x.bits,ee=x.lencode,te=x.distcode,ne=(1<>>=c=G>>>24,$-=c,0==(c=G>>>16&255))K[u++]=65535&G;else{if(!(16&c)){if(0==(64&c)){G=ee[(65535&G)+(Q&(1<>>=c,$-=c),$<15&&(Q+=H[V++]<<$,$+=8,Q+=H[V++]<<$,$+=8),G=te[Q&oe];;){if(Q>>>=c=G>>>24,$-=c,!(16&(c=G>>>16&255))){if(0==(64&c)){G=te[(65535&G)+(Q&(1<j){F.msg=\"invalid distance too far back\",x.mode=30;break t}if(Q>>>=c,$-=c,U>(c=u-Y)){if((c=U-c)>z&&x.sane){F.msg=\"invalid distance too far back\",x.mode=30;break t}if(w=Z,(b=0)===X){if(b+=J-c,c>3,Q&=(1<<($-=P<<3))-1,F.next_in=V,F.next_out=u,F.avail_in=V>>16&255,M=65535&k,!((v=k>>>24)<=s);){if(0===i)break e;i--,a+=n[o++]<>y)])>>>16&255,M=65535&k,!(y+(v=k>>>24)<=s);){if(0===i)break e;i--,a+=n[o++]<>>=y,s-=y,t.back+=y}if(a>>>=v,s-=v,t.back+=v,t.length=M,0===I){t.mode=26;break}if(32&I){t.back=-1,t.mode=12;break}if(64&I){e.msg=\"invalid literal/length code\",t.mode=30;break}t.extra=15&I,t.mode=22;case 22:if(t.extra){for(S=t.extra;s>>=t.extra,s-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;I=(k=t.distcode[a&(1<>>16&255,M=65535&k,!((v=k>>>24)<=s);){if(0===i)break e;i--,a+=n[o++]<>y)])>>>16&255,M=65535&k,!(y+(v=k>>>24)<=s);){if(0===i)break e;i--,a+=n[o++]<>>=y,s-=y,t.back+=y}if(a>>>=v,s-=v,t.back+=v,64&I){e.msg=\"invalid distance code\",t.mode=30;break}t.offset=M,t.extra=15&I,t.mode=24;case 24:if(t.extra){for(S=t.extra;s>>=t.extra,s-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg=\"invalid distance too far back\",t.mode=30;break}t.mode=25;case 25:if(0===_)break e;if(t.offset>(r=g-_)){if((r=t.offset-r)>t.whave&&t.sane){e.msg=\"invalid distance too far back\",t.mode=30;break}f=r>t.wnext?(r-=t.wnext,t.wsize-r):t.wnext-r,r>t.length&&(r=t.length),m=t.window}else m=d,f=p-t.offset,r=t.length;for(_-=r=_>10&1023,i[a++]=56320|1023&t)}var r=i,c=a;if(c<65534&&(r.subarray&&yc||!r.subarray&&Mc))return String.fromCharCode.apply(null,Sr.shrinkBuf(r,c));for(var d=\"\",u=0;u>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}(t.dictionary):\"[object ArrayBuffer]\"===Rc.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=Ic.inflateSetDictionary(this.strm,t.dictionary))!==Sc.Z_OK))throw new Error(kc[e])}function Oc(e,t){t=new Ac(t);if(t.push(e,!0),t.err)throw t.msg||kc[t.err];return t.result}Ac.prototype.push=function(e,t){var n,o,i,a,s,r=this.strm,c=this.options.chunkSize,l=this.options.dictionary,u=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?Sc.Z_FINISH:Sc.Z_NO_FLUSH,\"string\"==typeof e?r.input=function(e){for(var t=new Sr.Buf8(e.length),n=0,o=t.length;ne.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+Cc[e[n]]>t?n:t}(r.output,r.next_out),a=r.next_out-i,s=Dc(r.output,i),r.next_out=a,r.avail_out=c-a,a&&Sr.arraySet(r.output,r.output,i,a,0),this.onData(s)):this.onData(Sr.shrinkBuf(r.output,r.next_out)))),0===r.avail_in&&0===r.avail_out&&(u=!0)}while((0\",\" %c\"),\"background:#ff9d00; padding:1px; border-radius:3px; color: #fff\",\"background:transparent\",t):console.log(\"IM SDK API ->\",t)),(t=this.getErrMsg(\"DOCS_GUIDE\"))&&console.log(t),t=this.getErrMsg(\"IOS_WEBVIEW_WARNING\"),De&&t&&console.warn(t)),v.setLevel(e)}},{key:\"createTextMessage\",value:function(e){return this._get(2).createTextMessage(e)}},{key:\"createTextAtMessage\",value:function(e){return this._get(2).createTextMessage(e)}},{key:\"createImageMessage\",value:function(e){return this._get(2).createImageMessage(e)}},{key:\"createAudioMessage\",value:function(e){return this._get(2).createAudioMessage(e)}},{key:\"createVideoMessage\",value:function(e){return this._get(2).createVideoMessage(e)}},{key:\"createCustomMessage\",value:function(e){return this._get(2).createCustomMessage(e)}},{key:\"createFaceMessage\",value:function(e){return this._get(2).createFaceMessage(e)}},{key:\"createFileMessage\",value:function(e){return this._get(2).createFileMessage(e)}},{key:\"createLocationMessage\",value:function(e){return this._get(2).createLocationMessage(e)}},{key:\"createMergerMessage\",value:function(e){return this._get(2).createMergerMessage(e)}},{key:\"downloadMergerMessage\",value:function(e){return e.type!==R.MSG_MERGER?C({code:T.MSG_MERGER_TYPE_INVALID}):Je(e.payload.downloadKey)?C({code:T.MSG_MERGER_KEY_INVALID}):this._get(2).downloadMergerMessage(e).catch(function(e){return C({code:T.MSG_MERGER_DOWNLOAD_FAIL})})}},{key:\"createForwardMessage\",value:function(e){return this._get(2).createForwardMessage(e)}},{key:\"sendMessage\",value:function(e,t){return e instanceof Ro?this._get(2).sendMessageInstance(e,t):C({code:T.MSG_INSTANCE_REQUIRED})}},{key:\"callExperimentalAPI\",value:function(e,t){return\"sendComboMessage\"===e?this._get(31).sendMessage(t):\"handleGroupInvitation\"===e?this._get(7).handleGroupInvitation(t):\"isCommercialAbilityEnabled\"===e?this._get(27).isFeatureEnabled(t):\"isFeatureEnabledForStat\"===e?this._get(27).isFeatureEnabledForStat(t):\"isIntl\"===e?this.isIntl():\"sendTRTCCustomData\"===e||\"sendRoomCustomData\"===e?this._get(30).sendTRTCCustomData(t):\"getTimerID\"===e?this._m.getTimerID():\"getPollingTimerID\"===e?this._m.getPollingTimerID(t):\"setApplicationID\"===e?(this._get(12).setApplicationID(t),void this._get(20).updateProtocolConfig()):\"getServerConfig\"===e?this._get(23).getServerConfig(t):\"canIUseModule\"===e?this._m.canIUseModule(t):\"startMessageLongPolling\"===e?this._get(7).startMessageLongPolling(t):\"stopMessageLongPolling\"===e?this._get(7).stopMessageLongPolling(t):\"disableMessagePullOnInvite\"===e?this._get(11).disableMsgPullOnInvite(t):\"clearLocalMessage\"===e?this._get(11).clearMemMsg(t,!1):\"setCustomLoginInfo\"===e?this._get(12).setCustomLoginInfo(t):\"statTUIKeyFeatures\"===e?this._m.statTUIKeyFeatures(t):C({code:T.INVALID_OPERATION})}},{key:\"revokeMessage\",value:function(e){return this._get(2).revokeMessage(e)}},{key:\"resendMessage\",value:function(e,t){return e instanceof Ro?this._get(2).resendMessage(e,t):C({code:T.MSG_INSTANCE_REQUIRED})}},{key:\"deleteMessage\",value:function(e){return this._get(2).deleteMessage(e)}},{key:\"translateText\",value:function(e){return this._get(2).translateText(e)}},{key:\"convertVoiceToText\",value:function(e){return this._get(2).convertVoiceToText(e)}},{key:\"setMessageExtensions\",value:function(e,t){return this._get(3).setMessageExtensions(e,t)}},{key:\"getMessageExtensions\",value:function(e){return this._get(3).getMessageExtensions(e)}},{key:\"deleteMessageExtensions\",value:function(e,t){return this._get(3).deleteMessageExtensions(e,t)}},{key:\"addMessageReaction\",value:function(e,t){return this._get(34).addMessageReaction(e,t)}},{key:\"removeMessageReaction\",value:function(e,t){return this._get(34).removeMessageReaction(e,t)}},{key:\"getMessageReactions\",value:function(e){return this._get(34).getMessageReactions(e)}},{key:\"getAllUserListOfMessageReaction\",value:function(e){return this._get(34).getAllUserListOfMessageReaction(e)}},{key:\"modifyMessage\",value:function(e){return this._get(2).modifyRemoteMessage(e)}},{key:\"getMessageList\",value:function(e){return this._get(11).getMessageList(e)}},{key:\"getMessageListHopping\",value:function(e){return this._get(11).getMessageListHopping(e)}},{key:\"sendMessageReadReceipt\",value:function(e){return this._get(11).sendReadReceipt(e)}},{key:\"getMessageReadReceiptList\",value:function(e){return this._get(11).getReadReceiptList(e)}},{key:\"getGroupMessageReadMemberList\",value:function(e){var t=this._get(7);return t?t.getReadReceiptDetail(e):C({code:T.NO_MODULE})}},{key:\"findMessage\",value:function(e){return this._get(11).findMessage(e)}},{key:\"setMessageRead\",value:function(e){return this._get(11).setMessageRead(e)}},{key:\"getConversationList\",value:function(e){return this._get(11).getConvList(e)}},{key:\"getConversationProfile\",value:function(e){return this._get(11).getConversationProfile(e)}},{key:\"deleteConversation\",value:function(e){return this._get(11).deleteConversation(e)}},{key:\"setConversationDraft\",value:function(e){return this._get(11).setConvDraft(e)}},{key:\"clearHistoryMessage\",value:function(e){return this._get(11).clearHistoryMessage(e)}},{key:\"pinConversation\",value:function(e){return this._get(11).pinConversation(e)}},{key:\"setAllMessageRead\",value:function(e){return this._get(11).setAllMessageRead(e)}},{key:\"setMessageRemindType\",value:function(e){return this._get(11).setMessageRemindType(e)}},{key:\"setAllReceiveMessageOpt\",value:function(e){return this._get(11).setAllRcvMsgOpt(e)}},{key:\"getAllReceiveMessageOpt\",value:function(){return this._get(11).getAllRcvMsgOpt()}},{key:\"getTotalUnreadMessageCount\",value:function(){return this._get(11).getTotalUnreadCount()}},{key:\"setConversationCustomData\",value:function(e){return this._get(11).setConvCustomData(e)}},{key:\"markConversation\",value:function(e){return this._get(11).markConv(e)}},{key:\"getConversationGroupList\",value:function(){return this._get(11).getConvGroupList()}},{key:\"createConversationGroup\",value:function(e){return this._get(11).createConvGroup(e)}},{key:\"deleteConversationGroup\",value:function(e){return this._get(11).deleteConvGroup(e)}},{key:\"renameConversationGroup\",value:function(e){return this._get(11).renameConvGroup(e)}},{key:\"addConversationsToGroup\",value:function(e){return this._get(11).addConvsToGroup(e)}},{key:\"deleteConversationsFromGroup\",value:function(e){return this._get(11).deleteConvsFromGroup(e)}},{key:\"searchCloudMessages\",value:function(e){var t=this._get(38);return t?t.searchCloudMessages(e):C({code:T.NO_MODULE})}},{key:\"searchCloudUsers\",value:function(e){var t=this._get(38);return t?t.searchCloudUsers(e):C({code:T.NO_MODULE})}},{key:\"searchCloudGroups\",value:function(e){var t=this._get(38);return t?t.searchCloudGroups(e):C({code:T.NO_MODULE})}},{key:\"searchCloudGroupMembers\",value:function(e){var t=this._get(38);return t?t.searchCloudGroupMembers(e):C({code:T.NO_MODULE})}},{key:\"getMyProfile\",value:function(){return this._get(4).getMyProfile()}},{key:\"getUserProfile\",value:function(e){return this._get(4).getUserProfile(e)}},{key:\"updateMyProfile\",value:function(e){return this._get(4).updateMyProfile(e)}},{key:\"getBlacklist\",value:function(){return this._get(4).getLocalBlacklist()}},{key:\"addToBlacklist\",value:function(e){return this._get(4).addBlacklist(e)}},{key:\"removeFromBlacklist\",value:function(e){return this._get(4).deleteBlacklist(e)}},{key:\"setSelfStatus\",value:function(e){return this._get(4).setSelfStatus(e)}},{key:\"getUserStatus\",value:function(e){return this._get(4).getUserStatus(e)}},{key:\"subscribeUserStatus\",value:function(e){return this._get(4).subscribeUserStatus(e)}},{key:\"unsubscribeUserStatus\",value:function(e){return this._get(4).unsubscribeUserStatus(e)}},{key:\"getFriendList\",value:function(){var e=this._get(8);return e?e.getLocalFriendList():C({code:T.NO_MODULE})}},{key:\"addFriend\",value:function(e){var t=this._get(8);return t?t.addFriend(e):C({code:T.NO_MODULE})}},{key:\"deleteFriend\",value:function(e){var t=this._get(8);return t?t.deleteFriend(e):C({code:T.NO_MODULE})}},{key:\"checkFriend\",value:function(e){var t=this._get(8);return t?t.checkFriend(e):C({code:T.NO_MODULE})}},{key:\"getFriendProfile\",value:function(e){var t=this._get(8);return t?t.getFriendProfile(e):C({code:T.NO_MODULE})}},{key:\"updateFriend\",value:function(e){var t=this._get(8);return t?t.updateFriend(e):C({code:T.NO_MODULE})}},{key:\"getFriendApplicationList\",value:function(){var e=this._get(8);return e?e.getLocalFriendApplicationList():C({code:T.NO_MODULE})}},{key:\"acceptFriendApplication\",value:function(e){var t=this._get(8);return t?t.acceptFriendApplication(e):C({code:T.NO_MODULE})}},{key:\"refuseFriendApplication\",value:function(e){var t=this._get(8);return t?t.refuseFriendApplication(e):C({code:T.NO_MODULE})}},{key:\"deleteFriendApplication\",value:function(e){var t=this._get(8);return t?t.deleteFriendApplication(e):C({code:T.NO_MODULE})}},{key:\"setFriendApplicationRead\",value:function(){var e=this._get(8);return e?e.setFriendApplicationRead():C({code:T.NO_MODULE})}},{key:\"getFriendGroupList\",value:function(){var e=this._get(8);return e?e.getLocalFriendGroupList():C({code:T.NO_MODULE})}},{key:\"createFriendGroup\",value:function(e){var t=this._get(8);return t?t.createFriendGroup(e):C({code:T.NO_MODULE})}},{key:\"deleteFriendGroup\",value:function(e){var t=this._get(8);return t?t.deleteFriendGroup(e):C({code:T.NO_MODULE})}},{key:\"addToFriendGroup\",value:function(e){var t=this._get(8);return t?t.addToFriendGroup(e):C({code:T.NO_MODULE})}},{key:\"removeFromFriendGroup\",value:function(e){var t=this._get(8);return t?t.removeFromFriendGroup(e):C({code:T.NO_MODULE})}},{key:\"renameFriendGroup\",value:function(e){var t=this._get(8);return t?t.renameFriendGroup(e):C({code:T.NO_MODULE})}},{key:\"followUser\",value:function(e){var t=this._get(35);return t?t.followUser(e):C({code:T.NO_MODULE})}},{key:\"unfollowUser\",value:function(e){var t=this._get(35);return t?t.unfollowUser(e):C({code:T.NO_MODULE})}},{key:\"getMyFollowersList\",value:function(e){var t=this._get(35);return t?t.getMyFollowersList(e):C({code:T.NO_MODULE})}},{key:\"getMyFollowingList\",value:function(e){var t=this._get(35);return t?t.getMyFollowingList(e):C({code:T.NO_MODULE})}},{key:\"getMutualFollowersList\",value:function(e){var t=this._get(35);return t?t.getMutualFollowersList(e):C({code:T.NO_MODULE})}},{key:\"getUserFollowInfo\",value:function(e){var t=this._get(35);return t?t.getUserFollowInfo(e):C({code:T.NO_MODULE})}},{key:\"checkFollowType\",value:function(e){var t=this._get(35);return t?t.checkFollowType(e):C({code:T.NO_MODULE})}},{key:\"getGroupList\",value:function(){var e=this._get(7);return e?e.getGroupList():C({code:T.NO_MODULE})}},{key:\"getGroupProfile\",value:function(e){var t=this._get(7);return t?t.getGroupProfile(e):C({code:T.NO_MODULE})}},{key:\"createGroup\",value:function(e){var t=this._get(7);return t?t.createGroup(e):C({code:T.NO_MODULE})}},{key:\"dismissGroup\",value:function(e){var t=this._get(7);return t?t.dismissGroup(e):C({code:T.NO_MODULE})}},{key:\"updateGroupProfile\",value:function(e){var t=this._get(7);return t?t.updateGroupProfile(e):C({code:T.NO_MODULE})}},{key:\"joinGroup\",value:function(e){var t=this._get(7);return t?t.joinGroup(e):C({code:T.NO_MODULE})}},{key:\"quitGroup\",value:function(e){var t=this._get(7);return t?t.quitGroup(e):C({code:T.NO_MODULE})}},{key:\"searchGroupByID\",value:function(e){var t=this._get(7);return t?t.searchGroupByID(e):C({code:T.NO_MODULE})}},{key:\"getGroupOnlineMemberCount\",value:function(e){var t=this._get(7);return t?t.getGroupOnlineMemberCount(e):C({code:T.NO_MODULE})}},{key:\"changeGroupOwner\",value:function(e){var t=this._get(7);return t?t.changeGroupOwner(e):C({code:T.NO_MODULE})}},{key:\"getGroupApplicationList\",value:function(){var e=this._get(7);return e?e.getGroupApplicationList():C({code:T.NO_MODULE})}},{key:\"handleGroupApplication\",value:function(e){var t=this._get(7);return t?t.handleGroupApplication(e):C({code:T.NO_MODULE})}},{key:\"initGroupAttributes\",value:function(e){var t=this._get(7);return t?t.initGroupAttributes(e):C({code:T.NO_MODULE})}},{key:\"setGroupAttributes\",value:function(e){var t=this._get(7);return t?t.setGroupAttributes(e):C({code:T.NO_MODULE})}},{key:\"deleteGroupAttributes\",value:function(e){var t=this._get(7);return t?t.deleteGroupAttributes(e):C({code:T.NO_MODULE})}},{key:\"getGroupAttributes\",value:function(e){var t=this._get(7);return t?t.getGroupAttributes(e):C({code:T.NO_MODULE})}},{key:\"setGroupCounters\",value:function(e){var t=this._get(7);return t?t.setGroupCounters(e):C({code:T.NO_MODULE})}},{key:\"increaseGroupCounter\",value:function(e){var t=this._get(7);return t?t.increaseGroupCounter(e):C({code:T.NO_MODULE})}},{key:\"decreaseGroupCounter\",value:function(e){var t=this._get(7);return t?t.decreaseGroupCounter(e):C({code:T.NO_MODULE})}},{key:\"getGroupCounters\",value:function(e){var t=this._get(7);return t?t.getGroupCounters(e):C({code:T.NO_MODULE})}},{key:\"getGroupMemberList\",value:function(e){var t=this._get(7);return t?t.getGroupMemberList(e):C({code:T.NO_MODULE})}},{key:\"getGroupMemberProfile\",value:function(e){var t=this._get(7);return t?t.getGroupMemberProfile(e):C({code:T.NO_MODULE})}},{key:\"addGroupMember\",value:function(e){var t=this._get(7);return t?t.addGroupMember(e):C({code:T.NO_MODULE})}},{key:\"deleteGroupMember\",value:function(e){var t=this._get(7);return t?t.deleteGroupMember(e):C({code:T.NO_MODULE})}},{key:\"setGroupMemberMuteTime\",value:function(e){var t=this._get(7);return t?t.setGroupMemberMuteTime(e):C({code:T.NO_MODULE})}},{key:\"setGroupMemberRole\",value:function(e){var t=this._get(7);return t?t.setGroupMemberRole(e):C({code:T.NO_MODULE})}},{key:\"setGroupMemberNameCard\",value:function(e){var t=this._get(7);return t?t.setGroupMemberNameCard(e):C({code:T.NO_MODULE})}},{key:\"setGroupMemberCustomField\",value:function(e){var t=this._get(7);return t?t.setGroupMemberCustomField(e):C({code:T.NO_MODULE})}},{key:\"markGroupMemberList\",value:function(e){var t=this._get(7);return t?t.markGroupMemberList(e):C({code:T.NO_MODULE})}},{key:\"getJoinedCommunityList\",value:function(){return this._get(10).getJoinedCommunityList()}},{key:\"createTopicInCommunity\",value:function(e){return this._get(10).createTopicInCommunity(e)}},{key:\"deleteTopicFromCommunity\",value:function(e){return this._get(10).deleteTopicFromCommunity(e)}},{key:\"updateTopicProfile\",value:function(e){return this._get(10).updateTopicProfile(e)}},{key:\"getTopicList\",value:function(e){return this._get(10).getTopicList(e)}},{key:\"addSignalingListener\",value:function(e,t,n){var o=this._get(33);o&&o.addSignalingListener(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:\"removeSignalingListener\",value:function(e,t,n){var o,i=this._safetyCallbackFactory.find(e,t);null===i||(o=this._get(33))&&(o.removeSignalingListener(e,i,n),this._safetyCallbackFactory.delete(e,t))}},{key:\"invite\",value:function(e){var t=this._get(33);return t?t.invite(e):C({code:T.NO_MODULE})}},{key:\"inviteSync\",value:function(e,t,n){var o=this._get(33);return o?o.inviteSync(e,t,n):\"\"}},{key:\"inviteInGroup\",value:function(e){var t=this._get(33);return t?t.invite(e):C({code:T.NO_MODULE})}},{key:\"inviteInGroupSync\",value:function(e,t,n){var o=this._get(33);return o?o.inviteSync(e,t,n):\"\"}},{key:\"cancel\",value:function(e){var t=this._get(33);return t?t.cancel(e):C({code:T.NO_MODULE})}},{key:\"accept\",value:function(e){var t=this._get(33);return t?t.accept(e):C({code:T.NO_MODULE})}},{key:\"reject\",value:function(e){var t=this._get(33);return t?t.reject(e):C({code:T.NO_MODULE})}},{key:\"getSignalingInfo\",value:function(e){var t=this._get(33);return t?t.getSignalingInfo(e):null}},{key:\"modifyInvitation\",value:function(e){var t=this._get(33);return t?t.modifyInvitation(e):C({code:T.NO_MODULE})}}]),Jc),jc={login:1,logout:1,getLoginUser:1,destroy:1,on:1,off:1,ready:1,setLogLevel:1,joinGroup:1,quitGroup:1,registerPlugin:1,getGroupOnlineMemberCount:1,isReady:1,addSignalingListener:1,removeSignalingListener:1,callExperimentalAPI:1};function Jc(e){d(this,Jc);e={SDKAppID:e.SDKAppID,unlimitedAVChatRoom:e.unlimitedAVChatRoom||!1,scene:e.scene||\"\",oversea:e.oversea||!1,instanceID:Ut(),devMode:e.devMode||!1,testEnv:e.testEnv||!1,proxyServer:e.proxyServer||void 0,fileUploadProxy:e.fileUploadProxy||void 0,fileDownloadProxy:e.fileDownloadProxy||e.fileUploadProxy||void 0,eventThrottling:!1!==e.eventThrottling,partialUpdatedConversations:!0===e.partialUpdatedConversations,disableIndependentDomain:!0===e.disableIndependentDomain,modules:e.modules||void 0};this._m=new Kc(e),this._safetyCallbackFactory=new Yc(this._m)}function zc(e){d(this,zc),this._funcMap=new Map,this._m=e,this._n=\"SafetyCallback\",this._reportCount=0}function Xc(t){var n=this;d(this,Xc);var o,e=new M(\"sdkConstruct\"),i=(this._n=\"ModuleManager\",this._isReady=!1,this._reason=T.USER_NOT_LOGGED_IN,this._startLoginTs=0,this._map=new Map,this._optionalModuleMap=new Map,this._codeMsgForTUIMap=new Map,this._iEmitter=null,this._oEmitter=null,this._checkCount=0,this._checkTimer=-1,this._map.set(12,new wi(this,t)),this._map.set(37,new Pc(this)),this._map.set(15,new Ia(this)),this._map.set(27,new lr(this)),this._map.set(23,new Js(this)),this._map.set(24,new cr(this)),this._map.set(26,new er(this)),this._map.set(21,new ms(this)),this._map.set(20,new js(this)),this._map.set(1,new qi(this)),this._map.set(2,new Ba(this)),this._map.set(3,new Ka(this)),this._map.set(34,new Ya(this)),this._map.set(31,new Wa(this)),this._map.set(4,new bi(this)),this._map.set(6,new Yo(this)),this._map.set(11,new gi(this)),this._map.set(7,new ki(this)),this._map.set(10,new Oi(this)),this._map.set(13,new ha(this)),this._map.set(32,new gr(this)),this._map.set(14,new fa(this)),this._map.set(17,new Ra(this)),this._map.set(18,new ja(this)),this._map.set(19,new Ja(this)),this._map.set(25,new zs(this)),this._map.set(8,new rr(this)),this._map.set(28,new dr(this)),this._map.set(36,new pr(this)),this._map.set(29,new _r(this)),this._map.set(30,new hr(this)),this._map.set(33,new Cr(this)),this._map.set(35,new Lr(this)),this._map.set(38,new Bc(this)),this._eventThrottleMap=new Map,this._eventThrottling=t.eventThrottling,this._map.get(12).isPartialUpdatedConvs()&&(this._eventThrottling=!1),et(t.modules)?(Object.keys(t.modules).forEach(function(e){o=t.modules[e],\"group-module\"===e?n._map.set(7,new o(n)):\"relationship-module\"===e?n._map.set(8,new o(n)):\"signaling-module\"===e?n._map.set(33,new o(n)):\"follow-module\"===e?n._map.set(35,new o(n)):\"cloud-search-module\"===e&&n._map.set(38,new o(n)),n._optionalModuleMap.set(e,1)}),this._map.get(12).setUsingChatCore(!0)):this._map.has(7)||this._map.get(12).setUsingChatCore(!0),t.instanceID),a=t.SDKAppID,s=this._map.get(12).isIntl(),r=this._map.get(12).isUsingChatCore(),i=\"instanceID:\".concat(i,\" SDKAppID:\").concat(a,\" isIntl:\").concat(s,\" isUsingChatCore:\").concat(r,\" host:\").concat(bt())+\" isIOSWebView:\".concat(De,\" platform:\").concat(de,\" canIUseInflate:\").concat(this.canIUseInflate())+\" workerAvailable:\".concat(ye,\" eventThrottling:\").concat(this._eventThrottling,\" UserAgent:\").concat(le);M.bindEventStatModule(this._map.get(14)),M.bindNetMonitorModule(this._map.get(15)),e.setMessage(\"\".concat(i,\" \").concat(function(){var t=\"\";if(ae)try{var e=ue.getSystemInfoSync(),n=e.model,o=e.version,i=e.system,a=e.platform,s=e.SDKVersion,t=\"model:\".concat(n,\" version:\").concat(o,\" system:\").concat(i,\" platform:\").concat(a,\" SDKVersion:\").concat(s)}catch(e){t=\"\"}return t}())).end(),v.i(\"SDK \".concat(i)),Bn.prototype._getErrMsg=this.getErrMsg.bind(this),this._readyList=void 0,this._ssoLogForReady=null,this._initReadyList()}function Zc(e){return d(this,Zc),(e=Nc.call(this,e))._n=\"CSModule\",e}function Qc(e){d(this,Qc),this._m=e,this._n=\"InflateModule\",this._bLogForInflateOK=!1,this._bLogForInflateError=!1}var $c={},oe={};return oe.create=function(e){var t=\"TencentCloudChat.create\",n=0,o=e.SDKAppID;if(Qe(o))n=o;else if(n=parseInt(o),isNaN(o))return v.e(\"\".concat(t,\" failed. Failed to parse the SDKAppID, please check the arguments\")),null;if(n&&$c[n])return $c[n];v.l(\"\".concat(t));var i,a,o=new Wc(y(y({},e),{},{SDKAppID:n})),e=(o.on(G.SDK_DESTROY,function(e){$c[e.data.SDKAppID]=null,delete $c[e.data.SDKAppID]}),i=o,a=Object.create(null),Object.keys(Hn).forEach(function(o){var t;i[o]&&(t=new U,a[o]=function(){var e=Array.from(arguments);return t.use(function(e,t){var n=function(e,t){if(e.isReady()||1===jc[t])return!0;var n={code:n=e.getNotReadyReason(),message:\"\".concat(e.getErrMsg(n),\" | \").concat(t,\" | \").concat(e.getErrMsg(T.SDK_IS_NOT_READY))};return e.onError(n),n}(i,o);return!0===n?t():C(n)}).use(function(e,t){if(!0===function(n,o,i){if(void 0===o)return!0;var a=!0;if(et(o))Object.keys(o).forEach(function(e){var t=1===n.length?n[0][e]:void 0;a=!!en(t,o[e],i,e)&&a});else if(nt(o))for(var e=0;e