@rongcloud/imlib-next 5.5.6-beem → 5.5.7-beem
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 a,logger as r,LogTagId as i,Logger as c,ReceivedStatus as s,ConversationType as u,isNumber as d,EventEmitter as f,VersionManage as l,assert as g,isArray as v,isHttpUrl as I,APIContext as h,validate as R,AssertRules as m,isValidConversationType as p,isValidNotificationLevel as E,NotificationLevel as T,UltraGroupChannelType as S,isString as _,getUUID as C,UploadMethod as N,isValidFileType as A,FileType as y,usingCppEngine as O,MessageDirection as M,isUndefined as U}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,ReceivedStatus,UltraGroupChannelType,UploadMethod,reportLog}from"@rongcloud/engine";var L=function(){return L=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},L.apply(this,arguments)};function P(e,t,n,o){return new(n||(n=Promise))((function(a,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}s((o=o.apply(e,t||[])).next())}))}function w(e,t){var n,o,a,r,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,o=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){i.label=r[1];break}if(6===r[0]&&i.label<a[1]){i.label=a[1],a=r;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(r);break}a[2]&&i.ops.pop(),i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e],o=0}finally{n=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}}var D=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))},b=D();var B,G,x={tag:"browser",httpReq:function(e){var a=e.method||t.GET,r=e.timeout||n,i=e.headers,c=e.query,s=e.body,u=o(e.url,c);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(a,u),i&&n.setRequestHeader)for(var c in i)n.setRequestHeader(c,i[c]);if(o){n.timeout=r,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 s?JSON.stringify(s):s;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})}),r),n.send(s)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:b,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,a=n||o||e.UNKONWN;return new Promise((function(e){e(a)}))}},k=D(),H=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:o}),wx[e].apply(wx,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:o})}}},V={setItem:H("setStorageSync"),getItem:H("getStorageSync"),removeItem:H("removeStorageSync"),clear:H("clearStorageSync")},F={tag:"wechat",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){wx.request({url:d,method:r,header:c,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:V,sessionStorage:V,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:k,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)}})}))}},q=D(),Z=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{if(r.info(i.A_CALLBACK_O,{func_name:e,source:"alipay"},{traceId:o}),"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 a=my[e]({key:t[0]}).data;return a?JSON.stringify(a):a}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:o})}}},z={setItem:Z("setStorageSync"),getItem:Z("getStorageSync"),removeItem:Z("removeStorageSync"),clear:Z("clearStorageSync")},K={tag:"alipay",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,c=e.headers,s=e.query,u=e.body,d=o(e.url,s),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:r,headers:c,timeout:i,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:z,sessionStorage:z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:q,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)}})}))}},J=D(),Y=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:o}),tt[e].apply(tt,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:o})}}},W={setItem:Y("setStorageSync"),getItem:Y("getStorageSync"),removeItem:Y("removeStorageSync"),clear:Y("clearStorageSync")},X={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,localStorage:W,sessionStorage:W,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:a.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)}})}))}},j=D(),Q=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:o}),swan[e].apply(swan,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:o})}}},$={setItem:Q("setStorageSync"),getItem:Q("getStorageSync"),removeItem:Q("removeStorageSync"),clear:Q("clearStorageSync")},ee={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:$,sessionStorage:$,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:a.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 w(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)}})}))]}))}))}},te=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:o}),uni[e].apply(uni,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:o})}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe={tag:"uniapp",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){uni.request({url:d,method:r,header:c,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,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)}})}))}},ae=function(e){return e&&e.request&&e.getSystemInfo},re="undefined"!=typeof uni&&ae(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return oe;case"mp-baidu":return ee;case"mp-toutiao":return X;case"mp-alipay":return K;case"mp-weixin":return F;default:return x}}():"undefined"!=typeof my&&ae(my)?K:"undefined"!=typeof tt&&ae(tt)?X:"undefined"!=typeof swan&&ae(swan)?ee:"undefined"!=typeof wx&&ae(wx)?F:x,ie=new c("RCIM");function ce(e){var t=e.conversationType,n=e.channelId,o=e.messageType,a=e.content,r=e.senderUserId,i=e.targetId,c=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,p=e.receivedStatus,E=e.disableNotification,T=e.isMentioned,S=e.isStatusMessage,_=e.readReceiptInfo,C=e.pushConfig,N=e.messageId,A=e.isInterrupt,y=e.isModifyMessage,O=e.channelType,M=e.sentStatus;p||(p=s.UNREAD);var U={messageType:o,channelId:n||"",content:a,senderUserId:r,targetId:i,conversationType:t,sentTime:c,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:E,isStatusMessage:S,canIncludeExpansion:R,expansion:m,receivedStatus:p,readReceiptInfo:_,pushConfig:C,messageId:N,isInterrupt:A,isModifyMessage:y,sentStatus:M};return t!==u.ULTRA_GROUP&&(U.isOffLineMessage=h),t===u.ULTRA_GROUP&&d(O)&&(U.channelType=O),U}function se(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,a=e.unreadMessageCount,r=e.hasMentioned,i=e.mentionedInfo,c=e.lastUnreadTime,s=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&ce(o),unreadMessageCount:a,hasMentioned:r,mentionedInfo:r?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:s,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function ue(e,t){ie.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"}(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"}(G||(G={}));var de=new f,fe={onConnecting:function(){de.emit(B.CONNECTING)},onConnected:function(){de.emit(B.CONNECTED)},onDisconnect:function(e){r.info(i.A_CONNECT_S,{status:e},{traceId:r.ID()}),de.emit(B.DISCONNECT,e)},onSuspend:function(e){r.info(i.A_CONNECT_S,{status:e},{traceId:r.ID()}),de.emit(B.SUSPEND,e)},batchMessage:function(e){r.info(i.A_PULL_MSG_O,{messages:e.map((function(e){return e.messageUId}))}),de.emit(B.MESSAGES,{messages:e.map((function(e){return ce(e)}))})},typingState:function(e){de.emit(B.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){de.emit(B.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){de.emit(B.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){de.emit(B.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType;return t===u.ULTRA_GROUP?{conversation:{conversationType:t,latestMessage:e.latestMessage?ce(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,versionTime:e.versionTime,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId}}:{conversation:{conversationType:t,latestMessage:e.latestMessage?ce(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,hasMentioned:e.hasMentioned,mentionedInfo:e.mentionedInfo,lastUnreadTime:e.lastUnreadTime,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,isTop:e.isTop,channelId:e.channelId,unreadMentionedCount:e.unreadMentionedCount},updatedItems:e.updatedItems}}));de.emit(B.CONVERSATION,{conversationList:t})},chatroomState:function(e){de.emit(B.CHATROOM,e)},expansion:function(e){de.emit(B.EXPANSION,e)},pullFinished:function(){de.emit(B.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){de.emit(B.TAG)},conversationTagChanged:function(){de.emit(B.CONVERSATION_TAG)},messageBlocked:function(e){de.emit(B.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){de.emit(B.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){de.emit(B.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){de.emit(B.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){de.emit(B.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){de.emit(B.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){de.emit(B.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){de.emit(B.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){de.emit(B.ULTRA_GROUP_CHANNEL_DELETE,e)}};l.add("imlib-next","5.5.6-beem");var le=null,ge=null;function ve(){return!!le}function Ie(){return P(this,void 0,void 0,(function(){return w(this,(function(e){switch(e.label){case 0:return le?[4,h.destroy()]:[2];case 1:return e.sent(),ge=null,le=null,[2]}}))}))}function he(e){if(!le)throw new Error("Not initialized yet!");return e(le,ge)}function Re(e,t){return le?e(le,ge):(t&&r.warn(t.tagId,{code:a.BIZ_ERROR_CLIENT_NOT_INIT},{traceId:t.traceId}),Promise.resolve({code:a.BIZ_ERROR_CLIENT_NOT_INIT}))}function me(e,t,n){de.on(e,t,n)}function pe(e,t,n){de.once(e,t,n)}function Ee(e,t,n){de.off(e,t,n)}function Te(e){de.removeAll(e)}function Se(){de.clear()}function _e(e){var t=e.appkey,n=e.navigators;ve()?r.warn(i.A_INIT_REPEAT_O,{appkey:t,navigators:n,version:"5.5.6-beem",commit:"b6c03b686290c196848189732402b0d8a475cb7e"}):(r.info(i.A_INIT_O,{appkey:t,navigators:n,version:"5.5.6-beem",commit:"b6c03b686290c196848189732402b0d8a475cb7e"}),ie.setLogLevel(e.logLevel),ie.setLogStdout(e.logStdout),function(e){le||(g("options.navigators",e.navigators,(function(e){return v(e)&&(0===e.length||e.every(I))})),ge=e,(le=h.init(re,{appkey:e.appkey,apiVersion:"5.5.6-beem",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logLevel:e.logLevel,logStdout:e.logStdout,indexDBSwitch:e.indexDBSwitch,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess})).assignWatcher(fe))}(e))}function Ce(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return ve()?(r.info(i.A_DESTROY_O),Se(),[2,Ie()]):[2]}))}))}function Ne(){return he((function(e){return e.getConnectionStatus()}))}function Ae(){return he((function(e){return e.getServerTime()}))}function ye(){return he((function(e){return e.getCurrentUserId()}))}function Oe(e,t){l.add(e,t)}function Me(){return he((function(e){return e.getDeviceId()}))}function Ue(e,t){return he((function(n){return n.install(e,t)}))}var Le={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:a.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:a.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Pe={};for(var we in Le){var De=Le[we].code;Pe[De]=we}function be(e,t){return P(this,void 0,void 0,(function(){var n,o=this;return w(this,(function(c){return n=r.ID(),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o;return w(this,(function(s){switch(s.label){case 0:return R("token",e,m.STRING,!0)&&R("reconnectKickEnable",t,m.BOOLEAN)?(r.info(i.A_CONNECT_T,{token:e,reconnectKickEnable:t},{traceId:n}),[4,c.connect(e,!1,t,n)]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),(o.code===a.SUCCESS?r.info:r.warn)(i.A_CONNECT_R,{code:o.code,userId:o.userId},{traceId:n}),o.code===a.SUCCESS?[2,{code:o.code,data:{userId:o.userId}}]:[2,{code:o.code,msg:Pe[o.code]}]}}))}))}),{tagId:i.A_CONNECT_R,traceId:n})]}))}))}function Be(){return r.info(i.A_DISCONNECT_O,{}),he((function(e){return e.disconnect()}))}function Ge(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(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(),r=n.code,i=n.data,r===a.SUCCESS&&i?[2,{code:0,data:i.map((function(e){return se(e)}))}]:(ie.warn("get conversation list fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function xe(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=i.sent(),o=t.code,r=t.data,o!==a.SUCCESS?(ie.warn("getConversation ->code:".concat(o,", targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}]):[2,{code:o,data:r?se(r):null}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o;return w(this,(function(r){switch(r.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=r.sent(),o="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("destroy conversation ->".concat(o)),t!==a.SUCCESS?(ie.warn("destroy conversation fail ->".concat(t,":").concat(Pe[t],",").concat(o)),[2,{code:t,msg:Pe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function He(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),o=t.code,r=t.data,i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("get draft ->".concat(i)),o===a.SUCCESS?[2,{code:o,data:r||""}]:(ie.warn("get draft fail ->".concat(o,":").concat(Pe[o],",").concat(i)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ve(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)&&R("draft",t,m.STRING,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(r=i.sent())===a.SUCCESS?[2,{code:r}]:(ie.warn("set draft fail ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o;return w(this,(function(r){switch(r.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(o=r.sent())===a.SUCCESS?[2,{code:o}]:(ie.warn("delete draft fail ->".concat(o,":").concat(Pe[o],",").concat(t)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return ie.debug("get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),R("includeMuted",e,m.BOOLEAN,!1)&&R("conversationTypes",t,m.ARRAY,!1)&&!(null==t?void 0:t.every((function(e){return!R("conversationType",e,p)})))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getTotalUnreadCount fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return!R("conversationTypes",e,m.ARRAY,!0)||!R("levels",t,m.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,p)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getTotalUnreadCountByLevels fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return!R("conversationTypes",e,m.ARRAY,!0)||!R("levels",t,m.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,p)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getTotalUnreadMentionedCountByLevels fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function Ke(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),o=t.code,r=t.data,i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("get unreadCount ->".concat(i)),o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("get unreadCount fail ->".concat(o,":").concat(Pe[o],",").concat(i)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o;return w(this,(function(r){switch(r.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=r.sent(),o="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("clear unreadMsgNum ->".concat(o)),t!==a.SUCCESS?(ie.warn("clear unreadMsgNum fail ->".concat(t,":").concat(Pe[t],",").concat(o)),[2,{code:t,msg:Pe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){return w(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Le.ROAMING_SERVICE_UNAVAILABLE.code;var We=function(e){return!(!R("options.conversationType",e.conversationType,p,!0)||!R("options.targetId",e.targetId,m.STRING,!0)||!R("options.channelId",e.channelId,m.CHANNEL_ID))},Xe=function(e,t){void 0===t&&(t="");var n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId);return ie.debug("".concat(t," -> ").concat(n)),n},je=function(e,t,n){return void 0===n&&(n=""),P(void 0,void 0,void 0,(function(){var o,r;return w(this,(function(i){switch(i.label){case 0:return o=Xe(e,n),[4,t()];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("".concat(n," fail -> ").concat(r," : ").concat(Pe[r]," , ").concat(o)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))};function Qe(e,t){return P(this,void 0,void 0,(function(){return w(this,(function(n){return R("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)&&We(e)?[2,Re((function(n){return je(e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(e,t){return P(this,void 0,void 0,(function(){return w(this,(function(n){return R("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&We(e)?[2,Re((function(n){return je(e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function et(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return We(e)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t=Xe(e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return o=c.sent(),r=o.code,i=o.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getConversationNotificationLevel fail -> ".concat(r," : ").concat(Pe[r]," , ").concat(t)),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return ie.info("getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("getConversationNotificationStatus ->code:".concat(o,",targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ot(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return[2,Re((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 w(this,(function(o){return R("options.type",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("set conversation status fail ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return[2,Re((function(e){return e.getTopConversationList()}))]}))}))}function it(e){return P(this,void 0,void 0,(function(){return w(this,(function(t){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?(ie.debug("getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),[2,Re((function(t){return t.getUnreadMentionedCount(e)}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ct(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return ie.debug("getAllUnreadMentionedCount"),[2,Re((function(e){return e.getAllUnreadMentionedCount()}))]}))}))}function st(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return[2,Re((function(e){return e.getAllConversationState()}))]}))}))}function ut(e){return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.targetId",e.targetId,m.STRING,!1)&&R("options.channelType",e.channelType,(function(e){return void 0!==S[e]}),!1)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:a.SUCCESS,data:r}]:(ie.warn("get ultragroup ->".concat(o,":").concat(Pe[o])),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(r){switch(r.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=r.sent(),n=e.code,o=e.data,n===a.SUCCESS?[2,{code:a.SUCCESS,data:o}]:(ie.warn("get block ultragroup ->".concat(n,":").concat(Pe[n])),[2,{code:n,msg:Pe[n]}])}}))}))}))]}))}))}function ft(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)&&R("options.conversationType",e.conversationType,p,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("send ultraGroup OperateStatus ->".concat(t,":").concat(Pe[t])),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)&&R("options.conversationType",e.conversationType,p,!0)&&R("msgs",t,m.ARRAY,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f;return w(this,(function(l){switch(l.label){case 0:return n=e.targetId,r=e.conversationType,i=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:i})})),s={targetId:n,conversationType:r,messages:c},[4,o.getUltraGroupMessageListByMessageUId(s)];case 1:return u=l.sent(),d=u.code,f=u.data,d===a.SUCCESS?[2,{code:a.SUCCESS,data:f}]:(ie.warn("get UltraGroup MessageList by messageUId ->".concat(d,":").concat(Pe[d])),[2,{code:d,msg:Pe[d]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("expansion",e,m.OBJECT,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l;return w(this,(function(g){switch(g.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,s=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),ie.debug("update expansion for ultragroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:s,messageUId:i,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(l=g.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("update expansion for ultragroup message ->".concat(l,":").concat(Pe[l])),[2,{code:l,msg:Pe[l]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("expansion",e,m.ARRAY,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l;return w(this,(function(g){switch(g.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,s=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),ie.debug("remove expansion for ultragroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:s,messageUId:i,keys:e},[4,o.expandUltraMessage(f)];case 1:return(l=g.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("remove expansion for ultraGroup message ->".concat(l,":").concat(Pe[l])),[2,{code:l,msg:Pe[l]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("message",e,m.OBJECT,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c,s,u,d,f;return w(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,r=e.messageUId,i=e.sentTime,c=e.canIncludeExpansion,s=e.channelId,u="conversationType:".concat(t,",targetId:").concat(o,",channelId:").concat(s,",messageUId:").concat(r),ie.debug("remove all expansion for ultraGroup message ->".concat(u)),d={targetId:o,channelId:s,conversationType:t,sendTime:i,canIncludeExpansion:c,messageUId:r,removeAll:!0},[4,n.expandUltraMessage(d)];case 1:return(f=l.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("remove all expansion for ultraGroup message ->".concat(f,":").concat(Pe[f])),[2,{code:f,msg:Pe[f]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("content",e,m.OBJECT,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l,g;return w(this,(function(v){switch(v.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.senderUserId,s=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(d,",messageUId:").concat(i),ie.debug("update ultragroup message expansion ->".concat(f)),l={targetId:r,channelId:d,conversationType:n,fromUserId:c,sendTime:s,canIncludeExpansion:u,messageUId:i,content:e},[4,o.modifyMessage(l)];case 1:return(g=v.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("modify ultraGroup message ->".concat(g,":").concat(Pe[g])),[2,{code:g,msg:Pe[g]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&R("notificationLevels",t,m.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?(ie.debug("get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:a.SUCCESS,data:i}]:(ie.warn("get UltraGroup unreadMentionedCount by targetId error ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c;return w(this,(function(s){switch(s.label){case 0:return t="getUltraGroupDefaultNotificationLevel",o="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),ie.debug("".concat(t," -> ").concat(o)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return r=s.sent(),i=r.code,c=r.data,i===a.SUCCESS?[2,{code:i,data:c}]:(ie.warn("".concat(t," fail -> ").concat(i," : ").concat(Pe[i]," , ").concat(o)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.ONLY_STRING,!0)&&R("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),ie.debug("".concat(n," -> ").concat(r)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(i=c.sent().code)===a.SUCCESS?[2,{code:i}]:(ie.warn("".concat(n," fail -> ").concat(i," : ").concat(Pe[i]," , ").concat(r)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&R("notificationLevels",t,m.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return r=u.sent(),i=r.code,c=r.data,s="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),ie.debug("".concat(n," -> ").concat(s)),i===a.SUCCESS?[2,{code:i,data:c}]:(ie.warn("".concat(n," fail -> ").concat(i,": ").concat(Pe[i],", ").concat(s)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o,r;return w(this,(function(i){switch(i.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return n=i.sent(),o=n.code,r=n.data,ie.debug(e),o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("".concat(e," fail ->").concat(o,": ").concat(Pe[o])),[2,{code:o,msg:Pe[o]}])}}))}))}))]}))}))}function St(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o,r;return w(this,(function(i){switch(i.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return n=i.sent(),o=n.code,r=n.data,ie.debug(e),o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("".concat(e," fail ->").concat(o,": ").concat(Pe[o])),[2,{code:o,msg:Pe[o]}])}}))}))}))]}))}))}function _t(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.ONLY_STRING,!0)&&R("options.sentTime",e.sentTime,m.NUMBER,!0)&&R("options.count",e.count,(function(e){return d(e)&&e>0&&e<=50}),!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return t=e.targetId,o=e.channelId,r=e.sentTime,i=e.count,c={targetId:t,channelId:o,sentTime:r,count:i},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return s=f.sent(),u=s.code,d=s.data,u===a.SUCCESS?[2,{code:u,data:d}]:(ie.warn("getUltraGroupUnreadMentionedMessages fail ->".concat(u,": ").concat(Pe[u])),[2,{code:u,msg:Pe[u]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("conversation.targetId",e.targetId,m.STRING,!0)&&R("conversation.channelId",e.channelId,m.ONLY_STRING,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return i=u.sent(),c=i.code,s=i.data,c===a.SUCCESS?[2,{code:c,data:s}]:[2,{code:c,msg:Pe[c]}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Nt=function(e){return!!(R("options.key",e.key,m.STRING,!0)&&R("options.value",e.value,m.STRING,!0)&&R("options.isAutoDelete",e.isAutoDelete,m.BOOLEAN)&&R("options.isSendNotification",e.isSendNotification,m.BOOLEAN)&&R("options.notificationExtra",e.notificationExtra,m.STRING))},At=function(e){return!(!R("options.key",e.key,m.STRING,!0)||!R("options.isSendNotification",e.isSendNotification,m.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,m.STRING))};function yt(e,t){return P(this,void 0,void 0,(function(){var n,o=this;return w(this,(function(c){return R("options.count",t.count,m.NUMBER,!0)?(n=r.ID(),r.info(i.A_JOIN_CHATROOM_T,{chatroomId:e,count:t.count,joinExist:!1},{traceId:n}),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o;return w(this,(function(s){switch(s.label){case 0:return[4,c.joinChatroom(e,t.count,n)];case 1:return o=s.sent(),(o===a.SUCCESS?r.info:r.warn)(i.A_JOIN_CHATROOM_R,{code:o,timestamp:(new Date).getTime()},{traceId:n}),o!==a.SUCCESS?[2,{code:o,msg:Pe[o]}]:[2,{code:o}]}}))}))}),{tagId:i.A_JOIN_CHATROOM_R,traceId:n})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ot(e,t){return P(this,void 0,void 0,(function(){var n,o=this;return w(this,(function(c){return R("options.count",t.count,m.NUMBER,!0)?(n=r.ID(),r.info(i.A_JOIN_CHATROOM_T,{chatroomId:e,count:t.count,joinExist:!0},{traceId:n}),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o;return w(this,(function(s){switch(s.label){case 0:return[4,c.joinExistChatroom(e,t.count,n)];case 1:return o=s.sent(),(o===a.SUCCESS?r.info:r.warn)(i.A_JOIN_CHATROOM_R,{code:o,timestamp:(new Date).getTime()},{traceId:n}),o!==a.SUCCESS?[2,{code:o,msg:Pe[o]}]:[2,{code:o}]}}))}))}),{traceId:n,tagId:i.A_JOIN_CHATROOM_R})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return P(this,void 0,void 0,(function(){var t,n=this;return w(this,(function(o){return t=r.ID(),r.info(i.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:t}),[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(c){switch(c.label){case 0:return[4,o.quitChatroom(e)];case 1:return n=c.sent(),(n===a.SUCCESS?r.info:r.warn)(i.A_QUIT_CHATROOM_R,{code:n},{traceId:t}),n!==a.SUCCESS?[2,{code:n,msg:Pe[n]}]:[2,{code:n}]}}))}))}),{tagId:i.A_QUIT_CHATROOM_R,traceId:t})]}))}))}function Ut(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.count",t.count,m.NUMBER)&&R("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),ie.debug("get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return r=s.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?[2,{code:i,data:c}]:(ie.warn("get chatroom info fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&Nt(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.debug("set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("set chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("entry.key",e.key,m.STRING,!0)||!R("entry.value",e.value,m.STRING,!0)}))||!R("options.isAutoDelete",e.isAutoDelete,m.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,m.STRING)||!R("options.isForce",e.isForce,m.BOOLEAN))}(t)?t.entries.length>10?[2,Le.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),ie.debug("set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return r=s.sent(),i=r.code,c=r.data,i!==a.SUCCESS?(ie.warn("set chatroom entry fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i],data:c}]):[2,{code:i}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&Nt(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.debug("force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("force set chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&At(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.debug("remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("remove chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("key",e,m.STRING,!0)}))||!R("options.notificationExtra",e.notificationExtra,m.STRING))}(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),ie.info("remove chatroom entry->".concat(n)),(r=L({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,r)];case 1:return i=u.sent(),c=i.code,s=i.data,c!==a.SUCCESS?(ie.warn("remove chatroom entry fail ->code+:".concat(Pe[c],",").concat(n)),[2,{code:c,msg:Pe[c],data:s}]):[2,{code:c}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&At(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.info("force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("force remove chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),ie.debug("get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return r=s.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?[2,{code:i,data:c}]:(ie.warn("get chatroom entry fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),ie.debug("get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return o=c.sent(),r=o.code,i=o.data,r===a.SUCCESS&&i?[2,{code:r,data:i}]:(ie.warn("get all chatroom entries fail ->code+:".concat(Pe[r],",").concat(t)),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function kt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.timestamp",t.timestamp,m.NUMBER)&&R("options.count",t.count,m.NUMBER)&&R("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),ie.debug("get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return r=u.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?(s=c.list.map((function(e){return ce(e)})),[2,{code:i,data:{list:s,hasMore:!!c.hasMore}}]):(ie.warn("get chatroom history message fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Pe[t]}]}}))}))}))]}))}))}function Vt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("userId",e,m.STRING,!0)?(ie.info("addToBlacklist -> userId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("userId",e,m.STRING,!0)?(ie.info("removeFromBlacklist -> userId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return ie.info("getBlacklist -> "),[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(r){switch(r.label){case 0:return[4,t.getBlacklist()];case 1:return e=r.sent(),n=e.code,o=e.data,n===a.SUCCESS&&o?[2,{code:n,data:o}]:(ie.warn("getBlacklist fail -> code: ".concat(n)),[2,{code:n}])}}))}))}))]}))}))}function Zt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("userId",e,m.STRING,!0)?(ie.info("getBlacklistStatus -> userId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getBlacklistStatus(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:0===r}]:(ie.warn("getBlacklistStatus fail -> code: ".concat(o,", userId: ").concat(e)),[2,{code:o}])}}))}))}))]):[2,{code:a.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 Jt,Yt,Wt=Kt("RC:ImgMsg"),Xt=Kt("RC:HQVCMsg"),jt=Kt("RC:SightMsg"),Qt=Kt("RC:TxtMsg"),$t=Kt("RC:CombineMsg"),en=Kt("RC:FileMsg"),tn=Kt("RC:GIFMsg"),nn=Kt("RC:VcMsg"),on=Kt("RC:LBSMsg"),an=Kt("RC:ReferenceMsg"),rn=Kt("RC:ImgTextMsg"),cn={qiniu:function(e,t,n,o){he((function(a){var r=a.getInfoFromCache();if(1===(null==r?void 0:r.type)&&t.chunk_size&&o.size>t.chunk_size){var i=C();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,vn(o,t,n)}else gn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>un)throw new Error("the file size is over 5GB!");var a=t||{};t=t||Yt;var r=new XMLHttpRequest,i=dn();if(!a.uploadHost.bos&&!a.bosUploadPath)return;var c=i+sn[0][1]+a.bosUploadPath;sn.shift();var s=a.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:c,isBosRes:!0};r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});r.onreadystatechange=function(){if(4===r.readyState)if(JSON.parse(r.responseText||"{}").filename=t.uniqueValue,200===r.status){n.onCompleted(u,!0)}else sn.length?cn[sn[0][0]](e,t,n,o):n.onError("upload fail")},r.open(t.method,c,!0),r.setRequestHeader("authorization",s.bosToken),r.setRequestHeader("x-bce-date",s.bosDate),r.send(o)},aliyun:function(e,t,n,o){if(o.size>un)throw new Error("the file size is over 5GB!");var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token"));var r=sn[0][1];sn.shift(),e=e||Jt,t=(t=t||{})||Yt;var i=new XMLHttpRequest,c=dn(),s="".concat(c+t.ossBucketName,".").concat(r);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):sn.length?cn[sn[0][0]](a,t,n,o):n.onError("upload fail")}},i.open(t.method,s,!0),console.log("ali:url",s);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 a=new FormData,r=new XMLHttpRequest,i=dn(),c=t.contentDisposition,s=sn[0][1],u="".concat(i+t.s3BucketName,".").concat(s);console.log("uploadS3:url",u),sn.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.AWS,200===r.status||204===r.status)n.onCompleted(a);else if(sn.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[sn[0][0]](i,t,n,o)}else n.onError("upload fail")}},r.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;c?a.set("Content-Disposition","".concat(c,";")):a.set("Content-Disposition","text/html"===f?"inline;":"attachment;");a.set("Content-Type",f),a.set("x-amz-credential",d.s3Credential),a.set("x-amz-algorithm",d.s3Algorithm),a.set("x-amz-date",d.s3Date),a.set("policy",d.s3Policy),a.set("x-amz-signature",d.s3Signature),a.set("key",t.uploadFileName),a.set("file",o),r.send(a)},stc:function(e,t,n,o){var a=new XMLHttpRequest,r=t.contentDisposition,i=sn[0][1],c="https://".concat(i,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);sn.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?N.STC:"",200===a.status||204===a.status)n.onCompleted(r);else if(sn.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[sn[0][0]](i,t,n,o)}else n.onError("upload fail")}},a.open("PUT",c,!0);var s=t?t.stcHeader:{};a.setRequestHeader("Content-Type",o.type),r?a.setRequestHeader("Content-Disposition","".concat(r,";")):a.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");a.setRequestHeader("Authorization",s.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",s.stcContentSha256),a.setRequestHeader("x-amz-date",s.stcDate),a.send(o)}},sn=[],un=5368709120;function dn(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var fn,ln=(fn="RC-upload-",{get:function(e){e=fn+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=fn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=fn+e,localStorage.removeItem(e)}});function gn(e,t,n,o){var a="https://"+t.uploadHost.qiniu,r=(/http/.test(sn[0][1])?"":dn())+sn[0][1]||a;t.isChunk||sn.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 a=JSON.parse(i.responseText||"{}");a.filename=t.uniqueValue,a.uploadMethod=N?N.QINIU:"",200===i.status||204===i.status?n.onCompleted(a):sn.length?cn[sn[0][0]](e,t,n,o):n.onError("upload fail")}},i.open(t.method,r,!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 vn(e,t,n,o){var a=0,r=o||C(),i=ln.get(r);i&&(e.uniqueName=i.sessionId,a=i.offset);var c=Math.min(t.chunk_size,e.size-a),s=e.slice(a,a+c),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(a,"-").concat(a+c);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,s.name=e.name,s=function(e,t,n){var o=new FormData;for(var a in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var r=t.multi_parmas[a];o.append(a,r)}return o}(s,t,e.uniqueName),gn(s,t,{onCompleted:function(o){a+=c;var i=e.uniqueName;ln.set(r,{offset:a,sessionId:i}),a<e.size?vn(e,t,n,r):(a=0,ln.remove(r),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var r=e+a;n.onProgress(r,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function In(e,t,n,o){var a,r,i=t&&t.type||"text/plain",c=i.indexOf("image")>-1?1:4,s=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(c,a,"POST",l).then((function(e){a=e.fileName,r="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(a),console.log("uploadStcMultipart:url",r);var c=new XMLHttpRequest;c.open("POST","".concat(r,"?").concat(l),!0),s?c.setRequestHeader("Content-Disposition","".concat(s,";")):c.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),c.setRequestHeader("Authorization",e&&e.stcAuthorization),c.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),c.setRequestHeader("x-amz-date",e&&e.stcDate),c.setRequestHeader("Content-Type",i),c.send(),c.onreadystatechange=function(){if(4===c.readyState){var e=c.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===c.status||204===c.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(h(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(s,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(s);if(v.size===u)e.getFileToken(c,a,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",s);var a=new XMLHttpRequest;a.open("POST","".concat(r,"?").concat(d),!0),a.setRequestHeader("Authorization",e&&e.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),a.setRequestHeader("x-amz-date",e&&e.stcDate),a.setRequestHeader("Content-Type",i);var c="<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){c+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",a.send(c),console.log("xml",c),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.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,R=g;l<R.length;l++){var m=R[l];f.push(h(s,m))}I(s,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,a=g;n<a.length;n++){var r=a[n];t.push(h(s,r))}I(s,t)}))}function h(o,s){return new Promise((function(u,d){var f="partNumber=".concat(s,"&uploadId=").concat(o);e.getFileToken(c,a,"PUT",f).then((function(e){console.log("signature ".concat(s," onSuccess"),e);var o=t&&t.slice((s-1)*n.stc_chunk_size,s*n.stc_chunk_size);console.log("fileChunk:size",o.size);var a=new XMLHttpRequest;a.open("PUT","".concat(r,"?").concat(f),!0),a.setRequestHeader("Authorization",e&&e.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),a.setRequestHeader("x-amz-date",e&&e.stcDate),a.setRequestHeader("Content-Type",i),a.send(o),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.status){var e=a.getResponseHeader("etag");console.log("etag:".concat(s),e),v.set(s,e),u(e)}else g.includes(s)||g.push(s),d(s)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(s)||g.push(s),d(s)}))}))}}var hn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),a=Rn()+o;n.append(t.unique_key,a),t.uniqueValue=a}return n.append(t.file_data_name,e),mn(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(".")),a=Rn()+o;n[t.unique_key]=a,t.uniqueValue=a}return n[t.file_data_name]=e,mn(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Rn(){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 mn(e,t){for(var n in e)t(n,e[n])}var pn,En=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:Rn};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;mn(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var a=this;!function(e,t,n,o,a){Jt=n,Yt=o,sn=[];var r,i=e.getInfoFromCache();if(1===(null==i?void 0:i.type)&&t.uploadDomain)sn=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var c,s,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&&(c=e[n]),"stc"===n&&(s=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&sn.push(e)})),u.length!==sn.length&&(sn=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",c],["stc",s]])}else sn=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),r=l.find((function(e){return Object.keys(e).includes("stc")}))}if(r&&1===parseInt(r.p,10)&&n.size>=4194304)In(e,n,o,a);else{var g=o.data(n,o);cn[sn[0][0]](g,o,a,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(pn=e,n)?pn=En+e/t*(t-En):En=pn;o.onProgress(pn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){a.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 Sn,_n,Cn={init:function(e){return new Tn(e)},dataType:hn,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),a=new FileReader;a.readAsDataURL(e),a.onload=function(e){var a=e.target.result,r=new Image;r.src=a;var i=r.width,c=r.height,s=function(e,t){var n=1,o=e.width,a=t.maxWidth||0;a>0&&o>a&&(n=a/o);var r=e.height,i=t.maxHeight||0;if(i>0&&r>i){var c=i/r;n=Math.min(n,c)}var s=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>s){var d=s/u;n=Math.min(n,d)}return n}({width:i,height:c,size:e.total},t),u=a;s<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")}(r,i*s,c*s)),n(u)}},Upload:Tn},Nn=function(e,t,n){var o=document.createElement("canvas"),a=o.getContext("2d"),r=new Image,i="string"==typeof e;r.onload=function(i){var c=function(e,t,n){var o,a,r,i=e<t,c=0,s=0;return(i?t/e:e/t)>n.scale?(i?(a=100,s=((r=t/(o=e/100))-n.maxHeight)/2):(r=100,c=((a=e/(o=t/100))-n.maxWidth)/2),{w:a,h:r,x:-c,y:-s}):(i?(o=t/n.maxHeight,r=n.maxHeight,a=e/o):(o=e/n.maxWidth,a=n.maxWidth,r=t/o),{w:a,h:r,x:-c,y:-s})}(r.width,r.height,t);o.width=c.w>t.maxWidth?t.maxWidth:c.w,o.height=c.h>t.maxHeight?t.maxHeight:c.h,a.drawImage(r,c.x,c.y,c.w,c.h);var s=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);s=s.replace(/data:image\/[^;]+;base64,/,""),n(s)},r.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;Nn(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 a=Cn.init(e);t(a)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Cn.init(e);t(n)}},On=function(e,t,n,o,a){o.upload(e,t,n.file,{onError:function(e){a.onError(e)},onProgress:function(e,t){a.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,a.onCompleted(e)})):a.onCompleted(e)}})},Mn=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){On(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Un=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var a={file:n,compress:this.cfg};On(e,t,a,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ln=function(e,t){yn(e,(function(e){var n=new Mn(e);t(n)}))},Pn=function(e,t){yn(e,(function(n){var o,a,r,i,c={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.maxWidth)||160,quality:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},s=new Un(n,c);t(s)}))};Cn.dataType;function wn(e,t,n,o){var a=this;return void 0===t&&(t=y.FILE),he((function(r,i){var c;c=t===y.IMAGE?y.IMAGE:y.FILE;var s=r.getInfoFromCache();if(!_n&&(_n="upload.qiniup.com",s&&s.ossConfig))try{var u=JSON.parse(s.ossConfig).find((function(e){return void 0!==e.qiniu}));u&&(_n=u.qiniu)}catch(e){}var d=L({domain:_n,getToken:function(e){r.getFileToken(c).then((function(t){e(t.token,t)})).catch((function(e){n.onFail(e)}))}},o);(c===y.IMAGE?Pn:Ln)(d,(function(o){o.upload(r,i,e,{onProgress:function(e,t){var o,a=Math.floor(e/t*100);null===(o=n.onProgress)||void 0===o||o.call(n,a)},onCompleted:function(o){return P(a,void 0,void 0,(function(){return w(this,(function(a){return 1===(null==s?void 0:s.type)?function(e,t,n,o,a){he((function(t,r){var i={type:n.type,name:o.rc_url.file_name,downloadUrl:r.uploadDomain+o.rc_url.path};e!==y.AUDIO?(e===y.IMAGE&&(i.thumbnail=o.thumbnail),a.onSuccess(i)):Dn(n).then((function(e){a.onSuccess(L(L({},i),e))}))}))}(t,0,e,o,n):function(e,t,n,o,a){Gn(t,o.filename,o.name,o,o.uploadMethod).then((function(r){if(0===r.code){var i=r.data;i.type=n.type,i.name=o.name||o.filename,e!==y.AUDIO?(t===y.IMAGE&&(i.thumbnail=o.thumbnail),a.onSuccess(i)):Dn(n).then((function(e){a.onSuccess(L(L({},i),e))}))}else a.onFail(r)})).catch((function(e){a.onFail(e)}))}(t,c,e,o,n),[2]}))}))},onError:function(e){n.onFail(e)}})}))}))}function Dn(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 Sn=Sn||new AudioContext,new Promise((function(t,n){Sn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Bn(e,t,n,o){return Re((function(r){return new Promise((function(i){r.getFileToken(e,t,n,o).then((function(e){i({code:a.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:Pe[e]})}))}))}))}function Gn(e,t,n,o,r){return R("fileType",e,A,!0)&&R("filename",t,m.STRING)&&R("saveName",n,m.STRING)&&R("serverType",r,m.NUMBER)?Re((function(i){return new Promise((function(c){i.getFileUrl(e,t,n,o,r).then((function(e){c({code:a.SUCCESS,data:e})})).catch((function(e){c({code:e})}))}))})):Promise.resolve({code:a.BIZ_ERROR_INVALID_PARAMETER})}function xn(e,t,n){return P(this,void 0,void 0,(function(){var o,c,d,f=this;return w(this,(function(l){return n=n||{},t instanceof zt==!1?(ie.warn("send message fail -> message parameter is not an instance of BaseMessage"),[2,Le.ILLGAL_PARAMS]):R("conversation",e,m.OBJECT,!0)?(o=e.conversationType,c=e.targetId,d=e.channelId,R("conversation.targetId",c,m.STRING,!0)&&R("conversation.conversationType",o,m.NUMBER)&&R("conversation.channelId",d,m.CHANNEL_ID)&&R("options.isStatusMessage",null==n?void 0:n.isStatusMessage,m.BOOLEAN)&&R("options.disableNotification",null==n?void 0:n.disableNotification,m.BOOLEAN)&&R("options.pushContent",null==n?void 0:n.pushContent,m.STRING)&&R("options.pushData",null==n?void 0:n.pushData,m.STRING)&&R("options.isMentioned",null==n?void 0:n.isMentioned,m.BOOLEAN)&&R("options.mentionedType",null==n?void 0:n.mentionedType,m.NUMBER)&&R("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,m.ARRAY)&&R("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,m.ARRAY)&&R("options.isVoipPush",null==n?void 0:n.isVoipPush,m.BOOLEAN)&&R("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,m.BOOLEAN)&&R("options.expansion",null==n?void 0:n.expansion,m.OBJECT)&&R("options.pushConfig",null==n?void 0:n.pushConfig,m.OBJECT)&&R("options.messageId",null==n?void 0:n.messageId,m.NUMBER)?[2,Re((function(l,g){return P(f,void 0,void 0,(function(){var f,g,v,I,h,R,m,p,E;return w(this,(function(T){switch(T.label){case 0:return f="conversationType:".concat(o,",targetId:").concat(c),ie.debug("send message ->".concat(f)),g=function(e,t,n){var o=e.isStatusMessage,a=e.disableNotification,r=e.pushContent,i=e.pushData,c=e.isMentioned,s=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return L({isStatusMessage:o,disableNotification:a,pushContent:r,pushData:i,isMentioned:c,mentionedType:s,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},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:l.getCurrentUserId(),messageUId:"",messageDirection:M.SEND,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:s.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig},o!==u.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(ce(v))}catch(e){r.error('Callback method "onSendBefore" execution error',e)}},h=r.ID(),r.info(i.A_SEND_MSG_T,{messageType:t.messageType,conversationType:o,targetId:c,channelId:d},{traceId:h}),[4,l.sendMessage(o,c,g,I,h)];case 1:return R=T.sent(),m=R.code,p=R.data,(m===a.SUCCESS?r.info:r.warn)(i.A_SEND_MSG_R,{code:m,messageUId:p?p.messageUId:"",messageId:p?p.messageId:""},{traceId:h}),m===a.SUCCESS?(E=ce(p),[2,{code:m,data:E}]):(ie.warn("send message fail ->".concat(m,":").concat(Pe[m],",").concat(f)),v.sentTime=(null==p?void 0:p.sentTime)||0,[2,{code:m,msg:Pe[m],data:ce(v)}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kn(e,t,n){return xn(e,new Qt(t),n)}function Hn(e,t){return function(n,o,c,s){if(!R("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:a.BIZ_ERROR_INVALID_PARAMETER});var u={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){var d=null==s?void 0:s.thumbnailConfig;if(!(R("sendOptions.maxHeight",null==d?void 0:d.maxHeight,m.NUMBER)&&R("sendOptions.maxWidth",null==d?void 0:d.maxWidth,m.NUMBER)&&R("sendOptions.quality",null==d?void 0:d.quality,m.NUMBER)&&R("sendOptions.scale",null==d?void 0:d.scale,m.NUMBER)))return Promise.resolve({code:a.BIZ_ERROR_INVALID_PARAMETER});u.thumbnailConfig=d}return new Promise((function(d){var f=r.ID();r.info(i.L_MEDIA_UPLOAD_T,{filesize:o.file.size,type:e},{traceId:f}),wn(o.file,e,{onProgress:null==c?void 0:c.onProgress,onSuccess:function(e){var u,l=(null===(u=null==c?void 0:c.onComplete)||void 0===u?void 0:u.call(c,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&r.info(i.L_MEDIA_UPLOAD_R,{downurl:e.downloadUrl,code:a.SUCCESS},{traceId:f}),xn(n,l,s).then(d)},onFail:function(e){r.warn(i.L_MEDIA_UPLOAD_R,{code:a.UPLOAD_FILE_FAILED},{traceId:f}),d({code:a.UPLOAD_FILE_FAILED,msg:e||a[a.UPLOAD_FILE_FAILED]})}},u)}))}}var Vn=Hn(y.FILE,(function(e,t){return new en({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})})),Fn=Hn(y.IMAGE,(function(e,t){return new Wt({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),qn=Hn(y.AUDIO,(function(e,t){return new Xt({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Zn=Hn(y.SIGHT,(function(e,t){return new jt({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,o=this;return w(this,(function(c){return R("options.timestamp",null==t?void 0:t.timestamp,m.NUMBER)&&R("options.count",null==t?void 0:t.count,m.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?(n=r.ID(),r.info(i.A_GET_HISTORY_MSG_T,{targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count},{traceId:n}),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o,s,u,d;return w(this,(function(f){switch(f.label){case 0:return[4,c.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 o=f.sent(),s=o.code,u=o.data,s===a.SUCCESS&&u?(d=u.list.map((function(e){return ce(e)})),r.info(i.A_GET_HISTORY_MSG_R,{code:s,messageLength:d.length},{traceId:n}),[2,{code:s,data:{list:d,hasMore:u.hasMore}}]):(r.warn(i.A_GET_HISTORY_MSG_R,{code:s,messageUIds:""},{traceId:n}),[2,{code:s,msg:Pe[s]}])}}))}))}),{tagId:i.A_GET_HISTORY_MSG_R,traceId:n})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kn(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.timestamp",null==t?void 0:t.timestamp,m.NUMBER)&&R("options.count",null==t?void 0:t.count,m.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("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 r=u.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?(s=c.list.map((function(e){return ce(e)})),[2,{code:i,data:{list:s,hasMore:c.hasMore}}]):(ie.warn("get history message fail ->".concat(i,":").concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jn(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return w(this,(function(r){return[2,Re((function(r){return P(a,void 0,void 0,(function(){var a,r,i,c,s;return w(this,(function(d){switch(d.label){case 0:return a={targetId:e,conversationType:u.PRIVATE,channelId:o},r=new zt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,xn(a,r)];case 1:return i=d.sent(),c=i.code,s=i.msg,0===c?[2,{code:c}]:[2,{code:c,msg:s}]}}))}))}))]}))}))}function Yn(e,t,n){return P(this,void 0,void 0,(function(){var o,r,i,c,s;return w(this,(function(d){switch(d.label){case 0:return R("messageUId",t,m.STRING,!0)&&R("channelId",n,m.CHANNEL_ID)?(o="messageUId:".concat(t,",targetId:").concat(e),ie.debug("send read receipt message ->".concat(o)),r=new zt("RC:RRReqMsg",{messageUId:t}),[4,xn({targetId:e,conversationType:u.GROUP,channelId:n},r)]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}];case 1:return i=d.sent(),c=i.code,s=i.msg,0===c?[2,{code:c}]:[2,{code:c,msg:s}]}}))}))}function Wn(e,t,n){return P(this,void 0,void 0,(function(){return w(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 w(this,(function(r){return R("targetId",e,m.STRING,!0)&&R("messageList",t,m.OBJECT,!0)&&R("channelId",n,m.CHANNEL_ID)&&!Object.keys(t).every((function(e){return!R(e,t[e],m.ARRAY)}))?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s,d,f,l;return w(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:u.GROUP,channelId:n},c=r.getInfoFromCache(),0!==(s=(null==c?void 0:c.grpRRVer)||0)?[3,2]:(d=new zt("RC:RRRspMsg",{receiptMessageDic:t}),[4,xn(o,d)]);case 1:return i=g.sent(),[3,4];case 2:return 1!==s?[3,4]:(f=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===f.indexOf(e)&&f.push(e)}))})),f.length?[4,r.sendReadReceiptMessage(e,f,n)]:(ie.warn("Error in parameter messageList."),[2,{code:a.PARAMETER_ERROR}]));case 3:i=g.sent(),g.label=4;case 4:return(l=i.code)===a.SUCCESS?[2,{code:l}]:(ie.warn("send read receipt message fail ->".concat(l,":").concat(Pe[l])),[2,{code:l,msg:Pe[l]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e,t){return P(this,void 0,void 0,(function(){var n,o,r,i;return w(this,(function(c){switch(c.label){case 0:return R("conversation.type",e.conversationType,m.NUMBER,!0)&&R("conversation.targetId",e.targetId,m.STRING,!0)&&R("lastMessageSendTime",t,m.NUMBER,!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?(n=new zt("RC:SRSMsg",{lastMessageSendTime:t}),[4,xn(e,n)]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=c.sent(),r=o.code,i=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:i}]}}))}))}function Qn(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.messageUId",t.messageUId,m.STRING,!0)&&R("options.sentTime",t.sentTime,m.NUMBER,!0)&&R("options.disableNotification",null==t?void 0:t.disableNotification,m.BOOLEAN)&&R("options.pushConfig",null==t?void 0:t.pushConfig,m.OBJECT)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.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},r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),ie.debug("recall message ->".concat(r)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c===a.SUCCESS&&s?[2,{code:c,data:ce(s)}]:c===a.SUCCESS?[2,{code:c}]:(ie.warn("recall message fail ->".concat(c,":").concat(Pe[c],",").concat(r)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $n(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options",t,(function(e){return v(e)&&e.length}),!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)&&!t.every((function(e){return!R("options.messageUId",e.messageUId,m.STRING,!0)||!R("options.sentTime",e.sentTime,m.NUMBER,!0)||!R("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("delete message fail ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:a.SUCCESS}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.timestamp",t,m.NUMBER,!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("clear message ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:a.SUCCESS}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("expansion",e,m.OBJECT,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f;return w(this,(function(l){switch(l.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.canIncludeExpansion,s=t.expansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",messageUId:").concat(i),ie.debug("update message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:r,messageUId:i,expansion:e,canIncludeExpansion:c,originExpansion:s,channelId:u})];case 1:return(f=l.sent().code)!==a.SUCCESS?(ie.warn("update message expansion fail ->".concat(f,":").concat(Pe[f],",").concat(d)),[2,{code:f,msg:Pe[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function no(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("keys",e,m.ARRAY,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.canIncludeExpansion,s=t.channelId,u="conversationType:".concat(n,",targetId:").concat(r,",messageUId:").concat(i),ie.debug("remove message expansion ->".concat(u)),[4,o.sendExpansionMessage({conversationType:n,targetId:r,messageUId:i,canIncludeExpansion:c,keys:e,channelId:s})];case 1:return(d=f.sent().code)!==a.SUCCESS?(ie.warn("remove message expansion fail ->".concat(d,":").concat(Pe[d],",").concat(u)),[2,{code:d,msg:Pe[d]}]):[2,{code:d}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,t){return P(this,void 0,void 0,(function(){var n,o,c=this;return w(this,(function(s){return R("typingContentType",t,m.STRING,!0)?(n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},o=r.ID(),r.info(i.A_SEND_MSG_T,{messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},{traceId:o}),[2,Re((function(t){return P(c,void 0,void 0,(function(){var c,s,u;return w(this,(function(d){switch(d.label){case 0:return[4,t.sendMessage(e.conversationType,e.targetId,n,void 0,o)];case 1:return c=d.sent(),s=c.code,u=c.data,(s===a.SUCCESS?r.info:r.warn)(i.A_SEND_MSG_R,{code:s,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""},{traceId:o}),s===a.SUCCESS?[2,{code:s,data:ce(u)}]:[2,{code:s,msg:Pe[s]}]}}))}))}),{tagId:i.A_SEND_MSG_R,traceId:o})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ao(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return R("messageUId",t,m.STRING,!0)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s;return w(this,(function(u){switch(u.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),ie.debug("get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c===a.SUCCESS?[2,{code:c,data:s}]:(ie.warn("get message reader fail ->".concat(c,":").concat(Pe[c],",").concat(o)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,t,n,o,a){return he((function(c){return g("messageType",e,m.STRING,!0),g("isPersited",t,m.BOOLEAN,!0),g("isCounted",n,m.BOOLEAN,!0),g("isStatusMessage",a,m.BOOLEAN,!1),r.info(i.A_REGTYP_O,{messageType:e,isCounted:n,isStatusMessage:a,isPersited:t}),c.registerMessageType(e,t,n,o,a),Kt(e,t,n)}))}function io(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?R("conversation.conversationType",e.conversationType,m.NUMBER,!0)&&R("conversation.targetId",e.targetId,m.STRING,!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("insertMessage ->code:".concat(o,",targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function co(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return ue("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),O()?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s,u,d,f,l,g,v,I,h,R,m,p,E;return w(this,(function(T){switch(T.label){case 0:return o=t.senderUserId,i=t.messageType,c=t.content,s=t.messageDirection,u=t.messageUId,d=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,g=t.sentTime,v=t.sentStatus,ie.info("insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,R={senderUserId:o,messageType:i,content:c,messageDirection:s,sentTime:g,sentStatus:v,searchContent:h,isUnread:I,messageUId:u,disableNotification:l,canIncludeExpansion:d,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,R)];case 1:return m=T.sent(),p=m.code,E=m.data,p===a.SUCCESS?[2,{code:p,data:ce(E)}]:(ie.warn("insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:Pe[p]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function so(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getMessage(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:ce(r)}]:(ie.warn("getMessage ->code:".concat(o,",messageId:").concat(e)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function uo(e){if(!O())return{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId;return R("conversationType",n,m.NUMBER,!0)&&R("targetId",o,m.STRING,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o),r=[];return t&&t.length&&t.forEach((function(e){return r.push(ce(e))})),{code:a.SUCCESS,data:r}},le?t(le,ge):{code:a.BIZ_ERROR_CLIENT_NOT_INIT}):{code:a.BIZ_ERROR_INVALID_PARAMETER}}function fo(e,t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return ue("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),O()?R("conversationType",e.conversationType,m.NUMBER,!0)&&R("targetId",e.targetId,m.STRING,!0)&&R("keyword",t,m.STRING,!0)&&R("timestamp",n,m.NUMBER)&&R("count",o,m.NUMBER)?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s,u;return w(this,(function(d){switch(d.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=d.sent(),c=r.code,s=r.data,c===a.SUCCESS?(u=[],(null==s?void 0:s.messages)&&s.messages.length&&s.messages.forEach((function(e){return u.push(ce(e))})),[2,{code:c,data:{messages:u,count:null==s?void 0:s.count}}]):(ie.warn("searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function lo(e,t,n){return P(this,void 0,void 0,(function(){var o,c,s,u=this;return w(this,(function(d){return ue("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),O()?(o=e.conversationType,c=e.targetId,s=e.channelId,R("conversationType",o,m.NUMBER,!0)&&R("targetId",c,m.STRING,!0)&&R("timestamp",t,m.NUMBER,!0)&&R("cleanSpace",n,m.BOOLEAN)?[2,Re((function(d){return P(u,void 0,void 0,(function(){var u;return w(this,(function(f){switch(f.label){case 0:return[4,d.deleteMessagesByTimestamp(o,c,t,n,s)];case 1:return u=f.sent(),r.debug(i.A_DELETE_MESSAGES_S,{code:u,conversationType:o,targetId:c,channelId:s,timestamp:t}),u===a.SUCCESS?[2,{code:u}]:(ie.warn("deleteLocalMessagesByTimestamp ->code:".concat(u,",targetId:").concat(e.targetId)),[2,{code:u,msg:Pe[u]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function go(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return ue("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),O()?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,ie.info("clearMessages ->targetId:".concat(o,",conversationType:").concat(t)),[4,n.clearMessages(t,o,r)];case 1:return(i=c.sent())===a.SUCCESS?[2,{code:i}]:(ie.warn("clearMessages ->code:".concat(i,",targetId:").concat(o)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function vo(e,t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return ue("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),O()?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s;return w(this,(function(u){switch(u.label){case 0:return ie.info("searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,n,o,t)];case 1:return r=u.sent(),c=r.code,s=r.data,c===a.SUCCESS?[2,{code:c,data:s}]:(ie.warn("searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function Io(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n=e.conversationType,r=e.targetId,i=e.channelId,ie.info("clearUnreadCountByTimestamp ->targetId:".concat(r,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,r,t,i)];case 1:return(c=s.sent())===a.SUCCESS?[2,{code:c}]:(ie.warn("clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function ho(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return ue("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),O()?R("messageId",e,m.NUMBER,!0)&&R("receivedStatus",t,m.NUMBER,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=r.sent())===a.SUCCESS?[2,{code:n}]:(ie.warn("setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function Ro(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("tag.tagId",e.tagId,m.STRING,!0)&&R("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&R("tag.tagName",e.tagName,m.STRING,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return ie.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:t}]:(ie.warn("createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("tagId",e,m.STRING,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return ie.info("removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:t}]:(ie.warn("removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("tag.tagId",e.tagId,m.STRING,!0)&&R("tag.tagName",e.tagName,m.STRING,!0)&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return ie.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:t}]:(ie.warn("updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(r){switch(r.label){case 0:return[4,t.getTagList()];case 1:return e=r.sent(),n=e.code,o=e.data,n===a.SUCCESS?[2,{code:a.SUCCESS,data:o}]:(ie.warn("getTagList ->code:".concat(n)),[2,{code:n,msg:Pe[n]}])}}))}))}))]}))}))}function To(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("conversationType",e.conversationType,m.NUMBER)&&R("targetId",e.targetId,m.STRING)&&R("channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return ie.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:Pe[o]}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("conversations",t,m.ARRAY,!0)&&!t.every((function(e){return!R("conversation.conversationType",e.conversationType,m.NUMBER,!0)||!R("conversation.targetId",e.targetId,m.STRING,!0)||!R("conversation.channelId",e.channelId,m.CHANNEL_ID)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("conversations",t,m.ARRAY,!0)&&!t.every((function(e){return!R("conversation.conversationType",e.conversationType,m.NUMBER,!0)||!R("conversation.targetId",e.targetId,m.STRING,!0)||!R("conversation.channelId",e.channelId,m.CHANNEL_ID)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("conversation.conversationType",e.conversationType,m.NUMBER,!0)&&R("conversation.targetId",e.targetId,m.STRING,!0)&&R("conversation.channelId",e.channelId,m.CHANNEL_ID)&&R("tagIds",t,m.ARRAY,!0)&&!t.every((function(e){return!R("tagId",e,m.STRING,!0)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("conversations",t,m.ARRAY,!0)&&!t.every((function(e){return!R("conversation.conversationType",e.conversationType,m.NUMBER,!0)||!R("conversation.targetId",e.targetId,m.STRING,!0)||!R("conversation.channelId",e.channelId,m.CHANNEL_ID)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return R("tagId",e,m.STRING,!0)&&R("count",t,m.NUMBER,!0)&&R("startTime",n,m.NUMBER,!0)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c;return w(this,(function(s){switch(s.label){case 0:return ie.info("getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=s.sent(),i=o.code,c=o.data,i===a.SUCCESS?[2,{code:i,data:c}]:(ie.warn("getConversationListByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("containMuted",t,m.BOOLEAN,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return ie.info("getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),r=n.code,i=n.data,ie.info(r,i),r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getUnreadCountByTag ->code:".concat(r,",tagId:").concat(e)),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return R("tagId",e,m.STRING,!0)&&R("conversation.targetId",t.targetId,m.STRING,!0)&&R("conversation.conversationType",t.conversationType,m.NUMBER,!0)&&R("conversation.channelId",t.channelId,m.CHANNEL_ID)&&R("status.isTop",n,m.BOOLEAN,!0)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o;return w(this,(function(i){switch(i.label){case 0:return ie.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=i.sent().code)===a.SUCCESS?[2,{code:o}]:(ie.warn("setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Hn(y.COMBINE_HTML,(function(e,t){return new $t({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Mo={COMET:"comet",WEBSOCKET:"websocket"},Uo={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 w(this,(function(n){return O()?R("channelId",e,m.ONLY_STRING)?(ie.info("getAllConversationList -> channelId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return U(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 o=t.code,r=t.data,o===a.SUCCESS&&r?(i=r.map((function(e){return se(e)})),[2,{code:o,data:i}]):(ie.warn("getAllConversationList fail -> code: ".concat(o," channelId: ").concat(e)),[2,{code:o,msg:Pe[o]}])}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return O()?R("startTime",e,m.NUMBER,!0)&&R("count",t,m.NUMBER,!0)&&R("channelId",n,m.ONLY_STRING)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),ie.info("getConversationList -> ".concat(o)),U(n)?[4,r.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return i=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,t,n)];case 3:i=f.sent(),f.label=4;case 4:return s=i.code,u=i.data,s===a.SUCCESS&&u?(d=u.map((function(e){return se(e)})),[2,{code:s,data:d}]):(ie.warn("getConversationList fail -> code: ".concat(s," ").concat(o)),[2,{code:s,msg:Pe[s]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return O()?R("keyword",t,m.STRING,!0)&&R("messageTypes",n,m.ARRAY,!0)&&R("channelId",o,m.ONLY_STRING)&&!n.every((function(e){return!R("messageType",e,m.STRING,!0)}))?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return r="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),ie.info("searchConversationByContent -> ".concat(e)),U(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=f.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:c=f.sent(),f.label=4;case 4:return s=c.code,u=c.data,s===a.SUCCESS&&u?(d=u.map((function(e){return se(e)})),[2,{code:s,data:d}]):(ie.warn("searchConversationByContent fail -> code: ".concat(s," ").concat(r)),[2,{code:s,msg:Pe[s]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("keyword",t,m.STRING,!0)&&R("startTime",n,m.NUMBER,!0)&&R("count",o,m.NUMBER,!0)?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s,u,d,f,l,g,v,I;return w(this,(function(h){switch(h.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),ie.info("searchMessages -> ".concat(r)),c=e.targetId,s=e.conversationType,u=e.channelId,U(u)?[4,i.searchMessageByContentWithAllChannel(s,c,t,n,o)]:[3,2];case 1:return d=h.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(s,c,t,n,o,0,u)];case 3:d=h.sent(),h.label=4;case 4:return f=d.code,l=d.data,f===a.SUCCESS&&l?(g=l.messages,v=l.count,I=g.map((function(e){return ce(e)})),[2,{code:f,data:{messages:I,count:v}}]):(ie.warn("searchMessages fail -> code: ".concat(f," ").concat(r)),[2,{code:f,msg:Pe[f]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("option",t,m.OBJECT,!0)&&R("option.keyword",t.keyword,m.STRING,!0)&&R("option.startTime",t.startTime,m.NUMBER,!0)&&R("option.endTime",t.endTime,m.NUMBER,!0)&&R("option.offset",t.offset,m.NUMBER)&&R("option.limit",t.limit,m.NUMBER)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l,g,v;return w(this,(function(I){switch(I.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),ie.info("searchMessageInTimeRange -> ".concat(n)),r=e.conversationType,i=e.targetId,c=t.keyword,s=t.startTime,u=t.endTime,d=t.offset,f=t.limit,d=d||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(r,i,c,s,u,d,f)];case 1:return l=I.sent(),g=l.code,v=l.data,g===a.SUCCESS&&v?[2,{code:g,data:{messages:v.messages.map((function(e){return ce(e)}))}}]:(ie.warn("searchMessageInTimeRange fail -> code: ".concat(g,", ").concat(n)),[2,{code:g}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("option",t,m.OBJECT,!0)&&R("option.count",t.count,m.NUMBER)&&R("option.timestamp",t.timestamp,m.NUMBER)&&R("option.order",t.order,(function(e){return[0,1].includes(e)}))&&R("option.messageTypes",t.messageTypes,m.ARRAY,!0)&&!t.messageTypes.every((function(e){return!R("option.messageType",e,m.STRING,!0)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l,g,v,I,h,R,m;return w(this,(function(p){switch(p.label){case 0:return n=t.count,r=t.timestamp,i=t.order,c=t.messageTypes,s="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),ie.info("getHistoryMessagesByMessageTypes -> ".concat(s)),u=e.conversationType,d=e.targetId,f=e.channelId,n||(n=20),r||(r=0),i||(i=0),f||(f=""),[4,o.getHistoryMessagesByObjectNames(u,d,r,n,c,i,f)];case 1:return l=p.sent(),g=l.code,v=l.data,g===a.SUCCESS?(h=(I=v).list,R=I.hasMore,m=h.map((function(e){return ce(e)})),[2,{code:g,data:{messages:m,hasMore:R}}]):(ie.warn("getHistoryMessagesByMessageTypes fail -> code: ".concat(g," ").concat(s)),[2,{code:g,msg:Pe[g]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("timestamp",t,m.NUMBER,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,a,r,i;return w(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),ie.info("updateSentMsgReceiptStatus -> ".concat(n)),a=e.conversationType,r=e.targetId,i=e.channelId,[4,o.setMessageStatusToRead(a,r,t,i)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("messageId",e,m.NUMBER,!0)&&R("receivedStatus",t,(function(e){return!U(s[e])}),!0)?(ie.info("setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[2,Re((function(o){return P(n,void 0,void 0,(function(){return w(this,(function(n){switch(n.label){case 0:return[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("messageId",e,m.NUMBER,!0)&&R("sentStatus",t,(function(e){return!U(G[e])}),!0)?(ie.info("setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[2,Re((function(o){return P(n,void 0,void 0,(function(){return w(this,(function(n){switch(n.label){case 0:return[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return O()?R("messageId",e,m.NUMBER,!0)&&R("content",t,m.OBJECT,!0)&&R("messageType",n,m.ONLY_STRING,!0)?(ie.info("setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[2,Re((function(a){return P(o,void 0,void 0,(function(){return w(this,(function(o){switch(o.label){case 0:return[4,a.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?!R("messageIds",e,m.ARRAY,!0)||e.every((function(e){return!R("messageId",e,m.NUMBER,!0)}))?[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:(ie.info("deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[2,Re((function(n){return P(t,void 0,void 0,(function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,ie.info("clearMessages ->targetId:".concat(o,",conversationType:").concat(t)),[4,n.clearMessages(t,o,r)];case 1:return(i=c.sent())===a.SUCCESS?[2,{code:i}]:(ie.warn("clearMessages ->code:".concat(i,",targetId:").concat(o)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return P(this,void 0,void 0,(function(){var o,r,i,c=this;return w(this,(function(s){return O()?(o=e.conversationType,r=e.targetId,i=e.channelId,R("conversationType",o,m.NUMBER,!0)&&R("targetId",r,m.STRING,!0)&&R("timestamp",t,m.NUMBER,!0)&&R("cleanSpace",n,m.BOOLEAN)?[2,Re((function(e){return P(c,void 0,void 0,(function(){var c;return w(this,(function(s){switch(s.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,i)];case 1:return(c=s.sent())===a.SUCCESS?[2,{code:c}]:(ie.warn("deleteMessagesByTimestamp ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o,r,i,c,s,u,d,f,l,g,v,I,h,R=this;return w(this,(function(m){return O()?(o=t.senderUserId,r=t.messageType,i=t.content,c=t.messageDirection,s=t.messageUId,u=t.canIncludeExpansion,d=t.expansion,f=t.disableNotification,l=t.sentTime,g=t.sentStatus,ie.info("insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),v=n.isUnread,I=n.searchContent,h={senderUserId:o,messageType:r,content:i,messageDirection:c,sentTime:l,sentStatus:g,searchContent:I,isUnread:v,messageUId:s,disableNotification:f,canIncludeExpansion:u,expansionMsg:JSON.stringify(d),channelId:e.channelId||""},[2,Re((function(t){return P(R,void 0,void 0,(function(){var n,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,t.insertMessage(e.conversationType,e.targetId,h)];case 1:return n=i.sent(),o=n.code,r=n.data,o===a.SUCCESS?[2,{code:o,data:ce(r)}]:(ie.warn("insertMessage ->code:".concat(o,",targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}])}}))}))}))]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return O()?(ie.info("clearData -> "),[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(a){switch(a.label){case 0:return[4,t.clearData()];case 1:return e=a.sent(),n=e.code,o=e.data,[2,{code:n,data:o}]}}))}))}))]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}}),Po=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};export{zt as BaseMessage,$t as CombineMessage,Mo as ConnectType,B as Events,en as FileMessage,tn as GIFMessage,Xt as HQVoiceMessage,Wt as ImageMessage,on as LocationMessage,Po as MentionedInfoBody,Uo as MessageType,an as ReferenceMessage,rn as RichContentMessage,G as SentStatus,jt as SightMessage,Qt as TextMessage,nn as VoiceMessage,Oe as __addSDKVersion,So as addConversationsToTag,me as addEventListener,Ro as addTag,Vt as addToBlacklist,Ht as bindRTCRoomForChatroom,Ye as clearAllMessagesUnreadStatus,Se as clearEventListeners,eo as clearHistoryMessages,go as clearMessages,Je as clearMessagesUnreadStatus,Fe as clearTextMessageDraft,Io as clearUnreadCountByTimestamp,be as connect,lo as deleteLocalMessagesByTimestamp,$n as deleteMessages,Ce as destroy,Be as disconnect,Lo as electronExtension,Bt as forceRemoveChatRoomEntry,wt as forceSetChatRoomEntry,xt as getAllChatRoomEntries,st as getAllConversationState,Tt as getAllUltraGroupUnreadCount,St as getAllUltraGroupUnreadMentionedCount,ct as getAllUnreadMentionedCount,qt as getBlacklist,Zt as getBlacklistStatus,dt as getBlockUltraGroupList,ot as getBlockedConversationList,Gt as getChatRoomEntry,Ut as getChatRoomInfo,kt as getChatroomHistoryMessages,Ne as getConnectionStatus,xe as getConversation,Ge as getConversationList,et as getConversationNotificationLevel,nt as getConversationNotificationStatus,Ao as getConversationsFromTagByPage,ye as getCurrentUserId,Me as getDeviceId,Bn as getFileToken,Gn as getFileUrl,io as getFirstUnreadMessage,zn as getHistoryMessages,so as getMessage,ao as getMessageReader,Kn as getRemoteHistoryMessages,Ae as getServerTime,Eo as getTags,To as getTagsFromConversation,He as getTextMessageDraft,rt as getTopConversationList,qe as getTotalUnreadCount,Ze as getTotalUnreadCountByLevels,ze as getTotalUnreadMentionedCountByLevels,mt as getUltraGroupDefaultNotificationLevel,Ct as getUltraGroupFirstUnreadMessageTimestamp,ut as getUltraGroupList,lt as getUltraGroupMessageListByMessageUId,Et as getUltraGroupUnreadCountByTargetId,Rt as getUltraGroupUnreadMentionedCountByTargetId,_t as getUltraGroupUnreadMentionedMessages,Ke as getUnreadCount,yo as getUnreadCountByTag,it as getUnreadMentionedCount,uo as getUnreadMentionedMessages,_e as init,co as insertMessage,Ue as installPlugin,yt as joinChatRoom,Ot as joinExistChatRoom,ht as modifyMessage,pe as onceEventListener,Mt as quitChatRoom,Qn as recallMessage,ro as registerMessageType,It as removeAllExpansionForUltraGroupMessage,bt as removeChatRoomEntries,Dt as removeChatRoomEntry,ke as removeConversation,_o as removeConversationsFromTag,Ee as removeEventListener,Te as removeEventListeners,vt as removeExpansionForUltraGroupMessage,Ft as removeFromBlacklist,no as removeMessageExpansionForKey,mo as removeTag,No as removeTagFromConversations,Co as removeTagsFromConversation,Ve as saveTextMessageDraft,vo as searchConversationByContent,fo as searchMessages,Vn as sendFileMessage,qn as sendHQVoiceMessage,Fn as sendImageMessage,xn as sendMessage,Jn as sendReadReceiptMessage,Yn as sendReadReceiptRequest,Wn as sendReadReceiptResponse,Xn as sendReadReceiptResponseV2,Zn as sendSightMessage,jn as sendSyncReadStatusMessage,kn as sendTextMessage,oo as sendTypingStatusMessage,ft as sendUltraGroupTypingStatus,Pt as setChatRoomEntries,Lt as setChatRoomEntry,Qe as setConversationNotificationLevel,$e as setConversationNotificationStatus,at as setConversationToTop,Oo as setConversationToTopInTag,ho as setMessageReceivedStatus,pt as setUltraGroupDefaultNotificationLevel,gt as updateExpansionForUltraGroupMessage,to as updateMessageExpansion,po as updateTag};
|
|
1
|
+
import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as a,logger as r,LogTagId as i,Logger as c,ReceivedStatus as s,ConversationType as u,isNumber as d,EventEmitter as f,VersionManage as l,assert as g,isArray as v,isHttpUrl as I,APIContext as h,validate as R,AssertRules as m,isValidConversationType as p,isValidNotificationLevel as E,NotificationLevel as T,UltraGroupChannelType as S,isString as _,getUUID as C,UploadMethod as N,isValidFileType as A,FileType as y,usingCppEngine as O,MessageDirection as M,isUndefined as U}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,ReceivedStatus,UltraGroupChannelType,UploadMethod,reportLog}from"@rongcloud/engine";var L=function(){return L=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},L.apply(this,arguments)};function P(e,t,n,o){return new(n||(n=Promise))((function(a,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}s((o=o.apply(e,t||[])).next())}))}function w(e,t){var n,o,a,r,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,o=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){i.label=r[1];break}if(6===r[0]&&i.label<a[1]){i.label=a[1],a=r;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(r);break}a[2]&&i.ops.pop(),i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e],o=0}finally{n=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}}var D=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))},b=D();var B,G,x={tag:"browser",httpReq:function(e){var a=e.method||t.GET,r=e.timeout||n,i=e.headers,c=e.query,s=e.body,u=o(e.url,c);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(a,u),i&&n.setRequestHeader)for(var c in i)n.setRequestHeader(c,i[c]);if(o){n.timeout=r,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 s?JSON.stringify(s):s;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})}),r),n.send(s)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:b,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,a=n||o||e.UNKONWN;return new Promise((function(e){e(a)}))}},k=D(),H=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:o}),wx[e].apply(wx,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:o})}}},V={setItem:H("setStorageSync"),getItem:H("getStorageSync"),removeItem:H("removeStorageSync"),clear:H("clearStorageSync")},F={tag:"wechat",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){wx.request({url:d,method:r,header:c,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:V,sessionStorage:V,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:k,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)}})}))}},q=D(),Z=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{if(r.info(i.A_CALLBACK_O,{func_name:e,source:"alipay"},{traceId:o}),"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 a=my[e]({key:t[0]}).data;return a?JSON.stringify(a):a}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:o})}}},z={setItem:Z("setStorageSync"),getItem:Z("getStorageSync"),removeItem:Z("removeStorageSync"),clear:Z("clearStorageSync")},K={tag:"alipay",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,c=e.headers,s=e.query,u=e.body,d=o(e.url,s),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:r,headers:c,timeout:i,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:z,sessionStorage:z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:q,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)}})}))}},J=D(),Y=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:o}),tt[e].apply(tt,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:o})}}},W={setItem:Y("setStorageSync"),getItem:Y("getStorageSync"),removeItem:Y("removeStorageSync"),clear:Y("clearStorageSync")},X={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,localStorage:W,sessionStorage:W,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:a.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)}})}))}},j=D(),Q=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:o}),swan[e].apply(swan,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:o})}}},$={setItem:Q("setStorageSync"),getItem:Q("getStorageSync"),removeItem:Q("removeStorageSync"),clear:Q("clearStorageSync")},ee={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:$,sessionStorage:$,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:a.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 w(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)}})}))]}))}))}},te=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r.ID();try{return r.info(i.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:o}),uni[e].apply(uni,t)}catch(t){r.error(i.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:o})}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe={tag:"uniapp",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){uni.request({url:d,method:r,header:c,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,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)}})}))}},ae=function(e){return e&&e.request&&e.getSystemInfo},re="undefined"!=typeof uni&&ae(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return oe;case"mp-baidu":return ee;case"mp-toutiao":return X;case"mp-alipay":return K;case"mp-weixin":return F;default:return x}}():"undefined"!=typeof my&&ae(my)?K:"undefined"!=typeof tt&&ae(tt)?X:"undefined"!=typeof swan&&ae(swan)?ee:"undefined"!=typeof wx&&ae(wx)?F:x,ie=new c("RCIM");function ce(e){var t=e.conversationType,n=e.channelId,o=e.messageType,a=e.content,r=e.senderUserId,i=e.targetId,c=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,p=e.receivedStatus,E=e.disableNotification,T=e.isMentioned,S=e.isStatusMessage,_=e.readReceiptInfo,C=e.pushConfig,N=e.messageId,A=e.isInterrupt,y=e.isModifyMessage,O=e.channelType,M=e.sentStatus;p||(p=s.UNREAD);var U={messageType:o,channelId:n||"",content:a,senderUserId:r,targetId:i,conversationType:t,sentTime:c,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:E,isStatusMessage:S,canIncludeExpansion:R,expansion:m,receivedStatus:p,readReceiptInfo:_,pushConfig:C,messageId:N,isInterrupt:A,isModifyMessage:y,sentStatus:M};return t!==u.ULTRA_GROUP&&(U.isOffLineMessage=h),t===u.ULTRA_GROUP&&d(O)&&(U.channelType=O),U}function se(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,a=e.unreadMessageCount,r=e.hasMentioned,i=e.mentionedInfo,c=e.lastUnreadTime,s=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&ce(o),unreadMessageCount:a,hasMentioned:r,mentionedInfo:r?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:s,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function ue(e,t){ie.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"}(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"}(G||(G={}));var de=new f,fe={onConnecting:function(){de.emit(B.CONNECTING)},onConnected:function(){de.emit(B.CONNECTED)},onDisconnect:function(e){r.info(i.A_CONNECT_S,{status:e},{traceId:r.ID()}),de.emit(B.DISCONNECT,e)},onSuspend:function(e){r.info(i.A_CONNECT_S,{status:e},{traceId:r.ID()}),de.emit(B.SUSPEND,e)},batchMessage:function(e){r.info(i.A_PULL_MSG_O,{messages:e.map((function(e){return e.messageUId}))}),de.emit(B.MESSAGES,{messages:e.map((function(e){return ce(e)}))})},typingState:function(e){de.emit(B.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){de.emit(B.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){de.emit(B.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){de.emit(B.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType;return t===u.ULTRA_GROUP?{conversation:{conversationType:t,latestMessage:e.latestMessage?ce(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,versionTime:e.versionTime,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId}}:{conversation:{conversationType:t,latestMessage:e.latestMessage?ce(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,hasMentioned:e.hasMentioned,mentionedInfo:e.mentionedInfo,lastUnreadTime:e.lastUnreadTime,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,isTop:e.isTop,channelId:e.channelId,unreadMentionedCount:e.unreadMentionedCount},updatedItems:e.updatedItems}}));de.emit(B.CONVERSATION,{conversationList:t})},chatroomState:function(e){de.emit(B.CHATROOM,e)},expansion:function(e){de.emit(B.EXPANSION,e)},pullFinished:function(){de.emit(B.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){de.emit(B.TAG)},conversationTagChanged:function(){de.emit(B.CONVERSATION_TAG)},messageBlocked:function(e){de.emit(B.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){de.emit(B.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){de.emit(B.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){de.emit(B.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){de.emit(B.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){de.emit(B.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){de.emit(B.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){de.emit(B.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){de.emit(B.ULTRA_GROUP_CHANNEL_DELETE,e)}};l.add("imlib-next","5.5.7-beem");var le=null,ge=null;function ve(){return!!le}function Ie(){return P(this,void 0,void 0,(function(){return w(this,(function(e){switch(e.label){case 0:return le?[4,h.destroy()]:[2];case 1:return e.sent(),ge=null,le=null,[2]}}))}))}function he(e){if(!le)throw new Error("Not initialized yet!");return e(le,ge)}function Re(e,t){return le?e(le,ge):(t&&r.warn(t.tagId,{code:a.BIZ_ERROR_CLIENT_NOT_INIT},{traceId:t.traceId}),Promise.resolve({code:a.BIZ_ERROR_CLIENT_NOT_INIT}))}function me(e,t,n){de.on(e,t,n)}function pe(e,t,n){de.once(e,t,n)}function Ee(e,t,n){de.off(e,t,n)}function Te(e){de.removeAll(e)}function Se(){de.clear()}function _e(e){var t=e.appkey,n=e.navigators;ve()?r.warn(i.A_INIT_REPEAT_O,{appkey:t,navigators:n,version:"5.5.7-beem",commit:"8d9bf77ace0c6a875f20002cc62c286a2158dc63"}):(r.info(i.A_INIT_O,{appkey:t,navigators:n,version:"5.5.7-beem",commit:"8d9bf77ace0c6a875f20002cc62c286a2158dc63"}),ie.setLogLevel(e.logLevel),ie.setLogStdout(e.logStdout),function(e){le||(g("options.navigators",e.navigators,(function(e){return v(e)&&(0===e.length||e.every(I))})),ge=e,(le=h.init(re,{appkey:e.appkey,apiVersion:"5.5.7-beem",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logLevel:e.logLevel,logStdout:e.logStdout,indexDBSwitch:e.indexDBSwitch,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess})).assignWatcher(fe))}(e))}function Ce(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return ve()?(r.info(i.A_DESTROY_O),Se(),[2,Ie()]):[2]}))}))}function Ne(){return he((function(e){return e.getConnectionStatus()}))}function Ae(){return he((function(e){return e.getServerTime()}))}function ye(){return he((function(e){return e.getCurrentUserId()}))}function Oe(e,t){l.add(e,t)}function Me(){return he((function(e){return e.getDeviceId()}))}function Ue(e,t){return he((function(n){return n.install(e,t)}))}var Le={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:a.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:a.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Pe={};for(var we in Le){var De=Le[we].code;Pe[De]=we}function be(e,t){return P(this,void 0,void 0,(function(){var n,o=this;return w(this,(function(c){return n=r.ID(),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o;return w(this,(function(s){switch(s.label){case 0:return R("token",e,m.STRING,!0)&&R("reconnectKickEnable",t,m.BOOLEAN)?(r.info(i.A_CONNECT_T,{token:e,reconnectKickEnable:t},{traceId:n}),[4,c.connect(e,!1,t,n)]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),(o.code===a.SUCCESS?r.info:r.warn)(i.A_CONNECT_R,{code:o.code,userId:o.userId},{traceId:n}),o.code===a.SUCCESS?[2,{code:o.code,data:{userId:o.userId}}]:[2,{code:o.code,msg:Pe[o.code]}]}}))}))}),{tagId:i.A_CONNECT_R,traceId:n})]}))}))}function Be(){return r.info(i.A_DISCONNECT_O,{}),he((function(e){return e.disconnect()}))}function Ge(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(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(),r=n.code,i=n.data,r===a.SUCCESS&&i?[2,{code:0,data:i.map((function(e){return se(e)}))}]:(ie.warn("get conversation list fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function xe(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=i.sent(),o=t.code,r=t.data,o!==a.SUCCESS?(ie.warn("getConversation ->code:".concat(o,", targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}]):[2,{code:o,data:r?se(r):null}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o;return w(this,(function(r){switch(r.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=r.sent(),o="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("destroy conversation ->".concat(o)),t!==a.SUCCESS?(ie.warn("destroy conversation fail ->".concat(t,":").concat(Pe[t],",").concat(o)),[2,{code:t,msg:Pe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function He(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),o=t.code,r=t.data,i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("get draft ->".concat(i)),o===a.SUCCESS?[2,{code:o,data:r||""}]:(ie.warn("get draft fail ->".concat(o,":").concat(Pe[o],",").concat(i)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ve(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)&&R("draft",t,m.STRING,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(r=i.sent())===a.SUCCESS?[2,{code:r}]:(ie.warn("set draft fail ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o;return w(this,(function(r){switch(r.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(o=r.sent())===a.SUCCESS?[2,{code:o}]:(ie.warn("delete draft fail ->".concat(o,":").concat(Pe[o],",").concat(t)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return ie.debug("get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),R("includeMuted",e,m.BOOLEAN,!1)&&R("conversationTypes",t,m.ARRAY,!1)&&!(null==t?void 0:t.every((function(e){return!R("conversationType",e,p)})))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getTotalUnreadCount fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return!R("conversationTypes",e,m.ARRAY,!0)||!R("levels",t,m.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,p)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getTotalUnreadCountByLevels fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function ze(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return!R("conversationTypes",e,m.ARRAY,!0)||!R("levels",t,m.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,p)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getTotalUnreadMentionedCountByLevels fail ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function Ke(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),o=t.code,r=t.data,i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("get unreadCount ->".concat(i)),o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("get unreadCount fail ->".concat(o,":").concat(Pe[o],",").concat(i)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o;return w(this,(function(r){switch(r.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=r.sent(),o="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("clear unreadMsgNum ->".concat(o)),t!==a.SUCCESS?(ie.warn("clear unreadMsgNum fail ->".concat(t,":").concat(Pe[t],",").concat(o)),[2,{code:t,msg:Pe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){return w(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Le.ROAMING_SERVICE_UNAVAILABLE.code;var We=function(e){return!(!R("options.conversationType",e.conversationType,p,!0)||!R("options.targetId",e.targetId,m.STRING,!0)||!R("options.channelId",e.channelId,m.CHANNEL_ID))},Xe=function(e,t){void 0===t&&(t="");var n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId);return ie.debug("".concat(t," -> ").concat(n)),n},je=function(e,t,n){return void 0===n&&(n=""),P(void 0,void 0,void 0,(function(){var o,r;return w(this,(function(i){switch(i.label){case 0:return o=Xe(e,n),[4,t()];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("".concat(n," fail -> ").concat(r," : ").concat(Pe[r]," , ").concat(o)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))};function Qe(e,t){return P(this,void 0,void 0,(function(){return w(this,(function(n){return R("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)&&We(e)?[2,Re((function(n){return je(e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(e,t){return P(this,void 0,void 0,(function(){return w(this,(function(n){return R("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&We(e)?[2,Re((function(n){return je(e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function et(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return We(e)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t=Xe(e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return o=c.sent(),r=o.code,i=o.data,r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getConversationNotificationLevel fail -> ".concat(r," : ").concat(Pe[r]," , ").concat(t)),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.conversationType",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return ie.info("getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("getConversationNotificationStatus ->code:".concat(o,",targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ot(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return[2,Re((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 w(this,(function(o){return R("options.type",e.conversationType,p,!0)&&R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("set conversation status fail ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return[2,Re((function(e){return e.getTopConversationList()}))]}))}))}function it(e){return P(this,void 0,void 0,(function(){return w(this,(function(t){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?(ie.debug("getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),[2,Re((function(t){return t.getUnreadMentionedCount(e)}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ct(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return ie.debug("getAllUnreadMentionedCount"),[2,Re((function(e){return e.getAllUnreadMentionedCount()}))]}))}))}function st(){return P(this,void 0,void 0,(function(){return w(this,(function(e){return[2,Re((function(e){return e.getAllConversationState()}))]}))}))}function ut(e){return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.targetId",e.targetId,m.STRING,!1)&&R("options.channelType",e.channelType,(function(e){return void 0!==S[e]}),!1)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:a.SUCCESS,data:r}]:(ie.warn("get ultragroup ->".concat(o,":").concat(Pe[o])),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(r){switch(r.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=r.sent(),n=e.code,o=e.data,n===a.SUCCESS?[2,{code:a.SUCCESS,data:o}]:(ie.warn("get block ultragroup ->".concat(n,":").concat(Pe[n])),[2,{code:n,msg:Pe[n]}])}}))}))}))]}))}))}function ft(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)&&R("options.conversationType",e.conversationType,p,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("send ultraGroup OperateStatus ->".concat(t,":").concat(Pe[t])),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)&&R("options.conversationType",e.conversationType,p,!0)&&R("msgs",t,m.ARRAY,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f;return w(this,(function(l){switch(l.label){case 0:return n=e.targetId,r=e.conversationType,i=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:i})})),s={targetId:n,conversationType:r,messages:c},[4,o.getUltraGroupMessageListByMessageUId(s)];case 1:return u=l.sent(),d=u.code,f=u.data,d===a.SUCCESS?[2,{code:a.SUCCESS,data:f}]:(ie.warn("get UltraGroup MessageList by messageUId ->".concat(d,":").concat(Pe[d])),[2,{code:d,msg:Pe[d]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("expansion",e,m.OBJECT,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l;return w(this,(function(g){switch(g.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,s=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),ie.debug("update expansion for ultragroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:s,messageUId:i,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(l=g.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("update expansion for ultragroup message ->".concat(l,":").concat(Pe[l])),[2,{code:l,msg:Pe[l]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("expansion",e,m.ARRAY,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l;return w(this,(function(g){switch(g.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,s=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),ie.debug("remove expansion for ultragroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:s,messageUId:i,keys:e},[4,o.expandUltraMessage(f)];case 1:return(l=g.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("remove expansion for ultraGroup message ->".concat(l,":").concat(Pe[l])),[2,{code:l,msg:Pe[l]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("message",e,m.OBJECT,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c,s,u,d,f;return w(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,r=e.messageUId,i=e.sentTime,c=e.canIncludeExpansion,s=e.channelId,u="conversationType:".concat(t,",targetId:").concat(o,",channelId:").concat(s,",messageUId:").concat(r),ie.debug("remove all expansion for ultraGroup message ->".concat(u)),d={targetId:o,channelId:s,conversationType:t,sendTime:i,canIncludeExpansion:c,messageUId:r,removeAll:!0},[4,n.expandUltraMessage(d)];case 1:return(f=l.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("remove all expansion for ultraGroup message ->".concat(f,":").concat(Pe[f])),[2,{code:f,msg:Pe[f]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("content",e,m.OBJECT,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l,g;return w(this,(function(v){switch(v.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.senderUserId,s=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(d,",messageUId:").concat(i),ie.debug("update ultragroup message expansion ->".concat(f)),l={targetId:r,channelId:d,conversationType:n,fromUserId:c,sendTime:s,canIncludeExpansion:u,messageUId:i,content:e},[4,o.modifyMessage(l)];case 1:return(g=v.sent().code)===a.SUCCESS?[2,{code:a.SUCCESS}]:(ie.warn("modify ultraGroup message ->".concat(g,":").concat(Pe[g])),[2,{code:g,msg:Pe[g]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&R("notificationLevels",t,m.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?(ie.debug("get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),r=n.code,i=n.data,r===a.SUCCESS?[2,{code:a.SUCCESS,data:i}]:(ie.warn("get UltraGroup unreadMentionedCount by targetId error ->".concat(r,":").concat(Pe[r])),[2,{code:r,msg:Pe[r]}])}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c;return w(this,(function(s){switch(s.label){case 0:return t="getUltraGroupDefaultNotificationLevel",o="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),ie.debug("".concat(t," -> ").concat(o)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return r=s.sent(),i=r.code,c=r.data,i===a.SUCCESS?[2,{code:i,data:c}]:(ie.warn("".concat(t," fail -> ").concat(i," : ").concat(Pe[i]," , ").concat(o)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.ONLY_STRING,!0)&&R("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),ie.debug("".concat(n," -> ").concat(r)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(i=c.sent().code)===a.SUCCESS?[2,{code:i}]:(ie.warn("".concat(n," fail -> ").concat(i," : ").concat(Pe[i]," , ").concat(r)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&R("notificationLevels",t,m.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return r=u.sent(),i=r.code,c=r.data,s="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),ie.debug("".concat(n," -> ").concat(s)),i===a.SUCCESS?[2,{code:i,data:c}]:(ie.warn("".concat(n," fail -> ").concat(i,": ").concat(Pe[i],", ").concat(s)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o,r;return w(this,(function(i){switch(i.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return n=i.sent(),o=n.code,r=n.data,ie.debug(e),o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("".concat(e," fail ->").concat(o,": ").concat(Pe[o])),[2,{code:o,msg:Pe[o]}])}}))}))}))]}))}))}function St(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o,r;return w(this,(function(i){switch(i.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return n=i.sent(),o=n.code,r=n.data,ie.debug(e),o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("".concat(e," fail ->").concat(o,": ").concat(Pe[o])),[2,{code:o,msg:Pe[o]}])}}))}))}))]}))}))}function _t(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,m.STRING,!0)&&R("options.channelId",e.channelId,m.ONLY_STRING,!0)&&R("options.sentTime",e.sentTime,m.NUMBER,!0)&&R("options.count",e.count,(function(e){return d(e)&&e>0&&e<=50}),!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return t=e.targetId,o=e.channelId,r=e.sentTime,i=e.count,c={targetId:t,channelId:o,sentTime:r,count:i},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return s=f.sent(),u=s.code,d=s.data,u===a.SUCCESS?[2,{code:u,data:d}]:(ie.warn("getUltraGroupUnreadMentionedMessages fail ->".concat(u,": ").concat(Pe[u])),[2,{code:u,msg:Pe[u]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("conversation.targetId",e.targetId,m.STRING,!0)&&R("conversation.channelId",e.channelId,m.ONLY_STRING,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return i=u.sent(),c=i.code,s=i.data,c===a.SUCCESS?[2,{code:c,data:s}]:[2,{code:c,msg:Pe[c]}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Nt=function(e){return!!(R("options.key",e.key,m.STRING,!0)&&R("options.value",e.value,m.STRING,!0)&&R("options.isAutoDelete",e.isAutoDelete,m.BOOLEAN)&&R("options.isSendNotification",e.isSendNotification,m.BOOLEAN)&&R("options.notificationExtra",e.notificationExtra,m.STRING))},At=function(e){return!(!R("options.key",e.key,m.STRING,!0)||!R("options.isSendNotification",e.isSendNotification,m.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,m.STRING))};function yt(e,t){return P(this,void 0,void 0,(function(){var n,o=this;return w(this,(function(c){return R("options.count",t.count,m.NUMBER,!0)?(n=r.ID(),r.info(i.A_JOIN_CHATROOM_T,{chatroomId:e,count:t.count,joinExist:!1},{traceId:n}),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o;return w(this,(function(s){switch(s.label){case 0:return[4,c.joinChatroom(e,t.count,n)];case 1:return o=s.sent(),(o===a.SUCCESS?r.info:r.warn)(i.A_JOIN_CHATROOM_R,{code:o,timestamp:(new Date).getTime()},{traceId:n}),o!==a.SUCCESS?[2,{code:o,msg:Pe[o]}]:[2,{code:o}]}}))}))}),{tagId:i.A_JOIN_CHATROOM_R,traceId:n})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ot(e,t){return P(this,void 0,void 0,(function(){var n,o=this;return w(this,(function(c){return R("options.count",t.count,m.NUMBER,!0)?(n=r.ID(),r.info(i.A_JOIN_CHATROOM_T,{chatroomId:e,count:t.count,joinExist:!0},{traceId:n}),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o;return w(this,(function(s){switch(s.label){case 0:return[4,c.joinExistChatroom(e,t.count,n)];case 1:return o=s.sent(),(o===a.SUCCESS?r.info:r.warn)(i.A_JOIN_CHATROOM_R,{code:o,timestamp:(new Date).getTime()},{traceId:n}),o!==a.SUCCESS?[2,{code:o,msg:Pe[o]}]:[2,{code:o}]}}))}))}),{traceId:n,tagId:i.A_JOIN_CHATROOM_R})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return P(this,void 0,void 0,(function(){var t,n=this;return w(this,(function(o){return t=r.ID(),r.info(i.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:t}),[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(c){switch(c.label){case 0:return[4,o.quitChatroom(e)];case 1:return n=c.sent(),(n===a.SUCCESS?r.info:r.warn)(i.A_QUIT_CHATROOM_R,{code:n},{traceId:t}),n!==a.SUCCESS?[2,{code:n,msg:Pe[n]}]:[2,{code:n}]}}))}))}),{tagId:i.A_QUIT_CHATROOM_R,traceId:t})]}))}))}function Ut(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.count",t.count,m.NUMBER)&&R("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),ie.debug("get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return r=s.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?[2,{code:i,data:c}]:(ie.warn("get chatroom info fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&Nt(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.debug("set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("set chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("entry.key",e.key,m.STRING,!0)||!R("entry.value",e.value,m.STRING,!0)}))||!R("options.isAutoDelete",e.isAutoDelete,m.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,m.STRING)||!R("options.isForce",e.isForce,m.BOOLEAN))}(t)?t.entries.length>10?[2,Le.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),ie.debug("set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return r=s.sent(),i=r.code,c=r.data,i!==a.SUCCESS?(ie.warn("set chatroom entry fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i],data:c}]):[2,{code:i}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&Nt(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.debug("force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("force set chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&At(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.debug("remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("remove chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("key",e,m.STRING,!0)}))||!R("options.notificationExtra",e.notificationExtra,m.STRING))}(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),ie.info("remove chatroom entry->".concat(n)),(r=L({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,r)];case 1:return i=u.sent(),c=i.code,s=i.data,c!==a.SUCCESS?(ie.warn("remove chatroom entry fail ->code+:".concat(Pe[c],",").concat(n)),[2,{code:c,msg:Pe[c],data:s}]):[2,{code:c}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("targetId",e,m.STRING,!0)&&At(t)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="id:".concat(e),ie.info("force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("force remove chatroom entry fail ->code+:".concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),ie.debug("get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return r=s.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?[2,{code:i,data:c}]:(ie.warn("get chatroom entry fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),ie.debug("get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return o=c.sent(),r=o.code,i=o.data,r===a.SUCCESS&&i?[2,{code:r,data:i}]:(ie.warn("get all chatroom entries fail ->code+:".concat(Pe[r],",").concat(t)),[2,{code:r,msg:Pe[r]}])}}))}))}))]}))}))}function kt(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.timestamp",t.timestamp,m.NUMBER)&&R("options.count",t.count,m.NUMBER)&&R("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),ie.debug("get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return r=u.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?(s=c.list.map((function(e){return ce(e)})),[2,{code:i,data:{list:s,hasMore:!!c.hasMore}}]):(ie.warn("get chatroom history message fail ->code+:".concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Pe[t]}]}}))}))}))]}))}))}function Vt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("userId",e,m.STRING,!0)?(ie.info("addToBlacklist -> userId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("userId",e,m.STRING,!0)?(ie.info("removeFromBlacklist -> userId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return ie.info("getBlacklist -> "),[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(r){switch(r.label){case 0:return[4,t.getBlacklist()];case 1:return e=r.sent(),n=e.code,o=e.data,n===a.SUCCESS&&o?[2,{code:n,data:o}]:(ie.warn("getBlacklist fail -> code: ".concat(n)),[2,{code:n}])}}))}))}))]}))}))}function Zt(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("userId",e,m.STRING,!0)?(ie.info("getBlacklistStatus -> userId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getBlacklistStatus(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:0===r}]:(ie.warn("getBlacklistStatus fail -> code: ".concat(o,", userId: ").concat(e)),[2,{code:o}])}}))}))}))]):[2,{code:a.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 Jt,Yt,Wt=Kt("RC:ImgMsg"),Xt=Kt("RC:HQVCMsg"),jt=Kt("RC:SightMsg"),Qt=Kt("RC:TxtMsg"),$t=Kt("RC:CombineMsg"),en=Kt("RC:FileMsg"),tn=Kt("RC:GIFMsg"),nn=Kt("RC:VcMsg"),on=Kt("RC:LBSMsg"),an=Kt("RC:ReferenceMsg"),rn=Kt("RC:ImgTextMsg"),cn={qiniu:function(e,t,n,o){he((function(a){var r=a.getInfoFromCache();if(1===(null==r?void 0:r.type)&&t.chunk_size&&o.size>t.chunk_size){var i=C();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,vn(o,t,n)}else gn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>un)throw new Error("the file size is over 5GB!");var a=t||{};t=t||Yt;var r=new XMLHttpRequest,i=dn();if(!a.uploadHost.bos&&!a.bosUploadPath)return;var c=i+sn[0][1]+a.bosUploadPath;sn.shift();var s=a.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:c,isBosRes:!0};r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});r.onreadystatechange=function(){if(4===r.readyState)if(JSON.parse(r.responseText||"{}").filename=t.uniqueValue,200===r.status){n.onCompleted(u,!0)}else sn.length?cn[sn[0][0]](e,t,n,o):n.onError("upload fail")},r.open(t.method,c,!0),r.setRequestHeader("authorization",s.bosToken),r.setRequestHeader("x-bce-date",s.bosDate),r.send(o)},aliyun:function(e,t,n,o){if(o.size>un)throw new Error("the file size is over 5GB!");var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token"));var r=sn[0][1];sn.shift(),e=e||Jt,t=(t=t||{})||Yt;var i=new XMLHttpRequest,c=dn(),s="".concat(c+t.ossBucketName,".").concat(r);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):sn.length?cn[sn[0][0]](a,t,n,o):n.onError("upload fail")}},i.open(t.method,s,!0),console.log("ali:url",s);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 a=new FormData,r=new XMLHttpRequest,i=dn(),c=t.contentDisposition,s=sn[0][1],u="".concat(i+t.s3BucketName,".").concat(s);console.log("uploadS3:url",u),sn.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.AWS,200===r.status||204===r.status)n.onCompleted(a);else if(sn.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[sn[0][0]](i,t,n,o)}else n.onError("upload fail")}},r.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;c?a.set("Content-Disposition","".concat(c,";")):a.set("Content-Disposition","text/html"===f?"inline;":"attachment;");a.set("Content-Type",f),a.set("x-amz-credential",d.s3Credential),a.set("x-amz-algorithm",d.s3Algorithm),a.set("x-amz-date",d.s3Date),a.set("policy",d.s3Policy),a.set("x-amz-signature",d.s3Signature),a.set("key",t.uploadFileName),a.set("file",o),r.send(a)},stc:function(e,t,n,o){var a=new XMLHttpRequest,r=t.contentDisposition,i=sn[0][1],c="https://".concat(i,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);sn.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?N.STC:"",200===a.status||204===a.status)n.onCompleted(r);else if(sn.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),cn[sn[0][0]](i,t,n,o)}else n.onError("upload fail")}},a.open("PUT",c,!0);var s=t?t.stcHeader:{};a.setRequestHeader("Content-Type",o.type),r?a.setRequestHeader("Content-Disposition","".concat(r,";")):a.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");a.setRequestHeader("Authorization",s.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",s.stcContentSha256),a.setRequestHeader("x-amz-date",s.stcDate),a.send(o)}},sn=[],un=5368709120;function dn(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var fn,ln=(fn="RC-upload-",{get:function(e){e=fn+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=fn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=fn+e,localStorage.removeItem(e)}});function gn(e,t,n,o){var a="https://"+t.uploadHost.qiniu,r=(/http/.test(sn[0][1])?"":dn())+sn[0][1]||a;t.isChunk||sn.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 a=JSON.parse(i.responseText||"{}");a.filename=t.uniqueValue,a.uploadMethod=N?N.QINIU:"",200===i.status||204===i.status?n.onCompleted(a):sn.length?cn[sn[0][0]](e,t,n,o):n.onError("upload fail")}},i.open(t.method,r,!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 vn(e,t,n,o){var a=0,r=o||C(),i=ln.get(r);i&&(e.uniqueName=i.sessionId,a=i.offset);var c=Math.min(t.chunk_size,e.size-a),s=e.slice(a,a+c),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(a,"-").concat(a+c);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,s.name=e.name,s=function(e,t,n){var o=new FormData;for(var a in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var r=t.multi_parmas[a];o.append(a,r)}return o}(s,t,e.uniqueName),gn(s,t,{onCompleted:function(o){a+=c;var i=e.uniqueName;ln.set(r,{offset:a,sessionId:i}),a<e.size?vn(e,t,n,r):(a=0,ln.remove(r),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var r=e+a;n.onProgress(r,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function In(e,t,n,o){var a,r,i=t&&t.type||"text/plain",c=i.indexOf("image")>-1?1:4,s=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(c,a,"POST",l).then((function(e){a=e.fileName,r="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(a),console.log("uploadStcMultipart:url",r);var c=new XMLHttpRequest;c.open("POST","".concat(r,"?").concat(l),!0),s?c.setRequestHeader("Content-Disposition","".concat(s,";")):c.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),c.setRequestHeader("Authorization",e&&e.stcAuthorization),c.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),c.setRequestHeader("x-amz-date",e&&e.stcDate),c.setRequestHeader("Content-Type",i),c.send(),c.onreadystatechange=function(){if(4===c.readyState){var e=c.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===c.status||204===c.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(h(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(s,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(s);if(v.size===u)e.getFileToken(c,a,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",s);var a=new XMLHttpRequest;a.open("POST","".concat(r,"?").concat(d),!0),a.setRequestHeader("Authorization",e&&e.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),a.setRequestHeader("x-amz-date",e&&e.stcDate),a.setRequestHeader("Content-Type",i);var c="<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){c+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",a.send(c),console.log("xml",c),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.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,R=g;l<R.length;l++){var m=R[l];f.push(h(s,m))}I(s,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,a=g;n<a.length;n++){var r=a[n];t.push(h(s,r))}I(s,t)}))}function h(o,s){return new Promise((function(u,d){var f="partNumber=".concat(s,"&uploadId=").concat(o);e.getFileToken(c,a,"PUT",f).then((function(e){console.log("signature ".concat(s," onSuccess"),e);var o=t&&t.slice((s-1)*n.stc_chunk_size,s*n.stc_chunk_size);console.log("fileChunk:size",o.size);var a=new XMLHttpRequest;a.open("PUT","".concat(r,"?").concat(f),!0),a.setRequestHeader("Authorization",e&&e.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),a.setRequestHeader("x-amz-date",e&&e.stcDate),a.setRequestHeader("Content-Type",i),a.send(o),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.status){var e=a.getResponseHeader("etag");console.log("etag:".concat(s),e),v.set(s,e),u(e)}else g.includes(s)||g.push(s),d(s)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(s)||g.push(s),d(s)}))}))}}var hn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),a=Rn()+o;n.append(t.unique_key,a),t.uniqueValue=a}return n.append(t.file_data_name,e),mn(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(".")),a=Rn()+o;n[t.unique_key]=a,t.uniqueValue=a}return n[t.file_data_name]=e,mn(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Rn(){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 mn(e,t){for(var n in e)t(n,e[n])}var pn,En=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:Rn};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;mn(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var a=this;!function(e,t,n,o,a){Jt=n,Yt=o,sn=[];var r,i=e.getInfoFromCache();if(1===(null==i?void 0:i.type)&&t.uploadDomain)sn=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var c,s,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&&(c=e[n]),"stc"===n&&(s=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&sn.push(e)})),u.length!==sn.length&&(sn=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",c],["stc",s]])}else sn=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),r=l.find((function(e){return Object.keys(e).includes("stc")}))}if(r&&1===parseInt(r.p,10)&&n.size>=4194304)In(e,n,o,a);else{var g=o.data(n,o);cn[sn[0][0]](g,o,a,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(pn=e,n)?pn=En+e/t*(t-En):En=pn;o.onProgress(pn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){a.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 Sn,_n,Cn={init:function(e){return new Tn(e)},dataType:hn,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),a=new FileReader;a.readAsDataURL(e),a.onload=function(e){var a=e.target.result,r=new Image;r.src=a;var i=r.width,c=r.height,s=function(e,t){var n=1,o=e.width,a=t.maxWidth||0;a>0&&o>a&&(n=a/o);var r=e.height,i=t.maxHeight||0;if(i>0&&r>i){var c=i/r;n=Math.min(n,c)}var s=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>s){var d=s/u;n=Math.min(n,d)}return n}({width:i,height:c,size:e.total},t),u=a;s<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")}(r,i*s,c*s)),n(u)}},Upload:Tn},Nn=function(e,t,n){var o=document.createElement("canvas"),a=o.getContext("2d"),r=new Image,i="string"==typeof e;r.onload=function(i){var c=function(e,t,n){var o,a,r,i=e<t,c=0,s=0;return(i?t/e:e/t)>n.scale?(i?(a=100,s=((r=t/(o=e/100))-n.maxHeight)/2):(r=100,c=((a=e/(o=t/100))-n.maxWidth)/2),{w:a,h:r,x:-c,y:-s}):(i?(o=t/n.maxHeight,r=n.maxHeight,a=e/o):(o=e/n.maxWidth,a=n.maxWidth,r=t/o),{w:a,h:r,x:-c,y:-s})}(r.width,r.height,t);o.width=c.w>t.maxWidth?t.maxWidth:c.w,o.height=c.h>t.maxHeight?t.maxHeight:c.h,a.drawImage(r,c.x,c.y,c.w,c.h);var s=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);s=s.replace(/data:image\/[^;]+;base64,/,""),n(s)},r.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;Nn(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 a=Cn.init(e);t(a)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Cn.init(e);t(n)}},On=function(e,t,n,o,a){o.upload(e,t,n.file,{onError:function(e){a.onError(e)},onProgress:function(e,t){a.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,a.onCompleted(e)})):a.onCompleted(e)}})},Mn=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){On(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Un=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var a={file:n,compress:this.cfg};On(e,t,a,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ln=function(e,t){yn(e,(function(e){var n=new Mn(e);t(n)}))},Pn=function(e,t){yn(e,(function(n){var o,a,r,i,c={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.maxWidth)||160,quality:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},s=new Un(n,c);t(s)}))};Cn.dataType;function wn(e,t,n,o){var a=this;return void 0===t&&(t=y.FILE),he((function(r,i){var c;c=t===y.IMAGE?y.IMAGE:y.FILE;var s=r.getInfoFromCache();if(!_n&&(_n="upload.qiniup.com",s&&s.ossConfig))try{var u=JSON.parse(s.ossConfig).find((function(e){return void 0!==e.qiniu}));u&&(_n=u.qiniu)}catch(e){}var d=L({domain:_n,getToken:function(e){r.getFileToken(c).then((function(t){e(t.token,t)})).catch((function(e){n.onFail(e)}))}},o);(c===y.IMAGE?Pn:Ln)(d,(function(o){o.upload(r,i,e,{onProgress:function(e,t){var o,a=Math.floor(e/t*100);null===(o=n.onProgress)||void 0===o||o.call(n,a)},onCompleted:function(o){return P(a,void 0,void 0,(function(){return w(this,(function(a){return 1===(null==s?void 0:s.type)?function(e,t,n,o,a){he((function(t,r){var i={type:n.type,name:o.rc_url.file_name,downloadUrl:r.uploadDomain+o.rc_url.path};e!==y.AUDIO?(e===y.IMAGE&&(i.thumbnail=o.thumbnail),a.onSuccess(i)):Dn(n).then((function(e){a.onSuccess(L(L({},i),e))}))}))}(t,0,e,o,n):function(e,t,n,o,a){Gn(t,o.filename,o.name,o,o.uploadMethod).then((function(r){if(0===r.code){var i=r.data;i.type=n.type,i.name=o.name||o.filename,e!==y.AUDIO?(t===y.IMAGE&&(i.thumbnail=o.thumbnail),a.onSuccess(i)):Dn(n).then((function(e){a.onSuccess(L(L({},i),e))}))}else a.onFail(r)})).catch((function(e){a.onFail(e)}))}(t,c,e,o,n),[2]}))}))},onError:function(e){n.onFail(e)}})}))}))}function Dn(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 Sn=Sn||new AudioContext,new Promise((function(t,n){Sn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Bn(e,t,n,o){return Re((function(r){return new Promise((function(i){r.getFileToken(e,t,n,o).then((function(e){i({code:a.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:Pe[e]})}))}))}))}function Gn(e,t,n,o,r){return R("fileType",e,A,!0)&&R("filename",t,m.STRING)&&R("saveName",n,m.STRING)&&R("serverType",r,m.NUMBER)?Re((function(i){return new Promise((function(c){i.getFileUrl(e,t,n,o,r).then((function(e){c({code:a.SUCCESS,data:e})})).catch((function(e){c({code:e})}))}))})):Promise.resolve({code:a.BIZ_ERROR_INVALID_PARAMETER})}function xn(e,t,n){return P(this,void 0,void 0,(function(){var o,c,d,f=this;return w(this,(function(l){return n=n||{},t instanceof zt==!1?(ie.warn("send message fail -> message parameter is not an instance of BaseMessage"),[2,Le.ILLGAL_PARAMS]):R("conversation",e,m.OBJECT,!0)?(o=e.conversationType,c=e.targetId,d=e.channelId,R("conversation.targetId",c,m.STRING,!0)&&R("conversation.conversationType",o,m.NUMBER)&&R("conversation.channelId",d,m.CHANNEL_ID)&&R("options.isStatusMessage",null==n?void 0:n.isStatusMessage,m.BOOLEAN)&&R("options.disableNotification",null==n?void 0:n.disableNotification,m.BOOLEAN)&&R("options.pushContent",null==n?void 0:n.pushContent,m.STRING)&&R("options.pushData",null==n?void 0:n.pushData,m.STRING)&&R("options.isMentioned",null==n?void 0:n.isMentioned,m.BOOLEAN)&&R("options.mentionedType",null==n?void 0:n.mentionedType,m.NUMBER)&&R("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,m.ARRAY)&&R("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,m.ARRAY)&&R("options.isVoipPush",null==n?void 0:n.isVoipPush,m.BOOLEAN)&&R("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,m.BOOLEAN)&&R("options.expansion",null==n?void 0:n.expansion,m.OBJECT)&&R("options.pushConfig",null==n?void 0:n.pushConfig,m.OBJECT)&&R("options.messageId",null==n?void 0:n.messageId,m.NUMBER)?[2,Re((function(l,g){return P(f,void 0,void 0,(function(){var f,g,v,I,h,R,m,p,E;return w(this,(function(T){switch(T.label){case 0:return f="conversationType:".concat(o,",targetId:").concat(c),ie.debug("send message ->".concat(f)),g=function(e,t,n){var o=e.isStatusMessage,a=e.disableNotification,r=e.pushContent,i=e.pushData,c=e.isMentioned,s=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return L({isStatusMessage:o,disableNotification:a,pushContent:r,pushData:i,isMentioned:c,mentionedType:s,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},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:l.getCurrentUserId(),messageUId:"",messageDirection:M.SEND,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:s.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig},o!==u.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(ce(v))}catch(e){r.error('Callback method "onSendBefore" execution error',e)}},h=r.ID(),r.info(i.A_SEND_MSG_T,{messageType:t.messageType,conversationType:o,targetId:c,channelId:d},{traceId:h}),[4,l.sendMessage(o,c,g,I,h)];case 1:return R=T.sent(),m=R.code,p=R.data,(m===a.SUCCESS?r.info:r.warn)(i.A_SEND_MSG_R,{code:m,messageUId:p?p.messageUId:"",messageId:p?p.messageId:""},{traceId:h}),m===a.SUCCESS?(E=ce(p),[2,{code:m,data:E}]):(ie.warn("send message fail ->".concat(m,":").concat(Pe[m],",").concat(f)),v.sentTime=(null==p?void 0:p.sentTime)||0,[2,{code:m,msg:Pe[m],data:ce(v)}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kn(e,t,n){return xn(e,new Qt(t),n)}function Hn(e,t){return function(n,o,c,s){if(!R("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:a.BIZ_ERROR_INVALID_PARAMETER});var u={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){var d=null==s?void 0:s.thumbnailConfig;if(!(R("sendOptions.maxHeight",null==d?void 0:d.maxHeight,m.NUMBER)&&R("sendOptions.maxWidth",null==d?void 0:d.maxWidth,m.NUMBER)&&R("sendOptions.quality",null==d?void 0:d.quality,m.NUMBER)&&R("sendOptions.scale",null==d?void 0:d.scale,m.NUMBER)))return Promise.resolve({code:a.BIZ_ERROR_INVALID_PARAMETER});u.thumbnailConfig=d}return new Promise((function(d){var f=r.ID();r.info(i.L_MEDIA_UPLOAD_T,{filesize:o.file.size,type:e},{traceId:f}),wn(o.file,e,{onProgress:null==c?void 0:c.onProgress,onSuccess:function(e){var u,l=(null===(u=null==c?void 0:c.onComplete)||void 0===u?void 0:u.call(c,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&r.info(i.L_MEDIA_UPLOAD_R,{downurl:e.downloadUrl,code:a.SUCCESS},{traceId:f}),xn(n,l,s).then(d)},onFail:function(e){r.warn(i.L_MEDIA_UPLOAD_R,{code:a.UPLOAD_FILE_FAILED},{traceId:f}),d({code:a.UPLOAD_FILE_FAILED,msg:e||a[a.UPLOAD_FILE_FAILED]})}},u)}))}}var Vn=Hn(y.FILE,(function(e,t){return new en({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})})),Fn=Hn(y.IMAGE,(function(e,t){return new Wt({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),qn=Hn(y.AUDIO,(function(e,t){return new Xt({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Zn=Hn(y.SIGHT,(function(e,t){return new jt({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,o=this;return w(this,(function(c){return R("options.timestamp",null==t?void 0:t.timestamp,m.NUMBER)&&R("options.count",null==t?void 0:t.count,m.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?(n=r.ID(),r.info(i.A_GET_HISTORY_MSG_T,{targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count},{traceId:n}),[2,Re((function(c){return P(o,void 0,void 0,(function(){var o,s,u,d;return w(this,(function(f){switch(f.label){case 0:return[4,c.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 o=f.sent(),s=o.code,u=o.data,s===a.SUCCESS&&u?(d=u.list.map((function(e){return ce(e)})),r.info(i.A_GET_HISTORY_MSG_R,{code:s,messageLength:d.length},{traceId:n}),[2,{code:s,data:{list:d,hasMore:u.hasMore}}]):(r.warn(i.A_GET_HISTORY_MSG_R,{code:s,messageUIds:""},{traceId:n}),[2,{code:s,msg:Pe[s]}])}}))}))}),{tagId:i.A_GET_HISTORY_MSG_R,traceId:n})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kn(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.timestamp",null==t?void 0:t.timestamp,m.NUMBER)&&R("options.count",null==t?void 0:t.count,m.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("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 r=u.sent(),i=r.code,c=r.data,i===a.SUCCESS&&c?(s=c.list.map((function(e){return ce(e)})),[2,{code:i,data:{list:s,hasMore:c.hasMore}}]):(ie.warn("get history message fail ->".concat(i,":").concat(Pe[i],",").concat(n)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jn(e,t,n,o){return P(this,void 0,void 0,(function(){var a=this;return w(this,(function(r){return[2,Re((function(r){return P(a,void 0,void 0,(function(){var a,r,i,c,s;return w(this,(function(d){switch(d.label){case 0:return a={targetId:e,conversationType:u.PRIVATE,channelId:o},r=new zt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,xn(a,r)];case 1:return i=d.sent(),c=i.code,s=i.msg,0===c?[2,{code:c}]:[2,{code:c,msg:s}]}}))}))}))]}))}))}function Yn(e,t,n){return P(this,void 0,void 0,(function(){var o,r,i,c,s;return w(this,(function(d){switch(d.label){case 0:return R("messageUId",t,m.STRING,!0)&&R("channelId",n,m.CHANNEL_ID)?(o="messageUId:".concat(t,",targetId:").concat(e),ie.debug("send read receipt message ->".concat(o)),r=new zt("RC:RRReqMsg",{messageUId:t}),[4,xn({targetId:e,conversationType:u.GROUP,channelId:n},r)]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}];case 1:return i=d.sent(),c=i.code,s=i.msg,0===c?[2,{code:c}]:[2,{code:c,msg:s}]}}))}))}function Wn(e,t,n){return P(this,void 0,void 0,(function(){return w(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 w(this,(function(r){return R("targetId",e,m.STRING,!0)&&R("messageList",t,m.OBJECT,!0)&&R("channelId",n,m.CHANNEL_ID)&&!Object.keys(t).every((function(e){return!R(e,t[e],m.ARRAY)}))?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s,d,f,l;return w(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:u.GROUP,channelId:n},c=r.getInfoFromCache(),0!==(s=(null==c?void 0:c.grpRRVer)||0)?[3,2]:(d=new zt("RC:RRRspMsg",{receiptMessageDic:t}),[4,xn(o,d)]);case 1:return i=g.sent(),[3,4];case 2:return 1!==s?[3,4]:(f=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===f.indexOf(e)&&f.push(e)}))})),f.length?[4,r.sendReadReceiptMessage(e,f,n)]:(ie.warn("Error in parameter messageList."),[2,{code:a.PARAMETER_ERROR}]));case 3:i=g.sent(),g.label=4;case 4:return(l=i.code)===a.SUCCESS?[2,{code:l}]:(ie.warn("send read receipt message fail ->".concat(l,":").concat(Pe[l])),[2,{code:l,msg:Pe[l]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e,t){return P(this,void 0,void 0,(function(){var n,o,r,i;return w(this,(function(c){switch(c.label){case 0:return R("conversation.type",e.conversationType,m.NUMBER,!0)&&R("conversation.targetId",e.targetId,m.STRING,!0)&&R("lastMessageSendTime",t,m.NUMBER,!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?(n=new zt("RC:SRSMsg",{lastMessageSendTime:t}),[4,xn(e,n)]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=c.sent(),r=o.code,i=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:i}]}}))}))}function Qn(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.messageUId",t.messageUId,m.STRING,!0)&&R("options.sentTime",t.sentTime,m.NUMBER,!0)&&R("options.disableNotification",null==t?void 0:t.disableNotification,m.BOOLEAN)&&R("options.pushConfig",null==t?void 0:t.pushConfig,m.OBJECT)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s;return w(this,(function(u){switch(u.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},r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),ie.debug("recall message ->".concat(r)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c===a.SUCCESS&&s?[2,{code:c,data:ce(s)}]:c===a.SUCCESS?[2,{code:c}]:(ie.warn("recall message fail ->".concat(c,":").concat(Pe[c],",").concat(r)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $n(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options",t,(function(e){return v(e)&&e.length}),!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)&&!t.every((function(e){return!R("options.messageUId",e.messageUId,m.STRING,!0)||!R("options.sentTime",e.sentTime,m.NUMBER,!0)||!R("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("delete message fail ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:a.SUCCESS}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("options.timestamp",t,m.NUMBER,!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r;return w(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),ie.debug("clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(r=i.sent())!==a.SUCCESS?(ie.warn("clear message ->".concat(r,":").concat(Pe[r],",").concat(n)),[2,{code:r,msg:Pe[r]}]):[2,{code:a.SUCCESS}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("expansion",e,m.OBJECT,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f;return w(this,(function(l){switch(l.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.canIncludeExpansion,s=t.expansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",messageUId:").concat(i),ie.debug("update message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:r,messageUId:i,expansion:e,canIncludeExpansion:c,originExpansion:s,channelId:u})];case 1:return(f=l.sent().code)!==a.SUCCESS?(ie.warn("update message expansion fail ->".concat(f,":").concat(Pe[f],",").concat(d)),[2,{code:f,msg:Pe[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function no(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("keys",e,m.ARRAY,!0)&&R("message",t,m.OBJECT,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.canIncludeExpansion,s=t.channelId,u="conversationType:".concat(n,",targetId:").concat(r,",messageUId:").concat(i),ie.debug("remove message expansion ->".concat(u)),[4,o.sendExpansionMessage({conversationType:n,targetId:r,messageUId:i,canIncludeExpansion:c,keys:e,channelId:s})];case 1:return(d=f.sent().code)!==a.SUCCESS?(ie.warn("remove message expansion fail ->".concat(d,":").concat(Pe[d],",").concat(u)),[2,{code:d,msg:Pe[d]}]):[2,{code:d}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,t){return P(this,void 0,void 0,(function(){var n,o,c=this;return w(this,(function(s){return R("typingContentType",t,m.STRING,!0)?(n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},o=r.ID(),r.info(i.A_SEND_MSG_T,{messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},{traceId:o}),[2,Re((function(t){return P(c,void 0,void 0,(function(){var c,s,u;return w(this,(function(d){switch(d.label){case 0:return[4,t.sendMessage(e.conversationType,e.targetId,n,void 0,o)];case 1:return c=d.sent(),s=c.code,u=c.data,(s===a.SUCCESS?r.info:r.warn)(i.A_SEND_MSG_R,{code:s,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""},{traceId:o}),s===a.SUCCESS?[2,{code:s,data:ce(u)}]:[2,{code:s,msg:Pe[s]}]}}))}))}),{tagId:i.A_SEND_MSG_R,traceId:o})]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ao(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return R("messageUId",t,m.STRING,!0)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s;return w(this,(function(u){switch(u.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),ie.debug("get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c===a.SUCCESS?[2,{code:c,data:s}]:(ie.warn("get message reader fail ->".concat(c,":").concat(Pe[c],",").concat(o)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,t,n,o,a){return he((function(c){return g("messageType",e,m.STRING,!0),g("isPersited",t,m.BOOLEAN,!0),g("isCounted",n,m.BOOLEAN,!0),g("isStatusMessage",a,m.BOOLEAN,!1),r.info(i.A_REGTYP_O,{messageType:e,isCounted:n,isStatusMessage:a,isPersited:t}),c.registerMessageType(e,t,n,o,a),Kt(e,t,n)}))}function io(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?R("conversation.conversationType",e.conversationType,m.NUMBER,!0)&&R("conversation.targetId",e.targetId,m.STRING,!0)&&R("conversation.channelId",null==e?void 0:e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:r}]:(ie.warn("insertMessage ->code:".concat(o,",targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function co(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return ue("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),O()?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s,u,d,f,l,g,v,I,h,R,m,p,E;return w(this,(function(T){switch(T.label){case 0:return o=t.senderUserId,i=t.messageType,c=t.content,s=t.messageDirection,u=t.messageUId,d=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,g=t.sentTime,v=t.sentStatus,ie.info("insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,R={senderUserId:o,messageType:i,content:c,messageDirection:s,sentTime:g,sentStatus:v,searchContent:h,isUnread:I,messageUId:u,disableNotification:l,canIncludeExpansion:d,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,R)];case 1:return m=T.sent(),p=m.code,E=m.data,p===a.SUCCESS?[2,{code:p,data:ce(E)}]:(ie.warn("insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:Pe[p]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function so(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,n.getMessage(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:ce(r)}]:(ie.warn("getMessage ->code:".concat(o,",messageId:").concat(e)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function uo(e){if(!O())return{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId;return R("conversationType",n,m.NUMBER,!0)&&R("targetId",o,m.STRING,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o),r=[];return t&&t.length&&t.forEach((function(e){return r.push(ce(e))})),{code:a.SUCCESS,data:r}},le?t(le,ge):{code:a.BIZ_ERROR_CLIENT_NOT_INIT}):{code:a.BIZ_ERROR_INVALID_PARAMETER}}function fo(e,t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return ue("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),O()?R("conversationType",e.conversationType,m.NUMBER,!0)&&R("targetId",e.targetId,m.STRING,!0)&&R("keyword",t,m.STRING,!0)&&R("timestamp",n,m.NUMBER)&&R("count",o,m.NUMBER)?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s,u;return w(this,(function(d){switch(d.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=d.sent(),c=r.code,s=r.data,c===a.SUCCESS?(u=[],(null==s?void 0:s.messages)&&s.messages.length&&s.messages.forEach((function(e){return u.push(ce(e))})),[2,{code:c,data:{messages:u,count:null==s?void 0:s.count}}]):(ie.warn("searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function lo(e,t,n){return P(this,void 0,void 0,(function(){var o,c,s,u=this;return w(this,(function(d){return ue("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),O()?(o=e.conversationType,c=e.targetId,s=e.channelId,R("conversationType",o,m.NUMBER,!0)&&R("targetId",c,m.STRING,!0)&&R("timestamp",t,m.NUMBER,!0)&&R("cleanSpace",n,m.BOOLEAN)?[2,Re((function(d){return P(u,void 0,void 0,(function(){var u;return w(this,(function(f){switch(f.label){case 0:return[4,d.deleteMessagesByTimestamp(o,c,t,n,s)];case 1:return u=f.sent(),r.debug(i.A_DELETE_MESSAGES_S,{code:u,conversationType:o,targetId:c,channelId:s,timestamp:t}),u===a.SUCCESS?[2,{code:u}]:(ie.warn("deleteLocalMessagesByTimestamp ->code:".concat(u,",targetId:").concat(e.targetId)),[2,{code:u,msg:Pe[u]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function go(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return ue("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),O()?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,ie.info("clearMessages ->targetId:".concat(o,",conversationType:").concat(t)),[4,n.clearMessages(t,o,r)];case 1:return(i=c.sent())===a.SUCCESS?[2,{code:i}]:(ie.warn("clearMessages ->code:".concat(i,",targetId:").concat(o)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function vo(e,t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return ue("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),O()?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s;return w(this,(function(u){switch(u.label){case 0:return ie.info("searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,n,o,t)];case 1:return r=u.sent(),c=r.code,s=r.data,c===a.SUCCESS?[2,{code:c,data:s}]:(ie.warn("searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function Io(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c;return w(this,(function(s){switch(s.label){case 0:return n=e.conversationType,r=e.targetId,i=e.channelId,ie.info("clearUnreadCountByTimestamp ->targetId:".concat(r,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,r,t,i)];case 1:return(c=s.sent())===a.SUCCESS?[2,{code:c}]:(ie.warn("clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function ho(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return ue("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),O()?R("messageId",e,m.NUMBER,!0)&&R("receivedStatus",t,m.NUMBER,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=r.sent())===a.SUCCESS?[2,{code:n}]:(ie.warn("setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}function Ro(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("tag.tagId",e.tagId,m.STRING,!0)&&R("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&R("tag.tagName",e.tagName,m.STRING,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return ie.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:t}]:(ie.warn("createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("tagId",e,m.STRING,!0)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return ie.info("removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:t}]:(ie.warn("removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("tag.tagId",e.tagId,m.STRING,!0)&&R("tag.tagName",e.tagName,m.STRING,!0)&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t;return w(this,(function(o){switch(o.label){case 0:return ie.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=o.sent().code)===a.SUCCESS?[2,{code:t}]:(ie.warn("updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Pe[t]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(r){switch(r.label){case 0:return[4,t.getTagList()];case 1:return e=r.sent(),n=e.code,o=e.data,n===a.SUCCESS?[2,{code:a.SUCCESS,data:o}]:(ie.warn("getTagList ->code:".concat(n)),[2,{code:n,msg:Pe[n]}])}}))}))}))]}))}))}function To(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return R("conversationType",e.conversationType,m.NUMBER)&&R("targetId",e.targetId,m.STRING)&&R("channelId",e.channelId,m.CHANNEL_ID)?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r;return w(this,(function(i){switch(i.label){case 0:return ie.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=i.sent(),o=t.code,r=t.data,o===a.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:Pe[o]}]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("conversations",t,m.ARRAY,!0)&&!t.every((function(e){return!R("conversation.conversationType",e.conversationType,m.NUMBER,!0)||!R("conversation.targetId",e.targetId,m.STRING,!0)||!R("conversation.channelId",e.channelId,m.CHANNEL_ID)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("conversations",t,m.ARRAY,!0)&&!t.every((function(e){return!R("conversation.conversationType",e.conversationType,m.NUMBER,!0)||!R("conversation.targetId",e.targetId,m.STRING,!0)||!R("conversation.channelId",e.channelId,m.CHANNEL_ID)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("conversation.conversationType",e.conversationType,m.NUMBER,!0)&&R("conversation.targetId",e.targetId,m.STRING,!0)&&R("conversation.channelId",e.channelId,m.CHANNEL_ID)&&R("tagIds",t,m.ARRAY,!0)&&!t.every((function(e){return!R("tagId",e,m.STRING,!0)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("conversations",t,m.ARRAY,!0)&&!t.every((function(e){return!R("conversation.conversationType",e.conversationType,m.NUMBER,!0)||!R("conversation.targetId",e.targetId,m.STRING,!0)||!R("conversation.channelId",e.channelId,m.CHANNEL_ID)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n;return w(this,(function(r){switch(r.label){case 0:return ie.info("removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=r.sent().code)===a.SUCCESS?[2,{code:n}]:(ie.warn("removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Pe[n]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return R("tagId",e,m.STRING,!0)&&R("count",t,m.NUMBER,!0)&&R("startTime",n,m.NUMBER,!0)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c;return w(this,(function(s){switch(s.label){case 0:return ie.info("getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=s.sent(),i=o.code,c=o.data,i===a.SUCCESS?[2,{code:i,data:c}]:(ie.warn("getConversationListByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return R("tagId",e,m.STRING,!0)&&R("containMuted",t,m.BOOLEAN,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i;return w(this,(function(c){switch(c.label){case 0:return ie.info("getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),r=n.code,i=n.data,ie.info(r,i),r===a.SUCCESS?[2,{code:r,data:i}]:(ie.warn("getUnreadCountByTag ->code:".concat(r,",tagId:").concat(e)),[2,{code:r,msg:Pe[r]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return R("tagId",e,m.STRING,!0)&&R("conversation.targetId",t.targetId,m.STRING,!0)&&R("conversation.conversationType",t.conversationType,m.NUMBER,!0)&&R("conversation.channelId",t.channelId,m.CHANNEL_ID)&&R("status.isTop",n,m.BOOLEAN,!0)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o;return w(this,(function(i){switch(i.label){case 0:return ie.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=i.sent().code)===a.SUCCESS?[2,{code:o}]:(ie.warn("setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Pe[o]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Hn(y.COMBINE_HTML,(function(e,t){return new $t({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Mo={COMET:"comet",WEBSOCKET:"websocket"},Uo={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 w(this,(function(n){return O()?R("channelId",e,m.ONLY_STRING)?(ie.info("getAllConversationList -> channelId: ".concat(e)),[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return U(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 o=t.code,r=t.data,o===a.SUCCESS&&r?(i=r.map((function(e){return se(e)})),[2,{code:o,data:i}]):(ie.warn("getAllConversationList fail -> code: ".concat(o," channelId: ").concat(e)),[2,{code:o,msg:Pe[o]}])}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return O()?R("startTime",e,m.NUMBER,!0)&&R("count",t,m.NUMBER,!0)&&R("channelId",n,m.ONLY_STRING)?[2,Re((function(r){return P(o,void 0,void 0,(function(){var o,i,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),ie.info("getConversationList -> ".concat(o)),U(n)?[4,r.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return i=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,t,n)];case 3:i=f.sent(),f.label=4;case 4:return s=i.code,u=i.data,s===a.SUCCESS&&u?(d=u.map((function(e){return se(e)})),[2,{code:s,data:d}]):(ie.warn("getConversationList fail -> code: ".concat(s," ").concat(o)),[2,{code:s,msg:Pe[s]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return O()?R("keyword",t,m.STRING,!0)&&R("messageTypes",n,m.ARRAY,!0)&&R("channelId",o,m.ONLY_STRING)&&!n.every((function(e){return!R("messageType",e,m.STRING,!0)}))?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s,u,d;return w(this,(function(f){switch(f.label){case 0:return r="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),ie.info("searchConversationByContent -> ".concat(e)),U(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=f.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:c=f.sent(),f.label=4;case 4:return s=c.code,u=c.data,s===a.SUCCESS&&u?(d=u.map((function(e){return se(e)})),[2,{code:s,data:d}]):(ie.warn("searchConversationByContent fail -> code: ".concat(s," ").concat(r)),[2,{code:s,msg:Pe[s]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return P(this,void 0,void 0,(function(){var r=this;return w(this,(function(i){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("keyword",t,m.STRING,!0)&&R("startTime",n,m.NUMBER,!0)&&R("count",o,m.NUMBER,!0)?[2,Re((function(i){return P(r,void 0,void 0,(function(){var r,c,s,u,d,f,l,g,v,I;return w(this,(function(h){switch(h.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),ie.info("searchMessages -> ".concat(r)),c=e.targetId,s=e.conversationType,u=e.channelId,U(u)?[4,i.searchMessageByContentWithAllChannel(s,c,t,n,o)]:[3,2];case 1:return d=h.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(s,c,t,n,o,0,u)];case 3:d=h.sent(),h.label=4;case 4:return f=d.code,l=d.data,f===a.SUCCESS&&l?(g=l.messages,v=l.count,I=g.map((function(e){return ce(e)})),[2,{code:f,data:{messages:I,count:v}}]):(ie.warn("searchMessages fail -> code: ".concat(f," ").concat(r)),[2,{code:f,msg:Pe[f]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("option",t,m.OBJECT,!0)&&R("option.keyword",t.keyword,m.STRING,!0)&&R("option.startTime",t.startTime,m.NUMBER,!0)&&R("option.endTime",t.endTime,m.NUMBER,!0)&&R("option.offset",t.offset,m.NUMBER)&&R("option.limit",t.limit,m.NUMBER)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l,g,v;return w(this,(function(I){switch(I.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),ie.info("searchMessageInTimeRange -> ".concat(n)),r=e.conversationType,i=e.targetId,c=t.keyword,s=t.startTime,u=t.endTime,d=t.offset,f=t.limit,d=d||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(r,i,c,s,u,d,f)];case 1:return l=I.sent(),g=l.code,v=l.data,g===a.SUCCESS&&v?[2,{code:g,data:{messages:v.messages.map((function(e){return ce(e)}))}}]:(ie.warn("searchMessageInTimeRange fail -> code: ".concat(g,", ").concat(n)),[2,{code:g}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("option",t,m.OBJECT,!0)&&R("option.count",t.count,m.NUMBER)&&R("option.timestamp",t.timestamp,m.NUMBER)&&R("option.order",t.order,(function(e){return[0,1].includes(e)}))&&R("option.messageTypes",t.messageTypes,m.ARRAY,!0)&&!t.messageTypes.every((function(e){return!R("option.messageType",e,m.STRING,!0)}))?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,r,i,c,s,u,d,f,l,g,v,I,h,R,m;return w(this,(function(p){switch(p.label){case 0:return n=t.count,r=t.timestamp,i=t.order,c=t.messageTypes,s="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),ie.info("getHistoryMessagesByMessageTypes -> ".concat(s)),u=e.conversationType,d=e.targetId,f=e.channelId,n||(n=20),r||(r=0),i||(i=0),f||(f=""),[4,o.getHistoryMessagesByObjectNames(u,d,r,n,c,i,f)];case 1:return l=p.sent(),g=l.code,v=l.data,g===a.SUCCESS?(h=(I=v).list,R=I.hasMore,m=h.map((function(e){return ce(e)})),[2,{code:g,data:{messages:m,hasMore:R}}]):(ie.warn("getHistoryMessagesByMessageTypes fail -> code: ".concat(g," ").concat(s)),[2,{code:g,msg:Pe[g]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("conversation",e,m.CONVERSATION,!0)&&R("timestamp",t,m.NUMBER,!0)?[2,Re((function(o){return P(n,void 0,void 0,(function(){var n,a,r,i;return w(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),ie.info("updateSentMsgReceiptStatus -> ".concat(n)),a=e.conversationType,r=e.targetId,i=e.channelId,[4,o.setMessageStatusToRead(a,r,t,i)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("messageId",e,m.NUMBER,!0)&&R("receivedStatus",t,(function(e){return!U(s[e])}),!0)?(ie.info("setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[2,Re((function(o){return P(n,void 0,void 0,(function(){return w(this,(function(n){switch(n.label){case 0:return[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return w(this,(function(o){return O()?R("messageId",e,m.NUMBER,!0)&&R("sentStatus",t,(function(e){return!U(G[e])}),!0)?(ie.info("setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[2,Re((function(o){return P(n,void 0,void 0,(function(){return w(this,(function(n){switch(n.label){case 0:return[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),P(this,void 0,void 0,(function(){var o=this;return w(this,(function(r){return O()?R("messageId",e,m.NUMBER,!0)&&R("content",t,m.OBJECT,!0)&&R("messageType",n,m.ONLY_STRING,!0)?(ie.info("setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[2,Re((function(a){return P(o,void 0,void 0,(function(){return w(this,(function(o){switch(o.label){case 0:return[4,a.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]):[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?!R("messageIds",e,m.ARRAY,!0)||e.every((function(e){return!R("messageId",e,m.NUMBER,!0)}))?[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]:(ie.info("deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[2,Re((function(n){return P(t,void 0,void 0,(function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return w(this,(function(n){return O()?[2,Re((function(n){return P(t,void 0,void 0,(function(){var t,o,r,i;return w(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,ie.info("clearMessages ->targetId:".concat(o,",conversationType:").concat(t)),[4,n.clearMessages(t,o,r)];case 1:return(i=c.sent())===a.SUCCESS?[2,{code:i}]:(ie.warn("clearMessages ->code:".concat(i,",targetId:").concat(o)),[2,{code:i,msg:Pe[i]}])}}))}))}))]:[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return P(this,void 0,void 0,(function(){var o,r,i,c=this;return w(this,(function(s){return O()?(o=e.conversationType,r=e.targetId,i=e.channelId,R("conversationType",o,m.NUMBER,!0)&&R("targetId",r,m.STRING,!0)&&R("timestamp",t,m.NUMBER,!0)&&R("cleanSpace",n,m.BOOLEAN)?[2,Re((function(e){return P(c,void 0,void 0,(function(){var c;return w(this,(function(s){switch(s.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,i)];case 1:return(c=s.sent())===a.SUCCESS?[2,{code:c}]:(ie.warn("deleteMessagesByTimestamp ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:Pe[c]}])}}))}))}))]:[2,{code:a.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o,r,i,c,s,u,d,f,l,g,v,I,h,R=this;return w(this,(function(m){return O()?(o=t.senderUserId,r=t.messageType,i=t.content,c=t.messageDirection,s=t.messageUId,u=t.canIncludeExpansion,d=t.expansion,f=t.disableNotification,l=t.sentTime,g=t.sentStatus,ie.info("insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),v=n.isUnread,I=n.searchContent,h={senderUserId:o,messageType:r,content:i,messageDirection:c,sentTime:l,sentStatus:g,searchContent:I,isUnread:v,messageUId:s,disableNotification:f,canIncludeExpansion:u,expansionMsg:JSON.stringify(d),channelId:e.channelId||""},[2,Re((function(t){return P(R,void 0,void 0,(function(){var n,o,r;return w(this,(function(i){switch(i.label){case 0:return[4,t.insertMessage(e.conversationType,e.targetId,h)];case 1:return n=i.sent(),o=n.code,r=n.data,o===a.SUCCESS?[2,{code:o,data:ce(r)}]:(ie.warn("insertMessage ->code:".concat(o,",targetId:").concat(e.targetId)),[2,{code:o,msg:Pe[o]}])}}))}))}))]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return P(this,void 0,void 0,(function(){var e=this;return w(this,(function(t){return O()?(ie.info("clearData -> "),[2,Re((function(t){return P(e,void 0,void 0,(function(){var e,n,o;return w(this,(function(a){switch(a.label){case 0:return[4,t.clearData()];case 1:return e=a.sent(),n=e.code,o=e.data,[2,{code:n,data:o}]}}))}))}))]):[2,{code:a.NOT_SUPPORT,msg:Pe[a.NOT_SUPPORT]}]}))}))}}),Po=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};export{zt as BaseMessage,$t as CombineMessage,Mo as ConnectType,B as Events,en as FileMessage,tn as GIFMessage,Xt as HQVoiceMessage,Wt as ImageMessage,on as LocationMessage,Po as MentionedInfoBody,Uo as MessageType,an as ReferenceMessage,rn as RichContentMessage,G as SentStatus,jt as SightMessage,Qt as TextMessage,nn as VoiceMessage,Oe as __addSDKVersion,So as addConversationsToTag,me as addEventListener,Ro as addTag,Vt as addToBlacklist,Ht as bindRTCRoomForChatroom,Ye as clearAllMessagesUnreadStatus,Se as clearEventListeners,eo as clearHistoryMessages,go as clearMessages,Je as clearMessagesUnreadStatus,Fe as clearTextMessageDraft,Io as clearUnreadCountByTimestamp,be as connect,lo as deleteLocalMessagesByTimestamp,$n as deleteMessages,Ce as destroy,Be as disconnect,Lo as electronExtension,Bt as forceRemoveChatRoomEntry,wt as forceSetChatRoomEntry,xt as getAllChatRoomEntries,st as getAllConversationState,Tt as getAllUltraGroupUnreadCount,St as getAllUltraGroupUnreadMentionedCount,ct as getAllUnreadMentionedCount,qt as getBlacklist,Zt as getBlacklistStatus,dt as getBlockUltraGroupList,ot as getBlockedConversationList,Gt as getChatRoomEntry,Ut as getChatRoomInfo,kt as getChatroomHistoryMessages,Ne as getConnectionStatus,xe as getConversation,Ge as getConversationList,et as getConversationNotificationLevel,nt as getConversationNotificationStatus,Ao as getConversationsFromTagByPage,ye as getCurrentUserId,Me as getDeviceId,Bn as getFileToken,Gn as getFileUrl,io as getFirstUnreadMessage,zn as getHistoryMessages,so as getMessage,ao as getMessageReader,Kn as getRemoteHistoryMessages,Ae as getServerTime,Eo as getTags,To as getTagsFromConversation,He as getTextMessageDraft,rt as getTopConversationList,qe as getTotalUnreadCount,Ze as getTotalUnreadCountByLevels,ze as getTotalUnreadMentionedCountByLevels,mt as getUltraGroupDefaultNotificationLevel,Ct as getUltraGroupFirstUnreadMessageTimestamp,ut as getUltraGroupList,lt as getUltraGroupMessageListByMessageUId,Et as getUltraGroupUnreadCountByTargetId,Rt as getUltraGroupUnreadMentionedCountByTargetId,_t as getUltraGroupUnreadMentionedMessages,Ke as getUnreadCount,yo as getUnreadCountByTag,it as getUnreadMentionedCount,uo as getUnreadMentionedMessages,_e as init,co as insertMessage,Ue as installPlugin,yt as joinChatRoom,Ot as joinExistChatRoom,ht as modifyMessage,pe as onceEventListener,Mt as quitChatRoom,Qn as recallMessage,ro as registerMessageType,It as removeAllExpansionForUltraGroupMessage,bt as removeChatRoomEntries,Dt as removeChatRoomEntry,ke as removeConversation,_o as removeConversationsFromTag,Ee as removeEventListener,Te as removeEventListeners,vt as removeExpansionForUltraGroupMessage,Ft as removeFromBlacklist,no as removeMessageExpansionForKey,mo as removeTag,No as removeTagFromConversations,Co as removeTagsFromConversation,Ve as saveTextMessageDraft,vo as searchConversationByContent,fo as searchMessages,Vn as sendFileMessage,qn as sendHQVoiceMessage,Fn as sendImageMessage,xn as sendMessage,Jn as sendReadReceiptMessage,Yn as sendReadReceiptRequest,Wn as sendReadReceiptResponse,Xn as sendReadReceiptResponseV2,Zn as sendSightMessage,jn as sendSyncReadStatusMessage,kn as sendTextMessage,oo as sendTypingStatusMessage,ft as sendUltraGroupTypingStatus,Pt as setChatRoomEntries,Lt as setChatRoomEntry,Qe as setConversationNotificationLevel,$e as setConversationNotificationStatus,at as setConversationToTop,Oo as setConversationToTopInTag,ho as setMessageReceivedStatus,pt as setUltraGroupDefaultNotificationLevel,gt as updateExpansionForUltraGroupMessage,to as updateMessageExpansion,po as updateTag};
|