@rongcloud/imlib-next 5.8.4-alpha.2 → 5.8.4-alpha.3

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 CHANGED
@@ -1 +1 @@
1
- import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as o,appendUrl as r,ErrorCode as i,ReceivedStatus as a,ConversationType as s,isNumber as c,EventEmitter as u,RCConnectionStatus as d,VersionManage as l,assert as f,AssertRules as g,isArray as v,isHttpUrl as I,APIContext as h,LogTagId as R,logger as m,validate as E,isValidConversationType as S,isValidNotificationLevel as T,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MessageType as C,MAX_UPLOAD_FILE_SIZE as A,UPLOAD_FILE_CHUNK_SIZE as U,UploadMethod as y,fixUrlProtocol as M,FileType as P,getUUID as L,isValidFileType as w,usingCppEngine as B,MessageDirection as D,SentStatus as b,isUndefined as G}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var V=function(e,t){return V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},V(e,t)};function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}V(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var x=function(){return x=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},x.apply(this,arguments)};function F(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function Z(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var H=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))},J=H();var q=null,K=function(e){return F(void 0,void 0,void 0,(function(){var t;return Z(this,(function(n){switch(n.label){case 0:return[4,Y.getNetworkType()];case 1:return t=n.sent(),q({status:"online"===e.type,type:t}),[2]}}))}))};var Y={tag:"browser",httpReq:e,localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:J,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,o=e.effectiveType,r=n||o||t.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){q=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",K),window.addEventListener("online",K))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",K),window.removeEventListener("online",K)),q=null}},z=H(),j=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},W={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},Q=null,X=function(e){var t=e.isConnected,n=e.networkType;Q({status:t,type:n})};var $={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){wx.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:W,sessionStorage:W,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Q=e,wx.onNetworkStatusChange(X)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(X),Q=null}},ee=H(),te=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe=null,re=function(e){var t=e.isConnected,n=e.networkType;oe({status:t,type:n})};var ie={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){oe=e,my.onNetworkStatusChange(re)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(re),oe=null}},ae=H(),se=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue=null,de=function(e){var t=e.isConnected,n=e.networkType;ue({status:t,type:n})};var le={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ae,localStorage:ce,sessionStorage:ce,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:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ue=e,tt.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(de),ue=null}},fe=H(),ge=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},ve={setItem:ge("setStorageSync"),getItem:ge("getStorageSync"),removeItem:ge("removeStorageSync"),clear:ge("clearStorageSync")},Ie=null,he=function(e){var t=e.isConnected,n=e.networkType;Ie({status:t,type:n})};var Re={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:fe,localStorage:ve,sessionStorage:ve,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:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ie=e,swan.onNetworkStatusChange(he)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(he),Ie=null}},me=H(),Ee=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Se={setItem:Ee("setStorageSync"),getItem:Ee("getStorageSync"),removeItem:Ee("removeStorageSync"),clear:Ee("clearStorageSync")},Te=null,pe=function(e){var t=e.isConnected,n=e.networkType;Te({status:t,type:n})};var Oe={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){jd.request({url:d,method:t,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Se,sessionStorage:Se,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:me,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Te=e,jd.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(pe),Te=null}},Ne=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},_e={setItem:Ne("setStorageSync"),getItem:Ne("getStorageSync"),removeItem:Ne("removeStorageSync"),clear:Ne("clearStorageSync")},Ce=null,Ae=function(e){var t=e.isConnected,n=e.networkType;Ce({status:t,type:n})};var Ue,ye={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){uni.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:_e,sessionStorage:_e,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ce=e,uni.onNetworkStatusChange(Ae)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ae),Ce=null}},Me=function(e){return e&&e.request&&e.getSystemInfo},Pe="undefined"!=typeof uni&&Me(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ye;case"mp-jd":return Oe;case"mp-baidu":return Re;case"mp-toutiao":return le;case"mp-alipay":return ie;case"mp-weixin":return $;default:return Y}}():"undefined"!=typeof jd&&Me(jd)?Oe:"undefined"!=typeof my&&Me(my)?ie:"undefined"!=typeof tt&&Me(tt)?le:"undefined"!=typeof swan&&Me(swan)?Re:"undefined"!=typeof wx&&Me(wx)?$:Y;function Le(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,i=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,S=e.disableNotification,T=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,U=e.channelType,y=e.sentStatus;E||(E=a.UNREAD);var M={messageType:o,channelId:n||"",content:r,senderUserId:i,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:y};return t!==s.ULTRA_GROUP&&(M.isOffLineMessage=h),t===s.ULTRA_GROUP&&c(U)&&(M.channelType=U),M}function we(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I=e.unreadMentionedMeCount,h=e.operationTime,R={conversationType:t,targetId:n,latestMessage:o&&Le(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:g,matchCount:v,unreadMentionedMeCount:I,operationTime:h};return R.conversationType===s.ULTRA_GROUP&&(R.firstUnreadMessage=e.firstUnreadMessage,R.channelType=e.channelType),R}function Be(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(Ue||(Ue={}));var De=new u,be={connection:function(e,t){switch(e){case d.CONNECTED:De.emit(Ue.CONNECTED);break;case d.CONNECTING:De.emit(Ue.CONNECTING);break;case d.SUSPENDED:De.emit(Ue.SUSPEND,t);break;case d.DISCONNECTED:De.emit(Ue.DISCONNECT,t)}},batchMessage:function(e){De.emit(Ue.MESSAGES,{messages:e.map((function(e){return Le(e)}))})},typingState:function(e){De.emit(Ue.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){De.emit(Ue.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){De.emit(Ue.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){De.emit(Ue.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=Ge(e.unreadMessageCount||0),n.unreadMentionedCount=Ge(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Ge(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));De.emit(Ue.CONVERSATION,{conversationList:t})},chatroomState:function(e){De.emit(Ue.CHATROOM,e)},expansion:function(e){De.emit(Ue.EXPANSION,e)},pullFinished:function(){De.emit(Ue.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){De.emit(Ue.TAG)},conversationTagChanged:function(){De.emit(Ue.CONVERSATION_TAG)},messageBlocked:function(e){De.emit(Ue.MESSAGE_BLOCKED,e)},messageDelivered:function(e){De.emit(Ue.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){De.emit(Ue.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){De.emit(Ue.ULTRA_GROUP_ENABLE,e.map((function(e){return we(e)})))},operateStatus:function(e){De.emit(Ue.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){De.emit(Ue.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Le(e)})))},ultraGroupMessageModified:function(e){De.emit(Ue.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Le(e)})))},ultraGroupMessageRecalled:function(e){De.emit(Ue.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Le(e)})))},ultraGroupChannelChangeType:function(e){De.emit(Ue.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){De.emit(Ue.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){De.emit(Ue.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){De.emit(Ue.USER_GROUP_STATUS,e)}};function Ge(e){return e>999?999:e}l.add("imlib-next","5.8.4-alpha.2");var Ve=null,ke=null,xe=null;function Fe(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return Ve?(xe.info(R.A_DESTROY_O),[4,h.destroy()]):[2];case 1:return e.sent(),ke=null,Ve=null,xe=null,[2]}}))}))}function Ze(e){if(!Ve)throw new Error("Not initialized yet!");return e(Ve,xe,ke)}function He(e){return Ve?e(Ve,xe,ke):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Je(e,t,n){De.on(e,t,n)}function qe(e,t,n){De.once(e,t,n)}function Ke(e,t,n){De.off(e,t,n)}function Ye(e){De.removeAll(e)}function ze(){De.clear()}function je(e){!function(e){var t,n=e.appkey,o=e.navigators;Ve?xe.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,g.STRING,!0),f("options.navigators",e.navigators,(function(e){return v(e)&&(0===e.length||e.every(I))})),ke=e,Ve=h.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Pe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl}),(xe=Ve.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),xe.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.8.4-alpha.2",commit:"ef0712d57423ac27b4fc40dcdfaffc61d4f189e0"})),Ve.assignWatcher(be),m.init(xe))}(e)}function We(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return Ve?(ze(),[2,Fe()]):[2]}))}))}function Qe(){return Ze((function(e){return e.getConnectionStatus()}))}function Xe(){return Ze((function(e){return e.getServerTime()}))}function $e(){return Ze((function(e){return e.getCurrentUserId()}))}function et(e,t){l.add(e,t)}function nt(){return Ze((function(e){return e.getDeviceId()}))}function ot(e,t){return Ze((function(n){return n.install(e,t)}))}var rt={TIMEOUT:{code:-1,msg:"Network timeout"},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:i.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:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},it={};for(var at in rt){var st=rt[at].code;it[st]=at}function ct(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return E("token",e,g.STRING,!0)&&E("reconnectKickEnable",t,g.BOOLEAN)?(n=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](R.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:it[a.code]}]}}))}))}))]}))}))}function ut(e){return m.info(R.A_DISCONNECT_O,{}),Ze((function(t){return t.disconnect(e)}))}function dt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options.count",null==e?void 0:e.count,g.NUMBER)&&E("options.startTime",null==e?void 0:e.startTime,g.NUMBER)&&E("options.order",null==e?void 0:e.order,g.NUMBER)&&E("channelId",t,g.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(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(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}]):[2,{code:r,data:a?we(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("draft",t,g.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(R.O,"delete draft fail ->".concat(r,":").concat(it[r],",").concat(t)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("includeMuted",e,g.BOOLEAN,!1)&&E("conversationTypes",t,g.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!E("conversationType",e,S)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!E("conversationTypes",e,g.ARRAY,!0)||!E("levels",t,g.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function mt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!E("conversationTypes",e,g.ARRAY,!0)||!E("levels",t,g.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function Et(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}rt.ROAMING_SERVICE_UNAVAILABLE.code;var pt=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(R.O,"".concat(n," -> ").concat(o)),o},Ot=function(e,t,n,o){return void 0===o&&(o=""),F(void 0,void 0,void 0,(function(){var r,a;return Z(this,(function(s){switch(s.label){case 0:return r=pt(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(it[a]," , ").concat(r)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))};function Nt(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return E("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=pt(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(it[a]," , ").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getBlockConversationList()}))]}))}))}function yt(e,t){return void 0===t&&(t=!0),F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("isTop",t,g.BOOLEAN)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversationTypes",e,g.ARRAY)&&!(null==e?void 0:e.some((function(e){return!E("conversationType",e,S)})))&&E("channelId",t,g.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!E("conversationTypes",e,g.ARRAY)||(null==e?void 0:e.some((function(e){return!E("conversationType",e,O)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return we(e)}))}]:[2,{code:o,msg:it[o]}]}}))}))}))]}))}))}function Lt(e){return F(this,void 0,void 0,(function(){return Z(this,(function(t){return E("options",e,g.CONVERSATION,!0)?[2,He((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function Bt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getAllConversationState()}))]}))}))}function Dt(e){return void 0===e&&(e={}),F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options.targetId",e.targetId,g.STRING,!1)&&E("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(it[o])),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function Gt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(it[t])),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("msgs",t,g.ARRAY,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return Z(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),l=d.code,f=d.data,l===i.SUCCESS){for(v in g={},f)g[v]=f[v]?Le(f[v]):void 0;return[2,{code:i.SUCCESS,data:g}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(it[l])),[2,{code:l,msg:it[l]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("expansion",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(it[g])),[2,{code:g,msg:it[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("expansion",e,g.ARRAY,!0)&&E("message",t,g.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(it[g])),[2,{code:g,msg:it[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("message",e,g.OBJECT,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("content",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return Z(this,(function(I){switch(I.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(f)),g={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(it[v])),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("notificationLevels",t,g.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(r)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(it[s]," , ").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID,!0)&&E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(it[s]," , ").concat(a)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("notificationLevels",t,g.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(R.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function zt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function jt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID,!0)&&E("options.sentTime",e.sentTime,g.NUMBER,!0)&&E("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===i.SUCCESS?[2,{code:d,data:l}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(it[d])),[2,{code:d,msg:it[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("conversation.targetId",e.targetId,g.STRING,!0)&&E("conversation.channelId",e.channelId,g.CHANNEL_ID,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,a,s,c;return Z(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 a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:it[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qt(e){return F(this,void 0,void 0,(function(){var t,n=this;return Z(this,(function(o){return E("targetIds",e,g.ARRAY,!0)&&E("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!E("targetId",e,g.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,He((function(e){return F(n,void 0,void 0,(function(){var n,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:it[o]}]}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Xt=function(e){return!!(E("options.key",e.key,g.STRING,!0)&&E("options.value",e.value,g.STRING,!0)&&E("options.isAutoDelete",e.isAutoDelete,g.BOOLEAN)&&E("options.isSendNotification",e.isSendNotification,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING))},$t=function(e){return e.entries.every((function(e){return E("entry.key",e.key,g.STRING,!0)&&E("entry.value",e.value,g.STRING,!0)}))&&E("options.isAutoDelete",e.isAutoDelete,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING)&&E("options.isForce",e.isForce,g.BOOLEAN)},en=function(e){return E("options.key",e.key,g.STRING,!0)&&E("options.isSendNotification",e.isSendNotification,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING)},tn=function(e){return e.entries.every((function(e){return E("key",e,g.STRING,!0)}))&&E("options.notificationExtra",e.notificationExtra,g.STRING)};function nn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:it[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=d.sent(),s=a.code,c=a.data,u=s===i.SUCCESS?"info":"warn",r[u](R.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==i.SUCCESS?[2,{code:s,msg:it[s]}]:[2,{code:s,data:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("targetId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),t),r!==i.SUCCESS?[2,{code:r,msg:it[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER)&&E("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&Xt(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&$t(t)?t.entries.length>10?[2,rt.CHATROOM_KV_STORE_OUT_LIMIT]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&Xt(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&tn(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(n)),(a=x({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(it[c],",").concat(n)),[2,{code:c,msg:it[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("targetId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(it[a],",").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.timestamp",t.timestamp,g.NUMBER)&&E("options.count",t.count,g.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&E("options.order",t.order,(function(e){return 0===e||1===e}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("option.chatRoomId",e.chatRoomId,g.STRING,!0)&&E("option.rtcRoomId",e.rtcRoomId,g.STRING,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:it[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("userId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("userId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Sn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("userId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Tn=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 pn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Tn(e,o,t,n)}}var On,Nn=pn("RC:ImgMsg"),_n=pn("RC:HQVCMsg"),Cn=pn("RC:SightMsg"),An=pn("RC:TxtMsg"),Un=pn("RC:CombineMsg"),yn=pn(C.COMBINE_V2),Mn=pn("RC:FileMsg"),Pn=pn("RC:GIFMsg"),Ln=pn("RC:VcMsg"),wn=pn("RC:LBSMsg"),Bn=pn("RC:ReferenceMsg"),Dn=pn("RC:ImgTextMsg"),bn=pn("RC:CmdMsg"),Gn=pn("RC:InfoNtf"),Vn=pn("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(On||(On={}));var kn,xn,Fn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>A?Promise.resolve({code:i.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>U&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=d.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,e({url:M(this._url),headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.QINIU}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("Method not implemented.")}))}))},n}(Fn),Hn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=M("".concat(a.ossBucketName,".").concat(this._url)),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,e({url:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.ALI}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Fn),Jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=P.FILE?r:P.FILE)];case 1:return s=f.sent(),c=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},d=M("".concat(this._url).concat(s.path)),[4,e({url:d,headers:u,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=f.sent().status)||204===l?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:d}}]:[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Fn),qn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return s=g.sent(),c={},u=M("".concat(s.s3BucketName,".").concat(this._url)),d=new FormData,a?d.set("Content-Disposition",a):d.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),d.set("Content-Type",n.type),d.set("x-amz-credential",s.s3Credential),d.set("x-amz-algorithm",s.s3Algorithm),d.set("x-amz-date",s.s3Date),d.set("policy",s.s3Policy),d.set("x-amz-signature",s.s3Signature),d.set("key",s.fileName),d.set("file",n),[4,e({url:u,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:d,timeout:0})];case 2:return l=g.sent(),f=l.status,l.data,200===f||204===f?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:y.AWS}}]:[2,{code:i.UPLOAD_FAIL,msg:f.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Fn),Kn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=M("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,g,v,I,h,R,m,E,S;return Z(this,(function(T){switch(T.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=M("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(g=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,g)]);case 3:return v=T.sent(),I=v.code,h=v.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=g.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,g,v,I,h,R,m;return Z(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*U,l=Math.min(U,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return g=E.sent(),v=n.slice(d,c*U),I=this.getBaseHeaders(n,g,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:v,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)},timeout:0})];case 2:return h=E.sent(),R=h.status,h.data,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n}(Fn),Yn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=M("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,g,v,I,h,R,m,E,S;return Z(this,(function(T){switch(T.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=M("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(g=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,g)]);case 3:return v=T.sent(),I=v.code,h=v.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=g.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m,timeout:0})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,g,v,I,h,R,m;return Z(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*U,l=Math.min(U,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return g=E.sent(),v=n.slice(d,c*U),I=this.getBaseHeaders(n,g,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:v,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)}})];case 2:return h=E.sent(),R=h.status,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n}(Fn),zn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=v.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),u=M(this._url),[4,e({url:u,headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return d=v.sent(),l=d.status,f=d.data,200!==l&&204!==l||!f?[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]:(g=JSON.parse(f),[2,{code:i.SUCCESS,data:{uniqueName:g.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(g.rc_url.path)}}])}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){var t,n,o,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=L(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,o,r,a){return void 0===a&&(a=0),F(this,void 0,void 0,(function(){var s,c,u,d,l,f,g,v,I,h;return Z(this,(function(R){switch(R.label){case 0:return s=Math.min(U,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes=".concat(a,"-").concat(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},d=n.slice(a,a+s),(l=new FormData).set("file",d,n.name),l.set("key",c),l.set("name",c),l.set("token",o),f=M(this._url),[4,e({url:f,headers:u,onProgress:function(e){return null==r?void 0:r(a+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return g=R.sent(),v=g.status,I=g.data,200===v||204===v?a+s<n.size?[2,this._requestUploadPart(t,n,o,r,a+s)]:(h=JSON.parse(I),[2,{code:i.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:"".concat(f,"/").concat(h.rc_url.path)}}]):[2,{code:i.UPLOAD_FAIL,msg:v.toString()}]}}))}))},n}(Fn);function jn(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,g,v,I,h,R,m;return Z(this,(function(E){switch(E.label){case 0:return n=t.getFileToken,o=t.serverType,r=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:On.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:On.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:On.QINIU,url:o,p:"1"});r&&i.push({type:On.BAIDU,url:r,p:"2"});return i}(a,0,r,s,c),0===f.length?[2,Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,$n(f,e,n,o)];case 1:return g=E.sent(),v=g.code,I=g.data,h=g.msg,v===i.SUCCESS&&I?[4,Wn(e,t,I)]:[2,{code:v,msg:h}];case 2:return R=E.sent(),m={downloadUrl:R,uniqueName:(null==I?void 0:I.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==P.AUDIO?[3,4]:[4,u.arrayBuffer()];case 3:return[2,Qn(E.sent(),m)];case 4:return d===P.IMAGE?[2,eo(u,m,l)]:[2,{code:v,data:m}]}}))}))}function Wn(e,t,n){return F(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function Qn(e,t){return xn=xn||new AudioContext,new Promise((function(n,o){xn.decodeAudioData(e,(function(e){n({code:i.SUCCESS,data:x(x({},t),{duration:e.duration,length:e.length})})}),(function(e){n({code:i.UPLOAD_FAIL,msg:"get audio info fail:".concat(JSON.stringify(e))})}))}))}var Xn=((kn={})[On.QINIU]=Zn,kn[On.ALIYUN]=Hn,kn[On.BAIDU]=Jn,kn[On.S3]=qn,kn[On.STC]=Kn,kn[On.MINIO]=Yn,kn[On.RCX]=zn,kn);function $n(e,t,n,o,r){return void 0===r&&(r=[]),F(this,void 0,void 0,(function(){var a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:i.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(r))})]:(a=e.shift(),[4,new Xn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==i.SUCCESS?(r.push({type:a.type,url:a.url,code:c,msg:d}),[2,$n(e,t,n,o,r)]):[2,{code:c,data:u}]}}))}))}function eo(e,t,n){return new Promise((function(o,r){var a=document.createElement("canvas"),s=a.getContext("2d"),c=new Image;c.onload=function(r){var u=n||{},d=u.maxHeight,l=void 0===d?160:d,f=u.maxWidth,g=void 0===f?160:f,v=u.quality,I=void 0===v?.7:v,h=u.scale,R=void 0===h?1:h,m=to(c.width,c.height,{maxHeight:l,maxWidth:g,scale:R});a.width=Math.min(m.w,g),a.height=Math.min(m.h,l),s.drawImage(c,m.x,m.y,m.w,m.h);var E=a.toDataURL("string"==typeof e?"image/jpg":e.type,I);E=E.replace(/data:image\/[^;]+;base64,/,""),o({code:i.SUCCESS,data:x(x({},t),{thumbnail:E,width:m.w,height:m.h})})},c.onerror=function(e){o({code:i.UPLOAD_FAIL,msg:"get image info fail:".concat(JSON.stringify(e))})},c.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var to=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function no(e){return F(this,void 0,void 0,(function(){var t,n,o;return Z(this,(function(r){return t=e.contentDisposition,n=e.fileType,o=e.file,E("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1)&&E("fileType",n,(function(e){return!!P[e]}),!0)&&E("file",o,(function(e){return e instanceof File&&(!(n===P.IMAGE&&!e.type.match(/^image\//))&&!(n===P.AUDIO&&!e.type.match(/^audio\//)))}),!0)?[2,He((function(t,n,o){return new Promise((function(n){var r=t.getNaviInfoFromCache();jn(e,{getFileToken:t.getFileToken.bind(t),getFileUrl:t.getFileUrl.bind(t),customDomain:o.uploadDomain||"",serverType:null==r?void 0:r.type,ossConfig:null==r?void 0:r.ossConfig,uploadServer:null==r?void 0:r.uploadServer,bosAddr:null==r?void 0:r.bosAddr}).then((function(e){n(e)}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,t,n,o){return He((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:it[e]})}))}))}))}function ro(e){return E("url",e,g.STRING,!0)?He((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,o=e.downloadAuthInfo,r=e.deadline;n({code:i.SUCCESS,data:{token:t,downloadAuthInfo:o,deadline:r}})})).catch((function(e){n({code:e,msg:it[e]})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function io(e,t,n,o,r){return E("fileType",e,w,!0)&&E("filename",t,g.STRING)&&E("saveName",n,g.STRING)&&E("serverType",r,g.NUMBER)?He((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function ao(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return[2,He((function(r,c){return F(o,void 0,void 0,(function(){var o,u,d,l,f,v,I,h,m,S,T,p;return Z(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Tn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,rt.ILLGAL_PARAMS]):E("conversation",e,g.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,E("conversation.targetId",u,g.STRING,!0)&&E("conversation.conversationType",o,g.NUMBER,!0)&&E("conversation.channelId",d,g.CHANNEL_ID)&&E("options.isStatusMessage",null==n?void 0:n.isStatusMessage,g.BOOLEAN)&&E("options.disableNotification",null==n?void 0:n.disableNotification,g.BOOLEAN)&&E("options.pushContent",null==n?void 0:n.pushContent,g.STRING)&&E("options.pushData",null==n?void 0:n.pushData,g.STRING)&&E("options.isMentioned",null==n?void 0:n.isMentioned,g.BOOLEAN)&&E("options.mentionedType",null==n?void 0:n.mentionedType,g.NUMBER)&&E("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,g.ARRAY)&&E("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,g.ARRAY)&&E("options.isVoipPush",null==n?void 0:n.isVoipPush,g.BOOLEAN)&&E("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,g.BOOLEAN)&&E("options.expansion",null==n?void 0:n.expansion,g.OBJECT)&&E("options.pushConfig",null==n?void 0:n.pushConfig,g.OBJECT)&&E("options.messageId",null==n?void 0:n.messageId,g.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(l)),f=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,l=e.isVoipPush,f=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return x({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,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,isCounted:!!t.isCounted,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:r.getCurrentUserId(),messageUId:"",messageDirection:D.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:b.SENDING},o!==s.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Le(v))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,r.sendMessage(o,u,f,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return m=O.sent(),S=m.code,T=m.data,S===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),I),p=Le(T),[2,{code:S,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(it[S],",").concat(l)),v.sentTime=(null==T?void 0:T.sentTime)||0,v.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:it[S],data:Le(v)}])}}))}))}))]}))}))}function so(e,t,n){return ao(e,new An(t),n)}function co(e,t){return function(n,o,r,a){if(!E("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(E("sendOptions.maxHeight",null==c?void 0:c.maxHeight,g.NUMBER)&&E("sendOptions.maxWidth",null==c?void 0:c.maxWidth,g.NUMBER)&&E("sendOptions.quality",null==c?void 0:c.quality,g.NUMBER)&&E("sendOptions.scale",null==c?void 0:c.scale,g.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return He((function(c,u,d){return new Promise((function(c){var d=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),d),no({file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==r?void 0:r.onProgress)||void 0===n||n.call(r,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig}).then((function(e){var s,l=e.code,f=e.data,g=e.msg;if(l===i.SUCCESS&&f){var v=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,x({url:f.downloadUrl},f)))||t(f,o);return u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:i.SUCCESS}),d),void ao(n,v,a).then(c)}c({code:l,msg:g})}))}))}))}}var uo=co(P.FILE,(function(e,t){var n,o,r={name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(r.user=t.user),t.extra&&(r.extra=t.extra),t.mentionedInfo&&(r.mentionedInfo=t.mentionedInfo),new Mn(r)})),lo=co(P.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Nn(n)})),fo=co(P.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Pn(n)})),go=co(P.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new _n(n)})),vo=co(P.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Cn(n)}));function Io(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,g.NUMBER)&&E("options.count",null==t?void 0:t.count,g.NUMBER)&&(B()||E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,g.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),1!==(o.getNaviInfoFromCache()||{}).repairHisMsg?[3,2]:(null==t?void 0:t.count)&&(null==t?void 0:t.count)>100?(r.warn(R.A_GET_HISTORY_MSG_R,'"options.count" is invalid, It should be greater than 0 and less than 100',n),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[4,o.getMessages(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 a=d.sent(),[3,4];case 2:return[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 3:a=d.sent(),d.label=4;case 4:return s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,g.NUMBER)&&E("options.count",null==t?void 0:t.count,g.NUMBER)&&E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,g.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return E("targetId",e,g.STRING,!0)&&E("messageUId",t,g.STRING,!0)&&E("timestamp",n,g.NUMBER,!0)&&E("channelId",o,g.CHANNEL_ID)?[2,He((function(i){return F(r,void 0,void 0,(function(){var r,i,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new Tn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,ao(r,i)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("messageUId",t,g.STRING,!0)&&E("targetId",e,g.STRING,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){var o,r,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"send read receipt message ->".concat(o)),r=new Tn("RC:RRReqMsg",{messageUId:t}),[4,ao({targetId:e,conversationType:s.GROUP,channelId:n},r)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t,n){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function So(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("targetId",e,g.STRING,!0)&&E("messageList",t,g.OBJECT,!0)&&E("channelId",n,g.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!E(e,t[e],g.ARRAY)}))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:s.GROUP,channelId:n},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,n)]:(a.warn(R.O,"Error in parameter messageList."),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]));case 1:return c=g.sent(),[3,4];case 2:return l=new Tn("RC:RRRspMsg",{receiptMessageDic:t}),[4,ao(o,l)];case 3:c=g.sent(),g.label=4;case 4:return(f=c.code)===i.SUCCESS?[2,{code:f}]:(a.warn(R.O,"send read receipt message fail ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return E("conversation",e,g.CONVERSATION,!0)&&E("lastMessageSendTime",t,g.NUMBER,!0)?(n=new Tn("RC:SRSMsg",{lastMessageSendTime:t}),[4,ao(e,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function po(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("options.messageUId",t.messageUId,g.STRING,!0)&&E("options.sentTime",t.sentTime,g.NUMBER,!0)&&E("options.disableNotification",null==t?void 0:t.disableNotification,g.BOOLEAN)&&E("options.pushConfig",null==t?void 0:t.pushConfig,g.OBJECT)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:Le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(it[c],",").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("options",t,(function(e){return v(e)&&e.length}),!0)&&!t.some((function(e){return!E("options.messageUId",e.messageUId,g.STRING,!0)||!E("options.sentTime",e.sentTime,g.NUMBER,!0)||!E("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("expansion",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)&&E("message.conversationType",t.conversationType,g.NUMBER,!0)&&E("message.targetId",t.targetId,g.STRING,!0)&&E("message.channelId",t.channelId,g.CHANNEL_ID)&&E("message.messageUId",t.messageUId,g.STRING,!0)&&E("message.expansion",t.expansion,g.OBJECT)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=g.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(f,":").concat(it[f],",").concat(l)),[2,{code:f,msg:it[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("keys",e,g.ARRAY,!0)&&E("message",t,g.OBJECT,!0)&&E("message.conversationType",t.conversationType,g.NUMBER,!0)&&E("message.targetId",t.targetId,g.STRING,!0)&&E("message.channelId",t.channelId,g.CHANNEL_ID)&&E("message.messageUId",t.messageUId,g.STRING,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(l,":").concat(it[l],",").concat(d)),[2,{code:l,msg:it[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("typingContentType",t,g.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:Le(u)}]:[2,{code:c,msg:it[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("messageUId",t,g.STRING,!0)&&E("targetId",e,g.STRING,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(R.O,"get message reader fail ->".concat(c,":").concat(it[c],",").concat(o)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t,n,o,r){return Ze((function(i,a){return f("messageType",e,g.STRING,!0),f("isPersited",t,g.BOOLEAN,!0),f("isCounted",n,g.BOOLEAN,!0),f("isStatusMessage",r,g.BOOLEAN,!1),f("searchProps",o,g.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),pn(e,t,n)}))}function Mo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("conversation",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&Le(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Po(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return Be("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),B()?E("conversation",e,g.CONVERSATION,!0)&&E("message",t,g.OBJECT,!0)&&E("options",n,g.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,g.STRING)&&E("content.senderUserId",t.senderUserId,g.STRING,!0)&&E("content.messageType",t.messageType,g.STRING,!0)&&E("content.content",t.content,g.OBJECT,!0)&&E("content.messageDirection",t.messageDirection,g.NUMBER,!0)&&E("content.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN)&&E("content.expansion",t.expansion,g.OBJECT)&&E("content.disableNotification",t.disableNotification,g.BOOLEAN)&&E("content.sentTime",t.sentTime,g.NUMBER)&&E("content.sentStatus",t.sentStatus,g.NUMBER)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,m,E,S,T,p;return Z(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),T=S.code,p=S.data,T===i.SUCCESS?[2,{code:T,data:Le(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:it[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Lo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("messageId",e,(function(e){return c(e)||_(e)}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:Le(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function wo(e){if(!B())return{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return E("conversation",e,g.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Le(e))})),{code:i.SUCCESS,data:a}},Ve?t(Ve,xe,ke):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function Bo(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),B()?E("conversation",e,g.CONVERSATION,!0)&&E("keyword",t,g.STRING,!0)&&E("timestamp",n,g.NUMBER)&&E("count",o,g.NUMBER)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=l.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Do(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return Be("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),B()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,g.NUMBER,!0)&&E("targetId",r,g.STRING,!0)&&E("timestamp",t,g.NUMBER,!0)&&E("cleanSpace",n,g.BOOLEAN)?[2,He((function(c,u){return F(s,void 0,void 0,(function(){var s;return Z(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function bo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return Be("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),B()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Go(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),B()?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u;return Z(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Vo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return Be("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),B()?E("messageId",e,g.NUMBER,!0)&&E("receivedStatus",t,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function xo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("tag.tagId",e.tagId,g.STRING,!0)&&E("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&E("tag.tagName",e.tagName,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("tagId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("tag.tagId",e.tagId,g.STRING,!0)&&E("tag.tagName",e.tagName,g.STRING,!0)&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Jo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("conversation",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("tagIds",t,g.ARRAY,!0)&&!t.some((function(e){return!E("tagId",e,g.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("tagId",e,g.STRING,!0)&&E("count",t,g.NUMBER,!0)&&E("startTime",n,g.NUMBER,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c;return Z(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return x(x({},we(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("containMuted",t,g.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a;return Z(this,(function(s){switch(s.label){case 0:return r.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("tagId",e,g.STRING,!0)&&E("conversation",t,g.CONVERSATION,!0)&&E("status.isTop",n,g.BOOLEAN,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o;return Z(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:it[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}co(P.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Un(n)}));var Xo={COMET:"comet",WEBSOCKET:"websocket"},$o={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",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var er=Object.freeze({__proto__:null,getAllConversationList:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("channelId",e,g.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),G(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 r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return we(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("startTime",e,g.NUMBER,!0)&&E("count",t,g.NUMBER,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),G(n)?[4,r.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,t,n)];case 3:s=f.sent(),f.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(l=d.map((function(e){return we(e)})),[2,{code:u,data:l}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:it[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("keyword",e,g.STRING,!0)&&E("messageTypes",t,g.ARRAY,!0)&&E("channelId",n,g.CHANNEL_ID)&&!t.some((function(e){return!E("messageType",e,g.STRING,!0)}))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return o="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(n),a.info(R.O,"searchConversationByContent -> ".concat(o)),G(n)?[4,r.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,r.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===i.SUCCESS&&u?(d=u.map((function(e){return we(e)})),[2,{code:c,data:d}]):(a.warn(R.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(o)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("keyword",t,g.STRING,!0)&&E("startTime",n,g.NUMBER,!0)&&E("count",o,g.NUMBER,!0)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f,g,v,I,h;return Z(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,G(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return l=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:l=m.sent(),m.label=4;case 4:return f=l.code,g=l.data,f===i.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return Le(e)})),[2,{code:f,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(f," ").concat(r)),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("option",t,g.OBJECT,!0)&&E("option.keyword",t.keyword,g.STRING,!0)&&E("option.startTime",t.startTime,g.NUMBER,!0)&&E("option.endTime",t.endTime,g.NUMBER,!0)&&E("option.offset",t.offset,g.NUMBER)&&E("option.limit",t.limit,g.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I;return Z(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return g=h.sent(),v=g.code,I=g.data,v===i.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return Le(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("userId",t,g.STRING,!0)&&E("startTime",n,g.NUMBER,!0)&&E("count",o,g.NUMBER,!0)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=v.sent(),f=l.code,g=l.data,f===i.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return Le(e)}))}}]:(s.warn(R.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(r)),[2,{code:f}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("option",t,g.OBJECT,!0)&&E("option.count",t.count,g.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("option.timestamp",t.timestamp,g.NUMBER)&&E("option.order",t.order,(function(e){return[0,1].includes(e)}))&&E("option.messageTypes",t.messageTypes,g.ARRAY,!0)&&!t.messageTypes.some((function(e){return!E("option.messageType",e,g.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I,h,m,E,S,T,p,O,N;return Z(this,(function(_){switch(_.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,u=t.order,d=void 0===u?0:u,l=t.messageTypes,f="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(f)),g=e.conversationType,v=e.targetId,I=e.channelId,h=void 0===I?"":I,[4,o.getHistoryMessagesByObjectNames(g,v,c,a,l,d,h)];case 1:return m=_.sent(),E=m.code,S=m.data,E===i.SUCCESS?(p=(T=S).list,O=T.hasMore,N=p.map((function(e){return Le(e)})),[2,{code:E,data:{messages:N,hasMore:O,list:N}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(E," ").concat(f)),[2,{code:E,msg:it[E]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(R.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("messageId",e,g.NUMBER,!0)&&E("receivedStatus",t,(function(e){return!G(a[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("messageId",e,g.NUMBER,!0)&&E("sentStatus",t,(function(e){return!G(b[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("messageId",e,g.NUMBER,!0)&&E("content",t,g.OBJECT,!0)&&E("messageType",n,g.ONLY_STRING,!0)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){return Z(this,(function(o){switch(o.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?!E("messageIds",e,g.ARRAY,!0)||e.some((function(e){return!E("messageId",e,g.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return B()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,g.NUMBER,!0)&&E("targetId",r,g.STRING,!0)&&E("timestamp",t,g.NUMBER,!0)&&E("cleanSpace",n,g.BOOLEAN)?[2,He((function(e,i){return F(s,void 0,void 0,(function(){return Z(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("message",t,g.OBJECT,!0)&&E("options",n,g.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,g.STRING)&&(t instanceof Tn||E("message.senderUserId",t.senderUserId,g.STRING,!0)&&E("message.messageType",t.messageType,g.STRING,!0)&&E("message.content",t.content,g.OBJECT,!0)&&E("message.messageDirection",t.messageDirection,g.NUMBER,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN)&&E("message.expansion",t.expansion,g.OBJECT)&&E("message.disableNotification",t.disableNotification,g.BOOLEAN)&&E("message.sentTime",t.sentTime,g.NUMBER)&&E("message.sentStatus",t.sentStatus,g.NUMBER))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,m,E,S,T;return Z(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,g=t.messageType,v=t.content,t instanceof Tn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),S=E.code,T=E.data,S===i.SUCCESS?[2,{code:S,data:Le(T)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:it[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return F(this,void 0,void 0,(function(){var r,a=this;return Z(this,(function(c){if(!B())return[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}];if(!E("messages",e,(function(e){return v(e)&&!(e.length<=0||e.length>=500)}),!0)||!E("checkDuplicate",t,g.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(E("message",e[r],g.OBJECT,!0)&&E("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)&&E("message.targetId",e[r].targetId,g.STRING,!0)&&E("message.senderUserId",e[r].senderUserId,g.STRING,!0)&&E("message.messageType",e[r].messageType,g.STRING,!0)&&E("message.content",e[r].content,g.OBJECT,!0)&&E("message.messageDirection",e[r].messageDirection,g.NUMBER,!0)&&E("message.canIncludeExpansion",e[r].canIncludeExpansion,g.BOOLEAN)&&E("message.expansion",e[r].expansion,g.OBJECT)&&E("message.disableNotification",e[r].disableNotification,g.BOOLEAN)&&E("message.sentTime",e[r].sentTime,g.NUMBER)&&E("message.sentStatus",e[r].sentStatus,g.NUMBER)&&E("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,g.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,He((function(n){return F(a,void 0,void 0,(function(){var o,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return i=c.sent(),a=i.code,s=i.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("messageUId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("targetId",e,g.STRING,!0)&&E("messageUId",t,g.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("enableCheck",e,g.BOOLEAN)?[2,He((function(n){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return B()?[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(i){switch(i.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},enable:function(){return B()}});function tr(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!e||E("proxy.socksHost",e.socksHost,g.STRING,!0)&&E("proxy.socksPort",e.socksPort,g.NUMBER,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nr(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function or(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!e||E("proxy.socksHost",e.socksHost,g.STRING,!0)&&E("proxy.socksPort",e.socksPort,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Tn as BaseMessage,Un as CombineMessage,yn as CombineV2Message,bn as CommandMessage,Xo as ConnectType,Ue as Events,Mn as FileMessage,Pn as GIFMessage,Vn as GroupNotificationMessage,_n as HQVoiceMessage,Nn as ImageMessage,Gn as InformationNotificationMessage,wn as LocationMessage,$o as MessageType,Bn as ReferenceMessage,Dn as RichContentMessage,Cn as SightMessage,An as TextMessage,Ln as VoiceMessage,et as __addSDKVersion,qo as addConversationsToTag,Je as addEventListener,xo as addTag,Rn as addToBlacklist,hn as bindRTCRoomForChatroom,Tt as clearAllMessagesUnreadStatus,ze as clearEventListeners,No as clearHistoryMessages,bo as clearMessages,St as clearMessagesUnreadStatus,It as clearTextMessageDraft,Vo as clearUnreadCountByTimestamp,ct as connect,Do as deleteLocalMessagesByTimestamp,Oo as deleteMessages,We as destroy,ut as disconnect,er as electronExtension,fn as forceRemoveChatRoomEntry,un as forceSetChatRoomEntry,vn as getAllChatRoomEntries,Bt as getAllConversationState,Yt as getAllUltraGroupUnreadCount,zt as getAllUltraGroupUnreadMentionedCount,wt as getAllUnreadMentionedCount,En as getBlacklist,Sn as getBlacklistStatus,bt as getBlockUltraGroupList,Ut as getBlockedConversationList,gn as getChatRoomEntry,an as getChatRoomInfo,In as getChatroomHistoryMessages,Qe as getConnectionStatus,lt as getConversation,dt as getConversationList,Ct as getConversationNotificationLevel,At as getConversationNotificationStatus,jo as getConversationsFromTagByPage,$e as getCurrentUserId,nt as getDeviceId,ro as getDownloadAuth,oo as getFileToken,io as getFileUrl,Mo as getFirstUnreadMessage,Io as getHistoryMessages,Lo as getMessage,Uo as getMessageReader,nr as getProxy,ho as getRemoteHistoryMessages,Xe as getServerTime,Ho as getTags,Jo as getTagsFromConversation,gt as getTextMessageDraft,Mt as getTopConversationList,ht as getTotalUnreadCount,Rt as getTotalUnreadCountByLevels,mt as getTotalUnreadMentionedCountByLevels,Jt as getUltraGroupDefaultNotificationLevel,Wt as getUltraGroupFirstUnreadMessageTimestamp,Dt as getUltraGroupList,Vt as getUltraGroupMessageListByMessageUId,Kt as getUltraGroupUnreadCountByTargetId,Qt as getUltraGroupUnreadInfoList,Ht as getUltraGroupUnreadMentionedCountByTargetId,jt as getUltraGroupUnreadMentionedMessages,Pt as getUnreadConversationList,Et as getUnreadCount,Wo as getUnreadCountByTag,Lt as getUnreadMentionedCount,wo as getUnreadMentionedMessages,je as init,Po as insertMessage,ot as installPlugin,nn as joinChatRoom,on as joinExistChatRoom,Zt as modifyMessage,qe as onceEventListener,rn as quitChatRoom,po as recallMessage,yo as registerMessageType,Ft as removeAllExpansionForUltraGroupMessage,ln as removeChatRoomEntries,dn as removeChatRoomEntry,ft as removeConversation,Ko as removeConversationsFromTag,Ke as removeEventListener,Ye as removeEventListeners,xt as removeExpansionForUltraGroupMessage,mn as removeFromBlacklist,Co as removeMessageExpansionForKey,Fo as removeTag,zo as removeTagFromConversations,Yo as removeTagsFromConversation,vt as saveTextMessageDraft,Go as searchConversationByContent,Bo as searchMessages,uo as sendFileMessage,fo as sendGIFMessage,go as sendHQVoiceMessage,lo as sendImageMessage,ao as sendMessage,Ro as sendReadReceiptMessage,mo as sendReadReceiptRequest,Eo as sendReadReceiptResponse,So as sendReadReceiptResponseV2,vo as sendSightMessage,To as sendSyncReadStatusMessage,so as sendTextMessage,Ao as sendTypingStatusMessage,Gt as sendUltraGroupTypingStatus,cn as setChatRoomEntries,sn as setChatRoomEntry,Nt as setConversationNotificationLevel,_t as setConversationNotificationStatus,yt as setConversationToTop,Qo as setConversationToTopInTag,ko as setMessageReceivedStatus,tr as setProxy,qt as setUltraGroupDefaultNotificationLevel,or as testProxy,kt as updateExpansionForUltraGroupMessage,_o as updateMessageExpansion,Zo as updateTag,no as upload};
1
+ import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as o,appendUrl as r,ErrorCode as i,ReceivedStatus as a,ConversationType as s,isNumber as c,EventEmitter as u,RCConnectionStatus as d,VersionManage as l,assert as f,AssertRules as g,isArray as v,isHttpUrl as I,APIContext as h,LogTagId as R,logger as m,validate as E,isValidConversationType as S,isValidNotificationLevel as T,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MessageType as C,MAX_UPLOAD_FILE_SIZE as A,UPLOAD_FILE_CHUNK_SIZE as U,UploadMethod as y,fixUrlProtocol as M,FileType as P,getUUID as L,isValidFileType as w,usingCppEngine as B,MessageDirection as D,SentStatus as b,isUndefined as G}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var V=function(e,t){return V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},V(e,t)};function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}V(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var x=function(){return x=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},x.apply(this,arguments)};function F(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function Z(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var H=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))},J=H();var q=null,K=function(e){return F(void 0,void 0,void 0,(function(){var t;return Z(this,(function(n){switch(n.label){case 0:return[4,Y.getNetworkType()];case 1:return t=n.sent(),q({status:"online"===e.type,type:t}),[2]}}))}))};var Y={tag:"browser",httpReq:e,localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:J,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,o=e.effectiveType,r=n||o||t.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){q=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",K),window.addEventListener("online",K))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",K),window.removeEventListener("online",K)),q=null}},z=H(),j=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},W={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},Q=null,X=function(e){var t=e.isConnected,n=e.networkType;Q({status:t,type:n})};var $={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){wx.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:W,sessionStorage:W,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Q=e,wx.onNetworkStatusChange(X)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(X),Q=null}},ee=H(),te=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe=null,re=function(e){var t=e.isConnected,n=e.networkType;oe({status:t,type:n})};var ie={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){oe=e,my.onNetworkStatusChange(re)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(re),oe=null}},ae=H(),se=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue=null,de=function(e){var t=e.isConnected,n=e.networkType;ue({status:t,type:n})};var le={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ae,localStorage:ce,sessionStorage:ce,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:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ue=e,tt.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(de),ue=null}},fe=H(),ge=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},ve={setItem:ge("setStorageSync"),getItem:ge("getStorageSync"),removeItem:ge("removeStorageSync"),clear:ge("clearStorageSync")},Ie=null,he=function(e){var t=e.isConnected,n=e.networkType;Ie({status:t,type:n})};var Re={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:fe,localStorage:ve,sessionStorage:ve,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:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ie=e,swan.onNetworkStatusChange(he)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(he),Ie=null}},me=H(),Ee=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Se={setItem:Ee("setStorageSync"),getItem:Ee("getStorageSync"),removeItem:Ee("removeStorageSync"),clear:Ee("clearStorageSync")},Te=null,pe=function(e){var t=e.isConnected,n=e.networkType;Te({status:t,type:n})};var Oe={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){jd.request({url:d,method:t,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Se,sessionStorage:Se,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:me,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Te=e,jd.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(pe),Te=null}},Ne=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},_e={setItem:Ne("setStorageSync"),getItem:Ne("getStorageSync"),removeItem:Ne("removeStorageSync"),clear:Ne("clearStorageSync")},Ce=null,Ae=function(e){var t=e.isConnected,n=e.networkType;Ce({status:t,type:n})};var Ue,ye={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){uni.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:_e,sessionStorage:_e,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ce=e,uni.onNetworkStatusChange(Ae)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ae),Ce=null}},Me=function(e){return e&&e.request&&e.getSystemInfo},Pe="undefined"!=typeof uni&&Me(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ye;case"mp-jd":return Oe;case"mp-baidu":return Re;case"mp-toutiao":return le;case"mp-alipay":return ie;case"mp-weixin":return $;default:return Y}}():"undefined"!=typeof jd&&Me(jd)?Oe:"undefined"!=typeof my&&Me(my)?ie:"undefined"!=typeof tt&&Me(tt)?le:"undefined"!=typeof swan&&Me(swan)?Re:"undefined"!=typeof wx&&Me(wx)?$:Y;function Le(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,i=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,S=e.disableNotification,T=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,U=e.channelType,y=e.sentStatus;E||(E=a.UNREAD);var M={messageType:o,channelId:n||"",content:r,senderUserId:i,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:y};return t!==s.ULTRA_GROUP&&(M.isOffLineMessage=h),t===s.ULTRA_GROUP&&c(U)&&(M.channelType=U),M}function we(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I=e.unreadMentionedMeCount,h=e.operationTime,R={conversationType:t,targetId:n,latestMessage:o&&Le(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:g,matchCount:v,unreadMentionedMeCount:I,operationTime:h};return R.conversationType===s.ULTRA_GROUP&&(R.firstUnreadMessage=e.firstUnreadMessage,R.channelType=e.channelType),R}function Be(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(Ue||(Ue={}));var De=new u,be={connection:function(e,t){switch(e){case d.CONNECTED:De.emit(Ue.CONNECTED);break;case d.CONNECTING:De.emit(Ue.CONNECTING);break;case d.SUSPENDED:De.emit(Ue.SUSPEND,t);break;case d.DISCONNECTED:De.emit(Ue.DISCONNECT,t)}},batchMessage:function(e){De.emit(Ue.MESSAGES,{messages:e.map((function(e){return Le(e)}))})},typingState:function(e){De.emit(Ue.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){De.emit(Ue.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){De.emit(Ue.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){De.emit(Ue.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=Ge(e.unreadMessageCount||0),n.unreadMentionedCount=Ge(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Ge(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));De.emit(Ue.CONVERSATION,{conversationList:t})},chatroomState:function(e){De.emit(Ue.CHATROOM,e)},expansion:function(e){De.emit(Ue.EXPANSION,e)},pullFinished:function(){De.emit(Ue.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){De.emit(Ue.TAG)},conversationTagChanged:function(){De.emit(Ue.CONVERSATION_TAG)},messageBlocked:function(e){De.emit(Ue.MESSAGE_BLOCKED,e)},messageDelivered:function(e){De.emit(Ue.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){De.emit(Ue.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){De.emit(Ue.ULTRA_GROUP_ENABLE,e.map((function(e){return we(e)})))},operateStatus:function(e){De.emit(Ue.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){De.emit(Ue.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Le(e)})))},ultraGroupMessageModified:function(e){De.emit(Ue.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Le(e)})))},ultraGroupMessageRecalled:function(e){De.emit(Ue.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Le(e)})))},ultraGroupChannelChangeType:function(e){De.emit(Ue.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){De.emit(Ue.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){De.emit(Ue.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){De.emit(Ue.USER_GROUP_STATUS,e)}};function Ge(e){return e>999?999:e}l.add("imlib-next","5.8.4-alpha.3");var Ve=null,ke=null,xe=null;function Fe(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return Ve?(xe.info(R.A_DESTROY_O),[4,h.destroy()]):[2];case 1:return e.sent(),ke=null,Ve=null,xe=null,[2]}}))}))}function Ze(e){if(!Ve)throw new Error("Not initialized yet!");return e(Ve,xe,ke)}function He(e){return Ve?e(Ve,xe,ke):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Je(e,t,n){De.on(e,t,n)}function qe(e,t,n){De.once(e,t,n)}function Ke(e,t,n){De.off(e,t,n)}function Ye(e){De.removeAll(e)}function ze(){De.clear()}function je(e){!function(e){var t,n=e.appkey,o=e.navigators;Ve?xe.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,g.STRING,!0),f("options.navigators",e.navigators,(function(e){return v(e)&&(0===e.length||e.every(I))})),ke=e,Ve=h.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Pe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl}),(xe=Ve.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),xe.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.8.4-alpha.3",commit:"a61ad0651827df4a925e858c2d5f11b4bddbeb0b"})),Ve.assignWatcher(be),m.init(xe))}(e)}function We(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return Ve?(ze(),[2,Fe()]):[2]}))}))}function Qe(){return Ze((function(e){return e.getConnectionStatus()}))}function Xe(){return Ze((function(e){return e.getServerTime()}))}function $e(){return Ze((function(e){return e.getCurrentUserId()}))}function et(e,t){l.add(e,t)}function nt(){return Ze((function(e){return e.getDeviceId()}))}function ot(e,t){return Ze((function(n){return n.install(e,t)}))}var rt={TIMEOUT:{code:-1,msg:"Network timeout"},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:i.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:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},it={};for(var at in rt){var st=rt[at].code;it[st]=at}function ct(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return E("token",e,g.STRING,!0)&&E("reconnectKickEnable",t,g.BOOLEAN)?(n=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](R.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:it[a.code]}]}}))}))}))]}))}))}function ut(e){return m.info(R.A_DISCONNECT_O,{}),Ze((function(t){return t.disconnect(e)}))}function dt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options.count",null==e?void 0:e.count,g.NUMBER)&&E("options.startTime",null==e?void 0:e.startTime,g.NUMBER)&&E("options.order",null==e?void 0:e.order,g.NUMBER)&&E("channelId",t,g.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(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(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}]):[2,{code:r,data:a?we(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("draft",t,g.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(R.O,"delete draft fail ->".concat(r,":").concat(it[r],",").concat(t)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("includeMuted",e,g.BOOLEAN,!1)&&E("conversationTypes",t,g.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!E("conversationType",e,S)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!E("conversationTypes",e,g.ARRAY,!0)||!E("levels",t,g.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function mt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!E("conversationTypes",e,g.ARRAY,!0)||!E("levels",t,g.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function Et(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}rt.ROAMING_SERVICE_UNAVAILABLE.code;var pt=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(R.O,"".concat(n," -> ").concat(o)),o},Ot=function(e,t,n,o){return void 0===o&&(o=""),F(void 0,void 0,void 0,(function(){var r,a;return Z(this,(function(s){switch(s.label){case 0:return r=pt(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(it[a]," , ").concat(r)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))};function Nt(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return E("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=pt(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(it[a]," , ").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getBlockConversationList()}))]}))}))}function yt(e,t){return void 0===t&&(t=!0),F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("isTop",t,g.BOOLEAN)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversationTypes",e,g.ARRAY)&&!(null==e?void 0:e.some((function(e){return!E("conversationType",e,S)})))&&E("channelId",t,g.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!E("conversationTypes",e,g.ARRAY)||(null==e?void 0:e.some((function(e){return!E("conversationType",e,O)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return we(e)}))}]:[2,{code:o,msg:it[o]}]}}))}))}))]}))}))}function Lt(e){return F(this,void 0,void 0,(function(){return Z(this,(function(t){return E("options",e,g.CONVERSATION,!0)?[2,He((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function Bt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getAllConversationState()}))]}))}))}function Dt(e){return void 0===e&&(e={}),F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options.targetId",e.targetId,g.STRING,!1)&&E("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(it[o])),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function Gt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(it[t])),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("msgs",t,g.ARRAY,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return Z(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),l=d.code,f=d.data,l===i.SUCCESS){for(v in g={},f)g[v]=f[v]?Le(f[v]):void 0;return[2,{code:i.SUCCESS,data:g}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(it[l])),[2,{code:l,msg:it[l]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("expansion",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(it[g])),[2,{code:g,msg:it[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("expansion",e,g.ARRAY,!0)&&E("message",t,g.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(it[g])),[2,{code:g,msg:it[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("message",e,g.OBJECT,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("content",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return Z(this,(function(I){switch(I.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(f)),g={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(it[v])),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("notificationLevels",t,g.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(r)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(it[s]," , ").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID,!0)&&E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(it[s]," , ").concat(a)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("notificationLevels",t,g.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(R.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function zt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function jt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID,!0)&&E("options.sentTime",e.sentTime,g.NUMBER,!0)&&E("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===i.SUCCESS?[2,{code:d,data:l}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(it[d])),[2,{code:d,msg:it[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("conversation.targetId",e.targetId,g.STRING,!0)&&E("conversation.channelId",e.channelId,g.CHANNEL_ID,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,a,s,c;return Z(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 a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:it[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qt(e){return F(this,void 0,void 0,(function(){var t,n=this;return Z(this,(function(o){return E("targetIds",e,g.ARRAY,!0)&&E("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!E("targetId",e,g.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,He((function(e){return F(n,void 0,void 0,(function(){var n,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:it[o]}]}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Xt=function(e){return!!(E("options.key",e.key,g.STRING,!0)&&E("options.value",e.value,g.STRING,!0)&&E("options.isAutoDelete",e.isAutoDelete,g.BOOLEAN)&&E("options.isSendNotification",e.isSendNotification,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING))},$t=function(e){return e.entries.every((function(e){return E("entry.key",e.key,g.STRING,!0)&&E("entry.value",e.value,g.STRING,!0)}))&&E("options.isAutoDelete",e.isAutoDelete,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING)&&E("options.isForce",e.isForce,g.BOOLEAN)},en=function(e){return E("options.key",e.key,g.STRING,!0)&&E("options.isSendNotification",e.isSendNotification,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING)},tn=function(e){return e.entries.every((function(e){return E("key",e,g.STRING,!0)}))&&E("options.notificationExtra",e.notificationExtra,g.STRING)};function nn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:it[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=d.sent(),s=a.code,c=a.data,u=s===i.SUCCESS?"info":"warn",r[u](R.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==i.SUCCESS?[2,{code:s,msg:it[s]}]:[2,{code:s,data:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("targetId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),t),r!==i.SUCCESS?[2,{code:r,msg:it[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER)&&E("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&Xt(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&$t(t)?t.entries.length>10?[2,rt.CHATROOM_KV_STORE_OUT_LIMIT]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&Xt(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&tn(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(n)),(a=x({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(it[c],",").concat(n)),[2,{code:c,msg:it[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("targetId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(it[a],",").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.timestamp",t.timestamp,g.NUMBER)&&E("options.count",t.count,g.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&E("options.order",t.order,(function(e){return 0===e||1===e}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("option.chatRoomId",e.chatRoomId,g.STRING,!0)&&E("option.rtcRoomId",e.rtcRoomId,g.STRING,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:it[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("userId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("userId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Sn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("userId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Tn=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 pn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Tn(e,o,t,n)}}var On,Nn=pn("RC:ImgMsg"),_n=pn("RC:HQVCMsg"),Cn=pn("RC:SightMsg"),An=pn("RC:TxtMsg"),Un=pn("RC:CombineMsg"),yn=pn(C.COMBINE_V2),Mn=pn("RC:FileMsg"),Pn=pn("RC:GIFMsg"),Ln=pn("RC:VcMsg"),wn=pn("RC:LBSMsg"),Bn=pn("RC:ReferenceMsg"),Dn=pn("RC:ImgTextMsg"),bn=pn("RC:CmdMsg"),Gn=pn("RC:InfoNtf"),Vn=pn("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(On||(On={}));var kn,xn,Fn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>A?Promise.resolve({code:i.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>U&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=d.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,e({url:M(this._url),headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.QINIU}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("Method not implemented.")}))}))},n}(Fn),Hn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=M("".concat(a.ossBucketName,".").concat(this._url)),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,e({url:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.ALI}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Fn),Jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=P.FILE?r:P.FILE)];case 1:return s=f.sent(),c=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},d=M("".concat(this._url).concat(s.path)),[4,e({url:d,headers:u,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=f.sent().status)||204===l?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:d}}]:[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Fn),qn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return s=g.sent(),c={},u=M("".concat(s.s3BucketName,".").concat(this._url)),d=new FormData,a?d.set("Content-Disposition",a):d.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),d.set("Content-Type",n.type),d.set("x-amz-credential",s.s3Credential),d.set("x-amz-algorithm",s.s3Algorithm),d.set("x-amz-date",s.s3Date),d.set("policy",s.s3Policy),d.set("x-amz-signature",s.s3Signature),d.set("key",s.fileName),d.set("file",n),[4,e({url:u,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:d,timeout:0})];case 2:return l=g.sent(),f=l.status,l.data,200===f||204===f?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:y.AWS}}]:[2,{code:i.UPLOAD_FAIL,msg:f.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Fn),Kn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=M("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,g,v,I,h,R,m,E,S;return Z(this,(function(T){switch(T.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=M("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(g=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,g)]);case 3:return v=T.sent(),I=v.code,h=v.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=g.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,g,v,I,h,R,m;return Z(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*U,l=Math.min(U,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return g=E.sent(),v=n.slice(d,c*U),I=this.getBaseHeaders(n,g,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:v,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)},timeout:0})];case 2:return h=E.sent(),R=h.status,h.data,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n}(Fn),Yn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=M("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,g,v,I,h,R,m,E,S;return Z(this,(function(T){switch(T.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=M("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(g=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,g)]);case 3:return v=T.sent(),I=v.code,h=v.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=g.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m,timeout:0})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,g,v,I,h,R,m;return Z(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*U,l=Math.min(U,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return g=E.sent(),v=n.slice(d,c*U),I=this.getBaseHeaders(n,g,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:v,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)}})];case 2:return h=E.sent(),R=h.status,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n}(Fn),zn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=v.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),u=M(this._url),[4,e({url:u,headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return d=v.sent(),l=d.status,f=d.data,200!==l&&204!==l||!f?[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]:(g=JSON.parse(f),[2,{code:i.SUCCESS,data:{uniqueName:g.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(g.rc_url.path)}}])}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){var t,n,o,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=L(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,o,r,a){return void 0===a&&(a=0),F(this,void 0,void 0,(function(){var s,c,u,d,l,f,g,v,I,h;return Z(this,(function(R){switch(R.label){case 0:return s=Math.min(U,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes=".concat(a,"-").concat(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},d=n.slice(a,a+s),(l=new FormData).set("file",d,n.name),l.set("key",c),l.set("name",c),l.set("token",o),f=M(this._url),[4,e({url:f,headers:u,onProgress:function(e){return null==r?void 0:r(a+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return g=R.sent(),v=g.status,I=g.data,200===v||204===v?a+s<n.size?[2,this._requestUploadPart(t,n,o,r,a+s)]:(h=JSON.parse(I),[2,{code:i.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:"".concat(f,"/").concat(h.rc_url.path)}}]):[2,{code:i.UPLOAD_FAIL,msg:v.toString()}]}}))}))},n}(Fn);function jn(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,g,v,I,h,R,m;return Z(this,(function(E){switch(E.label){case 0:return n=t.getFileToken,o=t.serverType,r=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:On.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:On.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:On.QINIU,url:o,p:"1"});r&&i.push({type:On.BAIDU,url:r,p:"2"});return i}(a,0,r,s,c),0===f.length?[2,Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,$n(f,e,n,o)];case 1:return g=E.sent(),v=g.code,I=g.data,h=g.msg,v===i.SUCCESS&&I?[4,Wn(e,t,I)]:[2,{code:v,msg:h}];case 2:return R=E.sent(),m={downloadUrl:R,uniqueName:(null==I?void 0:I.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==P.AUDIO?[3,4]:[4,u.arrayBuffer()];case 3:return[2,Qn(E.sent(),m)];case 4:return d===P.IMAGE?[2,eo(u,m,l)]:[2,{code:v,data:m}]}}))}))}function Wn(e,t,n){return F(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function Qn(e,t){return xn=xn||new AudioContext,new Promise((function(n,o){xn.decodeAudioData(e,(function(e){n({code:i.SUCCESS,data:x(x({},t),{duration:e.duration,length:e.length})})}),(function(e){n({code:i.UPLOAD_FAIL,msg:"get audio info fail:".concat(JSON.stringify(e))})}))}))}var Xn=((kn={})[On.QINIU]=Zn,kn[On.ALIYUN]=Hn,kn[On.BAIDU]=Jn,kn[On.S3]=qn,kn[On.STC]=Kn,kn[On.MINIO]=Yn,kn[On.RCX]=zn,kn);function $n(e,t,n,o,r){return void 0===r&&(r=[]),F(this,void 0,void 0,(function(){var a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:i.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(r))})]:(a=e.shift(),[4,new Xn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==i.SUCCESS?(r.push({type:a.type,url:a.url,code:c,msg:d}),[2,$n(e,t,n,o,r)]):[2,{code:c,data:u}]}}))}))}function eo(e,t,n){return new Promise((function(o,r){var a=document.createElement("canvas"),s=a.getContext("2d"),c=new Image;c.onload=function(r){var u=n||{},d=u.maxHeight,l=void 0===d?160:d,f=u.maxWidth,g=void 0===f?160:f,v=u.quality,I=void 0===v?.7:v,h=u.scale,R=void 0===h?1:h,m=to(c.width,c.height,{maxHeight:l,maxWidth:g,scale:R});a.width=Math.min(m.w,g),a.height=Math.min(m.h,l),s.drawImage(c,m.x,m.y,m.w,m.h);var E=a.toDataURL("string"==typeof e?"image/jpg":e.type,I);E=E.replace(/data:image\/[^;]+;base64,/,""),o({code:i.SUCCESS,data:x(x({},t),{thumbnail:E,width:m.w,height:m.h})})},c.onerror=function(e){o({code:i.UPLOAD_FAIL,msg:"get image info fail:".concat(JSON.stringify(e))})},c.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var to=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function no(e){return F(this,void 0,void 0,(function(){var t,n,o;return Z(this,(function(r){return t=e.contentDisposition,n=e.fileType,o=e.file,E("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1)&&E("fileType",n,(function(e){return!!P[e]}),!0)&&E("file",o,(function(e){return e instanceof File&&(!(n===P.IMAGE&&!e.type.match(/^image\//))&&!(n===P.AUDIO&&!e.type.match(/^audio\//)))}),!0)?[2,He((function(t,n,o){return new Promise((function(n){var r=t.getNaviInfoFromCache();jn(e,{getFileToken:t.getFileToken.bind(t),getFileUrl:t.getFileUrl.bind(t),customDomain:o.uploadDomain||"",serverType:null==r?void 0:r.type,ossConfig:null==r?void 0:r.ossConfig,uploadServer:null==r?void 0:r.uploadServer,bosAddr:null==r?void 0:r.bosAddr}).then((function(e){n(e)}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,t,n,o){return He((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:it[e]})}))}))}))}function ro(e){return E("url",e,g.STRING,!0)?He((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,o=e.downloadAuthInfo,r=e.deadline;n({code:i.SUCCESS,data:{token:t,downloadAuthInfo:o,deadline:r}})})).catch((function(e){n({code:e,msg:it[e]})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function io(e,t,n,o,r){return E("fileType",e,w,!0)&&E("filename",t,g.STRING)&&E("saveName",n,g.STRING)&&E("serverType",r,g.NUMBER)?He((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function ao(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return[2,He((function(r,c){return F(o,void 0,void 0,(function(){var o,u,d,l,f,v,I,h,m,S,T,p;return Z(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Tn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,rt.ILLGAL_PARAMS]):E("conversation",e,g.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,E("conversation.targetId",u,g.STRING,!0)&&E("conversation.conversationType",o,g.NUMBER,!0)&&E("conversation.channelId",d,g.CHANNEL_ID)&&E("options.isStatusMessage",null==n?void 0:n.isStatusMessage,g.BOOLEAN)&&E("options.disableNotification",null==n?void 0:n.disableNotification,g.BOOLEAN)&&E("options.pushContent",null==n?void 0:n.pushContent,g.STRING)&&E("options.pushData",null==n?void 0:n.pushData,g.STRING)&&E("options.isMentioned",null==n?void 0:n.isMentioned,g.BOOLEAN)&&E("options.mentionedType",null==n?void 0:n.mentionedType,g.NUMBER)&&E("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,g.ARRAY)&&E("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,g.ARRAY)&&E("options.isVoipPush",null==n?void 0:n.isVoipPush,g.BOOLEAN)&&E("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,g.BOOLEAN)&&E("options.expansion",null==n?void 0:n.expansion,g.OBJECT)&&E("options.pushConfig",null==n?void 0:n.pushConfig,g.OBJECT)&&E("options.messageId",null==n?void 0:n.messageId,g.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(l)),f=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,l=e.isVoipPush,f=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return x({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,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,isCounted:!!t.isCounted,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:r.getCurrentUserId(),messageUId:"",messageDirection:D.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:b.SENDING},o!==s.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Le(v))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,r.sendMessage(o,u,f,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return m=O.sent(),S=m.code,T=m.data,S===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),I),p=Le(T),[2,{code:S,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(it[S],",").concat(l)),v.sentTime=(null==T?void 0:T.sentTime)||0,v.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:it[S],data:Le(v)}])}}))}))}))]}))}))}function so(e,t,n){return ao(e,new An(t),n)}function co(e,t){return function(n,o,r,a){if(!E("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(E("sendOptions.maxHeight",null==c?void 0:c.maxHeight,g.NUMBER)&&E("sendOptions.maxWidth",null==c?void 0:c.maxWidth,g.NUMBER)&&E("sendOptions.quality",null==c?void 0:c.quality,g.NUMBER)&&E("sendOptions.scale",null==c?void 0:c.scale,g.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return He((function(c,u,d){return new Promise((function(c){var d=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),d),no({file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==r?void 0:r.onProgress)||void 0===n||n.call(r,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig}).then((function(e){var s,l=e.code,f=e.data,g=e.msg;if(l===i.SUCCESS&&f){var v=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,x({url:f.downloadUrl},f)))||t(f,o);return u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:i.SUCCESS}),d),void ao(n,v,a).then(c)}c({code:l,msg:g})}))}))}))}}var uo=co(P.FILE,(function(e,t){var n,o,r={name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(r.user=t.user),t.extra&&(r.extra=t.extra),t.mentionedInfo&&(r.mentionedInfo=t.mentionedInfo),new Mn(r)})),lo=co(P.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Nn(n)})),fo=co(P.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Pn(n)})),go=co(P.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new _n(n)})),vo=co(P.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Cn(n)}));function Io(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,g.NUMBER)&&E("options.count",null==t?void 0:t.count,g.NUMBER)&&(B()||E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,g.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),1!==(o.getNaviInfoFromCache()||{}).repairHisMsg?[3,2]:(null==t?void 0:t.count)&&(null==t?void 0:t.count)>100?(r.warn(R.A_GET_HISTORY_MSG_R,'"options.count" is invalid, It should be greater than 0 and less than 100',n),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[4,o.getMessages(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 a=d.sent(),[3,4];case 2:return[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 3:a=d.sent(),d.label=4;case 4:return s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,g.NUMBER)&&E("options.count",null==t?void 0:t.count,g.NUMBER)&&E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,g.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return E("targetId",e,g.STRING,!0)&&E("messageUId",t,g.STRING,!0)&&E("timestamp",n,g.NUMBER,!0)&&E("channelId",o,g.CHANNEL_ID)?[2,He((function(i){return F(r,void 0,void 0,(function(){var r,i,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new Tn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,ao(r,i)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("messageUId",t,g.STRING,!0)&&E("targetId",e,g.STRING,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){var o,r,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"send read receipt message ->".concat(o)),r=new Tn("RC:RRReqMsg",{messageUId:t}),[4,ao({targetId:e,conversationType:s.GROUP,channelId:n},r)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t,n){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function So(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("targetId",e,g.STRING,!0)&&E("messageList",t,g.OBJECT,!0)&&E("channelId",n,g.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!E(e,t[e],g.ARRAY)}))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:s.GROUP,channelId:n},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,n)]:(a.warn(R.O,"Error in parameter messageList."),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]));case 1:return c=g.sent(),[3,4];case 2:return l=new Tn("RC:RRRspMsg",{receiptMessageDic:t}),[4,ao(o,l)];case 3:c=g.sent(),g.label=4;case 4:return(f=c.code)===i.SUCCESS?[2,{code:f}]:(a.warn(R.O,"send read receipt message fail ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return E("conversation",e,g.CONVERSATION,!0)&&E("lastMessageSendTime",t,g.NUMBER,!0)?(n=new Tn("RC:SRSMsg",{lastMessageSendTime:t}),[4,ao(e,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function po(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("options.messageUId",t.messageUId,g.STRING,!0)&&E("options.sentTime",t.sentTime,g.NUMBER,!0)&&E("options.disableNotification",null==t?void 0:t.disableNotification,g.BOOLEAN)&&E("options.pushConfig",null==t?void 0:t.pushConfig,g.OBJECT)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:Le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(it[c],",").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("options",t,(function(e){return v(e)&&e.length}),!0)&&!t.some((function(e){return!E("options.messageUId",e.messageUId,g.STRING,!0)||!E("options.sentTime",e.sentTime,g.NUMBER,!0)||!E("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("expansion",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)&&E("message.conversationType",t.conversationType,g.NUMBER,!0)&&E("message.targetId",t.targetId,g.STRING,!0)&&E("message.channelId",t.channelId,g.CHANNEL_ID)&&E("message.messageUId",t.messageUId,g.STRING,!0)&&E("message.expansion",t.expansion,g.OBJECT)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return Z(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=g.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(f,":").concat(it[f],",").concat(l)),[2,{code:f,msg:it[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("keys",e,g.ARRAY,!0)&&E("message",t,g.OBJECT,!0)&&E("message.conversationType",t.conversationType,g.NUMBER,!0)&&E("message.targetId",t.targetId,g.STRING,!0)&&E("message.channelId",t.channelId,g.CHANNEL_ID)&&E("message.messageUId",t.messageUId,g.STRING,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(l,":").concat(it[l],",").concat(d)),[2,{code:l,msg:it[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("typingContentType",t,g.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:Le(u)}]:[2,{code:c,msg:it[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("messageUId",t,g.STRING,!0)&&E("targetId",e,g.STRING,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(R.O,"get message reader fail ->".concat(c,":").concat(it[c],",").concat(o)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t,n,o,r){return Ze((function(i,a){return f("messageType",e,g.STRING,!0),f("isPersited",t,g.BOOLEAN,!0),f("isCounted",n,g.BOOLEAN,!0),f("isStatusMessage",r,g.BOOLEAN,!1),f("searchProps",o,g.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),pn(e,t,n)}))}function Mo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("conversation",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&Le(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Po(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return Be("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),B()?E("conversation",e,g.CONVERSATION,!0)&&E("message",t,g.OBJECT,!0)&&E("options",n,g.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,g.STRING)&&E("content.senderUserId",t.senderUserId,g.STRING,!0)&&E("content.messageType",t.messageType,g.STRING,!0)&&E("content.content",t.content,g.OBJECT,!0)&&E("content.messageDirection",t.messageDirection,g.NUMBER,!0)&&E("content.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN)&&E("content.expansion",t.expansion,g.OBJECT)&&E("content.disableNotification",t.disableNotification,g.BOOLEAN)&&E("content.sentTime",t.sentTime,g.NUMBER)&&E("content.sentStatus",t.sentStatus,g.NUMBER)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,m,E,S,T,p;return Z(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),T=S.code,p=S.data,T===i.SUCCESS?[2,{code:T,data:Le(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:it[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Lo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("messageId",e,(function(e){return c(e)||_(e)}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:Le(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function wo(e){if(!B())return{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return E("conversation",e,g.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Le(e))})),{code:i.SUCCESS,data:a}},Ve?t(Ve,xe,ke):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function Bo(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),B()?E("conversation",e,g.CONVERSATION,!0)&&E("keyword",t,g.STRING,!0)&&E("timestamp",n,g.NUMBER)&&E("count",o,g.NUMBER)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=l.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Do(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return Be("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),B()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,g.NUMBER,!0)&&E("targetId",r,g.STRING,!0)&&E("timestamp",t,g.NUMBER,!0)&&E("cleanSpace",n,g.BOOLEAN)?[2,He((function(c,u){return F(s,void 0,void 0,(function(){var s;return Z(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function bo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return Be("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),B()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Go(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),B()?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u;return Z(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Vo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return Be("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),B()?E("messageId",e,g.NUMBER,!0)&&E("receivedStatus",t,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function xo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("tag.tagId",e.tagId,g.STRING,!0)&&E("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&E("tag.tagName",e.tagName,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("tagId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("tag.tagId",e.tagId,g.STRING,!0)&&E("tag.tagName",e.tagName,g.STRING,!0)&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Jo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return E("conversation",e,g.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("tagIds",t,g.ARRAY,!0)&&!t.some((function(e){return!E("tagId",e,g.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("tagId",e,g.STRING,!0)&&E("count",t,g.NUMBER,!0)&&E("startTime",n,g.NUMBER,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c;return Z(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return x(x({},we(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("containMuted",t,g.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a;return Z(this,(function(s){switch(s.label){case 0:return r.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return E("tagId",e,g.STRING,!0)&&E("conversation",t,g.CONVERSATION,!0)&&E("status.isTop",n,g.BOOLEAN,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o;return Z(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:it[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}co(P.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Un(n)}));var Xo={COMET:"comet",WEBSOCKET:"websocket"},$o={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",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var er=Object.freeze({__proto__:null,getAllConversationList:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("channelId",e,g.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),G(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 r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return we(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("startTime",e,g.NUMBER,!0)&&E("count",t,g.NUMBER,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),G(n)?[4,r.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,t,n)];case 3:s=f.sent(),f.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(l=d.map((function(e){return we(e)})),[2,{code:u,data:l}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:it[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("keyword",e,g.STRING,!0)&&E("messageTypes",t,g.ARRAY,!0)&&E("channelId",n,g.CHANNEL_ID)&&!t.some((function(e){return!E("messageType",e,g.STRING,!0)}))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return o="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(n),a.info(R.O,"searchConversationByContent -> ".concat(o)),G(n)?[4,r.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,r.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===i.SUCCESS&&u?(d=u.map((function(e){return we(e)})),[2,{code:c,data:d}]):(a.warn(R.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(o)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("keyword",t,g.STRING,!0)&&E("startTime",n,g.NUMBER,!0)&&E("count",o,g.NUMBER,!0)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f,g,v,I,h;return Z(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,G(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return l=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:l=m.sent(),m.label=4;case 4:return f=l.code,g=l.data,f===i.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return Le(e)})),[2,{code:f,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(f," ").concat(r)),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("option",t,g.OBJECT,!0)&&E("option.keyword",t.keyword,g.STRING,!0)&&E("option.startTime",t.startTime,g.NUMBER,!0)&&E("option.endTime",t.endTime,g.NUMBER,!0)&&E("option.offset",t.offset,g.NUMBER)&&E("option.limit",t.limit,g.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I;return Z(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return g=h.sent(),v=g.code,I=g.data,v===i.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return Le(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("userId",t,g.STRING,!0)&&E("startTime",n,g.NUMBER,!0)&&E("count",o,g.NUMBER,!0)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f,g;return Z(this,(function(v){switch(v.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=v.sent(),f=l.code,g=l.data,f===i.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return Le(e)}))}}]:(s.warn(R.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(r)),[2,{code:f}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("option",t,g.OBJECT,!0)&&E("option.count",t.count,g.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("option.timestamp",t.timestamp,g.NUMBER)&&E("option.order",t.order,(function(e){return[0,1].includes(e)}))&&E("option.messageTypes",t.messageTypes,g.ARRAY,!0)&&!t.messageTypes.some((function(e){return!E("option.messageType",e,g.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I,h,m,E,S,T,p,O,N;return Z(this,(function(_){switch(_.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,u=t.order,d=void 0===u?0:u,l=t.messageTypes,f="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(f)),g=e.conversationType,v=e.targetId,I=e.channelId,h=void 0===I?"":I,[4,o.getHistoryMessagesByObjectNames(g,v,c,a,l,d,h)];case 1:return m=_.sent(),E=m.code,S=m.data,E===i.SUCCESS?(p=(T=S).list,O=T.hasMore,N=p.map((function(e){return Le(e)})),[2,{code:E,data:{messages:N,hasMore:O,list:N}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(E," ").concat(f)),[2,{code:E,msg:it[E]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(R.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("messageId",e,g.NUMBER,!0)&&E("receivedStatus",t,(function(e){return!G(a[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("messageId",e,g.NUMBER,!0)&&E("sentStatus",t,(function(e){return!G(b[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("messageId",e,g.NUMBER,!0)&&E("content",t,g.OBJECT,!0)&&E("messageType",n,g.ONLY_STRING,!0)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){return Z(this,(function(o){switch(o.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?!E("messageIds",e,g.ARRAY,!0)||e.some((function(e){return!E("messageId",e,g.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return B()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,g.NUMBER,!0)&&E("targetId",r,g.STRING,!0)&&E("timestamp",t,g.NUMBER,!0)&&E("cleanSpace",n,g.BOOLEAN)?[2,He((function(e,i){return F(s,void 0,void 0,(function(){return Z(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return B()?E("conversation",e,g.CONVERSATION,!0)&&E("message",t,g.OBJECT,!0)&&E("options",n,g.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,g.STRING)&&(t instanceof Tn||E("message.senderUserId",t.senderUserId,g.STRING,!0)&&E("message.messageType",t.messageType,g.STRING,!0)&&E("message.content",t.content,g.OBJECT,!0)&&E("message.messageDirection",t.messageDirection,g.NUMBER,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN)&&E("message.expansion",t.expansion,g.OBJECT)&&E("message.disableNotification",t.disableNotification,g.BOOLEAN)&&E("message.sentTime",t.sentTime,g.NUMBER)&&E("message.sentStatus",t.sentStatus,g.NUMBER))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,m,E,S,T;return Z(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,g=t.messageType,v=t.content,t instanceof Tn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),S=E.code,T=E.data,S===i.SUCCESS?[2,{code:S,data:Le(T)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:it[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return F(this,void 0,void 0,(function(){var r,a=this;return Z(this,(function(c){if(!B())return[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}];if(!E("messages",e,(function(e){return v(e)&&!(e.length<=0||e.length>=500)}),!0)||!E("checkDuplicate",t,g.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(E("message",e[r],g.OBJECT,!0)&&E("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)&&E("message.targetId",e[r].targetId,g.STRING,!0)&&E("message.senderUserId",e[r].senderUserId,g.STRING,!0)&&E("message.messageType",e[r].messageType,g.STRING,!0)&&E("message.content",e[r].content,g.OBJECT,!0)&&E("message.messageDirection",e[r].messageDirection,g.NUMBER,!0)&&E("message.canIncludeExpansion",e[r].canIncludeExpansion,g.BOOLEAN)&&E("message.expansion",e[r].expansion,g.OBJECT)&&E("message.disableNotification",e[r].disableNotification,g.BOOLEAN)&&E("message.sentTime",e[r].sentTime,g.NUMBER)&&E("message.sentStatus",e[r].sentStatus,g.NUMBER)&&E("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,g.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,He((function(n){return F(a,void 0,void 0,(function(){var o,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return i=c.sent(),a=i.code,s=i.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("messageUId",e,g.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return B()?E("targetId",e,g.STRING,!0)&&E("messageUId",t,g.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return B()?E("enableCheck",e,g.BOOLEAN)?[2,He((function(n){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return B()?[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(i){switch(i.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},enable:function(){return B()}});function tr(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!e||E("proxy.socksHost",e.socksHost,g.STRING,!0)&&E("proxy.socksPort",e.socksPort,g.NUMBER,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nr(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function or(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!e||E("proxy.socksHost",e.socksHost,g.STRING,!0)&&E("proxy.socksPort",e.socksPort,g.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Tn as BaseMessage,Un as CombineMessage,yn as CombineV2Message,bn as CommandMessage,Xo as ConnectType,Ue as Events,Mn as FileMessage,Pn as GIFMessage,Vn as GroupNotificationMessage,_n as HQVoiceMessage,Nn as ImageMessage,Gn as InformationNotificationMessage,wn as LocationMessage,$o as MessageType,Bn as ReferenceMessage,Dn as RichContentMessage,Cn as SightMessage,An as TextMessage,Ln as VoiceMessage,et as __addSDKVersion,qo as addConversationsToTag,Je as addEventListener,xo as addTag,Rn as addToBlacklist,hn as bindRTCRoomForChatroom,Tt as clearAllMessagesUnreadStatus,ze as clearEventListeners,No as clearHistoryMessages,bo as clearMessages,St as clearMessagesUnreadStatus,It as clearTextMessageDraft,Vo as clearUnreadCountByTimestamp,ct as connect,Do as deleteLocalMessagesByTimestamp,Oo as deleteMessages,We as destroy,ut as disconnect,er as electronExtension,fn as forceRemoveChatRoomEntry,un as forceSetChatRoomEntry,vn as getAllChatRoomEntries,Bt as getAllConversationState,Yt as getAllUltraGroupUnreadCount,zt as getAllUltraGroupUnreadMentionedCount,wt as getAllUnreadMentionedCount,En as getBlacklist,Sn as getBlacklistStatus,bt as getBlockUltraGroupList,Ut as getBlockedConversationList,gn as getChatRoomEntry,an as getChatRoomInfo,In as getChatroomHistoryMessages,Qe as getConnectionStatus,lt as getConversation,dt as getConversationList,Ct as getConversationNotificationLevel,At as getConversationNotificationStatus,jo as getConversationsFromTagByPage,$e as getCurrentUserId,nt as getDeviceId,ro as getDownloadAuth,oo as getFileToken,io as getFileUrl,Mo as getFirstUnreadMessage,Io as getHistoryMessages,Lo as getMessage,Uo as getMessageReader,nr as getProxy,ho as getRemoteHistoryMessages,Xe as getServerTime,Ho as getTags,Jo as getTagsFromConversation,gt as getTextMessageDraft,Mt as getTopConversationList,ht as getTotalUnreadCount,Rt as getTotalUnreadCountByLevels,mt as getTotalUnreadMentionedCountByLevels,Jt as getUltraGroupDefaultNotificationLevel,Wt as getUltraGroupFirstUnreadMessageTimestamp,Dt as getUltraGroupList,Vt as getUltraGroupMessageListByMessageUId,Kt as getUltraGroupUnreadCountByTargetId,Qt as getUltraGroupUnreadInfoList,Ht as getUltraGroupUnreadMentionedCountByTargetId,jt as getUltraGroupUnreadMentionedMessages,Pt as getUnreadConversationList,Et as getUnreadCount,Wo as getUnreadCountByTag,Lt as getUnreadMentionedCount,wo as getUnreadMentionedMessages,je as init,Po as insertMessage,ot as installPlugin,nn as joinChatRoom,on as joinExistChatRoom,Zt as modifyMessage,qe as onceEventListener,rn as quitChatRoom,po as recallMessage,yo as registerMessageType,Ft as removeAllExpansionForUltraGroupMessage,ln as removeChatRoomEntries,dn as removeChatRoomEntry,ft as removeConversation,Ko as removeConversationsFromTag,Ke as removeEventListener,Ye as removeEventListeners,xt as removeExpansionForUltraGroupMessage,mn as removeFromBlacklist,Co as removeMessageExpansionForKey,Fo as removeTag,zo as removeTagFromConversations,Yo as removeTagsFromConversation,vt as saveTextMessageDraft,Go as searchConversationByContent,Bo as searchMessages,uo as sendFileMessage,fo as sendGIFMessage,go as sendHQVoiceMessage,lo as sendImageMessage,ao as sendMessage,Ro as sendReadReceiptMessage,mo as sendReadReceiptRequest,Eo as sendReadReceiptResponse,So as sendReadReceiptResponseV2,vo as sendSightMessage,To as sendSyncReadStatusMessage,so as sendTextMessage,Ao as sendTypingStatusMessage,Gt as sendUltraGroupTypingStatus,cn as setChatRoomEntries,sn as setChatRoomEntry,Nt as setConversationNotificationLevel,_t as setConversationNotificationStatus,yt as setConversationToTop,Qo as setConversationToTopInTag,ko as setMessageReceivedStatus,tr as setProxy,qt as setUltraGroupDefaultNotificationLevel,or as testProxy,kt as updateExpansionForUltraGroupMessage,_o as updateMessageExpansion,Zo as updateTag,no as upload};