@rongcloud/imlib-v2-adapter 5.18.0 → 5.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +2 -2
- package/index.cjs.js +2 -2
- package/index.d.ts +82 -80
- package/index.esm.js +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getMessageTypeDescription as e,NotificationStatus as t,usingCppEngine as n,ReceivedStatus as a,MessageDirection as o,assert as r,AssertRules as s,ConversationListFilterType as i,ErrorCode as c,LogTagId as l,trans2NotificationLevel as u,trans2IReceivedStatusInfo as g,trans2NotificationStatus as d,UploadMethod as f,isArray as h,ConversationType as p,VersionManage as C,AppStorage as b,APIContext as v,logger as m}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,LogSource,MessageBlockType,MessageDirection,NotificationStatus,RCConnectionStatus,RTCApiType,RTCMode,ReceivedStatus,UploadMethod,logger}from"@rongcloud/engine";var y;!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(y||(y={}));var I,S=y;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(I||(I={}));var R=I,M=function(){return M=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)};
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function R(e,t,n,o){return new(n||(n=Promise))((function(a,s){function r(e){try{i(o.next(e))}catch(e){s(e)}}function c(e){try{i(o.throw(e))}catch(e){s(e)}}function i(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,c)}i((o=o.apply(e,t||[])).next())}))}function M(e,t){var n,o,a,s,r={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=2&s[0]?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(a=r.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(6===s[0]&&r.label<a[1]){r.label=a[1],a=s;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(s);break}a[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],o=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function y(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var T=function(){function t(){}return t.set=function(n){if(e[n.messageType]&&e[n.messageType].isPersited){var o=t.get(n.conversationType,n.targetId,n.channelId||"");if(!o||o.sentTime<n.sentTime){var a=y(n.conversationType,n.targetId,n.channelId||"");t.map[a]=n}}},t.get=function(e,n,o){var a=y(e,n,o);return t.map[a]||null},t.remove=function(e,n,o){var a=y(e,n,o);delete t.map[a]},t.clear=function(){t.map={}},t.map={},t}(),E={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage","RC:RcNtf":"NotificationMessage"},N={};function O(e){var t=e.channelId,n=e.conversationType,a=e.targetId,s=e.unreadMessageCount,r=e.latestMessage,c=e.isTop,i=e.notificationStatus,g=e.matchCount;if(!o()){var d=T.get(n,a,t||"");(!r||d&&r.sentTime<d.sentTime)&&(r=d)}var l=r?U(r):null;return{channelId:t||"",conversationType:n,targetId:a,unreadMessageCount:s,latestMessage:l,latestMessageId:null==l?void 0:l.messageId,objectName:null==l?void 0:l.messageType,sentTime:null==l?void 0:l.sentTime,isTop:c,notificationStatus:i,receivedStatus:null==l?void 0:l.receivedStatus,matchCount:g}}function U(e){var n=e.conversationType,o=e.targetId,a=e.senderUserId,s=e.content,r=e.messageType,c=e.messageUId,i=e.messageDirection,g=e.isOffLineMessage,d=e.sentTime,l=e.receivedStatus,u=e.receivedTime,h=e.canIncludeExpansion,C=e.disableNotification,p=e.expansion,f=e.messageId,I=e.sentStatus,v=e.channelId,m=e.readReceiptInfo,R=e.pushConfig,M="";return r in E?M=E[r]:r in N?M=N[r]:(s={message:{content:s,objectName:r},messageName:"UnknownMessage"},M="UnknownMessage"),l||(l=t.UNREAD),void 0===f&&(f=~~(16777215*Math.random())),{channelId:v||"",conversationType:n,targetId:o,senderUserId:a,content:s,messageType:M,messageUId:c,messageDirection:i,offLineMessage:g,sentTime:d,receivedStatus:l,receivedTime:u,objectName:r,messageId:f,sentStatus:I||S.SENT,disableNotification:C,canIncludeExpansion:h,expansion:p,readReceiptInfo:m,pushConfig:R}}function _(e,t,o,a,s){var r=new Date(o-1e3*a*60*60*24).getTime()-e.sentTime<0,c=e.messageType,i=e.messageDirection;if("ReadReceiptRequestMessage"===c&&r&&i===n.SEND){var g="".concat(t).concat(e.content.messageUId,"SENT");s.set(g,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===c&&r){var d="".concat(t).concat(e.conversationType).concat(e.targetId,"RECEIVED"),l=s.get(d);if(l){if(e.senderUserId in l)return void(l[e.senderUserId].uIds&&-1===l[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(l[e.senderUserId].uIds.push(e.content.messageUId),l[e.senderUserId].dealtime=e.sentTime,l[e.senderUserId].isResponse=!1,s.set(d,l)));var u={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};return l[e.senderUserId]=u,void s.set(d,l)}var h={};h[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},s.set(d,h)}}function A(e,t,n){try{e(t,n)}catch(e){null===console||void 0===console||console.error(e)}}function B(e,t,n){try{e(t,n)}catch(e){null===console||void 0===console||console.error(e)}}var L=function(e,t,n,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0),this.messageType=e,this.objectName=t,this.content=n,this.isPersited=o,this.isCounted=a};function x(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0);var a=function(a){return new L(e,t,a,n,o)};return a.MessageType=e,a.ObjectName=t,a}var b,P,w=x("ReadReceiptResponseMessage","RC:RRRspMsg"),k=function(){function e(e,t,n,o,a,s){this.logger=e,this._context=t,this.channelId=n,this._isCPPMode=o,this._readReceiptTimeout=a,this._storage=s,this._draftMap={}}return e.prototype.getConversationList=function(e,t,n){var o=this;a("callback",e,s.CALLBACK),a("conversationTypes",t,s.ARRAY),a("count",n,s.NUMBER),this._context.getConversationList(n,void 0,0,0,this.channelId).then((function(n){var a=n.code,s=n.data,i=[];s=s||[],a===r.SUCCESS?(t?s.forEach((function(e){t.indexOf(e.conversationType)>-1&&i.push(O(e))})):s.forEach((function(e){i.push(O(e))})),A(e.onSuccess,i)):(o.logger.warn(c.O,"getConversationList -> code:".concat(a)),B(e.onError,a))}))},e.prototype.getConversation=function(e,t,n){var o=this;a("callback",n,s.CALLBACK),a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),this.logger.info(c.O,"getConversation ->targetId:".concat(t,",conversationType:").concat(e)),R(o,void 0,void 0,(function(){var o,a,s;return M(this,(function(i){switch(i.label){case 0:return[4,this._context.getConversation(e,t,this.channelId)];case 1:return o=i.sent(),a=o.code,s=o.data,a!==r.SUCCESS?(this.logger.warn(c.O,"getConversation ->code:".concat(a,",targetId:").concat(t)),n.onError(a),[2]):(n.onSuccess(s?O(s):null),[2])}}))}))},e.prototype.removeConversation=function(e,t,n){var o=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"removeConversation ->targetId:".concat(t,",conversationType:").concat(e)),this._context.removeConversation(e,t,this.channelId).then((function(a){a===r.SUCCESS?(o._isCPPMode||T.remove(e,t,o.channelId),A(n.onSuccess)):(o.logger.warn(c.O,"removeConversation ->code:".concat(a,",targetId:").concat(t)),B(n.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,t,n){a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("draftText",n,s.STRING,!0),this.logger.info(c.O,"saveTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&((this._draftMap[o]=this._draftMap[o]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]=n,!0)},e.prototype.getTextMessageDraft=function(e,t){a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),this.logger.info(c.O,"getTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();if(n)return(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,t){a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),this.logger.info(c.O,"clearTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&delete(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,t,n){var o=this;a("callback",e,s.CALLBACK),this.logger.info(c.O,"getTotalUnreadCount ->conversationTypes:".concat(t)),this._context.getTotalUnreadCount(this.channelId,t,n).then((function(t){var n=t.code,a=t.data;n===r.SUCCESS?A(e.onSuccess,a):(o.logger.warn(c.O,"getTotalUnreadCount ->code:".concat(n)),B(e.onError,n))}))},e.prototype.getUnreadCount=function(e,t,n){var o=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"getUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadCount(e,t,this.channelId).then((function(e){var a=e.code,s=e.data;a===r.SUCCESS?A(n.onSuccess,s):(o.logger.warn(c.O,"getUnreadCount ->code:".concat(a,",targetId:").concat(t)),B(n.onError,a))}))},e.prototype.clearConversations=function(e,t){var n=this;this.logger.info(c.O,"clearConversations -> conversationTypes:".concat(t)),this._isCPPMode?this._context.clearConversations(t,this.channelId).then((function(t){t===r.SUCCESS?A(e.onSuccess,!0):(n.logger.warn(c.O,"clearConversations ->code:".concat(t)),B(e.onError,t))})):this.logger.error(c.O,"Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,t,n){var o=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"clearUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCount(e,t,this.channelId).then((function(e){e===r.SUCCESS?A(n.onSuccess,!0):(o.logger.warn(c.O,"clearUnreadCount ->code:".concat(e,",targetId:").concat(t)),B(n.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){var t=this;a("callback",e,s.CALLBACK),this.logger.info(c.O,"clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(n){n===r.SUCCESS?A(e.onSuccess,!0):(t.logger.warn(c.O,"clearUnreadCount ->code:".concat(n)),B(e.onError,n))}))},e.prototype.getFirstUnreadMessage=function(e,t,n){var o=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"getFirstUnreadMessage ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,t,this.channelId).then((function(e){e.code===r.SUCCESS?A(n.onSuccess,e.data?U(e.data):null):(o.logger.warn(c.O,"getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(t)),B(n.onError,e.code))}))},e.prototype.setConversationStatus=function(e,t,n,o){var i=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("callback",o,s.CALLBACK),a("status",n,s.OBJECT,!0),this.logger.info(c.O,"setConversationStatus ->targetId:".concat(t,",status:").concat(n));var g=n.isTop,d=n.notificationStatus;this._context.setConversationStatus(e,t,g,d,this.channelId).then((function(e){e===r.SUCCESS?A(o.onSuccess):(i.logger.warn(c.O,"setConversationStatus ->code:".concat(e,",targetId:").concat(t)),B(o.onError,e))}))},e.prototype.sendMessage=function(e,o,g,d,l,u,h,C){var p=this;a("conversationType",e,s.NUMBER,!0),a("targetId",o,s.STRING,!0),a("msg",g,s.OBJECT,!0),a("callback",d,s.CALLBACK),a("isMentioned",l,s.BOOLEAN),a("pushContent",u,s.ONLY_STRING),a("pushData",h,s.ONLY_STRING),a("options.userIds",null==C?void 0:C.userIds,s.ARRAY),a("options.isVoipPush",null==C?void 0:C.isVoipPush,s.BOOLEAN),a("options.disableNotification",null==C?void 0:C.disableNotification,s.BOOLEAN),a("options.canIncludeExpansion",null==C?void 0:C.canIncludeExpansion,s.BOOLEAN),a("options.expansion",null==C?void 0:C.expansion,s.OBJECT),a("options.pushConfig",null==C?void 0:C.pushConfig,s.OBJECT),a("options.resendMessageId",null==C?void 0:C.resendMessageId,s.NUMBER),this.logger.info(c.O,"sendMessage ->targetId:".concat(o,",conversationType:").concat(e));var f=!(!(null==C?void 0:C.isStatusMessage)&&!(null==C?void 0:C.isStatus)),I=function(e,t,n){var o,a=e||{},s=a.userIds,r=a.isVoipPush,c=a.disableNotification,i=a.isFilerWhiteBlacklist,g=a.expansion,d=a.canIncludeExpansion,l=a.pushConfig,u=a.resendMessageId,h=[];if(t){var C=(n||{}).content.mentionedInfo;h=C.userIdList,o=C.type}return{mentionedType:o,mentionedUserIdList:h,directionalUserIdList:s,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:g,canIncludeExpansion:d,pushConfig:l,messageId:u}}(C,l,g);u=u||"",h=h||"";var v=Object.assign(g,m(m({isMentioned:l,pushContent:u,pushData:h},I),{messageType:g.objectName,channelId:this.channelId,isStatusMessage:f})),R=this._context.getCurrentUserId(),M=this.logger.createTraceId();this.logger.info(c.A_SEND_MSG_T,JSON.stringify({messageType:v.messageType,conversationType:e,targetId:o,channelId:this.channelId}),M),this._context.sendMessage(e,o,v,d.onBefore,M).then((function(a){var s=a.code,l=a.data,u=s===r.SUCCESS?"info":"warn";if(p.logger[u](c.A_SEND_MSG_R,JSON.stringify({code:s,messageUId:l?l.messageUId:"",messageId:l?l.messageId:""}),M),s===r.SUCCESS){p._isCPPMode||T.set(l);var h=U(l);_(h,R,p._context.getConnectedTime(),p._readReceiptTimeout,p._storage),A(d.onSuccess,h)}else p.logger.warn(c.O,"sendMessage ->code:".concat(s,",targetId:").concat(o)),B(d.onError,s,U({isMentioned:!!v.isMentioned,content:g.content,messageType:g.messageType,isPersited:g.isPersited,isCounted:g.isCounted,disableNotification:!!(null==C?void 0:C.disableNotification),canIncludeExpansion:!!(null==C?void 0:C.canIncludeExpansion),expansion:(null==C?void 0:C.expansion)||null,conversationType:e,targetId:o,senderUserId:R,messageUId:"",messageDirection:n.SEND,isOffLineMessage:!1,sentTime:(null==l?void 0:l.sentTime)||0,receivedTime:0,isStatusMessage:f,receivedStatus:t.UNREAD,receivedStatusInfo:i(t.UNREAD),messageId:null==l?void 0:l.messageId,sentStatus:S.FAILED}))}))},e.prototype.sendRecallMessage=function(e,t,n){var o=this;a("message.conversationType",e.conversationType,s.NUMBER,!0),a("message.targetId",e.targetId,s.STRING,!0),a("message.messageUId",e.messageUId,s.STRING,!0),a("message.sentTime",e.sentTime,s.NUMBER,!0),a("callback",t,s.CALLBACK),a("options.disableNotification",null==n?void 0:n.disableNotification,s.BOOLEAN),a("options.pushConfig",null==n?void 0:n.pushConfig,s.OBJECT),a("options.extra",null==n?void 0:n.extra,s.STRING);var i=e.conversationType,g=e.targetId,d=e.messageUId,l=e.sentTime;this.logger.info(c.O,"sendRecallMessage ->targetId:".concat(g,",conversationType:").concat(i,",messageUId:").concat(d));var u={conversationType:i,targetId:g,channelId:this.channelId},h=m({messageUId:d,sentTime:l},n);this._context.recallMessage(u,h).then((function(e){var n=e.code,a=e.data;n===r.SUCCESS?(o._isCPPMode||T.set(a),A(t.onSuccess,U(a))):(o.logger.warn(c.O,"sendRecallMessage ->code:".concat(n,",targetId:").concat(g,",messageUId:").concat(d)),B(t.onError,n))}))},e.prototype.sendTypingStatusMessage=function(e,t,n,o){var i=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("typingContentType",n,s.STRING,!0),a("callback",o,s.CALLBACK),this.logger.info(c.O,"sendTypingStatusMessage ->targetId:".concat(t,",conversationType:").concat(e));var g={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:this.channelId},d=this.logger.createTraceId();this.logger.info(c.A_SEND_MSG_T,JSON.stringify({messageType:g.messageType,conversationType:e,targetId:t,channelId:g.channelId}),d),this._context.sendMessage(e,t,g,void 0,d).then((function(e){var n=e.code,a=e.data,s=n===r.SUCCESS?"info":"warn";i.logger[s](c.A_SEND_MSG_R,JSON.stringify({code:n,messageUId:a?a.messageUId:"",messageId:a?a.messageId:""}),d),n===r.SUCCESS?A(o.onSuccess,U(a)):(i.logger.warn(c.O,"sendTypingStatusMessage ->code:".concat(n,",targetId:").concat(t)),B(o.onError,n))}))},e.prototype.sendReceiptResponse=function(e,t,n){var o=this;this.logger.info(c.O,"sendReceiptResponse ->targetId:".concat(t,",conversationType:").concat(e));var a=this._context.getCurrentUserId(),s="".concat(a).concat(e).concat(t,"RECEIVED"),r=this._storage.get(s);if(r){var i=[];for(var g in r){var d={};d[g]=r[g].uIds,r[g].isResponse||i.push(d)}if(0===i.length)return void n.onSuccess(null);var l=setInterval((function(){1===i.length&&clearInterval(l);var a=i.splice(0,1)[0],g=new w({receiptMessageDic:a});o.sendMessage(e,t,g,{onSuccess:function(e){var t=Object.keys(a)[0];r[t].isResponse=!0,o._storage.set(s,r),A(n.onSuccess,e)},onError:function(e){o.logger.warn(c.O,"sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),B(n.onError,e)}})}),200)}else n.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,t,n){var o,i,g=this;a("messageUIds",e,s.ARRAY,!0),a("targetId",t,s.STRING,!0),this.logger.info(c.O,"sendReadReceiptMessage ->targetId:".concat(t,",messageUIds:").concat(e));try{for(var d=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),l=d.next();!l.done;l=d.next()){var u=l.value;a("messageUId",u,s.STRING)}}catch(e){o={error:e}}finally{try{l&&!l.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}this._context.sendReadReceiptMessage(t,e,this.channelId).then((function(o){var a=o.code;a===r.SUCCESS?n.onSuccess():(g.logger.warn(c.O,"sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(a))})).catch((function(o){g.logger.warn(c.O,"sendReadReceiptMessage ->code:".concat(o,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(o)}))},e.prototype.getMessageReader=function(e,t,n){var o=this;a("messageUId",e,s.STRING,!0),a("targetId",t,s.STRING,!0),this.logger.info(c.O,"getMessageReader ->targetId:".concat(t,",messageUId:").concat(e)),this._context.getMessageReader(t,e,this.channelId).then((function(a){var s=a.code,i=a.data;s===r.SUCCESS?n.onSuccess(i):(o.logger.warn(c.O,"getMessageReader ->code:".concat(s,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(s))})).catch((function(a){o.logger.warn(c.O,"getMessageReader ->code:".concat(a,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(a)}))},e.prototype.updateMessageExpansion=function(e,t,n){var o=this;a("expansion",e,s.OBJECT,!0),a("message",t,s.OBJECT,!0);var i=t.conversationType,g=t.targetId,d=t.messageUId,l=t.canIncludeExpansion,u=t.expansion,h=t.objectName;this.logger.info(c.O,"updateMessageExpansion ->targetId:".concat(g,",messageUId:").concat(d,",conversationType:").concat(i)),this._context.sendExpansionMessage({messageType:h,conversationType:i,targetId:g,messageUId:d,canIncludeExpansion:l,originExpansion:u,expansion:e,channelId:this.channelId}).then((function(e){var t=e.code;t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"updateMessageExpansion ->code:".concat(t,",targetId:").concat(g,",messageUId:").concat(d)),B(n.onError,t))}))},e.prototype.removeMessageExpansionForKey=function(e,t,n){var o=this;a("keys",e,s.ARRAY,!0),a("message",t,s.OBJECT,!0);var i=t.conversationType,g=t.targetId,d=t.messageUId,l=t.canIncludeExpansion,u=t.objectName;this.logger.info(c.O,"removeMessageExpansionForKey ->targetId:".concat(g,",messageUId:").concat(d,",conversationType:").concat(i)),this._context.sendExpansionMessage({conversationType:i,targetId:g,messageUId:d,canIncludeExpansion:l,keys:e,channelId:this.channelId,messageType:u}).then((function(e){var t=e.code;t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"removeMessageExpansionForKey ->code:".concat(t,",targetId:").concat(g,",messageUId:").concat(d)),B(n.onError,t))}))},e.prototype.getHistoryMessages=function(e,t,n,o,i,g,d){var l=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("timestamp",n,s.NUMBER,!0),a("count",o,s.NUMBER,!0),a("callback",i,s.CALLBACK,!0),a("order",d,s.NUMBER),this.logger.info(c.O,"getHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n));var u=this.logger.createTraceId();this.logger.info(c.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:"",timestamp:n,count:o}),u),this._context.getHistoryMessage(e,t,n,o,d,this.channelId,g,u).then((function(e){var t=e.code,n=e.data;if(t===r.SUCCESS)if(n){var o=n.list,a=n.hasMore,s=[],g=o.map((function(e){return s.push(e.messageUId),U(e)}));l.logger.info(c.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:s.join(",")}),u),A(i.onSuccess,g,a)}else l.logger.info(c.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:""}),u),A(i.onSuccess,[],!1);else l.logger.warn(c.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:""}),u),B(i.onError,t)}))},e.prototype.deleteRemoteMessages=function(e,t,n,o){var i=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("messages",n,s.ARRAY,!0),a("callback",o,s.CALLBACK),this.logger.info(c.O,"deleteRemoteMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,t,n,this.channelId).then((function(a){if(a===r.SUCCESS){if(!i._isCPPMode){var s=T.get(e,t,i.channelId);s&&n.forEach((function(n){s.messageUId===n.messageUId&&T.remove(e,t,i.channelId)}))}A(o.onSuccess)}else i.logger.warn(c.O,"deleteRemoteMessages ->code:".concat(a,",targetId:").concat(t)),B(o.onError,a)}))},e.prototype.clearRemoteHistoryMessages=function(e,t){var n=this;a("param.conversationType",e.conversationType,s.NUMBER,!0),a("param.targetId",e.targetId,s.STRING,!0),a("param.timestamp",e.timestamp,s.NUMBER,!0),a("callback",t,s.CALLBACK);var o=e.conversationType,i=e.targetId,g=e.timestamp;this.logger.info(c.O,"clearRemoteHistoryMessages ->targetId:".concat(i,",conversationType:").concat(o)),this._context.deleteRemoteMessageByTimestamp(o,i,g,this.channelId).then((function(e){e===r.SUCCESS?A(t.onSuccess):(n.logger.warn(c.O,"clearRemoteHistoryMessages ->code:".concat(e)),B(t.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){a("callback",e,s.CALLBACK),this._context.getConversationListWithAllChannel().then((function(t){var n=t.code,o=t.data;n===r.SUCCESS?A(e.onSuccess,o.map(O)):B(e.onError,n)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){a("callback",e,s.CALLBACK),a("index",t,s.NUMBER),a("limit",n,s.NUMBER),this._context.getConversationListWithAllChannelByPage(t,n).then((function(t){var n=t.code,o=t.data;n===r.SUCCESS?A(e.onSuccess,o.map(O)):B(e.onError,n)}))},e.prototype.insertMessage=function(e,t,n,o,a){var s=this;void 0===a&&(a={});var i=n.senderUserId,g=n.objectName,d=n.content,l=n.messageDirection,u=n.canIncludeExpansion,h=n.expansion,C=n.disableNotification,p=n.sentTime,f=n.sentStatus;this.logger.info(c.O,"insertMessage ->targetId:".concat(t,",conversationType:").concat(e));var I=a.isUnread,S={senderUserId:i,messageType:g,content:d,messageDirection:l,sentTime:p,sentStatus:f,searchContent:a.searchContent,isUnread:I,messageUId:"",disableNotification:C,canIncludeExpansion:u,expansionMsg:JSON.stringify(h),channelId:this.channelId};this._context.insertMessage(e,t,S).then((function(e){var n=e.code,a=e.data;n===r.SUCCESS?A(o.onSuccess,U(a)):(s.logger.warn(c.O,"insertMessage ->code:".concat(n,",targetId:").concat(t)),B(o.onError,n))}))},e.prototype.batchInsertMessage=function(e,t,n){this._context.batchInsertMessage(e,t).then((function(e){var t=e.code,o=e.data;t===r.SUCCESS?A(n.onSuccess,o):B(n.onError,t)}))},e.prototype.getMessageCount=function(e,t,n){this._context.getMessageCount(e,t).then((function(e){var t=e.code,o=e.data;t===r.SUCCESS?A(n.onSuccess,o):B(n.onError,t)}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,a){var s=this;this.logger.info(c.O,"deleteLocalMessagesByTimestamp ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n)),this._context.deleteMessagesByTimestamp(e,t,n,o,this.channelId).then((function(e){e===r.SUCCESS?A(a.onSuccess,!0):(s.logger.warn(c.O,"deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(t)),B(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,a,s){var i=this;this.logger.info(c.O,"getRemoteHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e));var g=s.order||0;this._context.getRemoteHistoryMessages(e,t,n,o,g,this.channelId).then((function(e){var n=e.code,o=e.data;if(n===r.SUCCESS)if(o){var s=o.list,g=o.hasMore,d=s.map((function(e){return U(e)}));A(a.onSuccess,d,g)}else A(a.onSuccess,[],!1);else i.logger.warn(c.O,"getRemoteHistoryMessages ->code:".concat(n,",targetId:").concat(t)),B(a.onError,n)}))},e.prototype.clearMessages=function(e,t,n){var o=this;this.logger.info(c.O,"clearMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearMessages(e,t,this.channelId).then((function(a){a===r.SUCCESS?(o._isCPPMode||T.remove(e,t,o.channelId),A(n.onSuccess,!0)):(o.logger.warn(c.O,"clearMessages ->code:".concat(a,",targetId:").concat(t)),B(n.onError,a))}))},e.prototype.searchConversationByContent=function(e,t,n,o){var a=this;this.logger.info(c.O,"searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,o,this.channelId,n).then((function(n){var o=n.code,s=n.data,i=[];s=s||[],o===r.SUCCESS?(s.forEach((function(e){i.push(O(e))})),A(t.onSuccess,i)):(a.logger.warn(c.O,"searchConversationByContent ->code:".concat(o,",keyword:").concat(e)),B(t.onError,o))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){var a=this;void 0===n&&(n=[]),this.logger.info(c.O,"searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,n,o).then((function(n){var o=n.code,s=n.data,i=[];s=s||[],o===r.SUCCESS?(s.forEach((function(e){i.push(O(e))})),A(t.onSuccess,i)):(a.logger.warn(c.O,"searchConversationByContentWithAllChannel ->code:".concat(o,",keyword:").concat(e)),B(t.onError,o))}))},e.prototype.searchMessageByContent=function(e,t,n,o,a,s,i){var g=this;this.logger.info(c.O,"searchMessageByContent ->targetId:".concat(t,",conversationType:").concat(e,",keyword:").concat(n)),this._context.searchMessageByContent(e,t,n,o,a,s,this.channelId).then((function(e){var n=e.code,o=e.data,a=[];if(n===r.SUCCESS){var s=o=o||{},d=s.messages,l=s.count;d.forEach((function(e){a.push(U(e))})),A(i.onSuccess,a,l)}else g.logger.warn(c.O,"searchMessageByContent ->code:".concat(n,",targetId:").concat(t)),B(i.onError,n)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,a,s){var i=this;this.logger.info(c.O,"searchMessageByContentWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,t,n,o,a).then((function(e){var n=e.code,o=e.data,a=[];if(n===r.SUCCESS){var g=o=o||{},d=g.messages,l=g.count;d.forEach((function(e){a.push(U(e))})),A(s.onSuccess,a,l)}else i.logger.warn(c.O,"searchMessageByContentWithAllChannel ->code:".concat(n,",targetId:").concat(t)),B(s.onError,n)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,a,s,i,g){var d=this;this.logger.info(c.O,"searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", startTime: ").concat(o,", endTime: ").concat(a,", offset: ").concat(s,", limit: ").concat(i)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,a,s,i).then((function(e){var n=e.code,o=e.data,a=[];n===r.SUCCESS?((o=o||{}).messages.forEach((function(e){a.push(U(e))})),A(g.onSuccess,a)):(d.logger.warn(c.O,"searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(n,",targetId:").concat(t)),B(g.onError,n))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return this.logger.info(c.O,"getUnreadMentionedMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,t,this.channelId).map((function(e){return U(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){var a=this;this.logger.info(c.O,"clearUnreadCountByTimestamp ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,t,n,this.channelId).then((function(e){e===r.SUCCESS?A(o.onSuccess,!0):(a.logger.warn(c.O,"clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(t)),B(o.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,t,n){var o=this;this.logger.info(c.O,"getConversationNotificationStatus ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,t,this.channelId).then((function(e){var a=e.code,s=e.data;a===r.SUCCESS?A(n.onSuccess,s):(o.logger.warn(c.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(t)),B(n.onError,a))}))},e.prototype.getGroupMessageDeliverList=function(e,t,n){var o=this;this.logger.info(c.O,"getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(t)),this._context.getGroupMessageDeliverList(e,t,this.channelId).then((function(e){var a=e.code,s=e.data;a===r.SUCCESS?A(n.onSuccess,s):(o.logger.warn(c.O,"getGroupMessageDeliverList ->code:".concat(a,",messageUId:").concat(t)),B(n.onError,a))}))},e.prototype.getPrivateMessageDeliverTime=function(e,t){var n=this;this.logger.info(c.O,"getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(o){var a=o.code,s=o.data;a===r.SUCCESS?A(t.onSuccess,s):(n.logger.warn(c.O,"getPrivateMessageDeliverTime ->code:".concat(a,",messageUId:").concat(e)),B(t.onError,a))}))},e}(),G=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},D=function(){function e(e,t,n,a){this._context=e,this._options=t,this.logger=n,this._storage=a,this._channelClient={},this._isCPPMode=o(),this._defaultChannelClient=new k(this.logger,e,"",this._isCPPMode,t.readReceiptTimeout,this._storage)}return e.prototype.assertCPPMode=function(e,t,n){if(!this._isCPPMode)return null==n||n.onError(r.NOT_SUPPORT),void this.logger.error(c.O,"'".concat(t,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(this.logger.info(c.O,"getChannel ->channelId:".concat(e)),!this._isCPPMode)return this.logger.error(c.O,"getChannel method is only available in protocol stack mode"),null;if(a("channelId",e,s.STRING,!0),e.length>20)return this.logger.error(c.O,"The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return this.logger.error(c.O,"Only 1000 channels can be obtained"),null;var t=new k(this.logger,this._context,e,this._isCPPMode,this._options.readReceiptTimeout,this._storage);return this._channelClient[e]=t,t},e.prototype.deleteChannels=function(e){var t=this;a("channelIds",e,s.ARRAY,!0),this.logger.info(c.O,"deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete t._channelClient[e]}))}),"deleteChannels")},e.prototype.getNavi=function(){return this._context.getNaviInfoFromCache()||{}},e.prototype.getSDKInfo=function(){return{version:"5.18.0"}},e.prototype.getAppInfo=function(){return{appKey:this._context.appkey}},e.prototype.getCurrentUserId=function(){return this._context.getCurrentUserId()},e.prototype.disconnect=function(e){return R(this,void 0,void 0,(function(){return M(this,(function(t){switch(t.label){case 0:return this.logger.info(c.A_DISCONNECT_O),[4,this._context.disconnect(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.logout=function(){return this.disconnect()},e.prototype.clearCache=function(){},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.getConversationList=function(e,t,n){this._defaultChannelClient.getConversationList(e,t,n)},e.prototype.getConversationListWithAllChannel=function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){void 0===n&&(n=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,n)},e.prototype.getConversation=function(e,t,n){return this._defaultChannelClient.getConversation(e,t,n)},e.prototype.removeConversation=function(e,t,n){return this._defaultChannelClient.removeConversation(e,t,n)},e.prototype.saveTextMessageDraft=function(e,t,n){return this._defaultChannelClient.saveTextMessageDraft(e,t,n)},e.prototype.getTextMessageDraft=function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)},e.prototype.clearTextMessageDraft=function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)},e.prototype.getTotalUnreadCount=function(e,t,n){return this._defaultChannelClient.getTotalUnreadCount(e,t,n)},e.prototype.getUnreadCount=function(e,t,n){return this._defaultChannelClient.getUnreadCount(e,t,n)},e.prototype.getConversationUnreadCount=function(e,t){this.logger.error(c.O,"Method is deprecated")},e.prototype.clearConversations=function(e,t){return this._defaultChannelClient.clearConversations(e,t)},e.prototype.clearUnreadCount=function(e,t,n){this._defaultChannelClient.clearUnreadCount(e,t,n)},e.prototype.clearAllUnreadCount=function(e){this._defaultChannelClient.clearAllUnreadCount(e)},e.prototype.setConversationStatus=function(e,t,n,o){return this._defaultChannelClient.setConversationStatus(e,t,n,o)},e.prototype.sendMessage=function(e,t,n,o,a,s,r,c,i){return this._defaultChannelClient.sendMessage(e,t,n,o,a,s,r,i)},e.prototype.sendRecallMessage=function(e,t,n){return this._defaultChannelClient.sendRecallMessage(e,t,n)},e.prototype.sendTypingStatusMessage=function(e,t,n,o){return this._defaultChannelClient.sendTypingStatusMessage(e,t,n,o)},e.prototype.sendReceiptResponse=function(e,t,n){return this._defaultChannelClient.sendReceiptResponse(e,t,n)},e.prototype.sendReadReceiptMessage=function(e,t,n){return this._defaultChannelClient.sendReadReceiptMessage(e,t,n)},e.prototype.getMessageReader=function(e,t,n){this._defaultChannelClient.getMessageReader(e,t,n)},e.prototype.updateMessageExpansion=function(e,t,n){this._defaultChannelClient.updateMessageExpansion(e,t,n)},e.prototype.removeMessageExpansionForKey=function(e,t,n){this._defaultChannelClient.removeMessageExpansionForKey(e,t,n)},e.prototype.getHistoryMessages=function(e,t,n,o,a,s,r){return this._defaultChannelClient.getHistoryMessages(e,t,n,o,a,s,r)},e.prototype.joinChatRoom=function(e,t,n){var o=this;a("chatRoomId",e,s.STRING,!0),a("count",t,s.NUMBER,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"joinChatRoom ->chatRoomId:".concat(e));var i=this.logger.createTraceId();this.logger.info(c.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,joinExist:!1}),i),this._context.joinChatroom(e,t,i).then((function(t){var a=t===r.SUCCESS?"info":"warn";o.logger[a](c.A_JOIN_CHATROOM_R,JSON.stringify({code:t,timestamp:(new Date).getTime()}),i),t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"joinChatRoom ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))},e.prototype.quitChatRoom=function(e,t){var n=this;a("chatRoomId",e,s.STRING,!0),a("callback",t,s.CALLBACK),this.logger.info(c.O,"quitChatRoom ->chatRoomId:".concat(e));var o=this.logger.createTraceId();this.logger.info(c.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),o),this._context.quitChatroom(e).then((function(a){var s=a===r.SUCCESS?"info":"warn";n.logger[s](c.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),o),a===r.SUCCESS?A(t.onSuccess):(n.logger.warn(c.O,"quitChatRoom ->code:".concat(a,",chatRoomId:").concat(e)),B(t.onError,a))}))},e.prototype.getChatRoomInfo=function(e,t,n,o){var i=this;a("chatRoomId",e,s.STRING,!0),a("count",t,s.NUMBER,!0),a("order",n,s.NUMBER,!0),a("callback",o,s.CALLBACK),this.logger.info(c.O,"getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,t,n).then((function(t){var n=t.code,a=t.data;n===r.SUCCESS?A(o.onSuccess,{userInfos:(null==a?void 0:a.userInfos)||[],userTotalNums:(null==a?void 0:a.userCount)||0}):(i.logger.warn(c.O,"getChatRoomInfo ->code:".concat(n,",chatRoomId:").concat(e)),B(o.onError,n))}))},e.prototype.setChatroomEntry=function(e,t,n){var o=this;a("chatRoomId",e,s.STRING,!0),a("chatroomEntry",t,s.OBJECT,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,t).then((function(t){t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"setChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))},e.prototype.setChatRoomEntries=function(e,t,n){var o=this;if(a("chatRoomId",e,s.STRING,!0),function(e){e.entries.forEach((function(e){a("entry.key",e.key,s.STRING,!0),a("entry.value",e.value,s.STRING,!0)})),a("options.isAutoDelete",e.isAutoDelete,s.BOOLEAN)}(t),a("callback",n,s.CALLBACK),t.entries.length>10)B(n.onError,r.CHATROOM_KV_STORE_OUT_LIMIT);else{var i="id:".concat(e);this.logger.info(c.O,"set chatroom entry->".concat(i)),this._context.setChatroomEntries(e,t).then((function(e){var t=e.code,a=e.data;t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"set chatroom entry fail ->code+:".concat(t,",").concat(i)),B(n.onError,t,a))}))}},e.prototype.forceSetChatroomEntry=function(e,t,n){var o=this;a("chatRoomId",e,s.STRING,!0),a("chatroomEntry",t,s.OBJECT,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,t).then((function(t){t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"forceSetChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))},e.prototype.removeChatroomEntry=function(e,t,n){var o=this;a("chatRoomId",e,s.STRING,!0),a("chatroomEntry",t,s.OBJECT,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,t).then((function(t){t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"removeChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))},e.prototype.removeChatRoomEntries=function(e,t,n){var o=this;a("chatRoomId",e,s.STRING,!0),function(e){e.entries.forEach((function(e){a("key",e,s.STRING,!0)}))}(t);var i="id:".concat(e);this.logger.debug(c.O,"remove chatroom entry->".concat(i));var g=m({},t);g.entries=t.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,g).then((function(e){var t=e.code,a=e.data;t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"remove chatroom entry fail ->code+:".concat(t,",").concat(i)),B(n.onError,t,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,t,n){var o=this;a("chatRoomId",e,s.STRING,!0),a("chatroomEntry",t,s.OBJECT,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,t).then((function(t){t===r.SUCCESS?A(n.onSuccess):(o.logger.warn(c.O,"forceRemoveChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))},e.prototype.getChatroomEntry=function(e,t,n){var o=this;a("chatRoomId",e,s.STRING,!0),a("key",t,s.STRING,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(t)),this._context.getChatroomEntry(e,t).then((function(t){var a=t.code,s=t.data;a===r.SUCCESS?A(n.onSuccess,s||""):(o.logger.warn(c.O,"getChatroomEntry ->code:".concat(a,",chatRoomId:").concat(e)),B(n.onError,a))}))},e.prototype.getAllChatroomEntries=function(e,t){var n=this;a("chatRoomId",e,s.STRING,!0),a("callback",t,s.CALLBACK),this.logger.info(c.O,"getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(o){var a=o.code,s=o.data;a===r.SUCCESS?A(t.onSuccess,s):(n.logger.warn(c.O,"getAllChatroomEntries ->code:".concat(a,",chatRoomId:").concat(e)),B(t.onError,a))}))},e.prototype.getChatRoomHistoryMessages=function(e,t,n,o,i){var g=this;void 0===i&&(i=0),a("chatRoomId",e,s.STRING,!0),a("count",t,s.NUMBER,!0),a("order",n,s.NUMBER,!0),a("callback",o,s.CALLBACK),a("timestamp",i,s.NUMBER),this.logger.info(c.O,"getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,t,n,i).then((function(t){var n=t.code,a=t.data;if(n===r.SUCCESS)if(a){var s=a.list,i=a.hasMore,d=s.map((function(e){return U(e)}));A(o.onSuccess,d,i)}else A(o.onSuccess,[],!1);else g.logger.warn(c.O,"getChatRoomHistoryMessages ->code:".concat(n,",chatRoomId:").concat(e)),B(o.onError,n)}))},e.prototype.setDeviceInfo=function(e){},e.prototype.getCurrentConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.deleteRemoteMessages=function(e,t,n,o){return this._defaultChannelClient.deleteRemoteMessages(e,t,n,o)},e.prototype.clearRemoteHistoryMessages=function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)},e.prototype.getFileToken=function(e,t,n,o,r){a("fileType",e,s.NUMBER,!0),a("fileName",n,s.STRING),a("callback",t,s.CALLBACK),this.logger.info(c.O,"getFileToken ->fileType:".concat(e,",fileName:").concat(n,",queryString:").concat(r)),this._context.getFileToken(e,n,o,r).then((function(e){t.onSuccess(m(m({},e),{bos:""}))})).catch(t.onError)},e.prototype.getFileUrl=function(e,t,n,o,r,i){a("fileType",e,s.NUMBER,!0),a("fileName",t,s.STRING,!0),a("saveName",n,s.STRING),a("callback",o,s.CALLBACK),a("serverType",i,s.NUMBER),a("uploadRes",r,s.OBJECT),this.logger.info(c.O,"getFileUrl ->fileType:".concat(e,",fileName:").concat(t)),r?o.onSuccess(r):this._context.getFileUrl(e,t,i||g.QINIU,n).then(o.onSuccess).catch(o.onError)},e.prototype.createTag=function(e,t){var n=this;a("tag.tagId",e.tagId,s.STRING,!0),a("tag.tagId",e.tagId,(function(e){return e.length<=10})),a("tag.tagName",e.tagName,(function(e){return e.length<=15})),a("tag.tagName",e.tagName,s.STRING,!0),a("callback",t,s.CALLBACK),this.logger.info(c.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(o){var a=o.code;a===r.SUCCESS?t.onSuccess():(n.logger.warn(c.O,"createTag ->code:".concat(a,",tagId:").concat(e.tagId)),t.onError(a))})).catch((function(o){n.logger.warn(c.O,"createTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o)}))},e.prototype.removeTag=function(e,t){var n=this;a("tagId",e,s.STRING,!0),a("callback",t,s.CALLBACK),this.logger.info(c.O,"removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(o){var a=o.code;a===r.SUCCESS?t.onSuccess():(n.logger.warn(c.O,"removeTag ->code:".concat(a,",tagId:").concat(e)),t.onError(a))})).catch((function(o){n.logger.warn(c.O,"removeTag ->code:".concat(o,",tagId:").concat(e)),t.onError(o)}))},e.prototype.updateTag=function(e,t){var n=this;a("tag.tagId",e.tagId,s.STRING,!0),a("tag.tagName",e.tagName,s.STRING,!0),a("tag.tagName",e.tagName,(function(e){return e.length<=15})),a("callback",t,s.CALLBACK),this.logger.info(c.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(o){var a=o.code;a===r.SUCCESS?t.onSuccess():(n.logger.warn(c.O,"updateTag ->code:".concat(a,",tagId:").concat(e.tagId)),t.onError(a))})).catch((function(o){n.logger.warn(c.O,"updateTag ->reason:".concat(o,",tagId:").concat(e.tagId)),t.onError(o)}))},e.prototype.getTagList=function(e){var t=this;a("callback",e,s.CALLBACK),this._context.getTagList().then((function(n){var o=n.code,a=n.data;o===r.SUCCESS?e.onSuccess(a||[]):(t.logger.warn(c.O,"getTagList ->code:".concat(o)),e.onError(o))})).catch((function(n){t.logger.warn(c.O,"getTagList ->reason:".concat(n)),e.onError(n)}))},e.prototype.getTagsForConversation=function(e,t){var n=this;a("conversationType",e.type,s.NUMBER),a("targetId",e.targetId,s.STRING),a("channelId",e.channelId,s.ONLY_STRING),a("callback",t,s.CALLBACK),this.logger.info(c.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(G(e)).then((function(e){var o=e.code,a=e.data;o===r.SUCCESS?t.onSuccess(a||[]):(n.logger.warn(c.O,"getTagsForConversation ->code:".concat(o)),t.onError(o))})).catch((function(e){n.logger.warn(c.O,"getTagsForConversation ->reason:".concat(e)),t.onError(e)}))},e.prototype.addTagForConversations=function(e,t,n){var o=this;a("tagId",e,s.STRING,!0),a("conversations",t,s.ARRAY,!0),a("callback",n,s.CALLBACK),t.forEach((function(e){a("conversation.type",e.type,s.NUMBER,!0),a("conversation.targetId",e.targetId,s.STRING,!0),a("conversation.channelId",e.channelId,s.ONLY_STRING)})),this.logger.info(c.O,"addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,t.map((function(e){return G(e)}))).then((function(t){var a=t.code;t.data,a===r.SUCCESS?n.onSuccess():(o.logger.warn(c.O,"addTagForConversations ->code:".concat(a,",tagId:").concat(e)),n.onError(a))})).catch((function(t){o.logger.warn(c.O,"addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagForConversations=function(e,t,n){var o=this;a("tagId",e,s.STRING,!0),a("conversations",t,s.ARRAY,!0),a("callback",n,s.CALLBACK),t.forEach((function(e){a("conversation.type",e.type,s.NUMBER,!0),a("conversation.targetId",e.targetId,s.STRING,!0),a("conversation.channelId",e.channelId,s.ONLY_STRING)})),this.logger.info(c.O,"removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,t.map((function(e){return G(e)}))).then((function(t){var a=t.code;t.data,a===r.SUCCESS?n.onSuccess():(o.logger.warn(c.O,"removeTagForConversations ->code:".concat(a,",tagId:").concat(e)),n.onError(a))})).catch((function(t){o.logger.warn(c.O,"removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagsForConversation=function(e,t,n){var o=this;a("conversation.type",e.type,s.NUMBER,!0),a("conversation.targetId",e.targetId,s.STRING,!0),a("conversation.channelId",e.channelId,s.ONLY_STRING),a("tagIds",t,s.ARRAY,!0),a("callback",n,s.CALLBACK),t.forEach((function(e){a("tagId",e,s.STRING,!0)})),this.logger.info(c.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(G(e),t).then((function(e){var a=e.code;e.data,a===r.SUCCESS?n.onSuccess():(o.logger.warn(c.O,"removeTagsForConversation ->code:".concat(a,",tagIds:").concat(t)),n.onError(a))})).catch((function(e){o.logger.warn(c.O,"removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(t)),n.onError(e)}))},e.prototype.getConversationListByTag=function(e,t,n,o){var i=this;a("tagId",e,s.STRING,!0),a("count",t,s.NUMBER,!0),a("startTime",n,s.NUMBER,!0),a("callback",o,s.CALLBACK,!0),this.logger.info(c.O,"getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,n,t).then((function(t){var n=t.code,a=t.data,s=[];n===r.SUCCESS?((a=a||[]).forEach((function(e){s.push(function(e){var t=e.channelId,n=e.conversationType,o=e.targetId,a=e.unreadMessageCount,s=e.latestMessage,r=e.isTop,c=e.notificationStatus,i=e.isTopInTag,g=s?U(s):null,d=g||{},l=d.messageType,u=d.sentTime,h=d.receivedStatus;return{channelId:t||"",conversationType:n,targetId:o,unreadMessageCount:a,latestMessage:g,isTopInTag:i,latestMessageId:d.messageId,objectName:l,sentTime:u,isTop:r,notificationStatus:c,receivedStatus:h}}(e))})),o.onSuccess(s)):(i.logger.warn(c.O,"getConversationListByTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){i.logger.warn(c.O,"getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,t,n){var o=this;a("tagId",e,s.STRING,!0),a("containMuted",t,s.BOOLEAN,!0),a("callback",n,s.CALLBACK),this.logger.info(c.O,"getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,t).then((function(t){var a=t.code,s=t.data;o.logger.info(c.O,JSON.stringify({code:a,data:s})),a===r.SUCCESS?n.onSuccess(s||0):(o.logger.warn(c.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(e)),n.onError(a))})).catch((function(t){o.logger.warn(c.O,"getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,t,n,o){var i=this;a("tagId",e,s.STRING,!0),a("conversation.targetId",t.targetId,s.STRING,!0),a("conversation.type",t.type,s.NUMBER,!0),a("conversation.channelId",t.channelId,s.ONLY_STRING),a("status.isTop",null==n?void 0:n.isTop,s.BOOLEAN,!0),a("callback",o,s.CALLBACK),this.logger.info(c.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",type").concat(t.type)),this._context.setConversationStatusInTag(e,G(t),n).then((function(t){var n=t.code;t.data,n===r.SUCCESS?o.onSuccess():(i.logger.warn(c.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){i.logger.warn(c.O,"setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.callExtra=function(e,t){for(var n,o=this,a=[],s=2;s<arguments.length;s++)a[s-2]=arguments[s];this.logger.info(c.O,"callExtra ->method:".concat(e)),(n=this._context).callExtra.apply(n,function(e,t,n){if(n||2===arguments.length)for(var o,a=0,s=t.length;a<s;a++)!o&&a in t||(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}([e],function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,a,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=s.next()).done;)r.push(o.value)}catch(e){a={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(a)throw a.error}}return r}(a),!1)).then((function(n){var a=n.code,s=n.data;if(a!==r.SUCCESS)o.logger.warn(c.O,"callExtra ->code:".concat(a)),t.onError&&B(t.onError,a);else{if("getConversationsByPage"===e&&s.forEach((function(e){e.latestMessage=e.latestMessage?U(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var i=s,g=i.list,d=i.hasMore,l=g.map((function(e){return U(e)}));return void A(t.onSuccess,l,d)}t.onSuccess&&A(t.onSuccess,s)}}))},e.prototype.hasRemoteUnreadMessages=function(e,t){a("callback",t,s.CALLBACK),this.logger.info(c.O,"hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){A(t.onSuccess,!1)}),"hasRemoteUnreadMessages",t)},e.prototype.setUserStatusListener=function(e,t){var n=this;this.logger.info(c.O,"setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,t){var n=this;a("status",e,s.NUMBER),a("callback",t,s.CALLBACK),this.logger.info(c.O,"setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){n._context.setUserStatus(e).then((function(e){e===r.SUCCESS?A(t.onSuccess,!0):(n.logger.warn(c.O,"setUserStatus ->code:".concat(e)),B(t.onError,e))}))}),"setUserStatus",t)},e.prototype.getUserStatus=function(e,t){var n=this;a("userId",e,s.STRING),a("callback",t,s.CALLBACK),this.logger.info(c.O,"getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getUserStatus(e).then((function(o){var a=o.code,s=o.data;a===r.SUCCESS?A(t.onSuccess,s):(n.logger.warn(c.O,"getUserStatus ->code:".concat(a,",useerId:").concat(e)),B(t.onError,a))}))}),"getUserStatus",t)},e.prototype.addToBlacklist=function(e,t){var n=this;a("userId",e,s.STRING),a("callback",t,s.CALLBACK),this.logger.info(c.O,"addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.addToBlacklist(e).then((function(o){o===r.SUCCESS?A(t.onSuccess):(n.logger.warn(c.O,"addToBlacklist ->code:".concat(o,",useerId:").concat(e)),B(t.onError,o))}))}),"addToBlacklist",t)},e.prototype.removeFromBlacklist=function(e,t){var n=this;a("userId",e,s.STRING),a("callback",t,s.CALLBACK),this.logger.info(c.O,"removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.removeFromBlacklist(e).then((function(o){o===r.SUCCESS?A(t.onSuccess):(n.logger.warn(c.O,"removeFromBlacklist ->code:".concat(o,",useerId:").concat(e)),B(t.onError,o))}))}),"removeFromBlacklist",t)},e.prototype.getBlacklist=function(e){var t=this;a("callback",e,s.CALLBACK),this.assertCPPMode((function(){t._context.getBlacklist().then((function(n){var o=n.code,a=n.data;o===r.SUCCESS?A(e.onSuccess,a):(t.logger.warn(c.O,"getBlacklist ->code:".concat(o)),B(e.onError,o))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,t){var n=this;a("userId",e,s.STRING),a("callback",t,s.CALLBACK),this.logger.info(c.O,"getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getBlacklistStatus(e).then((function(o){var a=o.code,s=o.data;a===r.SUCCESS?A(t.onSuccess,s):(n.logger.warn(c.O,"getBlacklistStatus ->code:".concat(a,",userId:").concat(e)),B(t.onError,a))}))}),"getBlacklistStatus",t)},e.prototype.insertMessage=function(e,t,n,o,r){var i=this;void 0===r&&(r={}),a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("content.senderUserId",n.senderUserId,s.STRING,!0),a("content.messageDirection",n.messageDirection,s.NUMBER,!0),a("content.objectName",n.objectName,s.STRING,!0),a("callback",o,s.CALLBACK),this.logger.info(c.O,"insertMessage ->targetId:".concat(t,",conversationType:").concat(e,",senderUserId:").concat(n.senderUserId)),this.assertCPPMode((function(){i._defaultChannelClient.insertMessage(e,t,n,o,r)}),"insertMessage",o)},e.prototype.batchInsertMessage=function(e,t,n){var o,r,c=this;for(var i in a("messages",e,(function(t){return d(t)&&!(e.length<=0||e.length>=500)}),!0),a("checkDuplicate",t,s.BOOLEAN),a("callback",n,s.CALLBACK),e)a("message",e[i],s.OBJECT,!0),a("message.conversationType",e[i].conversationType,(function(e){return[l.PRIVATE,l.DISCUSSION,l.GROUP,l.CUSTOMER_SERVICE,l.SYSTEM,l.APP_PUBLIC_SERVICE,l.PUBLIC_SERVICE].includes(e)}),!0),a("message.targetId",e[i].targetId,s.STRING,!0),a("message.senderUserId",e[i].senderUserId,s.STRING,!0),a("message.messageType",e[i].messageType,s.STRING,!0),a("message.content",e[i].content,s.OBJECT,!0),a("message.messageDirection",e[i].messageDirection,s.NUMBER,!0),a("message.canIncludeExpansion",e[i].canIncludeExpansion,s.BOOLEAN),a("message.expansion",e[i].expansion,s.OBJECT),a("message.disableNotification",e[i].disableNotification,s.BOOLEAN),a("message.sentTime",e[i].sentTime,s.NUMBER),a("message.sentStatus",e[i].sentStatus,s.NUMBER),a("options.isUnread",null===(o=e[i])||void 0===o?void 0:o.isUnread,s.BOOLEAN),a("options.searchContent",null===(r=e[i])||void 0===r?void 0:r.searchContent,s.STRING);this.assertCPPMode((function(){c._defaultChannelClient.batchInsertMessage(e,t,n)}),"batchInsertMessage",n)},e.prototype.getMessageCount=function(e,t,n){var o=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("callback",n,s.CALLBACK),this.assertCPPMode((function(){o._defaultChannelClient.getMessageCount(e,t,n)}),"getMessageCount",n)},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,r,c){var i=this;void 0===c&&(c={}),a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("timestamp",n,s.NUMBER,!0),a("count",o,s.NUMBER,!0),a("callback",r,s.CALLBACK),a("options.order",c.order,s.NUMBER),this.assertCPPMode((function(){i._defaultChannelClient.getRemoteHistoryMessages(e,t,n,o,r,c)}),"getRemoteHistoryMessages",r)},e.prototype.deleteLocalMessages=function(e,t,n,o){var i=this;a("messageIds",n,s.ARRAY,!0),a("callback",o,s.CALLBACK),this.logger.info(c.O,"deleteLocalMessages ->messageIds:".concat(n)),this.assertCPPMode((function(){i._context.deleteMessages(n).then((function(e){e===r.SUCCESS?A(o.onSuccess,!0):(i.logger.warn(c.O,"deleteLocalMessages ->code:".concat(e,",messageIds:").concat(n)),B(o.onError,e))}))}),"deleteLocalMessages",o)},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,r){var c=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("timestamp",n,s.NUMBER,!0),a("cleanSpace",o,s.BOOLEAN),a("callback",r,s.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.deleteLocalMessagesByTimestamp(e,t,n,o,r)}),"deleteLocalMessagesByTimestamp",r)},e.prototype.clearMessages=function(e,t,n){var o=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("callback",n,s.CALLBACK),this.assertCPPMode((function(){o._defaultChannelClient.clearMessages(e,t,n)}),"clearMessages",n)},e.prototype.getMessage=function(e,t){var n=this;a("callback",t,s.CALLBACK),this.assertCPPMode((function(){n._context.getLocalMessage(e).then((function(o){var a=o.code,s=o.data;a===r.SUCCESS?A(t.onSuccess,U(s)):(n.logger.warn(c.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),B(t.onError,a))}))}),"getMessage",t)},e.prototype.setMessageSentStatus=function(e,t,n){var o=this;a("messageId",e,s.NUMBER,!0),a("sentStatus",t,s.NUMBER,!0),this.logger.info(c.O,"setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageSentStatus(e,t).then((function(t){t===r.SUCCESS?A(n.onSuccess,!0):(o.logger.warn(c.O,"setMessageSentStatus ->code:".concat(t,",messageId:").concat(e)),B(n.onError,t))}))}),"setMessageSentStatus",n)},e.prototype.setMessageReceivedStatus=function(e,t,n){var o=this;a("messageId",e,s.NUMBER,!0),a("receivedStatus",t,s.NUMBER,!0),this.logger.info(c.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageReceivedStatus(e,t).then((function(t){t===r.SUCCESS?A(n.onSuccess,!0):(o.logger.warn(c.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),B(n.onError,t))}))}),"setMessageReceivedStatus",n)},e.prototype.setMessageContent=function(e,t,n,o){var i=this;a("messageId",e,s.NUMBER,!0),a("objectName",n,s.ONLY_STRING,!0),this.assertCPPMode((function(){i.logger.info(c.A_SET_MSG_CONTENT_O,JSON.stringify({messageId:e,objectName:n})),i._context.setMessageContent(e,t,n).then((function(e){e===r.SUCCESS?A(o.onSuccess,!0):B(o.onError,e)}))}),"setMessageContent",o)},e.prototype.setMessageSearchField=function(e,t,n){var o=this;a("messageId",e,s.NUMBER,!0),a("searchFiles",n,s.STRING,!0),this.logger.info(c.O,"setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(n)),this.assertCPPMode((function(){o._context.setMessageSearchField(e,t,n)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,t,n,o){var r=this;a("keyword",e,s.STRING,!0),a("callback",t,s.CALLBACK),a("conversationTypes",n,s.ARRAY),a("customMessageType",o,s.ARRAY),this.assertCPPMode((function(){r._defaultChannelClient.searchConversationByContent(e,t,n,o)}),"searchConversationByContent",t)},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){var r=this;void 0===n&&(n=[]),a("keyword",e,s.STRING,!0),a("callback",t,s.CALLBACK),a("conversationTypes",o,s.ARRAY),a("customMessageType",n,s.ARRAY),this.assertCPPMode((function(){r._defaultChannelClient.searchConversationByContentWithAllChannel(e,t,n,o)}),"searchConversationByContentWithAllChannel",t)},e.prototype.searchMessageByContent=function(e,t,n,o,r,c,i){var g=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("keyword",n,s.STRING,!0),a("timestamp",o,s.NUMBER),a("count",r,s.NUMBER),a("total",c,s.NUMBER),a("callback",i,s.CALLBACK),this.assertCPPMode((function(){g._defaultChannelClient.searchMessageByContent(e,t,n,o,r,c,i)}),"searchMessageByContent",i)},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,r,c){var i=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("keyword",n,s.STRING,!0),a("timestamp",o,s.NUMBER),a("count",r,s.NUMBER),a("callback",c,s.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.searchMessageByContentWithAllChannel(e,t,n,o,r,c)}),"searchMessageByContentWithAllChannel",c)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,r,c,i,g){var d=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("keyword",n,s.STRING,!0),a("startTime",o,s.NUMBER),a("endTime",r,s.NUMBER),a("offset",c,s.NUMBER),a("limit",i,s.NUMBER),a("callback",g,s.CALLBACK),this.assertCPPMode((function(){d._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,r,c,i,g)}),"searchMessageByContentInTimeRangeWithAllChannel",g)},e.prototype.getUnreadMentionedMessages=function(e,t){return this._isCPPMode?(a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,t)):(this.logger.error(c.O,"getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){var r=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),a("timestamp",n,s.NUMBER,!0),this.assertCPPMode((function(){r._defaultChannelClient.clearUnreadCountByTimestamp(e,t,n,o)}),"clearUnreadCountByTimestamp",o)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._defaultChannelClient.getFirstUnreadMessage(e,t,n)},e.prototype.getConversationNotificationStatus=function(e,t,n){var o=this;a("conversationType",e,s.NUMBER,!0),a("targetId",t,s.STRING,!0),this.assertCPPMode((function(){o._defaultChannelClient.getConversationNotificationStatus(e,t,n)}),"getConversationNotificationStatus",n)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getGroupMessageDeliverList=function(e,t,n){this._defaultChannelClient.getGroupMessageDeliverList(e,t,n)},e.prototype.getPrivateMessageDeliverTime=function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)},e}(),K=1;u.add("imlib-v2-adapter","5.18.0");var F,V,H=null,W={init:function(e,t,n){var o;void 0===n&&(n={}),a("appkey",e,s.STRING,!0),F=new h("API-V2"),P=C.init({appkey:e,navigators:n.navi?[n.navi]:[],miniCMPProxy:[],logOutputLevel:n.logOutputLevel,typingExpireTime:n.typingExpireTime,httpInMainProcess:!!n.httpInMainProcess,logExpireTime:n.logExpireTime,environment:null!==(o=n.environment)&&void 0!==o?o:"default"}),H=P.logger,K=Math.min(15,Math.max(n.readReceiptTimeout||1,1)),b=new D(P,{readReceiptTimeout:K},H,F),p.init(H)},getInstance:function(){return b},setConnectionStatusListener:function(e){throw new Error("Please use `onConnectionStatusChange()` instead of `setConnectionStatusListener()`")},onConnectionStatusChange:function(e){P.assignWatcher({connection:function(t,n){try{e.onChanged(t,n)}catch(e){null==H||H.error(c.A_CALLBACK_E,"onConnectionStatusChange -> ".concat(e.stack))}}})},setOnReceiveMessageListener:function(e){P.assignWatcher({message:function(t,n,a){try{var s=U(t),r=P.getCurrentUserId(),i=P.getConnectedTime();_(s,r,i,K,F),s=function(e,t,n,o,a){var s=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!s)return e;var r=e.content,c=((r=r||{}).receiptMessageDic||{})[t],i="",g={};if(e.receiptResponse=e.receiptResponse||{},c){for(var d=[],l=0;l<c.length;l++)i="".concat(t).concat(c[l],"SENT"),(g=a.get(i))&&!(e.senderUserId in g.userIds)&&(d.push(c[l]),g.count+=1,g.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[c[l]]=g.count,a.set(i,g));r.receiptMessageDic[t]=d,e.content=r}return e}(s,r,i,K,F),o()||T.set(t),e.onReceived(s,void 0,a)}catch(e){null==H||H.error(c.A_CALLBACK_E,"setOnReceiveMessageListener -> ".concat(e.stack))}}})},setConversationStatusListener:function(e){P.assignWatcher({conversationState:function(t){try{var n=[];t.forEach((function(e){var t=e.updatedItems,o=e.conversationType,a=e.targetId,s=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&n.push({notificationStatus:r.val,isTop:c.val,conversationType:o,targetId:a,channelId:s||"",updatedTime:r.time})})),n.length>0&&e.onChanged(n)}catch(e){null==H||H.error(c.O,"setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){P.assignWatcher({expansion:function(t){try{t.updatedExpansion&&e.onUpdated(t.updatedExpansion),t.deletedExpansion&&e.onDeleted(t.deletedExpansion)}catch(e){null==H||H.error(c.O,"setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){P.assignWatcher({tag:function(){try{e.onChanged()}catch(e){null==H||H.error(c.O,"setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){P.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){null==H||H.error(c.O,"setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){P.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){null==H||H.error(c.O,"setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){P.assignWatcher({typingState:function(t){try{e.onChanged(t)}catch(e){null==H||H.error(c.O,"setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){P.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){P.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){P.assignWatcher({messageDelivered:function(t){try{e.onDelivered(t)}catch(e){null==H||H.error(c.O,"setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){P.assignWatcher({groupMessageDeliveredStatus:function(t){try{e.onDelivered(t)}catch(e){null==H||H.error(c.O,"setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,t,n){return R(this,void 0,void 0,(function(){var o,a,s;return M(this,(function(i){switch(i.label){case 0:return o=null==H?void 0:H.createTraceId(),null==H||H.info(c.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:!1}),o),[4,P.connect(e,!!n,o)];case 1:return a=i.sent(),s=a.code===r.SUCCESS?"info":"warn",null==H||H[s](c.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),o),a.code===r.SUCCESS?(t.onSuccess(a.userId),g=new Date(P.getConnectedTime()-1e3*K*60*60*24).getTime(),F.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=F.get(e).dealtime;t&&g-t>0&&F.remove(e)}else if(/RECEIVED$/.test(e)){var n=F.get(e),o=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&g-t>0&&delete n[e]})),Object.keys(n).length!==o&&(0===n.length?F.remove(e):F.set(e,n))}}))):a.code===r.RC_CONN_TOKEN_INCORRECT?(null==H||H.warn(c.O,"connect ->code:".concat(a.code,",token:").concat(e)),t.onTokenIncorrect()):(null==H||H.warn(c.O,"connect ->code:".concat(a.code,",token:").concat(e)),t.onError(a.code)),[2]}var g}))}))},reconnect:function(e,t,n){var o=null==H?void 0:H.createTraceId();null==H||H.info(c.A_RECONNECT_T,null,o),P.reconnect(n).then((function(t){var n=t.code===r.SUCCESS?"info":"warn";null==H||H[n](c.A_RECONNECT_R,JSON.stringify({code:t.code,userId:t.userId}),o),t.code===r.SUCCESS?e.onSuccess(t.userId):(null==H||H.warn(c.O,"reconnect ->code:".concat(t.code)),e.onError(t.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:N,getMessageObjectName:function(e){var t=m(m({},E),N);return Object.keys(t).find((function(n){return t[n]===e}))||e},registerMessageType:function(e,t,n,o){this.RegisterMessage[e]=x(e,t,n.isPersited,n.isCounted),this.RegisterMessageTypeMapping[t]=e,P.registerMessageType(t,n.isPersited,n.isCounted,o)}},J=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n},j=function(e,t){this.isCounted=e,this.isPersited=t},Y=x("TextMessage","RC:TxtMsg"),q=x("LocationMessage","RC:LBSMsg"),Q=x("TypingStatusMessage","RC:TypSts"),X=x("ImageMessage","RC:ImgMsg"),$=x("RichContentMessage","RC:ImgTextMsg"),z=x("VoiceMessage","RC:VcMsg"),Z=x("HQVoiceMessage","RC:HQVCMsg"),ee=x("FileMessage","RC:FileMsg"),te=x("SightMessage","RC:SightMsg"),ne=x("GIFMessage","RC:GIFMsg"),oe=x("ReadReceiptMessage","RC:ReadNtf"),ae=x("ReadReceiptRequestMessage","RC:RRReqMsg"),se=x("RCCombineMessage","RC:CombineMsg"),re=function(e,t,n,o,a,s,r,c,i,g,d,l,u,h,C,p,f,I){this.conversationType=e,this.targetId=t,this.senderUserId=n,this.content=o,this.objectName=a,this.messageType=s,this.messageId=r,this.messageUId=c,this.messageDirection=i,this.offLineMessage=g,this.sentStatus=d,this.sentTime=l,this.receivedStatus=u,this.receivedTime=h,this.canIncludeExpansion=C,this.expansion=p,this.receiptResponse=f,this.disableNotification=I};!function(e){e[e.MEDIA_AUDIO=1]="MEDIA_AUDIO",e[e.MEDIA_VEDIO=2]="MEDIA_VEDIO",e[e.MEDIA_VIDEO=2]="MEDIA_VIDEO"}(V||(V={}));var ce,ie=x("AcceptMessage","RC:VCAccept"),ge=x("RingingMessage","RC:VCRinging"),de=x("SummaryMessage","RC:VCSummary"),le=x("HungupMessage","RC:VCHangup"),ue=x("InviteMessage","RC:VCInvite"),he=x("MediaModifyMessage","RC:VCModifyMedia"),Ce=x("MemberModifyMessage","RC:VCModifyMem"),pe=x("lastMessageSendTime","RC:SRSMsg"),fe=x("ReferenceMessage","RC:ReferenceMsg"),Ie=x("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),Se=x("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(ce||(ce={}));var ve=ce,me={ACCEPTED:0,UNACCEPTABLE_PROTOCOL_VERSION:1,IDENTIFIER_REJECTED:2,SERVER_UNAVAILABLE:3,TOKEN_INCORRECT:4,NOT_AUTHORIZED:5,REDIRECT:6,PACKAGE_ERROR:7,APP_BLOCK_OR_DELETE:8,BLOCK:9,TOKEN_EXPIRE:10,DEVICE_ERROR:11,HOSTNAME_ERROR:12,HASOHTERSAMECLIENTONLINE:13,OUT_OF_LIMIT:14,IN_OTHER_CLUSTER:15,APP_AUTH_NOT_PASS:16,OTP_USED:17,PLATFORM_ERROR:18,USER_LOGOUT:19,ACCOUNT_CANCELLATION:19,LICENSE_EXPIRED:20};window&&(window.RongIMClient=W);export{ie as AcceptMessage,L as BaseMessage,k as ChannelClient,me as ConnectionState,ee as FileMessage,ne as GIFMessage,v as GetChatRoomType,Z as HQVoiceMessage,le as HungupMessage,D as IMClient,X as ImageMessage,ue as InviteMessage,q as LocationMessage,he as MediaModifyMessage,Ce as MemberModifyMessage,J as MentionedInfo,ve as MentionedType,re as Message,j as MessageTag,Se as PublicServiceMultiRichContentMessage,Ie as PublicServiceRichContentMessage,se as RCCombineMessage,oe as ReadReceiptMessage,ae as ReadReceiptRequestMessage,w as ReadReceiptResponseMessage,fe as ReferenceMessage,$ as RichContentMessage,ge as RingingMessage,W as RongIMClient,S as SentStatus,te as SightMessage,de as SummaryMessage,pe as SyncReadStatusMessage,Y as TextMessage,Q as TypingStatusMessage,V as VoIPMediaType,z as VoiceMessage};
|
|
15
|
+
***************************************************************************** */function T(e,t,n,a){return new(n||(n=Promise))((function(o,r){function s(e){try{c(a.next(e))}catch(e){r(e)}}function i(e){try{c(a.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,i)}c((a=a.apply(e,t||[])).next())}))}function O(e,t){var n,a,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function i(r){return function(i){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,a&&(o=2&r[0]?a.return:r[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,r[1])).done)return o;switch(a=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,a=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],a=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,i])}}}function E(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var P=function(){function t(){}return Object.defineProperty(t,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(e(n.messageType).isPersited){var a=t.get(n.conversationType,n.targetId,n.channelId||"");if(!a||a.sentTime<n.sentTime){var o=E(n.conversationType,n.targetId,n.channelId||"");t.map[o]=n}}}}),Object.defineProperty(t,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,a){var o=E(e,n,a);return t.map[o]||null}}),Object.defineProperty(t,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,a){var o=E(e,n,a);delete t.map[o]}}),Object.defineProperty(t,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){t.map={}}}),Object.defineProperty(t,"map",{enumerable:!0,configurable:!0,writable:!0,value:{}}),t}(),N={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage","RC:RcNtf":"NotificationMessage"},U={};function w(e){var a=e.channelId,o=e.conversationType,r=e.targetId,s=e.unreadMessageCount,i=e.latestMessage,c=e.isTop,l=e.notificationStatus,u=e.matchCount;if(!n()){var g=P.get(o,r,a||"");(!i||g&&i.sentTime<g.sentTime)&&(i=g)}var d=i?_(i):null;return{channelId:a||"",conversationType:o,targetId:r,unreadMessageCount:s||0,latestMessage:d,latestMessageId:null==d?void 0:d.messageId,objectName:null==d?void 0:d.messageType,sentTime:null==d?void 0:d.sentTime,isTop:c||!1,notificationStatus:l||t.CLOSE,receivedStatus:null==d?void 0:d.receivedStatus,matchCount:u}}function _(e){var t=e.conversationType,n=e.targetId,o=e.senderUserId,r=e.content,s=e.messageType,i=e.messageUId,c=e.messageDirection,l=e.isOffLineMessage,u=e.sentTime,g=e.receivedStatus,d=e.receivedTime,f=e.canIncludeExpansion,h=e.disableNotification,p=e.expansion,C=e.messageId,b=e.sentStatus,v=e.channelId,m=e.readReceiptInfo,y=e.pushConfig,I="";return s in N?I=N[s]:s in U?I=U[s]:(r={message:{content:r,objectName:s},messageName:"UnknownMessage"},I="UnknownMessage"),g||(g=a.UNREAD),void 0===C&&(C=~~(16777215*Math.random())),{channelId:v||"",conversationType:t,targetId:n,senderUserId:o,content:r,messageType:I,messageUId:i,messageDirection:c,offLineMessage:l,sentTime:u,receivedStatus:g,receivedTime:d,objectName:s,messageId:C,sentStatus:b||S.SENT,disableNotification:h,canIncludeExpansion:f,expansion:p,readReceiptInfo:m,pushConfig:y}}function A(e,t,n,a,r){var s=new Date(n-1e3*a*60*60*24).getTime()-e.sentTime<0,i=e.messageType,c=e.messageDirection;if("ReadReceiptRequestMessage"===i&&s&&c===o.SEND){var l="".concat(t).concat(e.content.messageUId,"SENT");r.set(l,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===i&&s){var u="".concat(t).concat(e.conversationType).concat(e.targetId,"RECEIVED"),g=r.get(u);if(g){if(e.senderUserId in g)return void(g[e.senderUserId].uIds&&-1===g[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(g[e.senderUserId].uIds.push(e.content.messageUId),g[e.senderUserId].dealtime=e.sentTime,g[e.senderUserId].isResponse=!1,r.set(u,g)));var d={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};return g[e.senderUserId]=d,void r.set(u,g)}var f={};f[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},r.set(u,f)}}function L(e,t,n){try{e(t,n)}catch(e){null===console||void 0===console||console.error(e)}}function B(e,t,n){try{e(t,n)}catch(e){null===console||void 0===console||console.error(e)}}var j=function(e,t,n,a,o){void 0===a&&(a=!0),void 0===o&&(o=!0),Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"objectName",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:o})};function x(e,t,n,a){void 0===n&&(n=!0),void 0===a&&(a=!0);var o=function(o){return new j(e,t,o,n,a)};return o.MessageType=e,o.ObjectName=t,o}var k,G,D=x("ReadReceiptResponseMessage","RC:RRRspMsg"),K=function(){function e(e,t,n,a,o,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"channelId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_isCPPMode",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_readReceiptTimeout",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_draftMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("callback",e,s.CALLBACK),r("conversationTypes",t,s.ARRAY),r("count",n,s.NUMBER);var o={type:i.TIMESTAMP,params:{startTime:0,count:n||300,channelId:this.channelId}};this._context.getConversationListByFilter(o).then((function(n){var o=n.code,r=n.data,s=[];r=r||[],o===c.SUCCESS?(t?r.forEach((function(e){t.indexOf(e.conversationType)>-1&&s.push(w(e))})):r.forEach((function(e){s.push(w(e))})),L(e.onSuccess,s)):(a.logger.warn(l.O,"getConversationList -> code:".concat(o)),B(e.onError,o))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("callback",n,s.CALLBACK),T(a,void 0,void 0,(function(){var a,o,r,s;return O(this,(function(i){switch(i.label){case 0:return[4,this._context.getConversation({conversationType:e,targetId:t,channelId:this.channelId})];case 1:return a=i.sent(),o=a.isOk,r=a.code,s=a.data,o?(n.onSuccess(w(s)),[2]):(n.onError(r),[2])}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("callback",n,s.CALLBACK),this._context.removeConversation({conversationType:e,targetId:t,channelId:this.channelId}).then((function(o){o.isOk?(a._isCPPMode||P.remove(e,t,a.channelId),L(n.onSuccess)):B(n.onError,o.code)}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("draftText",n,s.STRING,!0),this.logger.info(l.O,"saveTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var a=this._context.getCurrentUserId();return!!a&&((this._draftMap[a]=this._draftMap[a]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]=n,!0)}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),this.logger.info(l.O,"getTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();if(n)return(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),this.logger.info(l.O,"clearTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&delete(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){r("callback",e,s.CALLBACK),this._context.getTotalUnreadCount(this.channelId,t,n).then((function(t){var n=t.code,a=t.data;n===c.SUCCESS?L(e.onSuccess,a):B(e.onError,n)}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"getUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadCount(e,t,this.channelId).then((function(e){var o=e.code,r=e.data;o===c.SUCCESS?L(n.onSuccess,r):(a.logger.warn(l.O,"getUnreadCount ->code:".concat(o,",targetId:").concat(t)),B(n.onError,o))}))}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;this.logger.info(l.O,"clearConversations -> conversationTypes:".concat(t)),this._isCPPMode?this._context.clearConversations(t,this.channelId).then((function(t){t===c.SUCCESS?L(e.onSuccess,!0):(n.logger.warn(l.O,"clearConversations ->code:".concat(t)),B(e.onError,t))})):this.logger.error(l.O,"Method is only available in cppProtocol mode")}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"clearUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCount(e,t,this.channelId).then((function(e){e===c.SUCCESS?L(n.onSuccess,!0):(a.logger.warn(l.O,"clearUnreadCount ->code:".concat(e,",targetId:").concat(t)),B(n.onError,e))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;r("callback",e,s.CALLBACK),this.logger.info(l.O,"clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(n){var a=n.code;a===c.SUCCESS?L(e.onSuccess,!0):(t.logger.warn(l.O,"clearUnreadCount ->code:".concat(a)),B(e.onError,a))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"getFirstUnreadMessage ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,t,this.channelId).then((function(e){e.code===c.SUCCESS?L(n.onSuccess,e.data?_(e.data):null):(a.logger.warn(l.O,"getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(t)),B(n.onError,e.code))}))}}),Object.defineProperty(e.prototype,"setConversationStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){r("callback",a,s.CALLBACK),r("status",n,s.OBJECT,!0);var o=n.isTop,i=n.notificationStatus,l={conversationType:e,targetId:t,channelId:this.channelId},g=[];if(void 0!==o&&g.push(this._context.batchSetConversationToTop([l],!!o,!1,!1)),void 0!==i){var d=u(i);g.push(this._context.batchSetConversationNotificationLevel([l],d))}Promise.all(g).then((function(e){var t=c.SUCCESS;e.forEach((function(e){e.isOk||(t=e.code)})),t===c.SUCCESS?L(a.onSuccess):B(a.onError,t)}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,u,d,f,h){var p=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("msg",n,s.OBJECT,!0),r("callback",i,s.CALLBACK),r("isMentioned",u,s.BOOLEAN),r("pushContent",d,s.ONLY_STRING),r("pushData",f,s.ONLY_STRING),r("options.userIds",null==h?void 0:h.userIds,s.ARRAY),r("options.isVoipPush",null==h?void 0:h.isVoipPush,s.BOOLEAN),r("options.disableNotification",null==h?void 0:h.disableNotification,s.BOOLEAN),r("options.canIncludeExpansion",null==h?void 0:h.canIncludeExpansion,s.BOOLEAN),r("options.expansion",null==h?void 0:h.expansion,s.OBJECT),r("options.pushConfig",null==h?void 0:h.pushConfig,s.OBJECT),r("options.resendMessageId",null==h?void 0:h.resendMessageId,s.NUMBER),this.logger.info(l.O,"sendMessage ->targetId:".concat(t,",conversationType:").concat(e));var C=!(!(null==h?void 0:h.isStatusMessage)&&!(null==h?void 0:h.isStatus)),b=function(e,t,n){var a,o=e||{},r=o.userIds,s=o.isVoipPush,i=o.disableNotification,c=o.isFilerWhiteBlacklist,l=o.expansion,u=o.canIncludeExpansion,g=o.pushConfig,d=o.resendMessageId,f=[];if(t){var h=(n||{}).content.mentionedInfo;f=h.userIdList,a=h.type}return{mentionedType:a,mentionedUserIdList:f,directionalUserIdList:r,isVoipPush:s,disableNotification:i,isFilerWhiteBlacklist:c,expansion:l,canIncludeExpansion:u,pushConfig:g,messageId:d}}(h,u,n);d=d||"",f=f||"";var v=Object.assign(n,M(M({isMentioned:u,pushContent:d,pushData:f},b),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:C})),m=this._context.getCurrentUserId(),y=this.logger.createTraceId();this.logger.info(l.A_SEND_MSG_T,JSON.stringify({messageType:v.messageType,conversationType:e,targetId:t,channelId:this.channelId}),y),this._context.sendMessage(e,t,v,i.onBefore,y).then((function(r){var s=r.code,u=r.data,d=s===c.SUCCESS?"info":"warn";if(p.logger[d](l.A_SEND_MSG_R,JSON.stringify({code:s,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),y),s===c.SUCCESS){p._isCPPMode||P.set(u);var f=_(u);A(f,m,p._context.getConnectedTime(),p._readReceiptTimeout,p._storage),L(i.onSuccess,f)}else p.logger.warn(l.O,"sendMessage ->code:".concat(s,",targetId:").concat(t)),B(i.onError,s,_({isMentioned:!!v.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==h?void 0:h.disableNotification),canIncludeExpansion:!!(null==h?void 0:h.canIncludeExpansion),expansion:(null==h?void 0:h.expansion)||null,conversationType:e,targetId:t,senderUserId:m,messageUId:"",messageDirection:o.SEND,isOffLineMessage:!1,sentTime:(null==u?void 0:u.sentTime)||0,receivedTime:0,isStatusMessage:C,receivedStatus:a.UNREAD,receivedStatusInfo:g(a.UNREAD),messageId:null==u?void 0:u.messageId,sentStatus:S.FAILED}))}))}}),Object.defineProperty(e.prototype,"sendRecallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("message.conversationType",e.conversationType,s.NUMBER,!0),r("message.targetId",e.targetId,s.STRING,!0),r("message.messageUId",e.messageUId,s.STRING,!0),r("message.sentTime",e.sentTime,s.NUMBER,!0),r("callback",t,s.CALLBACK),r("options.disableNotification",null==n?void 0:n.disableNotification,s.BOOLEAN),r("options.pushConfig",null==n?void 0:n.pushConfig,s.OBJECT),r("options.extra",null==n?void 0:n.extra,s.STRING);var o=e.conversationType,i=e.targetId,u=e.messageUId,g=e.sentTime;this.logger.info(l.O,"sendRecallMessage ->targetId:".concat(i,",conversationType:").concat(o,",messageUId:").concat(u));var d={conversationType:o,targetId:i,channelId:this.channelId},f=M({messageUId:u,sentTime:g},n);this._context.recallMessage(d,f).then((function(e){var n=e.code,o=e.data;n===c.SUCCESS?(a._isCPPMode||P.set(o),L(t.onSuccess,_(o))):(a.logger.warn(l.O,"sendRecallMessage ->code:".concat(n,",targetId:").concat(i,",messageUId:").concat(u)),B(t.onError,n))}))}}),Object.defineProperty(e.prototype,"sendTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("typingContentType",n,s.STRING,!0),r("callback",a,s.CALLBACK),this.logger.info(l.O,"sendTypingStatusMessage ->targetId:".concat(t,",conversationType:").concat(e));var i={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:this.channelId},u=this.logger.createTraceId();this.logger.info(l.A_SEND_MSG_T,JSON.stringify({messageType:i.messageType,conversationType:e,targetId:t,channelId:i.channelId}),u),this._context.sendMessage(e,t,i,void 0,u).then((function(e){var n=e.code,r=e.data,s=n===c.SUCCESS?"info":"warn";o.logger[s](l.A_SEND_MSG_R,JSON.stringify({code:n,messageUId:r?r.messageUId:"",messageId:r?r.messageId:""}),u),n===c.SUCCESS?L(a.onSuccess,_(r)):(o.logger.warn(l.O,"sendTypingStatusMessage ->code:".concat(n,",targetId:").concat(t)),B(a.onError,n))}))}}),Object.defineProperty(e.prototype,"sendReceiptResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;this.logger.info(l.O,"sendReceiptResponse ->targetId:".concat(t,",conversationType:").concat(e));var o=this._context.getCurrentUserId(),r="".concat(o).concat(e).concat(t,"RECEIVED"),s=this._storage.get(r);if(s){var i=[];for(var c in s){var u={};u[c]=s[c].uIds,s[c].isResponse||i.push(u)}if(0===i.length)return void n.onSuccess(null);var g=setInterval((function(){1===i.length&&clearInterval(g);var o=i.splice(0,1)[0],c=new D({receiptMessageDic:o});a.sendMessage(e,t,c,{onSuccess:function(e){var t=Object.keys(o)[0];s[t].isResponse=!0,a._storage.set(r,s),L(n.onSuccess,e)},onError:function(e){a.logger.warn(l.O,"sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),B(n.onError,e)}})}),200)}else n.onSuccess(null)}}),Object.defineProperty(e.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a,o,i=this;r("messageUIds",e,s.ARRAY,!0),r("targetId",t,s.STRING,!0),this.logger.info(l.O,"sendReadReceiptMessage ->targetId:".concat(t,",messageUIds:").concat(e));try{for(var u=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],a=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),g=u.next();!g.done;g=u.next()){var d=g.value;r("messageUId",d,s.STRING)}}catch(e){a={error:e}}finally{try{g&&!g.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}this._context.sendReadReceiptMessage(t,e,this.channelId).then((function(a){var o=a.code;o===c.SUCCESS?n.onSuccess():(i.logger.warn(l.O,"sendReadReceiptMessage ->code:".concat(o,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(o))})).catch((function(a){i.logger.warn(l.O,"sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(a)}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("messageUId",e,s.STRING,!0),r("targetId",t,s.STRING,!0),this.logger.info(l.O,"getMessageReader ->targetId:".concat(t,",messageUId:").concat(e)),this._context.getMessageReader(t,e,this.channelId).then((function(o){var r=o.code,s=o.data;r===c.SUCCESS?n.onSuccess(s):(a.logger.warn(l.O,"getMessageReader ->code:".concat(r,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(r))})).catch((function(o){a.logger.warn(l.O,"getMessageReader ->code:".concat(o,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(o)}))}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("expansion",e,s.OBJECT,!0),r("message",t,s.OBJECT,!0);var o=t.conversationType,i=t.targetId,u=t.messageUId,g=t.canIncludeExpansion,d=t.expansion,f=t.objectName;this.logger.info(l.O,"updateMessageExpansion ->targetId:".concat(i,",messageUId:").concat(u,",conversationType:").concat(o)),this._context.sendExpansionMessage({messageType:f,conversationType:o,targetId:i,messageUId:u,canIncludeExpansion:g,originExpansion:d,expansion:e,channelId:this.channelId}).then((function(e){var t=e.code;t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"updateMessageExpansion ->code:".concat(t,",targetId:").concat(i,",messageUId:").concat(u)),B(n.onError,t))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansionForKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("keys",e,s.ARRAY,!0),r("message",t,s.OBJECT,!0);var o=t.conversationType,i=t.targetId,u=t.messageUId,g=t.canIncludeExpansion,d=t.objectName;this.logger.info(l.O,"removeMessageExpansionForKey ->targetId:".concat(i,",messageUId:").concat(u,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:i,messageUId:u,canIncludeExpansion:g,keys:e,channelId:this.channelId,messageType:d}).then((function(e){var t=e.code;t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"removeMessageExpansionForKey ->code:".concat(t,",targetId:").concat(i,",messageUId:").concat(u)),B(n.onError,t))}))}}),Object.defineProperty(e.prototype,"getHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,i,u){var g=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("timestamp",n,s.NUMBER,!0),r("count",a,s.NUMBER,!0),r("callback",o,s.CALLBACK,!0),r("order",u,s.NUMBER),this.logger.info(l.O,"getHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n));var d=this.logger.createTraceId();this.logger.info(l.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:"",timestamp:n,count:a}),d),this._context.getHistoryMessage(e,t,n,a,u,this.channelId,i,d).then((function(e){var t=e.code,n=e.data;if(t===c.SUCCESS)if(n){var a=n.list,r=n.hasMore,s=[],i=a.map((function(e){return s.push(e.messageUId),_(e)}));g.logger.info(l.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:s.join(",")}),d),L(o.onSuccess,i,r)}else g.logger.info(l.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:""}),d),L(o.onSuccess,[],!1);else g.logger.warn(l.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:""}),d),B(o.onError,t)}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("callback",a,s.CALLBACK),this._context.deleteRemoteMessage({conversationType:e,targetId:t,channelId:this.channelId},n).then((function(r){if(r.isOk){if(!o._isCPPMode){var s=P.get(e,t,o.channelId);s&&n.forEach((function(n){s.messageUId===n.messageUId&&P.remove(e,t,o.channelId)}))}L(a.onSuccess)}else B(a.onError,r.code)}))}}),Object.defineProperty(e.prototype,"clearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){r("param.conversationType",e.conversationType,s.NUMBER,!0),r("param.targetId",e.targetId,s.STRING,!0),r("param.timestamp",e.timestamp,s.NUMBER,!0),r("callback",t,s.CALLBACK);var n=e.conversationType,a=e.targetId,o=e.timestamp;this._context.deleteRemoteMessageByTimestamp({conversationType:n,targetId:a,channelId:this.channelId},o).then((function(e){e.isOk?L(t.onSuccess):B(t.onError,e.code)}))}}),Object.defineProperty(e.prototype,"getConversationListWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){r("callback",e,s.CALLBACK);var t={type:i.ALL};this._context.getConversationListByFilter(t).then((function(t){var n=t.code,a=t.data;n===c.SUCCESS?L(e.onSuccess,a.map(w)):B(e.onError,n)}))}}),Object.defineProperty(e.prototype,"getConversationListWithAllChannelByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){r("callback",e,s.CALLBACK),this._context.getConversationListByFilter({type:i.PAGE_INDEX,params:{index:t,limit:n}}).then((function(t){var n=t.code,a=t.data;n===c.SUCCESS?L(e.onSuccess,a.map(w)):B(e.onError,n)}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o){var r=this;void 0===o&&(o={});var s=n.senderUserId,i=n.objectName,u=n.content,g=n.messageDirection,d=n.canIncludeExpansion,f=n.expansion,h=n.disableNotification,p=n.sentTime,C=n.sentStatus;this.logger.info(l.O,"insertMessage ->targetId:".concat(t,",conversationType:").concat(e));var b=o.isUnread,v={senderUserId:s,messageType:i,content:u,messageDirection:g,sentTime:p,sentStatus:C,searchContent:o.searchContent,isUnread:b,messageUId:"",disableNotification:h,canIncludeExpansion:d,expansionMsg:JSON.stringify(f),channelId:this.channelId};this._context.insertMessage(e,t,v).then((function(e){var n=e.code,o=e.data;n===c.SUCCESS?L(a.onSuccess,_(o)):(r.logger.warn(l.O,"insertMessage ->code:".concat(n,",targetId:").concat(t)),B(a.onError,n))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._context.batchInsertMessage(e,t).then((function(e){var t=e.code,a=e.data;t===c.SUCCESS?L(n.onSuccess,a):B(n.onError,t)}))}}),Object.defineProperty(e.prototype,"getMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._context.getMessageCount(e,t).then((function(e){var t=e.code,a=e.data;t===c.SUCCESS?L(n.onSuccess,a):B(n.onError,t)}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o){var r=this;this.logger.info(l.O,"deleteLocalMessagesByTimestamp ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n)),this._context.deleteMessagesByTimestamp(e,t,n,a,this.channelId).then((function(e){e===c.SUCCESS?L(o.onSuccess,!0):(r.logger.warn(l.O,"deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(t)),B(o.onError,e))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,r){var s=this;this.logger.info(l.O,"getRemoteHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e));var i=r.order||0;this._context.getRemoteHistoryMessages(e,t,n,a,i,this.channelId).then((function(e){var n=e.code,a=e.data;if(n===c.SUCCESS)if(a){var r=a.list,i=a.hasMore,u=r.map((function(e){return _(e)}));L(o.onSuccess,u,i)}else L(o.onSuccess,[],!1);else s.logger.warn(l.O,"getRemoteHistoryMessages ->code:".concat(n,",targetId:").concat(t)),B(o.onError,n)}))}}),Object.defineProperty(e.prototype,"clearMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;this.logger.info(l.O,"clearMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearMessages(e,t,this.channelId).then((function(o){o===c.SUCCESS?(a._isCPPMode||P.remove(e,t,a.channelId),L(n.onSuccess,!0)):(a.logger.warn(l.O,"clearMessages ->code:".concat(o,",targetId:").concat(t)),B(n.onError,o))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;this.logger.info(l.O,"searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,a,this.channelId,n).then((function(n){var a=n.code,r=n.data,s=[];r=r||[],a===c.SUCCESS?(r.forEach((function(e){s.push(w(e))})),L(t.onSuccess,s)):(o.logger.warn(l.O,"searchConversationByContent ->code:".concat(a,",keyword:").concat(e)),B(t.onError,a))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;void 0===n&&(n=[]),this.logger.info(l.O,"searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,n,a).then((function(n){var a=n.code,r=n.data,s=[];r=r||[],a===c.SUCCESS?(r.forEach((function(e){s.push(w(e))})),L(t.onSuccess,s)):(o.logger.warn(l.O,"searchConversationByContentWithAllChannel ->code:".concat(a,",keyword:").concat(e)),B(t.onError,a))}))}}),Object.defineProperty(e.prototype,"searchMessageByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,r,s){var i=this;this.logger.info(l.O,"searchMessageByContent ->targetId:".concat(t,",conversationType:").concat(e,",keyword:").concat(n)),this._context.searchMessageByContent(e,t,n,a,o,r,this.channelId).then((function(e){var n=e.code,a=e.data,o=[];if(n===c.SUCCESS){var r=a=a||{},u=r.messages,g=r.count;u.forEach((function(e){o.push(_(e))})),L(s.onSuccess,o,g)}else i.logger.warn(l.O,"searchMessageByContent ->code:".concat(n,",targetId:").concat(t)),B(s.onError,n)}))}}),Object.defineProperty(e.prototype,"searchMessageByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,r){var s=this;this.logger.info(l.O,"searchMessageByContentWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", timestamp: ").concat(a,", count: ").concat(o)),this._context.searchMessageByContentWithAllChannel(e,t,n,a,o).then((function(e){var n=e.code,a=e.data,o=[];if(n===c.SUCCESS){var i=a=a||{},u=i.messages,g=i.count;u.forEach((function(e){o.push(_(e))})),L(r.onSuccess,o,g)}else s.logger.warn(l.O,"searchMessageByContentWithAllChannel ->code:".concat(n,",targetId:").concat(t)),B(r.onError,n)}))}}),Object.defineProperty(e.prototype,"searchMessageByContentInTimeRangeWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,r,s,i){var u=this;this.logger.info(l.O,"searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", startTime: ").concat(a,", endTime: ").concat(o,", offset: ").concat(r,", limit: ").concat(s)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,a,o,r,s).then((function(e){var n=e.code,a=e.data,o=[];n===c.SUCCESS?((a=a||{}).messages.forEach((function(e){o.push(_(e))})),L(i.onSuccess,o)):(u.logger.warn(l.O,"searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(n,",targetId:").concat(t)),B(i.onError,n))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.logger.info(l.O,"getUnreadMentionedMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,t,this.channelId).map((function(e){return _(e)}))}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;this.logger.info(l.O,"clearUnreadCountByTimestamp ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,t,n,this.channelId).then((function(e){e===c.SUCCESS?L(a.onSuccess,!0):(o.logger.warn(l.O,"clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(t)),B(a.onError,e))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._context.getConversationNotificationLevel({conversationType:e,targetId:t,channelId:this.channelId}).then((function(e){var t=e.code,a=e.data;t===c.SUCCESS?L(n.onSuccess,d(a)):B(n.onError,t)}))}}),Object.defineProperty(e.prototype,"getGroupMessageDeliverList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;this.logger.info(l.O,"getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(t)),this._context.getGroupMessageDeliverList(e,t,this.channelId).then((function(e){var o=e.code,r=e.data;o===c.SUCCESS?L(n.onSuccess,r):(a.logger.warn(l.O,"getGroupMessageDeliverList ->code:".concat(o,",messageUId:").concat(t)),B(n.onError,o))}))}}),Object.defineProperty(e.prototype,"getPrivateMessageDeliverTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;this.logger.info(l.O,"getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(a){var o=a.code,r=a.data;o===c.SUCCESS?L(t.onSuccess,r):(n.logger.warn(l.O,"getPrivateMessageDeliverTime ->code:".concat(o,",messageUId:").concat(e)),B(t.onError,o))}))}}),e}(),F=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},V=function(){function e(e,t,a,o){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_channelClient",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_defaultChannelClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isCPPMode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._isCPPMode=n(),this._defaultChannelClient=new K(this.logger,e,"",this._isCPPMode,t.readReceiptTimeout,this._storage)}return Object.defineProperty(e.prototype,"assertCPPMode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(!this._isCPPMode)return null==n||n.onError(c.NOT_SUPPORT),void this.logger.error(l.O,"'".concat(t,"' is unusable!"));e()}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.install(e,t)}}),Object.defineProperty(e.prototype,"getChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.logger.info(l.O,"getChannel ->channelId:".concat(e)),!this._isCPPMode)return this.logger.error(l.O,"getChannel method is only available in protocol stack mode"),null;if(r("channelId",e,s.STRING,!0),e.length>20)return this.logger.error(l.O,"The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return this.logger.error(l.O,"Only 1000 channels can be obtained"),null;var t=new K(this.logger,this._context,e,this._isCPPMode,this._options.readReceiptTimeout,this._storage);return this._channelClient[e]=t,t}}),Object.defineProperty(e.prototype,"deleteChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;r("channelIds",e,s.ARRAY,!0),this.logger.info(l.O,"deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete t._channelClient[e]}))}),"deleteChannels")}}),Object.defineProperty(e.prototype,"getNavi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()||{}}}),Object.defineProperty(e.prototype,"getSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{version:"5.20.0"}}}),Object.defineProperty(e.prototype,"getAppInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{appKey:this._context.appkey}}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getCurrentUserId()}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return T(this,void 0,void 0,(function(){return O(this,(function(t){switch(t.label){case 0:return this.logger.info(l.A_DISCONNECT_O),[4,this._context.disconnect(e)];case 1:return t.sent(),[2]}}))}))}}),Object.defineProperty(e.prototype,"logout",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.disconnect()}}),Object.defineProperty(e.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getDeviceId()}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._defaultChannelClient.getConversationList(e,t,n)}}),Object.defineProperty(e.prototype,"getConversationListWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)}}),Object.defineProperty(e.prototype,"getConversationListWithAllChannelByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){void 0===n&&(n=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,n)}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.getConversation(e,t,n)}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.removeConversation(e,t,n)}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.saveTextMessageDraft(e,t,n)}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.getTotalUnreadCount(e,t,n)}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.getUnreadCount(e,t,n)}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.logger.error(l.O,"Method is deprecated")}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._defaultChannelClient.clearConversations(e,t)}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._defaultChannelClient.clearUnreadCount(e,t,n)}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._defaultChannelClient.clearAllUnreadCount(e)}}),Object.defineProperty(e.prototype,"setConversationStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){return this._defaultChannelClient.setConversationStatus(e,t,n,a)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,r,s,i,c){return this._defaultChannelClient.sendMessage(e,t,n,a,o,r,s,c)}}),Object.defineProperty(e.prototype,"sendRecallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.sendRecallMessage(e,t,n)}}),Object.defineProperty(e.prototype,"sendTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){return this._defaultChannelClient.sendTypingStatusMessage(e,t,n,a)}}),Object.defineProperty(e.prototype,"sendReceiptResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.sendReceiptResponse(e,t,n)}}),Object.defineProperty(e.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.sendReadReceiptMessage(e,t,n)}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._defaultChannelClient.getMessageReader(e,t,n)}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._defaultChannelClient.updateMessageExpansion(e,t,n)}}),Object.defineProperty(e.prototype,"removeMessageExpansionForKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._defaultChannelClient.removeMessageExpansionForKey(e,t,n)}}),Object.defineProperty(e.prototype,"getHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,r,s){return this._defaultChannelClient.getHistoryMessages(e,t,n,a,o,r,s)}}),Object.defineProperty(e.prototype,"joinChatRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("chatRoomId",e,s.STRING,!0),r("count",t,s.NUMBER,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"joinChatRoom ->chatRoomId:".concat(e));var o=this.logger.createTraceId();this.logger.info(l.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,joinExist:!1}),o),this._context.joinChatroom(e,t,o).then((function(t){var r=t===c.SUCCESS?"info":"warn";a.logger[r](l.A_JOIN_CHATROOM_R,JSON.stringify({code:t,timestamp:(new Date).getTime()}),o),t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"joinChatRoom ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))}}),Object.defineProperty(e.prototype,"quitChatRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("chatRoomId",e,s.STRING,!0),r("callback",t,s.CALLBACK),this.logger.info(l.O,"quitChatRoom ->chatRoomId:".concat(e));var a=this.logger.createTraceId();this.logger.info(l.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),a),this._context.quitChatroom(e).then((function(o){var r=o===c.SUCCESS?"info":"warn";n.logger[r](l.A_QUIT_CHATROOM_R,JSON.stringify({code:o}),a),o===c.SUCCESS?L(t.onSuccess):(n.logger.warn(l.O,"quitChatRoom ->code:".concat(o,",chatRoomId:").concat(e)),B(t.onError,o))}))}}),Object.defineProperty(e.prototype,"getChatRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("chatRoomId",e,s.STRING,!0),r("count",t,s.NUMBER,!0),r("order",n,s.NUMBER,!0),r("callback",a,s.CALLBACK),this.logger.info(l.O,"getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,t,n).then((function(t){var n=t.code,r=t.data;n===c.SUCCESS?L(a.onSuccess,{userInfos:(null==r?void 0:r.userInfos)||[],userTotalNums:(null==r?void 0:r.userCount)||0}):(o.logger.warn(l.O,"getChatRoomInfo ->code:".concat(n,",chatRoomId:").concat(e)),B(a.onError,n))}))}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("chatRoomId",e,s.STRING,!0),r("chatroomEntry",t,s.OBJECT,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,t).then((function(t){t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"setChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))}}),Object.defineProperty(e.prototype,"setChatRoomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;if(r("chatRoomId",e,s.STRING,!0),function(e){e.entries.forEach((function(e){r("entry.key",e.key,s.STRING,!0),r("entry.value",e.value,s.STRING,!0)})),r("options.isAutoDelete",e.isAutoDelete,s.BOOLEAN)}(t),r("callback",n,s.CALLBACK),t.entries.length>10)B(n.onError,c.CHATROOM_KV_STORE_OUT_LIMIT);else{var o="id:".concat(e);this.logger.info(l.O,"set chatroom entry->".concat(o)),this._context.setChatroomEntries(e,t).then((function(e){var t=e.code,r=e.data;t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"set chatroom entry fail ->code+:".concat(t,",").concat(o)),B(n.onError,t,r))}))}}}),Object.defineProperty(e.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("chatRoomId",e,s.STRING,!0),r("chatroomEntry",t,s.OBJECT,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,t).then((function(t){t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"forceSetChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("chatRoomId",e,s.STRING,!0),r("chatroomEntry",t,s.OBJECT,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,t).then((function(t){t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"removeChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))}}),Object.defineProperty(e.prototype,"removeChatRoomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("chatRoomId",e,s.STRING,!0),function(e){e.entries.forEach((function(e){r("key",e,s.STRING,!0)}))}(t);var o="id:".concat(e);this.logger.debug(l.O,"remove chatroom entry->".concat(o));var i=M({},t);i.entries=t.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,i).then((function(e){var t=e.code,r=e.data;t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"remove chatroom entry fail ->code+:".concat(t,",").concat(o)),B(n.onError,t,r))}))}}),Object.defineProperty(e.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("chatRoomId",e,s.STRING,!0),r("chatroomEntry",t,s.OBJECT,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,t).then((function(t){t===c.SUCCESS?L(n.onSuccess):(a.logger.warn(l.O,"forceRemoveChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),B(n.onError,t))}))}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("chatRoomId",e,s.STRING,!0),r("key",t,s.STRING,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(t)),this._context.getChatroomEntry(e,t).then((function(t){var o=t.code,r=t.data;o===c.SUCCESS?L(n.onSuccess,r||""):(a.logger.warn(l.O,"getChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),B(n.onError,o))}))}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("chatRoomId",e,s.STRING,!0),r("callback",t,s.CALLBACK),this.logger.info(l.O,"getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(a){var o=a.code,r=a.data;o===c.SUCCESS?L(t.onSuccess,r):(n.logger.warn(l.O,"getAllChatroomEntries ->code:".concat(o,",chatRoomId:").concat(e)),B(t.onError,o))}))}}),Object.defineProperty(e.prototype,"getChatRoomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o){var i=this;void 0===o&&(o=0),r("chatRoomId",e,s.STRING,!0),r("count",t,s.NUMBER,!0),r("order",n,s.NUMBER,!0),r("callback",a,s.CALLBACK),r("timestamp",o,s.NUMBER),this.logger.info(l.O,"getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,t,n,o).then((function(t){var n=t.code,o=t.data;if(n===c.SUCCESS)if(o){var r=o.list,s=o.hasMore,u=r.map((function(e){return _(e)}));L(a.onSuccess,u,s)}else L(a.onSuccess,[],!1);else i.logger.warn(l.O,"getChatRoomHistoryMessages ->code:".concat(n,",chatRoomId:").concat(e)),B(a.onError,n)}))}}),Object.defineProperty(e.prototype,"setDeviceInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),Object.defineProperty(e.prototype,"getCurrentConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getConnectionStatus()}}),Object.defineProperty(e.prototype,"deleteRemoteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){return this._defaultChannelClient.deleteRemoteMessages(e,t,n,a)}}),Object.defineProperty(e.prototype,"clearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o){r("fileType",e,s.NUMBER,!0),r("fileName",n,s.STRING),r("callback",t,s.CALLBACK),this.logger.info(l.O,"getFileToken ->fileType:".concat(e,",fileName:").concat(n,",queryString:").concat(o)),this._context.getFileToken(e,n,a,o).then((function(e){t.onSuccess(M(M({},e),{bos:""}))})).catch(t.onError)}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,i){r("fileType",e,s.NUMBER,!0),r("fileName",t,s.STRING,!0),r("saveName",n,s.STRING),r("callback",a,s.CALLBACK),r("serverType",i,s.NUMBER),r("uploadRes",o,s.OBJECT),this.logger.info(l.O,"getFileUrl ->fileType:".concat(e,",fileName:").concat(t)),o?a.onSuccess(o):this._context.getFileUrl(e,t,i||f.QINIU,n).then(a.onSuccess).catch(a.onError)}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("tag.tagId",e.tagId,s.STRING,!0),r("tag.tagId",e.tagId,(function(e){return e.length<=10})),r("tag.tagName",e.tagName,(function(e){return e.length<=15})),r("tag.tagName",e.tagName,s.STRING,!0),r("callback",t,s.CALLBACK),this.logger.info(l.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(a){var o=a.code;o===c.SUCCESS?t.onSuccess():(n.logger.warn(l.O,"createTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(a){n.logger.warn(l.O,"createTag ->code:".concat(a,",tagId:").concat(e.tagId)),t.onError(a)}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("tagId",e,s.STRING,!0),r("callback",t,s.CALLBACK),this.logger.info(l.O,"removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(a){var o=a.code;o===c.SUCCESS?t.onSuccess():(n.logger.warn(l.O,"removeTag ->code:".concat(o,",tagId:").concat(e)),t.onError(o))})).catch((function(a){n.logger.warn(l.O,"removeTag ->code:".concat(a,",tagId:").concat(e)),t.onError(a)}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("tag.tagId",e.tagId,s.STRING,!0),r("tag.tagName",e.tagName,s.STRING,!0),r("tag.tagName",e.tagName,(function(e){return e.length<=15})),r("callback",t,s.CALLBACK),this.logger.info(l.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(a){var o=a.code;o===c.SUCCESS?t.onSuccess():(n.logger.warn(l.O,"updateTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(a){n.logger.warn(l.O,"updateTag ->reason:".concat(a,",tagId:").concat(e.tagId)),t.onError(a)}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;r("callback",e,s.CALLBACK),this._context.getTagList().then((function(n){var a=n.code,o=n.data;a===c.SUCCESS?e.onSuccess(o||[]):(t.logger.warn(l.O,"getTagList ->code:".concat(a)),e.onError(a))})).catch((function(n){t.logger.warn(l.O,"getTagList ->reason:".concat(n)),e.onError(n)}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("conversationType",e.type,s.NUMBER),r("targetId",e.targetId,s.STRING),r("channelId",e.channelId,s.ONLY_STRING),r("callback",t,s.CALLBACK),this.logger.info(l.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(F(e)).then((function(e){var a=e.code,o=e.data;a===c.SUCCESS?t.onSuccess(o||[]):(n.logger.warn(l.O,"getTagsForConversation ->code:".concat(a)),t.onError(a))})).catch((function(e){n.logger.warn(l.O,"getTagsForConversation ->reason:".concat(e)),t.onError(e)}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("tagId",e,s.STRING,!0),r("conversations",t,s.ARRAY,!0),r("callback",n,s.CALLBACK),t.forEach((function(e){r("conversation.type",e.type,s.NUMBER,!0),r("conversation.targetId",e.targetId,s.STRING,!0),r("conversation.channelId",e.channelId,s.ONLY_STRING)})),this.logger.info(l.O,"addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,t.map((function(e){return F(e)}))).then((function(t){var o=t.code;t.data,o===c.SUCCESS?n.onSuccess():(a.logger.warn(l.O,"addTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){a.logger.warn(l.O,"addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("tagId",e,s.STRING,!0),r("conversations",t,s.ARRAY,!0),r("callback",n,s.CALLBACK),t.forEach((function(e){r("conversation.type",e.type,s.NUMBER,!0),r("conversation.targetId",e.targetId,s.STRING,!0),r("conversation.channelId",e.channelId,s.ONLY_STRING)})),this.logger.info(l.O,"removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,t.map((function(e){return F(e)}))).then((function(t){var o=t.code;t.data,o===c.SUCCESS?n.onSuccess():(a.logger.warn(l.O,"removeTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){a.logger.warn(l.O,"removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("conversation.type",e.type,s.NUMBER,!0),r("conversation.targetId",e.targetId,s.STRING,!0),r("conversation.channelId",e.channelId,s.ONLY_STRING),r("tagIds",t,s.ARRAY,!0),r("callback",n,s.CALLBACK),t.forEach((function(e){r("tagId",e,s.STRING,!0)})),this.logger.info(l.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(F(e),t).then((function(e){var o=e.code;e.data,o===c.SUCCESS?n.onSuccess():(a.logger.warn(l.O,"removeTagsForConversation ->code:".concat(o,",tagIds:").concat(t)),n.onError(o))})).catch((function(e){a.logger.warn(l.O,"removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(t)),n.onError(e)}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,a,o){var i=this;r("tagId",e,s.STRING,!0),r("count",n,s.NUMBER,!0),r("startTime",a,s.NUMBER,!0),r("callback",o,s.CALLBACK,!0),this.logger.info(l.O,"getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,a,n).then((function(n){var a=n.code,r=n.data,s=[];a===c.SUCCESS?((r=r||[]).forEach((function(e){s.push(function(e){var n=e.channelId,a=e.conversationType,o=e.targetId,r=e.unreadMessageCount,s=e.latestMessage,i=e.isTop,c=e.notificationStatus,l=e.isTopInTag,u=s?_(s):null,g=u||{},d=g.messageType,f=g.sentTime,h=g.receivedStatus;return{channelId:n||"",conversationType:a,targetId:o,unreadMessageCount:r||0,latestMessage:u,isTopInTag:l,latestMessageId:g.messageId,objectName:d,sentTime:f,isTop:i||!1,notificationStatus:c||t.CLOSE,receivedStatus:h}}(e))})),o.onSuccess(s)):(i.logger.warn(l.O,"getConversationListByTag ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(t){i.logger.warn(l.O,"getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("tagId",e,s.STRING,!0),r("containMuted",t,s.BOOLEAN,!0),r("callback",n,s.CALLBACK),this.logger.info(l.O,"getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,t).then((function(t){var o=t.code,r=t.data;a.logger.info(l.O,JSON.stringify({code:o,data:r})),o===c.SUCCESS?n.onSuccess(r||0):(a.logger.warn(l.O,"getUnreadCountByTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){a.logger.warn(l.O,"getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("tagId",e,s.STRING,!0),r("conversation.targetId",t.targetId,s.STRING,!0),r("conversation.type",t.type,s.NUMBER,!0),r("conversation.channelId",t.channelId,s.ONLY_STRING),r("status.isTop",null==n?void 0:n.isTop,s.BOOLEAN,!0),r("callback",a,s.CALLBACK),this.logger.info(l.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",type").concat(t.type)),this._context.setConversationStatusInTag(e,F(t),n).then((function(t){var n=t.code;t.data,n===c.SUCCESS?a.onSuccess():(o.logger.warn(l.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(e)),a.onError(n))})).catch((function(t){o.logger.warn(l.O,"setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),a.onError(t)}))}}),Object.defineProperty(e.prototype,"callExtra",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var n,a=this,o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];this.logger.info(l.O,"callExtra ->method:".concat(e)),(n=this._context).callExtra.apply(n,function(e,t,n){if(n||2===arguments.length)for(var a,o=0,r=t.length;o<r;o++)!a&&o in t||(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))}([e],function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,o,r=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(a=r.next()).done;)s.push(a.value)}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}(o),!1)).then((function(n){var o=n.code,r=n.data;if(o!==c.SUCCESS)a.logger.warn(l.O,"callExtra ->code:".concat(o)),t.onError&&B(t.onError,o);else{if("getHistoryMessagesByObjectNames"===e){var s=r,i=s.list,u=s.hasMore,g=i.map((function(e){return _(e)}));return void L(t.onSuccess,g,u)}t.onSuccess&&L(t.onSuccess,r)}}))}}),Object.defineProperty(e.prototype,"hasRemoteUnreadMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){r("callback",t,s.CALLBACK),this.logger.info(l.O,"hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){L(t.onSuccess,!1)}),"hasRemoteUnreadMessages",t)}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;this.logger.info(l.O,"setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("status",e,s.NUMBER),r("callback",t,s.CALLBACK),this.logger.info(l.O,"setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){n._context.setUserStatus(e).then((function(e){e===c.SUCCESS?L(t.onSuccess,!0):(n.logger.warn(l.O,"setUserStatus ->code:".concat(e)),B(t.onError,e))}))}),"setUserStatus",t)}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("userId",e,s.STRING),r("callback",t,s.CALLBACK),this.logger.info(l.O,"getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getUserStatus(e).then((function(a){var o=a.code,r=a.data;o===c.SUCCESS?L(t.onSuccess,r):(n.logger.warn(l.O,"getUserStatus ->code:".concat(o,",useerId:").concat(e)),B(t.onError,o))}))}),"getUserStatus",t)}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("userId",e,s.STRING),r("callback",t,s.CALLBACK),this.logger.info(l.O,"addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.addToBlacklist(e).then((function(a){a===c.SUCCESS?L(t.onSuccess):(n.logger.warn(l.O,"addToBlacklist ->code:".concat(a,",useerId:").concat(e)),B(t.onError,a))}))}),"addToBlacklist",t)}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("userId",e,s.STRING),r("callback",t,s.CALLBACK),this.logger.info(l.O,"removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.removeFromBlacklist(e).then((function(a){a===c.SUCCESS?L(t.onSuccess):(n.logger.warn(l.O,"removeFromBlacklist ->code:".concat(a,",useerId:").concat(e)),B(t.onError,a))}))}),"removeFromBlacklist",t)}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;r("callback",e,s.CALLBACK),this.assertCPPMode((function(){t._context.getBlacklist().then((function(n){var a=n.code,o=n.data;a===c.SUCCESS?L(e.onSuccess,o):(t.logger.warn(l.O,"getBlacklist ->code:".concat(a)),B(e.onError,a))}))}),"getBlacklist",e)}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("userId",e,s.STRING),r("callback",t,s.CALLBACK),this.logger.info(l.O,"getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getBlacklistStatus(e).then((function(a){var o=a.code,r=a.data;o===c.SUCCESS?L(t.onSuccess,r):(n.logger.warn(l.O,"getBlacklistStatus ->code:".concat(o,",userId:").concat(e)),B(t.onError,o))}))}),"getBlacklistStatus",t)}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o){var i=this;void 0===o&&(o={}),r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("content.senderUserId",n.senderUserId,s.STRING,!0),r("content.messageDirection",n.messageDirection,s.NUMBER,!0),r("content.objectName",n.objectName,s.STRING,!0),r("callback",a,s.CALLBACK),this.logger.info(l.O,"insertMessage ->targetId:".concat(t,",conversationType:").concat(e,",senderUserId:").concat(n.senderUserId)),this.assertCPPMode((function(){i._defaultChannelClient.insertMessage(e,t,n,a,o)}),"insertMessage",a)}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a,o,i=this;for(var c in r("messages",e,(function(t){return h(t)&&!(e.length<=0||e.length>=500)}),!0),r("checkDuplicate",t,s.BOOLEAN),r("callback",n,s.CALLBACK),e)r("message",e[c],s.OBJECT,!0),r("message.conversationType",e[c].conversationType,(function(e){return[p.PRIVATE,p.DISCUSSION,p.GROUP,p.CUSTOMER_SERVICE,p.SYSTEM,p.APP_PUBLIC_SERVICE,p.PUBLIC_SERVICE].includes(e)}),!0),r("message.targetId",e[c].targetId,s.STRING,!0),r("message.senderUserId",e[c].senderUserId,s.STRING,!0),r("message.messageType",e[c].messageType,s.STRING,!0),r("message.content",e[c].content,s.OBJECT,!0),r("message.messageDirection",e[c].messageDirection,s.NUMBER,!0),r("message.canIncludeExpansion",e[c].canIncludeExpansion,s.BOOLEAN),r("message.expansion",e[c].expansion,s.OBJECT),r("message.disableNotification",e[c].disableNotification,s.BOOLEAN),r("message.sentTime",e[c].sentTime,s.NUMBER),r("message.sentStatus",e[c].sentStatus,s.NUMBER),r("options.isUnread",null===(a=e[c])||void 0===a?void 0:a.isUnread,s.BOOLEAN),r("options.searchContent",null===(o=e[c])||void 0===o?void 0:o.searchContent,s.STRING);this.assertCPPMode((function(){i._defaultChannelClient.batchInsertMessage(e,t,n)}),"batchInsertMessage",n)}}),Object.defineProperty(e.prototype,"getMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("callback",n,s.CALLBACK),this.assertCPPMode((function(){a._defaultChannelClient.getMessageCount(e,t,n)}),"getMessageCount",n)}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,i){var c=this;void 0===i&&(i={}),r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("timestamp",n,s.NUMBER,!0),r("count",a,s.NUMBER,!0),r("callback",o,s.CALLBACK),r("options.order",i.order,s.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,t,n,a,o,i)}),"getRemoteHistoryMessages",o)}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("messageIds",n,s.ARRAY,!0),r("callback",a,s.CALLBACK),this.logger.info(l.O,"deleteLocalMessages ->messageIds:".concat(n)),this.assertCPPMode((function(){o._context.deleteMessages(n).then((function(e){e===c.SUCCESS?L(a.onSuccess,!0):(o.logger.warn(l.O,"deleteLocalMessages ->code:".concat(e,",messageIds:").concat(n)),B(a.onError,e))}))}),"deleteLocalMessages",a)}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o){var i=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("timestamp",n,s.NUMBER,!0),r("cleanSpace",a,s.BOOLEAN),r("callback",o,s.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.deleteLocalMessagesByTimestamp(e,t,n,a,o)}),"deleteLocalMessagesByTimestamp",o)}}),Object.defineProperty(e.prototype,"clearMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("callback",n,s.CALLBACK),this.assertCPPMode((function(){a._defaultChannelClient.clearMessages(e,t,n)}),"clearMessages",n)}}),Object.defineProperty(e.prototype,"getMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;r("callback",t,s.CALLBACK),this.assertCPPMode((function(){n._context.getLocalMessage(e).then((function(a){var o=a.code,r=a.data;o===c.SUCCESS?L(t.onSuccess,_(r)):(n.logger.warn(l.O,"getMessage ->code:".concat(o,",messageId:").concat(e)),B(t.onError,o))}))}),"getMessage",t)}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("messageId",e,s.NUMBER,!0),r("sentStatus",t,s.NUMBER,!0),this.logger.info(l.O,"setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(t)),this.assertCPPMode((function(){a._context.setMessageSentStatus(e,t).then((function(t){t===c.SUCCESS?L(n.onSuccess,!0):(a.logger.warn(l.O,"setMessageSentStatus ->code:".concat(t,",messageId:").concat(e)),B(n.onError,t))}))}),"setMessageSentStatus",n)}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("messageId",e,s.NUMBER,!0),r("receivedStatus",t,s.NUMBER,!0),this.logger.info(l.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),this.assertCPPMode((function(){a._context.setMessageReceivedStatus(e,t).then((function(t){t===c.SUCCESS?L(n.onSuccess,!0):(a.logger.warn(l.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),B(n.onError,t))}))}),"setMessageReceivedStatus",n)}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("messageId",e,s.NUMBER,!0),r("objectName",n,s.ONLY_STRING,!0),this.assertCPPMode((function(){o.logger.info(l.A_SET_MSG_CONTENT_O,JSON.stringify({messageId:e,objectName:n})),o._context.setMessageContent(e,t,n).then((function(e){e===c.SUCCESS?L(a.onSuccess,!0):B(a.onError,e)}))}),"setMessageContent",a)}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("messageId",e,s.NUMBER,!0),r("searchFiles",n,s.STRING,!0),this.logger.info(l.O,"setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(n)),this.assertCPPMode((function(){a._context.setMessageSearchField(e,t,n)}),"setMessageSearchField")}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("keyword",e,s.STRING,!0),r("callback",t,s.CALLBACK),r("conversationTypes",n,s.ARRAY),r("customMessageType",a,s.ARRAY),this.assertCPPMode((function(){o._defaultChannelClient.searchConversationByContent(e,t,n,a)}),"searchConversationByContent",t)}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;void 0===n&&(n=[]),r("keyword",e,s.STRING,!0),r("callback",t,s.CALLBACK),r("conversationTypes",a,s.ARRAY),r("customMessageType",n,s.ARRAY),this.assertCPPMode((function(){o._defaultChannelClient.searchConversationByContentWithAllChannel(e,t,n,a)}),"searchConversationByContentWithAllChannel",t)}}),Object.defineProperty(e.prototype,"searchMessageByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,i,c){var l=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("keyword",n,s.STRING,!0),r("timestamp",a,s.NUMBER),r("count",o,s.NUMBER),r("total",i,s.NUMBER),r("callback",c,s.CALLBACK),this.assertCPPMode((function(){l._defaultChannelClient.searchMessageByContent(e,t,n,a,o,i,c)}),"searchMessageByContent",c)}}),Object.defineProperty(e.prototype,"searchMessageByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,i){var c=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("keyword",n,s.STRING,!0),r("timestamp",a,s.NUMBER),r("count",o,s.NUMBER),r("callback",i,s.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.searchMessageByContentWithAllChannel(e,t,n,a,o,i)}),"searchMessageByContentWithAllChannel",i)}}),Object.defineProperty(e.prototype,"searchMessageByContentInTimeRangeWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a,o,i,c,l){var u=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("keyword",n,s.STRING,!0),r("startTime",a,s.NUMBER),r("endTime",o,s.NUMBER),r("offset",i,s.NUMBER),r("limit",c,s.NUMBER),r("callback",l,s.CALLBACK),this.assertCPPMode((function(){u._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,a,o,i,c,l)}),"searchMessageByContentInTimeRangeWithAllChannel",l)}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isCPPMode?(r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,t)):(this.logger.error(l.O,"getUnreadMentionedMessages method is not supported in a browser!"),null)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,a){var o=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),r("timestamp",n,s.NUMBER,!0),this.assertCPPMode((function(){o._defaultChannelClient.clearUnreadCountByTimestamp(e,t,n,a)}),"clearUnreadCountByTimestamp",a)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._defaultChannelClient.getFirstUnreadMessage(e,t,n)}}),Object.defineProperty(e.prototype,"getConversationNotificationStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var a=this;r("conversationType",e,s.NUMBER,!0),r("targetId",t,s.STRING,!0),this.assertCPPMode((function(){a._defaultChannelClient.getConversationNotificationStatus(e,t,n)}),"getConversationNotificationStatus",n)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getGroupMessageDeliverList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._defaultChannelClient.getGroupMessageDeliverList(e,t,n)}}),Object.defineProperty(e.prototype,"getPrivateMessageDeliverTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)}}),e}(),H=1;C.add("imlib-v2-adapter","5.20.0");var J,W,Y=null,q={init:function(e,t,n){var a;void 0===n&&(n={}),r("appkey",e,s.STRING,!0),J=new b("API-V2"),G=v.init({appkey:e,navigators:n.navi?[n.navi]:[],miniCMPProxy:[],logOutputLevel:n.logOutputLevel,typingExpireTime:n.typingExpireTime,httpInMainProcess:!!n.httpInMainProcess,logExpireTime:n.logExpireTime,environment:null!==(a=n.environment)&&void 0!==a?a:"default",eventLoopBlockingCheck:n.eventLoopBlockingCheck}),Y=G.logger,H=Math.min(15,Math.max(n.readReceiptTimeout||1,1)),k=new V(G,{readReceiptTimeout:H},Y,J),m.init(Y)},getInstance:function(){return k},setConnectionStatusListener:function(e){throw new Error("Please use `onConnectionStatusChange()` instead of `setConnectionStatusListener()`")},onConnectionStatusChange:function(e){G.assignWatcher({connection:function(t,n){try{e.onChanged(t,n)}catch(e){null==Y||Y.error(l.L_CALLBACK_E,"onConnectionStatusChange -> ".concat(e.stack))}}})},setOnReceiveMessageListener:function(e){G.assignWatcher({message:function(t,a,o){try{var r=_(t),s=G.getCurrentUserId(),i=G.getConnectedTime();A(r,s,i,H,J),r=function(e,t,n,a,o){var r=new Date(n-1e3*a*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!r)return e;var s=e.content,i=((s=s||{}).receiptMessageDic||{})[t],c="",l={};if(e.receiptResponse=e.receiptResponse||{},i){for(var u=[],g=0;g<i.length;g++)c="".concat(t).concat(i[g],"SENT"),(l=o.get(c))&&!(e.senderUserId in l.userIds)&&(u.push(i[g]),l.count+=1,l.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[i[g]]=l.count,o.set(c,l));s.receiptMessageDic[t]=u,e.content=s}return e}(r,s,i,H,J),n()||P.set(t),e.onReceived(r,void 0,o)}catch(e){null==Y||Y.error(l.L_CALLBACK_E,"setOnReceiveMessageListener -> ".concat(e.stack))}}})},setConversationStatusListener:function(e){G.assignWatcher({conversationState:function(t){try{var n=[];t.forEach((function(e){var t=e.updatedItems,a=e.conversationType,o=e.targetId,r=e.channelId,s=(t=t||{}).notificationStatus,i=t.isTop;s&&i&&n.push({notificationStatus:s.val,isTop:i.val,conversationType:a,targetId:o,channelId:r||"",updatedTime:s.time})})),n.length>0&&e.onChanged(n)}catch(e){null==Y||Y.error(l.O,"setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){G.assignWatcher({expansion:function(t){try{t.updatedExpansion&&e.onUpdated(t.updatedExpansion),t.deletedExpansion&&e.onDeleted(t.deletedExpansion)}catch(e){null==Y||Y.error(l.O,"setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){G.assignWatcher({tag:function(){try{e.onChanged()}catch(e){null==Y||Y.error(l.O,"setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){G.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){null==Y||Y.error(l.O,"setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){G.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){null==Y||Y.error(l.O,"setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){G.assignWatcher({typingState:function(t){try{e.onChanged(t)}catch(e){null==Y||Y.error(l.O,"setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){G.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){G.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){G.assignWatcher({messageDelivered:function(t){try{e.onDelivered(t)}catch(e){null==Y||Y.error(l.O,"setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){G.assignWatcher({groupMessageDeliveredStatus:function(t){try{e.onDelivered(t)}catch(e){null==Y||Y.error(l.O,"setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,t,n){return T(this,void 0,void 0,(function(){var a,o,r;return O(this,(function(s){switch(s.label){case 0:return a=null==Y?void 0:Y.createTraceId(),null==Y||Y.info(l.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:!1}),a),[4,G.connect(e,!!n,a)];case 1:return o=s.sent(),r=o.code===c.SUCCESS?"info":"warn",null==Y||Y[r](l.A_CONNECT_R,JSON.stringify({code:o.code,userId:o.userId}),a),o.code===c.SUCCESS?(t.onSuccess(o.userId),i=new Date(G.getConnectedTime()-1e3*H*60*60*24).getTime(),J.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=J.get(e).dealtime;t&&i-t>0&&J.remove(e)}else if(/RECEIVED$/.test(e)){var n=J.get(e),a=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&i-t>0&&delete n[e]})),Object.keys(n).length!==a&&(0===n.length?J.remove(e):J.set(e,n))}}))):o.code===c.RC_CONN_TOKEN_INCORRECT?(null==Y||Y.warn(l.O,"connect ->code:".concat(o.code,",token:").concat(e)),t.onTokenIncorrect()):(null==Y||Y.warn(l.O,"connect ->code:".concat(o.code,",token:").concat(e)),t.onError(o.code)),[2]}var i}))}))},reconnect:function(e,t,n){var a=null==Y?void 0:Y.createTraceId();null==Y||Y.info(l.A_RECONNECT_T,null,a),G.reconnect(n).then((function(t){var n=t.code===c.SUCCESS?"info":"warn";null==Y||Y[n](l.A_RECONNECT_R,JSON.stringify({code:t.code,userId:t.userId}),a),t.code===c.SUCCESS?e.onSuccess(t.userId):(null==Y||Y.warn(l.O,"reconnect ->code:".concat(t.code)),e.onError(t.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:U,getMessageObjectName:function(e){var t=M(M({},N),U);return Object.keys(t).find((function(n){return t[n]===e}))||e},registerMessageType:function(e,t,n,a){this.RegisterMessage[e]=x(e,t,n.isPersited,n.isCounted),this.RegisterMessageTypeMapping[t]=e,G.registerMessageType(t,n.isPersited,n.isCounted,a)}},Q=function(e,t,n){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"userIdList",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"mentionedContent",{enumerable:!0,configurable:!0,writable:!0,value:n})},X=function(e,t){Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:t})},$=x("TextMessage","RC:TxtMsg"),z=x("LocationMessage","RC:LBSMsg"),Z=x("TypingStatusMessage","RC:TypSts"),ee=x("ImageMessage","RC:ImgMsg"),te=x("RichContentMessage","RC:ImgTextMsg"),ne=x("VoiceMessage","RC:VcMsg"),ae=x("HQVoiceMessage","RC:HQVCMsg"),oe=x("FileMessage","RC:FileMsg"),re=x("SightMessage","RC:SightMsg"),se=x("GIFMessage","RC:GIFMsg"),ie=x("ReadReceiptMessage","RC:ReadNtf"),ce=x("ReadReceiptRequestMessage","RC:RRReqMsg"),le=x("RCCombineMessage","RC:CombineMsg"),ue=function(e,t,n,a,o,r,s,i,c,l,u,g,d,f,h,p,C,b){Object.defineProperty(this,"conversationType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"senderUserId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"objectName",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"messageDirection",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"offLineMessage",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"sentStatus",{enumerable:!0,configurable:!0,writable:!0,value:u}),Object.defineProperty(this,"sentTime",{enumerable:!0,configurable:!0,writable:!0,value:g}),Object.defineProperty(this,"receivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:d}),Object.defineProperty(this,"receivedTime",{enumerable:!0,configurable:!0,writable:!0,value:f}),Object.defineProperty(this,"canIncludeExpansion",{enumerable:!0,configurable:!0,writable:!0,value:h}),Object.defineProperty(this,"expansion",{enumerable:!0,configurable:!0,writable:!0,value:p}),Object.defineProperty(this,"receiptResponse",{enumerable:!0,configurable:!0,writable:!0,value:C}),Object.defineProperty(this,"disableNotification",{enumerable:!0,configurable:!0,writable:!0,value:b})};!function(e){e[e.MEDIA_AUDIO=1]="MEDIA_AUDIO",e[e.MEDIA_VEDIO=2]="MEDIA_VEDIO",e[e.MEDIA_VIDEO=2]="MEDIA_VIDEO"}(W||(W={}));var ge,de=x("AcceptMessage","RC:VCAccept"),fe=x("RingingMessage","RC:VCRinging"),he=x("SummaryMessage","RC:VCSummary"),pe=x("HungupMessage","RC:VCHangup"),Ce=x("InviteMessage","RC:VCInvite"),be=x("MediaModifyMessage","RC:VCModifyMedia"),ve=x("MemberModifyMessage","RC:VCModifyMem"),me=x("lastMessageSendTime","RC:SRSMsg"),ye=x("ReferenceMessage","RC:ReferenceMsg"),Ie=x("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),Se=x("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(ge||(ge={}));var Re=ge,Me={ACCEPTED:0,UNACCEPTABLE_PROTOCOL_VERSION:1,IDENTIFIER_REJECTED:2,SERVER_UNAVAILABLE:3,TOKEN_INCORRECT:4,NOT_AUTHORIZED:5,REDIRECT:6,PACKAGE_ERROR:7,APP_BLOCK_OR_DELETE:8,BLOCK:9,TOKEN_EXPIRE:10,DEVICE_ERROR:11,HOSTNAME_ERROR:12,HASOHTERSAMECLIENTONLINE:13,OUT_OF_LIMIT:14,IN_OTHER_CLUSTER:15,APP_AUTH_NOT_PASS:16,OTP_USED:17,PLATFORM_ERROR:18,USER_LOGOUT:19,ACCOUNT_CANCELLATION:19,LICENSE_EXPIRED:20};window&&(window.RongIMClient=q);export{de as AcceptMessage,j as BaseMessage,K as ChannelClient,Me as ConnectionState,oe as FileMessage,se as GIFMessage,R as GetChatRoomType,ae as HQVoiceMessage,pe as HungupMessage,V as IMClient,ee as ImageMessage,Ce as InviteMessage,z as LocationMessage,be as MediaModifyMessage,ve as MemberModifyMessage,Q as MentionedInfo,Re as MentionedType,ue as Message,X as MessageTag,Se as PublicServiceMultiRichContentMessage,Ie as PublicServiceRichContentMessage,le as RCCombineMessage,ie as ReadReceiptMessage,ce as ReadReceiptRequestMessage,D as ReadReceiptResponseMessage,ye as ReferenceMessage,te as RichContentMessage,fe as RingingMessage,q as RongIMClient,S as SentStatus,re as SightMessage,he as SummaryMessage,me as SyncReadStatusMessage,$ as TextMessage,Z as TypingStatusMessage,W as VoIPMediaType,ne as VoiceMessage};
|