@rongcloud/imlib-next 5.7.8 → 5.7.10

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.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@rongcloud/engine"),t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)};function n(e,t,n,o){return new(n||(n=Promise))((function(r,s){function a(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((o=o.apply(e,t||[])).next())}))}function o(e,t){var n,o,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,i[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var r=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},s=r(),a=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var i,c={tag:"browser",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,i=t.body,c=e.appendUrl(t.url,s);return new Promise((function(e){var t=a(),s="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(n,c),r&&t.setRequestHeader)for(var d in r)t.setRequestHeader(d,r[d]);if(s){t.timeout=o,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status})},t.ontimeout=function(){e({status:t.status})};var u="object"==typeof i?JSON.stringify(i):i;t.send(u)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status})},setTimeout((function(){t.abort(),e({status:t.status})}),o),t.send(i)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:s,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return Promise.resolve(r)}},d=r(),u=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},l={setItem:u("setStorageSync"),getItem:u("getStorageSync"),removeItem:u("removeStorageSync"),clear:u("clearStorageSync")},g={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){wx.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:l,sessionStorage:l,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:d,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},v=r(),f=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},R={setItem:f("setStorageSync"),getItem:f("getStorageSync"),removeItem:f("removeStorageSync"),clear:f("clearStorageSync")},E={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s),c=t.dataType||"json";return new Promise((function(t){my.request({url:i,method:n,headers:r,timeout:o,data:a,dataType:c,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:R,sessionStorage:R,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,createWebSocket:function(e){return my.connectSocket({url:e}),{id:Date.now(),onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},I=r(),p=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},T={setItem:p("setStorageSync"),getItem:p("getStorageSync"),removeItem:p("removeStorageSync"),clear:p("clearStorageSync")},h={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:I,localStorage:T,sessionStorage:T,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},m=r(),C=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},S={setItem:C("setStorageSync"),getItem:C("getStorageSync"),removeItem:C("removeStorageSync"),clear:C("clearStorageSync")},A={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:m,localStorage:S,sessionStorage:S,httpReq:function(t){return new Promise((function(n,o){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))}},O=r(),N=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},_={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},y={tag:"jingdong",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){jd.request({url:i,method:n,headers:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:_,sessionStorage:_,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:O,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},M=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},U={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},L={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){uni.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:U,sessionStorage:U,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},P=function(e){return e&&e.request&&e.getSystemInfo},x="undefined"!=typeof uni&&P(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return L;case"mp-jd":return y;case"mp-baidu":return A;case"mp-toutiao":return h;case"mp-alipay":return E;case"mp-weixin":return g;default:return c}}():"undefined"!=typeof jd&&P(jd)?y:"undefined"!=typeof my&&P(my)?E:"undefined"!=typeof tt&&P(tt)?h:"undefined"!=typeof swan&&P(swan)?A:"undefined"!=typeof wx&&P(wx)?g:c;function w(t){var n=t.conversationType,o=t.channelId,r=t.messageType,s=t.content,a=t.senderUserId,i=t.targetId,c=t.sentTime,d=t.receivedTime,u=t.messageUId,l=t.messageDirection,g=t.isPersited,v=t.isCounted,f=t.isOffLineMessage,R=t.canIncludeExpansion,E=t.expansion,I=t.receivedStatus,p=t.disableNotification,T=t.isMentioned,h=t.isStatusMessage,m=t.readReceiptInfo,C=t.pushConfig,S=t.messageId,A=t.isInterrupt,O=t.isModifyMessage,N=t.channelType,_=t.sentStatus;I||(I=e.ReceivedStatus.UNREAD);var y={messageType:r,channelId:o||"",content:s,senderUserId:a,targetId:i,conversationType:n,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:g,isCounted:v,isMentioned:T,disableNotification:p,isStatusMessage:h,canIncludeExpansion:R,expansion:E,receivedStatus:I,readReceiptInfo:m,pushConfig:C,messageId:S,isInterrupt:A,isModifyMessage:O,sentStatus:_};return n!==e.ConversationType.ULTRA_GROUP&&(y.isOffLineMessage=f),n===e.ConversationType.ULTRA_GROUP&&e.isNumber(N)&&(y.channelType=N),y}function b(t){var n=t.conversationType,o=t.targetId,r=t.latestMessage,s=t.unreadMessageCount,a=t.hasMentioned,i=t.mentionedInfo,c=t.lastUnreadTime,d=t.notificationStatus,u=t.notificationLevel,l=t.isTop,g=t.channelId,v=t.unreadMentionedCount,f=t.matchCount,R={conversationType:n,targetId:o,latestMessage:r&&w(r),unreadMessageCount:s,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:d,notificationLevel:u,isTop:l,channelId:g,unreadMentionedCount:v,matchCount:f};return R.conversationType===e.ConversationType.ULTRA_GROUP&&(R.firstUnreadMessage=t.firstUnreadMessage,R.channelType=t.channelType),R}function B(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(i=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",i.CONNECTED="CONNECTED",i.DISCONNECT="DISCONNECT",i.SUSPEND="SUSPEND",i.MESSAGES="MESSAGES",i.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",i.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",i.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",i.CONVERSATION="CONVERSATION",i.CHATROOM="CHATROOM",i.EXPANSION="EXPANSION",i.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",i.TAG="TAG",i.CONVERSATION_TAG="CONVERSATION_TAG",i.TYPING_STATUS="TYPING_STATUS",i.MESSAGE_BLOCKED="MESSAGE_BLOCKED",i.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",i.OPERATE_STATUS="OPERATE_STATUS",i.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",i.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",i.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",i.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",i.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",i.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",i.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",i.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",i.USER_GROUP_STATUS="USER_GROUP_STATUS";var D=new e.EventEmitter,G={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:D.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:D.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:D.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:D.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){D.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return w(e)}))})},typingState:function(e){D.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){D.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){D.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){D.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,o={conversationType:n,latestMessage:t.latestMessage?w(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(o.versionTime=t.versionTime,{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));D.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){D.emit(exports.Events.CHATROOM,e)},expansion:function(e){D.emit(exports.Events.EXPANSION,e)},pullFinished:function(){D.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){D.emit(exports.Events.TAG)},conversationTagChanged:function(){D.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){D.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){D.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){D.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){D.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return b(e)})))},operateStatus:function(e){D.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return w(e)})))},ultraGroupMessageModified:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return w(e)})))},ultraGroupMessageRecalled:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return w(e)})))},ultraGroupChannelChangeType:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){D.emit(exports.Events.USER_GROUP_STATUS,e)}};e.VersionManage.add("imlib-next","5.7.8");var V=null,k=null,H=null;function F(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return V?(H.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),k=null,V=null,H=null,[2]}}))}))}function Z(e){if(!V)throw new Error("Not initialized yet!");return e(V,H,k)}function q(t){return V?t(V,H,k):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function J(){D.clear()}var z={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},j={};for(var K in z){var Y=z[K].code;j[Y]=K}z.ROAMING_SERVICE_UNAVAILABLE.code;var W=function(t,n,o){void 0===o&&(o="");var r="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return t.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),r},X=function(t,r,s,a){return void 0===a&&(a=""),n(void 0,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=W(t,r,a),[4,s()];case 1:return(i=o.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(a," fail -> ").concat(i," : ").concat(j[i]," , ").concat(n)),[2,{code:i,msg:j[i]}]):[2,{code:i}]}}))}))};var Q=function(t){return!!(e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.value",t.value,e.AssertRules.STRING,!0)&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))},$=function(t){return t.entries.every((function(t){return e.validate("entry.key",t.key,e.AssertRules.STRING,!0)&&e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)&&e.validate("options.isForce",t.isForce,e.AssertRules.BOOLEAN)},ee=function(t){return e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)},te=function(t){return t.entries.every((function(t){return e.validate("key",t,e.AssertRules.STRING,!0)}))&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)};var ne=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function oe(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new ne(e,o,t,n)}}var re,se,ae=oe("RC:ImgMsg"),ie=oe("RC:HQVCMsg"),ce=oe("RC:SightMsg"),de=oe("RC:TxtMsg"),ue=oe("RC:CombineMsg"),le=oe("RC:FileMsg"),ge=oe("RC:GIFMsg"),ve=oe("RC:VcMsg"),fe=oe("RC:LBSMsg"),Re=oe("RC:ReferenceMsg"),Ee=oe("RC:ImgTextMsg"),Ie={qiniu:function(t,n,o,r){Z((function(s){var a=s.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&n.chunk_size&&r.size>n.chunk_size){var i=e.getUUID();i+=r.name.substr(r.name.lastIndexOf(".")),r.uniqueName=i,Ne(r,n,o)}else Oe(t,n,o,r)}))},baidu:function(e,t,n,o){if(o.size>Te.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||se;var s=new XMLHttpRequest,a=Ce();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var i=a+pe[0][1]+r.bosUploadPath;pe.shift();var c=r.bosHeader||{},d={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:i,isBosRes:!0};s.upload&&t.support_options&&(s.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});s.onreadystatechange=function(){if(4===s.readyState)if(JSON.parse(s.responseText||"{}").filename=t.uniqueValue,200===s.status){n.onCompleted(d,!0)}else pe.length?Ie[pe[0][0]](e,t,n,o):n.onError("upload fail")},s.open(t.method,i,!0),s.setRequestHeader("authorization",c.bosToken),s.setRequestHeader("x-bce-date",c.bosDate),s.send(o)},aliyun:function(t,n,o,r){if(r.size>Te.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var s=new FormData;s.set("file",t.get("file")),s.set("key",t.get("key")),s.set("token",t.get("token"));var a=pe[0][1];pe.shift(),t=t||re,n=(n=n||{})||se;var i=new XMLHttpRequest,c=Ce(),d="".concat(c+n.ossBucketName,".").concat(a);i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var t=JSON.parse(i.responseText||"{}");t.name=n.uniqueValue,t.filename=n.uploadFileName,t.uploadMethod=e.UploadMethod?e.UploadMethod.ALI:"",200===i.status?o.onCompleted(t):pe.length?Ie[pe[0][0]](s,n,o,r):o.onError("upload fail")}},i.open(n.method,d,!0),console.log("ali:url",d);var u=n.aliHeader||{};t.set("OSSAccessKeyId",u.osskeyId),t.set("policy",u.ossPolicy),t.set("Signature",u.ossSign),t.set("success_action_status",200),t.delete("key"),t.append("key",n.uploadFileName),t.delete("file"),t.append("file",r),i.send(t)},s3:function(t,n,o,r){var s=new FormData,a=new XMLHttpRequest,i=Ce(),c=n.contentDisposition,d=pe[0][1],u="".concat(i+n.s3BucketName,".").concat(d);console.log("uploadS3:url",u),pe.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var s=JSON.parse(a.responseText||"{}");if(s.name=n.uniqueValue,s.filename=n.uploadFileName,s.uploadMethod=e.UploadMethod.AWS,200===a.status||204===a.status)o.onCompleted(s);else if(pe.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Ie[pe[0][0]](i,n,o,r)}else o.onError("upload fail")}},a.open(n.method,u,!0);var l=n?n.s3Header:{},g=r&&r.type;c?s.set("Content-Disposition","".concat(c,";")):s.set("Content-Disposition","text/html"===g?"inline;":"attachment;");s.set("Content-Type",g),s.set("x-amz-credential",l.s3Credential),s.set("x-amz-algorithm",l.s3Algorithm),s.set("x-amz-date",l.s3Date),s.set("policy",l.s3Policy),s.set("x-amz-signature",l.s3Signature),s.set("key",n.uploadFileName),s.set("file",r),a.send(s)},stc:_e,minio:_e},pe=[],Te={BOS_CHUNCK_SIZE:5368709120},he="http://",me="https://";function Ce(){var e=me;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=he),e}var Se,Ae=(Se="RC-upload-",{get:function(e){e=Se+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=Se+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Se+e,localStorage.removeItem(e)}});function Oe(t,n,o,r){var s=me+n.uploadHost.qiniu,a=(/http/.test(pe[0][1])?"":Ce())+pe[0][1]||s;n.isChunk||pe.shift();var i=new XMLHttpRequest;i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var s=JSON.parse(i.responseText||"{}");s.filename=n.uniqueValue,s.uploadMethod=e.UploadMethod?e.UploadMethod.QINIU:"",200===i.status||204===i.status?o.onCompleted(s):pe.length?Ie[pe[0][0]](t,n,o,r):o.onError("upload fail")}},i.open(n.method,a,!0),o.onOpen(i),n.stream&&i.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(n.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(t)}function Ne(t,n,o,r){var s=0,a=r||e.getUUID(),i=Ae.get(a);i&&(t.uniqueName=i.sessionId,s=i.offset);var c=Math.min(n.chunk_size,t.size-s),d=t.slice(s,s+c),u=t.uniqueName;n.multi_parmas.name=u,n.filesize=t.size;var l="bytes=".concat(s,"-").concat(s+c);n.headers={Range:l,"X-File-TransactionId":u,"X-File-Total-Size":t.size},n.isChunk=!0,d.name=t.name,d=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var s=t.multi_parmas[r];o.append(r,s)}return o}(d,n,t.uniqueName),Oe(d,n,{onCompleted:function(e){s+=c;var r=t.uniqueName;Ae.set(a,{offset:s,sessionId:r}),s<t.size?Ne(t,n,o,a):(s=0,Ae.remove(a),o.onCompleted(e))},onError:function(e){console.error(e),o.onError(e)},onProgress:function(e,t){var r=e+s;o.onProgress(r,n.filesize)},onOpen:function(e){o.onOpen(e)}},t)}function _e(t,n,o,r,s){var a=new XMLHttpRequest,i=n.contentDisposition,c=pe[0][1],d=s===e.UploadMethod.STC?n.stcBucketName:n.minioBucketName,u="https://".concat(c,"/").concat(d,"/").concat(n.uploadFileName);pe.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");if(e.name=n.uniqueValue,e.filename=n.uploadFileName,e.uploadMethod=s,200===a.status||204===a.status)o.onCompleted(e);else if(pe.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Ie[pe[0][0]](i,n,o,r)}else o.onError("upload fail")}},a.open("PUT",u,!0);var l=n.stcHeader.stcAuthorization,g=n.stcHeader.stcContentSha256,v=n.stcHeader.stcDate;s===e.UploadMethod.MINIO&&(l=n.minioHeader.minioAuthorization,g=n.minioHeader.minioContentSha256,v=n.minioHeader.minioDate),a.setRequestHeader("Content-Type",r.type),i?a.setRequestHeader("Content-Disposition","".concat(i,";")):a.setRequestHeader("Content-Disposition","text/html"===r.type?"inline;":"attachment;"),a.setRequestHeader("Authorization",l),a.setRequestHeader("x-amz-content-sha256",g),a.setRequestHeader("x-amz-date",v),a.send(r)}function ye(t,n,o,r,s,a){var i,c,d=n&&n.type||"text/plain",u=d.indexOf("image")>-1?1:4,l=o.contentDisposition,g=Math.ceil(n.size/o.stc_chunk_size),v=s===e.UploadMethod.STC?o.stcBucketName:o.minioBucketName,f="uploads";t.getFileToken(u,n.name,"POST",f).then((function(t){i=t.fileName,c="https://".concat(a,"/").concat(v,"/").concat(i),console.log("uploadStcMultipart:url",c);var o=new XMLHttpRequest;o.open("POST","".concat(c,"?").concat(f),!0),l?o.setRequestHeader("Content-Disposition","".concat(l,";")):o.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;");var u=t.stcAuthorization,R=t.stcContentSha256,E=t.stcDate;s===e.UploadMethod.MINIO&&(u=t.minioAuthorization,R=t.minioContentSha256,E=t.minioDate),o.setRequestHeader("Authorization",u),o.setRequestHeader("x-amz-content-sha256",R),o.setRequestHeader("x-amz-date",E),o.setRequestHeader("Content-Type",d),o.send(),o.onreadystatechange=function(){if(4===o.readyState){var e=o.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===o.status||204===o.status?function(e){for(var t=[],n=1;n<=g;n++)t.push(p(e,n));I(e,t)}(Array.isArray(e)&&e[1]):r.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));var R=[],E=new Map;function I(o,a){a&&Array.isArray(a)&&0!==a.length&&Promise.all(a).then((function(){var a="uploadId=".concat(o);if(E.size===g)t.getFileToken(u,i,"POST",a).then((function(t){console.log("onSuccess",t),console.log("onSuccess:uploadId",o);var u=t.stcAuthorization,l=t.stcContentSha256,g=t.stcDate;s===e.UploadMethod.MINIO&&(u=t.minioAuthorization,l=t.minioContentSha256,g=t.minioDate);var v=new XMLHttpRequest;v.open("POST","".concat(c,"?").concat(a),!0),v.setRequestHeader("Authorization",u),v.setRequestHeader("x-amz-content-sha256",l),v.setRequestHeader("x-amz-date",g),v.setRequestHeader("Content-Type",d);var f="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",R=Array.from(E.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",R),R.forEach((function(e){f+="<Part><ETag>".concat(E.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),f+="</CompleteMultipartUpload>",v.send(f),console.log("xml",f),v.onreadystatechange=function(){if(4===v.readyState)if(200===v.status||204===v.status){var e={name:n.name,filename:i,uploadMethod:s};r.onCompleted(e)}else r.onError("uploadStcMultipart:upload does not end")}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));else{for(var l=[],v=0,f=R;v<f.length;v++){var T=f[v];l.push(p(o,T))}I(o,l)}}),(function(e){console.error(e),r.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,s=R;n<s.length;n++){var a=s[n];t.push(p(o,a))}I(o,t)}))}function p(r,a){return new Promise((function(l,g){var v="partNumber=".concat(a,"&uploadId=").concat(r);t.getFileToken(u,i,"PUT",v).then((function(t){console.log("signature ".concat(a," onSuccess"),t);var r=n&&n.slice((a-1)*o.stc_chunk_size,a*o.stc_chunk_size);console.log("fileChunk:size",r.size);var i=t.stcAuthorization,u=t.stcContentSha256,f=t.stcDate;s===e.UploadMethod.MINIO&&(i=t.minioAuthorization,u=t.minioContentSha256,f=t.minioDate);var I=new XMLHttpRequest;I.open("PUT","".concat(c,"?").concat(v),!0),I.setRequestHeader("Authorization",i),I.setRequestHeader("x-amz-content-sha256",u),I.setRequestHeader("x-amz-date",f),I.setRequestHeader("Content-Type",d),I.send(r),I.onreadystatechange=function(){if(4===I.readyState)if(200===I.status||204===I.status){var e=I.getResponseHeader("etag");console.log("etag:".concat(a),e),E.set(a,e),l(e)}else R.includes(a)||R.push(a),g(a)}}),(function(e){console.log("getETags:签名验证失败"),R.includes(a)||R.push(a),g(a)}))}))}}var Me={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Ue()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Le(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Ue()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Le(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Ue(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Le(e,t){for(var n in e)t(n,e[n])}var Pe,xe=0,we=function(){function t(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:Me.form,genUId:Ue};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return t.prototype.setOptions=function(e){var t=this;Le(e,(function(e,n){t.options[e]=n}))},t.prototype.upload=function(t,n,o,r){if(o){var s=this;!function(t,n,o,r,s){re=o,se=r,pe=[];var a,i,c=t.getNaviInfoFromCache();if(1===(null==c?void 0:c.type)&&n.uploadDomain&&!r.ossConfig)pe=[["qiniu",n.uploadDomain]];else if(r.ossConfig){var d,u,l,g=JSON.parse(r.ossConfig),v="",f=[];g.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(v=e[n]),"s3"===n&&(d=e[n]),"stc"===n&&(u=e[n]),"minio"===n&&(l=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&pe.push(e)})),g.length!==pe.length&&(pe=[["qiniu",r.domain],["baidu",r.uploadHost.bos],["aliyun",v],["s3",d],["stc",u],["minio",l]])}else pe=[["qiniu",r.domain],["baidu",r.uploadHost.bos]];if(r.ossConfig){var R=r&&JSON.parse(r.ossConfig);Array.isArray(R)||(R=[]),a=R.find((function(e){return Object.keys(e).includes("stc")})),i=R.find((function(e){return Object.keys(e).includes("minio")}))}if(a&&1===parseInt(a.p,10)&&o.size>=4194304)ye(t,o,r,s,e.UploadMethod.STC,a.stc);else if(i&&1===parseInt(i.p,10)&&o.size>=4194304)ye(t,o,r,s,e.UploadMethod.MINIO,i.minio);else{var E=r.data(o,r);Ie[pe[0][0]](E,r,s,o,e.UploadMethod.MINIO)}}(t,n,o,this.options,{onProgress:function(e,t,n){(Pe=e,n)?Pe=xe+e/t*(t-xe):xe=Pe;r.onProgress(Pe,t)},onCompleted:function(e){r.onCompleted(e)},onError:function(e){r.onError(e)},onOpen:function(e){s.xhr=e}})}else r.onError("upload file is null.")},t.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},t}();var be,Be,De={init:function(e){return new we(e)},dataType:Me,resize:function(e,t,n){var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,s=new Image;s.src=r;var a=s.width,i=s.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var s=e.height,a=t.maxHeight||0;if(a>0&&s>a){var i=a/s;n=Math.min(n,i)}var c=t.maxSize||0,d=Math.ceil(e.size/1e3);if(d>c){var u=c/d;n=Math.min(n,u)}return n}({width:a,height:i,size:e.total},t),d=r;c<1&&(d=function(e,t,n){o.width=t,o.height=n;var r=o.getContext("2d");return r.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(s,a*c,i*c)),n(d)}},Upload:we},Ge=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),s=new Image,a="string"==typeof e;s.onload=function(a){var i=function(e,t,n){var o,r,s,a=e<t,i=0,c=0;return(a?t/e:e/t)>n.scale?(a?(r=100,c=((s=t/(o=e/100))-n.maxHeight)/2):(s=100,i=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:s,x:-i,y:-c}):(a?(o=t/n.maxHeight,s=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,s=t/o),{w:r,h:s,x:-i,y:-c})}(s.width,s.height,t);o.width=i.w>t.maxWidth?t.maxWidth:i.w,o.height=i.h>t.maxHeight?t.maxHeight:i.h,r.drawImage(s,i.x,i.y,i.w,i.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},s.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Ve=function(e,t){var n=e.file,o=e.compress;Ge(n,o,t)},ke=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.minioHeader={},e.minioHeader.minioAuthorization=o.minioAuthorization,e.minioHeader.minioContentSha256=o.minioContentSha256,e.minioHeader.minioDate=o.minioDate,e.minioBucketName=o.minioBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=De.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=De.init(e);t(n)}},He=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Ve;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},Fe=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){He(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ze=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};He(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),qe={initFile:function(e,t){ke(e,(function(e){var n=new Fe(e);t(n)}))},initImage:function(e,t){ke(e,(function(n){var o,r,s,a,i={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(s=e.thumbnailConfig)||void 0===s?void 0:s.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new Ze(n,i);t(c)}))},dataType:De.dataType};function Je(r,s,a,i,c,d,u){var l=this;void 0===u&&(u=e.FileType.FILE);var g=e.FileType.FILE;u===e.FileType.IMAGE&&(g=e.FileType.IMAGE);var v=r.getNaviInfoFromCache();if(!Be&&(Be="upload.qiniup.com",v&&v.ossConfig))try{var f=JSON.parse(v.ossConfig).find((function(e){return void 0!==e.qiniu}));f&&(Be=f.qiniu)}catch(e){}var R=t({domain:Be,getToken:function(e){r.getFileToken(g,i.name).then((function(t){e(t.token,t)})).catch((function(e){c.onFail(e)}))}},d),E=qe.initFile;g===e.FileType.IMAGE&&(E=qe.initImage),E(R,(function(s){s.upload(r,a,i,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=c.onProgress)||void 0===n||n.call(c,o)},onCompleted:function(r){return n(l,void 0,void 0,(function(){return o(this,(function(n){return 1!==(null==v?void 0:v.type)||(null==v?void 0:v.ossConfig)?(function(n,o,r,s,a){Ke(o,s.filename,s.name,s,s.uploadMethod).then((function(i){if(0===i.code){var c=i.data;c.type=r.type,c.name=s.name||s.filename,n!==e.FileType.AUDIO?(o===e.FileType.IMAGE&&(c.thumbnail=s.thumbnail,c.width=s.w,c.height=s.h,c.size=s.size),a.onSuccess(c)):ze(r).then((function(e){a.onSuccess(t(t({},c),e))}))}else a.onFail(i)})).catch((function(e){a.onFail(e)}))}(u,g,i,r,c),[2]):(function(n,o,r,s,a,i){var c={type:s.type,name:a.rc_url.file_name,downloadUrl:n.uploadDomain+a.rc_url.path};if(o===e.FileType.AUDIO)return void ze(s).then((function(e){i.onSuccess(t(t({},c),e))}));o===e.FileType.IMAGE&&(c.thumbnail=a.thumbnail,c.width=a.w,c.height=a.h,c.size=a.size);i.onSuccess(c)}(a,u,0,i,r,c),[2])}))}))},onError:function(e){c.onFail(e)}})}))}function ze(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?je(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(je).then((function(e){t(e)}))}))}function je(e){return be=be||new AudioContext,new Promise((function(t,n){be.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Ke(t,n,o,r,s){return e.validate("fileType",t,e.isValidFileType,!0)&&e.validate("filename",n,e.AssertRules.STRING)&&e.validate("saveName",o,e.AssertRules.STRING)&&e.validate("serverType",s,e.AssertRules.NUMBER)?q((function(a){return new Promise((function(i){a.getFileUrl(t,n,o,r,s).then((function(t){i({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){i({code:e})}))}))})):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER})}function Ye(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,R,E,I,p,T;return o(this,(function(o){switch(o.label){case 0:return a=a||{},s instanceof ne==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,z.ILLGAL_PARAMS]):e.validate("conversation",r,e.AssertRules.OBJECT,!0)?(n=r.conversationType,i=r.targetId,u=r.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",n,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",u,e.AssertRules.CHANNEL_ID)&&e.validate("options.isStatusMessage",null==a?void 0:a.isStatusMessage,e.AssertRules.BOOLEAN)&&e.validate("options.disableNotification",null==a?void 0:a.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushContent",null==a?void 0:a.pushContent,e.AssertRules.STRING)&&e.validate("options.pushData",null==a?void 0:a.pushData,e.AssertRules.STRING)&&e.validate("options.isMentioned",null==a?void 0:a.isMentioned,e.AssertRules.BOOLEAN)&&e.validate("options.mentionedType",null==a?void 0:a.mentionedType,e.AssertRules.NUMBER)&&e.validate("options.mentionedUserIdList",null==a?void 0:a.mentionedUserIdList,e.AssertRules.ARRAY)&&e.validate("options.directionalUserIdList",null==a?void 0:a.directionalUserIdList,e.AssertRules.ARRAY)&&e.validate("options.isVoipPush",null==a?void 0:a.isVoipPush,e.AssertRules.BOOLEAN)&&e.validate("options.canIncludeExpansion",null==a?void 0:a.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("options.expansion",null==a?void 0:a.expansion,e.AssertRules.OBJECT)&&e.validate("options.pushConfig",null==a?void 0:a.pushConfig,e.AssertRules.OBJECT)&&e.validate("options.messageId",null==a?void 0:a.messageId,e.AssertRules.NUMBER)?(l="conversationType:".concat(n,",targetId:").concat(i),d.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,n,o){var r=e.isStatusMessage,s=e.disableNotification,a=e.pushContent,i=e.pushData,c=e.isMentioned,d=e.mentionedType,u=e.mentionedUserIdList,l=e.directionalUserIdList,g=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,R=e.isFilerWhiteBlacklist,E=e.pushConfig,I=e.messageId,p=o.channelId;return t({isStatusMessage:r,disableNotification:s,pushContent:a,pushData:i,isMentioned:c,mentionedType:d,mentionedUserIdList:u,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:R,pushConfig:E,channelId:p||"",messageId:I},n)}(a,s,r),v={isMentioned:!!a.isMentioned,content:s.content,messageType:s.messageType,isPersited:!!s.isPersited,isCounted:!!s.isCounted,disableNotification:!!(null==a?void 0:a.disableNotification),canIncludeExpansion:!!(null==a?void 0:a.canIncludeExpansion),expansion:(null==a?void 0:a.expansion)||null,conversationType:r.conversationType,targetId:r.targetId,channelId:r.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!a.isStatusMessage,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:null==a?void 0:a.pushConfig,sentStatus:e.SentStatus.SENDING},n!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=d.createTraceId(),R=function(t){v.messageId=t;try{(null==a?void 0:a.onSendBefore)&&a.onSendBefore(w(v))}catch(t){d.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),f)}},d.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:s.messageType,conversationType:n,targetId:i,channelId:u}),f),[4,c.sendMessage(n,i,g,R,f)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=o.sent(),I=E.code,p=E.data,I===e.ErrorCode.SUCCESS?(d.info(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:I,messageUId:p.messageUId,messageId:p.messageId}),f),T=w(p),[2,{code:I,data:T}]):(d.warn(e.LogTagId.A_SEND_MSG_R,"send message fail ->".concat(I,":").concat(j[I],",").concat(l)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:I,msg:j[I],data:w(v)}])}}))}))}))]}))}))}function We(n,o){return function(r,s,a,i){if(!e.validate("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var c={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var d=null==i?void 0:i.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==d?void 0:d.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==d?void 0:d.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==d?void 0:d.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==d?void 0:d.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});c.thumbnailConfig=d}return q((function(d,u,l){return new Promise((function(g){var v=u.createTraceId();u.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:s.file.size,type:n}),v),Je(d,0,l,s.file,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(n){var c,d=(null===(c=null==a?void 0:a.onComplete)||void 0===c?void 0:c.call(a,t({url:n.downloadUrl},n)))||o(n,s);n&&n.downloadUrl&&u.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:n.downloadUrl,code:e.ErrorCode.SUCCESS}),v),Ye(r,d,i).then(g)},onFail:function(t){u.warn(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({code:e.ErrorCode.UPLOAD_FILE_FAILED}),v),g({code:e.ErrorCode.UPLOAD_FILE_FAILED,msg:t||e.ErrorCode[e.ErrorCode.UPLOAD_FILE_FAILED]})}},c,n)}))}))}}var Xe=We(e.FileType.FILE,(function(e,t){return new le({name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,o})),Qe=We(e.FileType.IMAGE,(function(e,t){return new ae({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),$e=We(e.FileType.IMAGE,(function(e,t){return new ge({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),et=We(e.FileType.AUDIO,(function(e,t){return new ie({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),nt=We(e.FileType.SIGHT,(function(e,t){return new ce({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));We(e.FileType.COMBINE_HTML,(function(e,t){return new ue({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var ot=Object.freeze({__proto__:null,getAllConversationList:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.CHANNEL_ID)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,s.getConversationListWithAllChannel()]:[3,2];case 1:return n=o.sent(),[3,4];case 2:return[4,s.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:n=o.sent(),o.label=4;case 4:return r=n.code,i=n.data,r===e.ErrorCode.SUCCESS&&i?(c=i.map((function(e){return b(e)})),[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("startTime",t,e.AssertRules.NUMBER,!0)&&e.validate("count",r,e.AssertRules.NUMBER,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="startTime: ".concat(t,", count: ").concat(r,", channelId: ").concat(s),c.info(e.LogTagId.O,"getConversationList -> ".concat(n)),e.isUndefined(s)?[4,i.getConversationListWithAllChannelByPage(t,r)]:[3,2];case 1:return a=o.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(d,t,r,s)];case 3:a=o.sent(),o.label=4;case 4:return u=a.code,l=a.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return b(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:j[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("messageTypes",s,e.AssertRules.ARRAY,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)&&!s.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="keyword: ".concat(r,", messageTypes: ").concat(JSON.stringify(s),", channelId: ").concat(a),d.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(a)?[4,c.searchConversationByContentWithAllChannel(r,s)]:[3,2];case 1:return i=o.sent(),[3,4];case 2:return[4,c.searchConversationByContent(r,s,a)];case 3:i=o.sent(),o.label=4;case 4:return u=i.code,l=i.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return b(e)})),[2,{code:u,data:g}]):(d.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:j[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("startTime",s,e.AssertRules.NUMBER,!0)&&e.validate("count",a,e.AssertRules.NUMBER,!0)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,R,E,I;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(r,", timestamp: ").concat(s,", count: ").concat(a),d.info(e.LogTagId.O,"searchMessages -> ".concat(n)),i=t.targetId,u=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(u,i,r,s,a)]:[3,2];case 1:return g=o.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(u,i,r,s,a,0,l)];case 3:g=o.sent(),o.label=4;case 4:return v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?(R=f.messages,E=f.count,I=R.map((function(e){return w(e)})),[2,{code:v,data:{messages:I,count:E}}]):(d.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(n)),[2,{code:v,msg:j[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.keyword",r.keyword,e.AssertRules.STRING,!0)&&e.validate("option.startTime",r.startTime,e.AssertRules.NUMBER,!0)&&e.validate("option.endTime",r.endTime,e.AssertRules.NUMBER,!0)&&e.validate("option.offset",r.offset,e.AssertRules.NUMBER)&&e.validate("option.limit",r.limit,e.AssertRules.NUMBER)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R,E;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"searchMessageInTimeRange -> ".concat(n)),s=t.conversationType,c=t.targetId,d=r.keyword,u=r.startTime,l=r.endTime,g=r.offset,v=r.limit,g=g||0,v=v||5,[4,a.searchMessageByContentInTimeRangeWithAllChannel(s,c,d,u,l,g,v)];case 1:return f=o.sent(),R=f.code,E=f.data,R===e.ErrorCode.SUCCESS&&E?[2,{code:R,data:{messages:E.messages.map((function(e){return w(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(R,", ").concat(n)),[2,{code:R}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.count",r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&e.validate("option.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("option.order",r.order,(function(e){return[0,1].includes(e)}))&&e.validate("option.messageTypes",r.messageTypes,e.AssertRules.ARRAY,!0)&&!r.messageTypes.some((function(t){return!e.validate("option.messageType",t,e.AssertRules.STRING,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R,E,I,p,T,h;return o(this,(function(o){switch(o.label){case 0:return n=r.count,s=r.timestamp,c=r.order,d=r.messageTypes,u="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),l=t.conversationType,g=t.targetId,v=t.channelId,n||(n=20),s||(s=0),c||(c=0),v||(v=""),[4,a.getHistoryMessagesByObjectNames(l,g,s,n,d,c,v)];case 1:return f=o.sent(),R=f.code,E=f.data,R===e.ErrorCode.SUCCESS?(p=(I=E).list,T=I.hasMore,h=p.map((function(e){return w(e)})),[2,{code:R,data:{messages:h,hasMore:T,list:h}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(R," ").concat(u)),[2,{code:R,msg:j[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", timestamp: ").concat(r),i.info(e.LogTagId.O,"updateSentMsgReceiptStatus -> ".concat(n)),s=t.conversationType,c=t.targetId,d=t.channelId,[4,a.setMessageStatusToRead(s,c,r,d)];case 1:return[2,o.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus -> messageId: ".concat(t,", receivedStatus: ").concat(r)),[4,a.setMessageReceivedStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("sentStatus",r,(function(t){return!e.isUndefined(e.SentStatus[t])}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(r)),[4,a.setMessageSentStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,r,s){return void 0===s&&(s=""),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("content",r,e.AssertRules.OBJECT,!0)&&e.validate("messageType",s,e.AssertRules.ONLY_STRING,!0)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return c.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", messageType: ").concat(s)),[4,i.setMessageContent(t,r,s)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?!e.validate("messageIds",t,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("messageId",t,e.AssertRules.NUMBER,!0)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,s.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,s.clearMessages(n,r,i)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,r,s){return n(this,void 0,void 0,(function(){var a,i,c,d=this;return o(this,(function(u){return e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",s,e.AssertRules.BOOLEAN)?[2,q((function(e,t){return n(d,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,e.deleteMessagesByTimestamp(a,i,r,s,c)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,r,s){return void 0===s&&(s={}),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return console.log(e.usingCppEngine()),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("options",s,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==s?void 0:s.searchContent,e.AssertRules.STRING)&&(r instanceof ne||e.validate("message.senderUserId",r.senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",r.messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",r.content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",r.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",r.sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",r.sentStatus,e.AssertRules.NUMBER))?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g,v,f,R,E,I,p,T,h,m;return o(this,(function(o){switch(o.label){case 0:return n="",a=1,g=!1,f=r.messageType,R=r.content,r instanceof ne||(n=r.senderUserId,a=r.messageDirection,g=r.canIncludeExpansion,v=r.expansion,l=r.disableNotification,d=r.sentTime,u=r.sentStatus),c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),E=s.isUnread,I=s.searchContent,p={senderUserId:n,messageType:f,content:R,messageDirection:a,sentTime:d,sentStatus:u,searchContent:I,isUnread:E,messageUId:"",disableNotification:l,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,p)];case 1:return T=o.sent(),h=T.code,m=T.data,h===e.ErrorCode.SUCCESS?[2,{code:h,data:w(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(h,",targetId:").concat(t.targetId)),[2,{code:h,msg:j[h]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,r){var s,a;return n(this,void 0,void 0,(function(){var i,c=this;return o(this,(function(d){if(!e.usingCppEngine())return[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}];if(!e.validate("messages",t,(function(t){return e.isArray(t)&&!(t.length<=0||t.length>=500)}),!0)||!e.validate("checkDuplicate",r,e.AssertRules.BOOLEAN))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];for(i in t)if(!(e.validate("message",t[i],e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",t[i].conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.DISCUSSION,e.ConversationType.GROUP,e.ConversationType.CUSTOMER_SERVICE,e.ConversationType.SYSTEM,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE].includes(t)}),!0)&&e.validate("message.targetId",t[i].targetId,e.AssertRules.STRING,!0)&&e.validate("message.senderUserId",t[i].senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",t[i].messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",t[i].content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",t[i].messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",t[i].canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",t[i].expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",t[i].disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",t[i].sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",t[i].sentStatus,e.AssertRules.NUMBER)&&e.validate("options.isUnread",null===(s=t[i])||void 0===s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null===(a=t[i])||void 0===a?void 0:a.searchContent,e.AssertRules.STRING)))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,q((function(s){return n(c,void 0,void 0,(function(){var n,a,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.batchInsertMessage(t,r)];case 1:return n=o.sent(),a=n.code,i=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:j[a]}]}}))}))}))]}))}))},getMessageCount:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?[2,q((function(e){return n(r,void 0,void 0,(function(){var n,r,s,a,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,s=t.channelId,[4,e.getMessageCount(n,r,s)];case 1:return a=o.sent(),i=a.code,c=a.data,[2,{code:i,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageUId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getPrivateMessageDeliverTime(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getGroupMessageDeliverList(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(s,", targetId:").concat(t," messageUId:").concat(r)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("enableCheck",t,e.AssertRules.BOOLEAN)?[2,q((function(e){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,e.setCheckDuplicateMessage(t)];case 1:return[2,{code:n.sent().code}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return e.usingCppEngine()?[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"clearLocalData ->"),[4,r.clearData()];case 1:return t=o.sent(),n=t.code,a=t.data,[2,{code:n,data:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),rt=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"OperateStatus",{enumerable:!0,get:function(){return e.OperateStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return e.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return e.SentStatus}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return e.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),exports.BaseMessage=ne,exports.CombineMessage=ue,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=le,exports.GIFMessage=ge,exports.HQVoiceMessage=ie,exports.ImageMessage=ae,exports.LocationMessage=fe,exports.MentionedInfoBody=rt,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=Re,exports.RichContentMessage=Ee,exports.SightMessage=ce,exports.TextMessage=de,exports.VoiceMessage=ve,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"addTagForConversations ->tagId:".concat(t)),[4,a.addTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){D.on(e,t,n)},exports.addTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagId",t.tagId,(function(e){return e.length<=10}))&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,s.createTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addToBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,s.addToBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.bindRTCRoomForChatroom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("option.chatRoomId",t.chatRoomId,e.AssertRules.STRING,!0)&&e.validate("option.rtcRoomId",t.rtcRoomId,e.AssertRules.STRING,!0)?[2,q((function(e){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,e.bindRTCRoomForChatroom(t)];case 1:return[2,{code:n=o.sent(),msg:j[n]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearAllMessagesUnreadStatus=function(){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,q((function(t,r){return n(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=J,exports.clearHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"clear message ->".concat(n)),[4,a.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return B("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,s.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(a.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,s.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"clear unreadMsgNum ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"clear unreadMsgNum fail ->".concat(n,":").concat(j[n],",").concat(r)),[2,{code:n,msg:j[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,s.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=o.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(a.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(j[r],",").concat(n)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,s=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(s,",conversationType:").concat(n)),[4,a.clearUnreadCountByTimestamp(n,s,r,c)];case 1:return(d=o.sent())===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(d,",targetId:").concat(s)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return e.validate("token",t,e.AssertRules.STRING,!0)&&e.validate("reconnectKickEnable",r,e.AssertRules.BOOLEAN)?(n=i.createTraceId(),i.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:r}),n),[4,a.connect(t,!!r,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return s=o.sent(),c=s.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:s.code,userId:s.userId}),n),s.code===e.ErrorCode.SUCCESS?[2,{code:s.code,data:{userId:s.userId}}]:[2,{code:s.code,msg:j[s.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,r,s){return n(this,void 0,void 0,(function(){var a,i,c,d=this;return o(this,(function(u){return B("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",s,e.AssertRules.BOOLEAN)?[2,q((function(u,l){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,u.deleteMessagesByTimestamp(a,i,r,s,c)];case 1:return n=o.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:n,conversationType:a,targetId:i,channelId:c,timestamp:r})),n===e.ErrorCode.SUCCESS?[2,{code:n}]:(l.warn(e.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(n,",targetId:").concat(t.targetId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options",r,(function(t){return e.isArray(t)&&t.length}),!0)&&!r.some((function(t){return!e.validate("options.messageUId",t.messageUId,e.AssertRules.STRING,!0)||!e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)||!e.validate("options.messageDirection",t.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"delete messages ->".concat(n)),[4,a.deleteRemoteMessage(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.destroy=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return V?(J(),[2,F()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),Z((function(e){return e.disconnect(t)}))},exports.electronExtension=ot,exports.forceRemoveChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ee(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.info(e.LogTagId.O,"force remove chatroom entry ->".concat(n)),[4,a.forceRemoveChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Q(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"force set chatroom entry ->".concat(n)),[4,a.forceSetChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllChatRoomEntries=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),a.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,s.getAllChatroomEntries(t)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS&&c?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"get all chatroom entries fail ->code+:".concat(j[i],",").concat(n)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllConversationState=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,q((function(e){return e.getAllConversationState()}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadCount",[4,r.getAllUltraGroupUnreadCount()];case 1:return n=o.sent(),a=n.code,i=n.data,s.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(s.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(j[a])),[2,{code:a,msg:j[a]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadMentionedCount",!0,[4,r.getAllUltraGroupUnreadCount(true)];case 1:return n=o.sent(),a=n.code,i=n.data,s.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(s.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(j[a])),[2,{code:a,msg:j[a]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,q((function(t,n){return n.debug(e.LogTagId.O,"getAllUnreadMentionedCount"),t.getAllUnreadMentionedCount()}))]}))}))},exports.getBlacklist=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getBlacklist -> "),[4,r.getBlacklist()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS&&a?[2,{code:n,data:a}]:(s.warn(e.LogTagId.O,"getBlacklist fail -> code: ".concat(n)),[2,{code:n}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,s.getBlacklistStatus(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:0===i}]:(a.warn(e.LogTagId.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(t)),[2,{code:r}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getBlockUltraGroupList=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getBlockUltraGroupList()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:a}]:(s.warn(e.LogTagId.O,"get block ultragroup ->".concat(n,":").concat(j[n])),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,q((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("key",r,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom entry->".concat(n)),[4,a.getChatroomEntry(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return[0,1,2].includes(e)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom info ->".concat(n)),[4,a.getChatroomInfo(t,r.count,r.order)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.count",r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&e.validate("options.order",r.order,(function(e){return 0===e||1===e}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom history message->".concat(n)),[4,a.getChatRoomHistoryMessages(t,r.count,r.order,r.timestamp)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),[2,{code:c,data:{list:u,hasMore:!!d.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return Z((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=o.sent(),r=n.code,i=n.data,r!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"getConversation ->code:".concat(r,", targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}]):[2,{code:r,data:i?b(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.count",null==t?void 0:t.count,e.AssertRules.NUMBER)&&e.validate("options.startTime",null==t?void 0:t.startTime,e.AssertRules.NUMBER)&&e.validate("options.order",null==t?void 0:t.order,e.AssertRules.NUMBER)&&e.validate("channelId",r,e.AssertRules.CHANNEL_ID)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return b(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=W(a,t,"getConversationNotificationLevel"),[4,s.getConversationNotificationLevel(t.conversationType,t.targetId,t.channelId)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(j[i]," , ").concat(n)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.getConversationNotificationStatus(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.validate("tagId",r,e.AssertRules.STRING,!0)&&e.validate("count",s,e.AssertRules.NUMBER,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(r)),[4,c.getConversationListByTag(r,a,s)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:null==u?void 0:u.map((function(e){return function(e){return t(t({},b(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(d.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(i,",tagId:").concat(r)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return Z((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return Z((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return q((function(s){return new Promise((function(a){s.getFileToken(t,n,o,r).then((function(t){a({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){a({code:e,msg:j[e]})}))}))}))},exports.getFileUrl=Ke,exports.getFirstUnreadMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getFirstUnreadMessage(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?(c=i&&w(i)||null,[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&(e.usingCppEngine()||e.validate("options.count",null==r?void 0:r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==r?void 0:r.timestamp,count:null==r?void 0:r.count}),n),[4,a.getHistoryMessage(t.conversationType,t.targetId,null==r?void 0:r.timestamp,null==r?void 0:r.count,null==r?void 0:r.order,null==t?void 0:t.channelId,"",n)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),i.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),n),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),n),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getMessage(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:w(i)}]:(a.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"get message reader ->".concat(n)),[4,i.getMessageReader(t,r,s)];case 1:return a=o.sent(),d=a.code,u=a.data,d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:(c.warn(e.LogTagId.O,"get message reader fail ->".concat(d,":").concat(j[d],",").concat(n)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getProxy=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getProxy()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:n,data:a}]:(s.warn(e.LogTagId.O,"getProxy ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"get history message ->".concat(n)),[4,a.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==r?void 0:r.timestamp)||0,(null==r?void 0:r.count)||20,(null==r?void 0:r.order)||0,t.channelId||"")];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return Z((function(e){return e.getServerTime()}))},exports.getTags=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getTagList()];case 1:return t=o.sent(),n=t.code,a=t.data,s.warn(e.LogTagId.O,"getTagList ->code:".concat(n)),[2,{code:e.ErrorCode.SUCCESS,data:a}]}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.getTagsForConversation(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:[2,{code:r,msg:j[r]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get draft ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i||""}]:(a.warn(e.LogTagId.O,"get draft fail ->".concat(r,":").concat(j[r],",").concat(c)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversationTypes",t,e.AssertRules.ARRAY)&&!(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))&&e.validate("channelId",r,e.AssertRules.CHANNEL_ID)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTopConversationList(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return b(e)}))}]:(i.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,"".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCount=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("includeMuted",t,e.AssertRules.BOOLEAN,!1)&&e.validate("conversationTypes",r,e.AssertRules.ARRAY,!1)&&!(null==r?void 0:r.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get total unread count -> ConversationType:".concat(JSON.stringify(r)," includeMuted:").concat(t)),[4,a.getTotalUnreadCount("",r,t)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,r,!0)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),a.debug(e.LogTagId.O,"".concat(n," -> ").concat(r)),[4,s.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(a.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(j[c]," , ").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)?[2,q((function(s){return n(r,void 0,void 0,(function(){var n,r,a,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,a={targetId:n,channelId:r},[4,s.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:j[c]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!1)&&e.validate("options.channelType",t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUltraGroupList(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:i}]:(a.warn(e.LogTagId.O,"get ultragroup ->".concat(r,":").concat(j[r])),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("msgs",r,e.AssertRules.ARRAY,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,s=t.conversationType,c=t.channelId,d=[],r.forEach((function(e){var t=e.sendTime,n=e.messageUId;d.push({sendTime:t,messageUId:n,channelId:c})})),u={targetId:n,conversationType:s,messages:d},[4,a.getUltraGroupMessageListByMessageUId(u)];case 1:if(l=o.sent(),g=l.code,v=l.data,g===e.ErrorCode.SUCCESS){for(R in f={},v)f[R]=v[R]?w(v[R]):void 0;return[2,{code:e.ErrorCode.SUCCESS,data:f}]}return i.warn(e.LogTagId.O,"get UltraGroup MessageList by messageUId ->".concat(g,":").concat(j[g])),[2,{code:g,msg:j[g]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,a.getUltraGroupUnreadCountByTargetId(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,u="targetId: ".concat(t,", levels: ").concat(JSON.stringify(r)),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(u)),[2,{code:c,data:d}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(t,", notificationLevels: ").concat(JSON.stringify(r))),[4,a.getUltraGroupUnreadMentionedCountByTargetId(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.count",t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,i=t.sentTime,c=t.count,d={targetId:n,channelId:r,sentTime:i,count:c},[4,s.getUltraGroupUnreadMentionedMessages(d)];case 1:return u=o.sent(),l=u.code,g=u.data,l===e.ErrorCode.SUCCESS?[2,{code:l,data:g}]:(a.warn(e.LogTagId.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(l,": ").concat(j[l])),[2,{code:l,msg:j[l]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadConversationList=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY)||(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isTypeInConversationList)})))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,a;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUnreadConversationList(t)];case 1:return n=o.sent(),r=n.code,a=n.data,r===e.ErrorCode.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return b(e)}))}]:[2,{code:r,msg:j[r]}]}}))}))}))]}))}))},exports.getUnreadCount=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get unreadCount ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"get unreadCount fail ->".concat(r,":").concat(j[r],",").concat(c)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",r,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,a.getUnreadCountByTag(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,[2,{code:s,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedCount=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(n,o){return o.debug(e.LogTagId.O,"getUnreadMentionedCount".concat(t.targetId,",channelId:").concat(t.channelId)),n.getUnreadMentionedCount(t)}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedMessages=function(t){if(!e.usingCppEngine())return{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]};var n,o=t.conversationType,r=t.targetId,s=t.channelId;return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?(n=function(t){var n=t.getUnreadMentionedMessages(o,r,s),a=[];return n&&n.length&&n.forEach((function(e){return a.push(w(e))})),{code:e.ErrorCode.SUCCESS,data:a}},V?n(V,H,k):{code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT}):{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}},exports.init=function(t){!function(t){var n,o=t.appkey,r=t.navigators;V?H.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.appkey",t.appkey,e.AssertRules.STRING,!0),e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),k=t,V=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||x,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime}),(H=V.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),H.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.7.8",commit:"a8c6bdefd42b849d4ba9a105ecf5c00403c17522"})),V.assignWatcher(G),e.logger.init(H))}(t)},exports.insertMessage=function(t,r,s){return void 0===s&&(s={}),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return B("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("options",s,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==s?void 0:s.searchContent,e.AssertRules.STRING)&&e.validate("content.senderUserId",r.senderUserId,e.AssertRules.STRING,!0)&&e.validate("content.messageType",r.messageType,e.AssertRules.STRING,!0)&&e.validate("content.content",r.content,e.AssertRules.OBJECT,!0)&&e.validate("content.messageDirection",r.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("content.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("content.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("content.disableNotification",r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("content.sentTime",r.sentTime,e.AssertRules.NUMBER)&&e.validate("content.sentStatus",r.sentStatus,e.AssertRules.NUMBER)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g,v,f,R,E,I,p,T,h,m,C;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,a=r.messageType,d=r.content,u=r.messageDirection,l=r.messageUId,g=r.canIncludeExpansion,v=r.expansion,f=r.disableNotification,R=r.sentTime,E=r.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),I=s.isUnread,p=s.searchContent,T={senderUserId:n,messageType:a,content:d,messageDirection:u,sentTime:R,sentStatus:E,searchContent:p,isUnread:I,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=o.sent(),m=h.code,C=h.data,m===e.ErrorCode.SUCCESS?[2,{code:m,data:w(C)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(m,",targetId:").concat(t.targetId)),[2,{code:m,msg:j[m]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return Z((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!1}),n),[4,a.joinChatroom(t,r.count,n)];case 1:return s=o.sent(),c=s===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==e.ErrorCode.SUCCESS?[2,{code:s,msg:j[s]}]:[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!0}),n),[4,a.joinExistChatroom(t,r.count,n)];case 1:return s=o.sent(),c=s===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==e.ErrorCode.SUCCESS?[2,{code:s,msg:j[s]}]:[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.senderUserId,u=r.sentTime,l=r.canIncludeExpansion,g=r.channelId,v="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:s,channelId:g,conversationType:n,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,a.modifyMessage(f)];case 1:return(R=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(R,":").concat(j[R])),[2,{code:R,msg:j[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){D.once(e,t,n)},exports.quitChatRoom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=a.createTraceId(),a.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,s.quitChatroom(t)];case 1:return r=o.sent(),i=r===e.ErrorCode.SUCCESS?"info":"warn",a[i](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:j[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.recallMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("options.sentTime",r.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.disableNotification",null==r?void 0:r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushConfig",null==r?void 0:r.pushConfig,e.AssertRules.OBJECT)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={user:r.user,channelId:t.channelId||"",disableNotification:null==r?void 0:r.disableNotification,pushConfig:null==r?void 0:r.pushConfig,extra:r.extra,isDelete:r.isDelete},s="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(r.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(s)),[4,a.recallMessage(t.conversationType,t.targetId,r.messageUId,r.sentTime,n)];case 1:return c=o.sent(),d=c.code,u=c.data,d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:w(u)}]:d===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(d,":").concat(j[d],",").concat(s)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,s){return Z((function(a,i){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",o,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",s,e.AssertRules.BOOLEAN,!1),e.assert("searchProps",r,e.AssertRules.ARRAY),i.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:o,isStatusMessage:s,isPersited:n})),a.registerMessageType(t,n,o,r,s),oe(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),a.debug(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(l)),g={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:i,removeAll:!0},[4,s.expandUltraMessage(g)];case 1:return(v=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(j[v])),[2,{code:v,msg:j[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("targetId",r,e.AssertRules.STRING,!0)&&te(s)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(r),c.info(e.LogTagId.O,"remove chatroom entry->".concat(n)),(a=t({},s)).entries=s.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(r,a)];case 1:return d=o.sent(),u=d.code,l=d.data,u!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(j[u],",").concat(n)),[2,{code:u,msg:j[u],data:l}]):[2,{code:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ee(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"remove chatroom entry->".concat(n)),[4,a.removeChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,s.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"destroy conversation ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"destroy conversation fail ->".concat(n,":").concat(j[n],",").concat(r)),[2,{code:n,msg:j[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversationsFromTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){D.off(e,t,n)},exports.removeEventListeners=function(e){D.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:s,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,keys:t},[4,a.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(f,":").concat(j[f])),[2,{code:f,msg:j[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeFromBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"removeFromBlacklist -> userId: ".concat(t)),[4,s.removeFromBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeMessageExpansionForKey=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("keys",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.channelId,l="conversationType:".concat(n,",targetId:").concat(s,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,a.sendExpansionMessage({conversationType:n,targetId:s,messageUId:c,canIncludeExpansion:d,keys:t,channelId:u})];case 1:return(g=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(j[g],",").concat(l)),[2,{code:g,msg:j[g]}]):[2,{code:g}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,s.removeTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("tagIds",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("tagId",t,e.AssertRules.STRING,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(r,",targetId:").concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.removeTagsForConversation(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(r)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("draft",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set draft ->".concat(n)),[4,a.saveConversationMessageDraft(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())===e.ErrorCode.SUCCESS?[2,{code:s}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return B("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,s,a,r)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:u}]:(d.warn(e.LogTagId.O,"searchConversationByContent ->code:".concat(i,",keyword:").concat(t)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return B("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",s,e.AssertRules.NUMBER)&&e.validate("count",a,e.AssertRules.NUMBER)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l;return o(this,(function(o){switch(o.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,r,s,a,1,t.channelId)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?(l=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return l.push(w(e))})),[2,{code:i,data:{messages:l,count:null==u?void 0:u.count}}]):(d.warn(e.LogTagId.O,"searchMessages ->code:".concat(i,",targetId:").concat(t.targetId)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=Xe,exports.sendGIFMessage=$e,exports.sendHQVoiceMessage=et,exports.sendImageMessage=Qe,exports.sendMessage=Ye,exports.sendReadReceiptMessage=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",s,e.AssertRules.NUMBER,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)?[2,q((function(c){return n(i,void 0,void 0,(function(){var n,i,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:a},i=new ne("RC:ReadNtf",{messageUId:r,lastMessageSendTime:s,type:1}),[4,Ye(n,i)];case 1:return c=o.sent(),d=c.code,u=c.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptRequest=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,i,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"send read receipt message ->".concat(n)),a=new ne("RC:RRReqMsg",{messageUId:r}),[4,Ye({targetId:t,conversationType:e.ConversationType.GROUP,channelId:s},a)];case 1:return i=o.sent(),d=i.code,u=i.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptResponse=function(e,t,r){return n(this,void 0,void 0,(function(){return o(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageList",r,e.AssertRules.OBJECT,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)&&!Object.keys(r).some((function(t){return!e.validate(t,r[t],e.AssertRules.ARRAY)}))?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.GROUP,channelId:s},d=i.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:(u=[],Object.keys(r).forEach((function(e){r[e].forEach((function(e){-1===u.indexOf(e)&&u.push(e)}))})),u.length?[4,i.sendReadReceiptMessage(t,u,s)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 1:return a=o.sent(),[3,4];case 2:return l=new ne("RC:RRRspMsg",{receiptMessageDic:r}),[4,Ye(n,l)];case 3:a=o.sent(),o.label=4;case 4:return(g=a.code)===e.ErrorCode.SUCCESS?[2,{code:g}]:(c.warn(e.LogTagId.O,"send read receipt message fail ->".concat(g,":").concat(j[g])),[2,{code:g,msg:j[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=nt,exports.sendSyncReadStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var n,s,a,i;return o(this,(function(o){switch(o.label){case 0:return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("lastMessageSendTime",r,e.AssertRules.NUMBER,!0)?(n=new ne("RC:SRSMsg",{lastMessageSendTime:r}),[4,Ye(t,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return s=o.sent(),a=s.code,i=s.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return Ye(e,new de(t),n)},exports.sendTypingStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("typingContentType",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:r},isStatusMessage:!0,channelId:t.channelId},s=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),s),[4,a.sendMessage(t.conversationType,t.targetId,n,void 0,s)];case 1:return c=o.sent(),d=c.code,u=c.data,l=d===e.ErrorCode.SUCCESS?"info":"warn",i[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:d,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),s),d===e.ErrorCode.SUCCESS?[2,{code:d,data:w(u)}]:[2,{code:d,msg:j[d]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendUltraGroupTypingStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,s.sendUltraGroupTypingStatus(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(j[n])),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&$(r)?r.entries.length>10?[2,z.CHATROOM_KV_STORE_OUT_LIMIT]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,a.setChatroomEntries(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c],data:d}]):[2,{code:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Q(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,a.setChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(e,n){return X(n,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,r,t.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationStatus=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationStatus",r,(function(e){return 1===e||2===e}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(e,n){return X(n,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,r,t.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTop=function(t,r){return void 0===r&&(r=!0),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("isTop",r,e.AssertRules.BOOLEAN)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set conversation status ->".concat(n)),[4,a.setConversationStatus(t.conversationType,t.targetId,r,void 0,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversation",r,e.AssertRules.CONVERSATION,!0)&&e.validate("status.isTop",s,e.AssertRules.BOOLEAN,!0)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return c.info(e.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(t,",targetId:").concat(r.targetId,",conversationType").concat(r.conversationType)),[4,i.setConversationStatusInTag(t,r,{isTop:s})];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(c.warn(e.LogTagId.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return B("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(t,",receivedStatus:").concat(r)),[4,a.setMessageReceivedStatus(t,r)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"setProxy: ->".concat(t)),[4,s.setProxy(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n="setUltraGroupDefaultNotificationLevel",s="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(s)),[4,a.setUltraGroupDefaultNotificationLevel(t.targetId,r,t.channelId)];case 1:return(c=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:c}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(j[c]," , ").concat(s)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.testProxy=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"testProxy: ->".concat(t)),[4,a.testProxy(t,r)];case 1:return n=o.sent(),s=n.status,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,msg:c}]:(i.warn(e.LogTagId.O,"testProxy ->code:".concat(s)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:s,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,expansion:t},[4,a.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(f,":").concat(j[f])),[2,{code:f,msg:j[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.expansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,a.sendExpansionMessage({conversationType:n,targetId:s,messageUId:c,expansion:t,canIncludeExpansion:d,originExpansion:u,channelId:l})];case 1:return(v=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(j[v],",").concat(g)),[2,{code:v,msg:j[v]}]):[2,{code:v}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,s.updateTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"updateTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@rongcloud/engine"),t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)};function n(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},o.apply(this,arguments)};function r(e,t,n,o){return new(n||(n=Promise))((function(r,s){function a(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((o=o.apply(e,t||[])).next())}))}function s(e,t){var n,o,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,i[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var a=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},i=a(),c=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var d=null,u=function(e){return r(void 0,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,l.getNetworkType()];case 1:return t=n.sent(),d({status:"online"===e.type,type:t}),[2]}}))}))};var l={tag:"browser",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(e){var s=c(),d="[object XDomainRequest]"===Object.prototype.toString.call(s);if(s.open(n,i),r&&s.setRequestHeader)for(var u in r)s.setRequestHeader(u,r[u]);if(d){0!==t.timeout&&(s.timeout=o),s.onload=function(){e({data:s.responseText,status:s.status||200})},s.onerror=function(){e({status:s.status})},s.ontimeout=function(){e({status:s.status})};var l="object"==typeof a?JSON.stringify(a):a;s.send(l)}else s.onreadystatechange=function(){4===s.readyState&&e({data:s.responseText,status:s.status,xhr:s})},s.onerror=function(){e({status:s.status})},t.onProgress&&(s.upload.onprogress=function(e){return t.onProgress&&t.onProgress(e)}),0!==t.timeout&&setTimeout((function(){s.abort(),e({status:s.status})}),o),s.send(a)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:i,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:e.NetworkType.UNKONWN},n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){d=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",u),window.addEventListener("online",u))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",u),window.removeEventListener("online",u)),d=null}},g=a(),v=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},f={setItem:v("setStorageSync"),getItem:v("getStorageSync"),removeItem:v("removeStorageSync"),clear:v("clearStorageSync")},E=null,R=function(e){var t=e.isConnected,n=e.networkType;E({status:t,type:n})};var I={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){wx.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:f,sessionStorage:f,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:g,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){E=e,wx.onNetworkStatusChange(R)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(R),E=null}},p=a(),T=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},h={setItem:T("setStorageSync"),getItem:T("getStorageSync"),removeItem:T("removeStorageSync"),clear:T("clearStorageSync")},C=null,m=function(e){var t=e.isConnected,n=e.networkType;C({status:t,type:n})};var S={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s),c=t.dataType||"json";return new Promise((function(t){my.request({url:i,method:n,headers:r,timeout:o,data:a,dataType:c,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:h,sessionStorage:h,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:p,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onSocketClose(e)},onError:function(e){t.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onSocketMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onSocketOpen(e)},send:function(e){t.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){C=e,my.onNetworkStatusChange(m)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(m),C=null}},A=a(),O=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},N={setItem:O("setStorageSync"),getItem:O("getStorageSync"),removeItem:O("removeStorageSync"),clear:O("clearStorageSync")},_=null,y=function(e){var t=e.isConnected,n=e.networkType;_({status:t,type:n})};var U={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:A,localStorage:N,sessionStorage:N,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){_=e,tt.onNetworkStatusChange(y)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(y),_=null}},L=a(),M=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},P={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},w=null,x=function(e){var t=e.isConnected,n=e.networkType;w({status:t,type:n})};var b={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:L,localStorage:P,sessionStorage:P,httpReq:function(t){return new Promise((function(n,o){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){w=e,swan.onNetworkStatusChange(x)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(x),w=null}},B=a(),D=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},G={setItem:D("setStorageSync"),getItem:D("getStorageSync"),removeItem:D("removeStorageSync"),clear:D("clearStorageSync")},V=null,k=function(e){var t=e.isConnected,n=e.networkType;V({status:t,type:n})};var F={tag:"jingdong",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){jd.request({url:i,method:n,headers:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:G,sessionStorage:G,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:B,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){V=e,jd.onNetworkStatusChange(k)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(k),V=null}},H=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},Z={setItem:H("setStorageSync"),getItem:H("getStorageSync"),removeItem:H("removeStorageSync"),clear:H("clearStorageSync")},q=null,J=function(e){var t=e.isConnected,n=e.networkType;q({status:t,type:n})};var j,K={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){uni.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){q=e,uni.onNetworkStatusChange(J)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(J),q=null}},Y=function(e){return e&&e.request&&e.getSystemInfo},z="undefined"!=typeof uni&&Y(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return K;case"mp-jd":return F;case"mp-baidu":return b;case"mp-toutiao":return U;case"mp-alipay":return S;case"mp-weixin":return I;default:return l}}():"undefined"!=typeof jd&&Y(jd)?F:"undefined"!=typeof my&&Y(my)?S:"undefined"!=typeof tt&&Y(tt)?U:"undefined"!=typeof swan&&Y(swan)?b:"undefined"!=typeof wx&&Y(wx)?I:l;function W(t){var n=t.conversationType,o=t.channelId,r=t.messageType,s=t.content,a=t.senderUserId,i=t.targetId,c=t.sentTime,d=t.receivedTime,u=t.messageUId,l=t.messageDirection,g=t.isPersited,v=t.isCounted,f=t.isOffLineMessage,E=t.canIncludeExpansion,R=t.expansion,I=t.receivedStatus,p=t.disableNotification,T=t.isMentioned,h=t.isStatusMessage,C=t.readReceiptInfo,m=t.pushConfig,S=t.messageId,A=t.isInterrupt,O=t.isModifyMessage,N=t.channelType,_=t.sentStatus;I||(I=e.ReceivedStatus.UNREAD);var y={messageType:r,channelId:o||"",content:s,senderUserId:a,targetId:i,conversationType:n,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:g,isCounted:v,isMentioned:T,disableNotification:p,isStatusMessage:h,canIncludeExpansion:E,expansion:R,receivedStatus:I,readReceiptInfo:C,pushConfig:m,messageId:S,isInterrupt:A,isModifyMessage:O,sentStatus:_};return n!==e.ConversationType.ULTRA_GROUP&&(y.isOffLineMessage=f),n===e.ConversationType.ULTRA_GROUP&&e.isNumber(N)&&(y.channelType=N),y}function X(t){var n=t.conversationType,o=t.targetId,r=t.latestMessage,s=t.unreadMessageCount,a=t.hasMentioned,i=t.mentionedInfo,c=t.lastUnreadTime,d=t.notificationStatus,u=t.notificationLevel,l=t.isTop,g=t.channelId,v=t.unreadMentionedCount,f=t.matchCount,E=t.unreadMentionedMeCount,R={conversationType:n,targetId:o,latestMessage:r&&W(r),unreadMessageCount:s,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:d,notificationLevel:u,isTop:l,channelId:g,unreadMentionedCount:v,matchCount:f,unreadMentionedMeCount:E};return R.conversationType===e.ConversationType.ULTRA_GROUP&&(R.firstUnreadMessage=t.firstUnreadMessage,R.channelType=t.channelType),R}function Q(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(j=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",j.CONNECTED="CONNECTED",j.DISCONNECT="DISCONNECT",j.SUSPEND="SUSPEND",j.MESSAGES="MESSAGES",j.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",j.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",j.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",j.CONVERSATION="CONVERSATION",j.CHATROOM="CHATROOM",j.EXPANSION="EXPANSION",j.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",j.TAG="TAG",j.CONVERSATION_TAG="CONVERSATION_TAG",j.TYPING_STATUS="TYPING_STATUS",j.MESSAGE_BLOCKED="MESSAGE_BLOCKED",j.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",j.OPERATE_STATUS="OPERATE_STATUS",j.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",j.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",j.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",j.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",j.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",j.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",j.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",j.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",j.USER_GROUP_STATUS="USER_GROUP_STATUS";var $=new e.EventEmitter,ee={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:$.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:$.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:$.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:$.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){$.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return W(e)}))})},typingState:function(e){$.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){$.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){$.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){$.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,o={conversationType:n,latestMessage:t.latestMessage?W(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(o.versionTime=t.versionTime,o.unreadMessageCount=te(t.unreadMessageCount||0),o.unreadMentionedCount=te(t.unreadMentionedCount||0),o.unreadMentionedMeCount=te(t.unreadMentionedMeCount||0),{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));$.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){$.emit(exports.Events.CHATROOM,e)},expansion:function(e){$.emit(exports.Events.EXPANSION,e)},pullFinished:function(){$.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){$.emit(exports.Events.TAG)},conversationTagChanged:function(){$.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){$.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){$.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){$.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){$.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return X(e)})))},operateStatus:function(e){$.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return W(e)})))},ultraGroupMessageModified:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return W(e)})))},ultraGroupMessageRecalled:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return W(e)})))},ultraGroupChannelChangeType:function(e){$.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){$.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){$.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){$.emit(exports.Events.USER_GROUP_STATUS,e)}};function te(e){return e>999?999:e}e.VersionManage.add("imlib-next","5.7.10");var ne=null,oe=null,re=null;function se(){return r(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return ne?(re.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),oe=null,ne=null,re=null,[2]}}))}))}function ae(e){if(!ne)throw new Error("Not initialized yet!");return e(ne,re,oe)}function ie(t){return ne?t(ne,re,oe):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function ce(){$.clear()}var de={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},ue={};for(var le in de){var ge=de[le].code;ue[ge]=le}de.ROAMING_SERVICE_UNAVAILABLE.code;var ve=function(t,n,o){void 0===o&&(o="");var r="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return t.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),r},fe=function(t,n,o,a){return void 0===a&&(a=""),r(void 0,void 0,void 0,(function(){var r,i;return s(this,(function(s){switch(s.label){case 0:return r=ve(t,n,a),[4,o()];case 1:return(i=s.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(a," fail -> ").concat(i," : ").concat(ue[i]," , ").concat(r)),[2,{code:i,msg:ue[i]}]):[2,{code:i}]}}))}))};var Ee=function(t){return!!(e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.value",t.value,e.AssertRules.STRING,!0)&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))},Re=function(t){return t.entries.every((function(t){return e.validate("entry.key",t.key,e.AssertRules.STRING,!0)&&e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)&&e.validate("options.isForce",t.isForce,e.AssertRules.BOOLEAN)},Ie=function(t){return e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)},pe=function(t){return t.entries.every((function(t){return e.validate("key",t,e.AssertRules.STRING,!0)}))&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)};var Te=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function he(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Te(e,o,t,n)}}var Ce,me=he("RC:ImgMsg"),Se=he("RC:HQVCMsg"),Ae=he("RC:SightMsg"),Oe=he("RC:TxtMsg"),Ne=he("RC:CombineMsg"),_e=he("RC:FileMsg"),ye=he("RC:GIFMsg"),Ue=he("RC:VcMsg"),Le=he("RC:LBSMsg"),Me=he("RC:ReferenceMsg"),Pe=he("RC:ImgTextMsg");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Ce||(Ce={}));var we,xe,be=function(){function t(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return t.prototype.upload=function(t){return t.file.size>e.MAX_UPLOAD_FILE_SIZE?Promise.resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):t.file.size>e.UPLOAD_FILE_CHUNK_SIZE&&this.isSupportMultipart?this.multipartUpload(t):this.commonUpload(t)},t}(),Be=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=s.sent(),i={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,z.httpReq({url:/http/.test(this._url)?this._url:"https://".concat(this._url),headers:i,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.QINIU}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:d.toString()}]}}))}))},o.prototype.multipartUpload=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("Method not implemented.")}))}))},o}(be),De=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=s.sent(),i="https://".concat(a.ossBucketName,".").concat(this._url),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,z.httpReq({url:i,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.ALI}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:d.toString()}]}}))}))},o.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},o}(be),Ge=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d,u,l;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=e.FileType.FILE?r:e.FileType.FILE)];case 1:return i=s.sent(),c=a||("text/html"===n.type?"inline":"attachment"),d={authorization:i.bosToken,"x-bce-date":i.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},u=(/http/.test(this._url)?this._url:"https://".concat(this._url))+i.path,[4,z.httpReq({url:u,headers:d,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=s.sent().status)||204===l?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:i.fileName,downloadUrl:u}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]}}))}))},o.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},o}(be),Ve=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return i=s.sent(),c={},d="https://".concat(i.s3BucketName,".").concat(this._url),u=new FormData,a?u.set("Content-Disposition",a):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",i.s3Credential),u.set("x-amz-algorithm",i.s3Algorithm),u.set("x-amz-date",i.s3Date),u.set("policy",i.s3Policy),u.set("x-amz-signature",i.s3Signature),u.set("key",i.fileName),u.set("file",n),[4,z.httpReq({url:d,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:u,timeout:0})];case 2:return l=s.sent(),g=l.status,l.data,200===g||204===g?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:e.UploadMethod.AWS}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:g.toString()}]}}))}))},o.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},o}(be),ke=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(n,a,t),[4,z.httpReq({url:i,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL}]}}))}))},o.prototype.multipartUpload=function(t){var n;return r(this,void 0,void 0,(function(){var o,r,a,i,c,d,u,l,g,v,f,E,R,I,p,T,h;return s(this,(function(s){switch(s.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(o,a,t),[4,z.httpReq({url:"".concat(i,"?uploads"),headers:c,method:"POST"})];case 2:return d=s.sent(),u=d.status,l=d.data,g=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!g?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(i,o,g,a.fileName,t,v)]);case 3:return f=s.sent(),E=f.code,R=f.msg,E!==e.ErrorCode.SUCCESS?[2,{code:E,msg:R}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(g))];case 4:return I=s.sent(),p=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(p,"</CompleteMultipartUpload>"),T=this.getBaseHeaders(o,I,t),[4,z.httpReq({url:"".concat(i,"?uploadId=").concat(g),headers:T,method:"POST",body:p})];case 5:return 200===(h=s.sent().status)||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.STC}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},o.prototype.requestUploadPart=function(t,n,o,a,i,c,d,u){return void 0===d&&(d=1),void 0===u&&(u=0),r(this,void 0,void 0,(function(){var r,l,g,v,f,E,R,I,p;return s(this,(function(s){switch(s.label){case 0:return u>=5?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(r=(d-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-r),g="partNumber=".concat(d,"&uploadId=").concat(o),[4,this._getFileToken(i.fileType,a,"PUT",g)]);case 1:return v=s.sent(),f=n.slice(r,d*e.UPLOAD_FILE_CHUNK_SIZE),E=this.getBaseHeaders(n,v,i),[4,z.httpReq({url:"".concat(t,"?").concat(g),headers:E,method:"PUT",body:f,onProgress:function(e){var t;return null===(t=null==i?void 0:i.onProgress)||void 0===t?void 0:t.call(i,r+e.loaded,n.size)},timeout:0})];case 2:return R=s.sent(),I=R.status,R.data,p=R.xhr,200===I||204===I?(c.push((null==p?void 0:p.getResponseHeader("ETag"))||""),r+l<n.size?[2,this.requestUploadPart(t,n,o,a,i,c,d+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,o,a,i,c,d,u+1)]}}))}))},o.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},o}(be),Fe=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(n,a,t),[4,z.httpReq({url:i,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:d.toString()}]}}))}))},o.prototype.multipartUpload=function(t){var n;return r(this,void 0,void 0,(function(){var o,r,a,i,c,d,u,l,g,v,f,E,R,I,p,T,h;return s(this,(function(s){switch(s.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(o,a,t),[4,z.httpReq({url:"".concat(i,"?uploads"),headers:c,method:"POST"})];case 2:return d=s.sent(),u=d.status,l=d.data,g=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!g?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(i,o,g,a.fileName,t,v)]);case 3:return f=s.sent(),E=f.code,R=f.msg,E!==e.ErrorCode.SUCCESS?[2,{code:E,msg:R}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(g))];case 4:return I=s.sent(),p=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(p,"</CompleteMultipartUpload>"),T=this.getBaseHeaders(o,I,t),[4,z.httpReq({url:"".concat(i,"?uploadId=").concat(g),headers:T,method:"POST",body:p,timeout:0})];case 5:return 200===(h=s.sent().status)||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},o.prototype.requestUploadPart=function(t,n,o,a,i,c,d,u){return void 0===d&&(d=1),void 0===u&&(u=0),r(this,void 0,void 0,(function(){var r,l,g,v,f,E,R,I,p;return s(this,(function(s){switch(s.label){case 0:return u>=5?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(r=(d-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-r),g="partNumber=".concat(d,"&uploadId=").concat(o),[4,this._getFileToken(i.fileType,a,"PUT",g)]);case 1:return v=s.sent(),f=n.slice(r,d*e.UPLOAD_FILE_CHUNK_SIZE),E=this.getBaseHeaders(n,v,i),[4,z.httpReq({url:"".concat(t,"?").concat(g),headers:E,method:"PUT",body:f,timeout:0,onProgress:function(e){var t;return null===(t=null==i?void 0:i.onProgress)||void 0===t?void 0:t.call(i,r+e.loaded,n.size)}})];case 2:return R=s.sent(),I=R.status,p=R.xhr,200===I||204===I?(c.push((null==p?void 0:p.getResponseHeader("ETag"))||""),r+l<n.size?[2,this.requestUploadPart(t,n,o,a,i,c,d+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,o,a,i,c,d,u+1)]}}))}))},o.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},o}(be),He=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d,u,l,g,v;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=s.sent(),i={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),d=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,z.httpReq({url:d,headers:i,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return u=s.sent(),l=u.status,g=u.data,200!==l&&204!==l||!g?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]:(v=JSON.parse(g),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:v.rc_url.file_name,downloadUrl:"".concat(d,"/").concat(v.rc_url.path)}}])}}))}))},o.prototype.multipartUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=e.getUUID(),[4,this._getFileToken(r,n.name)];case 1:return i=s.sent().token,[2,this._requestUploadPart(a,n,i,o)]}}))}))},o.prototype._requestUploadPart=function(t,n,o,a,i){return void 0===i&&(i=0),r(this,void 0,void 0,(function(){var r,c,d,u,l,g,v,f,E,R;return s(this,(function(s){switch(s.label){case 0:return r=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-i),c=t+n.name.substring(n.name.lastIndexOf(".")),d={Range:"bytes=".concat(i,"-").concat(i+r),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},u=n.slice(i,i+r),(l=new FormData).set("file",u,n.name),l.set("key",c),l.set("name",c),l.set("token",o),g=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,z.httpReq({url:g,headers:d,onProgress:function(e){return null==a?void 0:a(i+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return v=s.sent(),f=v.status,E=v.data,200===f||204===f?i+r<n.size?[2,this._requestUploadPart(t,n,o,a,i+r)]:(R=JSON.parse(E),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:R.rc_url.file_name,downloadUrl:"".concat(g,"/").concat(R.rc_url.path)}}]):[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:f.toString()}]}}))}))},o}(be);function Ze(t,n){return r(this,void 0,void 0,(function(){var r,a,i,c,d,u,l,g,v,f,E,R,I,p,T,h,C,m,S,A,O,N,_,y;return s(this,(function(s){switch(s.label){case 0:return r=n.getFileToken,a=n.serverType,i=n.customDomain,c=n.ossConfig,d=n.uploadServer,u=n.bosAddr,l=t.file,g=t.fileType,v=t.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:Ce.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:Ce.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var s=[];o&&s.push({type:Ce.QINIU,url:o,p:"1"});r&&s.push({type:Ce.BAIDU,url:r,p:"2"});return s}(c,0,i,d,u),0===f.length?[2,Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Ke(f,t,r,a)];case 1:return E=s.sent(),R=E.code,I=E.data,p=E.msg,R===e.ErrorCode.SUCCESS&&I?[4,qe(t,n,I)]:[2,{code:R,msg:p}];case 2:return T=s.sent(),h={downloadUrl:T,uniqueName:(null==I?void 0:I.uniqueName)||"",name:l.name,size:l.size,type:l.type},g!==e.FileType.AUDIO?[3,5]:[4,l.arrayBuffer()];case 3:return[4,Je(s.sent())];case 4:return C=s.sent(),m=C.duration,S=C.length,y=o(o({},h),{duration:m,length:S}),[2,{code:R,data:y}];case 5:return g!==e.FileType.IMAGE?[3,7]:[4,Ye(l,v)];case 6:return A=s.sent(),O=A.thumbnail,N=A.width,_=A.height,y=o(o({},h),{thumbnail:O,width:N,height:_}),[2,{code:R,data:y}];case 7:return[2,{code:R,data:h}]}}))}))}function qe(e,t,n){return r(this,void 0,void 0,(function(){var o,r,a,i,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o=t.getFileUrl,r=e.fileType,a=e.file,i=n.uploadMethod,c=n.downloadUrl,d=n.uniqueName,(u=c)?[3,2]:[4,o(r,d,a.name,void 0,i)];case 1:u=s.sent().downloadUrl,s.label=2;case 2:return[2,u]}}))}))}function Je(e){return xe=xe||new AudioContext,new Promise((function(t,n){xe.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var je=((we={})[Ce.QINIU]=Be,we[Ce.ALIYUN]=De,we[Ce.BAIDU]=Ge,we[Ce.S3]=Ve,we[Ce.STC]=ke,we[Ce.MINIO]=Fe,we[Ce.RCX]=He,we);function Ke(t,n,o,a,i){return void 0===i&&(i=[]),r(this,void 0,void 0,(function(){var r,c,d,u,l;return s(this,(function(s){switch(s.label){case 0:return 0===t.length?[2,Promise.resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(i))})]:(r=t.shift(),[4,new je[r.type](r.url,o,a).upload(n)]);case 1:return c=s.sent(),d=c.code,u=c.data,l=c.msg,d!==e.ErrorCode.SUCCESS?(i.push({type:r.type,url:r.url,code:d,msg:l}),[2,Ke(t,n,o,a,i)]):[2,{code:d,data:u}]}}))}))}function Ye(e,t){return new Promise((function(n,o){var r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;a.onload=function(o){var i=t||{},c=i.maxHeight,d=void 0===c?160:c,u=i.maxWidth,l=void 0===u?160:u,g=i.quality,v=void 0===g?.7:g,f=i.scale,E=void 0===f?1:f,R=ze(a.width,a.height,{maxHeight:d,maxWidth:l,scale:E});r.width=Math.min(R.w,l),r.height=Math.min(R.h,d),s.drawImage(a,R.x,R.y,R.w,R.h);var I=r.toDataURL("string"==typeof e?"image/jpg":e.type,v);I=I.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:I,width:R.w,height:R.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var ze=function(e,t,n){var o,r,s=n.maxHeight,a=void 0===s?160:s,i=n.maxWidth,c=void 0===i?160:i,d=n.scale,u=e<t,l=0,g=0;return(u?t/e:e/t)>(void 0===d?1:d)?(u?(o=100,g=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-g}):(u?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-g})};function We(t,n,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g,v,f,E,R,I,p,T;return s(this,(function(s){switch(s.label){case 0:return a=a||{},n instanceof Te==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,de.ILLGAL_PARAMS]):e.validate("conversation",t,e.AssertRules.OBJECT,!0)?(r=t.conversationType,i=t.targetId,u=t.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",r,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",u,e.AssertRules.CHANNEL_ID)&&e.validate("options.isStatusMessage",null==a?void 0:a.isStatusMessage,e.AssertRules.BOOLEAN)&&e.validate("options.disableNotification",null==a?void 0:a.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushContent",null==a?void 0:a.pushContent,e.AssertRules.STRING)&&e.validate("options.pushData",null==a?void 0:a.pushData,e.AssertRules.STRING)&&e.validate("options.isMentioned",null==a?void 0:a.isMentioned,e.AssertRules.BOOLEAN)&&e.validate("options.mentionedType",null==a?void 0:a.mentionedType,e.AssertRules.NUMBER)&&e.validate("options.mentionedUserIdList",null==a?void 0:a.mentionedUserIdList,e.AssertRules.ARRAY)&&e.validate("options.directionalUserIdList",null==a?void 0:a.directionalUserIdList,e.AssertRules.ARRAY)&&e.validate("options.isVoipPush",null==a?void 0:a.isVoipPush,e.AssertRules.BOOLEAN)&&e.validate("options.canIncludeExpansion",null==a?void 0:a.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("options.expansion",null==a?void 0:a.expansion,e.AssertRules.OBJECT)&&e.validate("options.pushConfig",null==a?void 0:a.pushConfig,e.AssertRules.OBJECT)&&e.validate("options.messageId",null==a?void 0:a.messageId,e.AssertRules.NUMBER)?(l="conversationType:".concat(r,",targetId:").concat(i),d.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,t,n){var r=e.isStatusMessage,s=e.disableNotification,a=e.pushContent,i=e.pushData,c=e.isMentioned,d=e.mentionedType,u=e.mentionedUserIdList,l=e.directionalUserIdList,g=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,E=e.isFilerWhiteBlacklist,R=e.pushConfig,I=e.messageId,p=n.channelId;return o({isStatusMessage:r,disableNotification:s,pushContent:a,pushData:i,isMentioned:c,mentionedType:d,mentionedUserIdList:u,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:E,pushConfig:R,channelId:p||"",messageId:I},t)}(a,n,t),v={isMentioned:!!a.isMentioned,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!(null==a?void 0:a.disableNotification),canIncludeExpansion:!!(null==a?void 0:a.canIncludeExpansion),expansion:(null==a?void 0:a.expansion)||null,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!a.isStatusMessage,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:null==a?void 0:a.pushConfig,sentStatus:e.SentStatus.SENDING},r!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=d.createTraceId(),E=function(t){v.messageId=t;try{(null==a?void 0:a.onSendBefore)&&a.onSendBefore(W(v))}catch(t){d.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),f)}},d.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:r,targetId:i,channelId:u}),f),[4,c.sendMessage(r,i,g,E,f)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return R=s.sent(),I=R.code,p=R.data,I===e.ErrorCode.SUCCESS?(d.info(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:I,messageUId:p.messageUId,messageId:p.messageId}),f),T=W(p),[2,{code:I,data:T}]):(d.warn(e.LogTagId.A_SEND_MSG_R,"send message fail ->".concat(I,":").concat(ue[I],",").concat(l)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:I,msg:ue[I],data:W(v)}])}}))}))}))]}))}))}function Xe(t,n){return function(r,s,a,i){if(!e.validate("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var c={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var d=null==i?void 0:i.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==d?void 0:d.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==d?void 0:d.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==d?void 0:d.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==d?void 0:d.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});c.thumbnailConfig=d}return ie((function(d,u,l){return new Promise((function(d){var l,g=u.createTraceId();u.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:s.file.size,type:t}),g),(l={file:s.file,fileType:t,onProgress:function(e,t){var n;null===(n=null==a?void 0:a.onProgress)||void 0===n||n.call(a,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig},ie((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();Ze(l,{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:n.uploadDomain||"",serverType:null==o?void 0:o.type,ossConfig:null==o?void 0:o.ossConfig,uploadServer:null==o?void 0:o.uploadServer,bosAddr:null==o?void 0:o.bosAddr}).then((function(e){t(e)}))}))}))).then((function(t){var c,l=t.code,v=t.data,f=t.msg;if(l===e.ErrorCode.SUCCESS&&v){var E=(null===(c=null==a?void 0:a.onComplete)||void 0===c?void 0:c.call(a,o({url:v.downloadUrl},v)))||n(v,s);return u.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:v.downloadUrl,code:e.ErrorCode.SUCCESS}),g),void We(r,E,i).then(d)}d({code:l,msg:f})}))}))}))}}var Qe=Xe(e.FileType.FILE,(function(e,t){return new _e({name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,o})),$e=Xe(e.FileType.IMAGE,(function(e,t){return new me({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),et=Xe(e.FileType.IMAGE,(function(e,t){return new ye({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),nt=Xe(e.FileType.AUDIO,(function(e,t){return new Se({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),ot=Xe(e.FileType.SIGHT,(function(e,t){return new Ae({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));Xe(e.FileType.COMBINE_HTML,(function(e,t){return new Ne({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var rt=Object.freeze({__proto__:null,getAllConversationList:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.CHANNEL_ID)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,o.getConversationListWithAllChannel()]:[3,2];case 1:return n=s.sent(),[3,4];case 2:return[4,o.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:n=s.sent(),s.label=4;case 4:return r=n.code,i=n.data,r===e.ErrorCode.SUCCESS&&i?(c=i.map((function(e){return X(e)})),[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.usingCppEngine()?e.validate("startTime",t,e.AssertRules.NUMBER,!0)&&e.validate("count",n,e.AssertRules.NUMBER,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return r="startTime: ".concat(t,", count: ").concat(n,", channelId: ").concat(o),c.info(e.LogTagId.O,"getConversationList -> ".concat(r)),e.isUndefined(o)?[4,i.getConversationListWithAllChannelByPage(t,n)]:[3,2];case 1:return a=s.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(d,t,n,o)];case 3:a=s.sent(),s.label=4;case 4:return u=a.code,l=a.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return X(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:ue[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.usingCppEngine()?e.validate("keyword",n,e.AssertRules.STRING,!0)&&e.validate("messageTypes",o,e.AssertRules.ARRAY,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)&&!o.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g;return s(this,(function(s){switch(s.label){case 0:return r="keyword: ".concat(n,", messageTypes: ").concat(JSON.stringify(o),", channelId: ").concat(a),d.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(a)?[4,c.searchConversationByContentWithAllChannel(n,o)]:[3,2];case 1:return i=s.sent(),[3,4];case 2:return[4,c.searchConversationByContent(n,o,a)];case 3:i=s.sent(),s.label=4;case 4:return u=i.code,l=i.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return X(e)})),[2,{code:u,data:g}]):(d.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:ue[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",n,e.AssertRules.STRING,!0)&&e.validate("startTime",o,e.AssertRules.NUMBER,!0)&&e.validate("count",a,e.AssertRules.NUMBER,!0)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g,v,f,E,R,I;return s(this,(function(s){switch(s.label){case 0:return r="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a),d.info(e.LogTagId.O,"searchMessages -> ".concat(r)),i=t.targetId,u=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(u,i,n,o,a)]:[3,2];case 1:return g=s.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(u,i,n,o,a,0,l)];case 3:g=s.sent(),s.label=4;case 4:return v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?(E=f.messages,R=f.count,I=E.map((function(e){return W(e)})),[2,{code:v,data:{messages:I,count:R}}]):(d.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(r)),[2,{code:v,msg:ue[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",n,e.AssertRules.OBJECT,!0)&&e.validate("option.keyword",n.keyword,e.AssertRules.STRING,!0)&&e.validate("option.startTime",n.startTime,e.AssertRules.NUMBER,!0)&&e.validate("option.endTime",n.endTime,e.AssertRules.NUMBER,!0)&&e.validate("option.offset",n.offset,e.AssertRules.NUMBER)&&e.validate("option.limit",n.limit,e.AssertRules.NUMBER)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E,R;return s(this,(function(s){switch(s.label){case 0:return o="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(n)),i.info(e.LogTagId.O,"searchMessageInTimeRange -> ".concat(o)),r=t.conversationType,c=t.targetId,d=n.keyword,u=n.startTime,l=n.endTime,g=n.offset,v=n.limit,g=g||0,v=v||5,[4,a.searchMessageByContentInTimeRangeWithAllChannel(r,c,d,u,l,g,v)];case 1:return f=s.sent(),E=f.code,R=f.data,E===e.ErrorCode.SUCCESS&&R?[2,{code:E,data:{messages:R.messages.map((function(e){return W(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(E,", ").concat(o)),[2,{code:E}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("userId",n,e.AssertRules.STRING,!0)&&e.validate("startTime",o,e.AssertRules.NUMBER,!0)&&e.validate("count",a,e.AssertRules.NUMBER,!0)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g,v,f;return s(this,(function(s){switch(s.label){case 0:return r="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a),d.info(e.LogTagId.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),i=t.conversationType,u=t.targetId,l=t.channelId,[4,c.searchMessagesByUser(i,u,n,o,a,l)];case 1:return g=s.sent(),v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?[2,{code:v,data:{messages:f.messages.map((function(e){return W(e)}))}}]:(d.warn(e.LogTagId.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(v,", ").concat(r)),[2,{code:v}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",n,e.AssertRules.OBJECT,!0)&&e.validate("option.count",n.count,e.AssertRules.NUMBER)&&e.validate("options.count",n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&e.validate("option.timestamp",n.timestamp,e.AssertRules.NUMBER)&&e.validate("option.order",n.order,(function(e){return[0,1].includes(e)}))&&e.validate("option.messageTypes",n.messageTypes,e.AssertRules.ARRAY,!0)&&!n.messageTypes.some((function(t){return!e.validate("option.messageType",t,e.AssertRules.STRING,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E,R,I,p,T,h;return s(this,(function(s){switch(s.label){case 0:return o=n.count,r=n.timestamp,c=n.order,d=n.messageTypes,u="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(n)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),l=t.conversationType,g=t.targetId,v=t.channelId,o||(o=20),r||(r=0),c||(c=0),v||(v=""),[4,a.getHistoryMessagesByObjectNames(l,g,r,o,d,c,v)];case 1:return f=s.sent(),E=f.code,R=f.data,E===e.ErrorCode.SUCCESS?(p=(I=R).list,T=I.hasMore,h=p.map((function(e){return W(e)})),[2,{code:E,data:{messages:h,hasMore:T,list:h}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(E," ").concat(u)),[2,{code:E,msg:ue[E]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="conversation: ".concat(JSON.stringify(t),", timestamp: ").concat(n),i.info(e.LogTagId.O,"updateSentMsgReceiptStatus -> ".concat(o)),r=t.conversationType,c=t.targetId,d=t.channelId,[4,a.setMessageStatusToRead(r,c,n,d)];case 1:return[2,s.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",n,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus -> messageId: ".concat(t,", receivedStatus: ").concat(n)),[4,a.setMessageReceivedStatus(t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("sentStatus",n,(function(t){return!e.isUndefined(e.SentStatus[t])}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(n)),[4,a.setMessageSentStatus(t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,n,o){return void 0===o&&(o=""),r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("content",n,e.AssertRules.OBJECT,!0)&&e.validate("messageType",o,e.AssertRules.ONLY_STRING,!0)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return c.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", messageType: ").concat(o)),[4,i.setMessageContent(t,n,o)];case 1:return[2,{code:r.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?!e.validate("messageIds",t,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("messageId",t,e.AssertRules.NUMBER,!0)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,ie((function(o,a){return r(n,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,o.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,o.clearMessages(n,r,i)];case 1:return[2,{code:s.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,n,o){return r(this,void 0,void 0,(function(){var a,i,c,d=this;return s(this,(function(u){return e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",o,e.AssertRules.BOOLEAN)?[2,ie((function(e,t){return r(d,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.deleteMessagesByTimestamp(a,i,n,o,c)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,n,o){return void 0===o&&(o={}),r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("options",o,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==o?void 0:o.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==o?void 0:o.searchContent,e.AssertRules.STRING)&&(n instanceof Te||e.validate("message.senderUserId",n.senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",n.messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",n.content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",n.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",n.expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",n.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",n.sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",n.sentStatus,e.AssertRules.NUMBER))?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g,v,f,E,R,I,p,T,h,C;return s(this,(function(s){switch(s.label){case 0:return r="",a=1,g=!1,f=n.messageType,E=n.content,n instanceof Te||(r=n.senderUserId,a=n.messageDirection,g=n.canIncludeExpansion,v=n.expansion,l=n.disableNotification,d=n.sentTime,u=n.sentStatus),c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),R=o.isUnread,I=o.searchContent,p={senderUserId:r,messageType:f,content:E,messageDirection:a,sentTime:d,sentStatus:u,searchContent:I,isUnread:R,messageUId:"",disableNotification:l,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,p)];case 1:return T=s.sent(),h=T.code,C=T.data,h===e.ErrorCode.SUCCESS?[2,{code:h,data:W(C)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(h,",targetId:").concat(t.targetId)),[2,{code:h,msg:ue[h]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,n){var o,a;return r(this,void 0,void 0,(function(){var i,c=this;return s(this,(function(d){if(!e.usingCppEngine())return[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}];if(!e.validate("messages",t,(function(t){return e.isArray(t)&&!(t.length<=0||t.length>=500)}),!0)||!e.validate("checkDuplicate",n,e.AssertRules.BOOLEAN))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];for(i in t)if(!(e.validate("message",t[i],e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",t[i].conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.DISCUSSION,e.ConversationType.GROUP,e.ConversationType.CUSTOMER_SERVICE,e.ConversationType.SYSTEM,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE].includes(t)}),!0)&&e.validate("message.targetId",t[i].targetId,e.AssertRules.STRING,!0)&&e.validate("message.senderUserId",t[i].senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",t[i].messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",t[i].content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",t[i].messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",t[i].canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",t[i].expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",t[i].disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",t[i].sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",t[i].sentStatus,e.AssertRules.NUMBER)&&e.validate("options.isUnread",null===(o=t[i])||void 0===o?void 0:o.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null===(a=t[i])||void 0===a?void 0:a.searchContent,e.AssertRules.STRING)))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,ie((function(o){return r(c,void 0,void 0,(function(){var r,a,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.batchInsertMessage(t,n)];case 1:return r=s.sent(),a=r.code,i=r.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:ue[a]}]}}))}))}))]}))}))},getMessageCount:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?[2,ie((function(e){return r(n,void 0,void 0,(function(){var n,o,r,a,i,c;return s(this,(function(s){switch(s.label){case 0:return n=t.conversationType,o=t.targetId,r=t.channelId,[4,e.getMessageCount(n,o,r)];case 1:return a=s.sent(),i=a.code,c=a.data,[2,{code:i,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("messageUId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getPrivateMessageDeliverTime(t)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(t)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",n,e.AssertRules.STRING,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getGroupMessageDeliverList(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(r,", targetId:").concat(t," messageUId:").concat(n)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("enableCheck",t,e.AssertRules.BOOLEAN)?[2,ie((function(e){return r(n,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,e.setCheckDuplicateMessage(t)];case 1:return[2,{code:n.sent().code}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return e.usingCppEngine()?[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return o.info(e.LogTagId.O,"clearLocalData ->"),[4,n.clearData()];case 1:return t=s.sent(),r=t.code,a=t.data,[2,{code:r,data:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),st=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};Object.defineProperty(exports,"AreaCode",{enumerable:!0,get:function(){return e.AreaCode}}),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomSyncStatusReason",{enumerable:!0,get:function(){return e.ChatroomSyncStatusReason}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ChrmMemBanType",{enumerable:!0,get:function(){return e.ChrmMemBanType}}),Object.defineProperty(exports,"ChrmMemOperateType",{enumerable:!0,get:function(){return e.ChrmMemOperateType}}),Object.defineProperty(exports,"ChrmSyncStatus",{enumerable:!0,get:function(){return e.ChrmSyncStatus}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"OperateStatus",{enumerable:!0,get:function(){return e.OperateStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return e.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return e.SentStatus}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return e.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),exports.BaseMessage=Te,exports.CombineMessage=Ne,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=_e,exports.GIFMessage=ye,exports.HQVoiceMessage=Se,exports.ImageMessage=me,exports.LocationMessage=Le,exports.MentionedInfoBody=st,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=Me,exports.RichContentMessage=Pe,exports.SightMessage=Ae,exports.TextMessage=Oe,exports.VoiceMessage=Ue,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"addTagForConversations ->tagId:".concat(t)),[4,a.addTagForConversations(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"addTagForConversations ->code:".concat(o,",tagId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){$.on(e,t,n)},exports.addTag=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagId",t.tagId,(function(e){return e.length<=10}))&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,o.createTag(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addToBlacklist=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,o.addToBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.bindRTCRoomForChatroom=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("option.chatRoomId",t.chatRoomId,e.AssertRules.STRING,!0)&&e.validate("option.rtcRoomId",t.rtcRoomId,e.AssertRules.STRING,!0)?[2,ie((function(e){return r(n,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return[4,e.bindRTCRoomForChatroom(t)];case 1:return[2,{code:n=o.sent(),msg:ue[n]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearAllMessagesUnreadStatus=function(){return r(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){return[2,ie((function(t,n){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=ce,exports.clearHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"clear message ->".concat(o)),[4,a.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,n,t.channelId)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearMessages=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return Q("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,o.clearMessages(n,r,i)];case 1:return(c=s.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(a.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r;return s(this,(function(s){switch(s.label){case 0:return[4,o.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"clear unreadMsgNum ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"clear unreadMsgNum fail ->".concat(n,":").concat(ue[n],",").concat(r)),[2,{code:n,msg:ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearTextMessageDraft=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r;return s(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,o.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=s.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(a.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(ue[r],",").concat(n)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o=t.conversationType,r=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(r,",conversationType:").concat(o)),[4,a.clearUnreadCountByTimestamp(o,r,n,c)];case 1:return(d=s.sent())===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(d,",targetId:").concat(r)),[2,{code:d,msg:ue[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return e.validate("token",t,e.AssertRules.STRING,!0)&&e.validate("reconnectKickEnable",n,e.AssertRules.BOOLEAN)?(o=i.createTraceId(),i.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:n}),o),[4,a.connect(t,!!n,o)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return r=s.sent(),c=r.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:r.code,userId:r.userId}),o),r.code===e.ErrorCode.SUCCESS?[2,{code:r.code,data:{userId:r.userId}}]:[2,{code:r.code,msg:ue[r.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,n,o){return r(this,void 0,void 0,(function(){var a,i,c,d=this;return s(this,(function(u){return Q("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",o,e.AssertRules.BOOLEAN)?[2,ie((function(u,l){return r(d,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return[4,u.deleteMessagesByTimestamp(a,i,n,o,c)];case 1:return r=s.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:r,conversationType:a,targetId:i,channelId:c,timestamp:n})),r===e.ErrorCode.SUCCESS?[2,{code:r}]:(l.warn(e.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options",n,(function(t){return e.isArray(t)&&t.length}),!0)&&!n.some((function(t){return!e.validate("options.messageUId",t.messageUId,e.AssertRules.STRING,!0)||!e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)||!e.validate("options.messageDirection",t.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"delete messages ->".concat(o)),[4,a.deleteRemoteMessage(t.conversationType,t.targetId,n,t.channelId)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.destroy=function(){return r(this,void 0,void 0,(function(){return s(this,(function(e){return ne?(ce(),[2,se()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),ae((function(e){return e.disconnect(t)}))},exports.electronExtension=rt,exports.forceRemoveChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ie(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.info(e.LogTagId.O,"force remove chatroom entry ->".concat(o)),[4,a.forceRemoveChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ee(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"force set chatroom entry ->".concat(o)),[4,a.forceSetChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllChatRoomEntries=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return n="id:".concat(t),a.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,o.getAllChatroomEntries(t)];case 1:return r=s.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS&&c?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"get all chatroom entries fail ->code+:".concat(ue[i],",").concat(n)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllConversationState=function(){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ie((function(e){return e.getAllConversationState()}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a,i;return s(this,(function(s){switch(s.label){case 0:return t="getAllUltraGroupUnreadCount",[4,n.getAllUltraGroupUnreadCount()];case 1:return r=s.sent(),a=r.code,i=r.data,o.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(o.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(ue[a])),[2,{code:a,msg:ue[a]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a,i;return s(this,(function(s){switch(s.label){case 0:return t="getAllUltraGroupUnreadMentionedCount",!0,[4,n.getAllUltraGroupUnreadCount(true)];case 1:return r=s.sent(),a=r.code,i=r.data,o.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(o.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(ue[a])),[2,{code:a,msg:ue[a]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,ie((function(t,n){return n.debug(e.LogTagId.O,"getAllUnreadMentionedCount"),t.getAllUnreadMentionedCount()}))]}))}))},exports.getBlacklist=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return o.info(e.LogTagId.O,"getBlacklist -> "),[4,n.getBlacklist()];case 1:return t=s.sent(),r=t.code,a=t.data,r===e.ErrorCode.SUCCESS&&a?[2,{code:r,data:a}]:(o.warn(e.LogTagId.O,"getBlacklist fail -> code: ".concat(r)),[2,{code:r}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,o.getBlacklistStatus(t)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:0===i}]:(a.warn(e.LogTagId.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(t)),[2,{code:r}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getBlockUltraGroupList=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,n.getBlockUltraGroupList()];case 1:return t=s.sent(),r=t.code,a=t.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:a}]:(o.warn(e.LogTagId.O,"get block ultragroup ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ie((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("key",n,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom entry->".concat(o)),[4,a.getChatroomEntry(t,n)];case 1:return r=s.sent(),c=r.code,d=r.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",n.count,e.AssertRules.NUMBER)&&e.validate("options.order",n.order,(function(e){return[0,1,2].includes(e)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom info ->".concat(o)),[4,a.getChatroomInfo(t,n.count,n.order)];case 1:return r=s.sent(),c=r.code,d=r.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.timestamp",n.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",n.count,e.AssertRules.NUMBER)&&e.validate("options.count",n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&e.validate("options.order",n.order,(function(e){return 0===e||1===e}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom history message->".concat(o)),[4,a.getChatRoomHistoryMessages(t,n.count,n.order,n.timestamp)];case 1:return r=s.sent(),c=r.code,d=r.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return W(e)})),[2,{code:c,data:{list:u,hasMore:!!d.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return ae((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=s.sent(),r=n.code,i=n.data,r!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"getConversation ->code:".concat(r,", targetId:").concat(t.targetId)),[2,{code:r,msg:ue[r]}]):[2,{code:r,data:i?X(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options.count",null==t?void 0:t.count,e.AssertRules.NUMBER)&&e.validate("options.startTime",null==t?void 0:t.startTime,e.AssertRules.NUMBER)&&e.validate("options.order",null==t?void 0:t.order,e.AssertRules.NUMBER)&&e.validate("channelId",n,e.AssertRules.CHANNEL_ID)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return X(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationLevel=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return n=ve(a,t,"getConversationNotificationLevel"),[4,o.getConversationNotificationLevel(t.conversationType,t.targetId,t.channelId)];case 1:return r=s.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(ue[i]," , ").concat(n)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,o.getConversationNotificationStatus(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(t,n,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("count",n,e.AssertRules.NUMBER,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u;return s(this,(function(s){switch(s.label){case 0:return d.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(t)),[4,c.getConversationListByTag(t,a,n)];case 1:return r=s.sent(),i=r.code,u=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:null==u?void 0:u.map((function(e){return function(e){return o(o({},X(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(d.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(i,",tagId:").concat(t)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return ae((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return ae((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return ie((function(s){return new Promise((function(a){s.getFileToken(t,n,o,r).then((function(t){a({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){a({code:e,msg:ue[e]})}))}))}))},exports.getFileUrl=function(t,n,o,r,s){return e.validate("fileType",t,e.isValidFileType,!0)&&e.validate("filename",n,e.AssertRules.STRING)&&e.validate("saveName",o,e.AssertRules.STRING)&&e.validate("serverType",s,e.AssertRules.NUMBER)?ie((function(a){return new Promise((function(i){a.getFileUrl(t,n,o,r,s).then((function(t){i({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){i({code:e})}))}))})):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER})},exports.getFirstUnreadMessage=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return[4,o.getFirstUnreadMessage(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?(c=i&&W(i)||null,[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options.timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==n?void 0:n.count,e.AssertRules.NUMBER)&&(e.usingCppEngine()||e.validate("options.count",null==n?void 0:n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&e.validate("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o=i.createTraceId(),i.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),o),[4,a.getHistoryMessage(t.conversationType,t.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==t?void 0:t.channelId,"",o)];case 1:return r=s.sent(),c=r.code,d=r.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return W(e)})),i.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),o),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),o),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getMessage=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getMessage(t)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:W(i)}]:(a.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("messageUId",n,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u;return s(this,(function(s){switch(s.label){case 0:return r="messageUId:".concat(n,",targetId:").concat(t),c.debug(e.LogTagId.O,"get message reader ->".concat(r)),[4,i.getMessageReader(t,n,o)];case 1:return a=s.sent(),d=a.code,u=a.data,d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:(c.warn(e.LogTagId.O,"get message reader fail ->".concat(d,":").concat(ue[d],",").concat(r)),[2,{code:d,msg:ue[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getProxy=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,n.getProxy()];case 1:return t=s.sent(),r=t.code,a=t.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:a}]:(o.warn(e.LogTagId.O,"getProxy ->code:".concat(r)),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options.timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==n?void 0:n.count,e.AssertRules.NUMBER)&&e.validate("options.count",null==n?void 0:n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&e.validate("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"get history message ->".concat(o)),[4,a.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,t.channelId||"")];case 1:return r=s.sent(),c=r.code,d=r.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return W(e)})),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return ae((function(e){return e.getServerTime()}))},exports.getTags=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,n.getTagList()];case 1:return t=s.sent(),r=t.code,a=t.data,o.warn(e.LogTagId.O,"getTagList ->code:".concat(r)),[2,{code:e.ErrorCode.SUCCESS,data:a}]}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,o.getTagsForConversation(t)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:[2,{code:r,msg:ue[r]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTextMessageDraft=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return[4,o.getConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get draft ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i||""}]:(a.warn(e.LogTagId.O,"get draft fail ->".concat(r,":").concat(ue[r],",").concat(c)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversationTypes",t,e.AssertRules.ARRAY)&&!(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))&&e.validate("channelId",n,e.AssertRules.CHANNEL_ID)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getTopConversationList(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return X(e)}))}]:(i.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,"".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCount=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("includeMuted",t,e.AssertRules.BOOLEAN,!1)&&e.validate("conversationTypes",n,e.AssertRules.ARRAY,!1)&&!(null==n?void 0:n.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.debug(e.LogTagId.O,"get total unread count -> ConversationType:".concat(JSON.stringify(n)," includeMuted:").concat(t)),[4,a.getTotalUnreadCount("",n,t)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",n,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||n.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",n,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||n.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,n,!0)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),a.debug(e.LogTagId.O,"".concat(n," -> ").concat(r)),[4,o.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=s.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(a.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(ue[c]," , ").concat(r)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)?[2,ie((function(o){return r(n,void 0,void 0,(function(){var n,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.targetId,r=t.channelId,a={targetId:n,channelId:r},[4,o.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=s.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:ue[c]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!1)&&e.validate("options.channelType",t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getUltraGroupList(t)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:i}]:(a.warn(e.LogTagId.O,"get ultragroup ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("msgs",n,e.AssertRules.ARRAY,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E;return s(this,(function(s){switch(s.label){case 0:return o=t.targetId,r=t.conversationType,c=t.channelId,d=[],n.forEach((function(e){var t=e.sendTime,n=e.messageUId;d.push({sendTime:t,messageUId:n,channelId:c})})),u={targetId:o,conversationType:r,messages:d},[4,a.getUltraGroupMessageListByMessageUId(u)];case 1:if(l=s.sent(),g=l.code,v=l.data,g===e.ErrorCode.SUCCESS){for(E in f={},v)f[E]=v[E]?W(v[E]):void 0;return[2,{code:e.ErrorCode.SUCCESS,data:f}]}return i.warn(e.LogTagId.O,"get UltraGroup MessageList by messageUId ->".concat(g,":").concat(ue[g])),[2,{code:g,msg:ue[g]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",n,e.AssertRules.ARRAY)&&!(null==n?void 0:n.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o="getUltraGroupUnreadCountByTargetId",[4,a.getUltraGroupUnreadCountByTargetId(t,n)];case 1:return r=s.sent(),c=r.code,d=r.data,u="targetId: ".concat(t,", levels: ").concat(JSON.stringify(n)),i.debug(e.LogTagId.O,"".concat(o," -> ").concat(u)),[2,{code:c,data:d}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadInfoList=function(t){return r(this,void 0,void 0,(function(){var n,o=this;return s(this,(function(a){return e.validate("targetIds",t,e.AssertRules.ARRAY,!0)&&e.validate("targetIds.length",t,(function(e){return e.length>0&&e.length<20}))&&!t.some((function(t){return!e.validate("targetId",t,e.AssertRules.STRING)}))?(n=t.filter((function(e,n){return t.indexOf(e)===n})),[2,ie((function(t){return r(o,void 0,void 0,(function(){var o,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,t.getUltraGroupUnreadInfoList(n)];case 1:return o=s.sent(),r=o.code,a=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:ue[r]}]}}))}))}))]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",n,e.AssertRules.ARRAY)&&!(null==n?void 0:n.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.debug(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(t,", notificationLevels: ").concat(JSON.stringify(n))),[4,a.getUltraGroupUnreadMentionedCountByTargetId(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.count",t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return n=t.targetId,r=t.channelId,i=t.sentTime,c=t.count,d={targetId:n,channelId:r,sentTime:i,count:c},[4,o.getUltraGroupUnreadMentionedMessages(d)];case 1:return u=s.sent(),l=u.code,g=u.data,l===e.ErrorCode.SUCCESS?[2,{code:l,data:g}]:(a.warn(e.LogTagId.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(l,": ").concat(ue[l])),[2,{code:l,msg:ue[l]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadConversationList=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY)||(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isTypeInConversationList)})))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,o.getUnreadConversationList(t)];case 1:return n=s.sent(),r=n.code,a=n.data,r===e.ErrorCode.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return X(e)}))}]:[2,{code:r,msg:ue[r]}]}}))}))}))]}))}))},exports.getUnreadCount=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return[4,o.getUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get unreadCount ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"get unreadCount fail ->".concat(r,":").concat(ue[r],",").concat(c)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",n,e.AssertRules.BOOLEAN,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,a.getUnreadCountByTag(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,[2,{code:r,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedCount=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(n){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(n,o){return o.debug(e.LogTagId.O,"getUnreadMentionedCount".concat(t.targetId,",channelId:").concat(t.channelId)),n.getUnreadMentionedCount(t)}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedMessages=function(t){if(!e.usingCppEngine())return{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]};var n,o=t.conversationType,r=t.targetId,s=t.channelId;return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?(n=function(t){var n=t.getUnreadMentionedMessages(o,r,s),a=[];return n&&n.length&&n.forEach((function(e){return a.push(W(e))})),{code:e.ErrorCode.SUCCESS,data:a}},ne?n(ne,re,oe):{code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT}):{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}},exports.init=function(t){!function(t){var n,o=t.appkey,r=t.navigators;ne?re.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.appkey",t.appkey,e.AssertRules.STRING,!0),e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),oe=t,ne=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||z,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime,areaCode:t.areaCode,logServerUrl:t.logServerUrl}),(re=ne.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),re.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.7.10",commit:"8733f13c4f051f4e58aedf9b86db72639c36ecbb"})),ne.assignWatcher(ee),e.logger.init(re))}(t)},exports.insertMessage=function(t,n,o){return void 0===o&&(o={}),r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return Q("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("options",o,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==o?void 0:o.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==o?void 0:o.searchContent,e.AssertRules.STRING)&&e.validate("content.senderUserId",n.senderUserId,e.AssertRules.STRING,!0)&&e.validate("content.messageType",n.messageType,e.AssertRules.STRING,!0)&&e.validate("content.content",n.content,e.AssertRules.OBJECT,!0)&&e.validate("content.messageDirection",n.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("content.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("content.expansion",n.expansion,e.AssertRules.OBJECT)&&e.validate("content.disableNotification",n.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("content.sentTime",n.sentTime,e.AssertRules.NUMBER)&&e.validate("content.sentStatus",n.sentStatus,e.AssertRules.NUMBER)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g,v,f,E,R,I,p,T,h,C,m;return s(this,(function(s){switch(s.label){case 0:return r=n.senderUserId,a=n.messageType,d=n.content,u=n.messageDirection,l=n.messageUId,g=n.canIncludeExpansion,v=n.expansion,f=n.disableNotification,E=n.sentTime,R=n.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),I=o.isUnread,p=o.searchContent,T={senderUserId:r,messageType:a,content:d,messageDirection:u,sentTime:E,sentStatus:R,searchContent:p,isUnread:I,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=s.sent(),C=h.code,m=h.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:W(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:ue[C]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return ae((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",n.count,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return o=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!1}),o),[4,a.joinChatroom(t,n.count,o)];case 1:return r=s.sent(),c=r===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:r,timestamp:(new Date).getTime()}),o),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:ue[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",n.count,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return o=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!0}),o),[4,a.joinExistChatroom(t,n.count,o)];case 1:return r=s.sent(),c=r===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:r,timestamp:(new Date).getTime()}),o),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:ue[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.senderUserId,u=n.sentTime,l=n.canIncludeExpansion,g=n.channelId,v="conversationType:".concat(o,",targetId:").concat(r,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:r,channelId:g,conversationType:o,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,a.modifyMessage(f)];case 1:return(E=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(E,":").concat(ue[E])),[2,{code:E,msg:ue[E]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){$.once(e,t,n)},exports.quitChatRoom=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return n=a.createTraceId(),a.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,o.quitChatroom(t)];case 1:return r=s.sent(),i=r===e.ErrorCode.SUCCESS?"info":"warn",a[i](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:ue[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.recallMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options.messageUId",n.messageUId,e.AssertRules.STRING,!0)&&e.validate("options.sentTime",n.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.disableNotification",null==n?void 0:n.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushConfig",null==n?void 0:n.pushConfig,e.AssertRules.OBJECT)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o={user:n.user,channelId:t.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete},r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(n.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(r)),[4,a.recallMessage(t.conversationType,t.targetId,n.messageUId,n.sentTime,o)];case 1:return c=s.sent(),d=c.code,u=c.data,d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:W(u)}]:d===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(d,":").concat(ue[d],",").concat(r)),[2,{code:d,msg:ue[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,s){return ae((function(a,i){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",o,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",s,e.AssertRules.BOOLEAN,!1),e.assert("searchProps",r,e.AssertRules.ARRAY),i.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:o,isStatusMessage:s,isPersited:n})),a.registerMessageType(t,n,o,r,s),he(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c,d,u,l,g,v;return s(this,(function(s){switch(s.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),a.debug(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(l)),g={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:i,removeAll:!0},[4,o.expandUltraMessage(g)];case 1:return(v=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(ue[v])),[2,{code:v,msg:ue[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(t,n){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&pe(n)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l;return s(this,(function(s){switch(s.label){case 0:return r="id:".concat(t),c.info(e.LogTagId.O,"remove chatroom entry->".concat(r)),(a=o({},n)).entries=n.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(t,a)];case 1:return d=s.sent(),u=d.code,l=d.data,u!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(ue[u],",").concat(r)),[2,{code:u,msg:ue[u],data:l}]):[2,{code:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ie(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"remove chatroom entry->".concat(o)),[4,a.removeChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversation=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r;return s(this,(function(s){switch(s.label){case 0:return[4,o.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"destroy conversation ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"destroy conversation fail ->".concat(n,":").concat(ue[n],",").concat(r)),[2,{code:n,msg:ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversationsFromTag=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(o,",tagId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){$.off(e,t,n)},exports.removeEventListeners=function(e){$.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.sentTime,u=n.canIncludeExpansion,l=n.channelId,g="conversationType:".concat(o,",targetId:").concat(r,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:r,channelId:l,conversationType:o,sendTime:d,canIncludeExpansion:u,messageUId:c,keys:t},[4,a.expandUltraMessage(v)];case 1:return(f=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(f,":").concat(ue[f])),[2,{code:f,msg:ue[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeFromBlacklist=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"removeFromBlacklist -> userId: ".concat(t)),[4,o.removeFromBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeMessageExpansionForKey=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("keys",t,e.AssertRules.ARRAY,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",n.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",n.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",n.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",n.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.canIncludeExpansion,u=n.channelId,l="conversationType:".concat(o,",targetId:").concat(r,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,a.sendExpansionMessage({conversationType:o,targetId:r,messageUId:c,canIncludeExpansion:d,keys:t,channelId:u})];case 1:return(g=s.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(ue[g],",").concat(l)),[2,{code:g,msg:ue[g]}]):[2,{code:g}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTag=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,o.removeTag(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(o,",tagId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("tagIds",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("tagId",t,e.AssertRules.STRING,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.removeTagsForConversation(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"removeTagsForConversation ->code:".concat(o,",tagIds:").concat(n)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("draft",n,e.AssertRules.STRING,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set draft ->".concat(o)),[4,a.saveConversationMessageDraft(t.conversationType,t.targetId,n,t.channelId)];case 1:return(r=s.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return Q("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u;return s(this,(function(s){switch(s.label){case 0:return d.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,o,a,n)];case 1:return r=s.sent(),i=r.code,u=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:u}]:(d.warn(e.LogTagId.O,"searchConversationByContent ->code:".concat(i,",keyword:").concat(t)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return Q("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",n,e.AssertRules.STRING,!0)&&e.validate("timestamp",o,e.AssertRules.NUMBER)&&e.validate("count",a,e.AssertRules.NUMBER)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l;return s(this,(function(s){switch(s.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,n,o,a,1,t.channelId)];case 1:return r=s.sent(),i=r.code,u=r.data,i===e.ErrorCode.SUCCESS?(l=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return l.push(W(e))})),[2,{code:i,data:{messages:l,count:null==u?void 0:u.count}}]):(d.warn(e.LogTagId.O,"searchMessages ->code:".concat(i,",targetId:").concat(t.targetId)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=Qe,exports.sendGIFMessage=et,exports.sendHQVoiceMessage=nt,exports.sendImageMessage=$e,exports.sendMessage=We,exports.sendReadReceiptMessage=function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",n,e.AssertRules.STRING,!0)&&e.validate("timestamp",o,e.AssertRules.NUMBER,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)?[2,ie((function(c){return r(i,void 0,void 0,(function(){var r,i,c,d,u;return s(this,(function(s){switch(s.label){case 0:return r={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:a},i=new Te("RC:ReadNtf",{messageUId:n,lastMessageSendTime:o,type:1}),[4,We(r,i)];case 1:return c=s.sent(),d=c.code,u=c.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptRequest=function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("messageUId",n,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,i,d,u;return s(this,(function(s){switch(s.label){case 0:return r="messageUId:".concat(n,",targetId:").concat(t),c.debug(e.LogTagId.O,"send read receipt message ->".concat(r)),a=new Te("RC:RRReqMsg",{messageUId:n}),[4,We({targetId:t,conversationType:e.ConversationType.GROUP,channelId:o},a)];case 1:return i=s.sent(),d=i.code,u=i.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptResponse=function(e,t,n){return r(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageList",n,e.AssertRules.OBJECT,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)&&!Object.keys(n).some((function(t){return!e.validate(t,n[t],e.AssertRules.ARRAY)}))?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return r={targetId:t,conversationType:e.ConversationType.GROUP,channelId:o},d=i.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:(u=[],Object.keys(n).forEach((function(e){n[e].forEach((function(e){-1===u.indexOf(e)&&u.push(e)}))})),u.length?[4,i.sendReadReceiptMessage(t,u,o)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 1:return a=s.sent(),[3,4];case 2:return l=new Te("RC:RRRspMsg",{receiptMessageDic:n}),[4,We(r,l)];case 3:a=s.sent(),s.label=4;case 4:return(g=a.code)===e.ErrorCode.SUCCESS?[2,{code:g}]:(c.warn(e.LogTagId.O,"send read receipt message fail ->".concat(g,":").concat(ue[g])),[2,{code:g,msg:ue[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=ot,exports.sendSyncReadStatusMessage=function(t,n){return r(this,void 0,void 0,(function(){var o,r,a,i;return s(this,(function(s){switch(s.label){case 0:return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("lastMessageSendTime",n,e.AssertRules.NUMBER,!0)?(o=new Te("RC:SRSMsg",{lastMessageSendTime:n}),[4,We(t,o)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return r=s.sent(),a=r.code,i=r.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return We(e,new Oe(t),n)},exports.sendTypingStatusMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("typingContentType",n,e.AssertRules.STRING,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l;return s(this,(function(s){switch(s.label){case 0:return o={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:t.channelId},r=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:o.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),r),[4,a.sendMessage(t.conversationType,t.targetId,o,void 0,r)];case 1:return c=s.sent(),d=c.code,u=c.data,l=d===e.ErrorCode.SUCCESS?"info":"warn",i[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:d,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),r),d===e.ErrorCode.SUCCESS?[2,{code:d,data:W(u)}]:[2,{code:d,msg:ue[d]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendUltraGroupTypingStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,o.sendUltraGroupTypingStatus(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(ue[n])),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Re(n)?n.entries.length>10?[2,de.CHATROOM_KV_STORE_OUT_LIMIT]:[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(o)),[4,a.setChatroomEntries(t,n)];case 1:return r=s.sent(),c=r.code,d=r.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c],data:d}]):[2,{code:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ee(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(o)),[4,a.setChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationLevel=function(t,n){return r(this,void 0,void 0,(function(){return s(this,(function(o){return e.validate("notificationLevel",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(e,o){return fe(o,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,n,t.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationStatus=function(t,n){return r(this,void 0,void 0,(function(){return s(this,(function(o){return e.validate("notificationStatus",n,(function(e){return 1===e||2===e}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(e,o){return fe(o,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,n,t.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTop=function(t,n){return void 0===n&&(n=!0),r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("isTop",n,e.AssertRules.BOOLEAN)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set conversation status ->".concat(o)),[4,a.setConversationStatus(t.conversationType,t.targetId,n,void 0,t.channelId)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversation",n,e.AssertRules.CONVERSATION,!0)&&e.validate("status.isTop",o,e.AssertRules.BOOLEAN,!0)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return c.info(e.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(t,",targetId:").concat(n.targetId,",conversationType").concat(n.conversationType)),[4,i.setConversationStatusInTag(t,n,{isTop:o})];case 1:return(r=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:r}]:(c.warn(e.LogTagId.O,"setConversationStatusInTag ->code:".concat(r,",tagId:").concat(t)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return Q("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",n,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(t,",receivedStatus:").concat(n)),[4,a.setMessageReceivedStatus(t,n)];case 1:return(o=r.sent())===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"setMessageReceivedStatus ->code:".concat(o,",messageId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"setProxy: ->".concat(t)),[4,o.setProxy(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("notificationLevel",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return o="setUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),[4,a.setUltraGroupDefaultNotificationLevel(t.targetId,n,t.channelId)];case 1:return(c=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:c}]:(i.warn(e.LogTagId.O,"".concat(o," fail -> ").concat(c," : ").concat(ue[c]," , ").concat(r)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.testProxy=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.info(e.LogTagId.O,"testProxy: ->".concat(t)),[4,a.testProxy(t,n)];case 1:return o=s.sent(),r=o.status,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,msg:c}]:(i.warn(e.LogTagId.O,"testProxy ->code:".concat(r)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.sentTime,u=n.canIncludeExpansion,l=n.channelId,g="conversationType:".concat(o,",targetId:").concat(r,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:r,channelId:l,conversationType:o,sendTime:d,canIncludeExpansion:u,messageUId:c,expansion:t},[4,a.expandUltraMessage(v)];case 1:return(f=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(f,":").concat(ue[f])),[2,{code:f,msg:ue[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",n.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",n.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",n.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",n.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.expansion",n.expansion,e.AssertRules.OBJECT)&&e.validate("message.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.canIncludeExpansion,u=n.expansion,l=n.channelId,g="conversationType:".concat(o,",targetId:").concat(r,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,a.sendExpansionMessage({conversationType:o,targetId:r,messageUId:c,expansion:t,canIncludeExpansion:d,originExpansion:u,channelId:l})];case 1:return(v=s.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(ue[v],",").concat(g)),[2,{code:v,msg:ue[v]}]):[2,{code:v}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateTag=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,o.updateTag(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"updateTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};