@rongcloud/imlib-next 5.6.1 → 5.6.2-alpha.1
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.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as r,ReceivedStatus as a,ConversationType as i,isNumber as s,EventEmitter as c,VersionManage as u,assert as d,AssertRules as f,isArray as l,isHttpUrl as g,APIContext as v,LogTagId as I,logger as R,validate as h,isValidConversationType as m,isValidNotificationLevel as E,NotificationLevel as p,UltraGroupChannelType as S,isString as T,getUUID as O,UploadMethod as N,isValidFileType as _,FileType as C,usingCppEngine as A,MessageDirection as y,isUndefined as M}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,ReceivedStatus,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var U=function(){return U=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},U.apply(this,arguments)};function P(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(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(i,s)}c((o=o.apply(e,t||[])).next())}))}function L(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var w=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))},D=w();var B,b,G={tag:"browser",httpReq:function(e){var r=e.method||t.GET,a=e.timeout||n,i=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t,n=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(r,u),i&&n.setRequestHeader)for(var s in i)n.setRequestHeader(s,i[s]);if(o){n.timeout=a,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status||0})},n.ontimeout=function(){e({status:n.status||0})};var d="object"==typeof c?JSON.stringify(c):c;n.send(d)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status||0})},setTimeout((function(){n.abort(),e({status:n.status||0})}),a),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:D,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},x=w(),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)}}},k={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},H={tag:"wechat",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:k,sessionStorage:k,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{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.UNKONWN)}})}))}},F=w(),Z=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){}}},q={setItem:Z("setStorageSync"),getItem:Z("getStorageSync"),removeItem:Z("removeStorageSync"),clear:Z("clearStorageSync")},J={tag:"alipay",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:a,headers:s,timeout:i,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:q,sessionStorage:q,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},z=w(),K=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){}}},Y={setItem:K("setStorageSync"),getItem:K("getStorageSync"),removeItem:K("removeStorageSync"),clear:K("clearStorageSync")},j={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,localStorage:Y,sessionStorage:Y,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{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.UNKONWN)}})}))}},W=w(),X=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){}}},Q={setItem:X("setStorageSync"),getItem:X("getStorageSync"),removeItem:X("removeStorageSync"),clear:X("clearStorageSync")},$={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:W,localStorage:Q,sessionStorage:Q,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{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 P(this,void 0,void 0,(function(){return L(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},ee=w(),te=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)}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe={tag:"jingdong",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){jd.request({url:d,method:a,headers:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{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.UNKONWN)}})}))}},re=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)}}},ae={setItem:re("setStorageSync"),getItem:re("getStorageSync"),removeItem:re("removeStorageSync"),clear:re("clearStorageSync")},ie={tag:"uniapp",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ae,sessionStorage:ae,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{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.UNKONWN)}})}))}},se=function(e){return e&&e.request&&e.getSystemInfo},ce="undefined"!=typeof uni&&se(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ie;case"mp-jd":return oe;case"mp-baidu":return $;case"mp-toutiao":return j;case"mp-alipay":return J;case"mp-weixin":return H;default:return G}}():"undefined"!=typeof jd&&se(jd)?oe:"undefined"!=typeof my&&se(my)?J:"undefined"!=typeof tt&&se(tt)?j:"undefined"!=typeof swan&&se(swan)?$:"undefined"!=typeof wx&&se(wx)?H:G;function ue(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,p=e.disableNotification,S=e.isMentioned,T=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=a.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:S,disableNotification:p,isStatusMessage:T,canIncludeExpansion:h,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return t!==i.ULTRA_GROUP&&(U.isOffLineMessage=R),t===i.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function de(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,i=e.mentionedInfo,s=e.lastUnreadTime,c=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&ue(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:s,notificationStatus:c,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function fe(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED"}(B||(B={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(b||(b={}));var le=new c,ge={onConnecting:function(){le.emit(B.CONNECTING)},onConnected:function(){le.emit(B.CONNECTED)},onDisconnect:function(e){le.emit(B.DISCONNECT,e)},onSuspend:function(e){le.emit(B.SUSPEND,e)},batchMessage:function(e){le.emit(B.MESSAGES,{messages:e.map((function(e){return ue(e)}))})},typingState:function(e){le.emit(B.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){le.emit(B.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){le.emit(B.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){le.emit(B.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?ue(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===i.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));le.emit(B.CONVERSATION,{conversationList:t})},chatroomState:function(e){le.emit(B.CHATROOM,e)},expansion:function(e){le.emit(B.EXPANSION,e)},pullFinished:function(){le.emit(B.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){le.emit(B.TAG)},conversationTagChanged:function(){le.emit(B.CONVERSATION_TAG)},messageBlocked:function(e){le.emit(B.MESSAGE_BLOCKED,e)},messageDelivered:function(e){le.emit(B.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){le.emit(B.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){le.emit(B.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){le.emit(B.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){le.emit(B.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){le.emit(B.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){le.emit(B.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){le.emit(B.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){le.emit(B.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){le.emit(B.ULTRA_GROUP_CHANNEL_DELETE,e)}};u.add("imlib-next","5.6.1");var ve=null,Ie=null,Re=null;function he(){return P(this,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return ve?(Re.info(I.A_DESTROY_O),[4,v.destroy()]):[2];case 1:return e.sent(),Ie=null,ve=null,Re=null,[2]}}))}))}function me(e){if(!ve)throw new Error("Not initialized yet!");return e(ve,Re,Ie)}function Ee(e){return ve?e(ve,Re,Ie):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function pe(e,t,n){le.on(e,t,n)}function Se(e,t,n){le.once(e,t,n)}function Te(e,t,n){le.off(e,t,n)}function Oe(e){le.removeAll(e)}function Ne(){le.clear()}function _e(e){!function(e){var t=e.appkey,n=e.navigators;ve?Re.warn(I.A_INIT_REPEAT_O):(d("options.appkey",e.appkey,f.STRING,!0),d("options.navigators",e.navigators,(function(e){return l(e)&&(0===e.length||e.every(g))})),Ie=e,ve=v.init(ce,{appkey:e.appkey,apiVersion:"5.6.1",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(Re=ve.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Re.info(I.A_INIT_O,JSON.stringify({appkey:t,navigators:n,version:"5.6.1",commit:"530541cfdb452c4336fef8ab544c0f14e4445d32"})),ve.assignWatcher(ge))}(e)}function Ce(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return ve?(Ne(),[2,he()]):[2]}))}))}function Ae(){return me((function(e){return e.getConnectionStatus()}))}function ye(){return me((function(e){return e.getServerTime()}))}function Me(){return me((function(e){return e.getCurrentUserId()}))}function Ue(e,t){u.add(e,t)}function Pe(){return me((function(e){return e.getDeviceId()}))}function Le(e,t){return me((function(n){return n.install(e,t)}))}var we={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:r.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:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},De={};for(var Be in we){var be=we[Be].code;De[be]=Be}function Ge(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return h("token",e,f.STRING,!0)&&h("reconnectKickEnable",t,f.BOOLEAN)?(n=a.createTraceId(),a.info(I.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!1,t,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return i=c.sent(),s=i.code===r.SUCCESS?"info":"warn",a[s](I.A_CONNECT_R,JSON.stringify({code:i.code,userId:i.userId}),n),i.code===r.SUCCESS?[2,{code:i.code,data:{userId:i.userId}}]:[2,{code:i.code,msg:De[i.code]}]}}))}))}))]}))}))}function xe(){return R.info(I.A_DISCONNECT_O,{}),me((function(e){return e.disconnect()}))}function Ve(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options.count",null==e?void 0:e.count,f.NUMBER)&&h("options.startTime",null==e?void 0:e.startTime,f.NUMBER)&&h("options.order",null==e?void 0:e.order,f.NUMBER)&&h("channelId",t,f.CHANNEL_ID)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return de(e)}))}]:(a.warn(I.O,"get conversation list fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),a=t.code,i=t.data,a!==r.SUCCESS?(o.warn(I.O,"getConversation ->code:".concat(a,", targetId:").concat(e.targetId)),[2,{code:a,msg:De[a]}]):[2,{code:a,data:i?de(i):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function He(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a;return L(this,(function(i){switch(i.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"destroy conversation ->".concat(a)),t!==r.SUCCESS?(o.warn(I.O,"destroy conversation fail ->".concat(t,":").concat(De[t],",").concat(a)),[2,{code:t,msg:De[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get draft ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i||""}]:(o.warn(I.O,"get draft fail ->".concat(a,":").concat(De[a],",").concat(s)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options",e,f.CONVERSATION,!0)&&h("draft",t,f.STRING,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())===r.SUCCESS?[2,{code:i}]:(a.warn(I.O,"set draft fail ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a;return L(this,(function(i){switch(i.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(a=i.sent())===r.SUCCESS?[2,{code:a}]:(o.warn(I.O,"delete draft fail ->".concat(a,":").concat(De[a],",").concat(t)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("includeMuted",e,f.BOOLEAN,!1)&&h("conversationTypes",t,f.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!h("conversationType",e,m)})))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return a.debug(I.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getTotalUnreadCount fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!h("conversationTypes",e,f.ARRAY,!0)||!h("levels",t,f.ARRAY,!0)||e.some((function(e){return!h("conversationType",e,m)}))||t.some((function(e){return!h("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getTotalUnreadCountByLevels fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]}))}))}function Ke(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!h("conversationTypes",e,f.ARRAY,!0)||!h("levels",t,f.ARRAY,!0)||e.some((function(e){return!h("conversationType",e,m)}))||t.some((function(e){return!h("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]}))}))}function Ye(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get unreadCount ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.O,"get unreadCount fail ->".concat(a,":").concat(De[a],",").concat(s)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a;return L(this,(function(i){switch(i.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"clear unreadMsgNum ->".concat(a)),t!==r.SUCCESS?(o.warn(I.O,"clear unreadMsgNum fail ->".concat(t,":").concat(De[t],",").concat(a)),[2,{code:t,msg:De[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function We(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}we.ROAMING_SERVICE_UNAVAILABLE.code;var Xe=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(I.O,"".concat(n," -> ").concat(o)),o},Qe=function(e,t,n,o){return void 0===o&&(o=""),P(void 0,void 0,void 0,(function(){var a,i;return L(this,(function(s){switch(s.label){case 0:return a=Xe(e,t,o),[4,n()];case 1:return(i=s.sent())!==r.SUCCESS?(e.warn(I.O,"".concat(o," fail -> ").concat(i," : ").concat(De[i]," , ").concat(a)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))};function $e(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return h("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return Qe(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function et(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return h("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return Qe(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t=Xe(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS?[2,{code:i,data:s}]:(o.warn(I.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(De[i]," , ").concat(t)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ot(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ee((function(e){return e.getBlockConversationList()}))]}))}))}function at(e,t){return void 0===t&&(t=!0),P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options",e,f.CONVERSATION,!0)&&h("isTop",t,f.BOOLEAN)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"set conversation status fail ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function it(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversationTypes",e,f.ARRAY)&&!(null==e?void 0:e.some((function(e){return!h("conversationType",e,m)})))&&h("channelId",t,f.CHANNEL_ID)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return de(e)}))}]:(a.warn(I.A_GET_TOP_CONVERSATION_LIST_E,"".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(e){return P(this,void 0,void 0,(function(){return L(this,(function(t){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(t,n){return n.debug(I.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ct(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ee((function(e,t){return t.debug(I.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function ut(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ee((function(e){return e.getAllConversationState()}))]}))}))}function dt(e){return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options.targetId",e.targetId,f.STRING,!1)&&h("options.channelType",e.channelType,(function(e){return void 0!==S[e]}),!1)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(o.warn(I.O,"get ultragroup ->".concat(a,":").concat(De[a])),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a;return L(this,(function(i){switch(i.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(I.O,"get block ultragroup ->".concat(o,":").concat(De[o])),[2,{code:o,msg:De[o]}])}}))}))}))]}))}))}function lt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(De[t])),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options",e,f.CONVERSATION,!0)&&h("msgs",t,f.ARRAY,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=e.targetId,i=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:i,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:return d=g.sent(),f=d.code,l=d.data,f===r.SUCCESS?[2,{code:r.SUCCESS,data:l}]:(a.warn(I.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(De[f])),[2,{code:f,msg:De[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("expansion",e,f.OBJECT,!0)&&h("message",t,f.OBJECT,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(I.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(I.O,"update expansion for ultragroup message ->".concat(g,":").concat(De[g])),[2,{code:g,msg:De[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("expansion",e,f.ARRAY,!0)&&h("message",t,f.OBJECT,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(I.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(I.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(De[g])),[2,{code:g,msg:De[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("message",e,f.OBJECT,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return t=e.conversationType,a=e.targetId,i=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(u,",messageUId:").concat(i),o.debug(I.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:a,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:i,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(De[l])),[2,{code:l,msg:De[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("content",e,f.OBJECT,!0)&&h("message",t,f.OBJECT,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v;return L(this,(function(R){switch(R.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(f,",messageUId:").concat(s),a.debug(I.O,"update ultragroup message expansion ->".concat(l)),g={targetId:i,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=R.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(I.O,"modify ultraGroup message ->".concat(v,":").concat(De[v])),[2,{code:v,msg:De[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!h("notificationLevel",e,E)})))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return a.debug(I.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(a.warn(I.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options.targetId",e.targetId,f.STRING,!0)&&h("options.channelId",e.channelId,f.CHANNEL_ID)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s,c;return L(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(I.O,"".concat(t," -> ").concat(a)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(I.O,"".concat(t," fail -> ").concat(s," : ").concat(De[s]," , ").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,f.STRING,!0)&&h("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&h("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),a.debug(I.O,"".concat(n," -> ").concat(i)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(a.warn(I.O,"".concat(n," fail -> ").concat(s," : ").concat(De[s]," , ").concat(i)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!h("notificationLevel",e,E)})))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=d.sent(),s=i.code,c=i.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),a.debug(I.O,"".concat(n," -> ").concat(u)),s===r.SUCCESS?[2,{code:s,data:c}]:(a.warn(I.O,"".concat(n," fail -> ").concat(s,": ").concat(De[s],", ").concat(u)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a,i;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(I.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(I.O,"".concat(e," fail ->").concat(a,": ").concat(De[a])),[2,{code:a,msg:De[a]}])}}))}))}))]}))}))}function Ot(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a,i;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(I.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(I.O,"".concat(e," fail ->").concat(a,": ").concat(De[a])),[2,{code:a,msg:De[a]}])}}))}))}))]}))}))}function Nt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,f.STRING,!0)&&h("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&h("options.sentTime",e.sentTime,f.NUMBER,!0)&&h("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return t=e.targetId,a=e.channelId,i=e.sentTime,s=e.count,c={targetId:t,channelId:a,sentTime:i,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(I.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(De[d])),[2,{code:d,msg:De[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("conversation.targetId",e.targetId,f.STRING,!0)&&h("conversation.channelId",e.channelId,f.CHANNEL_ID,!0)?[2,Ee((function(n){return P(t,void 0,void 0,(function(){var t,o,a,i,s,c;return L(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:De[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Ct=function(e){return!!(h("options.key",e.key,f.STRING,!0)&&h("options.value",e.value,f.STRING,!0)&&h("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&h("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,f.STRING))},At=function(e){return h("options.key",e.key,f.STRING,!0)&&h("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,f.STRING)};function yt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.count",t.count,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:De[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.count",t.count,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:De[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("targetId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(I.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return a=s.sent(),i=a===r.SUCCESS?"info":"warn",o[i](I.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),t),a!==r.SUCCESS?[2,{code:a,msg:De[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.count",t.count,f.NUMBER)&&h("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(I.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(I.O,"get chatroom info fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&Ct(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"set chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&function(e){return e.entries.every((function(e){return h("entry.key",e.key,f.STRING,!0)&&h("entry.value",e.value,f.STRING,!0)}))&&h("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,f.STRING)&&h("options.isForce",e.isForce,f.BOOLEAN)}(t)?t.entries.length>10?[2,we.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s!==r.SUCCESS?(a.warn(I.O,"set chatroom entry fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&Ct(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(I.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"force set chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&At(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(I.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"remove chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&function(e){return e.entries.every((function(e){return h("key",e,f.STRING,!0)}))&&h("options.notificationExtra",e.notificationExtra,f.STRING)}(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.info(I.O,"remove chatroom entry->".concat(n)),(i=U({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,i)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==r.SUCCESS?(a.warn(I.O,"remove chatroom entry fail ->code+:".concat(De[c],",").concat(n)),[2,{code:c,msg:De[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&At(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.info(I.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"force remove chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("key",t,(function(e){return T(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(I.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(I.O,"get chatroom entry fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("targetId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(I.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS&&s?[2,{code:i,data:s}]:(o.warn(I.O,"get all chatroom entries fail ->code+:".concat(De[i],",").concat(t)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.timestamp",t.timestamp,f.NUMBER)&&h("options.count",t.count,f.NUMBER)&&h("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.debug(I.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ue(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(a.warn(I.O,"get chatroom history message fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("option.chatRoomId",e.chatRoomId,f.STRING,!0)&&h("option.rtcRoomId",e.rtcRoomId,f.STRING,!0)?[2,Ee((function(n){return P(t,void 0,void 0,(function(){var t;return L(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:De[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("userId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("userId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a;return L(this,(function(i){switch(i.label){case 0:return n.info(I.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS&&a?[2,{code:o,data:a}]:(n.warn(I.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Jt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("userId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:0===i}]:(o.warn(I.O,"getBlacklistStatus fail -> code: ".concat(a,", userId: ").concat(e)),[2,{code:a}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var zt=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 Kt(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new zt(e,o,t,n)}}var Yt,jt,Wt=Kt("RC:ImgMsg"),Xt=Kt("RC:HQVCMsg"),Qt=Kt("RC:SightMsg"),$t=Kt("RC:TxtMsg"),en=Kt("RC:CombineMsg"),tn=Kt("RC:FileMsg"),nn=Kt("RC:GIFMsg"),on=Kt("RC:VcMsg"),rn=Kt("RC:LBSMsg"),an=Kt("RC:ReferenceMsg"),sn=Kt("RC:ImgTextMsg"),cn={qiniu:function(e,t,n,o){me((function(r){var a=r.getInfoFromCache();if(1===(null==a?void 0:a.type)&&t.chunk_size&&o.size>t.chunk_size){var i=O();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,In(o,t,n)}else vn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>dn)throw new Error("the file size is over 5GB!");var r=t||{};t=t||jt;var a=new XMLHttpRequest,i=fn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=i+un[0][1]+r.bosUploadPath;un.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=t.uniqueValue,200===a.status){n.onCompleted(u,!0)}else un.length?cn[un[0][0]](e,t,n,o):n.onError("upload fail")},a.open(t.method,s,!0),a.setRequestHeader("authorization",c.bosToken),a.setRequestHeader("x-bce-date",c.bosDate),a.send(o)},aliyun:function(e,t,n,o){if(o.size>dn)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var a=un[0][1];un.shift(),e=e||Yt,t=(t=t||{})||jt;var i=new XMLHttpRequest,s=fn(),c="".concat(s+t.ossBucketName,".").concat(a);i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var e=JSON.parse(i.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=N?N.ALI:"",200===i.status?n.onCompleted(e):un.length?cn[un[0][0]](r,t,n,o):n.onError("upload fail")}},i.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),i.send(e)},s3:function(e,t,n,o){var r=new FormData,a=new XMLHttpRequest,i=fn(),s=t.contentDisposition,c=un[0][1],u="".concat(i+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),un.shift(),a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=N.AWS,200===a.status||204===a.status)n.onCompleted(r);else if(un.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[un[0][0]](i,t,n,o)}else n.onError("upload fail")}},a.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),a.send(r)},stc:function(e,t,n,o){var r=new XMLHttpRequest,a=t.contentDisposition,i=un[0][1],s="https://".concat(i,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);un.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=N?N.STC:"",200===r.status||204===r.status)n.onCompleted(a);else if(un.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[un[0][0]](i,t,n,o)}else n.onError("upload fail")}},r.open("PUT",s,!0);var c=t?t.stcHeader:{};r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",c.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",c.stcContentSha256),r.setRequestHeader("x-amz-date",c.stcDate),r.send(o)}},un=[],dn=5368709120;function fn(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var ln,gn=(ln="RC-upload-",{get:function(e){e=ln+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=ln+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=ln+e,localStorage.removeItem(e)}});function vn(e,t,n,o){var r="https://"+t.uploadHost.qiniu,a=(/http/.test(un[0][1])?"":fn())+un[0][1]||r;t.isChunk||un.shift();var i=new XMLHttpRequest;i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=N?N.QINIU:"",200===i.status||204===i.status?n.onCompleted(r):un.length?cn[un[0][0]](e,t,n,o):n.onError("upload fail")}},i.open(t.method,a,!0),n.onOpen(i),t.stream&&i.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(e)}function In(e,t,n,o){var r=0,a=o||O(),i=gn.get(a);i&&(e.uniqueName=i.sessionId,r=i.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var a=t.multi_parmas[r];o.append(r,a)}return o}(c,t,e.uniqueName),vn(c,t,{onCompleted:function(o){r+=s;var i=e.uniqueName;gn.set(a,{offset:r,sessionId:i}),r<e.size?In(e,t,n,a):(r=0,gn.remove(a),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var a=e+r;n.onProgress(a,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function Rn(e,t,n,o){var r,a,i=t&&t.type||"text/plain",s=i.indexOf("image")>-1?1:4,c=n.contentDisposition,u=Math.ceil(t.size/n.stc_chunk_size),d=n&&JSON.parse(n.ossConfig?n.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(s,r,"POST",l).then((function(e){r=e.fileName,a="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",a);var s=new XMLHttpRequest;s.open("POST","".concat(a,"?").concat(l),!0),c?s.setRequestHeader("Content-Disposition","".concat(c,";")):s.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",i),s.send(),s.onreadystatechange=function(){if(4===s.readyState){var e=s.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===s.status||204===s.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(R(e,n));I(e,t)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var g=[],v=new Map;function I(c,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(c);if(v.size===u)e.getFileToken(s,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",c);var r=new XMLHttpRequest;r.open("POST","".concat(a,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i);var s="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){s+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),s+="</CompleteMultipartUpload>",r.send(s),console.log("xml",s),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:t.name,filename:n.uploadFileName,uploadMethod:N.STC};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var f=[],l=0,h=g;l<h.length;l++){var m=h[l];f.push(R(c,m))}I(c,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,r=g;n<r.length;n++){var a=r[n];t.push(R(c,a))}I(c,t)}))}function R(o,c){return new Promise((function(u,d){var f="partNumber=".concat(c,"&uploadId=").concat(o);e.getFileToken(s,r,"PUT",f).then((function(e){console.log("signature ".concat(c," onSuccess"),e);var o=t&&t.slice((c-1)*n.stc_chunk_size,c*n.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(a,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(c),e),v.set(c,e),u(e)}else g.includes(c)||g.push(c),d(c)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(c)||g.push(c),d(c)}))}))}}var hn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=mn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),En(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=mn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,En(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function mn(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function En(e,t){for(var n in e)t(n,e[n])}var pn,Sn=0,Tn=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:hn.form,genUId:mn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;En(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){Yt=n,jt=o,un=[];var a,i=e.getInfoFromCache();if(1===(null==i?void 0:i.type)&&t.uploadDomain)un=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var s,c,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(d=e[n]),"s3"===n&&(s=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&un.push(e)})),u.length!==un.length&&(un=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",s],["stc",c]])}else un=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),a=l.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&n.size>=4194304)Rn(e,n,o,r);else{var g=o.data(n,o);cn[un[0][0]](g,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(pn=e,n)?pn=Sn+e/t*(t-Sn):Sn=pn;o.onProgress(pn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var On,Nn,_n={init:function(e){return new Tn(e)},dataType:hn,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var i=a.width,s=a.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var a=e.height,i=t.maxHeight||0;if(i>0&&a>i){var s=i/a;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:i,height:s,size:e.total},t),u=r;c<1&&(u=function(e,t,n){return o.width=t,o.height=n,o.getContext("2d").drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(a,i*c,s*c)),n(u)}},Upload:Tn},Cn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,i="string"==typeof e;a.onload=function(i){var s=function(e,t,n){var o,r,a,i=e<t,s=0,c=0;return(i?t/e:e/t)>n.scale?(i?(r=100,c=((a=t/(o=e/100))-n.maxHeight)/2):(a=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:a,x:-s,y:-c}):(i?(o=t/n.maxHeight,a=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,a=t/o),{w:r,h:a,x:-s,y:-c})}(a.width,a.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(a,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},a.src=i?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},An=function(e,t){var n=e.file,o=e.compress;Cn(n,o,t)},yn=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=_n.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=_n.init(e);t(n)}},Mn=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||An;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},Un=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){Mn(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Pn=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};Mn(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ln=function(e,t){yn(e,(function(e){var n=new Un(e);t(n)}))},wn=function(e,t){yn(e,(function(n){var o,r,a,i,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},c=new Pn(n,s);t(c)}))};_n.dataType;function Dn(e,t,n,o,r,a,i){var s,c=this;void 0===r&&(r=C.FILE),s=r===C.IMAGE?C.IMAGE:C.FILE;var u=e.getInfoFromCache();if(!Nn&&(Nn="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Nn=d.qiniu)}catch(e){}var f=U({domain:Nn,getToken:function(t){e.getFileToken(s).then((function(e){t(e.token,e)})).catch((function(e){a.onFail(e)}))}},i);(s===C.IMAGE?wn:Ln)(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=a.onProgress)||void 0===n||n.call(a,o)},onCompleted:function(e){return P(c,void 0,void 0,(function(){return L(this,(function(t){return 1===(null==u?void 0:u.type)?function(e,t,n,o,r,a){var i={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===C.AUDIO)return void Bn(o).then((function(e){a.onSuccess(U(U({},i),e))}));t===C.IMAGE&&(i.thumbnail=r.thumbnail);a.onSuccess(i)}(n,r,0,o,e,a):function(e,t,n,o,r){xn(t,o.filename,o.name,o,o.uploadMethod).then((function(a){if(0===a.code){var i=a.data;i.type=n.type,i.name=o.name||o.filename,e!==C.AUDIO?(t===C.IMAGE&&(i.thumbnail=o.thumbnail),r.onSuccess(i)):Bn(n).then((function(e){r.onSuccess(U(U({},i),e))}))}else r.onFail(a)})).catch((function(e){r.onFail(e)}))}(r,s,o,e,a),[2]}))}))},onError:function(e){a.onFail(e)}})}))}function Bn(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?bn(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(bn).then((function(e){t(e)}))}))}function bn(e){return On=On||new AudioContext,new Promise((function(t,n){On.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Gn(e,t,n,o){return Ee((function(a){return new Promise((function(i){a.getFileToken(e,t,n,o).then((function(e){i({code:r.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:De[e]})}))}))}))}function xn(e,t,n,o,a){return h("fileType",e,_,!0)&&h("filename",t,f.STRING)&&h("saveName",n,f.STRING)&&h("serverType",a,f.NUMBER)?Ee((function(i){return new Promise((function(s){i.getFileUrl(e,t,n,o,a).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function Vn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(s){return[2,Ee((function(s,c){return P(o,void 0,void 0,(function(){var o,u,d,l,g,v,R,m,E,p,S,T,O;return L(this,(function(N){switch(N.label){case 0:return n=n||{},t instanceof zt==!1?(c.warn(I.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,we.ILLGAL_PARAMS]):h("conversation",e,f.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,h("conversation.targetId",u,f.STRING,!0)&&h("conversation.conversationType",o,f.NUMBER,!0)&&h("conversation.channelId",d,f.CHANNEL_ID)&&h("options.isStatusMessage",null==n?void 0:n.isStatusMessage,f.BOOLEAN)&&h("options.disableNotification",null==n?void 0:n.disableNotification,f.BOOLEAN)&&h("options.pushContent",null==n?void 0:n.pushContent,f.STRING)&&h("options.pushData",null==n?void 0:n.pushData,f.STRING)&&h("options.isMentioned",null==n?void 0:n.isMentioned,f.BOOLEAN)&&h("options.mentionedType",null==n?void 0:n.mentionedType,f.NUMBER)&&h("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,f.ARRAY)&&h("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,f.ARRAY)&&h("options.isVoipPush",null==n?void 0:n.isVoipPush,f.BOOLEAN)&&h("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,f.BOOLEAN)&&h("options.expansion",null==n?void 0:n.expansion,f.OBJECT)&&h("options.pushConfig",null==n?void 0:n.pushConfig,f.OBJECT)&&h("options.messageId",null==n?void 0:n.messageId,f.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(I.O,"send message ->".concat(l)),g=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,a=e.pushContent,i=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=n.channelId;return U({isStatusMessage:o,disableNotification:r,pushContent:a,pushData:i,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:h||"",messageId:R},t)}(n,t,e),v={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:t.isPersited||!1,isCounted:t.isCounted||!1,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:y.SEND,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig},o!==i.ULTRA_GROUP&&(v.isOffLineMessage=!1),R=c.createTraceId(),m=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(ue(v))}catch(e){c.error(I.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),R)}},c.info(I.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),R),[4,s.sendMessage(o,u,g,m,R)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=N.sent(),p=E.code,S=E.data,T=p===r.SUCCESS?"info":"warn",c[T](I.A_SEND_MSG_R,JSON.stringify({code:p,messageUId:S?S.messageUId:"",messageId:S?S.messageId:""}),R),p===r.SUCCESS?(O=ue(S),[2,{code:p,data:O}]):(c.warn(I.O,"send message fail ->".concat(p,":").concat(De[p],",").concat(l)),v.sentTime=(null==S?void 0:S.sentTime)||0,[2,{code:p,msg:De[p],data:ue(v)}])}}))}))}))]}))}))}function kn(e,t,n){return Vn(e,new $t(t),n)}function Hn(e,t){return function(n,o,a,i){if(!h("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var c=null==i?void 0:i.thumbnailConfig;if(!(h("sendOptions.maxHeight",null==c?void 0:c.maxHeight,f.NUMBER)&&h("sendOptions.maxWidth",null==c?void 0:c.maxWidth,f.NUMBER)&&h("sendOptions.quality",null==c?void 0:c.quality,f.NUMBER)&&h("sendOptions.scale",null==c?void 0:c.scale,f.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ee((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(I.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Dn(c,0,d,o.file,e,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(e){var s,c=(null===(s=null==a?void 0:a.onComplete)||void 0===s?void 0:s.call(a,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&u.info(I.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),Vn(n,c,i).then(f)},onFail:function(e){u.warn(I.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s)}))}))}}var Fn=Hn(C.FILE,(function(e,t){return new tn({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})),Zn=Hn(C.IMAGE,(function(e,t){return new Wt({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),qn=Hn(C.AUDIO,(function(e,t){return new Xt({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Jn=Hn(C.SIGHT,(function(e,t){return new Qt({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})}));function zn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&h("options.count",null==t?void 0:t.count,f.NUMBER)&&h("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n=a.createTraceId(),a.info(I.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ue(e)})),a.info(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&h("options.count",null==t?void 0:t.count,f.NUMBER)&&h("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ue(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(I.O,"get history message fail ->".concat(s,":").concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yn(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(s){return h("targetId",e,f.STRING,!0)&&h("messageUId",t,f.STRING,!0)&&h("timestamp",n,f.NUMBER,!0)&&h("channelId",o,f.CHANNEL_ID)?[2,Ee((function(r){return P(a,void 0,void 0,(function(){var r,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:i.PRIVATE,channelId:o},a=new zt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,Vn(r,a)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("messageUId",t,f.STRING,!0)&&h("targetId",e,f.STRING,!0)&&h("channelId",n,f.CHANNEL_ID)?[2,Ee((function(r,a){return P(o,void 0,void 0,(function(){var o,r,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(I.O,"send read receipt message ->".concat(o)),r=new zt("RC:RRReqMsg",{messageUId:t}),[4,Vn({targetId:e,conversationType:i.GROUP,channelId:n},r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wn(e,t,n){return P(this,void 0,void 0,(function(){return L(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Xn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("targetId",e,f.STRING,!0)&&h("messageList",t,f.OBJECT,!0)&&h("channelId",n,f.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!h(e,t[e],f.ARRAY)}))?[2,Ee((function(a,s){return P(o,void 0,void 0,(function(){var o,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:i.GROUP,channelId:n},u=a.getInfoFromCache(),0!==(d=(null==u?void 0:u.grpRRVer)||0)?[3,2]:(f=new zt("RC:RRRspMsg",{receiptMessageDic:t}),[4,Vn(o,f)]);case 1:return c=v.sent(),[3,4];case 2:return 1!==d?[3,4]:(l=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,a.sendReadReceiptMessage(e,l,n)]:(s.warn(I.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:c=v.sent(),v.label=4;case 4:return(g=c.code)===r.SUCCESS?[2,{code:g}]:(s.warn(I.O,"send read receipt message fail ->".concat(g,":").concat(De[g])),[2,{code:g,msg:De[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qn(e,t){return P(this,void 0,void 0,(function(){var n,o,a,i;return L(this,(function(s){switch(s.label){case 0:return h("conversation",e,f.CONVERSATION,!0)&&h("lastMessageSendTime",t,f.NUMBER,!0)?(n=new zt("RC:SRSMsg",{lastMessageSendTime:t}),[4,Vn(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),a=o.code,i=o.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))}function $n(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("options.messageUId",t.messageUId,f.STRING,!0)&&h("options.sentTime",t.sentTime,f.NUMBER,!0)&&h("options.disableNotification",null==t?void 0:t.disableNotification,f.BOOLEAN)&&h("options.pushConfig",null==t?void 0:t.pushConfig,f.OBJECT)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),a.debug(I.O,"recall message ->".concat(i)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS&&u?[2,{code:c,data:ue(u)}]:c===r.SUCCESS?[2,{code:c}]:(a.warn(I.O,"recall message fail ->".concat(c,":").concat(De[c],",").concat(i)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("options",t,(function(e){return l(e)&&e.length}),!0)&&!t.some((function(e){return!h("options.messageUId",e.messageUId,f.STRING,!0)||!h("options.sentTime",e.sentTime,f.NUMBER,!0)||!h("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"delete message fail ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("timestamp",t,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"clear message ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function no(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("expansion",e,f.OBJECT,!0)&&h("message",t,f.OBJECT,!0)&&h("message.conversationType",t.conversationType,f.NUMBER,!0)&&h("message.targetId",t.targetId,f.STRING,!0)&&h("message.channelId",t.channelId,f.CHANNEL_ID)&&h("message.messageUId",t.messageUId,f.STRING,!0)&&h("message.expansion",t.expansion,f.OBJECT)&&h("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(I.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(a.warn(I.O,"update message expansion fail ->".concat(l,":").concat(De[l],",").concat(f)),[2,{code:l,msg:De[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("keys",e,f.ARRAY,!0)&&h("message",t,f.OBJECT,!0)&&h("message.conversationType",t.conversationType,f.NUMBER,!0)&&h("message.targetId",t.targetId,f.STRING,!0)&&h("message.channelId",t.channelId,f.CHANNEL_ID)&&h("message.messageUId",t.messageUId,f.STRING,!0)&&h("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(I.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(a.warn(I.O,"remove message expansion fail ->".concat(f,":").concat(De[f],",").concat(d)),[2,{code:f,msg:De[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("typingContentType",t,f.STRING,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d;return L(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},i=a.createTraceId(),a.info(I.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),i),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,i)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",a[d](I.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),i),c===r.SUCCESS?[2,{code:c,data:ue(u)}]:[2,{code:c,msg:De[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ao(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("messageUId",t,f.STRING,!0)&&h("targetId",e,f.STRING,!0)&&h("channelId",n,f.CHANNEL_ID)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(I.O,"get message reader ->".concat(o)),[4,a.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(i.warn(I.O,"get message reader fail ->".concat(c,":").concat(De[c],",").concat(o)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function io(e,t,n,o,r){return me((function(a,i){return d("messageType",e,f.STRING,!0),d("isPersited",t,f.BOOLEAN,!0),d("isCounted",n,f.BOOLEAN,!0),d("isStatusMessage",r,f.BOOLEAN,!1),d("searchProps",o,f.ARRAY),i.info(I.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),a.registerMessageType(e,t,n,o,r),Kt(e,t,n)}))}function so(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.O,"insertMessage ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function co(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return fe("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),A()?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,R,h,m,E,p,S,T;return L(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,R=t.sentStatus,i.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:R,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,E)];case 1:return p=O.sent(),S=p.code,T=p.data,S===r.SUCCESS?[2,{code:S,data:ue(T)}]:(i.warn(I.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:De[S]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function uo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("messageId",e,(function(e){return s(e)||T(e)}),!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:ue(i)}]:(o.warn(I.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function fo(e){if(!A())return{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,a=e.channelId;return h("conversation",e,f.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,a),i=[];return t&&t.length&&t.forEach((function(e){return i.push(ue(e))})),{code:r.SUCCESS,data:i}},ve?t(ve,Re,Ie):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function lo(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return fe("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),A()?h("conversation",e,f.CONVERSATION,!0)&&h("keyword",t,f.STRING,!0)&&h("timestamp",n,f.NUMBER)&&h("count",o,f.NUMBER)?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u,d;return L(this,(function(f){switch(f.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return a=f.sent(),c=a.code,u=a.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(ue(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(I.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function go(e,t,n){return P(this,void 0,void 0,(function(){var o,a,i,s=this;return L(this,(function(c){return fe("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,f.NUMBER,!0)&&h("targetId",a,f.STRING,!0)&&h("timestamp",t,f.NUMBER,!0)&&h("cleanSpace",n,f.BOOLEAN)?[2,Ee((function(c,u){return P(s,void 0,void 0,(function(){var s;return L(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return s=d.sent(),u.debug(I.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:a,channelId:i,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(I.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function vo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return fe("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),A()?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function Io(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return fe("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),A()?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u;return L(this,(function(d){switch(d.label){case 0:return s.info(I.O,"searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,n,o,t)];case 1:return a=d.sent(),c=a.code,u=a.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(I.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function Ro(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("timestamp",t,f.NUMBER)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n=e.conversationType,i=e.targetId,s=e.channelId,a.info(I.O,"clearUnreadCountByTimestamp ->targetId:".concat(i,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,i,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(a.warn(I.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(i)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function ho(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return fe("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),A()?h("messageId",e,f.NUMBER,!0)&&h("receivedStatus",t,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=i.sent())===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function mo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("tag.tagId",e.tagId,f.STRING,!0)&&h("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&h("tag.tagName",e.tagName,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return o.info(I.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("tagId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return o.info(I.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("tag.tagId",e.tagId,f.STRING,!0)&&h("tag.tagName",e.tagName,f.STRING,!0)&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return o.info(I.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a;return L(this,(function(i){switch(i.label){case 0:return[4,t.getTagList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(I.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:De[o]}])}}))}))}))]}))}))}function To(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:De[a]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!h("conversation",e,f.CONVERSATION,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!h("conversation",e,f.CONVERSATION,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("tagIds",t,f.ARRAY,!0)&&!t.some((function(e){return!h("tagId",e,f.STRING,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!h("conversation",e,f.CONVERSATION,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("tagId",e,f.STRING,!0)&&h("count",t,f.NUMBER,!0)&&h("startTime",n,f.NUMBER,!0)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c;return L(this,(function(u){switch(u.label){case 0:return i.info(I.O,"getConversationListByTag ->tagId:".concat(e)),[4,a.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===r.SUCCESS?[2,{code:s,data:c}]:(i.warn(I.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("containMuted",t,f.BOOLEAN,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return a.info(I.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getUnreadCountByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("tagId",e,f.STRING,!0)&&h("conversation",t,f.CONVERSATION,!0)&&h("status.isTop",n,f.BOOLEAN,!0)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o;return L(this,(function(s){switch(s.label){case 0:return i.info(I.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,a.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(i.warn(I.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:De[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Hn(C.COMBINE_HTML,(function(e,t){return new en({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Uo={COMET:"comet",WEBSOCKET:"websocket"},Po={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"};var Lo=Object.freeze({__proto__:null,getAllConversationList:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("channelId",e,f.CHANNEL_ID)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return o.info(I.O,"getAllConversationList -> channelId: ".concat(e)),M(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return a=t.code,i=t.data,a===r.SUCCESS&&i?(s=i.map((function(e){return de(e)})),[2,{code:a,data:s}]):(o.warn(I.O,"getAllConversationList fail -> code: ".concat(a," channelId: ").concat(e)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return A()?h("startTime",e,f.NUMBER,!0)&&h("count",t,f.NUMBER,!0)&&h("channelId",n,f.CHANNEL_ID)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),i.info(I.O,"getConversationList -> ".concat(o)),M(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return de(e)})),[2,{code:u,data:f}]):(i.warn(I.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:De[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return A()?h("keyword",t,f.STRING,!0)&&h("messageTypes",n,f.ARRAY,!0)&&h("channelId",o,f.CHANNEL_ID)&&!n.some((function(e){return!h("messageType",e,f.STRING,!0)}))?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return a="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(I.O,"searchConversationByContent -> ".concat(e)),M(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return de(e)})),[2,{code:u,data:f}]):(s.warn(I.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(a)),[2,{code:u,msg:De[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("keyword",t,f.STRING,!0)&&h("startTime",n,f.NUMBER,!0)&&h("count",o,f.NUMBER,!0)?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u,d,f,l,g,v,R,h;return L(this,(function(m){switch(m.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(I.O,"searchMessages -> ".concat(a)),c=e.targetId,u=e.conversationType,d=e.channelId,M(d)?[4,i.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,R=g.count,h=v.map((function(e){return ue(e)})),[2,{code:l,data:{messages:h,count:R}}]):(s.warn(I.O,"searchMessages fail -> code: ".concat(l," ").concat(a)),[2,{code:l,msg:De[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("option",t,f.OBJECT,!0)&&h("option.keyword",t.keyword,f.STRING,!0)&&h("option.startTime",t.startTime,f.NUMBER,!0)&&h("option.endTime",t.endTime,f.NUMBER,!0)&&h("option.offset",t.offset,f.NUMBER)&&h("option.limit",t.limit,f.NUMBER)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,R;return L(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(I.O,"searchMessageInTimeRange -> ".concat(n)),i=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(i,s,c,u,d,f,l)];case 1:return g=h.sent(),v=g.code,R=g.data,v===r.SUCCESS&&R?[2,{code:v,data:{messages:R.messages.map((function(e){return ue(e)}))}}]:(a.warn(I.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("option",t,f.OBJECT,!0)&&h("option.count",t.count,f.NUMBER)&&h("option.timestamp",t.timestamp,f.NUMBER)&&h("option.order",t.order,(function(e){return[0,1].includes(e)}))&&h("option.messageTypes",t.messageTypes,f.ARRAY,!0)&&!t.messageTypes.some((function(e){return!h("option.messageType",e,f.STRING,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,R,h,m,E,p;return L(this,(function(S){switch(S.label){case 0:return n=t.count,i=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(I.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),i||(i=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,i,n,c,s,l)];case 1:return g=S.sent(),v=g.code,R=g.data,v===r.SUCCESS?(m=(h=R).list,E=h.hasMore,p=m.map((function(e){return ue(e)})),[2,{code:v,data:{messages:p,hasMore:E,list:p}}]):(a.warn(I.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:De[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("timestamp",t,f.NUMBER,!0)?[2,Ee((function(o,r){return P(n,void 0,void 0,(function(){var n,a,i,s;return L(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(I.O,"updateSentMsgReceiptStatus -> ".concat(n)),a=e.conversationType,i=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(a,i,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("messageId",e,f.NUMBER,!0)&&h("receivedStatus",t,(function(e){return!M(a[e])}),!0)?[2,Ee((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("messageId",e,f.NUMBER,!0)&&h("sentStatus",t,(function(e){return!M(b[e])}),!0)?[2,Ee((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return A()?h("messageId",e,f.NUMBER,!0)&&h("content",t,f.OBJECT,!0)&&h("messageType",n,f.ONLY_STRING,!0)?[2,Ee((function(r,a){return P(o,void 0,void 0,(function(){return L(this,(function(o){switch(o.label){case 0:return a.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?!h("messageIds",e,f.ARRAY,!0)||e.some((function(e){return!h("messageId",e,f.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return P(this,void 0,void 0,(function(){var o,a,i,s=this;return L(this,(function(c){return A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,f.NUMBER,!0)&&h("targetId",a,f.STRING,!0)&&h("timestamp",t,f.NUMBER,!0)&&h("cleanSpace",n,f.BOOLEAN)?[2,Ee((function(e,c){return P(s,void 0,void 0,(function(){var s;return L(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(c.warn(I.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("message",t,f.OBJECT,!0)&&h("options",n,f.OBJECT)&&h("options.isUnread",null==n?void 0:n.isUnread,f.BOOLEAN)&&h("options.searchContent",null==n?void 0:n.searchContent,f.STRING)&&(t instanceof zt||h("message.senderUserId",t.senderUserId,f.STRING,!0)&&h("message.messageType",t.messageType,f.STRING,!0)&&h("message.content",t.content,f.OBJECT,!0)&&h("message.messageDirection",t.messageDirection,f.NUMBER,!0)&&h("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN)&&h("message.expansion",t.expansion,f.OBJECT)&&h("message.disableNotification",t.disableNotification,f.BOOLEAN)&&h("message.sentTime",t.sentTime,f.NUMBER)&&h("message.sentStatus",t.sentStatus,f.NUMBER))?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,R,h,m,E,p,S;return L(this,(function(T){switch(T.label){case 0:return o="",s=1,f=!1,g=t.messageType,v=t.content,t instanceof zt||(o=t.senderUserId,s=t.messageDirection,f=t.canIncludeExpansion,l=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),i.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:R,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=T.sent(),p=E.code,S=E.data,p===r.SUCCESS?[2,{code:p,data:ue(S)}]:(i.warn(I.O,"insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:De[p]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("messageUId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(a,",messageUId:").concat(e)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("targetId",e,f.STRING,!0)&&h("messageUId",t,f.STRING,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(i,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return A()?[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,r;return L(this,(function(a){switch(a.label){case 0:return n.info(I.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=a.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}}),wo=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};export{zt as BaseMessage,en as CombineMessage,Uo as ConnectType,B as Events,tn as FileMessage,nn as GIFMessage,Xt as HQVoiceMessage,Wt as ImageMessage,rn as LocationMessage,wo as MentionedInfoBody,Po as MessageType,an as ReferenceMessage,sn as RichContentMessage,b as SentStatus,Qt as SightMessage,$t as TextMessage,on as VoiceMessage,Ue as __addSDKVersion,Oo as addConversationsToTag,pe as addEventListener,mo as addTag,Ft as addToBlacklist,Ht as bindRTCRoomForChatroom,We as clearAllMessagesUnreadStatus,Ne as clearEventListeners,to as clearHistoryMessages,vo as clearMessages,je as clearMessagesUnreadStatus,qe as clearTextMessageDraft,Ro as clearUnreadCountByTimestamp,Ge as connect,go as deleteLocalMessagesByTimestamp,eo as deleteMessages,Ce as destroy,xe as disconnect,Lo as electronExtension,Gt as forceRemoveChatRoomEntry,Dt as forceSetChatRoomEntry,Vt as getAllChatRoomEntries,ut as getAllConversationState,Tt as getAllUltraGroupUnreadCount,Ot as getAllUltraGroupUnreadMentionedCount,ct as getAllUnreadMentionedCount,qt as getBlacklist,Jt as getBlacklistStatus,ft as getBlockUltraGroupList,rt as getBlockedConversationList,xt as getChatRoomEntry,Pt as getChatRoomInfo,kt as getChatroomHistoryMessages,Ae as getConnectionStatus,ke as getConversation,Ve as getConversationList,nt as getConversationNotificationLevel,ot as getConversationNotificationStatus,Ao as getConversationsFromTagByPage,Me as getCurrentUserId,Pe as getDeviceId,Gn as getFileToken,xn as getFileUrl,so as getFirstUnreadMessage,zn as getHistoryMessages,uo as getMessage,ao as getMessageReader,Kn as getRemoteHistoryMessages,ye as getServerTime,So as getTags,To as getTagsFromConversation,Fe as getTextMessageDraft,it as getTopConversationList,Je as getTotalUnreadCount,ze as getTotalUnreadCountByLevels,Ke as getTotalUnreadMentionedCountByLevels,Et as getUltraGroupDefaultNotificationLevel,_t as getUltraGroupFirstUnreadMessageTimestamp,dt as getUltraGroupList,gt as getUltraGroupMessageListByMessageUId,St as getUltraGroupUnreadCountByTargetId,mt as getUltraGroupUnreadMentionedCountByTargetId,Nt as getUltraGroupUnreadMentionedMessages,Ye as getUnreadCount,yo as getUnreadCountByTag,st as getUnreadMentionedCount,fo as getUnreadMentionedMessages,_e as init,co as insertMessage,Le as installPlugin,yt as joinChatRoom,Mt as joinExistChatRoom,ht as modifyMessage,Se as onceEventListener,Ut as quitChatRoom,$n as recallMessage,io as registerMessageType,Rt as removeAllExpansionForUltraGroupMessage,bt as removeChatRoomEntries,Bt as removeChatRoomEntry,He as removeConversation,No as removeConversationsFromTag,Te as removeEventListener,Oe as removeEventListeners,It as removeExpansionForUltraGroupMessage,Zt as removeFromBlacklist,oo as removeMessageExpansionForKey,Eo as removeTag,Co as removeTagFromConversations,_o as removeTagsFromConversation,Ze as saveTextMessageDraft,Io as searchConversationByContent,lo as searchMessages,Fn as sendFileMessage,qn as sendHQVoiceMessage,Zn as sendImageMessage,Vn as sendMessage,Yn as sendReadReceiptMessage,jn as sendReadReceiptRequest,Wn as sendReadReceiptResponse,Xn as sendReadReceiptResponseV2,Jn as sendSightMessage,Qn as sendSyncReadStatusMessage,kn as sendTextMessage,ro as sendTypingStatusMessage,lt as sendUltraGroupTypingStatus,wt as setChatRoomEntries,Lt as setChatRoomEntry,$e as setConversationNotificationLevel,et as setConversationNotificationStatus,at as setConversationToTop,Mo as setConversationToTopInTag,ho as setMessageReceivedStatus,pt as setUltraGroupDefaultNotificationLevel,vt as updateExpansionForUltraGroupMessage,no as updateMessageExpansion,po as updateTag};
|
|
1
|
+
import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as r,ReceivedStatus as a,ConversationType as i,isNumber as s,EventEmitter as c,VersionManage as u,assert as d,AssertRules as f,isArray as l,isHttpUrl as g,APIContext as v,LogTagId as I,logger as R,validate as h,isValidConversationType as m,isValidNotificationLevel as E,NotificationLevel as p,UltraGroupChannelType as S,isString as T,getUUID as O,UploadMethod as N,isValidFileType as _,FileType as C,usingCppEngine as A,MessageDirection as y,isUndefined as M}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,ReceivedStatus,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var U=function(){return U=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},U.apply(this,arguments)};function P(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(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(i,s)}c((o=o.apply(e,t||[])).next())}))}function L(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}"function"==typeof SuppressedError&&SuppressedError;var w=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))},D=w();var B,b,G={tag:"browser",httpReq:function(e){var r=e.method||t.GET,a=e.timeout||n,i=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t,n=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(r,u),i&&n.setRequestHeader)for(var s in i)n.setRequestHeader(s,i[s]);if(o){n.timeout=a,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status||0})},n.ontimeout=function(){e({status:n.status||0})};var d="object"==typeof c?JSON.stringify(c):c;n.send(d)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status||0})},setTimeout((function(){n.abort(),e({status:n.status||0})}),a),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:D,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},x=w(),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)}}},k={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},H={tag:"wechat",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:k,sessionStorage:k,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{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.UNKONWN)}})}))}},F=w(),Z=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){}}},q={setItem:Z("setStorageSync"),getItem:Z("getStorageSync"),removeItem:Z("removeStorageSync"),clear:Z("clearStorageSync")},J={tag:"alipay",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:a,headers:s,timeout:i,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:q,sessionStorage:q,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},z=w(),K=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){}}},Y={setItem:K("setStorageSync"),getItem:K("getStorageSync"),removeItem:K("removeStorageSync"),clear:K("clearStorageSync")},j={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,localStorage:Y,sessionStorage:Y,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{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.UNKONWN)}})}))}},W=w(),X=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){}}},Q={setItem:X("setStorageSync"),getItem:X("getStorageSync"),removeItem:X("removeStorageSync"),clear:X("clearStorageSync")},$={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:W,localStorage:Q,sessionStorage:Q,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{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 P(this,void 0,void 0,(function(){return L(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},ee=w(),te=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)}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe={tag:"jingdong",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){jd.request({url:d,method:a,headers:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{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.UNKONWN)}})}))}},re=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)}}},ae={setItem:re("setStorageSync"),getItem:re("getStorageSync"),removeItem:re("removeStorageSync"),clear:re("clearStorageSync")},ie={tag:"uniapp",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ae,sessionStorage:ae,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{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.UNKONWN)}})}))}},se=function(e){return e&&e.request&&e.getSystemInfo},ce="undefined"!=typeof uni&&se(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ie;case"mp-jd":return oe;case"mp-baidu":return $;case"mp-toutiao":return j;case"mp-alipay":return J;case"mp-weixin":return H;default:return G}}():"undefined"!=typeof jd&&se(jd)?oe:"undefined"!=typeof my&&se(my)?J:"undefined"!=typeof tt&&se(tt)?j:"undefined"!=typeof swan&&se(swan)?$:"undefined"!=typeof wx&&se(wx)?H:G;function ue(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,p=e.disableNotification,S=e.isMentioned,T=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=a.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:S,disableNotification:p,isStatusMessage:T,canIncludeExpansion:h,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return t!==i.ULTRA_GROUP&&(U.isOffLineMessage=R),t===i.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function de(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,i=e.mentionedInfo,s=e.lastUnreadTime,c=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&ue(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:s,notificationStatus:c,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function fe(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED"}(B||(B={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(b||(b={}));var le=new c,ge={onConnecting:function(){le.emit(B.CONNECTING)},onConnected:function(){le.emit(B.CONNECTED)},onDisconnect:function(e){le.emit(B.DISCONNECT,e)},onSuspend:function(e){le.emit(B.SUSPEND,e)},batchMessage:function(e){le.emit(B.MESSAGES,{messages:e.map((function(e){return ue(e)}))})},typingState:function(e){le.emit(B.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){le.emit(B.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){le.emit(B.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){le.emit(B.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?ue(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===i.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));le.emit(B.CONVERSATION,{conversationList:t})},chatroomState:function(e){le.emit(B.CHATROOM,e)},expansion:function(e){le.emit(B.EXPANSION,e)},pullFinished:function(){le.emit(B.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){le.emit(B.TAG)},conversationTagChanged:function(){le.emit(B.CONVERSATION_TAG)},messageBlocked:function(e){le.emit(B.MESSAGE_BLOCKED,e)},messageDelivered:function(e){le.emit(B.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){le.emit(B.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){le.emit(B.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){le.emit(B.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){le.emit(B.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){le.emit(B.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){le.emit(B.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){le.emit(B.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){le.emit(B.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){le.emit(B.ULTRA_GROUP_CHANNEL_DELETE,e)}};u.add("imlib-next","5.6.2-alpha.1");var ve=null,Ie=null,Re=null;function he(){return P(this,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return ve?(Re.info(I.A_DESTROY_O),[4,v.destroy()]):[2];case 1:return e.sent(),Ie=null,ve=null,Re=null,[2]}}))}))}function me(e){if(!ve)throw new Error("Not initialized yet!");return e(ve,Re,Ie)}function Ee(e){return ve?e(ve,Re,Ie):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function pe(e,t,n){le.on(e,t,n)}function Se(e,t,n){le.once(e,t,n)}function Te(e,t,n){le.off(e,t,n)}function Oe(e){le.removeAll(e)}function Ne(){le.clear()}function _e(e){!function(e){var t=e.appkey,n=e.navigators;ve?Re.warn(I.A_INIT_REPEAT_O):(d("options.appkey",e.appkey,f.STRING,!0),d("options.navigators",e.navigators,(function(e){return l(e)&&(0===e.length||e.every(g))})),Ie=e,ve=v.init(ce,{appkey:e.appkey,apiVersion:"5.6.2-alpha.1",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(Re=ve.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Re.info(I.A_INIT_O,JSON.stringify({appkey:t,navigators:n,version:"5.6.2-alpha.1",commit:"321edb741e02b6bb78a735b1dea30910977ad77e"})),ve.assignWatcher(ge))}(e)}function Ce(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return ve?(Ne(),[2,he()]):[2]}))}))}function Ae(){return me((function(e){return e.getConnectionStatus()}))}function ye(){return me((function(e){return e.getServerTime()}))}function Me(){return me((function(e){return e.getCurrentUserId()}))}function Ue(e,t){u.add(e,t)}function Pe(){return me((function(e){return e.getDeviceId()}))}function Le(e,t){return me((function(n){return n.install(e,t)}))}var we={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:r.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:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},De={};for(var Be in we){var be=we[Be].code;De[be]=Be}function Ge(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return h("token",e,f.STRING,!0)&&h("reconnectKickEnable",t,f.BOOLEAN)?(n=a.createTraceId(),a.info(I.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!1,t,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return i=c.sent(),s=i.code===r.SUCCESS?"info":"warn",a[s](I.A_CONNECT_R,JSON.stringify({code:i.code,userId:i.userId}),n),i.code===r.SUCCESS?[2,{code:i.code,data:{userId:i.userId}}]:[2,{code:i.code,msg:De[i.code]}]}}))}))}))]}))}))}function xe(){return R.info(I.A_DISCONNECT_O,{}),me((function(e){return e.disconnect()}))}function Ve(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options.count",null==e?void 0:e.count,f.NUMBER)&&h("options.startTime",null==e?void 0:e.startTime,f.NUMBER)&&h("options.order",null==e?void 0:e.order,f.NUMBER)&&h("channelId",t,f.CHANNEL_ID)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return de(e)}))}]:(a.warn(I.O,"get conversation list fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),a=t.code,i=t.data,a!==r.SUCCESS?(o.warn(I.O,"getConversation ->code:".concat(a,", targetId:").concat(e.targetId)),[2,{code:a,msg:De[a]}]):[2,{code:a,data:i?de(i):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function He(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a;return L(this,(function(i){switch(i.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"destroy conversation ->".concat(a)),t!==r.SUCCESS?(o.warn(I.O,"destroy conversation fail ->".concat(t,":").concat(De[t],",").concat(a)),[2,{code:t,msg:De[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get draft ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i||""}]:(o.warn(I.O,"get draft fail ->".concat(a,":").concat(De[a],",").concat(s)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options",e,f.CONVERSATION,!0)&&h("draft",t,f.STRING,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())===r.SUCCESS?[2,{code:i}]:(a.warn(I.O,"set draft fail ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a;return L(this,(function(i){switch(i.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(a=i.sent())===r.SUCCESS?[2,{code:a}]:(o.warn(I.O,"delete draft fail ->".concat(a,":").concat(De[a],",").concat(t)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("includeMuted",e,f.BOOLEAN,!1)&&h("conversationTypes",t,f.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!h("conversationType",e,m)})))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return a.debug(I.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getTotalUnreadCount fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!h("conversationTypes",e,f.ARRAY,!0)||!h("levels",t,f.ARRAY,!0)||e.some((function(e){return!h("conversationType",e,m)}))||t.some((function(e){return!h("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getTotalUnreadCountByLevels fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]}))}))}function Ke(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!h("conversationTypes",e,f.ARRAY,!0)||!h("levels",t,f.ARRAY,!0)||e.some((function(e){return!h("conversationType",e,m)}))||t.some((function(e){return!h("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]}))}))}function Ye(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get unreadCount ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.O,"get unreadCount fail ->".concat(a,":").concat(De[a],",").concat(s)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a;return L(this,(function(i){switch(i.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"clear unreadMsgNum ->".concat(a)),t!==r.SUCCESS?(o.warn(I.O,"clear unreadMsgNum fail ->".concat(t,":").concat(De[t],",").concat(a)),[2,{code:t,msg:De[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function We(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}we.ROAMING_SERVICE_UNAVAILABLE.code;var Xe=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(I.O,"".concat(n," -> ").concat(o)),o},Qe=function(e,t,n,o){return void 0===o&&(o=""),P(void 0,void 0,void 0,(function(){var a,i;return L(this,(function(s){switch(s.label){case 0:return a=Xe(e,t,o),[4,n()];case 1:return(i=s.sent())!==r.SUCCESS?(e.warn(I.O,"".concat(o," fail -> ").concat(i," : ").concat(De[i]," , ").concat(a)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))};function $e(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return h("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return Qe(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function et(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return h("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return Qe(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t=Xe(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS?[2,{code:i,data:s}]:(o.warn(I.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(De[i]," , ").concat(t)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ot(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ee((function(e){return e.getBlockConversationList()}))]}))}))}function at(e,t){return void 0===t&&(t=!0),P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options",e,f.CONVERSATION,!0)&&h("isTop",t,f.BOOLEAN)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"set conversation status fail ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function it(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversationTypes",e,f.ARRAY)&&!(null==e?void 0:e.some((function(e){return!h("conversationType",e,m)})))&&h("channelId",t,f.CHANNEL_ID)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return de(e)}))}]:(a.warn(I.A_GET_TOP_CONVERSATION_LIST_E,"".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(e){return P(this,void 0,void 0,(function(){return L(this,(function(t){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(t,n){return n.debug(I.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ct(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ee((function(e,t){return t.debug(I.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function ut(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ee((function(e){return e.getAllConversationState()}))]}))}))}function dt(e){return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options.targetId",e.targetId,f.STRING,!1)&&h("options.channelType",e.channelType,(function(e){return void 0!==S[e]}),!1)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(o.warn(I.O,"get ultragroup ->".concat(a,":").concat(De[a])),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a;return L(this,(function(i){switch(i.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(I.O,"get block ultragroup ->".concat(o,":").concat(De[o])),[2,{code:o,msg:De[o]}])}}))}))}))]}))}))}function lt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(De[t])),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options",e,f.CONVERSATION,!0)&&h("msgs",t,f.ARRAY,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=e.targetId,i=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:i,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:return d=g.sent(),f=d.code,l=d.data,f===r.SUCCESS?[2,{code:r.SUCCESS,data:l}]:(a.warn(I.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(De[f])),[2,{code:f,msg:De[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("expansion",e,f.OBJECT,!0)&&h("message",t,f.OBJECT,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(I.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(I.O,"update expansion for ultragroup message ->".concat(g,":").concat(De[g])),[2,{code:g,msg:De[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("expansion",e,f.ARRAY,!0)&&h("message",t,f.OBJECT,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(I.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(I.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(De[g])),[2,{code:g,msg:De[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("message",e,f.OBJECT,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return t=e.conversationType,a=e.targetId,i=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(u,",messageUId:").concat(i),o.debug(I.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:a,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:i,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(De[l])),[2,{code:l,msg:De[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("content",e,f.OBJECT,!0)&&h("message",t,f.OBJECT,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v;return L(this,(function(R){switch(R.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(f,",messageUId:").concat(s),a.debug(I.O,"update ultragroup message expansion ->".concat(l)),g={targetId:i,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=R.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(I.O,"modify ultraGroup message ->".concat(v,":").concat(De[v])),[2,{code:v,msg:De[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!h("notificationLevel",e,E)})))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return a.debug(I.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(a.warn(I.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(i,":").concat(De[i])),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("options.targetId",e.targetId,f.STRING,!0)&&h("options.channelId",e.channelId,f.CHANNEL_ID)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s,c;return L(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(I.O,"".concat(t," -> ").concat(a)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(I.O,"".concat(t," fail -> ").concat(s," : ").concat(De[s]," , ").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,f.STRING,!0)&&h("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&h("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),a.debug(I.O,"".concat(n," -> ").concat(i)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(a.warn(I.O,"".concat(n," fail -> ").concat(s," : ").concat(De[s]," , ").concat(i)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!h("notificationLevel",e,E)})))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=d.sent(),s=i.code,c=i.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),a.debug(I.O,"".concat(n," -> ").concat(u)),s===r.SUCCESS?[2,{code:s,data:c}]:(a.warn(I.O,"".concat(n," fail -> ").concat(s,": ").concat(De[s],", ").concat(u)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a,i;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(I.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(I.O,"".concat(e," fail ->").concat(a,": ").concat(De[a])),[2,{code:a,msg:De[a]}])}}))}))}))]}))}))}function Ot(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a,i;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(I.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(I.O,"".concat(e," fail ->").concat(a,": ").concat(De[a])),[2,{code:a,msg:De[a]}])}}))}))}))]}))}))}function Nt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,f.STRING,!0)&&h("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&h("options.sentTime",e.sentTime,f.NUMBER,!0)&&h("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return t=e.targetId,a=e.channelId,i=e.sentTime,s=e.count,c={targetId:t,channelId:a,sentTime:i,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(I.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(De[d])),[2,{code:d,msg:De[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("conversation.targetId",e.targetId,f.STRING,!0)&&h("conversation.channelId",e.channelId,f.CHANNEL_ID,!0)?[2,Ee((function(n){return P(t,void 0,void 0,(function(){var t,o,a,i,s,c;return L(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:De[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Ct=function(e){return!!(h("options.key",e.key,f.STRING,!0)&&h("options.value",e.value,f.STRING,!0)&&h("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&h("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,f.STRING))},At=function(e){return h("options.key",e.key,f.STRING,!0)&&h("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,f.STRING)};function yt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.count",t.count,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:De[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.count",t.count,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:De[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("targetId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(I.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return a=s.sent(),i=a===r.SUCCESS?"info":"warn",o[i](I.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),t),a!==r.SUCCESS?[2,{code:a,msg:De[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.count",t.count,f.NUMBER)&&h("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(I.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(I.O,"get chatroom info fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&Ct(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"set chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&function(e){return e.entries.every((function(e){return h("entry.key",e.key,f.STRING,!0)&&h("entry.value",e.value,f.STRING,!0)}))&&h("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,f.STRING)&&h("options.isForce",e.isForce,f.BOOLEAN)}(t)?t.entries.length>10?[2,we.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s!==r.SUCCESS?(a.warn(I.O,"set chatroom entry fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&Ct(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(I.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"force set chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&At(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(I.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"remove chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&function(e){return e.entries.every((function(e){return h("key",e,f.STRING,!0)}))&&h("options.notificationExtra",e.notificationExtra,f.STRING)}(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.info(I.O,"remove chatroom entry->".concat(n)),(i=U({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,i)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==r.SUCCESS?(a.warn(I.O,"remove chatroom entry fail ->code+:".concat(De[c],",").concat(n)),[2,{code:c,msg:De[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&At(t)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.info(I.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"force remove chatroom entry fail ->code+:".concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("key",t,(function(e){return T(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(I.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(I.O,"get chatroom entry fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("targetId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(I.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS&&s?[2,{code:i,data:s}]:(o.warn(I.O,"get all chatroom entries fail ->code+:".concat(De[i],",").concat(t)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("targetId",e,f.STRING,!0)&&h("options.timestamp",t.timestamp,f.NUMBER)&&h("options.count",t.count,f.NUMBER)&&h("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.debug(I.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ue(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(a.warn(I.O,"get chatroom history message fail ->code+:".concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("option.chatRoomId",e.chatRoomId,f.STRING,!0)&&h("option.rtcRoomId",e.rtcRoomId,f.STRING,!0)?[2,Ee((function(n){return P(t,void 0,void 0,(function(){var t;return L(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:De[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("userId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("userId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a;return L(this,(function(i){switch(i.label){case 0:return n.info(I.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS&&a?[2,{code:o,data:a}]:(n.warn(I.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Jt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("userId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:0===i}]:(o.warn(I.O,"getBlacklistStatus fail -> code: ".concat(a,", userId: ").concat(e)),[2,{code:a}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var zt=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 Kt(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new zt(e,o,t,n)}}var Yt,jt,Wt=Kt("RC:ImgMsg"),Xt=Kt("RC:HQVCMsg"),Qt=Kt("RC:SightMsg"),$t=Kt("RC:TxtMsg"),en=Kt("RC:CombineMsg"),tn=Kt("RC:FileMsg"),nn=Kt("RC:GIFMsg"),on=Kt("RC:VcMsg"),rn=Kt("RC:LBSMsg"),an=Kt("RC:ReferenceMsg"),sn=Kt("RC:ImgTextMsg"),cn={qiniu:function(e,t,n,o){me((function(r){var a=r.getInfoFromCache();if(1===(null==a?void 0:a.type)&&t.chunk_size&&o.size>t.chunk_size){var i=O();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,hn(o,t,n)}else Rn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>dn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||jt;var a=new XMLHttpRequest,i=gn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=i+un[0][1]+r.bosUploadPath;un.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=t.uniqueValue,200===a.status){n.onCompleted(u,!0)}else un.length?cn[un[0][0]](e,t,n,o):n.onError("upload fail")},a.open(t.method,s,!0),a.setRequestHeader("authorization",c.bosToken),a.setRequestHeader("x-bce-date",c.bosDate),a.send(o)},aliyun:function(e,t,n,o){if(o.size>dn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var a=un[0][1];un.shift(),e=e||Yt,t=(t=t||{})||jt;var i=new XMLHttpRequest,s=gn(),c="".concat(s+t.ossBucketName,".").concat(a);i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var e=JSON.parse(i.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=N?N.ALI:"",200===i.status?n.onCompleted(e):un.length?cn[un[0][0]](r,t,n,o):n.onError("upload fail")}},i.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),i.send(e)},s3:function(e,t,n,o){var r=new FormData,a=new XMLHttpRequest,i=gn(),s=t.contentDisposition,c=un[0][1],u="".concat(i+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),un.shift(),a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=N.AWS,200===a.status||204===a.status)n.onCompleted(r);else if(un.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[un[0][0]](i,t,n,o)}else n.onError("upload fail")}},a.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),a.send(r)},stc:function(e,t,n,o){var r=new XMLHttpRequest,a=t.contentDisposition,i=un[0][1],s="https://".concat(i,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);un.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=N?N.STC:"",200===r.status||204===r.status)n.onCompleted(a);else if(un.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[un[0][0]](i,t,n,o)}else n.onError("upload fail")}},r.open("PUT",s,!0);var c=t?t.stcHeader:{};r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",c.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",c.stcContentSha256),r.setRequestHeader("x-amz-date",c.stcDate),r.send(o)}},un=[],dn={BOS_CHUNCK_SIZE:5368709120},fn="http://",ln="https://";function gn(){var e=ln;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=fn),e}var vn,In=(vn="RC-upload-",{get:function(e){e=vn+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=vn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=vn+e,localStorage.removeItem(e)}});function Rn(e,t,n,o){var r=ln+t.uploadHost.qiniu,a=(/http/.test(un[0][1])?"":gn())+un[0][1]||r;t.isChunk||un.shift();var i=new XMLHttpRequest;i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=N?N.QINIU:"",200===i.status||204===i.status?n.onCompleted(r):un.length?cn[un[0][0]](e,t,n,o):n.onError("upload fail")}},i.open(t.method,a,!0),n.onOpen(i),t.stream&&i.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(e)}function hn(e,t,n,o){var r=0,a=o||O(),i=In.get(a);i&&(e.uniqueName=i.sessionId,r=i.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var a=t.multi_parmas[r];o.append(r,a)}return o}(c,t,e.uniqueName),Rn(c,t,{onCompleted:function(o){r+=s;var i=e.uniqueName;In.set(a,{offset:r,sessionId:i}),r<e.size?hn(e,t,n,a):(r=0,In.remove(a),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var a=e+r;n.onProgress(a,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function mn(e,t,n,o){var r,a,i=t&&t.type||"text/plain",s=i.indexOf("image")>-1?1:4,c=n.contentDisposition,u=Math.ceil(t.size/n.stc_chunk_size),d=n&&JSON.parse(n.ossConfig?n.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(s,r,"POST",l).then((function(e){r=e.fileName,a="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",a);var s=new XMLHttpRequest;s.open("POST","".concat(a,"?").concat(l),!0),c?s.setRequestHeader("Content-Disposition","".concat(c,";")):s.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",i),s.send(),s.onreadystatechange=function(){if(4===s.readyState){var e=s.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===s.status||204===s.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(R(e,n));I(e,t)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var g=[],v=new Map;function I(c,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(c);if(v.size===u)e.getFileToken(s,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",c);var r=new XMLHttpRequest;r.open("POST","".concat(a,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i);var s="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){s+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),s+="</CompleteMultipartUpload>",r.send(s),console.log("xml",s),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:t.name,filename:n.uploadFileName,uploadMethod:N.STC};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var f=[],l=0,h=g;l<h.length;l++){var m=h[l];f.push(R(c,m))}I(c,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,r=g;n<r.length;n++){var a=r[n];t.push(R(c,a))}I(c,t)}))}function R(o,c){return new Promise((function(u,d){var f="partNumber=".concat(c,"&uploadId=").concat(o);e.getFileToken(s,r,"PUT",f).then((function(e){console.log("signature ".concat(c," onSuccess"),e);var o=t&&t.slice((c-1)*n.stc_chunk_size,c*n.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(a,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(c),e),v.set(c,e),u(e)}else g.includes(c)||g.push(c),d(c)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(c)||g.push(c),d(c)}))}))}}var En={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=pn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Sn(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=pn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Sn(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function pn(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Sn(e,t){for(var n in e)t(n,e[n])}var Tn,On=0,Nn=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:En.form,genUId:pn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Sn(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){Yt=n,jt=o,un=[];var a,i=e.getInfoFromCache();if(1===(null==i?void 0:i.type)&&t.uploadDomain)un=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var s,c,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(d=e[n]),"s3"===n&&(s=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&un.push(e)})),u.length!==un.length&&(un=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",s],["stc",c]])}else un=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),a=l.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&n.size>=4194304)mn(e,n,o,r);else{var g=o.data(n,o);cn[un[0][0]](g,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(Tn=e,n)?Tn=On+e/t*(t-On):On=Tn;o.onProgress(Tn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var _n,Cn,An={init:function(e){return new Nn(e)},dataType:En,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var i=a.width,s=a.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var a=e.height,i=t.maxHeight||0;if(i>0&&a>i){var s=i/a;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:i,height:s,size:e.total},t),u=r;c<1&&(u=function(e,t,n){o.width=t,o.height=n;var r=o.getContext("2d");return r.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(a,i*c,s*c)),n(u)}},Upload:Nn},yn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,i="string"==typeof e;a.onload=function(i){var s=function(e,t,n){var o,r,a,i=e<t,s=0,c=0;return(i?t/e:e/t)>n.scale?(i?(r=100,c=((a=t/(o=e/100))-n.maxHeight)/2):(a=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:a,x:-s,y:-c}):(i?(o=t/n.maxHeight,a=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,a=t/o),{w:r,h:a,x:-s,y:-c})}(a.width,a.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(a,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},a.src=i?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Mn=function(e,t){var n=e.file,o=e.compress;yn(n,o,t)},Un=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=An.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=An.init(e);t(n)}},Pn=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Mn;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},Ln=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){Pn(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),wn=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};Pn(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Dn={initFile:function(e,t){Un(e,(function(e){var n=new Ln(e);t(n)}))},initImage:function(e,t){Un(e,(function(n){var o,r,a,i,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},c=new wn(n,s);t(c)}))},dataType:An.dataType};function Bn(e,t,n,o,r,a,i){var s,c=this;void 0===r&&(r=C.FILE),s=r===C.IMAGE?C.IMAGE:C.FILE;var u=e.getInfoFromCache();if(!Cn&&(Cn="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Cn=d.qiniu)}catch(e){}var f=U({domain:Cn,getToken:function(t){e.getFileToken(s).then((function(e){t(e.token,e)})).catch((function(e){a.onFail(e)}))}},i);(s===C.IMAGE?Dn.initImage:Dn.initFile)(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=a.onProgress)||void 0===n||n.call(a,o)},onCompleted:function(e){return P(c,void 0,void 0,(function(){return L(this,(function(t){return 1===(null==u?void 0:u.type)?function(e,t,n,o,r,a){var i={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===C.AUDIO)return void bn(o).then((function(e){a.onSuccess(U(U({},i),e))}));t===C.IMAGE&&(i.thumbnail=r.thumbnail);a.onSuccess(i)}(n,r,0,o,e,a):function(e,t,n,o,r){Vn(t,o.filename,o.name,o,o.uploadMethod).then((function(a){if(0===a.code){var i=a.data;i.type=n.type,i.name=o.name||o.filename,e!==C.AUDIO?(t===C.IMAGE&&(i.thumbnail=o.thumbnail),r.onSuccess(i)):bn(n).then((function(e){r.onSuccess(U(U({},i),e))}))}else r.onFail(a)})).catch((function(e){r.onFail(e)}))}(r,s,o,e,a),[2]}))}))},onError:function(e){a.onFail(e)}})}))}function bn(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?Gn(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(Gn).then((function(e){t(e)}))}))}function Gn(e){return _n=_n||new AudioContext,new Promise((function(t,n){_n.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function xn(e,t,n,o){return Ee((function(a){return new Promise((function(i){a.getFileToken(e,t,n,o).then((function(e){i({code:r.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:De[e]})}))}))}))}function Vn(e,t,n,o,a){return h("fileType",e,_,!0)&&h("filename",t,f.STRING)&&h("saveName",n,f.STRING)&&h("serverType",a,f.NUMBER)?Ee((function(i){return new Promise((function(s){i.getFileUrl(e,t,n,o,a).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function kn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(s){return[2,Ee((function(s,c){return P(o,void 0,void 0,(function(){var o,u,d,l,g,v,R,m,E,p,S,T,O;return L(this,(function(N){switch(N.label){case 0:return n=n||{},t instanceof zt==!1?(c.warn(I.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,we.ILLGAL_PARAMS]):h("conversation",e,f.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,h("conversation.targetId",u,f.STRING,!0)&&h("conversation.conversationType",o,f.NUMBER,!0)&&h("conversation.channelId",d,f.CHANNEL_ID)&&h("options.isStatusMessage",null==n?void 0:n.isStatusMessage,f.BOOLEAN)&&h("options.disableNotification",null==n?void 0:n.disableNotification,f.BOOLEAN)&&h("options.pushContent",null==n?void 0:n.pushContent,f.STRING)&&h("options.pushData",null==n?void 0:n.pushData,f.STRING)&&h("options.isMentioned",null==n?void 0:n.isMentioned,f.BOOLEAN)&&h("options.mentionedType",null==n?void 0:n.mentionedType,f.NUMBER)&&h("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,f.ARRAY)&&h("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,f.ARRAY)&&h("options.isVoipPush",null==n?void 0:n.isVoipPush,f.BOOLEAN)&&h("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,f.BOOLEAN)&&h("options.expansion",null==n?void 0:n.expansion,f.OBJECT)&&h("options.pushConfig",null==n?void 0:n.pushConfig,f.OBJECT)&&h("options.messageId",null==n?void 0:n.messageId,f.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(I.O,"send message ->".concat(l)),g=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,a=e.pushContent,i=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=n.channelId;return U({isStatusMessage:o,disableNotification:r,pushContent:a,pushData:i,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:h||"",messageId:R},t)}(n,t,e),v={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:t.isPersited||!1,isCounted:t.isCounted||!1,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:y.SEND,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig},o!==i.ULTRA_GROUP&&(v.isOffLineMessage=!1),R=c.createTraceId(),m=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(ue(v))}catch(e){c.error(I.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),R)}},c.info(I.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),R),[4,s.sendMessage(o,u,g,m,R)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=N.sent(),p=E.code,S=E.data,T=p===r.SUCCESS?"info":"warn",c[T](I.A_SEND_MSG_R,JSON.stringify({code:p,messageUId:S?S.messageUId:"",messageId:S?S.messageId:""}),R),p===r.SUCCESS?(O=ue(S),[2,{code:p,data:O}]):(c.warn(I.O,"send message fail ->".concat(p,":").concat(De[p],",").concat(l)),v.sentTime=(null==S?void 0:S.sentTime)||0,[2,{code:p,msg:De[p],data:ue(v)}])}}))}))}))]}))}))}function Hn(e,t,n){return kn(e,new $t(t),n)}function Fn(e,t){return function(n,o,a,i){if(!h("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var c=null==i?void 0:i.thumbnailConfig;if(!(h("sendOptions.maxHeight",null==c?void 0:c.maxHeight,f.NUMBER)&&h("sendOptions.maxWidth",null==c?void 0:c.maxWidth,f.NUMBER)&&h("sendOptions.quality",null==c?void 0:c.quality,f.NUMBER)&&h("sendOptions.scale",null==c?void 0:c.scale,f.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ee((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(I.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Bn(c,0,d,o.file,e,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(e){var s,c=(null===(s=null==a?void 0:a.onComplete)||void 0===s?void 0:s.call(a,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&u.info(I.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),kn(n,c,i).then(f)},onFail:function(e){u.warn(I.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s)}))}))}}var Zn=Fn(C.FILE,(function(e,t){return new tn({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})),qn=Fn(C.IMAGE,(function(e,t){return new Wt({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),Jn=Fn(C.AUDIO,(function(e,t){return new Xt({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),zn=Fn(C.SIGHT,(function(e,t){return new Qt({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})}));function Kn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&h("options.count",null==t?void 0:t.count,f.NUMBER)&&h("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n=a.createTraceId(),a.info(I.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ue(e)})),a.info(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&h("options.count",null==t?void 0:t.count,f.NUMBER)&&h("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ue(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(I.O,"get history message fail ->".concat(s,":").concat(De[s],",").concat(n)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(s){return h("targetId",e,f.STRING,!0)&&h("messageUId",t,f.STRING,!0)&&h("timestamp",n,f.NUMBER,!0)&&h("channelId",o,f.CHANNEL_ID)?[2,Ee((function(r){return P(a,void 0,void 0,(function(){var r,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:i.PRIVATE,channelId:o},a=new zt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,kn(r,a)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("messageUId",t,f.STRING,!0)&&h("targetId",e,f.STRING,!0)&&h("channelId",n,f.CHANNEL_ID)?[2,Ee((function(r,a){return P(o,void 0,void 0,(function(){var o,r,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(I.O,"send read receipt message ->".concat(o)),r=new zt("RC:RRReqMsg",{messageUId:t}),[4,kn({targetId:e,conversationType:i.GROUP,channelId:n},r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xn(e,t,n){return P(this,void 0,void 0,(function(){return L(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Qn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("targetId",e,f.STRING,!0)&&h("messageList",t,f.OBJECT,!0)&&h("channelId",n,f.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!h(e,t[e],f.ARRAY)}))?[2,Ee((function(a,s){return P(o,void 0,void 0,(function(){var o,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:i.GROUP,channelId:n},u=a.getInfoFromCache(),0!==(d=(null==u?void 0:u.grpRRVer)||0)?[3,2]:(f=new zt("RC:RRRspMsg",{receiptMessageDic:t}),[4,kn(o,f)]);case 1:return c=v.sent(),[3,4];case 2:return 1!==d?[3,4]:(l=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,a.sendReadReceiptMessage(e,l,n)]:(s.warn(I.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:c=v.sent(),v.label=4;case 4:return(g=c.code)===r.SUCCESS?[2,{code:g}]:(s.warn(I.O,"send read receipt message fail ->".concat(g,":").concat(De[g])),[2,{code:g,msg:De[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $n(e,t){return P(this,void 0,void 0,(function(){var n,o,a,i;return L(this,(function(s){switch(s.label){case 0:return h("conversation",e,f.CONVERSATION,!0)&&h("lastMessageSendTime",t,f.NUMBER,!0)?(n=new zt("RC:SRSMsg",{lastMessageSendTime:t}),[4,kn(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),a=o.code,i=o.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))}function eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("options.messageUId",t.messageUId,f.STRING,!0)&&h("options.sentTime",t.sentTime,f.NUMBER,!0)&&h("options.disableNotification",null==t?void 0:t.disableNotification,f.BOOLEAN)&&h("options.pushConfig",null==t?void 0:t.pushConfig,f.OBJECT)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),a.debug(I.O,"recall message ->".concat(i)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS&&u?[2,{code:c,data:ue(u)}]:c===r.SUCCESS?[2,{code:c}]:(a.warn(I.O,"recall message fail ->".concat(c,":").concat(De[c],",").concat(i)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("options",t,(function(e){return l(e)&&e.length}),!0)&&!t.some((function(e){return!h("options.messageUId",e.messageUId,f.STRING,!0)||!h("options.sentTime",e.sentTime,f.NUMBER,!0)||!h("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"delete message fail ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function no(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("timestamp",t,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(I.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(I.O,"clear message ->".concat(i,":").concat(De[i],",").concat(n)),[2,{code:i,msg:De[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("expansion",e,f.OBJECT,!0)&&h("message",t,f.OBJECT,!0)&&h("message.conversationType",t.conversationType,f.NUMBER,!0)&&h("message.targetId",t.targetId,f.STRING,!0)&&h("message.channelId",t.channelId,f.CHANNEL_ID)&&h("message.messageUId",t.messageUId,f.STRING,!0)&&h("message.expansion",t.expansion,f.OBJECT)&&h("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(I.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(a.warn(I.O,"update message expansion fail ->".concat(l,":").concat(De[l],",").concat(f)),[2,{code:l,msg:De[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("keys",e,f.ARRAY,!0)&&h("message",t,f.OBJECT,!0)&&h("message.conversationType",t.conversationType,f.NUMBER,!0)&&h("message.targetId",t.targetId,f.STRING,!0)&&h("message.channelId",t.channelId,f.CHANNEL_ID)&&h("message.messageUId",t.messageUId,f.STRING,!0)&&h("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(I.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(a.warn(I.O,"remove message expansion fail ->".concat(f,":").concat(De[f],",").concat(d)),[2,{code:f,msg:De[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ao(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("typingContentType",t,f.STRING,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d;return L(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},i=a.createTraceId(),a.info(I.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),i),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,i)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",a[d](I.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),i),c===r.SUCCESS?[2,{code:c,data:ue(u)}]:[2,{code:c,msg:De[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function io(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("messageUId",t,f.STRING,!0)&&h("targetId",e,f.STRING,!0)&&h("channelId",n,f.CHANNEL_ID)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(I.O,"get message reader ->".concat(o)),[4,a.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(i.warn(I.O,"get message reader fail ->".concat(c,":").concat(De[c],",").concat(o)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,t,n,o,r){return me((function(a,i){return d("messageType",e,f.STRING,!0),d("isPersited",t,f.BOOLEAN,!0),d("isCounted",n,f.BOOLEAN,!0),d("isStatusMessage",r,f.BOOLEAN,!1),d("searchProps",o,f.ARRAY),i.info(I.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),a.registerMessageType(e,t,n,o,r),Kt(e,t,n)}))}function co(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.O,"insertMessage ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function uo(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return fe("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),A()?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,R,h,m,E,p,S,T;return L(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,R=t.sentStatus,i.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:R,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,E)];case 1:return p=O.sent(),S=p.code,T=p.data,S===r.SUCCESS?[2,{code:S,data:ue(T)}]:(i.warn(I.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:De[S]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function fo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("messageId",e,(function(e){return s(e)||T(e)}),!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:ue(i)}]:(o.warn(I.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function lo(e){if(!A())return{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,a=e.channelId;return h("conversation",e,f.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,a),i=[];return t&&t.length&&t.forEach((function(e){return i.push(ue(e))})),{code:r.SUCCESS,data:i}},ve?t(ve,Re,Ie):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function go(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return fe("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),A()?h("conversation",e,f.CONVERSATION,!0)&&h("keyword",t,f.STRING,!0)&&h("timestamp",n,f.NUMBER)&&h("count",o,f.NUMBER)?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u,d;return L(this,(function(f){switch(f.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return a=f.sent(),c=a.code,u=a.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(ue(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(I.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function vo(e,t,n){return P(this,void 0,void 0,(function(){var o,a,i,s=this;return L(this,(function(c){return fe("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,f.NUMBER,!0)&&h("targetId",a,f.STRING,!0)&&h("timestamp",t,f.NUMBER,!0)&&h("cleanSpace",n,f.BOOLEAN)?[2,Ee((function(c,u){return P(s,void 0,void 0,(function(){var s;return L(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return s=d.sent(),u.debug(I.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:a,channelId:i,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(I.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function Io(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return fe("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),A()?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function Ro(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return fe("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),A()?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u;return L(this,(function(d){switch(d.label){case 0:return s.info(I.O,"searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,n,o,t)];case 1:return a=d.sent(),c=a.code,u=a.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(I.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function ho(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("timestamp",t,f.NUMBER)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c;return L(this,(function(u){switch(u.label){case 0:return n=e.conversationType,i=e.targetId,s=e.channelId,a.info(I.O,"clearUnreadCountByTimestamp ->targetId:".concat(i,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,i,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(a.warn(I.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(i)),[2,{code:c,msg:De[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function mo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return fe("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),A()?h("messageId",e,f.NUMBER,!0)&&h("receivedStatus",t,f.NUMBER,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=i.sent())===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}function Eo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("tag.tagId",e.tagId,f.STRING,!0)&&h("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&h("tag.tagName",e.tagName,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return o.info(I.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("tagId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return o.info(I.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("tag.tagId",e.tagId,f.STRING,!0)&&h("tag.tagName",e.tagName,f.STRING,!0)&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(a){switch(a.label){case 0:return o.info(I.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:De[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,a;return L(this,(function(i){switch(i.label){case 0:return[4,t.getTagList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(I.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:De[o]}])}}))}))}))]}))}))}function Oo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return h("conversation",e,f.CONVERSATION,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:De[a]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!h("conversation",e,f.CONVERSATION,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!h("conversation",e,f.CONVERSATION,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("conversation",e,f.CONVERSATION,!0)&&h("tagIds",t,f.ARRAY,!0)&&!t.some((function(e){return!h("tagId",e,f.STRING,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!h("conversation",e,f.CONVERSATION,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return a.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:De[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("tagId",e,f.STRING,!0)&&h("count",t,f.NUMBER,!0)&&h("startTime",n,f.NUMBER,!0)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c;return L(this,(function(u){switch(u.label){case 0:return i.info(I.O,"getConversationListByTag ->tagId:".concat(e)),[4,a.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===r.SUCCESS?[2,{code:s,data:c}]:(i.warn(I.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return h("tagId",e,f.STRING,!0)&&h("containMuted",t,f.BOOLEAN,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return a.info(I.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.O,"getUnreadCountByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return h("tagId",e,f.STRING,!0)&&h("conversation",t,f.CONVERSATION,!0)&&h("status.isTop",n,f.BOOLEAN,!0)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o;return L(this,(function(s){switch(s.label){case 0:return i.info(I.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,a.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(i.warn(I.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:De[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Fn(C.COMBINE_HTML,(function(e,t){return new en({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Po={COMET:"comet",WEBSOCKET:"websocket"},Lo={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"};var wo=Object.freeze({__proto__:null,getAllConversationList:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("channelId",e,f.CHANNEL_ID)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return o.info(I.O,"getAllConversationList -> channelId: ".concat(e)),M(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return a=t.code,i=t.data,a===r.SUCCESS&&i?(s=i.map((function(e){return de(e)})),[2,{code:a,data:s}]):(o.warn(I.O,"getAllConversationList fail -> code: ".concat(a," channelId: ").concat(e)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return A()?h("startTime",e,f.NUMBER,!0)&&h("count",t,f.NUMBER,!0)&&h("channelId",n,f.CHANNEL_ID)?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),i.info(I.O,"getConversationList -> ".concat(o)),M(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return de(e)})),[2,{code:u,data:f}]):(i.warn(I.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:De[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return A()?h("keyword",t,f.STRING,!0)&&h("messageTypes",n,f.ARRAY,!0)&&h("channelId",o,f.CHANNEL_ID)&&!n.some((function(e){return!h("messageType",e,f.STRING,!0)}))?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return a="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(I.O,"searchConversationByContent -> ".concat(e)),M(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return de(e)})),[2,{code:u,data:f}]):(s.warn(I.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(a)),[2,{code:u,msg:De[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return L(this,(function(i){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("keyword",t,f.STRING,!0)&&h("startTime",n,f.NUMBER,!0)&&h("count",o,f.NUMBER,!0)?[2,Ee((function(i,s){return P(a,void 0,void 0,(function(){var a,c,u,d,f,l,g,v,R,h;return L(this,(function(m){switch(m.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(I.O,"searchMessages -> ".concat(a)),c=e.targetId,u=e.conversationType,d=e.channelId,M(d)?[4,i.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,R=g.count,h=v.map((function(e){return ue(e)})),[2,{code:l,data:{messages:h,count:R}}]):(s.warn(I.O,"searchMessages fail -> code: ".concat(l," ").concat(a)),[2,{code:l,msg:De[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("option",t,f.OBJECT,!0)&&h("option.keyword",t.keyword,f.STRING,!0)&&h("option.startTime",t.startTime,f.NUMBER,!0)&&h("option.endTime",t.endTime,f.NUMBER,!0)&&h("option.offset",t.offset,f.NUMBER)&&h("option.limit",t.limit,f.NUMBER)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,R;return L(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(I.O,"searchMessageInTimeRange -> ".concat(n)),i=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(i,s,c,u,d,f,l)];case 1:return g=h.sent(),v=g.code,R=g.data,v===r.SUCCESS&&R?[2,{code:v,data:{messages:R.messages.map((function(e){return ue(e)}))}}]:(a.warn(I.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("option",t,f.OBJECT,!0)&&h("option.count",t.count,f.NUMBER)&&h("option.timestamp",t.timestamp,f.NUMBER)&&h("option.order",t.order,(function(e){return[0,1].includes(e)}))&&h("option.messageTypes",t.messageTypes,f.ARRAY,!0)&&!t.messageTypes.some((function(e){return!h("option.messageType",e,f.STRING,!0)}))?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,R,h,m,E,p;return L(this,(function(S){switch(S.label){case 0:return n=t.count,i=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(I.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),i||(i=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,i,n,c,s,l)];case 1:return g=S.sent(),v=g.code,R=g.data,v===r.SUCCESS?(m=(h=R).list,E=h.hasMore,p=m.map((function(e){return ue(e)})),[2,{code:v,data:{messages:p,hasMore:E,list:p}}]):(a.warn(I.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:De[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("timestamp",t,f.NUMBER,!0)?[2,Ee((function(o,r){return P(n,void 0,void 0,(function(){var n,a,i,s;return L(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(I.O,"updateSentMsgReceiptStatus -> ".concat(n)),a=e.conversationType,i=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(a,i,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("messageId",e,f.NUMBER,!0)&&h("receivedStatus",t,(function(e){return!M(a[e])}),!0)?[2,Ee((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("messageId",e,f.NUMBER,!0)&&h("sentStatus",t,(function(e){return!M(b[e])}),!0)?[2,Ee((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return A()?h("messageId",e,f.NUMBER,!0)&&h("content",t,f.OBJECT,!0)&&h("messageType",n,f.ONLY_STRING,!0)?[2,Ee((function(r,a){return P(o,void 0,void 0,(function(){return L(this,(function(o){switch(o.label){case 0:return a.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?!h("messageIds",e,f.ARRAY,!0)||e.some((function(e){return!h("messageId",e,f.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return P(this,void 0,void 0,(function(){var o,a,i,s=this;return L(this,(function(c){return A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,f.NUMBER,!0)&&h("targetId",a,f.STRING,!0)&&h("timestamp",t,f.NUMBER,!0)&&h("cleanSpace",n,f.BOOLEAN)?[2,Ee((function(e,c){return P(s,void 0,void 0,(function(){var s;return L(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(c.warn(I.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:De[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(a){return A()?h("conversation",e,f.CONVERSATION,!0)&&h("message",t,f.OBJECT,!0)&&h("options",n,f.OBJECT)&&h("options.isUnread",null==n?void 0:n.isUnread,f.BOOLEAN)&&h("options.searchContent",null==n?void 0:n.searchContent,f.STRING)&&(t instanceof zt||h("message.senderUserId",t.senderUserId,f.STRING,!0)&&h("message.messageType",t.messageType,f.STRING,!0)&&h("message.content",t.content,f.OBJECT,!0)&&h("message.messageDirection",t.messageDirection,f.NUMBER,!0)&&h("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN)&&h("message.expansion",t.expansion,f.OBJECT)&&h("message.disableNotification",t.disableNotification,f.BOOLEAN)&&h("message.sentTime",t.sentTime,f.NUMBER)&&h("message.sentStatus",t.sentStatus,f.NUMBER))?[2,Ee((function(a,i){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,R,h,m,E,p,S;return L(this,(function(T){switch(T.label){case 0:return o="",s=1,f=!1,g=t.messageType,v=t.content,t instanceof zt||(o=t.senderUserId,s=t.messageDirection,f=t.canIncludeExpansion,l=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),i.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:R,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=T.sent(),p=E.code,S=E.data,p===r.SUCCESS?[2,{code:p,data:ue(S)}]:(i.warn(I.O,"insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:De[p]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?h("messageUId",e,f.STRING,!0)?[2,Ee((function(n,o){return P(t,void 0,void 0,(function(){var t,a,i;return L(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(I.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(a,",messageUId:").concat(e)),[2,{code:a,msg:De[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?h("targetId",e,f.STRING,!0)&&h("messageUId",t,f.STRING,!0)?[2,Ee((function(o,a){return P(n,void 0,void 0,(function(){var n,i,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(I.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(i,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:i,msg:De[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return A()?[2,Ee((function(t,n){return P(e,void 0,void 0,(function(){var e,o,r;return L(this,(function(a){switch(a.label){case 0:return n.info(I.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=a.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:De[r.NOT_SUPPORT]}]}))}))}}),Do=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};export{zt as BaseMessage,en as CombineMessage,Po as ConnectType,B as Events,tn as FileMessage,nn as GIFMessage,Xt as HQVoiceMessage,Wt as ImageMessage,rn as LocationMessage,Do as MentionedInfoBody,Lo as MessageType,an as ReferenceMessage,sn as RichContentMessage,b as SentStatus,Qt as SightMessage,$t as TextMessage,on as VoiceMessage,Ue as __addSDKVersion,No as addConversationsToTag,pe as addEventListener,Eo as addTag,Ft as addToBlacklist,Ht as bindRTCRoomForChatroom,We as clearAllMessagesUnreadStatus,Ne as clearEventListeners,no as clearHistoryMessages,Io as clearMessages,je as clearMessagesUnreadStatus,qe as clearTextMessageDraft,ho as clearUnreadCountByTimestamp,Ge as connect,vo as deleteLocalMessagesByTimestamp,to as deleteMessages,Ce as destroy,xe as disconnect,wo as electronExtension,Gt as forceRemoveChatRoomEntry,Dt as forceSetChatRoomEntry,Vt as getAllChatRoomEntries,ut as getAllConversationState,Tt as getAllUltraGroupUnreadCount,Ot as getAllUltraGroupUnreadMentionedCount,ct as getAllUnreadMentionedCount,qt as getBlacklist,Jt as getBlacklistStatus,ft as getBlockUltraGroupList,rt as getBlockedConversationList,xt as getChatRoomEntry,Pt as getChatRoomInfo,kt as getChatroomHistoryMessages,Ae as getConnectionStatus,ke as getConversation,Ve as getConversationList,nt as getConversationNotificationLevel,ot as getConversationNotificationStatus,yo as getConversationsFromTagByPage,Me as getCurrentUserId,Pe as getDeviceId,xn as getFileToken,Vn as getFileUrl,co as getFirstUnreadMessage,Kn as getHistoryMessages,fo as getMessage,io as getMessageReader,Yn as getRemoteHistoryMessages,ye as getServerTime,To as getTags,Oo as getTagsFromConversation,Fe as getTextMessageDraft,it as getTopConversationList,Je as getTotalUnreadCount,ze as getTotalUnreadCountByLevels,Ke as getTotalUnreadMentionedCountByLevels,Et as getUltraGroupDefaultNotificationLevel,_t as getUltraGroupFirstUnreadMessageTimestamp,dt as getUltraGroupList,gt as getUltraGroupMessageListByMessageUId,St as getUltraGroupUnreadCountByTargetId,mt as getUltraGroupUnreadMentionedCountByTargetId,Nt as getUltraGroupUnreadMentionedMessages,Ye as getUnreadCount,Mo as getUnreadCountByTag,st as getUnreadMentionedCount,lo as getUnreadMentionedMessages,_e as init,uo as insertMessage,Le as installPlugin,yt as joinChatRoom,Mt as joinExistChatRoom,ht as modifyMessage,Se as onceEventListener,Ut as quitChatRoom,eo as recallMessage,so as registerMessageType,Rt as removeAllExpansionForUltraGroupMessage,bt as removeChatRoomEntries,Bt as removeChatRoomEntry,He as removeConversation,_o as removeConversationsFromTag,Te as removeEventListener,Oe as removeEventListeners,It as removeExpansionForUltraGroupMessage,Zt as removeFromBlacklist,ro as removeMessageExpansionForKey,po as removeTag,Ao as removeTagFromConversations,Co as removeTagsFromConversation,Ze as saveTextMessageDraft,Ro as searchConversationByContent,go as searchMessages,Zn as sendFileMessage,Jn as sendHQVoiceMessage,qn as sendImageMessage,kn as sendMessage,jn as sendReadReceiptMessage,Wn as sendReadReceiptRequest,Xn as sendReadReceiptResponse,Qn as sendReadReceiptResponseV2,zn as sendSightMessage,$n as sendSyncReadStatusMessage,Hn as sendTextMessage,ao as sendTypingStatusMessage,lt as sendUltraGroupTypingStatus,wt as setChatRoomEntries,Lt as setChatRoomEntry,$e as setConversationNotificationLevel,et as setConversationNotificationStatus,at as setConversationToTop,Uo as setConversationToTopInTag,mo as setMessageReceivedStatus,pt as setUltraGroupDefaultNotificationLevel,vt as updateExpansionForUltraGroupMessage,oo as updateMessageExpansion,So as updateTag};
|