@rongcloud/imlib-next 5.46.0-enterprise-c-tmp-alpha.1 → 5.46.0-enterprise-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.cjs.js +1 -1
- package/index.esm.js +1 -1
- package/index.mjs +1 -1
- package/package.json +2 -2
package/index.cjs.js
CHANGED
|
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function n(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((o=o.apply(e,t||[])).next())}))}function o(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function r(e){const{conversationType:n,targetId:r,latestMessage:i,unreadMessageCount:s,hasMentioned:a,mentionedInfo:u,lastUnreadTime:d,notificationStatus:c,notificationLevel:l,isTop:p,channelId:f,unreadMentionedCount:g,matchCount:v,operationTime:m,draft:E,translateStrategy:h,editedMessageDraft:x,includeRobot:T,dataMgmtInfo:C}=e,S=i&&o(i);let M;M=a?{type:null==u?void 0:u.type,userIdList:null==u?void 0:u.userIdList}:void 0;const y={conversationType:n,targetId:r,latestMessage:S,unreadMessageCount:s,hasMentioned:a,mentionedInfo:M,lastUnreadTime:d,notificationStatus:c,notificationLevel:l,isTop:p,channelId:f,unreadMentionedCount:g,matchCount:v,operationTime:m,draft:E||"",translateStrategy:h,editedMessageDraft:x,includeRobot:T,dataMgmtInfo:C};return y.conversationType===t.ConversationType.ULTRA_GROUP&&(y.firstUnreadMessage=e.firstUnreadMessage,y.channelType=e.channelType,y.unreadMentionedMeCount=e.unreadMentionedMeCount),y}function i(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}exports.Events=void 0,(e=exports.Events||(exports.Events={})).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.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.USER_SETTINGS_SYNCED="USER_SETTINGS_SYNCED",e.USER_SETTINGS_CHANGED="USER_SETTINGS_CHANGED",e.CONVERSATIONS_SETTINGS_SYNCED="CONVERSATIONS_SETTINGS_SYNCED",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.CONVERSATIONS_SYNCED="CONVERSATIONS_SYNCED",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="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.USER_GROUP_STATUS="USER_GROUP_STATUS",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",e.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED",e.GROUP_OPERATION="GROUP_OPERATION",e.GROUP_INFO_CHANGED="GROUP_INFO_CHANGED",e.GROUP_MEMBER_INFO_CHANGED="GROUP_MEMBER_INFO_CHANGED",e.GROUP_APPLICATION_EVENT="GROUP_APPLICATION_EVENT",e.GROUP_REMARK_CHANGED_SYNC="GROUP_REMARK_CHANGED_SYNC",e.GROUP_FOLLOWS_CHANGED_SYNC="GROUP_FOLLOWS_CHANGED_SYNC",e.FRIEND_ADDED="FRIEND_ADDED",e.FRIEND_DELETE="FRIEND_DELETE",e.FRIEND_APPLICATION_STATUS_CHANGED="FRIEND_APPLICATION_STATUS_CHANGED",e.FRIEND_CLEARED="FRIEND_CLEARED",e.FRIEND_INFO_CHANGED_SYNC="FRIEND_INFO_CHANGED_SYNC",e.DATABASE_OPENED="DATABASE_OPENED",e.DATABASE_UPGRADE_WILL_START="DATABASE_UPGRADE_WILL_START",e.DATABASE_UPGRADING="DATABASE_UPGRADING",e.DATABASE_UPGRADE_DID_COMPLETE="DATABASE_UPGRADE_DID_COMPLETE",e.STREAM_MESSAGE_RESPONSE="STREAM_MESSAGE_RESPONSE",e.MESSAGE_RECEIPT_RESPONSE_V5="MESSAGE_RECEIPT_RESPONSE_V5",e.SPEECH_TO_TEXT_RESPONSE="SPEECH_TO_TEXT_RESPONSE",e.TRANSLATE_RESPONSE="TRANSLATE_RESPONSE",e.MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.MESSAGE_MODIFIED_SYNC_COMPLETED="MESSAGE_MODIFIED_SYNC_COMPLETED",e.ROBOTS_SYNCED="ROBOTS_SYNCED",e.SYNC_SERVER_SAVE_UNREAD_COMPLETED="SYNC_SERVER_SAVE_UNREAD_COMPLETED",e.MESSAGE_REACTION_CHANGED="MESSAGE_REACTION_CHANGED";const s=new t.EventEmitter,a={connection(e,n){switch(e){case t.RCConnectionStatus.CONNECTED:s.emit(exports.Events.CONNECTED);break;case t.RCConnectionStatus.CONNECTING:s.emit(exports.Events.CONNECTING);break;case t.RCConnectionStatus.SUSPENDED:s.emit(exports.Events.SUSPEND,n);break;case t.RCConnectionStatus.DISCONNECTED:s.emit(exports.Events.DISCONNECT,n)}},batchMessage:e=>{s.emit(exports.Events.MESSAGES,{messages:e.map((e=>o(e)))})},typingState:e=>{s.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,o)=>{s.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:o})},messageReceiptRequest:(e,t,n)=>{s.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{s.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:e=>{const n=e.map((({conversation:e,updatedItems:n})=>{const{conversationType:o}=e,i=r(e);return o===t.ConversationType.ULTRA_GROUP&&(i.versionTime=e.versionTime,i.unreadMessageCount=u(e.unreadMessageCount||0),i.unreadMentionedCount=u(e.unreadMentionedCount||0),i.unreadMentionedMeCount=u(e.unreadMentionedMeCount||0)),{conversation:i,updatedItems:n}}));s.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:e=>{s.emit(exports.Events.CHATROOM,e)},expansion:e=>{s.emit(exports.Events.EXPANSION,e)},pullFinished:()=>{s.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{s.emit(exports.Events.TAG)},userSettingsSynced:e=>{s.emit(exports.Events.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{s.emit(exports.Events.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{s.emit(exports.Events.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{s.emit(exports.Events.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{s.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:e=>{s.emit(exports.Events.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{s.emit(exports.Events.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{s.emit(exports.Events.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{s.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{s.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>o(e))))},ultraGroupMessageRecalled:e=>{s.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>o(e))))},ultraGroupChannelChangeType:e=>{s.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{s.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{s.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{s.emit(exports.Events.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{s.emit(exports.Events.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{s.emit(exports.Events.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{s.emit(exports.Events.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{s.emit(exports.Events.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{s.emit(exports.Events.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{s.emit(exports.Events.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{s.emit(exports.Events.GROUP_OPERATION,e)},groupInfoChanged:e=>{s.emit(exports.Events.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{s.emit(exports.Events.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{s.emit(exports.Events.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{s.emit(exports.Events.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{s.emit(exports.Events.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{s.emit(exports.Events.FRIEND_ADDED,e)},friendDelete:e=>{s.emit(exports.Events.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{s.emit(exports.Events.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{s.emit(exports.Events.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{s.emit(exports.Events.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{s.emit(exports.Events.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{s.emit(exports.Events.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{s.emit(exports.Events.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{s.emit(exports.Events.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{s.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{s.emit(exports.Events.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{s.emit(exports.Events.TRANSLATE_RESPONSE,e)},messagesModified:e=>{s.emit(exports.Events.MESSAGE_MODIFIED,e.map((e=>o(e))))},messageModifiedSyncCompleted:()=>{s.emit(exports.Events.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{s.emit(exports.Events.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){s.emit(exports.Events.MESSAGE_REACTION_CHANGED,e)}};function u(e){return e>999?999:e}t.VersionManage.add("imlib-next","5.46.0-enterprise-c-tmp-alpha.1");let d=null,c=null,l=null;function p(e){if(!d)throw new Error("Not initialized yet!");return e(d,l,c)}function f(){return d?t.ok(d):t.fail(t.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT)}let g=0;const v=new Map;function m(e,t){const n=(...e)=>{const o=[],r=[];[...v.values()].forEach((([e,t,i])=>{e===n&&(r.push(t),i&&o.push(i))})),o.forEach((t=>{e=t(e)}));const i=t(...e);return r.forEach((t=>{t(e,i)})),i};return Object.defineProperty(n,"original",{value:t,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"monitorable",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n}const E=m("disconnect",((e,t)=>p((n=>n.disconnect(e,t)))));function h(){s.clear()}class x{constructor(e,t,n=!0,o=!0){Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:o})}}class T extends x{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class C extends T{constructor(e){super(t.MessageType.COMBINE,t.getMessageTypeDescription(t.MessageType.COMBINE),e)}}class S extends T{constructor(e){super(t.MessageType.FILE,t.getMessageTypeDescription(t.MessageType.FILE),e)}}class M extends T{constructor(e){super(t.MessageType.GIF,t.getMessageTypeDescription(t.MessageType.GIF),e)}}const y=t.MessageType.GROUP_NOTIFICATION;class _ extends T{constructor(e){super(t.MessageType.IMAGE,t.getMessageTypeDescription(t.MessageType.IMAGE),e)}}const R=t.MessageType.INFORMATION_NOTIFICATION;class I extends T{constructor(e){super(t.MessageType.SIGHT,t.getMessageTypeDescription(t.MessageType.SIGHT),e)}}class U extends T{constructor(e){super(t.MessageType.TEXT,t.getMessageTypeDescription(t.MessageType.TEXT),e)}}class A extends T{constructor(e){super(t.MessageType.HQ_VOICE,t.getMessageTypeDescription(t.MessageType.HQ_VOICE),e)}}var b;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(b||(b={}));class O{constructor(e,t,n){Object.defineProperty(this,"_url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_authInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_getFileToken",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isAbort",{enumerable:!0,configurable:!0,writable:!0,value:!1})}isAbort(){return this._isAbort}abort(){this._isAbort=!0,this._abortHandler()}upload(e){return e.file.size>t.MAX_UPLOAD_FILE_SIZE?Promise.resolve(t.fail(t.ErrorCode.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>t.UPLOAD_FILE_CHUNK_SIZE&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function P(e){return Math.ceil(e/1024)||0}const N={[b.QINIU]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=new FormData;s.set("token",i.token),s.set("key",i.fileName),s.set("file",n),this._promise=t.httpRequest({url:t.fixUrlProtocol(this._url),headers:{},onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?t.ok({uniqueName:i.fileName,uploadMethod:t.UploadMethod.QINIU}):t.fail(t.ErrorCode.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.ALIYUN]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=t.fixUrlProtocol(`${i.ossBucketName}.${this._url}`),a=new FormData;a.set("token",i.token),a.set("OSSAccessKeyId",i.osskeyId),a.set("policy",i.ossPolicy),a.set("Signature",i.ossSign),a.set("success_action_status","200"),a.set("key",i.fileName),a.set("file",n),this._promise=t.httpRequest({url:s,onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u}=yield this._promise.result();return this._promise=null,200===u||204===u?t.ok({uniqueName:i.fileName,uploadMethod:t.UploadMethod.ALI}):t.fail(t.ErrorCode.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.S3]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r,contentDisposition:i}=e;let s=this._authInfo;const a=t.fixUrlProtocol(`${s.s3BucketName}.${this._url}`),u=new FormData;i?u.set("Content-Disposition",i):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",s.s3Credential),u.set("x-amz-algorithm",s.s3Algorithm),u.set("x-amz-date",s.s3Date),u.set("policy",s.s3Policy),u.set("x-amz-signature",s.s3Signature),u.set("key",s.fileName),u.set("file",n),this._promise=t.httpRequest({url:a,headers:{},onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:u,timeout:0});const{status:d,data:c}=yield this._promise.result();return this._promise=null,200===d||204===d?t.ok({uniqueName:s.fileName,uploadMethod:t.UploadMethod.AWS}):t.fail(t.ErrorCode.UPLOAD_FAIL,d.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.MINIO]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>n(this,void 0,void 0,(function*(){var n;const{file:o,fileType:r}=e;let i=yield this._getFileToken(r,o.name,"POST","uploads",void 0,P(o.size));if(!i.isOk)return i.wipe();let s=i.data;const a=t.fixUrlProtocol(`${this._url}/${s.minioBucketName}/${s.fileName}`),u=this.getBaseHeaders(o,s,e);this._promise=t.httpRequest({url:`${a}?uploads`,headers:u,method:"POST"});const{status:d,data:c}=yield this._promise.result();this._promise=null;const l=null===(n=null==c?void 0:c.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1];if(200!==d&&204!==d||!l)return t.fail(t.ErrorCode.UPLOAD_FAIL,"start upload fail");const p=[],f=yield this.requestUploadPart(a,o,l,s.fileName,e,p);if(!f.isOk)return f.wipe();if(i=yield this._getFileToken(r,s.fileName,"POST",`uploadId=${l}`,void 0,P(o.size)),!i.isOk)return i.wipe();s=i.data;let g=p.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");g=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${g}</CompleteMultipartUpload>`;const v=this.getBaseHeaders(o,s,e);this._promise=t.httpRequest({url:`${a}?uploadId=${l}`,headers:v,method:"POST",body:g,timeout:0});const{status:m}=yield this._promise.result();return this._promise=null,200===m||204===m?t.ok({uniqueName:s.fileName,uploadMethod:t.UploadMethod.MINIO}):t.fail(t.ErrorCode.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=t.fixUrlProtocol(`${this._url}/${i.minioBucketName}/${i.fileName}`),a=this.getBaseHeaders(n,i,e);this._promise=t.httpRequest({url:s,headers:a,onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"PUT",body:n,timeout:0});const{status:u}=yield this._promise.result();return this._promise=null,200===u||204===u?t.ok({uniqueName:i.fileName,uploadMethod:t.UploadMethod.MINIO}):t.fail(t.ErrorCode.UPLOAD_FAIL,u.toString())}))}requestUploadPart(e,o,r,i,s,a,u=1,d=0){return n(this,void 0,void 0,(function*(){if(d>=5)return t.fail(t.ErrorCode.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const n=(u-1)*t.UPLOAD_FILE_CHUNK_SIZE,c=Math.min(t.UPLOAD_FILE_CHUNK_SIZE,o.size-n),l=`partNumber=${u}&uploadId=${r}`,p=yield this._getFileToken(s.fileType,i,"PUT",l,void 0,P(o.size));if(!p.isOk)return p.wipe();const f=p.data,g=o.slice(n,u*t.UPLOAD_FILE_CHUNK_SIZE),v=this.getBaseHeaders(o,f,s);this._promise=t.httpRequest({url:`${e}?${l}`,headers:v,method:"PUT",body:g,timeout:0,onProgress:e=>{var t;return null===(t=null==s?void 0:s.onProgress)||void 0===t?void 0:t.call(s,n+e.loaded,o.size)}});const{status:m,xhr:E}=yield this._promise.result();return this._promise=null,200===m||204===m?(a.push((null==E?void 0:E.getResponseHeader("ETag"))||""),n+c<o.size?this.requestUploadPart(e,o,r,i,s,a,u+1,0):t.ok()):this.requestUploadPart(e,o,r,i,s,a,u,d+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:o}=n;return{"Content-Disposition":`${o||("text/html"===e.type?"inline":"attachment")}; filename=${encodeURIComponent(e.name)};`,Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.RCX]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e,i=t.UUId.gen();let s=this._authInfo;return this._requestUploadPart(i,n,s.token,o)}))})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=new FormData;s.set("token",i.token),s.set("key",i.fileName),s.set("file",n);const a=t.fixUrlProtocol(this._url);this._promise=t.httpRequest({url:a,headers:{},onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:u,data:d}=yield this._promise.result();if(this._promise=null,(200===u||204===u)&&d){const e=JSON.parse(d);return t.ok({uniqueName:e.rc_url.file_name,downloadUrl:`${a}/${e.rc_url.path}`,uploadMethod:t.UploadMethod.QINIU})}return t.fail(t.ErrorCode.UPLOAD_FAIL,u.toString())}))}_requestUploadPart(e,o,r,i,s=0){return n(this,void 0,void 0,(function*(){const n=Math.min(t.UPLOAD_FILE_CHUNK_SIZE,o.size-s),a=e+o.name.substring(o.name.lastIndexOf(".")),u={Range:`bytes=${s}-${s+n}`,"X-File-TransactionId":a,"X-File-Total-Size":o.size.toString()},d=o.slice(s,s+n),c=new FormData;c.set("file",d,o.name),c.set("key",a),c.set("name",a),c.set("token",r);const l=t.fixUrlProtocol(this._url);this._promise=t.httpRequest({url:l,headers:u,onProgress:e=>null==i?void 0:i(s+e.loaded,o.size),method:"POST",body:c,timeout:0});const{status:p,data:f}=yield this._promise.result();if(this._promise=null,200===p||204===p){if(s+n<o.size)return this._requestUploadPart(e,o,r,i,s+n);const a=JSON.parse(f);return t.ok({uniqueName:a.rc_url.file_name,downloadUrl:`${l}/${a.rc_url.path}`,uploadMethod:t.UploadMethod.QINIU})}return t.fail(t.ErrorCode.UPLOAD_FAIL,p.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function D(e,n,o){const{promise:r,resolve:i}=t.promiseWithResolvers(),s=document.createElement("canvas"),a=s.getContext("2d"),u=new Image;return u.onload=e=>{const{maxHeight:r=160,maxWidth:d=160,quality:c=1,scale:l=1}=o||{},p=G(u.width,u.height,{maxHeight:r,maxWidth:d,scale:l});s.width=Math.min(p.w,d),s.height=Math.min(p.h,r),a.drawImage(u,p.x,p.y,p.w,p.h);let f=L(s,c);f=f.replace(/data:image\/[^;]+;base64,/,""),i(t.ok(Object.assign(Object.assign({},n),{thumbnail:f,width:Math.ceil(p.w),height:Math.ceil(p.h)})))},u.onerror=e=>{i(t.fail(t.ErrorCode.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},u.src=(window.URL||window.webkitURL).createObjectURL(e),r}function L(e,n){let o=e.toDataURL("image/jpeg",n);return o.length>t.MAX_MESSAGE_CONTENT_BYTES-10240?L(e,n-.1):o}const G=(e,t,n)=>{const{maxHeight:o=160,maxWidth:r=160,scale:i=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>i?(s?(a=e/160,u=160,d=t/a,d>o&&(l=(d-o)/2)):(a=t/160,d=160,u=e/a,u>r&&(c=(u-r)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/o,d=o,u=e/a):(a=e/r,u=r,d=t/a),{w:u,h:d,x:-c,y:-l})};let F=0;class B{constructor(e,t){Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:++F}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,o,r,i,s=[]){return n(this,void 0,void 0,(function*(){for(let n=0;n<e.length;n++){const a=e[n],u=N[a.type];if(!u){s.push({type:a.type,url:a.url,code:t.ErrorCode.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new u(a.url,r,i);const d=yield this._client.upload(o);if(d.isOk)return d;const{code:c}=d;if([t.ErrorCode.RC_FILE_SIZE_EXCEED_LIMIT,t.ErrorCode.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(d.code))return d;if(this._client.isAbort())return this._client=null,d;this._client=null,s.push({type:a.type,url:a.url,code:c,msg:d.msg})}return t.fail(t.ErrorCode.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(s)}`)}))}_handleUpload(e,o){return n(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:r,uploadServer:i,ossConfig:s}=o,{file:a,fileType:u,thumbnailConfig:d}=e,c=yield n(u,a.name,void 0,void 0,void 0,P(a.size));if(!c.isOk)return c.wipe();const l=c.data,p=function(e,t,n){if(t)return[{type:b.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:b.QINIU,url:"",p:""};return Object.keys(e).forEach((n=>{"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort(((e,t)=>e.p-t.p));const o=[];return n&&o.push({type:b.QINIU,url:n,p:"1"}),o}(l.ossConfig||s,r,i);if(0===p.length)return t.fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:f,data:g,msg:v,isOk:m}=yield this._uploadInLoop(p,e,l,n);if(!m)return t.fail(f,v);let{downloadUrl:E,uploadMethod:h}=g;if(!E){const e=yield o.getFileUrl(u,g.uniqueName,h,a.name);if(!e.isOk)return t.fail(e.code,"Get download url fail");E=e.data.downloadUrl}if(!E)return t.fail(t.ErrorCode.UPLOAD_FAIL,"Get download url fail");const x={downloadUrl:E,uniqueName:(null==g?void 0:g.uniqueName)||"",name:a.name,size:a.size,type:a.type};if(u===t.FileType.AUDIO){return function(e,n){const o=new AudioContext({sampleRate:16e3}),{promise:r,resolve:i}=t.promiseWithResolvers();return o.decodeAudioData(e,(e=>{var o,r;i(t.ok(Object.assign(Object.assign({},n),{duration:e.duration,length:e.length,sampleRate:null!==(o=e.sampleRate)&&void 0!==o?o:void 0,numberOfChannels:null!==(r=e.numberOfChannels)&&void 0!==r?r:void 0})))}),(e=>{i(t.fail(t.ErrorCode.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),r}(yield a.arrayBuffer(),x)}return u===t.FileType.IMAGE?D(a,x,d):t.ok(x)}))}awaitResult(){return n(this,void 0,void 0,(function*(){return this._promise}))}}const H={};function j(e,t){const o=new B(e,t);return function(e){n(this,void 0,void 0,(function*(){H[e.id]=e,yield e.awaitResult(),delete H[e.id]}))}(o),o}const w=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function k(e){return n(this,void 0,void 0,(function*(){const{contentDisposition:o,fileType:r,file:i}=e;return f().next((s=>n(this,void 0,void 0,(function*(){const a=yield t.Validator.create("upload").validate("contentDisposition",o,(e=>"inline"===e||"attachment"===e),!1).fail(t.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",r,t.FileType,!0).fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(r===t.FileType.IMAGE&&!e.type.match(/^image\//))&&!(r===t.FileType.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(t.ErrorCode.MEDIA_EXCEPTION).result().next((()=>function(e,t){return n(this,void 0,void 0,(function*(){return new B(e,t).awaitResult()}))}(e,w(s,s.getOptions().uploadDomain))));return a}))))}))}const V=Ee,q=m("sendMessage",((e,r,i)=>n(void 0,void 0,void 0,(function*(){const{disableNotification:n,isMentioned:s,directionalUserIdList:a,canIncludeExpansion:u,onSendBefore:d,expansion:c,pushConfig:l,isStatusMessage:p,disableUpdateLastMessage:g}=i||{},v=function(e,t){const{disableNotification:n,pushContent:o,pushData:r,isMentioned:i,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:p,pushConfig:f,messageId:g,disableUpdateLastMessage:v,needReceipt:m,quoteInfo:E}=e;return Object.assign({disableNotification:n,pushContent:o,pushData:r,isMentioned:i,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:p,pushConfig:f,messageId:g,disableUpdateLastMessage:v,needReceipt:m,quoteInfo:E},t)}(i||{},r),m=Object.assign(Object.assign({},e),{isMentioned:!!s,content:r.content,messageType:r.messageType,isPersited:!!r.isPersited,isCounted:!!r.isCounted,disableNotification:!!n,canIncludeExpansion:!!u,expansion:c||null,senderUserId:"",messageUId:"",messageDirection:t.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!p,receivedStatus:t.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:l,sentStatus:t.SentStatus.SENDING,sentTime:0,directedUserIds:a||[],disableUpdateLastMessage:g,quoteInfo:v.quoteInfo}),E=yield f().next((n=>{m.senderUserId=n.getCurrentUserId();return n.sendMessage(e,v,(e=>{m.messageId=e;try{d&&d(o(m))}catch(e){n.logger.error(t.LogTagId.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return E.isOk?E.trans((e=>o(e))):(m.sentStatus=t.SentStatus.FAILED,t.fail(E.code,E.msg,o(m)))}))));function Y(e,o){return(r,i,s,a)=>n(this,void 0,void 0,(function*(){var n,u;const d=f();if(!d.isOk)return d.wipe();const c=d.data;if(!t.validate("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(e=>["inline","attachment"].includes(e))))return t.fail(t.ErrorCode.INVALID_PARAMETER_SENDOPTIONS);const l={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){const e=null===(n=a)||void 0===n?void 0:n.thumbnailConfig;if(!(t.validate("sendOptions.maxHeight",null==e?void 0:e.maxHeight,t.AssertRules.NUMBER)&&t.validate("sendOptions.maxWidth",null==e?void 0:e.maxWidth,t.AssertRules.NUMBER)&&t.validate("sendOptions.quality",null==e?void 0:e.quality,t.AssertRules.NUMBER)&&t.validate("sendOptions.scale",null==e?void 0:e.scale,t.AssertRules.NUMBER)))return t.fail(t.ErrorCode.INVALID_PARAMETER_SENDOPTIONS);l.thumbnailConfig=e}const{logger:p}=c,g=p.createTraceId();p.info(t.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),g);const v=yield k({file:i.file,fileType:e,onProgress:(e,t)=>{var n;null===(n=null==s?void 0:s.onProgress)||void 0===n||n.call(s,Math.floor(e/t*100))},contentDisposition:l.contentDisposition,thumbnailConfig:l.thumbnailConfig}),{code:m,data:E,msg:h}=v;if(m===t.ErrorCode.SUCCESS&&E){const e=(null===(u=null==s?void 0:s.onComplete)||void 0===u?void 0:u.call(s,Object.assign({url:E.downloadUrl},E)))||o(E,i);return p.info(t.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:E.downloadUrl,code:t.ErrorCode.SUCCESS}),g),q(r,e,a)}return t.fail(m,h)}))}const W=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},z=Y(t.FileType.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:W(e.name),fileUrl:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new S(n)})),$=Y(t.FileType.IMAGE,((e,t)=>{const n={content:e.thumbnail,imageUri:e.downloadUrl,thumWidth:e.width,thumHeight:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new _(n)})),Q=Y(t.FileType.IMAGE,((e,t)=>{const 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),t.audit&&(n.audit=t.audit),new M(n)})),K=Y(t.FileType.AUDIO,((e,t)=>{var n;const o={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),t.audit&&(o.audit=t.audit),new A(o)})),X=Y(t.FileType.SIGHT,((e,t)=>{const 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),t.audit&&(n.audit=t.audit),new I(n)}));Y(t.FileType.COMBINE_HTML,((e,t)=>{const 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 C(n)}));const J=m("recallMessage",((e,t)=>n(void 0,void 0,void 0,(function*(){return f().next((r=>n(void 0,void 0,void 0,(function*(){return(yield r.recallMessage(e,t)).trans((e=>o(e)))}))))}))));function Z(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.updateMessageExpansion(e,t)))}))}function ee(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeMessageExpansion(e,t)))}))}function te(e){return f().next((t=>t.modifyMessageWithParams(e)))}function ne(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>n(this,void 0,void 0,(function*(){return t.getAllConversationList(e)}))))).trans((e=>e.map(r)))}))}const oe=m("removeConversation",((e,t)=>n(void 0,void 0,void 0,(function*(){return f().next((n=>n.removeConversation(e,t)))}))));function re(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.batchDeleteConversations(e)))}))}function ie(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getTotalUnreadCountByLevels(e,t)))}))}function se(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getTotalUnreadCountByLevels(e,t,!0)))}))}const ae=m("clearMessagesUnreadStatus",(e=>n(void 0,void 0,void 0,(function*(){return f().next((t=>t.chat.clearUnreadCount(e)))}))));const ue=m("setConversationNotificationLevel",((e,t)=>n(void 0,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationNotificationLevel([e],t)))}))));const de=m("setConversationToTop",((e,t=!0,o=!0,r=!1)=>n(void 0,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationToTop([e],!!t,o,r)))}))));function ce(e,t,o,i){return n(this,void 0,void 0,(function*(){return f().next((s=>n(this,void 0,void 0,(function*(){return(yield s.searchConversationByContent(e,t,o,i)).trans((e=>e.map((e=>r(e)))))}))))}))}function le(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.searchMessages(e,t)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>o(e)))})))}))}function pe(e,o,r,s,a){return n(this,void 0,void 0,(function*(){return i("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),le(e,{keyword:o,limit:s||t.MAX_U32_INTEGER,order:0,timeRange:{endTime:r?r-1:r||0},messageFilter:{objectNames:a}})}))}function fe(e,t){return n(this,void 0,void 0,(function*(){return i("setMessageReceivedStatus","setMessageReceivedStatusInfo"),f().next((n=>n.setMessageReceivedStatus(e,t)))}))}function ge(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.clearLocalMessages(e)))}))}function ve(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.deleteLocalMessagesByTimestamp(e,t,o)))}))}function me(e,r,i={}){return n(this,void 0,void 0,(function*(){return r instanceof x?function(e,r,i={}){return n(this,void 0,void 0,(function*(){const n=!!(null==i?void 0:i.isUnread),s=null==i?void 0:i.searchContent,a=null==i?void 0:i.disableUpdateLastMessage,u={senderUserId:"",messageType:null==r?void 0:r.messageType,content:null==r?void 0:r.content,searchContent:s,messageDirection:t.MessageDirection.SEND,isUnread:n,messageUId:"",disableUpdateLastMessage:a,quoteInfo:i.quoteInfo};return(yield f().next((t=>t.insertMessage(e,u)))).trans(o)}))}(e,r,i):function(e,r,i={}){return n(this,void 0,void 0,(function*(){const n=!!(null==i?void 0:i.isUnread),s=null==i?void 0:i.searchContent,a=null==i?void 0:i.disableUpdateLastMessage,u={senderUserId:null==r?void 0:r.senderUserId,messageType:null==r?void 0:r.messageType,content:null==r?void 0:r.content,messageDirection:null==r?void 0:r.messageDirection,readStatus:"object"==typeof(null==r?void 0:r.receivedStatusInfo)?t.transformReceivedStatusFlag(r.receivedStatusInfo):null==r?void 0:r.receivedStatus,sentTime:null==r?void 0:r.sentTime,sentStatus:null==r?void 0:r.sentStatus,searchContent:s,messageUId:"",isUnread:n,disableNotification:null==r?void 0:r.disableNotification,canIncludeExpansion:null==r?void 0:r.canIncludeExpansion,expansion:(null==r?void 0:r.expansion)||void 0,directedUserIds:null==r?void 0:r.directedUserIds,disableUpdateLastMessage:(null==r?void 0:r.disableUpdateLastMessage)||a,quoteInfo:null==r?void 0:r.quoteInfo};return(yield f().next((t=>t.insertMessage(e,u)))).trans(o)}))}(e,r,i)}))}function Ee(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getLocalMessage(e)))).trans((e=>o(e)))}))}var he=Object.freeze({__proto__:null,getAllConversationList:function(e){return n(this,void 0,void 0,(function*(){return i("electronExtension.getAllConversationList","getAllConversationList"),ne(e)}))},getConversationList:function(e,t,o,s){return n(this,void 0,void 0,(function*(){i("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield f().next((r=>n(this,void 0,void 0,(function*(){return r.getConversationList({startTime:e,count:t,channelId:o,topPriority:s})}))))).trans((e=>e.map((e=>r(e)))))}))},searchConversationByContent:ce,getConversations:function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getConversations(e)))).trans((e=>e.map(r)))}))},getUntaggedConversationListByPage:function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((i=>n(this,void 0,void 0,(function*(){return(yield i.getUntaggedConversationListByPage(e,t,o)).trans((e=>e.map((e=>r(e)))))}))))}))},getRemoteConversations:function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.syncRemoteConversations()))}))},saveEditedMessageDraft:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.saveEditedMessageDraft(e,t)))}))},getEditedMessageDraft:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.getEditedMessageDraft(e)))}))},clearEditedMessageDraft:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.clearEditedMessageDraft(e)))}))},searchMessages:pe,searchMessageInTimeRange:function(e,t){return n(this,void 0,void 0,(function*(){return i("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),le(e,{keyword:null==t?void 0:t.keyword,limit:(null==t?void 0:t.limit)||5,offset:null==t?void 0:t.offset,order:0,timeRange:{startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}})}))},searchMessagesByUser:function(e,t,o,r){return n(this,void 0,void 0,(function*(){i("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield le(e,{limit:r,keyword:"",order:0,timeRange:{endTime:o?o-1:o||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},getHistoryMessagesByMessageTypes:function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getHistoryMessagesByObjectNames(e,t)))).trans((({list:e,hasMore:t})=>{const n=e.map(o);return{messages:n,hasMore:t,list:n}}))}))},getContinuousMessages:function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getContinuousMessages(e,t)))).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(o),timestamp:n})))}))},setMessageStatusToRead:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setMessageStatusToRead(e,t)))}))},setMessageReceivedStatus:fe,setMessageReceivedStatusInfo:function(e,o){return n(this,void 0,void 0,(function*(){const n=t.transformReceivedStatusFlag(o||{});return f().next((t=>t.setMessageReceivedStatus(e,n)))}))},setMessageSentStatus:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setMessageSentStatus(e,t)))}))},setMessageContent:function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setMessageContent(e,t,o)))}))},deleteMessages:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.deleteLocalMessages(e)))}))},clearMessages:ge,deleteMessagesByTimestamp:ve,batchClearMessagesByTimestamp:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.batchClearLocalMessagesByTimestamp(e)))}))},insertMessage:me,batchInsertMessage:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchInsertMessage(e,t)))}))},getMessageCount:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getLocalMessageCount(e)))}))},setCheckDuplicateMessage:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setCheckDuplicateMessage(e)))}))},setCheckChatRoomDuplicateMessage:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chatroom.setCheckChatRoomDuplicateMessage(!!e)))}))},getMessagesAroundTimestamp:function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>{const o=null==t?void 0:t.timestamp,r=null==t?void 0:t.beforeCount,i=null==t?void 0:t.afterCount;return n.getMessagesAroundTimestamp(e,o,r,i)}))).trans((e=>e.map(o)))}))},getLocalMessage:Ee,searchMessagesWithParams:function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.searchMessagesWithParams(e)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>o(e)))})))}))},setMessageSpeechToTextVisible:function(e,t){return f().next((n=>n.setMessageSpeechToTextVisible(e,t)))},deleteUltraGroupMessagesForAllChannel:function(e,t){return f().next((n=>n.deleteLocalUGMessagesForAllChannel(e,t)))},getUnreadMentionedMessages:function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getUnreadMentionedMessages(e)))).trans((e=>e.map(o)))}))},clearLocalData:function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.clearLocalData()))}))},enable:function(){return t.usingCppEngine()}});Object.defineProperty(exports,"AreaCode",{enumerable:!0,get:function(){return t.AreaCode}}),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return t.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomSyncStatusReason",{enumerable:!0,get:function(){return t.ChatroomSyncStatusReason}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return t.ChatroomUserChangeType}}),Object.defineProperty(exports,"ChrmMemBanType",{enumerable:!0,get:function(){return t.ChrmMemBanType}}),Object.defineProperty(exports,"ChrmMemOperateType",{enumerable:!0,get:function(){return t.ChrmMemOperateType}}),Object.defineProperty(exports,"ChrmSyncStatus",{enumerable:!0,get:function(){return t.ChrmSyncStatus}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return t.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return t.ConversationType}}),Object.defineProperty(exports,"ConversationUnreadCountFilter",{enumerable:!0,get:function(){return t.ConversationUnreadCountFilter}}),Object.defineProperty(exports,"DirectionType",{enumerable:!0,get:function(){return t.DirectionType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return t.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return t.FileType}}),Object.defineProperty(exports,"FilterRobotType",{enumerable:!0,get:function(){return t.FilterRobotType}}),Object.defineProperty(exports,"FriendAddPermission",{enumerable:!0,get:function(){return t.FriendAddPermission}}),Object.defineProperty(exports,"FriendApplicationStatus",{enumerable:!0,get:function(){return t.FriendApplicationStatus}}),Object.defineProperty(exports,"FriendApplicationType",{enumerable:!0,get:function(){return t.FriendApplicationType}}),Object.defineProperty(exports,"FriendRelationType",{enumerable:!0,get:function(){return t.FriendRelationType}}),Object.defineProperty(exports,"GroupApplicationDirection",{enumerable:!0,get:function(){return t.GroupApplicationDirection}}),Object.defineProperty(exports,"GroupApplicationStatus",{enumerable:!0,get:function(){return t.GroupApplicationStatus}}),Object.defineProperty(exports,"GroupApplicationType",{enumerable:!0,get:function(){return t.GroupApplicationType}}),Object.defineProperty(exports,"GroupInviteHandlePermission",{enumerable:!0,get:function(){return t.GroupInviteHandlePermission}}),Object.defineProperty(exports,"GroupJoinPermission",{enumerable:!0,get:function(){return t.GroupJoinPermission}}),Object.defineProperty(exports,"GroupMemberInfoEditPermission",{enumerable:!0,get:function(){return t.GroupMemberInfoEditPermission}}),Object.defineProperty(exports,"GroupMemberRole",{enumerable:!0,get:function(){return t.GroupMemberRole}}),Object.defineProperty(exports,"GroupOperation",{enumerable:!0,get:function(){return t.GroupOperation}}),Object.defineProperty(exports,"GroupOperationPermission",{enumerable:!0,get:function(){return t.GroupOperationPermission}}),Object.defineProperty(exports,"GroupReadReceiptVersion",{enumerable:!0,get:function(){return t.GroupReadReceiptVersion}}),Object.defineProperty(exports,"InterruptionLevel",{enumerable:!0,get:function(){return t.InterruptionLevel}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return t.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return t.MentionedType}}),Object.defineProperty(exports,"MessageAuditType",{enumerable:!0,get:function(){return t.MessageAuditType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return t.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return t.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return t.MessageDirection}}),Object.defineProperty(exports,"MessageReactionOperationType",{enumerable:!0,get:function(){return t.MessageReactionOperationType}}),Object.defineProperty(exports,"MessageType",{enumerable:!0,get:function(){return t.MessageType}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return t.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return t.NotificationStatus}}),Object.defineProperty(exports,"OnlineStatus",{enumerable:!0,get:function(){return t.OnlineStatus}}),Object.defineProperty(exports,"OperateStatus",{enumerable:!0,get:function(){return t.OperateStatus}}),Object.defineProperty(exports,"Platform",{enumerable:!0,get:function(){return t.Platform}}),Object.defineProperty(exports,"PlatformInfo",{enumerable:!0,get:function(){return t.Platform}}),Object.defineProperty(exports,"PushImportanceHonor",{enumerable:!0,get:function(){return t.PushImportanceHonor}}),Object.defineProperty(exports,"PushNotificationQuietHoursLevel",{enumerable:!0,get:function(){return t.PushNotificationQuietHoursLevel}}),Object.defineProperty(exports,"QueryFriendsDirectionType",{enumerable:!0,get:function(){return t.QueryFriendsDirectionType}}),Object.defineProperty(exports,"QuoteMessageStatus",{enumerable:!0,get:function(){return t.QuoteMessageStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return t.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return t.ReceivedStatus}}),Object.defineProperty(exports,"ReferenceMessageStatus",{enumerable:!0,get:function(){return t.ReferenceMessageStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return t.SentStatus}}),Object.defineProperty(exports,"SpeechToTextStatus",{enumerable:!0,get:function(){return t.SpeechToTextStatus}}),Object.defineProperty(exports,"StreamMessageResponseEventType",{enumerable:!0,get:function(){return t.StreamMessageResponseEventType}}),Object.defineProperty(exports,"SubscribeOperationType",{enumerable:!0,get:function(){return t.SubscribeOperationType}}),Object.defineProperty(exports,"SubscribeType",{enumerable:!0,get:function(){return t.SubscribeType}}),Object.defineProperty(exports,"TranslateMessageParam",{enumerable:!0,get:function(){return t.TranslateMessageParam}}),Object.defineProperty(exports,"TranslateMode",{enumerable:!0,get:function(){return t.TranslateMode}}),Object.defineProperty(exports,"TranslateStatus",{enumerable:!0,get:function(){return t.TranslateStatus}}),Object.defineProperty(exports,"TranslateStrategy",{enumerable:!0,get:function(){return t.TranslateStrategy}}),Object.defineProperty(exports,"TranslateTextParam",{enumerable:!0,get:function(){return t.TranslateTextParam}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return t.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return t.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return t.UploadMethod}}),Object.defineProperty(exports,"UserProfileVisibility",{enumerable:!0,get:function(){return t.UserProfileVisibility}}),Object.defineProperty(exports,"UserSettingsChangedKey",{enumerable:!0,get:function(){return t.UserSettingsChangedKey}}),Object.defineProperty(exports,"UserType",{enumerable:!0,get:function(){return t.UserType}}),Object.defineProperty(exports,"createLogDBProxy",{enumerable:!0,get:function(){return t.createLogDBProxy}}),Object.defineProperty(exports,"fail",{enumerable:!0,get:function(){return t.fail}}),Object.defineProperty(exports,"ok",{enumerable:!0,get:function(){return t.ok}}),exports.BaseMessage=x,exports.CombineMessage=C,exports.CombineV2Message=class extends T{constructor(e){super(t.MessageType.COMBINE_V2,t.getMessageTypeDescription(t.MessageType.COMBINE_V2),e)}},exports.CommandMessage=class extends T{constructor(e){super(t.MessageType.COMMAND,t.getMessageTypeDescription(t.MessageType.COMMAND),e)}},exports.ConnectType={COMET:"_",WEBSOCKET:"_"},exports.FileMessage=S,exports.GIFMessage=M,exports.GroupNotificationMessage=class extends T{constructor(e){super(y,t.getMessageTypeDescription(y),e)}},exports.HQVoiceMessage=A,exports.ImageMessage=_,exports.InformationNotificationMessage=class extends T{constructor(e){super(R,t.getMessageTypeDescription(R),e)}},exports.LocationMessage=class extends T{constructor(e){super(t.MessageType.LOCATION,t.getMessageTypeDescription(t.MessageType.LOCATION),e)}},exports.ReferenceMessage=class extends T{constructor(e){super(t.MessageType.REFERENCE,t.getMessageTypeDescription(t.MessageType.REFERENCE),e)}},exports.RichContentMessage=class extends T{constructor(e){super(t.MessageType.RICH_CONTENT,t.getMessageTypeDescription(t.MessageType.RICH_CONTENT),e)}},exports.SightMessage=I,exports.TextMessage=U,exports.UploadTask=B,exports.VoiceMessage=class extends T{constructor(e){super(t.MessageType.VOICE,t.getMessageTypeDescription(t.MessageType.VOICE),e)}},exports.__addSDKVersion=function(e,n){t.VersionManage.add(e,n)},exports.acceptFriendApplication=function(e){return f().next((t=>t.dataHosting.acceptFriendRequest(e)))},exports.acceptGroupApplication=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.acceptGroupApplication(e,t,o)))}))},exports.acceptGroupInvite=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.acceptGroupInvite(e,t)))}))},exports.addConversationsToTag=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.addTagForConversations(e,t)))}))},exports.addEventListener=function(e,t,n){s.on(e,t,n)},exports.addFriend=function(e,t,n){return f().next((o=>o.dataHosting.addFriend(e,t,n)))},exports.addGroupFollows=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.addGroupFollows(e,t)))}))},exports.addGroupManagers=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.addGroupManagers(e,t)))}))},exports.addMessageReaction=function(e){return f().next((t=>t.chat.addMessageReaction(e)))},exports.addMonitor=function(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const o=++g;return v.set(o,[e,t,n]),o},exports.addTag=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.createTag(e)))}))},exports.addToBlacklist=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.addToBlacklist(e)))}))},exports.batchClearRemoteHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchClearRemoteHistoryMessages(e,t)))}))},exports.batchDeleteConversations=re,exports.batchGetMessageReactionSummaries=function(e){return f().next((t=>t.chat.batchGetMessageReactionSummaries(e)))},exports.batchGetMessageReadReceiptInfoV4=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.batchGetMessageReadReceiptInfoV4(e,t)))}))},exports.batchRemoveConversation=function(e){return n(this,void 0,void 0,(function*(){return i("batchRemoveConversation","batchDeleteConversations"),re({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))},exports.batchSetConversationNotificationLevel=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationNotificationLevel(e,t)))}))},exports.batchSetConversationToTop=function(e,t,o=!0,r=!0){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationToTop(e,!!t,r,o)))}))},exports.batchSetConversationTranslateStrategy=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationTranslateStrategy(e,t)))}))},exports.bindRTCRoomForChatroom=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chatroom.bindRTCRoomForChatroom(e)))}))},exports.checkFriends=function(e,t){return f().next((n=>n.dataHosting.checkFriends(e,t)))},exports.clearAllMessagesUnreadStatus=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.chat.clearAllUnreadCount()))}))},exports.clearEventListeners=h,exports.clearHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.deleteRemoteMessageByTimestamp(e,t)))}))},exports.clearMessages=function(e){return n(this,void 0,void 0,(function*(){return i("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),ge(e)}))},exports.clearMessagesUnreadStatus=ae,exports.clearRealtimeConUnreadCount=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.clearRealtimeConUnreadCount(e)))}))},exports.clearTextMessageDraft=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.clearTextMessageDraft(e)))}))},exports.clearUnreadCountByTimestamp=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return o.chat.clearUnreadCountByTimestamp(e,t)}))))}))},exports.connect=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))},exports.createConversationListLoader=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.createConversationListLoader(e)))}))},exports.createGroup=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.createGroup(e,t)))}))},exports.createUploadTask=function(e){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:r,file:i}=e;return t.Validator.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(t.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",r,t.FileType,!0).fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(r===t.FileType.IMAGE&&!e.type.match(/^image\//))&&!(r===t.FileType.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(t.ErrorCode.MEDIA_EXCEPTION).result().trans((()=>j(e,w(o,o.getOptions().uploadDomain))))}))))}))},exports.deleteFriends=function(e,t){return f().next((n=>n.dataHosting.deleteFriends(e,t)))},exports.deleteLocalMessagesByTimestamp=function(e,t,o){return n(this,void 0,void 0,(function*(){return i("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),ve(e,t,o)}))},exports.deleteMessages=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.deleteRemoteMessage(e,t)))}))},exports.destroy=function(){return n(this,void 0,void 0,(function*(){return h(),function(){return n(this,void 0,void 0,(function*(){d&&(yield t.APIContext.destroy(),c=null,d=null,l=null)}))}()}))},exports.disconnect=E,exports.dismissGroup=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.dismissGroup(e)))}))},exports.electronExtension=he,exports.forceRemoveChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.removeChatroomEntry(e,t,!0)))}))},exports.forceSetChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.setChatroomEntry(e,t,!0)))}))},exports.getAllChatRoomEntries=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chatroom.getAllChatroomEntries(e)))}))},exports.getAllConversationList=ne,exports.getAllRobots=function(){return f().next((e=>e.getAllRobots()))},exports.getAllUltraGroupUnreadCount=function(){return n(this,void 0,void 0,(function*(){return i("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),ie([t.ConversationType.ULTRA_GROUP],[])}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function*(){return i("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),se([t.ConversationType.ULTRA_GROUP],[])}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getAllUnreadMentionedCount()))}))},exports.getAppSettings=function(){const e=f().tryTrans((e=>e.getAppSettings()));return e.isOk?e.data:null},exports.getAutoTranslateEnabled=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getAutoTranslateEnabled()))}))},exports.getBlacklist=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getBlacklist()))}))},exports.getBlacklistStatus=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getBlacklistStatus(e)))).trans((e=>0===e))}))},exports.getBlockUltraGroupList=function(){return n(this,void 0,void 0,(function*(){return(yield f().next((e=>e.getBlockedUGList()))).trans((e=>e.map((e=>r(e)))))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function*(){return(yield f().next((e=>e.getBlockedConversationList()))).trans((e=>e.map(r)))}))},exports.getChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.getChatroomEntry(e,t)))}))},exports.getChatRoomInfo=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)))}))},exports.getChatroomHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chatroom.getChatroomHistoryMessages(e,null==t?void 0:t.count,null==t?void 0:t.order,null==t?void 0:t.timestamp)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>o(e)))})))}))},exports.getConnectionStatus=function(){return p((e=>e.getConnectionStatus()))},exports.getConversation=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>n(this,void 0,void 0,(function*(){return(yield t.getConversation(e)).trans((e=>r(e)))}))))}))},exports.getConversationList=function(e,t){return n(this,void 0,void 0,(function*(){i("getConversationList","getConversationListByTimestamp");return(yield f().next((o=>n(this,void 0,void 0,(function*(){return o.getConversationList({count:(null==e?void 0:e.count)||300,startTime:(null==e?void 0:e.startTime)||0,order:null==e?void 0:e.order,channelId:t})}))))).trans((e=>e.map(r)))}))},exports.getConversationListByTimestamp=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>n(this,void 0,void 0,(function*(){return t.getConversationListByTimestamp(e)}))))).trans((e=>e.map(r)))}))},exports.getConversationNotificationLevel=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getConversationNotificationLevel(e)))}))},exports.getConversationNotificationStatus=function(e){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return(yield o.getConversationNotificationLevel(e)).trans((e=>t.trans2NotificationStatus(e)))}))))}))},exports.getConversationTypeNotificationLevel=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getConversationTypeNotificationLevel(e)))}))},exports.getConversationsFromTagByPage=function(e,t,o){return n(this,void 0,void 0,(function*(){i("getConversationsFromTagByPage","createConversationListLoader");return(yield f().next((n=>n.getConversationListByTag(e,o,t)))).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},r(t)),{isTopInTag:t.isTopInTag});var t}))))}))},exports.getConversationsIncludingRobots=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.chat.getConversationsIncludingRobots(e)))).trans((e=>e.map(r)))}))},exports.getCurrentUserId=function(){return p((e=>e.getCurrentUserId()))},exports.getDeviceId=function(){return p((e=>e.getDeviceId()))},exports.getDownloadAuth=function(e){return f().next((o=>n(this,void 0,void 0,(function*(){return(yield t.Validator.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_URL).result().next((()=>o.getFileToken(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))},exports.getFileToken=function(e,t,n,o){return f().next((r=>r.getFileToken(e,t,n,o)))},exports.getFileUrl=function(e,o,r,i,s){return n(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?t.ok(i):f().next((n=>n.getFileUrl(e,o,s||t.UploadMethod.QINIU,r)))}))},exports.getFirstUnreadMessage=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getFirstUnreadMessage(e)))).trans((e=>e?o(e):null))}))},exports.getFirstUnreadMessageInfo=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getFirstUnreadMessageDigest(e)))}))},exports.getFriendAddPermission=function(){return f().next((e=>e.dataHosting.getFriendAddPermission()))},exports.getFriendApplications=function(e,t,n){return f().next((o=>o.dataHosting.getFriendApplications(e,t,n)))},exports.getFriends=function(e,t){return f().next((n=>n.dataHosting.getFriends(e,t)))},exports.getFriendsInfo=function(e){return f().next((t=>t.dataHosting.getFriendsInfo(e)))},exports.getGroupApplications=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getGroupApplications(e,t,o)))}))},exports.getGroupFollows=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.getGroupFollows(e)))}))},exports.getGroupMembers=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getGroupMembers(e,t)))}))},exports.getGroupMembersByRole=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getGroupMembersByRole(e,t,o)))}))},exports.getGroupsInfo=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.getGroupsInfo(e)))}))},exports.getHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getHistoryMessage(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>o(e)))})))}))},exports.getJoinedGroups=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.getJoinedGroups(e)))}))},exports.getJoinedGroupsByRole=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getJoinedGroupsByRole(t,e)))}))},exports.getMessage=V,exports.getMessageReactionUsers=function(e){return f().next((t=>t.chat.getMessageReactionUsers(e)))},exports.getMessageReactions=function(e){return f().next((t=>t.chat.getMessageReactions(e)))},exports.getMessageReadReceiptInfoV5=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return o.getMessageReadReceiptInfoV5(e,t)}))))}))},exports.getMessageReadReceiptInfoV5ByIdentifiers=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>n(this,void 0,void 0,(function*(){return t.getMessageReadReceiptInfoV5ByIdentifiers(e)}))))}))},exports.getMessageReadReceiptV4=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.getMessageReadReceiptV4(e,t)))}))},exports.getMessageReader=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){return r.chat.getMessageReader(e,t,o)}))))}))},exports.getMessagesByUIds=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getMessagesByUIds(e.conversationIdentifier,e.messageUIds)))).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?o(e.message):void 0,code:e.code})))))}))},exports.getMessagesReadReceiptByUsersV5=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){return r.getMessagesReadReceiptByUsersV5(e,t,o)}))))}))},exports.getMessagesReadReceiptUsersByPageV5=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){return r.getMessagesReadReceiptUsersByPageV5(e,t,o)}))))}))},exports.getMyUserProfile=function(){return f().next((e=>e.getMyUserProfile()))},exports.getMyUserProfileVisibility=function(){return f().next((e=>e.dataHosting.getMyUserProfileVisibility()))},exports.getNotificationQuietHoursSetting=function(){return f().next((e=>e.getNotificationQuietHoursSetting()))},exports.getProxy=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getProxy()))}))},exports.getRealtimeConTotalUnreadCount=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getRealtimeConTotalUnreadCount()))}))},exports.getRealtimeConUnreadCounts=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.batchGetRealtimeConUnreadCount(e)))}))},exports.getRealtimeConversations=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>{var n,o,r;return t.getRealtimeConversations(null!==(n=null==e?void 0:e.count)&&void 0!==n?n:30,null!==(o=null==e?void 0:e.startTime)&&void 0!==o?o:0,null!==(r=null==e?void 0:e.order)&&void 0!==r?r:0)}))).trans((e=>e.map(r)))}))},exports.getRemoteHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getRemoteHistoryMessages(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>o(e)))})))}))},exports.getRobotById=function(e){return f().next((t=>t.getRobotById(e)))},exports.getServerTime=function(){return p((e=>e.getServerTime()))},exports.getSubscribeUserList=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getSubscribeUserList(e,t,o)))}))},exports.getSubscribeUserStatus=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getSubscribeUserStatus(e,t)))}))},exports.getSubscribeUsersOnlineStatus=function(e){return f().next((t=>t.getSubscribeUsersOnlineStatus(e)))},exports.getTags=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getTagList()))}))},exports.getTagsFromConversation=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getTagsForConversation(e)))}))},exports.getTextMessageDraft=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getTextMessageDraft(e)))}))},exports.getTopConversationList=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getTopConversationList(e,t)))).trans((e=>e.map(r)))}))},exports.getTotalUnreadCount=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getTotalUnreadCount(t,e)))}))},exports.getTotalUnreadCountByLevels=ie,exports.getTotalUnreadMentionedCountByLevels=se,exports.getTranslationLanguage=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getTranslationLanguage()))}))},exports.getUltraGroupDefaultNotificationLevel=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,null==e?void 0:e.channelId)))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUGFirstUnreadMessageDigest(e)))}))},exports.getUltraGroupList=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUltraGroupList(e)))}))},exports.getUltraGroupMessageListByMessageUId=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((o=>n(this,void 0,void 0,(function*(){return o.getUltraGroupMessageListByMessageUId(e,t)}))))).trans((e=>{const t={};for(const n in e)t[n]=e[n]?o(e[n]):void 0;return t}))}))},exports.getUltraGroupUnreadCountByTargetId=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getUGUnreadCountForAllChannels(e,!1,t)))}))},exports.getUltraGroupUnreadInfoList=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUGUnreadInfoList(e)))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getUGUnreadCountForAllChannels(e,!0,t)))}))},exports.getUltraGroupUnreadMentionedMessages=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUGUnreadMentionedDigest(e)))}))},exports.getUnreadConversationList=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getUnreadConversationList(e)))).trans((e=>e.map(r)))}))},exports.getUnreadCount=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUnreadCount(e)))}))},exports.getUnreadCountByTag=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getUnreadCountByTag(e,t)))}))},exports.getUnreadMentionMeConversationList=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getUnreadMentionMeConversationList(e)))).trans((e=>e.map(r)))}))},exports.getUnreadMentionedCount=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUnreadMentionedCount(e)))}))},exports.getUnreadMentionedMessages=function(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")},exports.getUserProfiles=function(e){return f().next((t=>t.getUserProfiles(e)))},exports.init=function(e){!function(e){var n,r,i;d?l.warn(t.LogTagId.A_INIT_REPEAT_O):(t.assert("options.appkey",e.appkey,t.AssertRules.STRING,!0),t.assert("options.navigators",e.navigators,(e=>t.isArray(e)&&(0===e.length||e.every(t.isHttpUrl)))),t.assert("options.loggerProxy",e.loggerProxy,(e=>e instanceof t.LogDBProxy)),c=e,d=t.APIContext.init({appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(n=e.environment)&&void 0!==n?n:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null!==(r=e.enableReadReceiptStorage)&&void 0!==r&&r,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),l=d.logger,d.assignWatcher(a),d.sse.on("message",((e,t)=>{const n=Object.assign(Object.assign({},t),{message:t.message?o(t.message):void 0});s.emit(exports.Events.STREAM_MESSAGE_RESPONSE,n)})))}(e)},exports.insertMessage=function(e,t,o={}){return n(this,void 0,void 0,(function*(){return i("insertMessage","electronExtension.insertMessage"),me(e,t,o)}))},exports.installPlugin=function(e,t){return p((n=>n.install(e,t)))},exports.inviteUsersToGroup=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.inviteUsersToGroup(e,t)))}))},exports.joinChatRoom=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)))).wipe()}))},exports.joinExistChatRoom=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)))}))},exports.joinGroup=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.joinGroup(e)))}))},exports.kickGroupMembers=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.kickGroupMembers(e,t,o)))}))},exports.markRemoteConversationAsRead=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.markRemoteConversationAsRead(e)))}))},exports.modifyMessage=function(e,t){return n(this,void 0,void 0,(function*(){return i("modifyMessage","modifyMessageWithParams"),te({messageUId:null==t?void 0:t.messageUId,messageContent:e,conversation:{conversationType:null==t?void 0:t.conversationType,targetId:null==t?void 0:t.targetId,channelId:null==t?void 0:t.channelId}})}))},exports.modifyMessageWithParams=te,exports.onceEventListener=function(e,t,n){s.once(e,t,n)},exports.quitChatRoom=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.quitChatroom(e,t)))}))},exports.quitGroup=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.quitGroup(e,t)))}))},exports.recallMessage=J,exports.refreshReferenceMessageWithParams=function(e){return f().next((t=>{const n=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?o(e.message):void 0,code:e.code})));return t.refreshReferenceMessageWithParams(Object.assign(Object.assign({},e),{remoteMessageBlock:t=>{e.remoteMessageBlock&&e.remoteMessageBlock(n(t))},localMessageBlock:t=>{e.localMessageBlock&&e.localMessageBlock(n(t))}}))}))},exports.refuseFriendApplication=function(e){return f().next((t=>t.dataHosting.refuseFriendRequest(e)))},exports.refuseGroupApplication=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.refuseGroupApplication(e,t,o,r)))}))},exports.refuseGroupInvite=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.refuseGroupInvite(e,t,o)))}))},exports.registerMessageType=function(e,n,o,r,i){return p(((s,a)=>(t.assert("messageType",e,t.AssertRules.STRING,!0),t.assert("isPersited",n,t.AssertRules.BOOLEAN,!0),t.assert("isCounted",o,t.AssertRules.BOOLEAN,!0),t.assert("isStatusMessage",i,t.AssertRules.BOOLEAN),t.assert("searchProps",r,t.AssertRules.ARRAY),a.info(t.LogTagId.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:o,isStatusMessage:i,isPersited:n,searchProps:r})),s.registerMessageType(e,n,o,r,i),function(e,t=!0,n=!0){return function(o){return new x(e,o,t,n)}}(e,n,o))))},exports.removeAllExpansionForUltraGroupMessage=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeAllMessageExpansion(e)))}))},exports.removeChatRoomEntries=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.removeChatroomEntries(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})))}))},exports.removeChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.removeChatroomEntry(e,t,!1)))}))},exports.removeConversation=oe,exports.removeConversationsFromTag=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeTagForConversations(e,t)))}))},exports.removeEventListener=function(e,t,n){s.off(e,t,n)},exports.removeEventListeners=function(e){s.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(e,t){return n(this,void 0,void 0,(function*(){return i("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),ee(e,t)}))},exports.removeFromBlacklist=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeFromBlacklist(e)))}))},exports.removeGroupFollows=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.removeGroupFollows(e,t)))}))},exports.removeGroupManagers=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.removeGroupManagers(e,t)))}))},exports.removeMessageExpansionForKey=ee,exports.removeMessageReaction=function(e){return f().next((t=>t.chat.removeMessageReaction(e)))},exports.removeMonitor=function(e){v.delete(e)},exports.removeNotificationQuietHoursSetting=function(){return f().next((e=>e.removeNotificationQuietHoursSetting()))},exports.removeRealtimeConversations=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeRealtimeConversations(e)))}))},exports.removeTag=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeTag(e)))}))},exports.removeTagFromConversations=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeTagForConversations(e,t)))}))},exports.removeTagsFromConversation=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeTagsForConversation(e,t)))}))},exports.requestSpeechToTextForMessage=function(e,t){return f().next((n=>n.requestSpeechToTextForMessage(e,t)))},exports.requestStreamMessageContent=function(e){return f().next((t=>t.sse.requestStreamMessageContent(e)))},exports.saveTextMessageDraft=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.saveTextMessageDraft(e,t)))}))},exports.searchConversationByContent=function(e,o,r,s){return n(this,void 0,void 0,(function*(){return i("searchConversationByContent","electronExtension.searchConversationByContent"),ce(e,null!=r?r:[t.MessageType.TEXT,t.MessageType.FILE],s,o)}))},exports.searchFriendsInfo=function(e){return f().next((t=>t.dataHosting.searchFriendsInfo(e)))},exports.searchGroupMembers=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.searchGroupMembers(e,t,o)))}))},exports.searchJoinedGroups=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.searchJoinedGroups(e,t)))}))},exports.searchMessages=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return i("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),pe(e,t,o,r)}))},exports.searchUserProfileByUniqueId=function(e){return f().next((t=>t.dataHosting.searchUserProfileByUniqueId(e)))},exports.sendFileMessage=z,exports.sendGIFMessage=Q,exports.sendHQVoiceMessage=K,exports.sendImageMessage=$,exports.sendMessage=q,exports.sendReadReceiptMessage=function(e,o,r,i){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceiptMessage({targetId:e,conversationType:t.ConversationType.PRIVATE,channelId:i},o,r)))}))},exports.sendReadReceiptMessageV4=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceiptMessageV4(e,t,o)))}))},exports.sendReadReceiptRequest=function(e,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceiptRequest({targetId:e,conversationType:t.ConversationType.GROUP,channelId:r},o)))}))},exports.sendReadReceiptResponse=function(e,t,o){return n(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))},exports.sendReadReceiptResponseV2=function(e,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceipt({targetId:e,conversationType:t.ConversationType.GROUP,channelId:r},o)))}))},exports.sendReadReceiptResponseV5=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return o.sendReadReceiptResponseV5(e,t)}))))}))},exports.sendSightMessage=X,exports.sendSyncReadStatusMessage=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendSyncReadStatusMessage(e,t)))}))},exports.sendTextMessage=function(e,t,n){return q(e,new U(t),n)},exports.sendTypingStatusMessage=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chat.sendTypingStatus(e,t)))).trans(o)}))},exports.sendUltraGroupTypingStatus=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.sendUltraGroupTypingStatus(e)))}))},exports.setAutoTranslateEnabled=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setAutoTranslateEnabled(e)))}))},exports.setChatRoomEntries=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chatroom.setChatroomEntries(e,t)))).wipe()}))},exports.setChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.setChatroomEntry(e,t,!1)))}))},exports.setConversationNotificationLevel=ue,exports.setConversationNotificationStatus=function(e,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){if(o!==t.NotificationStatus.CLOSE&&o!==t.NotificationStatus.OPEN)return t.fail(t.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL);const n=t.trans2NotificationLevel(o);return r.batchSetConversationNotificationLevel([e],n)}))))}))},exports.setConversationToTop=de,exports.setConversationToTopInTag=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setConversationStatusInTag(e,t,{isTop:o})))}))},exports.setConversationTypeNotificationLevel=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setConversationTypeNotificationLevel(e,t)))}))},exports.setFriendAddPermission=function(e){return f().next((t=>t.dataHosting.setFriendAddPermission(e)))},exports.setFriendInfo=function(e,t,n){return f().next((o=>o.dataHosting.setFriendInfo(e,t||"",n)))},exports.setGroupMemberInfo=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.setGroupMemberInfo(e,t,o,r)))}))},exports.setGroupRemark=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.setGroupRemark(e,t)))}))},exports.setMessageReceivedStatus=function(e,t){return n(this,void 0,void 0,(function*(){return fe(e,t)}))},exports.setNotificationQuietHoursWithSetting=function(e){return f().next((t=>t.setNotificationQuietHoursWithSetting(e)))},exports.setProxy=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setProxy(e)))}))},exports.setTranslationLanguage=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setTranslationLanguage(e)))}))},exports.setUltraGroupDefaultNotificationLevel=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)))}))},exports.stopUploadTask=function(e){return n(this,void 0,void 0,(function*(){return t.ok(function(e){const t=H[e];return!!t&&(t.abort(),!0)}(e))}))},exports.subscribeUserStatus=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.subscribeUser(e,t,o)))}))},exports.testProxy=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.testProxy(e,t)))}))},exports.transferGroupOwner=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.transferGroupOwner(e,t,!!o,r)))}))},exports.translateMessagesWithParams=function(e){return f().next((t=>t.translateMessagesWithParams(e)))},exports.translateTextsWithParams=function(e){return f().next((t=>t.translateTextsWithParams(e)))},exports.unSubscribeUserStatus=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.unSubscribeUser(e,t)))).wipe()}))},exports.updateExpansionForUltraGroupMessage=function(e,t){return n(this,void 0,void 0,(function*(){return i("updateExpansionForUltraGroupMessage","updateMessageExpansion"),Z(e,t)}))},exports.updateGroupInfo=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.updateGroupInfo(e)))}))},exports.updateMessageExpansion=Z,exports.updateMyUserProfile=function(e){return f().next((t=>t.updateMyUserProfile(e)))},exports.updateMyUserProfileVisibility=function(e){return f().next((t=>t.dataHosting.updateMyUserProfileVisibility(e)))},exports.updateTag=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.updateTag(e)))}))},exports.upload=k;
|
|
15
|
+
***************************************************************************** */function n(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((o=o.apply(e,t||[])).next())}))}function o(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function r(e){const{conversationType:n,targetId:r,latestMessage:i,unreadMessageCount:s,hasMentioned:a,mentionedInfo:u,lastUnreadTime:d,notificationStatus:c,notificationLevel:l,isTop:p,channelId:f,unreadMentionedCount:g,matchCount:v,operationTime:m,draft:E,translateStrategy:h,editedMessageDraft:x,includeRobot:T,dataMgmtInfo:C}=e,S=i&&o(i);let M;M=a?{type:null==u?void 0:u.type,userIdList:null==u?void 0:u.userIdList}:void 0;const y={conversationType:n,targetId:r,latestMessage:S,unreadMessageCount:s,hasMentioned:a,mentionedInfo:M,lastUnreadTime:d,notificationStatus:c,notificationLevel:l,isTop:p,channelId:f,unreadMentionedCount:g,matchCount:v,operationTime:m,draft:E||"",translateStrategy:h,editedMessageDraft:x,includeRobot:T,dataMgmtInfo:C};return y.conversationType===t.ConversationType.ULTRA_GROUP&&(y.firstUnreadMessage=e.firstUnreadMessage,y.channelType=e.channelType,y.unreadMentionedMeCount=e.unreadMentionedMeCount),y}function i(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}exports.Events=void 0,(e=exports.Events||(exports.Events={})).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.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.USER_SETTINGS_SYNCED="USER_SETTINGS_SYNCED",e.USER_SETTINGS_CHANGED="USER_SETTINGS_CHANGED",e.CONVERSATIONS_SETTINGS_SYNCED="CONVERSATIONS_SETTINGS_SYNCED",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.CONVERSATIONS_SYNCED="CONVERSATIONS_SYNCED",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="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.USER_GROUP_STATUS="USER_GROUP_STATUS",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",e.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED",e.GROUP_OPERATION="GROUP_OPERATION",e.GROUP_INFO_CHANGED="GROUP_INFO_CHANGED",e.GROUP_MEMBER_INFO_CHANGED="GROUP_MEMBER_INFO_CHANGED",e.GROUP_APPLICATION_EVENT="GROUP_APPLICATION_EVENT",e.GROUP_REMARK_CHANGED_SYNC="GROUP_REMARK_CHANGED_SYNC",e.GROUP_FOLLOWS_CHANGED_SYNC="GROUP_FOLLOWS_CHANGED_SYNC",e.FRIEND_ADDED="FRIEND_ADDED",e.FRIEND_DELETE="FRIEND_DELETE",e.FRIEND_APPLICATION_STATUS_CHANGED="FRIEND_APPLICATION_STATUS_CHANGED",e.FRIEND_CLEARED="FRIEND_CLEARED",e.FRIEND_INFO_CHANGED_SYNC="FRIEND_INFO_CHANGED_SYNC",e.DATABASE_OPENED="DATABASE_OPENED",e.DATABASE_UPGRADE_WILL_START="DATABASE_UPGRADE_WILL_START",e.DATABASE_UPGRADING="DATABASE_UPGRADING",e.DATABASE_UPGRADE_DID_COMPLETE="DATABASE_UPGRADE_DID_COMPLETE",e.STREAM_MESSAGE_RESPONSE="STREAM_MESSAGE_RESPONSE",e.MESSAGE_RECEIPT_RESPONSE_V5="MESSAGE_RECEIPT_RESPONSE_V5",e.SPEECH_TO_TEXT_RESPONSE="SPEECH_TO_TEXT_RESPONSE",e.TRANSLATE_RESPONSE="TRANSLATE_RESPONSE",e.MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.MESSAGE_MODIFIED_SYNC_COMPLETED="MESSAGE_MODIFIED_SYNC_COMPLETED",e.ROBOTS_SYNCED="ROBOTS_SYNCED",e.SYNC_SERVER_SAVE_UNREAD_COMPLETED="SYNC_SERVER_SAVE_UNREAD_COMPLETED",e.MESSAGE_REACTION_CHANGED="MESSAGE_REACTION_CHANGED";const s=new t.EventEmitter,a={connection(e,n){switch(e){case t.RCConnectionStatus.CONNECTED:s.emit(exports.Events.CONNECTED);break;case t.RCConnectionStatus.CONNECTING:s.emit(exports.Events.CONNECTING);break;case t.RCConnectionStatus.SUSPENDED:s.emit(exports.Events.SUSPEND,n);break;case t.RCConnectionStatus.DISCONNECTED:s.emit(exports.Events.DISCONNECT,n)}},batchMessage:e=>{s.emit(exports.Events.MESSAGES,{messages:e.map((e=>o(e)))})},typingState:e=>{s.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,o)=>{s.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:o})},messageReceiptRequest:(e,t,n)=>{s.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{s.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:e=>{const n=e.map((({conversation:e,updatedItems:n})=>{const{conversationType:o}=e,i=r(e);return o===t.ConversationType.ULTRA_GROUP&&(i.versionTime=e.versionTime,i.unreadMessageCount=u(e.unreadMessageCount||0),i.unreadMentionedCount=u(e.unreadMentionedCount||0),i.unreadMentionedMeCount=u(e.unreadMentionedMeCount||0)),{conversation:i,updatedItems:n}}));s.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:e=>{s.emit(exports.Events.CHATROOM,e)},expansion:e=>{s.emit(exports.Events.EXPANSION,e)},pullFinished:()=>{s.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{s.emit(exports.Events.TAG)},userSettingsSynced:e=>{s.emit(exports.Events.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{s.emit(exports.Events.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{s.emit(exports.Events.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{s.emit(exports.Events.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{s.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:e=>{s.emit(exports.Events.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{s.emit(exports.Events.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{s.emit(exports.Events.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{s.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{s.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>o(e))))},ultraGroupMessageRecalled:e=>{s.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>o(e))))},ultraGroupChannelChangeType:e=>{s.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{s.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{s.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{s.emit(exports.Events.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{s.emit(exports.Events.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{s.emit(exports.Events.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{s.emit(exports.Events.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{s.emit(exports.Events.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{s.emit(exports.Events.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{s.emit(exports.Events.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{s.emit(exports.Events.GROUP_OPERATION,e)},groupInfoChanged:e=>{s.emit(exports.Events.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{s.emit(exports.Events.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{s.emit(exports.Events.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{s.emit(exports.Events.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{s.emit(exports.Events.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{s.emit(exports.Events.FRIEND_ADDED,e)},friendDelete:e=>{s.emit(exports.Events.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{s.emit(exports.Events.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{s.emit(exports.Events.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{s.emit(exports.Events.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{s.emit(exports.Events.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{s.emit(exports.Events.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{s.emit(exports.Events.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{s.emit(exports.Events.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{s.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{s.emit(exports.Events.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{s.emit(exports.Events.TRANSLATE_RESPONSE,e)},messagesModified:e=>{s.emit(exports.Events.MESSAGE_MODIFIED,e.map((e=>o(e))))},messageModifiedSyncCompleted:()=>{s.emit(exports.Events.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{s.emit(exports.Events.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){s.emit(exports.Events.MESSAGE_REACTION_CHANGED,e)}};function u(e){return e>999?999:e}t.VersionManage.add("imlib-next","5.46.0-enterprise-alpha.2");let d=null,c=null,l=null;function p(e){if(!d)throw new Error("Not initialized yet!");return e(d,l,c)}function f(){return d?t.ok(d):t.fail(t.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT)}let g=0;const v=new Map;function m(e,t){const n=(...e)=>{const o=[],r=[];[...v.values()].forEach((([e,t,i])=>{e===n&&(r.push(t),i&&o.push(i))})),o.forEach((t=>{e=t(e)}));const i=t(...e);return r.forEach((t=>{t(e,i)})),i};return Object.defineProperty(n,"original",{value:t,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"monitorable",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n}const E=m("disconnect",((e,t)=>p((n=>n.disconnect(e,t)))));function h(){s.clear()}class x{constructor(e,t,n=!0,o=!0){Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:o})}}class T extends x{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class C extends T{constructor(e){super(t.MessageType.COMBINE,t.getMessageTypeDescription(t.MessageType.COMBINE),e)}}class S extends T{constructor(e){super(t.MessageType.FILE,t.getMessageTypeDescription(t.MessageType.FILE),e)}}class M extends T{constructor(e){super(t.MessageType.GIF,t.getMessageTypeDescription(t.MessageType.GIF),e)}}const y=t.MessageType.GROUP_NOTIFICATION;class _ extends T{constructor(e){super(t.MessageType.IMAGE,t.getMessageTypeDescription(t.MessageType.IMAGE),e)}}const R=t.MessageType.INFORMATION_NOTIFICATION;class I extends T{constructor(e){super(t.MessageType.SIGHT,t.getMessageTypeDescription(t.MessageType.SIGHT),e)}}class U extends T{constructor(e){super(t.MessageType.TEXT,t.getMessageTypeDescription(t.MessageType.TEXT),e)}}class A extends T{constructor(e){super(t.MessageType.HQ_VOICE,t.getMessageTypeDescription(t.MessageType.HQ_VOICE),e)}}var b;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(b||(b={}));class O{constructor(e,t,n){Object.defineProperty(this,"_url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_authInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_getFileToken",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isAbort",{enumerable:!0,configurable:!0,writable:!0,value:!1})}isAbort(){return this._isAbort}abort(){this._isAbort=!0,this._abortHandler()}upload(e){return e.file.size>t.MAX_UPLOAD_FILE_SIZE?Promise.resolve(t.fail(t.ErrorCode.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>t.UPLOAD_FILE_CHUNK_SIZE&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function P(e){return Math.ceil(e/1024)||0}const N={[b.QINIU]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=new FormData;s.set("token",i.token),s.set("key",i.fileName),s.set("file",n),this._promise=t.httpRequest({url:t.fixUrlProtocol(this._url),headers:{},onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?t.ok({uniqueName:i.fileName,uploadMethod:t.UploadMethod.QINIU}):t.fail(t.ErrorCode.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.ALIYUN]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=t.fixUrlProtocol(`${i.ossBucketName}.${this._url}`),a=new FormData;a.set("token",i.token),a.set("OSSAccessKeyId",i.osskeyId),a.set("policy",i.ossPolicy),a.set("Signature",i.ossSign),a.set("success_action_status","200"),a.set("key",i.fileName),a.set("file",n),this._promise=t.httpRequest({url:s,onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u}=yield this._promise.result();return this._promise=null,200===u||204===u?t.ok({uniqueName:i.fileName,uploadMethod:t.UploadMethod.ALI}):t.fail(t.ErrorCode.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.S3]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r,contentDisposition:i}=e;let s=this._authInfo;const a=t.fixUrlProtocol(`${s.s3BucketName}.${this._url}`),u=new FormData;i?u.set("Content-Disposition",i):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",s.s3Credential),u.set("x-amz-algorithm",s.s3Algorithm),u.set("x-amz-date",s.s3Date),u.set("policy",s.s3Policy),u.set("x-amz-signature",s.s3Signature),u.set("key",s.fileName),u.set("file",n),this._promise=t.httpRequest({url:a,headers:{},onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:u,timeout:0});const{status:d,data:c}=yield this._promise.result();return this._promise=null,200===d||204===d?t.ok({uniqueName:s.fileName,uploadMethod:t.UploadMethod.AWS}):t.fail(t.ErrorCode.UPLOAD_FAIL,d.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.MINIO]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>n(this,void 0,void 0,(function*(){var n;const{file:o,fileType:r}=e;let i=yield this._getFileToken(r,o.name,"POST","uploads",void 0,P(o.size));if(!i.isOk)return i.wipe();let s=i.data;const a=t.fixUrlProtocol(`${this._url}/${s.minioBucketName}/${s.fileName}`),u=this.getBaseHeaders(o,s,e);this._promise=t.httpRequest({url:`${a}?uploads`,headers:u,method:"POST"});const{status:d,data:c}=yield this._promise.result();this._promise=null;const l=null===(n=null==c?void 0:c.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1];if(200!==d&&204!==d||!l)return t.fail(t.ErrorCode.UPLOAD_FAIL,"start upload fail");const p=[],f=yield this.requestUploadPart(a,o,l,s.fileName,e,p);if(!f.isOk)return f.wipe();if(i=yield this._getFileToken(r,s.fileName,"POST",`uploadId=${l}`,void 0,P(o.size)),!i.isOk)return i.wipe();s=i.data;let g=p.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");g=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${g}</CompleteMultipartUpload>`;const v=this.getBaseHeaders(o,s,e);this._promise=t.httpRequest({url:`${a}?uploadId=${l}`,headers:v,method:"POST",body:g,timeout:0});const{status:m}=yield this._promise.result();return this._promise=null,200===m||204===m?t.ok({uniqueName:s.fileName,uploadMethod:t.UploadMethod.MINIO}):t.fail(t.ErrorCode.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=t.fixUrlProtocol(`${this._url}/${i.minioBucketName}/${i.fileName}`),a=this.getBaseHeaders(n,i,e);this._promise=t.httpRequest({url:s,headers:a,onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"PUT",body:n,timeout:0});const{status:u}=yield this._promise.result();return this._promise=null,200===u||204===u?t.ok({uniqueName:i.fileName,uploadMethod:t.UploadMethod.MINIO}):t.fail(t.ErrorCode.UPLOAD_FAIL,u.toString())}))}requestUploadPart(e,o,r,i,s,a,u=1,d=0){return n(this,void 0,void 0,(function*(){if(d>=5)return t.fail(t.ErrorCode.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const n=(u-1)*t.UPLOAD_FILE_CHUNK_SIZE,c=Math.min(t.UPLOAD_FILE_CHUNK_SIZE,o.size-n),l=`partNumber=${u}&uploadId=${r}`,p=yield this._getFileToken(s.fileType,i,"PUT",l,void 0,P(o.size));if(!p.isOk)return p.wipe();const f=p.data,g=o.slice(n,u*t.UPLOAD_FILE_CHUNK_SIZE),v=this.getBaseHeaders(o,f,s);this._promise=t.httpRequest({url:`${e}?${l}`,headers:v,method:"PUT",body:g,timeout:0,onProgress:e=>{var t;return null===(t=null==s?void 0:s.onProgress)||void 0===t?void 0:t.call(s,n+e.loaded,o.size)}});const{status:m,xhr:E}=yield this._promise.result();return this._promise=null,200===m||204===m?(a.push((null==E?void 0:E.getResponseHeader("ETag"))||""),n+c<o.size?this.requestUploadPart(e,o,r,i,s,a,u+1,0):t.ok()):this.requestUploadPart(e,o,r,i,s,a,u,d+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:o}=n;return{"Content-Disposition":`${o||("text/html"===e.type?"inline":"attachment")}; filename=${encodeURIComponent(e.name)};`,Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[b.RCX]:class extends O{constructor(){super(...arguments),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e,i=t.UUId.gen();let s=this._authInfo;return this._requestUploadPart(i,n,s.token,o)}))})}commonUpload(e){return n(this,void 0,void 0,(function*(){const{file:n,onProgress:o,fileType:r}=e;let i=this._authInfo;const s=new FormData;s.set("token",i.token),s.set("key",i.fileName),s.set("file",n);const a=t.fixUrlProtocol(this._url);this._promise=t.httpRequest({url:a,headers:{},onProgress:e=>null==o?void 0:o(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:u,data:d}=yield this._promise.result();if(this._promise=null,(200===u||204===u)&&d){const e=JSON.parse(d);return t.ok({uniqueName:e.rc_url.file_name,downloadUrl:`${a}/${e.rc_url.path}`,uploadMethod:t.UploadMethod.QINIU})}return t.fail(t.ErrorCode.UPLOAD_FAIL,u.toString())}))}_requestUploadPart(e,o,r,i,s=0){return n(this,void 0,void 0,(function*(){const n=Math.min(t.UPLOAD_FILE_CHUNK_SIZE,o.size-s),a=e+o.name.substring(o.name.lastIndexOf(".")),u={Range:`bytes=${s}-${s+n}`,"X-File-TransactionId":a,"X-File-Total-Size":o.size.toString()},d=o.slice(s,s+n),c=new FormData;c.set("file",d,o.name),c.set("key",a),c.set("name",a),c.set("token",r);const l=t.fixUrlProtocol(this._url);this._promise=t.httpRequest({url:l,headers:u,onProgress:e=>null==i?void 0:i(s+e.loaded,o.size),method:"POST",body:c,timeout:0});const{status:p,data:f}=yield this._promise.result();if(this._promise=null,200===p||204===p){if(s+n<o.size)return this._requestUploadPart(e,o,r,i,s+n);const a=JSON.parse(f);return t.ok({uniqueName:a.rc_url.file_name,downloadUrl:`${l}/${a.rc_url.path}`,uploadMethod:t.UploadMethod.QINIU})}return t.fail(t.ErrorCode.UPLOAD_FAIL,p.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function D(e,n,o){const{promise:r,resolve:i}=t.promiseWithResolvers(),s=document.createElement("canvas"),a=s.getContext("2d"),u=new Image;return u.onload=e=>{const{maxHeight:r=160,maxWidth:d=160,quality:c=1,scale:l=1}=o||{},p=G(u.width,u.height,{maxHeight:r,maxWidth:d,scale:l});s.width=Math.min(p.w,d),s.height=Math.min(p.h,r),a.drawImage(u,p.x,p.y,p.w,p.h);let f=L(s,c);f=f.replace(/data:image\/[^;]+;base64,/,""),i(t.ok(Object.assign(Object.assign({},n),{thumbnail:f,width:Math.ceil(p.w),height:Math.ceil(p.h)})))},u.onerror=e=>{i(t.fail(t.ErrorCode.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},u.src=(window.URL||window.webkitURL).createObjectURL(e),r}function L(e,n){let o=e.toDataURL("image/jpeg",n);return o.length>t.MAX_MESSAGE_CONTENT_BYTES-10240?L(e,n-.1):o}const G=(e,t,n)=>{const{maxHeight:o=160,maxWidth:r=160,scale:i=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>i?(s?(a=e/160,u=160,d=t/a,d>o&&(l=(d-o)/2)):(a=t/160,d=160,u=e/a,u>r&&(c=(u-r)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/o,d=o,u=e/a):(a=e/r,u=r,d=t/a),{w:u,h:d,x:-c,y:-l})};let F=0;class B{constructor(e,t){Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:++F}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,o,r,i,s=[]){return n(this,void 0,void 0,(function*(){for(let n=0;n<e.length;n++){const a=e[n],u=N[a.type];if(!u){s.push({type:a.type,url:a.url,code:t.ErrorCode.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new u(a.url,r,i);const d=yield this._client.upload(o);if(d.isOk)return d;const{code:c}=d;if([t.ErrorCode.RC_FILE_SIZE_EXCEED_LIMIT,t.ErrorCode.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(d.code))return d;if(this._client.isAbort())return this._client=null,d;this._client=null,s.push({type:a.type,url:a.url,code:c,msg:d.msg})}return t.fail(t.ErrorCode.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(s)}`)}))}_handleUpload(e,o){return n(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:r,uploadServer:i,ossConfig:s}=o,{file:a,fileType:u,thumbnailConfig:d}=e,c=yield n(u,a.name,void 0,void 0,void 0,P(a.size));if(!c.isOk)return c.wipe();const l=c.data,p=function(e,t,n){if(t)return[{type:b.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:b.QINIU,url:"",p:""};return Object.keys(e).forEach((n=>{"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort(((e,t)=>e.p-t.p));const o=[];return n&&o.push({type:b.QINIU,url:n,p:"1"}),o}(l.ossConfig||s,r,i);if(0===p.length)return t.fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:f,data:g,msg:v,isOk:m}=yield this._uploadInLoop(p,e,l,n);if(!m)return t.fail(f,v);let{downloadUrl:E,uploadMethod:h}=g;if(!E){const e=yield o.getFileUrl(u,g.uniqueName,h,a.name);if(!e.isOk)return t.fail(e.code,"Get download url fail");E=e.data.downloadUrl}if(!E)return t.fail(t.ErrorCode.UPLOAD_FAIL,"Get download url fail");const x={downloadUrl:E,uniqueName:(null==g?void 0:g.uniqueName)||"",name:a.name,size:a.size,type:a.type};if(u===t.FileType.AUDIO){return function(e,n){const o=new AudioContext({sampleRate:16e3}),{promise:r,resolve:i}=t.promiseWithResolvers();return o.decodeAudioData(e,(e=>{var o,r;i(t.ok(Object.assign(Object.assign({},n),{duration:e.duration,length:e.length,sampleRate:null!==(o=e.sampleRate)&&void 0!==o?o:void 0,numberOfChannels:null!==(r=e.numberOfChannels)&&void 0!==r?r:void 0})))}),(e=>{i(t.fail(t.ErrorCode.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),r}(yield a.arrayBuffer(),x)}return u===t.FileType.IMAGE?D(a,x,d):t.ok(x)}))}awaitResult(){return n(this,void 0,void 0,(function*(){return this._promise}))}}const H={};function j(e,t){const o=new B(e,t);return function(e){n(this,void 0,void 0,(function*(){H[e.id]=e,yield e.awaitResult(),delete H[e.id]}))}(o),o}const w=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function k(e){return n(this,void 0,void 0,(function*(){const{contentDisposition:o,fileType:r,file:i}=e;return f().next((s=>n(this,void 0,void 0,(function*(){const a=yield t.Validator.create("upload").validate("contentDisposition",o,(e=>"inline"===e||"attachment"===e),!1).fail(t.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",r,t.FileType,!0).fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(r===t.FileType.IMAGE&&!e.type.match(/^image\//))&&!(r===t.FileType.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(t.ErrorCode.MEDIA_EXCEPTION).result().next((()=>function(e,t){return n(this,void 0,void 0,(function*(){return new B(e,t).awaitResult()}))}(e,w(s,s.getOptions().uploadDomain))));return a}))))}))}const V=Ee,q=m("sendMessage",((e,r,i)=>n(void 0,void 0,void 0,(function*(){const{disableNotification:n,isMentioned:s,directionalUserIdList:a,canIncludeExpansion:u,onSendBefore:d,expansion:c,pushConfig:l,isStatusMessage:p,disableUpdateLastMessage:g}=i||{},v=function(e,t){const{disableNotification:n,pushContent:o,pushData:r,isMentioned:i,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:p,pushConfig:f,messageId:g,disableUpdateLastMessage:v,needReceipt:m,quoteInfo:E}=e;return Object.assign({disableNotification:n,pushContent:o,pushData:r,isMentioned:i,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:p,pushConfig:f,messageId:g,disableUpdateLastMessage:v,needReceipt:m,quoteInfo:E},t)}(i||{},r),m=Object.assign(Object.assign({},e),{isMentioned:!!s,content:r.content,messageType:r.messageType,isPersited:!!r.isPersited,isCounted:!!r.isCounted,disableNotification:!!n,canIncludeExpansion:!!u,expansion:c||null,senderUserId:"",messageUId:"",messageDirection:t.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!p,receivedStatus:t.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:l,sentStatus:t.SentStatus.SENDING,sentTime:0,directedUserIds:a||[],disableUpdateLastMessage:g,quoteInfo:v.quoteInfo}),E=yield f().next((n=>{m.senderUserId=n.getCurrentUserId();return n.sendMessage(e,v,(e=>{m.messageId=e;try{d&&d(o(m))}catch(e){n.logger.error(t.LogTagId.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return E.isOk?E.trans((e=>o(e))):(m.sentStatus=t.SentStatus.FAILED,t.fail(E.code,E.msg,o(m)))}))));function Y(e,o){return(r,i,s,a)=>n(this,void 0,void 0,(function*(){var n,u;const d=f();if(!d.isOk)return d.wipe();const c=d.data;if(!t.validate("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(e=>["inline","attachment"].includes(e))))return t.fail(t.ErrorCode.INVALID_PARAMETER_SENDOPTIONS);const l={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){const e=null===(n=a)||void 0===n?void 0:n.thumbnailConfig;if(!(t.validate("sendOptions.maxHeight",null==e?void 0:e.maxHeight,t.AssertRules.NUMBER)&&t.validate("sendOptions.maxWidth",null==e?void 0:e.maxWidth,t.AssertRules.NUMBER)&&t.validate("sendOptions.quality",null==e?void 0:e.quality,t.AssertRules.NUMBER)&&t.validate("sendOptions.scale",null==e?void 0:e.scale,t.AssertRules.NUMBER)))return t.fail(t.ErrorCode.INVALID_PARAMETER_SENDOPTIONS);l.thumbnailConfig=e}const{logger:p}=c,g=p.createTraceId();p.info(t.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),g);const v=yield k({file:i.file,fileType:e,onProgress:(e,t)=>{var n;null===(n=null==s?void 0:s.onProgress)||void 0===n||n.call(s,Math.floor(e/t*100))},contentDisposition:l.contentDisposition,thumbnailConfig:l.thumbnailConfig}),{code:m,data:E,msg:h}=v;if(m===t.ErrorCode.SUCCESS&&E){const e=(null===(u=null==s?void 0:s.onComplete)||void 0===u?void 0:u.call(s,Object.assign({url:E.downloadUrl},E)))||o(E,i);return p.info(t.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:E.downloadUrl,code:t.ErrorCode.SUCCESS}),g),q(r,e,a)}return t.fail(m,h)}))}const W=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},z=Y(t.FileType.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:W(e.name),fileUrl:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new S(n)})),$=Y(t.FileType.IMAGE,((e,t)=>{const n={content:e.thumbnail,imageUri:e.downloadUrl,thumWidth:e.width,thumHeight:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new _(n)})),Q=Y(t.FileType.IMAGE,((e,t)=>{const 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),t.audit&&(n.audit=t.audit),new M(n)})),K=Y(t.FileType.AUDIO,((e,t)=>{var n;const o={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),t.audit&&(o.audit=t.audit),new A(o)})),X=Y(t.FileType.SIGHT,((e,t)=>{const 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),t.audit&&(n.audit=t.audit),new I(n)}));Y(t.FileType.COMBINE_HTML,((e,t)=>{const 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 C(n)}));const J=m("recallMessage",((e,t)=>n(void 0,void 0,void 0,(function*(){return f().next((r=>n(void 0,void 0,void 0,(function*(){return(yield r.recallMessage(e,t)).trans((e=>o(e)))}))))}))));function Z(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.updateMessageExpansion(e,t)))}))}function ee(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeMessageExpansion(e,t)))}))}function te(e){return f().next((t=>t.modifyMessageWithParams(e)))}function ne(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>n(this,void 0,void 0,(function*(){return t.getAllConversationList(e)}))))).trans((e=>e.map(r)))}))}const oe=m("removeConversation",((e,t)=>n(void 0,void 0,void 0,(function*(){return f().next((n=>n.removeConversation(e,t)))}))));function re(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.batchDeleteConversations(e)))}))}function ie(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getTotalUnreadCountByLevels(e,t)))}))}function se(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getTotalUnreadCountByLevels(e,t,!0)))}))}const ae=m("clearMessagesUnreadStatus",(e=>n(void 0,void 0,void 0,(function*(){return f().next((t=>t.chat.clearUnreadCount(e)))}))));const ue=m("setConversationNotificationLevel",((e,t)=>n(void 0,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationNotificationLevel([e],t)))}))));const de=m("setConversationToTop",((e,t=!0,o=!0,r=!1)=>n(void 0,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationToTop([e],!!t,o,r)))}))));function ce(e,t,o,i){return n(this,void 0,void 0,(function*(){return f().next((s=>n(this,void 0,void 0,(function*(){return(yield s.searchConversationByContent(e,t,o,i)).trans((e=>e.map((e=>r(e)))))}))))}))}function le(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.searchMessages(e,t)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>o(e)))})))}))}function pe(e,o,r,s,a){return n(this,void 0,void 0,(function*(){return i("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),le(e,{keyword:o,limit:s||t.MAX_U32_INTEGER,order:0,timeRange:{endTime:r?r-1:r||0},messageFilter:{objectNames:a}})}))}function fe(e,t){return n(this,void 0,void 0,(function*(){return i("setMessageReceivedStatus","setMessageReceivedStatusInfo"),f().next((n=>n.setMessageReceivedStatus(e,t)))}))}function ge(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.clearLocalMessages(e)))}))}function ve(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.deleteLocalMessagesByTimestamp(e,t,o)))}))}function me(e,r,i={}){return n(this,void 0,void 0,(function*(){return r instanceof x?function(e,r,i={}){return n(this,void 0,void 0,(function*(){const n=!!(null==i?void 0:i.isUnread),s=null==i?void 0:i.searchContent,a=null==i?void 0:i.disableUpdateLastMessage,u={senderUserId:"",messageType:null==r?void 0:r.messageType,content:null==r?void 0:r.content,searchContent:s,messageDirection:t.MessageDirection.SEND,isUnread:n,messageUId:"",disableUpdateLastMessage:a,quoteInfo:i.quoteInfo};return(yield f().next((t=>t.insertMessage(e,u)))).trans(o)}))}(e,r,i):function(e,r,i={}){return n(this,void 0,void 0,(function*(){const n=!!(null==i?void 0:i.isUnread),s=null==i?void 0:i.searchContent,a=null==i?void 0:i.disableUpdateLastMessage,u={senderUserId:null==r?void 0:r.senderUserId,messageType:null==r?void 0:r.messageType,content:null==r?void 0:r.content,messageDirection:null==r?void 0:r.messageDirection,readStatus:"object"==typeof(null==r?void 0:r.receivedStatusInfo)?t.transformReceivedStatusFlag(r.receivedStatusInfo):null==r?void 0:r.receivedStatus,sentTime:null==r?void 0:r.sentTime,sentStatus:null==r?void 0:r.sentStatus,searchContent:s,messageUId:"",isUnread:n,disableNotification:null==r?void 0:r.disableNotification,canIncludeExpansion:null==r?void 0:r.canIncludeExpansion,expansion:(null==r?void 0:r.expansion)||void 0,directedUserIds:null==r?void 0:r.directedUserIds,disableUpdateLastMessage:(null==r?void 0:r.disableUpdateLastMessage)||a,quoteInfo:null==r?void 0:r.quoteInfo};return(yield f().next((t=>t.insertMessage(e,u)))).trans(o)}))}(e,r,i)}))}function Ee(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getLocalMessage(e)))).trans((e=>o(e)))}))}var he=Object.freeze({__proto__:null,getAllConversationList:function(e){return n(this,void 0,void 0,(function*(){return i("electronExtension.getAllConversationList","getAllConversationList"),ne(e)}))},getConversationList:function(e,t,o,s){return n(this,void 0,void 0,(function*(){i("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield f().next((r=>n(this,void 0,void 0,(function*(){return r.getConversationList({startTime:e,count:t,channelId:o,topPriority:s})}))))).trans((e=>e.map((e=>r(e)))))}))},searchConversationByContent:ce,getConversations:function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getConversations(e)))).trans((e=>e.map(r)))}))},getUntaggedConversationListByPage:function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((i=>n(this,void 0,void 0,(function*(){return(yield i.getUntaggedConversationListByPage(e,t,o)).trans((e=>e.map((e=>r(e)))))}))))}))},getRemoteConversations:function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.syncRemoteConversations()))}))},saveEditedMessageDraft:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.saveEditedMessageDraft(e,t)))}))},getEditedMessageDraft:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.getEditedMessageDraft(e)))}))},clearEditedMessageDraft:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.clearEditedMessageDraft(e)))}))},searchMessages:pe,searchMessageInTimeRange:function(e,t){return n(this,void 0,void 0,(function*(){return i("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),le(e,{keyword:null==t?void 0:t.keyword,limit:(null==t?void 0:t.limit)||5,offset:null==t?void 0:t.offset,order:0,timeRange:{startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}})}))},searchMessagesByUser:function(e,t,o,r){return n(this,void 0,void 0,(function*(){i("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield le(e,{limit:r,keyword:"",order:0,timeRange:{endTime:o?o-1:o||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},getHistoryMessagesByMessageTypes:function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getHistoryMessagesByObjectNames(e,t)))).trans((({list:e,hasMore:t})=>{const n=e.map(o);return{messages:n,hasMore:t,list:n}}))}))},getContinuousMessages:function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getContinuousMessages(e,t)))).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(o),timestamp:n})))}))},setMessageStatusToRead:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setMessageStatusToRead(e,t)))}))},setMessageReceivedStatus:fe,setMessageReceivedStatusInfo:function(e,o){return n(this,void 0,void 0,(function*(){const n=t.transformReceivedStatusFlag(o||{});return f().next((t=>t.setMessageReceivedStatus(e,n)))}))},setMessageSentStatus:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setMessageSentStatus(e,t)))}))},setMessageContent:function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setMessageContent(e,t,o)))}))},deleteMessages:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.deleteLocalMessages(e)))}))},clearMessages:ge,deleteMessagesByTimestamp:ve,batchClearMessagesByTimestamp:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.batchClearLocalMessagesByTimestamp(e)))}))},insertMessage:me,batchInsertMessage:function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchInsertMessage(e,t)))}))},getMessageCount:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getLocalMessageCount(e)))}))},setCheckDuplicateMessage:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setCheckDuplicateMessage(e)))}))},setCheckChatRoomDuplicateMessage:function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chatroom.setCheckChatRoomDuplicateMessage(!!e)))}))},getMessagesAroundTimestamp:function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>{const o=null==t?void 0:t.timestamp,r=null==t?void 0:t.beforeCount,i=null==t?void 0:t.afterCount;return n.getMessagesAroundTimestamp(e,o,r,i)}))).trans((e=>e.map(o)))}))},getLocalMessage:Ee,searchMessagesWithParams:function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.searchMessagesWithParams(e)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>o(e)))})))}))},setMessageSpeechToTextVisible:function(e,t){return f().next((n=>n.setMessageSpeechToTextVisible(e,t)))},deleteUltraGroupMessagesForAllChannel:function(e,t){return f().next((n=>n.deleteLocalUGMessagesForAllChannel(e,t)))},getUnreadMentionedMessages:function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getUnreadMentionedMessages(e)))).trans((e=>e.map(o)))}))},clearLocalData:function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.clearLocalData()))}))},enable:function(){return t.usingCppEngine()}});Object.defineProperty(exports,"AreaCode",{enumerable:!0,get:function(){return t.AreaCode}}),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return t.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomSyncStatusReason",{enumerable:!0,get:function(){return t.ChatroomSyncStatusReason}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return t.ChatroomUserChangeType}}),Object.defineProperty(exports,"ChrmMemBanType",{enumerable:!0,get:function(){return t.ChrmMemBanType}}),Object.defineProperty(exports,"ChrmMemOperateType",{enumerable:!0,get:function(){return t.ChrmMemOperateType}}),Object.defineProperty(exports,"ChrmSyncStatus",{enumerable:!0,get:function(){return t.ChrmSyncStatus}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return t.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return t.ConversationType}}),Object.defineProperty(exports,"ConversationUnreadCountFilter",{enumerable:!0,get:function(){return t.ConversationUnreadCountFilter}}),Object.defineProperty(exports,"DirectionType",{enumerable:!0,get:function(){return t.DirectionType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return t.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return t.FileType}}),Object.defineProperty(exports,"FilterRobotType",{enumerable:!0,get:function(){return t.FilterRobotType}}),Object.defineProperty(exports,"FriendAddPermission",{enumerable:!0,get:function(){return t.FriendAddPermission}}),Object.defineProperty(exports,"FriendApplicationStatus",{enumerable:!0,get:function(){return t.FriendApplicationStatus}}),Object.defineProperty(exports,"FriendApplicationType",{enumerable:!0,get:function(){return t.FriendApplicationType}}),Object.defineProperty(exports,"FriendRelationType",{enumerable:!0,get:function(){return t.FriendRelationType}}),Object.defineProperty(exports,"GroupApplicationDirection",{enumerable:!0,get:function(){return t.GroupApplicationDirection}}),Object.defineProperty(exports,"GroupApplicationStatus",{enumerable:!0,get:function(){return t.GroupApplicationStatus}}),Object.defineProperty(exports,"GroupApplicationType",{enumerable:!0,get:function(){return t.GroupApplicationType}}),Object.defineProperty(exports,"GroupInviteHandlePermission",{enumerable:!0,get:function(){return t.GroupInviteHandlePermission}}),Object.defineProperty(exports,"GroupJoinPermission",{enumerable:!0,get:function(){return t.GroupJoinPermission}}),Object.defineProperty(exports,"GroupMemberInfoEditPermission",{enumerable:!0,get:function(){return t.GroupMemberInfoEditPermission}}),Object.defineProperty(exports,"GroupMemberRole",{enumerable:!0,get:function(){return t.GroupMemberRole}}),Object.defineProperty(exports,"GroupOperation",{enumerable:!0,get:function(){return t.GroupOperation}}),Object.defineProperty(exports,"GroupOperationPermission",{enumerable:!0,get:function(){return t.GroupOperationPermission}}),Object.defineProperty(exports,"GroupReadReceiptVersion",{enumerable:!0,get:function(){return t.GroupReadReceiptVersion}}),Object.defineProperty(exports,"InterruptionLevel",{enumerable:!0,get:function(){return t.InterruptionLevel}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return t.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return t.MentionedType}}),Object.defineProperty(exports,"MessageAuditType",{enumerable:!0,get:function(){return t.MessageAuditType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return t.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return t.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return t.MessageDirection}}),Object.defineProperty(exports,"MessageReactionOperationType",{enumerable:!0,get:function(){return t.MessageReactionOperationType}}),Object.defineProperty(exports,"MessageType",{enumerable:!0,get:function(){return t.MessageType}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return t.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return t.NotificationStatus}}),Object.defineProperty(exports,"OnlineStatus",{enumerable:!0,get:function(){return t.OnlineStatus}}),Object.defineProperty(exports,"OperateStatus",{enumerable:!0,get:function(){return t.OperateStatus}}),Object.defineProperty(exports,"Platform",{enumerable:!0,get:function(){return t.Platform}}),Object.defineProperty(exports,"PlatformInfo",{enumerable:!0,get:function(){return t.Platform}}),Object.defineProperty(exports,"PushImportanceHonor",{enumerable:!0,get:function(){return t.PushImportanceHonor}}),Object.defineProperty(exports,"PushNotificationQuietHoursLevel",{enumerable:!0,get:function(){return t.PushNotificationQuietHoursLevel}}),Object.defineProperty(exports,"QueryFriendsDirectionType",{enumerable:!0,get:function(){return t.QueryFriendsDirectionType}}),Object.defineProperty(exports,"QuoteMessageStatus",{enumerable:!0,get:function(){return t.QuoteMessageStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return t.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return t.ReceivedStatus}}),Object.defineProperty(exports,"ReferenceMessageStatus",{enumerable:!0,get:function(){return t.ReferenceMessageStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return t.SentStatus}}),Object.defineProperty(exports,"SpeechToTextStatus",{enumerable:!0,get:function(){return t.SpeechToTextStatus}}),Object.defineProperty(exports,"StreamMessageResponseEventType",{enumerable:!0,get:function(){return t.StreamMessageResponseEventType}}),Object.defineProperty(exports,"SubscribeOperationType",{enumerable:!0,get:function(){return t.SubscribeOperationType}}),Object.defineProperty(exports,"SubscribeType",{enumerable:!0,get:function(){return t.SubscribeType}}),Object.defineProperty(exports,"TranslateMessageParam",{enumerable:!0,get:function(){return t.TranslateMessageParam}}),Object.defineProperty(exports,"TranslateMode",{enumerable:!0,get:function(){return t.TranslateMode}}),Object.defineProperty(exports,"TranslateStatus",{enumerable:!0,get:function(){return t.TranslateStatus}}),Object.defineProperty(exports,"TranslateStrategy",{enumerable:!0,get:function(){return t.TranslateStrategy}}),Object.defineProperty(exports,"TranslateTextParam",{enumerable:!0,get:function(){return t.TranslateTextParam}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return t.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return t.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return t.UploadMethod}}),Object.defineProperty(exports,"UserProfileVisibility",{enumerable:!0,get:function(){return t.UserProfileVisibility}}),Object.defineProperty(exports,"UserSettingsChangedKey",{enumerable:!0,get:function(){return t.UserSettingsChangedKey}}),Object.defineProperty(exports,"UserType",{enumerable:!0,get:function(){return t.UserType}}),Object.defineProperty(exports,"createLogDBProxy",{enumerable:!0,get:function(){return t.createLogDBProxy}}),Object.defineProperty(exports,"fail",{enumerable:!0,get:function(){return t.fail}}),Object.defineProperty(exports,"ok",{enumerable:!0,get:function(){return t.ok}}),exports.BaseMessage=x,exports.CombineMessage=C,exports.CombineV2Message=class extends T{constructor(e){super(t.MessageType.COMBINE_V2,t.getMessageTypeDescription(t.MessageType.COMBINE_V2),e)}},exports.CommandMessage=class extends T{constructor(e){super(t.MessageType.COMMAND,t.getMessageTypeDescription(t.MessageType.COMMAND),e)}},exports.ConnectType={COMET:"_",WEBSOCKET:"_"},exports.FileMessage=S,exports.GIFMessage=M,exports.GroupNotificationMessage=class extends T{constructor(e){super(y,t.getMessageTypeDescription(y),e)}},exports.HQVoiceMessage=A,exports.ImageMessage=_,exports.InformationNotificationMessage=class extends T{constructor(e){super(R,t.getMessageTypeDescription(R),e)}},exports.LocationMessage=class extends T{constructor(e){super(t.MessageType.LOCATION,t.getMessageTypeDescription(t.MessageType.LOCATION),e)}},exports.ReferenceMessage=class extends T{constructor(e){super(t.MessageType.REFERENCE,t.getMessageTypeDescription(t.MessageType.REFERENCE),e)}},exports.RichContentMessage=class extends T{constructor(e){super(t.MessageType.RICH_CONTENT,t.getMessageTypeDescription(t.MessageType.RICH_CONTENT),e)}},exports.SightMessage=I,exports.TextMessage=U,exports.UploadTask=B,exports.VoiceMessage=class extends T{constructor(e){super(t.MessageType.VOICE,t.getMessageTypeDescription(t.MessageType.VOICE),e)}},exports.__addSDKVersion=function(e,n){t.VersionManage.add(e,n)},exports.acceptFriendApplication=function(e){return f().next((t=>t.dataHosting.acceptFriendRequest(e)))},exports.acceptGroupApplication=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.acceptGroupApplication(e,t,o)))}))},exports.acceptGroupInvite=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.acceptGroupInvite(e,t)))}))},exports.addConversationsToTag=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.addTagForConversations(e,t)))}))},exports.addEventListener=function(e,t,n){s.on(e,t,n)},exports.addFriend=function(e,t,n){return f().next((o=>o.dataHosting.addFriend(e,t,n)))},exports.addGroupFollows=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.addGroupFollows(e,t)))}))},exports.addGroupManagers=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.addGroupManagers(e,t)))}))},exports.addMessageReaction=function(e){return f().next((t=>t.chat.addMessageReaction(e)))},exports.addMonitor=function(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const o=++g;return v.set(o,[e,t,n]),o},exports.addTag=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.createTag(e)))}))},exports.addToBlacklist=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.addToBlacklist(e)))}))},exports.batchClearRemoteHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchClearRemoteHistoryMessages(e,t)))}))},exports.batchDeleteConversations=re,exports.batchGetMessageReactionSummaries=function(e){return f().next((t=>t.chat.batchGetMessageReactionSummaries(e)))},exports.batchGetMessageReadReceiptInfoV4=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.batchGetMessageReadReceiptInfoV4(e,t)))}))},exports.batchRemoveConversation=function(e){return n(this,void 0,void 0,(function*(){return i("batchRemoveConversation","batchDeleteConversations"),re({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))},exports.batchSetConversationNotificationLevel=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationNotificationLevel(e,t)))}))},exports.batchSetConversationToTop=function(e,t,o=!0,r=!0){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationToTop(e,!!t,r,o)))}))},exports.batchSetConversationTranslateStrategy=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.batchSetConversationTranslateStrategy(e,t)))}))},exports.bindRTCRoomForChatroom=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chatroom.bindRTCRoomForChatroom(e)))}))},exports.checkFriends=function(e,t){return f().next((n=>n.dataHosting.checkFriends(e,t)))},exports.clearAllMessagesUnreadStatus=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.chat.clearAllUnreadCount()))}))},exports.clearEventListeners=h,exports.clearHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.deleteRemoteMessageByTimestamp(e,t)))}))},exports.clearMessages=function(e){return n(this,void 0,void 0,(function*(){return i("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),ge(e)}))},exports.clearMessagesUnreadStatus=ae,exports.clearRealtimeConUnreadCount=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.clearRealtimeConUnreadCount(e)))}))},exports.clearTextMessageDraft=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.clearTextMessageDraft(e)))}))},exports.clearUnreadCountByTimestamp=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return o.chat.clearUnreadCountByTimestamp(e,t)}))))}))},exports.connect=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))},exports.createConversationListLoader=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.createConversationListLoader(e)))}))},exports.createGroup=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.createGroup(e,t)))}))},exports.createUploadTask=function(e){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:r,file:i}=e;return t.Validator.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(t.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",r,t.FileType,!0).fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(r===t.FileType.IMAGE&&!e.type.match(/^image\//))&&!(r===t.FileType.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(t.ErrorCode.MEDIA_EXCEPTION).result().trans((()=>j(e,w(o,o.getOptions().uploadDomain))))}))))}))},exports.deleteFriends=function(e,t){return f().next((n=>n.dataHosting.deleteFriends(e,t)))},exports.deleteLocalMessagesByTimestamp=function(e,t,o){return n(this,void 0,void 0,(function*(){return i("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),ve(e,t,o)}))},exports.deleteMessages=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.deleteRemoteMessage(e,t)))}))},exports.destroy=function(){return n(this,void 0,void 0,(function*(){return h(),function(){return n(this,void 0,void 0,(function*(){d&&(yield t.APIContext.destroy(),c=null,d=null,l=null)}))}()}))},exports.disconnect=E,exports.dismissGroup=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.dismissGroup(e)))}))},exports.electronExtension=he,exports.forceRemoveChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.removeChatroomEntry(e,t,!0)))}))},exports.forceSetChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.setChatroomEntry(e,t,!0)))}))},exports.getAllChatRoomEntries=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chatroom.getAllChatroomEntries(e)))}))},exports.getAllConversationList=ne,exports.getAllRobots=function(){return f().next((e=>e.getAllRobots()))},exports.getAllUltraGroupUnreadCount=function(){return n(this,void 0,void 0,(function*(){return i("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),ie([t.ConversationType.ULTRA_GROUP],[])}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function*(){return i("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),se([t.ConversationType.ULTRA_GROUP],[])}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getAllUnreadMentionedCount()))}))},exports.getAppSettings=function(){const e=f().tryTrans((e=>e.getAppSettings()));return e.isOk?e.data:null},exports.getAutoTranslateEnabled=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getAutoTranslateEnabled()))}))},exports.getBlacklist=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getBlacklist()))}))},exports.getBlacklistStatus=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getBlacklistStatus(e)))).trans((e=>0===e))}))},exports.getBlockUltraGroupList=function(){return n(this,void 0,void 0,(function*(){return(yield f().next((e=>e.getBlockedUGList()))).trans((e=>e.map((e=>r(e)))))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function*(){return(yield f().next((e=>e.getBlockedConversationList()))).trans((e=>e.map(r)))}))},exports.getChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.getChatroomEntry(e,t)))}))},exports.getChatRoomInfo=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)))}))},exports.getChatroomHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chatroom.getChatroomHistoryMessages(e,null==t?void 0:t.count,null==t?void 0:t.order,null==t?void 0:t.timestamp)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>o(e)))})))}))},exports.getConnectionStatus=function(){return p((e=>e.getConnectionStatus()))},exports.getConversation=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>n(this,void 0,void 0,(function*(){return(yield t.getConversation(e)).trans((e=>r(e)))}))))}))},exports.getConversationList=function(e,t){return n(this,void 0,void 0,(function*(){i("getConversationList","getConversationListByTimestamp");return(yield f().next((o=>n(this,void 0,void 0,(function*(){return o.getConversationList({count:(null==e?void 0:e.count)||300,startTime:(null==e?void 0:e.startTime)||0,order:null==e?void 0:e.order,channelId:t})}))))).trans((e=>e.map(r)))}))},exports.getConversationListByTimestamp=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>n(this,void 0,void 0,(function*(){return t.getConversationListByTimestamp(e)}))))).trans((e=>e.map(r)))}))},exports.getConversationNotificationLevel=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getConversationNotificationLevel(e)))}))},exports.getConversationNotificationStatus=function(e){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return(yield o.getConversationNotificationLevel(e)).trans((e=>t.trans2NotificationStatus(e)))}))))}))},exports.getConversationTypeNotificationLevel=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getConversationTypeNotificationLevel(e)))}))},exports.getConversationsFromTagByPage=function(e,t,o){return n(this,void 0,void 0,(function*(){i("getConversationsFromTagByPage","createConversationListLoader");return(yield f().next((n=>n.getConversationListByTag(e,o,t)))).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},r(t)),{isTopInTag:t.isTopInTag});var t}))))}))},exports.getConversationsIncludingRobots=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.chat.getConversationsIncludingRobots(e)))).trans((e=>e.map(r)))}))},exports.getCurrentUserId=function(){return p((e=>e.getCurrentUserId()))},exports.getDeviceId=function(){return p((e=>e.getDeviceId()))},exports.getDownloadAuth=function(e){return f().next((o=>n(this,void 0,void 0,(function*(){return(yield t.Validator.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(t.ErrorCode.INVALID_PARAMETER_MEDIA_URL).result().next((()=>o.getFileToken(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))},exports.getFileToken=function(e,t,n,o){return f().next((r=>r.getFileToken(e,t,n,o)))},exports.getFileUrl=function(e,o,r,i,s){return n(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?t.ok(i):f().next((n=>n.getFileUrl(e,o,s||t.UploadMethod.QINIU,r)))}))},exports.getFirstUnreadMessage=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getFirstUnreadMessage(e)))).trans((e=>e?o(e):null))}))},exports.getFirstUnreadMessageInfo=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getFirstUnreadMessageDigest(e)))}))},exports.getFriendAddPermission=function(){return f().next((e=>e.dataHosting.getFriendAddPermission()))},exports.getFriendApplications=function(e,t,n){return f().next((o=>o.dataHosting.getFriendApplications(e,t,n)))},exports.getFriends=function(e,t){return f().next((n=>n.dataHosting.getFriends(e,t)))},exports.getFriendsInfo=function(e){return f().next((t=>t.dataHosting.getFriendsInfo(e)))},exports.getGroupApplications=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getGroupApplications(e,t,o)))}))},exports.getGroupFollows=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.getGroupFollows(e)))}))},exports.getGroupMembers=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getGroupMembers(e,t)))}))},exports.getGroupMembersByRole=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getGroupMembersByRole(e,t,o)))}))},exports.getGroupsInfo=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.getGroupsInfo(e)))}))},exports.getHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getHistoryMessage(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>o(e)))})))}))},exports.getJoinedGroups=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.getJoinedGroups(e)))}))},exports.getJoinedGroupsByRole=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.getJoinedGroupsByRole(t,e)))}))},exports.getMessage=V,exports.getMessageReactionUsers=function(e){return f().next((t=>t.chat.getMessageReactionUsers(e)))},exports.getMessageReactions=function(e){return f().next((t=>t.chat.getMessageReactions(e)))},exports.getMessageReadReceiptInfoV5=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return o.getMessageReadReceiptInfoV5(e,t)}))))}))},exports.getMessageReadReceiptInfoV5ByIdentifiers=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>n(this,void 0,void 0,(function*(){return t.getMessageReadReceiptInfoV5ByIdentifiers(e)}))))}))},exports.getMessageReadReceiptV4=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.getMessageReadReceiptV4(e,t)))}))},exports.getMessageReader=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){return r.chat.getMessageReader(e,t,o)}))))}))},exports.getMessagesByUIds=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getMessagesByUIds(e.conversationIdentifier,e.messageUIds)))).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?o(e.message):void 0,code:e.code})))))}))},exports.getMessagesReadReceiptByUsersV5=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){return r.getMessagesReadReceiptByUsersV5(e,t,o)}))))}))},exports.getMessagesReadReceiptUsersByPageV5=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){return r.getMessagesReadReceiptUsersByPageV5(e,t,o)}))))}))},exports.getMyUserProfile=function(){return f().next((e=>e.getMyUserProfile()))},exports.getMyUserProfileVisibility=function(){return f().next((e=>e.dataHosting.getMyUserProfileVisibility()))},exports.getNotificationQuietHoursSetting=function(){return f().next((e=>e.getNotificationQuietHoursSetting()))},exports.getProxy=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getProxy()))}))},exports.getRealtimeConTotalUnreadCount=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getRealtimeConTotalUnreadCount()))}))},exports.getRealtimeConUnreadCounts=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.batchGetRealtimeConUnreadCount(e)))}))},exports.getRealtimeConversations=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>{var n,o,r;return t.getRealtimeConversations(null!==(n=null==e?void 0:e.count)&&void 0!==n?n:30,null!==(o=null==e?void 0:e.startTime)&&void 0!==o?o:0,null!==(r=null==e?void 0:e.order)&&void 0!==r?r:0)}))).trans((e=>e.map(r)))}))},exports.getRemoteHistoryMessages=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getRemoteHistoryMessages(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>o(e)))})))}))},exports.getRobotById=function(e){return f().next((t=>t.getRobotById(e)))},exports.getServerTime=function(){return p((e=>e.getServerTime()))},exports.getSubscribeUserList=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getSubscribeUserList(e,t,o)))}))},exports.getSubscribeUserStatus=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getSubscribeUserStatus(e,t)))}))},exports.getSubscribeUsersOnlineStatus=function(e){return f().next((t=>t.getSubscribeUsersOnlineStatus(e)))},exports.getTags=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getTagList()))}))},exports.getTagsFromConversation=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getTagsForConversation(e)))}))},exports.getTextMessageDraft=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getTextMessageDraft(e)))}))},exports.getTopConversationList=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.getTopConversationList(e,t)))).trans((e=>e.map(r)))}))},exports.getTotalUnreadCount=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getTotalUnreadCount(t,e)))}))},exports.getTotalUnreadCountByLevels=ie,exports.getTotalUnreadMentionedCountByLevels=se,exports.getTranslationLanguage=function(){return n(this,void 0,void 0,(function*(){return f().next((e=>e.getTranslationLanguage()))}))},exports.getUltraGroupDefaultNotificationLevel=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,null==e?void 0:e.channelId)))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUGFirstUnreadMessageDigest(e)))}))},exports.getUltraGroupList=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUltraGroupList(e)))}))},exports.getUltraGroupMessageListByMessageUId=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((o=>n(this,void 0,void 0,(function*(){return o.getUltraGroupMessageListByMessageUId(e,t)}))))).trans((e=>{const t={};for(const n in e)t[n]=e[n]?o(e[n]):void 0;return t}))}))},exports.getUltraGroupUnreadCountByTargetId=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getUGUnreadCountForAllChannels(e,!1,t)))}))},exports.getUltraGroupUnreadInfoList=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUGUnreadInfoList(e)))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getUGUnreadCountForAllChannels(e,!0,t)))}))},exports.getUltraGroupUnreadMentionedMessages=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUGUnreadMentionedDigest(e)))}))},exports.getUnreadConversationList=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getUnreadConversationList(e)))).trans((e=>e.map(r)))}))},exports.getUnreadCount=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUnreadCount(e)))}))},exports.getUnreadCountByTag=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.getUnreadCountByTag(e,t)))}))},exports.getUnreadMentionMeConversationList=function(e){return n(this,void 0,void 0,(function*(){return(yield f().next((t=>t.getUnreadMentionMeConversationList(e)))).trans((e=>e.map(r)))}))},exports.getUnreadMentionedCount=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.getUnreadMentionedCount(e)))}))},exports.getUnreadMentionedMessages=function(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")},exports.getUserProfiles=function(e){return f().next((t=>t.getUserProfiles(e)))},exports.init=function(e){!function(e){var n,r,i;d?l.warn(t.LogTagId.A_INIT_REPEAT_O):(t.assert("options.appkey",e.appkey,t.AssertRules.STRING,!0),t.assert("options.navigators",e.navigators,(e=>t.isArray(e)&&(0===e.length||e.every(t.isHttpUrl)))),t.assert("options.loggerProxy",e.loggerProxy,(e=>e instanceof t.LogDBProxy)),c=e,d=t.APIContext.init({appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(n=e.environment)&&void 0!==n?n:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null!==(r=e.enableReadReceiptStorage)&&void 0!==r&&r,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),l=d.logger,d.assignWatcher(a),d.sse.on("message",((e,t)=>{const n=Object.assign(Object.assign({},t),{message:t.message?o(t.message):void 0});s.emit(exports.Events.STREAM_MESSAGE_RESPONSE,n)})))}(e)},exports.insertMessage=function(e,t,o={}){return n(this,void 0,void 0,(function*(){return i("insertMessage","electronExtension.insertMessage"),me(e,t,o)}))},exports.installPlugin=function(e,t){return p((n=>n.install(e,t)))},exports.inviteUsersToGroup=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.inviteUsersToGroup(e,t)))}))},exports.joinChatRoom=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)))).wipe()}))},exports.joinExistChatRoom=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)))}))},exports.joinGroup=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.joinGroup(e)))}))},exports.kickGroupMembers=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.kickGroupMembers(e,t,o)))}))},exports.markRemoteConversationAsRead=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.markRemoteConversationAsRead(e)))}))},exports.modifyMessage=function(e,t){return n(this,void 0,void 0,(function*(){return i("modifyMessage","modifyMessageWithParams"),te({messageUId:null==t?void 0:t.messageUId,messageContent:e,conversation:{conversationType:null==t?void 0:t.conversationType,targetId:null==t?void 0:t.targetId,channelId:null==t?void 0:t.channelId}})}))},exports.modifyMessageWithParams=te,exports.onceEventListener=function(e,t,n){s.once(e,t,n)},exports.quitChatRoom=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.quitChatroom(e,t)))}))},exports.quitGroup=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.quitGroup(e,t)))}))},exports.recallMessage=J,exports.refreshReferenceMessageWithParams=function(e){return f().next((t=>{const n=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?o(e.message):void 0,code:e.code})));return t.refreshReferenceMessageWithParams(Object.assign(Object.assign({},e),{remoteMessageBlock:t=>{e.remoteMessageBlock&&e.remoteMessageBlock(n(t))},localMessageBlock:t=>{e.localMessageBlock&&e.localMessageBlock(n(t))}}))}))},exports.refuseFriendApplication=function(e){return f().next((t=>t.dataHosting.refuseFriendRequest(e)))},exports.refuseGroupApplication=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.refuseGroupApplication(e,t,o,r)))}))},exports.refuseGroupInvite=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.refuseGroupInvite(e,t,o)))}))},exports.registerMessageType=function(e,n,o,r,i){return p(((s,a)=>(t.assert("messageType",e,t.AssertRules.STRING,!0),t.assert("isPersited",n,t.AssertRules.BOOLEAN,!0),t.assert("isCounted",o,t.AssertRules.BOOLEAN,!0),t.assert("isStatusMessage",i,t.AssertRules.BOOLEAN),t.assert("searchProps",r,t.AssertRules.ARRAY),a.info(t.LogTagId.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:o,isStatusMessage:i,isPersited:n,searchProps:r})),s.registerMessageType(e,n,o,r,i),function(e,t=!0,n=!0){return function(o){return new x(e,o,t,n)}}(e,n,o))))},exports.removeAllExpansionForUltraGroupMessage=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeAllMessageExpansion(e)))}))},exports.removeChatRoomEntries=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.removeChatroomEntries(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})))}))},exports.removeChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.removeChatroomEntry(e,t,!1)))}))},exports.removeConversation=oe,exports.removeConversationsFromTag=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeTagForConversations(e,t)))}))},exports.removeEventListener=function(e,t,n){s.off(e,t,n)},exports.removeEventListeners=function(e){s.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(e,t){return n(this,void 0,void 0,(function*(){return i("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),ee(e,t)}))},exports.removeFromBlacklist=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeFromBlacklist(e)))}))},exports.removeGroupFollows=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.removeGroupFollows(e,t)))}))},exports.removeGroupManagers=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.removeGroupManagers(e,t)))}))},exports.removeMessageExpansionForKey=ee,exports.removeMessageReaction=function(e){return f().next((t=>t.chat.removeMessageReaction(e)))},exports.removeMonitor=function(e){v.delete(e)},exports.removeNotificationQuietHoursSetting=function(){return f().next((e=>e.removeNotificationQuietHoursSetting()))},exports.removeRealtimeConversations=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeRealtimeConversations(e)))}))},exports.removeTag=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.removeTag(e)))}))},exports.removeTagFromConversations=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeTagForConversations(e,t)))}))},exports.removeTagsFromConversation=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.removeTagsForConversation(e,t)))}))},exports.requestSpeechToTextForMessage=function(e,t){return f().next((n=>n.requestSpeechToTextForMessage(e,t)))},exports.requestStreamMessageContent=function(e){return f().next((t=>t.sse.requestStreamMessageContent(e)))},exports.saveTextMessageDraft=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.saveTextMessageDraft(e,t)))}))},exports.searchConversationByContent=function(e,o,r,s){return n(this,void 0,void 0,(function*(){return i("searchConversationByContent","electronExtension.searchConversationByContent"),ce(e,null!=r?r:[t.MessageType.TEXT,t.MessageType.FILE],s,o)}))},exports.searchFriendsInfo=function(e){return f().next((t=>t.dataHosting.searchFriendsInfo(e)))},exports.searchGroupMembers=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.searchGroupMembers(e,t,o)))}))},exports.searchJoinedGroups=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.searchJoinedGroups(e,t)))}))},exports.searchMessages=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return i("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),pe(e,t,o,r)}))},exports.searchUserProfileByUniqueId=function(e){return f().next((t=>t.dataHosting.searchUserProfileByUniqueId(e)))},exports.sendFileMessage=z,exports.sendGIFMessage=Q,exports.sendHQVoiceMessage=K,exports.sendImageMessage=$,exports.sendMessage=q,exports.sendReadReceiptMessage=function(e,o,r,i){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceiptMessage({targetId:e,conversationType:t.ConversationType.PRIVATE,channelId:i},o,r)))}))},exports.sendReadReceiptMessageV4=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceiptMessageV4(e,t,o)))}))},exports.sendReadReceiptRequest=function(e,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceiptRequest({targetId:e,conversationType:t.ConversationType.GROUP,channelId:r},o)))}))},exports.sendReadReceiptResponse=function(e,t,o){return n(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))},exports.sendReadReceiptResponseV2=function(e,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendReadReceipt({targetId:e,conversationType:t.ConversationType.GROUP,channelId:r},o)))}))},exports.sendReadReceiptResponseV5=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((o=>n(this,void 0,void 0,(function*(){return o.sendReadReceiptResponseV5(e,t)}))))}))},exports.sendSightMessage=X,exports.sendSyncReadStatusMessage=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chat.sendSyncReadStatusMessage(e,t)))}))},exports.sendTextMessage=function(e,t,n){return q(e,new U(t),n)},exports.sendTypingStatusMessage=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chat.sendTypingStatus(e,t)))).trans(o)}))},exports.sendUltraGroupTypingStatus=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.chat.sendUltraGroupTypingStatus(e)))}))},exports.setAutoTranslateEnabled=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setAutoTranslateEnabled(e)))}))},exports.setChatRoomEntries=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.chatroom.setChatroomEntries(e,t)))).wipe()}))},exports.setChatRoomEntry=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.chatroom.setChatroomEntry(e,t,!1)))}))},exports.setConversationNotificationLevel=ue,exports.setConversationNotificationStatus=function(e,o){return n(this,void 0,void 0,(function*(){return f().next((r=>n(this,void 0,void 0,(function*(){if(o!==t.NotificationStatus.CLOSE&&o!==t.NotificationStatus.OPEN)return t.fail(t.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL);const n=t.trans2NotificationLevel(o);return r.batchSetConversationNotificationLevel([e],n)}))))}))},exports.setConversationToTop=de,exports.setConversationToTopInTag=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setConversationStatusInTag(e,t,{isTop:o})))}))},exports.setConversationTypeNotificationLevel=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setConversationTypeNotificationLevel(e,t)))}))},exports.setFriendAddPermission=function(e){return f().next((t=>t.dataHosting.setFriendAddPermission(e)))},exports.setFriendInfo=function(e,t,n){return f().next((o=>o.dataHosting.setFriendInfo(e,t||"",n)))},exports.setGroupMemberInfo=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.setGroupMemberInfo(e,t,o,r)))}))},exports.setGroupRemark=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.setGroupRemark(e,t)))}))},exports.setMessageReceivedStatus=function(e,t){return n(this,void 0,void 0,(function*(){return fe(e,t)}))},exports.setNotificationQuietHoursWithSetting=function(e){return f().next((t=>t.setNotificationQuietHoursWithSetting(e)))},exports.setProxy=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setProxy(e)))}))},exports.setTranslationLanguage=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.setTranslationLanguage(e)))}))},exports.setUltraGroupDefaultNotificationLevel=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.setUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)))}))},exports.stopUploadTask=function(e){return n(this,void 0,void 0,(function*(){return t.ok(function(e){const t=H[e];return!!t&&(t.abort(),!0)}(e))}))},exports.subscribeUserStatus=function(e,t,o){return n(this,void 0,void 0,(function*(){return f().next((n=>n.subscribeUser(e,t,o)))}))},exports.testProxy=function(e,t){return n(this,void 0,void 0,(function*(){return f().next((n=>n.testProxy(e,t)))}))},exports.transferGroupOwner=function(e,t,o,r){return n(this,void 0,void 0,(function*(){return f().next((n=>n.dataHosting.transferGroupOwner(e,t,!!o,r)))}))},exports.translateMessagesWithParams=function(e){return f().next((t=>t.translateMessagesWithParams(e)))},exports.translateTextsWithParams=function(e){return f().next((t=>t.translateTextsWithParams(e)))},exports.unSubscribeUserStatus=function(e,t){return n(this,void 0,void 0,(function*(){return(yield f().next((n=>n.unSubscribeUser(e,t)))).wipe()}))},exports.updateExpansionForUltraGroupMessage=function(e,t){return n(this,void 0,void 0,(function*(){return i("updateExpansionForUltraGroupMessage","updateMessageExpansion"),Z(e,t)}))},exports.updateGroupInfo=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.dataHosting.updateGroupInfo(e)))}))},exports.updateMessageExpansion=Z,exports.updateMyUserProfile=function(e){return f().next((t=>t.updateMyUserProfile(e)))},exports.updateMyUserProfileVisibility=function(e){return f().next((t=>t.dataHosting.updateMyUserProfileVisibility(e)))},exports.updateTag=function(e){return n(this,void 0,void 0,(function*(){return f().next((t=>t.updateTag(e)))}))},exports.upload=k;
|