@rongcloud/imlib-next 5.8.0 → 5.8.2
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.d.ts +80 -34
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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)}}},E={setItem:v("setStorageSync"),getItem:v("getStorageSync"),removeItem:v("removeStorageSync"),clear:v("clearStorageSync")},f=null,R=function(e){var t=e.isConnected,n=e.networkType;f({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:E,sessionStorage:E,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){f=e,wx.onNetworkStatusChange(R)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(R),f=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){}}},C={setItem:T("setStorageSync"),getItem:T("getStorageSync"),removeItem:T("removeStorageSync"),clear:T("clearStorageSync")},h=null,m=function(e){var t=e.isConnected,n=e.networkType;h({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:C,sessionStorage:C,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){h=e,my.onNetworkStatusChange(m)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(m),h=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 X(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,E=t.isOffLineMessage,f=t.canIncludeExpansion,R=t.expansion,I=t.receivedStatus,p=t.disableNotification,T=t.isMentioned,C=t.isStatusMessage,h=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:C,canIncludeExpansion:f,expansion:R,receivedStatus:I,readReceiptInfo:h,pushConfig:m,messageId:S,isInterrupt:A,isModifyMessage:O,sentStatus:_};return n!==e.ConversationType.ULTRA_GROUP&&(y.isOffLineMessage=E),n===e.ConversationType.ULTRA_GROUP&&e.isNumber(N)&&(y.channelType=N),y}function W(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,E=t.matchCount,f=t.unreadMentionedMeCount,R={conversationType:n,targetId:o,latestMessage:r&&X(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:E,unreadMentionedMeCount:f};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 X(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?X(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 W(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 X(e)})))},ultraGroupMessageModified:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return X(e)})))},ultraGroupMessageRecalled:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return X(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.8.0");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:e.ErrorCodes.REJECTED_BY_BLACKLIST,msg:"Blacklisted by the other party"},MESSAGE_SENT_OVER_FREQUENCY:{code:e.ErrorCodes.MESSAGE_SENT_OVER_FREQUENCY,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:e.ErrorCodes.NOT_IN_GROUP,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:e.ErrorCodes.FORBIDDEN_IN_GROUP,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:e.ErrorCodes.NOT_IN_CHATROOM,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:e.ErrorCodes.FORBIDDEN_IN_CHATROOM,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:e.ErrorCodes.KICKED_FROM_CHATROOM,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:e.ErrorCodes.CHATROOM_NOT_EXIST,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:e.ErrorCodes.CHATROOM_IS_FULL,msg:"ChatRoom members exceeded"},CHATROOM_PARAMETER_INVALID:{code:e.ErrorCodes.CHATROOM_PARAMETER_INVALID,msg:"Invalid chatRoom parameters"},CHATROOM_ROAMING_SERVICE_UNAVAILABLE:{code:e.ErrorCodes.CHATROOM_ROAMING_SERVICE_UNAVAILABLE,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:e.ErrorCodes.RECALL_MESSAGE_PARAMETER_INVALID,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:e.ErrorCodes.MESSAGE_BLOCKED_BY_SENSITIVE_WORD,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:e.ErrorCodes.MESSAGE_SENSITIVE_WORD_REPLACED,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:e.ErrorCodes.CONNECTION_RELEASED,msg:"Please connect successfully first"},NAVIGATION_RESOURCE_ERROR:{code:e.ErrorCodes.NAVIGATION_RESOURCE_ERROR,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:e.ErrorCodes.CONNECTION_CREATED_ERROR,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:e.ErrorCodes.IDENTIFIER_REJECTED,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:e.ErrorCodes.SERVER_UNAVAILABLE,msg:"Mini program service is not open, Please go to the developer to open this service"},CONNECTION_ACK_TIMEOUT:{code:e.ErrorCodes.CONNECTION_ACK_TIMEOUT,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:e.ErrorCodes.TOKEN_INCORRECT,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:e.ErrorCodes.APP_NOT_AUTHORIZED,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},APP_BLOCKED_OR_DELETED:{code:e.ErrorCodes.APP_BLOCKED_OR_DELETED,msg:"AppKey is banned or deleted"},USER_BLOCKED:{code:e.ErrorCodes.USER_BLOCKED,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},PROTOCOL_MESSAGE_STORAGE_SERVICE_UNAVAILABLE:{code:e.ErrorCodes.PROTOCOL_MESSAGE_STORAGE_SERVICE_UNAVAILABLE,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},CONNECTION_EXIST:{code:e.ErrorCodes.CONNECTION_EXIST,msg:"Connection already exists"},CHATROOM_PROPERTY_OVERSIZE:{code:e.ErrorCodes.CHATROOM_PROPERTY_OVERSIZE,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_PROPERTY_EXISTED:{code:e.ErrorCodes.CHATROOM_PROPERTY_EXISTED,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:e.ErrorCodes.CHATROOM_PROPERTY_SERVICE_UNAVAILABLE,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_PROPERTY_NOT_EXIST:{code:e.ErrorCodes.CHATROOM_PROPERTY_NOT_EXIST,msg:"ChatRoom key does not exist"},MESSAGE_NOT_EXPANDABLE:{code:e.ErrorCodes.MESSAGE_NOT_EXPANDABLE,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:e.ErrorCodes.MESSAGE_EXPANSION_OVERSIZE,msg:"The message expansion size is beyond the limit"},PROTOCOL_PARAMETER_INVALID:{code:e.ErrorCodes.PROTOCOL_PARAMETER_INVALID,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_PROPERTY_NOT_ALL_SET:{code:e.ErrorCodes.CHATROOM_PROPERTY_NOT_ALL_SET,msg:"Chatroom kv store not all success"},CHATROOM_PROPERTY_BATCH_SET_OVERSIZE:{code:e.ErrorCodes.CHATROOM_PROPERTY_BATCH_SET_OVERSIZE,msg:"Chatroom kv's length is out of limit"},TAG_ALREADY_EXISTS:{code:e.ErrorCodes.TAG_ALREADY_EXISTS,msg:"The tag already exists"},TAG_NOT_EXIST:{code:e.ErrorCodes.TAG_NOT_EXIST,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.PROTOCOL_MESSAGE_STORAGE_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},Ee=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 fe=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 Ce(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Te(e,o,t,n)}}var he,me=Ce("RC:ImgMsg"),Se=Ce("RC:HQVCMsg"),Ae=Ce("RC:SightMsg"),Oe=Ce("RC:TxtMsg"),Ne=Ce("RC:CombineMsg"),_e=Ce("RC:FileMsg"),ye=Ce("RC:GIFMsg"),Ue=Ce("RC:VcMsg"),Le=Ce("RC:LBSMsg"),Me=Ce("RC:ReferenceMsg"),Pe=Ce("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"}(he||(he={}));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,E,f,R,I,p,T,C;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 E=s.sent(),f=E.code,R=E.msg,f!==e.ErrorCode.SUCCESS?[2,{code:f,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===(C=s.sent().status)||204===C?[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,E,f,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(),E=n.slice(r,d*e.UPLOAD_FILE_CHUNK_SIZE),f=this.getBaseHeaders(n,v,i),[4,z.httpReq({url:"".concat(t,"?").concat(g),headers:f,method:"PUT",body:E,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,E,f,R,I,p,T,C;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 E=s.sent(),f=E.code,R=E.msg,f!==e.ErrorCode.SUCCESS?[2,{code:f,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===(C=s.sent().status)||204===C?[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,E,f,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(),E=n.slice(r,d*e.UPLOAD_FILE_CHUNK_SIZE),f=this.getBaseHeaders(n,v,i),[4,z.httpReq({url:"".concat(t,"?").concat(g),headers:f,method:"PUT",body:E,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,E,f,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(),E=v.status,f=v.data,200===E||204===E?i+r<n.size?[2,this._requestUploadPart(t,n,o,a,i+r)]:(R=JSON.parse(f),[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:E.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,E,f,R,I,p,T,C,h,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,E=function(e,t,n,o,r){if(n)return[{type:he.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:he.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:he.QINIU,url:o,p:"1"});r&&s.push({type:he.BAIDU,url:r,p:"2"});return s}(c,0,i,d,u),0===E.length?[2,Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Ke(E,t,r,a)];case 1:return f=s.sent(),R=f.code,I=f.data,p=f.msg,R===e.ErrorCode.SUCCESS&&I?[4,qe(t,n,I)]:[2,{code:R,msg:p}];case 2:return T=s.sent(),C={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 h=s.sent(),m=h.duration,S=h.length,y=o(o({},C),{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({},C),{thumbnail:O,width:N,height:_}),[2,{code:R,data:y}];case 7:return[2,{code:R,data:C}]}}))}))}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={})[he.QINIU]=Be,we[he.ALIYUN]=De,we[he.BAIDU]=Ge,we[he.S3]=Ve,we[he.STC]=ke,we[he.MINIO]=Fe,we[he.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,E=i.scale,f=void 0===E?1:E,R=ze(a.width,a.height,{maxHeight:d,maxWidth:l,scale:f});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 Xe(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,E,f,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,E=e.expansion,f=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:E,isFilerWhiteBlacklist:f,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),E=d.createTraceId(),f=function(t){v.messageId=t;try{(null==a?void 0:a.onSendBefore)&&a.onSendBefore(X(v))}catch(t){d.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),E)}},d.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:r,targetId:i,channelId:u}),E),[4,c.sendMessage(r,i,g,f,E)]):[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}),E),T=X(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:X(v)}])}}))}))}))]}))}))}function We(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,E=t.msg;if(l===e.ErrorCode.SUCCESS&&v){var f=(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 Xe(r,f,i).then(d)}d({code:l,msg:E})}))}))}))}}var Qe=We(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=We(e.FileType.IMAGE,(function(e,t){return new me({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),et=We(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=We(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=We(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})}));We(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 W(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 W(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){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.usingCppEngine()?e.validate("keyword",t,e.AssertRules.STRING,!0)&&e.validate("messageTypes",n,e.AssertRules.ARRAY,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)&&!n.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[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="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),c.info(e.LogTagId.O,"searchConversationByContent -> ".concat(r)),e.isUndefined(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return a=s.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:a=s.sent(),s.label=4;case 4:return d=a.code,u=a.data,d===e.ErrorCode.SUCCESS&&u?(l=u.map((function(e){return W(e)})),[2,{code:d,data:l}]):(c.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(d," ").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]}]}))}))},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,E,f,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,E=g.data,v===e.ErrorCode.SUCCESS&&E?(f=E.messages,R=E.count,I=f.map((function(e){return X(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,E,f,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 E=s.sent(),f=E.code,R=E.data,f===e.ErrorCode.SUCCESS&&R?[2,{code:f,data:{messages:R.messages.map((function(e){return X(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(f,", ").concat(o)),[2,{code:f}])}}))}))}))]:[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,E;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,E=g.data,v===e.ErrorCode.SUCCESS&&E?[2,{code:v,data:{messages:E.messages.map((function(e){return X(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,E,f,R,I,p,T,C;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 E=s.sent(),f=E.code,R=E.data,f===e.ErrorCode.SUCCESS?(p=(I=R).list,T=I.hasMore,C=p.map((function(e){return X(e)})),[2,{code:f,data:{messages:C,hasMore:T,list:C}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(f," ").concat(u)),[2,{code:f,msg:ue[f]}])}}))}))}))]:[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,E,f,R,I,p,T,C,h;return s(this,(function(s){switch(s.label){case 0:return r="",a=1,g=!1,E=n.messageType,f=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:E,content:f,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(),C=T.code,h=T.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:X(h)}]:(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]}]}))}))},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)&&fe(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 X(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?W(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 W(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({},W(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&&X(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 X(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:X(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 X(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 W(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,E,f;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(f in E={},v)E[f]=v[f]?X(v[f]):void 0;return[2,{code:e.ErrorCode.SUCCESS,data:E}]}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 W(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(X(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.8.0",commit:"99986f10b8ff686903159afcffe9be7d7e8642df"})),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,E,f,R,I,p,T,C,h,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,E=n.disableNotification,f=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:f,sentStatus:R,searchContent:p,isUnread:I,messageUId:l,disableNotification:E,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return C=s.sent(),h=C.code,m=C.data,h===e.ErrorCode.SUCCESS?[2,{code:h,data:X(m)}]:(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]}]}))}))},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,E,f;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)),E={targetId:r,channelId:g,conversationType:o,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,a.modifyMessage(E)];case 1:return(f=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(f,":").concat(ue[f])),[2,{code:f,msg:ue[f]}])}}))}))}))]:[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:X(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),Ce(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,E;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(E=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(E,":").concat(ue[E])),[2,{code:E,msg:ue[E]}])}}))}))}))]:[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(X(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=Xe,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,Xe(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,Xe({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,Xe(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,Xe(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 Xe(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:X(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)&&fe(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 Ee(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 Ee(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,E;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(E=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(E,":").concat(ue[E])),[2,{code:E,msg:ue[E]}])}}))}))}))]:[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}]}))}))};
|
|
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();var c=null,d=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,u.getNetworkType()];case 1:return t=n.sent(),c({status:"online"===e.type,type:t}),[2]}}))}))};var u={tag:"browser",httpReq:e.httpRequest,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){c=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",d),window.addEventListener("online",d))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",d),window.removeEventListener("online",d)),c=null}},l=a(),g=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)}}},v={setItem:g("setStorageSync"),getItem:g("getStorageSync"),removeItem:g("removeStorageSync"),clear:g("clearStorageSync")},f=null,E=function(e){var t=e.isConnected,n=e.networkType;f({status:t,type:n})};var R={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:v,sessionStorage:v,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,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){f=e,wx.onNetworkStatusChange(E)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(E),f=null}},I=a(),p=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){}}},T={setItem:p("setStorageSync"),getItem:p("getStorageSync"),removeItem:p("removeStorageSync"),clear:p("clearStorageSync")},h=null,C=function(e){var t=e.isConnected,n=e.networkType;h({status:t,type:n})};var m={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:T,sessionStorage:T,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:I,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},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){h=e,my.onNetworkStatusChange(C)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(C),h=null}},S=a(),A=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){}}},O={setItem:A("setStorageSync"),getItem:A("getStorageSync"),removeItem:A("removeStorageSync"),clear:A("clearStorageSync")},N=null,_=function(e){var t=e.isConnected,n=e.networkType;N({status:t,type:n})};var y={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:S,localStorage:O,sessionStorage:O,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){N=e,tt.onNetworkStatusChange(_)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(_),N=null}},U=a(),L=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){}}},M={setItem:L("setStorageSync"),getItem:L("getStorageSync"),removeItem:L("removeStorageSync"),clear:L("clearStorageSync")},P=null,w=function(e){var t=e.isConnected,n=e.networkType;P({status:t,type:n})};var x={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:U,localStorage:M,sessionStorage:M,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){P=e,swan.onNetworkStatusChange(w)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(w),P=null}},b=a(),B=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)}}},D={setItem:B("setStorageSync"),getItem:B("getStorageSync"),removeItem:B("removeStorageSync"),clear:B("clearStorageSync")},G=null,V=function(e){var t=e.isConnected,n=e.networkType;G({status:t,type:n})};var k={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:D,sessionStorage:D,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){G=e,jd.onNetworkStatusChange(V)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(V),G=null}},F=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)}}},H={setItem:F("setStorageSync"),getItem:F("getStorageSync"),removeItem:F("removeStorageSync"),clear:F("clearStorageSync")},Z=null,J=function(e){var t=e.isConnected,n=e.networkType;Z({status:t,type:n})};var q,j={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:H,sessionStorage:H,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){Z=e,uni.onNetworkStatusChange(J)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(J),Z=null}},K=function(e){return e&&e.request&&e.getSystemInfo},Y="undefined"!=typeof uni&&K(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return j;case"mp-jd":return k;case"mp-baidu":return x;case"mp-toutiao":return y;case"mp-alipay":return m;case"mp-weixin":return R;default:return u}}():"undefined"!=typeof jd&&K(jd)?k:"undefined"!=typeof my&&K(my)?m:"undefined"!=typeof tt&&K(tt)?y:"undefined"!=typeof swan&&K(swan)?x:"undefined"!=typeof wx&&K(wx)?R:u;function z(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 W(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&&z(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,(q=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",q.CONNECTED="CONNECTED",q.DISCONNECT="DISCONNECT",q.SUSPEND="SUSPEND",q.MESSAGES="MESSAGES",q.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",q.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",q.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",q.CONVERSATION="CONVERSATION",q.CHATROOM="CHATROOM",q.EXPANSION="EXPANSION",q.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",q.TAG="TAG",q.CONVERSATION_TAG="CONVERSATION_TAG",q.TYPING_STATUS="TYPING_STATUS",q.MESSAGE_BLOCKED="MESSAGE_BLOCKED",q.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",q.OPERATE_STATUS="OPERATE_STATUS",q.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",q.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",q.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",q.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",q.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",q.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",q.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",q.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",q.USER_GROUP_STATUS="USER_GROUP_STATUS";var X=new e.EventEmitter,$={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:X.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:X.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:X.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:X.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){X.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return z(e)}))})},typingState:function(e){X.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){X.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){X.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){X.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?z(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=ee(t.unreadMessageCount||0),o.unreadMentionedCount=ee(t.unreadMentionedCount||0),o.unreadMentionedMeCount=ee(t.unreadMentionedMeCount||0),{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));X.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){X.emit(exports.Events.CHATROOM,e)},expansion:function(e){X.emit(exports.Events.EXPANSION,e)},pullFinished:function(){X.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){X.emit(exports.Events.TAG)},conversationTagChanged:function(){X.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){X.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){X.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){X.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){X.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return W(e)})))},operateStatus:function(e){X.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){X.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return z(e)})))},ultraGroupMessageModified:function(e){X.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return z(e)})))},ultraGroupMessageRecalled:function(e){X.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return z(e)})))},ultraGroupChannelChangeType:function(e){X.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){X.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){X.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){X.emit(exports.Events.USER_GROUP_STATUS,e)}};function ee(e){return e>999?999:e}e.VersionManage.add("imlib-next","5.8.2");var te=null,ne=null,oe=null;function re(){return r(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return te?(oe.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),ne=null,te=null,oe=null,[2]}}))}))}function se(e){if(!te)throw new Error("Not initialized yet!");return e(te,oe,ne)}function ae(t){return te?t(te,oe,ne):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function ie(){X.clear()}var ce={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!"}},de={};for(var ue in ce){var le=ce[ue].code;de[le]=ue}ce.ROAMING_SERVICE_UNAVAILABLE.code;var ge=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},ve=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=ge(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(de[i]," , ").concat(r)),[2,{code:i,msg:de[i]}]):[2,{code:i}]}}))}))};var fe=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))},Ee=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)},Re=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)},Ie=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 pe=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 Te(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new pe(e,o,t,n)}}var he,Ce=Te("RC:ImgMsg"),me=Te("RC:HQVCMsg"),Se=Te("RC:SightMsg"),Ae=Te("RC:TxtMsg"),Oe=Te("RC:CombineMsg"),Ne=Te("RC:FileMsg"),_e=Te("RC:GIFMsg"),ye=Te("RC:VcMsg"),Ue=Te("RC:LBSMsg"),Le=Te("RC:ReferenceMsg"),Me=Te("RC:ImgTextMsg"),Pe=Te("RC:CmdMsg"),we=Te("RC:InfoNtf"),xe=Te("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(he||(he={}));var be,Be,De=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}(),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;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,e.httpRequest({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}(De),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;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,e.httpRequest({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}(De),ke=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,e.httpRequest({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}(De),Fe=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,e.httpRequest({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}(De),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;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,e.httpRequest({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,e.httpRequest({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,e.httpRequest({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,e.httpRequest({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}(De),Ze=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,e.httpRequest({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,e.httpRequest({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,e.httpRequest({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,e.httpRequest({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}(De),Je=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,e.httpRequest({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,e.httpRequest({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}(De);function qe(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:he.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:he.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:he.QINIU,url:o,p:"1"});r&&s.push({type:he.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,ze(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,je(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,Ke(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,We(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 je(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 Ke(e){return Be=Be||new AudioContext,new Promise((function(t,n){Be.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var Ye=((be={})[he.QINIU]=Ge,be[he.ALIYUN]=Ve,be[he.BAIDU]=ke,be[he.S3]=Fe,be[he.STC]=He,be[he.MINIO]=Ze,be[he.RCX]=Je,be);function ze(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 Ye[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,ze(t,n,o,a,i)]):[2,{code:d,data:u}]}}))}))}function We(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=Qe(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 Qe=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 Xe(t,n,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return[2,ae((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 pe==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,ce.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(z(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=z(p),[2,{code:I,data:T}]):(d.warn(e.LogTagId.A_SEND_MSG_R,"send message fail ->".concat(I,":").concat(de[I],",").concat(l)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:I,msg:de[I],data:z(v)}])}}))}))}))]}))}))}function $e(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 ae((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},ae((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();qe(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 Xe(r,E,i).then(d)}d({code:l,msg:f})}))}))}))}}var et=$e(e.FileType.FILE,(function(e,t){return new Ne({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})),nt=$e(e.FileType.IMAGE,(function(e,t){return new Ce({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),ot=$e(e.FileType.IMAGE,(function(e,t){return new _e({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),rt=$e(e.FileType.AUDIO,(function(e,t){return new me({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),st=$e(e.FileType.SIGHT,(function(e,t){return new Se({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})}));$e(e.FileType.COMBINE_HTML,(function(e,t){return new Oe({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var at=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,ae((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 W(e)})),[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:de[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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 W(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:de[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent: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("keyword",t,e.AssertRules.STRING,!0)&&e.validate("messageTypes",n,e.AssertRules.ARRAY,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)&&!n.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,ae((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="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),c.info(e.LogTagId.O,"searchConversationByContent -> ".concat(r)),e.isUndefined(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return a=s.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:a=s.sent(),s.label=4;case 4:return d=a.code,u=a.data,d===e.ErrorCode.SUCCESS&&u?(l=u.map((function(e){return W(e)})),[2,{code:d,data:l}]):(c.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(d," ").concat(r)),[2,{code:d,msg:de[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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 z(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:de[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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 z(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:de[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,ae((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 z(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:de[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,ae((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,C,m,S,A;return s(this,(function(s){switch(s.label){case 0:return o=n.count,r=void 0===o?20:o,c=n.timestamp,d=void 0===c?0:c,u=n.order,l=void 0===u?0:u,g=n.messageTypes,v="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(n)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(v)),f=t.conversationType,E=t.targetId,R=t.channelId,I=void 0===R?"":R,[4,a.getHistoryMessagesByObjectNames(f,E,d,r,g,l,I)];case 1:return p=s.sent(),T=p.code,h=p.data,T===e.ErrorCode.SUCCESS?(m=(C=h).list,S=C.hasMore,A=m.map((function(e){return z(e)})),[2,{code:T,data:{messages:A,hasMore:S,list:A}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(T," ").concat(v)),[2,{code:T,msg:de[T]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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:de[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,ae((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:de[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,ae((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:de[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,ae((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:de[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,ae((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:de[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,ae((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:de[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,ae((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:de[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 pe||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,ae((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 pe||(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:z(C)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(h,",targetId:").concat(t.targetId)),[2,{code:h,msg:de[h]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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:de[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,ae((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:de[a]}]}}))}))}))]}))}))},getMessageCount:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?[2,ae((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:de[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,ae((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:de[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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:de[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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:de[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,ae((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:de[e.ErrorCode.NOT_SUPPORT]}]}))}))}});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=pe,exports.CombineMessage=Oe,exports.CommandMessage=Pe,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=Ne,exports.GIFMessage=_e,exports.GroupNotificationMessage=xe,exports.HQVoiceMessage=me,exports.ImageMessage=Ce,exports.InformationNotificationMessage=we,exports.LocationMessage=Ue,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=Le,exports.RichContentMessage=Me,exports.SightMessage=Se,exports.TextMessage=Ae,exports.VoiceMessage=ye,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,ae((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:de[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){X.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,ae((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:de[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,ae((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,ae((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:de[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,ae((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=ie,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,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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,ae((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:de[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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(de[n],",").concat(r)),[2,{code:n,msg:de[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,ae((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(de[r],",").concat(n)),[2,{code:r,msg:de[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,ae((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:de[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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:de[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,ae((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:de[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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 te?(ie(),[2,re()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),se((function(e){return e.disconnect(t)}))},exports.electronExtension=at,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)&&Re(n)?[2,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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)&&fe(n)?[2,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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,ae((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(de[i],",").concat(n)),[2,{code:i,msg:de[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,ae((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,ae((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(de[a])),[2,{code:a,msg:de[a]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ae((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(de[a])),[2,{code:a,msg:de[a]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,ae((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,ae((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,ae((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,ae((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(de[r])),[2,{code:r,msg:de[r]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ae((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,ae((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(de[c],",").concat(o)),[2,{code:c,msg:de[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,ae((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(de[c],",").concat(o)),[2,{code:c,msg:de[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,ae((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 z(e)})),[2,{code:c,data:{list:u,hasMore:!!d.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(de[c],",").concat(o)),[2,{code:c,msg:de[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return se((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,ae((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:de[r]}]):[2,{code:r,data:i?W(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,ae((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 W(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(r,":").concat(de[r])),[2,{code:r,msg:de[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,ae((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=ge(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(de[i]," , ").concat(n)),[2,{code:i,msg:de[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,ae((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:de[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,ae((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({},W(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(d.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(i,",tagId:").concat(t)),[2,{code:i,msg:de[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return se((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return se((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return ae((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:de[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)?ae((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,ae((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&&z(i)||null,[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:de[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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 z(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:de[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,ae((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:z(i)}]:(a.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:de[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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(de[d],",").concat(r)),[2,{code:d,msg:de[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,ae((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:de[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,ae((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 z(e)})),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(de[c],",").concat(o)),[2,{code:c,msg:de[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return se((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,ae((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,ae((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:de[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,ae((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(de[r],",").concat(c)),[2,{code:r,msg:de[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,ae((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 W(e)}))}]:(i.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,"".concat(r,":").concat(de[r])),[2,{code:r,msg:de[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,ae((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(de[r])),[2,{code:r,msg:de[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,ae((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(de[r])),[2,{code:r,msg:de[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,ae((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(de[r])),[2,{code:r,msg:de[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,ae((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(de[c]," , ").concat(r)),[2,{code:c,msg:de[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,ae((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:de[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,ae((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(de[r])),[2,{code:r,msg:de[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,ae((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]?z(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(de[g])),[2,{code:g,msg:de[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,ae((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,ae((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:de[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,ae((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(de[r])),[2,{code:r,msg:de[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,ae((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(de[l])),[2,{code:l,msg:de[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,ae((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 W(e)}))}]:[2,{code:r,msg:de[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,ae((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(de[r],",").concat(c)),[2,{code:r,msg:de[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,ae((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,ae((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:de[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(z(e))})),{code:e.ErrorCode.SUCCESS,data:a}},te?n(te,oe,ne):{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;te?oe.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))})),ne=t,te=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||Y,{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}),(oe=te.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),oe.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.8.2",commit:"8abcc96cfe3eaaf7e6f4b6e67a1580a41af234d5"})),te.assignWatcher($),e.logger.init(oe))}(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,ae((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:z(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:de[C]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return se((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,ae((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:de[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,ae((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:de[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,ae((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(de[E])),[2,{code:E,msg:de[E]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){X.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,ae((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:de[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,ae((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:z(u)}]:d===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(d,":").concat(de[d],",").concat(r)),[2,{code:d,msg:de[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,s){return se((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),Te(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,ae((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(de[v])),[2,{code:v,msg:de[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)&&Ie(n)?[2,ae((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(de[u],",").concat(r)),[2,{code:u,msg:de[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)&&Re(n)?[2,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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,ae((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(de[n],",").concat(r)),[2,{code:n,msg:de[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,ae((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:de[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){X.off(e,t,n)},exports.removeEventListeners=function(e){X.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,ae((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(de[f])),[2,{code:f,msg:de[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,ae((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,ae((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(de[g],",").concat(l)),[2,{code:g,msg:de[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,ae((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:de[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,ae((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:de[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,ae((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:de[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,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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,ae((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:de[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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(z(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:de[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=et,exports.sendGIFMessage=ot,exports.sendHQVoiceMessage=rt,exports.sendImageMessage=nt,exports.sendMessage=Xe,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,ae((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 pe("RC:ReadNtf",{messageUId:n,lastMessageSendTime:o,type:1}),[4,Xe(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,ae((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 pe("RC:RRReqMsg",{messageUId:n}),[4,Xe({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,ae((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 pe("RC:RRRspMsg",{receiptMessageDic:n}),[4,Xe(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(de[g])),[2,{code:g,msg:de[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=st,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 pe("RC:SRSMsg",{lastMessageSendTime:n}),[4,Xe(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 Xe(e,new Ae(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,ae((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:z(u)}]:[2,{code:d,msg:de[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,ae((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(de[n])),[2,{code:n,msg:de[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)&&Ee(n)?n.entries.length>10?[2,ce.CHATROOM_KV_STORE_OUT_LIMIT]:[2,ae((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(de[c],",").concat(o)),[2,{code:c,msg:de[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)&&fe(n)?[2,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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,ae((function(e,o){return ve(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,ae((function(e,o){return ve(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,ae((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(de[r],",").concat(o)),[2,{code:r,msg:de[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,ae((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:de[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,ae((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:de[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:de[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,ae((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:de[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,ae((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(de[c]," , ").concat(r)),[2,{code:c,msg:de[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,ae((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:de[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,ae((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(de[f])),[2,{code:f,msg:de[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,ae((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(de[v],",").concat(g)),[2,{code:v,msg:de[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,ae((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:de[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};
|