@rongcloud/imlib-next 5.48.0-alpha.1 → 5.48.0
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.esm.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 Ci(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function Ni(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function Mi(t){const{conversationType:n,targetId:i,latestMessage:o,unreadMessageCount:r,hasMentioned:s,mentionedInfo:a,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:E,operationTime:h,draft:m,translateStrategy:p,editedMessageDraft:g,includeRobot:S,dataMgmtInfo:_}=t,I=o&&Ni(o);let T;T=s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0;const A={conversationType:n,targetId:i,latestMessage:I,unreadMessageCount:r,hasMentioned:s,mentionedInfo:T,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:E,operationTime:h,draft:m||"",translateStrategy:p,editedMessageDraft:g,includeRobot:S,dataMgmtInfo:_};return A.conversationType===e.ULTRA_GROUP&&(A.firstUnreadMessage=t.firstUnreadMessage,A.channelType=t.channelType,A.unreadMentionedMeCount=t.unreadMentionedMeCount),A}function Oi(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}var Ui;!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.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"}(Ui||(Ui={}));const yi=new t,Pi={connection(e,t){switch(e){case n.CONNECTED:yi.emit(Ui.CONNECTED);break;case n.CONNECTING:yi.emit(Ui.CONNECTING);break;case n.SUSPENDED:yi.emit(Ui.SUSPEND,t);break;case n.DISCONNECTED:yi.emit(Ui.DISCONNECT,t)}},batchMessage:e=>{yi.emit(Ui.MESSAGES,{messages:e.map((e=>Ni(e)))})},typingState:e=>{yi.emit(Ui.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,i)=>{yi.emit(Ui.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:(e,t,n)=>{yi.emit(Ui.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{yi.emit(Ui.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:t=>{const n=t.map((({conversation:t,updatedItems:n})=>{const{conversationType:i}=t,o=Mi(t);return i===e.ULTRA_GROUP&&(o.versionTime=t.versionTime,o.unreadMessageCount=Di(t.unreadMessageCount||0),o.unreadMentionedCount=Di(t.unreadMentionedCount||0),o.unreadMentionedMeCount=Di(t.unreadMentionedMeCount||0)),{conversation:o,updatedItems:n}}));yi.emit(Ui.CONVERSATION,{conversationList:n})},chatroomState:e=>{yi.emit(Ui.CHATROOM,e)},expansion:e=>{yi.emit(Ui.EXPANSION,e)},pullFinished:()=>{yi.emit(Ui.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{yi.emit(Ui.TAG)},userSettingsSynced:e=>{yi.emit(Ui.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{yi.emit(Ui.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{yi.emit(Ui.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{yi.emit(Ui.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{yi.emit(Ui.CONVERSATION_TAG)},messageBlocked:e=>{yi.emit(Ui.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{yi.emit(Ui.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{yi.emit(Ui.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{yi.emit(Ui.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{yi.emit(Ui.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>Ni(e))))},ultraGroupMessageRecalled:e=>{yi.emit(Ui.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>Ni(e))))},ultraGroupChannelChangeType:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{yi.emit(Ui.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{yi.emit(Ui.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{yi.emit(Ui.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{yi.emit(Ui.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{yi.emit(Ui.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{yi.emit(Ui.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{yi.emit(Ui.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{yi.emit(Ui.GROUP_OPERATION,e)},groupInfoChanged:e=>{yi.emit(Ui.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{yi.emit(Ui.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{yi.emit(Ui.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{yi.emit(Ui.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{yi.emit(Ui.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{yi.emit(Ui.FRIEND_ADDED,e)},friendDelete:e=>{yi.emit(Ui.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{yi.emit(Ui.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{yi.emit(Ui.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{yi.emit(Ui.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{yi.emit(Ui.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{yi.emit(Ui.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{yi.emit(Ui.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{yi.emit(Ui.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{yi.emit(Ui.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{yi.emit(Ui.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{yi.emit(Ui.TRANSLATE_RESPONSE,e)},messagesModified:e=>{yi.emit(Ui.MESSAGE_MODIFIED,e.map((e=>Ni(e))))},messageModifiedSyncCompleted:()=>{yi.emit(Ui.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{yi.emit(Ui.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){yi.emit(Ui.MESSAGE_REACTION_CHANGED,e)},streamMessageResponse(e){const t=Object.assign(Object.assign({},e),{message:e.message?Ni(e.message):void 0});yi.emit(Ui.STREAM_MESSAGE_RESPONSE,t)}};function Di(e){return e>999?999:e}i.add("imlib-next","5.48.0-alpha.1");let bi=null,Li=null,Gi=null;function xi(e){if(!bi)throw new Error("Not initialized yet!");return e(bi,Gi,Li)}const{setup:Fi}=o;function wi(e,t){return xi((n=>n.install(e,t)))}let Bi=0;const Hi=new Map;function ki(e,t){const n=(...e)=>{const i=[],o=[];[...Hi.values()].forEach((([e,t,r])=>{e===n&&(o.push(t),r&&i.push(r))})),i.forEach((t=>{e=t(e)}));const r=t(...e);return o.forEach((t=>{t(e,r)})),r};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}function Vi(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const i=++Bi;return Hi.set(i,[e,t,n]),i}function ji(e){Hi.delete(e)}function Yi(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Fi().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))}const zi=ki("disconnect",((e,t)=>xi((n=>n.disconnect(e,t)))));function $i(e,t,n){yi.on(e,t,n)}function qi(e,t,n){yi.once(e,t,n)}function Wi(e,t,n){yi.off(e,t,n)}function Xi(e){yi.removeAll(e)}function Qi(){yi.clear()}class Ki{constructor(e,t,n=!0,i=!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:i})}}class Ji extends Ki{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class Zi extends Ji{constructor(e){super(l.COMBINE,f(l.COMBINE),e)}}class eo extends Ji{constructor(e){super(l.COMBINE_V2,f(l.COMBINE_V2),e)}}class to extends Ji{constructor(e){super(l.COMMAND,f(l.COMMAND),e)}}class no extends Ji{constructor(e){super(l.FILE,f(l.FILE),e)}}class io extends Ji{constructor(e){super(l.GIF,f(l.GIF),e)}}const oo=l.GROUP_NOTIFICATION;class ro extends Ji{constructor(e){super(oo,f(oo),e)}}class so extends Ji{constructor(e){super(l.IMAGE,f(l.IMAGE),e)}}const ao=l.INFORMATION_NOTIFICATION;class uo extends Ji{constructor(e){super(ao,f(ao),e)}}class co extends Ji{constructor(e){super(l.LOCATION,f(l.LOCATION),e)}}class lo extends Ji{constructor(e){super(l.REFERENCE,f(l.REFERENCE),e)}}class fo extends Ji{constructor(e){super(l.RICH_CONTENT,f(l.RICH_CONTENT),e)}}class vo extends Ji{constructor(e){super(l.SIGHT,f(l.SIGHT),e)}}class Eo extends Ji{constructor(e){super(l.TEXT,f(l.TEXT),e)}}class ho extends Ji{constructor(e){super(l.HQ_VOICE,f(l.HQ_VOICE),e)}}class mo extends Ji{constructor(e){super(l.VOICE,f(l.VOICE),e)}}var po;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(po||(po={}));class go{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>v?Promise.resolve(E(h.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>m&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function So(e){return Math.ceil(e/1024)||0}const _o={[po.QINIU]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t),this._promise=p({url:g(this._url),headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:s}=yield this._promise.result();return this._promise=null,200===s||204===s?S({uniqueName:o.fileName,uploadMethod:_.QINIU}):E(h.UPLOAD_FAIL,s.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.ALIYUN]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=g(`${o.ossBucketName}.${this._url}`),s=new FormData;s.set("token",o.token),s.set("OSSAccessKeyId",o.osskeyId),s.set("policy",o.ossPolicy),s.set("Signature",o.ossSign),s.set("success_action_status","200"),s.set("key",o.fileName),s.set("file",t),this._promise=p({url:r,onProgress:e=>null==n?void 0:n(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?S({uniqueName:o.fileName,uploadMethod:_.ALI}):E(h.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.S3]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i,contentDisposition:o}=e;let r=this._authInfo;const s=g(`${r.s3BucketName}.${this._url}`),a=new FormData;o?a.set("Content-Disposition",o):a.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),a.set("Content-Type",t.type),a.set("x-amz-credential",r.s3Credential),a.set("x-amz-algorithm",r.s3Algorithm),a.set("x-amz-date",r.s3Date),a.set("policy",r.s3Policy),a.set("x-amz-signature",r.s3Signature),a.set("key",r.fileName),a.set("file",t),this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u,data:d}=yield this._promise.result();return this._promise=null,200===u||204===u?S({uniqueName:r.fileName,uploadMethod:_.AWS}):E(h.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.MINIO]:class extends go{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=>Ci(this,void 0,void 0,(function*(){var t;const{file:n,fileType:i}=e;let o=yield this._getFileToken(i,n.name,"POST","uploads",void 0,So(n.size));if(!o.isOk)return o.wipe();let r=o.data;const s=g(`${this._url}/${r.minioBucketName}/${r.fileName}`),a=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploads`,headers:a,method:"POST"});const{status:u,data:d}=yield this._promise.result();this._promise=null;const c=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1];if(200!==u&&204!==u||!c)return E(h.UPLOAD_FAIL,"start upload fail");const l=[],f=yield this.requestUploadPart(s,n,c,r.fileName,e,l);if(!f.isOk)return f.wipe();if(o=yield this._getFileToken(i,r.fileName,"POST",`uploadId=${c}`,void 0,So(n.size)),!o.isOk)return o.wipe();r=o.data;let v=l.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");v=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${v}</CompleteMultipartUpload>`;const m=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploadId=${c}`,headers:m,method:"POST",body:v,timeout:0});const{status:I}=yield this._promise.result();return this._promise=null,200===I||204===I?S({uniqueName:r.fileName,uploadMethod:_.MINIO}):E(h.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=g(`${this._url}/${o.minioBucketName}/${o.fileName}`),s=this.getBaseHeaders(t,o,e);this._promise=p({url:r,headers:s,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"PUT",body:t,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?S({uniqueName:o.fileName,uploadMethod:_.MINIO}):E(h.UPLOAD_FAIL,a.toString())}))}requestUploadPart(e,t,n,i,o,r){return Ci(this,arguments,void 0,(function*(e,t,n,i,o,r,s=1,a=0){if(a>=5)return E(h.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const u=(s-1)*m,d=Math.min(m,t.size-u),c=`partNumber=${s}&uploadId=${n}`,l=yield this._getFileToken(o.fileType,i,"PUT",c,void 0,So(t.size));if(!l.isOk)return l.wipe();const f=l.data,v=t.slice(u,s*m),g=this.getBaseHeaders(t,f,o);this._promise=p({url:`${e}?${c}`,headers:g,method:"PUT",body:v,timeout:0,onProgress:e=>{var n;return null===(n=null==o?void 0:o.onProgress)||void 0===n?void 0:n.call(o,u+e.loaded,t.size)}});const{status:_,xhr:I}=yield this._promise.result();return this._promise=null,200===_||204===_?(r.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+d<t.size?this.requestUploadPart(e,t,n,i,o,r,s+1,0):S()):this.requestUploadPart(e,t,n,i,o,r,s,a+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:i}=n;return{"Content-Disposition":`${i||("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()}},[po.RCX]:class extends go{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=>Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e,o=I.gen();let r=this._authInfo;return this._requestUploadPart(o,t,r.token,n)}))})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t);const s=g(this._url);this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:a,data:u}=yield this._promise.result();if(this._promise=null,(200===a||204===a)&&u){const e=JSON.parse(u);return S({uniqueName:e.rc_url.file_name,downloadUrl:`${s}/${e.rc_url.path}`,uploadMethod:_.QINIU})}return E(h.UPLOAD_FAIL,a.toString())}))}_requestUploadPart(e,t,n,i){return Ci(this,arguments,void 0,(function*(e,t,n,i,o=0){const r=Math.min(m,t.size-o),s=e+t.name.substring(t.name.lastIndexOf(".")),a={Range:`bytes=${o}-${o+r}`,"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(o,o+r),d=new FormData;d.set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n);const c=g(this._url);this._promise=p({url:c,headers:a,onProgress:e=>null==i?void 0:i(o+e.loaded,t.size),method:"POST",body:d,timeout:0});const{status:l,data:f}=yield this._promise.result();if(this._promise=null,200===l||204===l){if(o+r<t.size)return this._requestUploadPart(e,t,n,i,o+r);const s=JSON.parse(f);return S({uniqueName:s.rc_url.file_name,downloadUrl:`${c}/${s.rc_url.path}`,uploadMethod:_.QINIU})}return E(h.UPLOAD_FAIL,l.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function Io(e,t,n){const{promise:i,resolve:o}=A(),r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;return a.onload=e=>{const{maxHeight:i=160,maxWidth:u=160,quality:d=1,scale:c=1}=n||{},l=Ao(a.width,a.height,{maxHeight:i,maxWidth:u,scale:c});r.width=Math.min(l.w,u),r.height=Math.min(l.h,i),s.drawImage(a,l.x,l.y,l.w,l.h);let f=To(r,d);f=f.replace(/data:image\/[^;]+;base64,/,""),o(S(Object.assign(Object.assign({},t),{thumbnail:f,width:Math.ceil(l.w),height:Math.ceil(l.h)})))},a.onerror=e=>{o(E(h.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},a.src=(window.URL||window.webkitURL).createObjectURL(e),i}function To(e,t){let n=e.toDataURL("image/jpeg",t);return n.length>R-10240?To(e,t-.1):n}const Ao=(e,t,n)=>{const{maxHeight:i=160,maxWidth:o=160,scale:r=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>r?(s?(a=e/160,u=160,d=t/a,d>i&&(l=(d-i)/2)):(a=t/160,d=160,u=e/a,u>o&&(c=(u-o)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/i,d=i,u=e/a):(a=e/o,u=o,d=t/a),{w:u,h:d,x:-c,y:-l})};let Ro=0;class Co{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:++Ro}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,t,n,i){return Ci(this,arguments,void 0,(function*(e,t,n,i,o=[]){for(let r=0;r<e.length;r++){const s=e[r],a=_o[s.type];if(!a){o.push({type:s.type,url:s.url,code:h.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new a(s.url,n,i);const u=yield this._client.upload(t);if(u.isOk)return u;const{code:d}=u;if([h.RC_FILE_SIZE_EXCEED_LIMIT,h.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(u.code))return u;if(this._client.isAbort())return this._client=null,u;this._client=null,o.push({type:s.type,url:s.url,code:d,msg:u.msg})}return E(h.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(o)}`)}))}_handleUpload(e,t){return Ci(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:i,uploadServer:o,ossConfig:r}=t,{file:s,fileType:a,thumbnailConfig:u}=e,d=yield n(a,s.name,void 0,void 0,void 0,So(s.size));if(!d.isOk)return d.wipe();const c=d.data,l=function(e,t,n){if(t)return[{type:po.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:po.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 i=[];return n&&i.push({type:po.QINIU,url:n,p:"1"}),i}(c.ossConfig||r,i,o);if(0===l.length)return E(h.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:f,data:v,msg:m,isOk:p}=yield this._uploadInLoop(l,e,c,n);if(!p)return E(f,m);let{downloadUrl:g,uploadMethod:_}=v;if(!g){const e=yield t.getFileUrl(a,v.uniqueName,_,s.name);if(!e.isOk)return E(e.code,"Get download url fail");g=e.data.downloadUrl}if(!g)return E(h.UPLOAD_FAIL,"Get download url fail");const I={downloadUrl:g,uniqueName:(null==v?void 0:v.uniqueName)||"",name:s.name,size:s.size,type:s.type};if(a===T.AUDIO){return function(e,t){const n=new AudioContext({sampleRate:16e3}),{promise:i,resolve:o}=A();return n.decodeAudioData(e,(e=>{var n,i;o(S(Object.assign(Object.assign({},t),{duration:e.duration,length:e.length,sampleRate:null!==(n=e.sampleRate)&&void 0!==n?n:void 0,numberOfChannels:null!==(i=e.numberOfChannels)&&void 0!==i?i:void 0})))}),(e=>{o(E(h.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),i}(yield s.arrayBuffer(),I)}return a===T.IMAGE?Io(s,I,u):S(I)}))}awaitResult(){return Ci(this,void 0,void 0,(function*(){return this._promise}))}}const No={};function Mo(e,t){const n=new Co(e,t);return function(e){Ci(this,void 0,void 0,(function*(){No[e.id]=e,yield e.awaitResult(),delete No[e.id]}))}(n),n}const Oo=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:M,getFileUrl:N,customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function Uo(e){return Ci(this,void 0,void 0,(function*(){return Fi().next((t=>Ci(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:i,file:o}=e;return C.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(h.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",i,T,!0).fail(h.INVALID_PARAMETER_MEDIA_TYPE).validate("file",o,(e=>e instanceof File&&(!(i===T.IMAGE&&!e.type.match(/^image\//))&&!(i===T.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(h.MEDIA_EXCEPTION).result().trans((()=>Mo(e,Oo(t,t.getOptions().uploadDomain))))}))))}))}function yo(e){return Ci(this,void 0,void 0,(function*(){return S(function(e){const t=No[e];return!!t&&(t.abort(),!0)}(e))}))}function Po(e){return Ci(this,void 0,void 0,(function*(){const{contentDisposition:t,fileType:n,file:i}=e;return Fi().next((o=>Ci(this,void 0,void 0,(function*(){const r=yield C.create("upload").validate("contentDisposition",t,(e=>"inline"===e||"attachment"===e),!1).fail(h.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",n,T,!0).fail(h.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(n===T.IMAGE&&!e.type.match(/^image\//))&&!(n===T.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(h.MEDIA_EXCEPTION).result().next((()=>function(e,t){return Ci(this,void 0,void 0,(function*(){return new Co(e,t).awaitResult()}))}(e,Oo(o,o.getOptions().uploadDomain))));return r}))))}))}function Do(e,t,n,i){return M(e,t,n,i)}function bo(e){return Fi().next((t=>Ci(this,void 0,void 0,(function*(){return(yield C.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(h.INVALID_PARAMETER_MEDIA_URL).result().next((()=>M(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))}function Lo(e,t,n,i,o){return Ci(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?S(i):N(e,t,o||_.QINIU,n)}))}function Go(e,t){return Ci(this,void 0,void 0,(function*(){return(yield K(e,t)).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>Ni(e)))})))}))}function xo(e,t,n,i,o){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),Go(e,{keyword:t,limit:i||J,order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{objectNames:o}})}))}function Fo(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("setMessageReceivedStatus","setMessageReceivedStatusInfo"),Y(e,t)}))}function wo(e){return Ci(this,void 0,void 0,(function*(){return y(e)}))}function Bo(e,t,n){return Ci(this,void 0,void 0,(function*(){return D(e,t,n)}))}function Ho(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){return t instanceof Ki?function(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:"",messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,searchContent:o,messageDirection:X.SEND,isUnread:i,messageUId:"",disableUpdateLastMessage:r,quoteInfo:n.quoteInfo};return(yield Q(e,s)).trans(Ni)}))}(e,t,n):function(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:null==t?void 0:t.senderUserId,messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,messageDirection:null==t?void 0:t.messageDirection,readStatus:"object"==typeof(null==t?void 0:t.receivedStatusInfo)?z(t.receivedStatusInfo):null==t?void 0:t.receivedStatus,sentTime:null==t?void 0:t.sentTime,sentStatus:null==t?void 0:t.sentStatus,searchContent:o,messageUId:"",isUnread:i,disableNotification:null==t?void 0:t.disableNotification,canIncludeExpansion:null==t?void 0:t.canIncludeExpansion,expansion:(null==t?void 0:t.expansion)||void 0,directedUserIds:null==t?void 0:t.directedUserIds,disableUpdateLastMessage:(null==t?void 0:t.disableUpdateLastMessage)||r,quoteInfo:null==t?void 0:t.quoteInfo};return(yield Q(e,s)).trans(Ni)}))}(e,t,n)}))}function ko(e){return Ci(this,void 0,void 0,(function*(){return(yield x(e)).trans((e=>Ni(e)))}))}function Vo(e,t){return Ci(this,void 0,void 0,(function*(){Oi("getConversationList","getConversationListByTimestamp");return(yield fe({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(Mi)))}))}function jo(e){return Ci(this,void 0,void 0,(function*(){return(yield ue(e)).trans((e=>e.map(Mi)))}))}function Yo(e){return Ci(this,void 0,void 0,(function*(){return(yield ve(e)).trans((e=>e.map(Mi)))}))}function zo(e){return Ci(this,void 0,void 0,(function*(){return(yield le(e)).trans((e=>Mi(e)))}))}const $o=ki("removeConversation",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return ye(e,t)}))));function qo(e){return Ci(this,void 0,void 0,(function*(){return Oi("batchRemoveConversation","batchDeleteConversations"),Wo({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))}function Wo(e){return Ci(this,void 0,void 0,(function*(){return Z(e)}))}function Xo(e){return Ci(this,void 0,void 0,(function*(){return Ie(e)}))}function Qo(e,t){return Ci(this,void 0,void 0,(function*(){return De(e,t)}))}function Ko(e){return Ci(this,void 0,void 0,(function*(){return se(e)}))}function Jo(e,t){return Ci(this,void 0,void 0,(function*(){return Ae(t,e)}))}function Zo(e,t){return Ci(this,void 0,void 0,(function*(){return Re(e,t)}))}function er(e,t){return Ci(this,void 0,void 0,(function*(){return Re(e,t,!0)}))}function tr(e){return Ci(this,void 0,void 0,(function*(){return Ne(e)}))}const nr=ki("clearMessagesUnreadStatus",(e=>Ci(void 0,void 0,void 0,(function*(){return oe(e)}))));function ir(){return Ci(this,void 0,void 0,(function*(){return ie()}))}const or=ki("setConversationNotificationLevel",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return ee([e],t)}))));function rr(e,t){return Ci(this,void 0,void 0,(function*(){return ee(e,t)}))}function sr(e,t){return Ci(this,void 0,void 0,(function*(){return ne(e,t)}))}function ar(e,t){return Ci(this,void 0,void 0,(function*(){return Fi().next((n=>Ci(this,void 0,void 0,(function*(){if(t!==be.CLOSE&&t!==be.OPEN)return E(h.INVALID_PARAMETER_NOTIFICATION_LEVEL);const n=Le(t);return ee([e],n)}))))}))}function ur(e){return Ci(this,void 0,void 0,(function*(){return Ee(e)}))}function dr(e){return Ci(this,void 0,void 0,(function*(){return(yield Ee(e)).trans((e=>he(e)))}))}function cr(){return Ci(this,void 0,void 0,(function*(){return(yield ce()).trans((e=>e.map(Mi)))}))}function lr(e,t){return Ci(this,void 0,void 0,(function*(){return Ge(e,t)}))}function fr(e){return Ci(this,void 0,void 0,(function*(){return me(e)}))}const vr=ki("setConversationToTop",((e,...t)=>Ci(void 0,[e,...t],void 0,(function*(e,t=!0,n=!0,i=!1){return te([e],!!t,n,i)}))));function Er(e,t){return Ci(this,arguments,void 0,(function*(e,t,n=!0,i=!0){return te(e,!!t,i,n)}))}function hr(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Te(e,t)).trans((e=>e.map(Mi)))}))}function mr(e){return Ci(this,void 0,void 0,(function*(){return(yield Ce(e)).trans((e=>e.map(Mi)))}))}function pr(e){return Ci(this,void 0,void 0,(function*(){return Oe(e)}))}function gr(){return Ci(this,void 0,void 0,(function*(){return de()}))}function Sr(e){return Ci(this,void 0,void 0,(function*(){var t,n,i;return(yield _e(null!==(t=null==e?void 0:e.count)&&void 0!==t?t:30,null!==(n=null==e?void 0:e.startTime)&&void 0!==n?n:0,null!==(i=null==e?void 0:e.order)&&void 0!==i?i:0)).trans((e=>e.map(Mi)))}))}function _r(){return Ci(this,void 0,void 0,(function*(){return ge()}))}function Ir(e){return Ci(this,void 0,void 0,(function*(){return re(e)}))}function Tr(e){return Ci(this,void 0,void 0,(function*(){return Pe(e)}))}function Ar(e){return Ci(this,void 0,void 0,(function*(){return Se(e)}))}function Rr(e){return Ci(this,void 0,void 0,(function*(){return(yield Me(e)).trans((e=>e.map(Mi)))}))}function Cr(e){return Ci(this,void 0,void 0,(function*(){return ae(e)}))}function Nr(e){return Ci(this,void 0,void 0,(function*(){return(yield pe(e)).trans((e=>e.map(Mi)))}))}function Mr(e){return Ci(this,void 0,void 0,(function*(){return Ue(e)}))}function Or(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return(yield Ve(e,t,n,i)).trans((e=>e.map((e=>Mi(e)))))}))}const Ur=ko,yr=ki("sendMessage",((e,t,n)=>Ci(void 0,void 0,void 0,(function*(){const{disableNotification:i,isMentioned:o,directionalUserIdList:r,canIncludeExpansion:s,onSendBefore:a,expansion:u,pushConfig:d,isStatusMessage:l,disableUpdateLastMessage:f}=n||{},v=function(e,t){const{disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:E,disableUpdateLastMessage:h,needReceipt:m,quoteInfo:p}=e;return Object.assign({disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:E,disableUpdateLastMessage:h,needReceipt:m,quoteInfo:p},t)}(n||{},t),h=Object.assign(Object.assign({},e),{isMentioned:!!o,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!i,canIncludeExpansion:!!s,expansion:u||null,senderUserId:"",messageUId:"",messageDirection:X.SEND,receivedTime:0,isStatusMessage:!!l,receivedStatus:Rt.UNREAD,isOffLineMessage:!1,pushConfig:d,sentStatus:At.SENDING,sentTime:0,directedUserIds:r||[],disableUpdateLastMessage:f,quoteInfo:v.quoteInfo}),m=yield Fi().next((t=>{h.senderUserId=t.getCurrentUserId();return t.sendMessage(e,v,(e=>{h.messageId=e;try{a&&a(Ni(h))}catch(e){t.logger.error(c.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return m.isOk?m.trans((e=>Ni(e))):(h.sentStatus=At.FAILED,E(m.code,m.msg,Ni(h)))}))));function Pr(e,t,n){return yr(e,new Eo(t),n)}function Dr(e,t){return(n,i,o,r)=>Ci(this,void 0,void 0,(function*(){var a;const u=Fi();if(!u.isOk)return u.wipe();const d=u.data;if(!je("sendOptions.contentDisposition",null==r?void 0:r.contentDisposition,(e=>["inline","attachment"].includes(e))))return E(h.INVALID_PARAMETER_SENDOPTIONS);const c={contentDisposition:null==r?void 0:r.contentDisposition};if(r&&"thumbnailConfig"in r){const e=null==r?void 0:r.thumbnailConfig;if(!(je("sendOptions.maxHeight",null==e?void 0:e.maxHeight,s.NUMBER)&&je("sendOptions.maxWidth",null==e?void 0:e.maxWidth,s.NUMBER)&&je("sendOptions.quality",null==e?void 0:e.quality,s.NUMBER)&&je("sendOptions.scale",null==e?void 0:e.scale,s.NUMBER)))return E(h.INVALID_PARAMETER_SENDOPTIONS);c.thumbnailConfig=e}const{logger:l}=d,f=l.createTraceId();l.info("L-media_upload-T",JSON.stringify({filesize:i.file.size,type:e}),f);const v=yield Po({file:i.file,fileType:e,onProgress:(e,t)=>{var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig}),{code:m,data:p,msg:g}=v;if(m===h.SUCCESS&&p){const e=(null===(a=null==o?void 0:o.onComplete)||void 0===a?void 0:a.call(o,Object.assign({url:p.downloadUrl},p)))||t(p,i);return l.info("L-media_upload-R",JSON.stringify({downurl:p.downloadUrl,code:h.SUCCESS}),f),yr(n,e,r)}return E(m,g)}))}const br=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},Lr=Dr(T.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:br(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 no(n)})),Gr=Dr(T.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 so(n)})),xr=Dr(T.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 io(n)})),Fr=Dr(T.AUDIO,((e,t)=>{var n;const i={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(i.user=t.user),t.extra&&(i.extra=t.extra),t.mentionedInfo&&(i.mentionedInfo=t.mentionedInfo),t.audit&&(i.audit=t.audit),new ho(i)})),wr=Dr(T.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 vo(n)}));function Br(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Ke(e,t)).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>Ni(e)))})))}))}function Hr(e,t){return Ci(this,void 0,void 0,(function*(){return(yield st(e,t)).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>Ni(e)))})))}))}function kr(t,n,i,o){return Ci(this,void 0,void 0,(function*(){return vt({targetId:t,conversationType:e.PRIVATE,channelId:o},n,i)}))}function Vr(t,n,i){return Ci(this,void 0,void 0,(function*(){return ht({targetId:t,conversationType:e.GROUP,channelId:i},n)}))}function jr(e,t,n){return Ci(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}function Yr(t,n,i){return Ci(this,void 0,void 0,(function*(){return mt({targetId:t,conversationType:e.GROUP,channelId:i},n)}))}function zr(e,t){return Ci(this,void 0,void 0,(function*(){return gt(e,t)}))}function $r(e,t,n){return Ci(this,void 0,void 0,(function*(){return Et(e,t,n)}))}function qr(e,t){return Ci(this,void 0,void 0,(function*(){return tt(e,t)}))}function Wr(e,t){return Ci(this,void 0,void 0,(function*(){return ze(e,t)}))}Dr(T.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 Zi(n)}));const Xr=ki("recallMessage",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return(yield ut(e,t)).trans((e=>Ni(e)))}))));function Qr(e,t){return Ci(this,void 0,void 0,(function*(){return We(e,t)}))}function Kr(e,t){return Ci(this,void 0,void 0,(function*(){return $e(e,t)}))}function Jr(e,t){return Ci(this,void 0,void 0,(function*(){return Ye(e,t)}))}function Zr(e,t){return Ci(this,void 0,void 0,(function*(){return Tt(e,t)}))}function es(e,t){return Ci(this,void 0,void 0,(function*(){return ct(e,t)}))}function ts(e,t){return Ci(this,void 0,void 0,(function*(){return(yield St(e,t)).trans(Ni)}))}function ns(e,t,n){return Ci(this,void 0,void 0,(function*(){return nt(e,t,n)}))}function is(e,t,n,i,o){return xi(((a,u)=>(r("messageType",e,s.STRING,!0),r("isPersited",t,s.BOOLEAN,!0),r("isCounted",n,s.BOOLEAN,!0),r("isStatusMessage",o,s.BOOLEAN),r("searchProps",i,s.ARRAY),u.info("A-regtyp-O",JSON.stringify({messageType:e,isCounted:n,isStatusMessage:o,isPersited:t,searchProps:i})),a.registerMessageType(e,t,n,i,o),function(e,t=!0,n=!0){return function(i){return new Ki(e,i,t,n)}}(e,t,n))))}function os(e){return Ci(this,void 0,void 0,(function*(){return(yield Xe(e)).trans((e=>e?Ni(e):null))}))}function rs(e){return Ci(this,void 0,void 0,(function*(){return Qe(e)}))}function ss(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){return Oi("insertMessage","electronExtension.insertMessage"),Ho(e,t,n)}))}function as(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")}function us(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),xo(e,t,n,i)}))}function ds(e,t,n){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),Bo(e,t,n)}))}function cs(e){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),wo(e)}))}function ls(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Oi("searchConversationByContent","electronExtension.searchConversationByContent"),Or(e,null!=n?n:[l.TEXT,l.FILE],i,t)}))}function fs(e,t){return Ci(this,void 0,void 0,(function*(){return qe(e,t)}))}function vs(e,t){return Ci(this,void 0,void 0,(function*(){return Fo(e,t)}))}function Es(e){return ft(e)}function hs(e,t){return Ci(this,void 0,void 0,(function*(){return pt(e,t)}))}function ms(e,t){return Ci(this,void 0,void 0,(function*(){return Ze(e,t)}))}function ps(e){return Ci(this,void 0,void 0,(function*(){return et(e)}))}function gs(e,t,n){return Ci(this,void 0,void 0,(function*(){return rt(e,t,n)}))}function Ss(e,t,n){return Ci(this,void 0,void 0,(function*(){return ot(e,t,n)}))}function _s(e,t){return lt(e,t)}function Is(e){return _t(e)}function Ts(e){return It(e)}function As(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("modifyMessage","modifyMessageWithParams"),Rs({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}})}))}function Rs(e){return at(e)}function Cs(e){const t=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?Ni(e.message):void 0,code:e.code})));return dt(Object.assign(Object.assign({},e),{remoteMessageBlock:n=>{e.remoteMessageBlock&&e.remoteMessageBlock(t(n))},localMessageBlock:n=>{e.localMessageBlock&&e.localMessageBlock(t(n))}}))}function Ns(e){return Ci(this,void 0,void 0,(function*(){return(yield it(e.conversationIdentifier,e.messageUIds)).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?Ni(e.message):void 0,code:e.code})))))}))}function Ms(e,t){return Ci(this,void 0,void 0,(function*(){return Je(e,t)}))}function Os(e){return Ci(this,void 0,void 0,(function*(){return(yield Ot(e)).trans((e=>e))}))}function Us(){return Ci(this,void 0,void 0,(function*(){return(yield Ct()).trans((e=>e.map((e=>Mi(e)))))}))}function ys(e){return Ci(this,void 0,void 0,(function*(){return Lt(e)}))}function Ps(e,t){return Ci(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t.map((e=>null==e?void 0:e.messageUId)):t;return(yield Ut(e,n)).trans((e=>{const n={};return e.forEach((e=>{n[e.messageUId]=Ni(e)})),t.forEach((({messageUId:e})=>{e in n||(n[e]=void 0)})),n}))}))}function Ds(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("updateExpansionForUltraGroupMessage","updateMessageExpansion"),Zr(e,t)}))}function bs(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),es(e,t)}))}function Ls(e){return Ci(this,void 0,void 0,(function*(){return bt(e)}))}function Gs(e,t){return Ci(this,void 0,void 0,(function*(){return yt(e,t,!0)}))}function xs(e){return Ci(this,void 0,void 0,(function*(){return Nt(null==e?void 0:e.targetId,null==e?void 0:e.channelId)}))}function Fs(e,t){return Ci(this,void 0,void 0,(function*(){return Gt(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)}))}function ws(e,t){return Ci(this,void 0,void 0,(function*(){return yt(e,t,!1)}))}function Bs(){return Ci(this,void 0,void 0,(function*(){return Oi("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),Zo([e.ULTRA_GROUP],[])}))}function Hs(){return Ci(this,void 0,void 0,(function*(){return Oi("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),er([e.ULTRA_GROUP],[])}))}function ks(e){return Ci(this,void 0,void 0,(function*(){return Dt(e)}))}function Vs(t){return Ci(this,void 0,void 0,(function*(){return Mt(Object.assign(Object.assign({},t),{conversationType:e.ULTRA_GROUP}))}))}function js(e){return Ci(this,void 0,void 0,(function*(){return Pt(e)}))}function Ys(e){return Ci(this,void 0,void 0,(function*(){return xt(e)}))}function zs(e){return Ci(this,void 0,void 0,(function*(){return Bt(e)}))}function $s(){return Ci(this,void 0,void 0,(function*(){return Ft()}))}function qs(e){return Ci(this,void 0,void 0,(function*(){return(yield wt(e)).trans((e=>0===e))}))}function Ws(e){return Ci(this,void 0,void 0,(function*(){return kt(e)}))}function Xs(e){return Ci(this,void 0,void 0,(function*(){return qt(e)}))}function Qs(e){return Ci(this,void 0,void 0,(function*(){return Qt(e)}))}function Ks(){return Ci(this,void 0,void 0,(function*(){return jt()}))}function Js(e){return Ci(this,void 0,void 0,(function*(){return Yt(e)}))}function Zs(e,t){return Ci(this,void 0,void 0,(function*(){return Ht(e,t)}))}function ea(e,t){return Ci(this,void 0,void 0,(function*(){return $t(e,t)}))}function ta(e,t){return Ci(this,void 0,void 0,(function*(){return Wt(e,t)}))}function na(e,t){return Ci(this,void 0,void 0,(function*(){return $t(e,t)}))}function ia(e,t,n){return Ci(this,void 0,void 0,(function*(){Oi("getConversationsFromTagByPage","createConversationListLoader");return(yield Vt(e,n,t)).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},Mi(t)),{isTopInTag:t.isTopInTag});var t}))))}))}function oa(e,t){return Ci(this,void 0,void 0,(function*(){return zt(e,t)}))}function ra(e,t,n){return Ci(this,void 0,void 0,(function*(){return Xt(e,t,{isTop:n})}))}var sa=Object.freeze({__proto__:null,batchClearMessagesByTimestamp:function(e){return Ci(this,void 0,void 0,(function*(){return O(e)}))},batchInsertMessage:function(e,t){return Ci(this,void 0,void 0,(function*(){return U(e,t)}))},clearEditedMessageDraft:function(e){return Ci(this,void 0,void 0,(function*(){return xe(e)}))},clearLocalData:function(){return Ci(this,void 0,void 0,(function*(){return Kt()}))},clearMessages:wo,deleteMessages:function(e){return Ci(this,void 0,void 0,(function*(){return P(e)}))},deleteMessagesByTimestamp:Bo,deleteUltraGroupMessagesForAllChannel:function(e,t){return b(e,t)},enable:function(){return Jt()},getAllConversationList:function(e){return Ci(this,void 0,void 0,(function*(){return Oi("electronExtension.getAllConversationList","getAllConversationList"),jo(e)}))},getContinuousMessages:function(e,t){return Ci(this,void 0,void 0,(function*(){return(yield L(e,t)).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(Ni),timestamp:n})))}))},getConversationList:function(e,t,n,i){return Ci(this,void 0,void 0,(function*(){Oi("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield fe({startTime:e,count:t,channelId:n,topPriority:i})).trans((e=>e.map((e=>Mi(e)))))}))},getConversations:function(e){return Ci(this,void 0,void 0,(function*(){return(yield Fe(e)).trans((e=>e.map(Mi)))}))},getEditedMessageDraft:function(e){return Ci(this,void 0,void 0,(function*(){return we(e)}))},getHistoryMessagesByMessageTypes:function(e,t){return Ci(this,void 0,void 0,(function*(){return(yield G(e,t)).trans((({list:e,hasMore:t})=>{const n=e.map(Ni);return{messages:n,hasMore:t,list:n}}))}))},getLocalMessage:ko,getMessageCount:function(e){return Ci(this,void 0,void 0,(function*(){return F(e)}))},getMessagesAroundTimestamp:function(e,t){return Ci(this,void 0,void 0,(function*(){const n=null==t?void 0:t.timestamp,i=null==t?void 0:t.beforeCount,o=null==t?void 0:t.afterCount;return(yield w(e,n,i,o)).trans((e=>e.map(Ni)))}))},getRemoteConversations:function(){return Ci(this,void 0,void 0,(function*(){return Be()}))},getUnreadMentionedMessages:function(e){return Ci(this,void 0,void 0,(function*(){return(yield B(e)).trans((e=>e.map(Ni)))}))},getUntaggedConversationListByPage:function(e,t,n){return Ci(this,void 0,void 0,(function*(){return(yield He(e,t,n)).trans((e=>e.map((e=>Mi(e)))))}))},insertMessage:Ho,saveEditedMessageDraft:function(e,t){return Ci(this,void 0,void 0,(function*(){return ke(e,t)}))},searchConversationByContent:Or,searchMessageInTimeRange:function(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),Go(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}})}))},searchMessages:xo,searchMessagesByUser:function(e,t,n,i){return Ci(this,void 0,void 0,(function*(){Oi("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield Go(e,{limit:i,keyword:"",order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},searchMessagesWithParams:function(e){return Ci(this,void 0,void 0,(function*(){return(yield H(e)).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>Ni(e)))})))}))},setCheckChatRoomDuplicateMessage:function(e){return Ci(this,void 0,void 0,(function*(){return k(!!e)}))},setCheckDuplicateMessage:function(e){return Ci(this,void 0,void 0,(function*(){return V(e)}))},setMessageContent:function(e,t,n){return Ci(this,void 0,void 0,(function*(){return j(e,t,n)}))},setMessageReceivedStatus:Fo,setMessageReceivedStatusInfo:function(e,t){return Ci(this,void 0,void 0,(function*(){const n=z(t||{});return Y(e,n)}))},setMessageSentStatus:function(e,t){return Ci(this,void 0,void 0,(function*(){return $(e,t)}))},setMessageSpeechToTextVisible:function(e,t){return q(e,t)},setMessageStatusToRead:function(e,t){return Ci(this,void 0,void 0,(function*(){return W(e,t)}))}});function aa(e){return Ci(this,void 0,void 0,(function*(){return en(e)}))}function ua(){return Ci(this,void 0,void 0,(function*(){return Zt()}))}function da(e,t){return Ci(this,void 0,void 0,(function*(){return tn(e,t)}))}function ca(e,t,n){return Ci(this,void 0,void 0,(function*(){return cn(e,t,n)}))}function la(e,t){return Ci(this,void 0,void 0,(function*(){return(yield ln(e,t)).wipe()}))}function fa(e,t,n){return Ci(this,void 0,void 0,(function*(){return rn(e,t,n)}))}function va(e,t){return Ci(this,void 0,void 0,(function*(){return sn(e,t)}))}function Ea(e){return fn(e)}function ha(e){return un(e)}function ma(){return nn()}function pa(e){return vn(e)}function ga(){return on()}function Sa(e){return dn(e)}function _a(e){return an(e)}function Ia(e,t){return Ci(this,void 0,void 0,(function*(){return gn(e,t)}))}function Ta(e){return Ci(this,void 0,void 0,(function*(){return Hn(e)}))}function Aa(e){return Ci(this,void 0,void 0,(function*(){return Rn(e)}))}function Ra(e,t,n){return Ci(this,void 0,void 0,(function*(){return Un(e,t,n)}))}function Ca(e,t){return Ci(this,void 0,void 0,(function*(){return yn(e,t)}))}function Na(e){return Ci(this,void 0,void 0,(function*(){return Sn(e)}))}function Ma(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Bn(e,t,!!n,i)}))}function Oa(e,t){return Ci(this,void 0,void 0,(function*(){return pn(e,t)}))}function Ua(e,t){return Ci(this,void 0,void 0,(function*(){return Ln(e,t)}))}function ya(e,t,n){return Ci(this,void 0,void 0,(function*(){return An(e,t,n)}))}function Pa(e,t){return Ci(this,void 0,void 0,(function*(){return Tn(e,t)}))}function Da(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Fn(e,t,n,i)}))}function ba(e,t,n){return Ci(this,void 0,void 0,(function*(){return Gn(e,t,n)}))}function La(e){return Ci(this,void 0,void 0,(function*(){return On(e)}))}function Ga(e,t){return Ci(this,void 0,void 0,(function*(){return Mn(e,t)}))}function xa(e,t){return Ci(this,void 0,void 0,(function*(){return(yield hn(e,t)).wipe()}))}function Fa(e,t,n){return Ci(this,void 0,void 0,(function*(){return(yield Dn(e,t,n)).wipe()}))}function wa(e,t,n){return Ci(this,void 0,void 0,(function*(){return En(e,t,n)}))}function Ba(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return(yield Pn(e,t,n,i)).wipe()}))}function Ha(e,t,n){return Ci(this,void 0,void 0,(function*(){return _n(e,t,n)}))}function ka(e,t){return Ci(this,void 0,void 0,(function*(){return Nn(t,e)}))}function Va(e,t){return Ci(this,void 0,void 0,(function*(){return xn(e,t)}))}function ja(e){return Ci(this,void 0,void 0,(function*(){return Cn(e)}))}function Ya(e,t){return Ci(this,void 0,void 0,(function*(){return wn(e,t)}))}function za(e,t){return Ci(this,void 0,void 0,(function*(){return mn(e,t)}))}function $a(e,t){return Ci(this,void 0,void 0,(function*(){return bn(e,t)}))}function qa(e){return Ci(this,void 0,void 0,(function*(){return In(e)}))}function Wa(e,t,n){return Vn(e,t,n)}function Xa(e,t){return Yn(e,t)}function Qa(e){return kn(e)}function Ka(e){return Xn(e)}function Ja(e,t,n){return Jn(e,t||"",n)}function Za(e,t){return jn(e,t)}function eu(e,t){return qn(e,t)}function tu(e,t,n){return $n(e,t,n)}function nu(e){return Wn(e)}function iu(e){return Qn(e)}function ou(e){return Kn(e)}function ru(){return zn()}function su(e){!function(e){var t,n,i;bi?Gi.warn(c.A_INIT_REPEAT_O):(r("options.appkey",e.appkey,s.STRING,!0),r("options.navigators",e.navigators,(e=>a(e)&&(0===e.length||e.every(u)))),r("options.loggerProxy",e.loggerProxy,(e=>e instanceof d)),Li=e,bi=o.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!==(t=e.environment)&&void 0!==t?t:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null===(n=e.enableReadReceiptStorage)||void 0===n||n,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),Gi=bi.logger,bi.assignWatcher(Pi))}(e)}function au(){return Ci(this,void 0,void 0,(function*(){return Qi(),function(){return Ci(this,void 0,void 0,(function*(){bi&&(yield o.destroy(),Li=null,bi=null,Gi=null)}))}()}))}function uu(){return xi((e=>e.getConnectionStatus()))}function du(){return xi((e=>e.getServerTime()))}function cu(){return xi((e=>e.getCurrentUserId()))}function lu(e,t){i.add(e,t)}function fu(){return xi((e=>e.getDeviceId()))}function vu(){const e=Zn();return e.isOk?e.data:null}const Eu={COMET:"_",WEBSOCKET:"_"};function hu(e){return ni(e)}function mu(){return ti()}function pu(){return ei()}function gu(e,t){return Ci(this,void 0,void 0,(function*(){return(yield ci(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)).wipe()}))}function Su(e,t){return Ci(this,void 0,void 0,(function*(){return ci(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)}))}function _u(e,t){return Ci(this,void 0,void 0,(function*(){return li(e,t)}))}function Iu(e,t){return Ci(this,void 0,void 0,(function*(){return ui(e,null==t?void 0:t.count,null==t?void 0:t.order)}))}function Tu(e,t){return Ci(this,void 0,void 0,(function*(){return ri(e,t,!1)}))}function Au(e,t){return Ci(this,void 0,void 0,(function*(){return(yield vi(e,t)).wipe()}))}function Ru(e,t){return Ci(this,void 0,void 0,(function*(){return ri(e,t,!0)}))}function Cu(e,t){return Ci(this,void 0,void 0,(function*(){return oi(e,t,!1)}))}function Nu(e,t){return Ci(this,void 0,void 0,(function*(){return fi(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})}))}function Mu(e,t){return Ci(this,void 0,void 0,(function*(){return oi(e,t,!0)}))}function Ou(e,t){return Ci(this,void 0,void 0,(function*(){return ai(e,t)}))}function Uu(e){return Ci(this,void 0,void 0,(function*(){return si(e)}))}function yu(e,t){return Ci(this,void 0,void 0,(function*(){return(yield di(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=>Ni(e)))})))}))}function Pu(e){return Ci(this,void 0,void 0,(function*(){return ii(e)}))}function Du(e){return Ci(this,void 0,void 0,(function*(){return pi(e)}))}function bu(){return Ci(this,void 0,void 0,(function*(){return hi()}))}function Lu(e){return Ci(this,void 0,void 0,(function*(){return mi(e)}))}function Gu(){return Ci(this,void 0,void 0,(function*(){return Ei()}))}function xu(){return gi()}function Fu(e){return Si(e)}function wu(e){return _i(e)}function Bu(e){return Ri(e)}function Hu(e){return Ii(e)}function ku(e){return Ai(e)}function Vu(e){return Ti(e)}export{Ki as BaseMessage,Zi as CombineMessage,eo as CombineV2Message,to as CommandMessage,Eu as ConnectType,Ui as Events,no as FileMessage,io as GIFMessage,ro as GroupNotificationMessage,ho as HQVoiceMessage,so as ImageMessage,uo as InformationNotificationMessage,co as LocationMessage,lo as ReferenceMessage,fo as RichContentMessage,vo as SightMessage,Eo as TextMessage,Co as UploadTask,mo as VoiceMessage,lu as __addSDKVersion,Qa as acceptFriendApplication,wa as acceptGroupApplication,xa as acceptGroupInvite,Zs as addConversationsToTag,$i as addEventListener,Wa as addFriend,za as addGroupFollows,Oa as addGroupManagers,wu as addMessageReaction,Vi as addMonitor,Ws as addTag,Ys as addToBlacklist,Jr as batchClearRemoteHistoryMessages,Wo as batchDeleteConversations,Hu as batchGetMessageReactionSummaries,Wr as batchGetMessageReadReceiptInfoV4,qo as batchRemoveConversation,rr as batchSetConversationNotificationLevel,Er as batchSetConversationToTop,sr as batchSetConversationTranslateStrategy,Pu as bindRTCRoomForChatroom,Za as checkFriends,ir as clearAllMessagesUnreadStatus,Qi as clearEventListeners,Kr as clearHistoryMessages,cs as clearMessages,nr as clearMessagesUnreadStatus,Ir as clearRealtimeConUnreadCount,Ko as clearTextMessageDraft,fs as clearUnreadCountByTimestamp,Yi as connect,Cr as createConversationListLoader,Ia as createGroup,Uo as createUploadTask,Xa as deleteFriends,ds as deleteLocalMessagesByTimestamp,Qr as deleteMessages,au as destroy,zi as disconnect,Na as dismissGroup,sa as electronExtension,Mu as forceRemoveChatRoomEntry,Ru as forceSetChatRoomEntry,Uu as getAllChatRoomEntries,jo as getAllConversationList,xu as getAllRobots,Bs as getAllUltraGroupUnreadCount,Hs as getAllUltraGroupUnreadMentionedCount,gr as getAllUnreadMentionedCount,vu as getAppSettings,Gu as getAutoTranslateEnabled,$s as getBlacklist,qs as getBlacklistStatus,Us as getBlockUltraGroupList,cr as getBlockedConversationList,Ou as getChatRoomEntry,Iu as getChatRoomInfo,yu as getChatroomHistoryMessages,uu as getConnectionStatus,zo as getConversation,Vo as getConversationList,Yo as getConversationListByTimestamp,ur as getConversationNotificationLevel,dr as getConversationNotificationStatus,fr as getConversationTypeNotificationLevel,ia as getConversationsFromTagByPage,Nr as getConversationsIncludingRobots,cu as getCurrentUserId,fu as getDeviceId,bo as getDownloadAuth,Do as getFileToken,Lo as getFileUrl,os as getFirstUnreadMessage,rs as getFirstUnreadMessageInfo,ru as getFriendAddPermission,tu as getFriendApplications,eu as getFriends,nu as getFriendsInfo,Ha as getGroupApplications,qa as getGroupFollows,Pa as getGroupMembers,ya as getGroupMembersByRole,Aa as getGroupsInfo,Br as getHistoryMessages,ja as getJoinedGroups,ka as getJoinedGroupsByRole,Ur as getMessage,Ms as getMessageCountDetail,Vu as getMessageReactionUsers,ku as getMessageReactions,ms as getMessageReadReceiptInfoV5,ps as getMessageReadReceiptInfoV5ByIdentifiers,qr as getMessageReadReceiptV4,ns as getMessageReader,Ns as getMessagesByUIds,Ss as getMessagesReadReceiptByUsersV5,gs as getMessagesReadReceiptUsersByPageV5,ma as getMyUserProfile,ga as getMyUserProfileVisibility,pu as getNotificationQuietHoursSetting,ua as getProxy,_r as getRealtimeConTotalUnreadCount,Ar as getRealtimeConUnreadCounts,Sr as getRealtimeConversations,Hr as getRemoteHistoryMessages,Fu as getRobotById,du as getServerTime,fa as getSubscribeUserList,va as getSubscribeUserStatus,_a as getSubscribeUsersOnlineStatus,Ks as getTags,Js as getTagsFromConversation,Xo as getTextMessageDraft,hr as getTopConversationList,Jo as getTotalUnreadCount,Zo as getTotalUnreadCountByLevels,er as getTotalUnreadMentionedCountByLevels,bu as getTranslationLanguage,xs as getUltraGroupDefaultNotificationLevel,Vs as getUltraGroupFirstUnreadMessageTimestamp,Os as getUltraGroupList,Ps as getUltraGroupMessageListByMessageUId,ws as getUltraGroupUnreadCountByTargetId,js as getUltraGroupUnreadInfoList,Gs as getUltraGroupUnreadMentionedCountByTargetId,ks as getUltraGroupUnreadMentionedMessages,mr as getUnreadConversationList,tr as getUnreadCount,oa as getUnreadCountByTag,Rr as getUnreadMentionMeConversationList,pr as getUnreadMentionedCount,as as getUnreadMentionedMessages,ha as getUserProfiles,su as init,ss as insertMessage,wi as installPlugin,Ga as inviteUsersToGroup,gu as joinChatRoom,Su as joinExistChatRoom,La as joinGroup,Ra as kickGroupMembers,Mr as markRemoteConversationAsRead,As as modifyMessage,Rs as modifyMessageWithParams,qi as onceEventListener,_u as quitChatRoom,Ca as quitGroup,Xr as recallMessage,Cs as refreshReferenceMessageWithParams,Ka as refuseFriendApplication,Ba as refuseGroupApplication,Fa as refuseGroupInvite,is as registerMessageType,Ls as removeAllExpansionForUltraGroupMessage,Nu as removeChatRoomEntries,Cu as removeChatRoomEntry,$o as removeConversation,ea as removeConversationsFromTag,Wi as removeEventListener,Xi as removeEventListeners,bs as removeExpansionForUltraGroupMessage,zs as removeFromBlacklist,$a as removeGroupFollows,Ua as removeGroupManagers,es as removeMessageExpansionForKey,Bu as removeMessageReaction,ji as removeMonitor,mu as removeNotificationQuietHoursSetting,Tr as removeRealtimeConversations,Xs as removeTag,na as removeTagFromConversations,ta as removeTagsFromConversation,_s as requestSpeechToTextForMessage,Es as requestStreamMessageContent,Qo as saveTextMessageDraft,ls as searchConversationByContent,iu as searchFriendsInfo,ba as searchGroupMembers,Va as searchJoinedGroups,us as searchMessages,Sa as searchUserProfileByUniqueId,Lr as sendFileMessage,xr as sendGIFMessage,Fr as sendHQVoiceMessage,Gr as sendImageMessage,yr as sendMessage,kr as sendReadReceiptMessage,$r as sendReadReceiptMessageV4,Vr as sendReadReceiptRequest,jr as sendReadReceiptResponse,Yr as sendReadReceiptResponseV2,hs as sendReadReceiptResponseV5,wr as sendSightMessage,zr as sendSyncReadStatusMessage,Pr as sendTextMessage,ts as sendTypingStatusMessage,ys as sendUltraGroupTypingStatus,Lu as setAutoTranslateEnabled,Au as setChatRoomEntries,Tu as setChatRoomEntry,or as setConversationNotificationLevel,ar as setConversationNotificationStatus,vr as setConversationToTop,ra as setConversationToTopInTag,lr as setConversationTypeNotificationLevel,ou as setFriendAddPermission,Ja as setFriendInfo,Da as setGroupMemberInfo,Ya as setGroupRemark,vs as setMessageReceivedStatus,hu as setNotificationQuietHoursWithSetting,aa as setProxy,Du as setTranslationLanguage,Fs as setUltraGroupDefaultNotificationLevel,yo as stopUploadTask,ca as subscribeUserStatus,da as testProxy,Ma as transferGroupOwner,Is as translateMessagesWithParams,Ts as translateTextsWithParams,la as unSubscribeUserStatus,Ds as updateExpansionForUltraGroupMessage,Ta as updateGroupInfo,Zr as updateMessageExpansion,Ea as updateMyUserProfile,pa as updateMyUserProfileVisibility,Qs as updateTag,Po as upload};
|
|
15
|
+
***************************************************************************** */function Ci(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function Ni(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function Mi(t){const{conversationType:n,targetId:i,latestMessage:o,unreadMessageCount:r,hasMentioned:s,mentionedInfo:a,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:E,operationTime:h,draft:m,translateStrategy:p,editedMessageDraft:g,includeRobot:S,dataMgmtInfo:_}=t,I=o&&Ni(o);let T;T=s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0;const A={conversationType:n,targetId:i,latestMessage:I,unreadMessageCount:r,hasMentioned:s,mentionedInfo:T,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:E,operationTime:h,draft:m||"",translateStrategy:p,editedMessageDraft:g,includeRobot:S,dataMgmtInfo:_};return A.conversationType===e.ULTRA_GROUP&&(A.firstUnreadMessage=t.firstUnreadMessage,A.channelType=t.channelType,A.unreadMentionedMeCount=t.unreadMentionedMeCount),A}function Oi(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}var Ui;!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.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"}(Ui||(Ui={}));const yi=new t,Pi={connection(e,t){switch(e){case n.CONNECTED:yi.emit(Ui.CONNECTED);break;case n.CONNECTING:yi.emit(Ui.CONNECTING);break;case n.SUSPENDED:yi.emit(Ui.SUSPEND,t);break;case n.DISCONNECTED:yi.emit(Ui.DISCONNECT,t)}},batchMessage:e=>{yi.emit(Ui.MESSAGES,{messages:e.map((e=>Ni(e)))})},typingState:e=>{yi.emit(Ui.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,i)=>{yi.emit(Ui.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:(e,t,n)=>{yi.emit(Ui.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{yi.emit(Ui.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:t=>{const n=t.map((({conversation:t,updatedItems:n})=>{const{conversationType:i}=t,o=Mi(t);return i===e.ULTRA_GROUP&&(o.versionTime=t.versionTime,o.unreadMessageCount=Di(t.unreadMessageCount||0),o.unreadMentionedCount=Di(t.unreadMentionedCount||0),o.unreadMentionedMeCount=Di(t.unreadMentionedMeCount||0)),{conversation:o,updatedItems:n}}));yi.emit(Ui.CONVERSATION,{conversationList:n})},chatroomState:e=>{yi.emit(Ui.CHATROOM,e)},expansion:e=>{yi.emit(Ui.EXPANSION,e)},pullFinished:()=>{yi.emit(Ui.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{yi.emit(Ui.TAG)},userSettingsSynced:e=>{yi.emit(Ui.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{yi.emit(Ui.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{yi.emit(Ui.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{yi.emit(Ui.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{yi.emit(Ui.CONVERSATION_TAG)},messageBlocked:e=>{yi.emit(Ui.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{yi.emit(Ui.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{yi.emit(Ui.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{yi.emit(Ui.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{yi.emit(Ui.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>Ni(e))))},ultraGroupMessageRecalled:e=>{yi.emit(Ui.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>Ni(e))))},ultraGroupChannelChangeType:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{yi.emit(Ui.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{yi.emit(Ui.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{yi.emit(Ui.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{yi.emit(Ui.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{yi.emit(Ui.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{yi.emit(Ui.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{yi.emit(Ui.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{yi.emit(Ui.GROUP_OPERATION,e)},groupInfoChanged:e=>{yi.emit(Ui.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{yi.emit(Ui.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{yi.emit(Ui.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{yi.emit(Ui.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{yi.emit(Ui.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{yi.emit(Ui.FRIEND_ADDED,e)},friendDelete:e=>{yi.emit(Ui.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{yi.emit(Ui.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{yi.emit(Ui.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{yi.emit(Ui.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{yi.emit(Ui.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{yi.emit(Ui.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{yi.emit(Ui.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{yi.emit(Ui.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{yi.emit(Ui.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{yi.emit(Ui.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{yi.emit(Ui.TRANSLATE_RESPONSE,e)},messagesModified:e=>{yi.emit(Ui.MESSAGE_MODIFIED,e.map((e=>Ni(e))))},messageModifiedSyncCompleted:()=>{yi.emit(Ui.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{yi.emit(Ui.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){yi.emit(Ui.MESSAGE_REACTION_CHANGED,e)},streamMessageResponse(e){const t=Object.assign(Object.assign({},e),{message:e.message?Ni(e.message):void 0});yi.emit(Ui.STREAM_MESSAGE_RESPONSE,t)}};function Di(e){return e>999?999:e}i.add("imlib-next","5.48.0");let bi=null,Li=null,Gi=null;function xi(e){if(!bi)throw new Error("Not initialized yet!");return e(bi,Gi,Li)}const{setup:Fi}=o;function wi(e,t){return xi((n=>n.install(e,t)))}let Bi=0;const Hi=new Map;function ki(e,t){const n=(...e)=>{const i=[],o=[];[...Hi.values()].forEach((([e,t,r])=>{e===n&&(o.push(t),r&&i.push(r))})),i.forEach((t=>{e=t(e)}));const r=t(...e);return o.forEach((t=>{t(e,r)})),r};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}function Vi(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const i=++Bi;return Hi.set(i,[e,t,n]),i}function ji(e){Hi.delete(e)}function Yi(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Fi().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))}const zi=ki("disconnect",((e,t)=>xi((n=>n.disconnect(e,t)))));function $i(e,t,n){yi.on(e,t,n)}function qi(e,t,n){yi.once(e,t,n)}function Wi(e,t,n){yi.off(e,t,n)}function Xi(e){yi.removeAll(e)}function Qi(){yi.clear()}class Ki{constructor(e,t,n=!0,i=!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:i})}}class Ji extends Ki{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class Zi extends Ji{constructor(e){super(l.COMBINE,f(l.COMBINE),e)}}class eo extends Ji{constructor(e){super(l.COMBINE_V2,f(l.COMBINE_V2),e)}}class to extends Ji{constructor(e){super(l.COMMAND,f(l.COMMAND),e)}}class no extends Ji{constructor(e){super(l.FILE,f(l.FILE),e)}}class io extends Ji{constructor(e){super(l.GIF,f(l.GIF),e)}}const oo=l.GROUP_NOTIFICATION;class ro extends Ji{constructor(e){super(oo,f(oo),e)}}class so extends Ji{constructor(e){super(l.IMAGE,f(l.IMAGE),e)}}const ao=l.INFORMATION_NOTIFICATION;class uo extends Ji{constructor(e){super(ao,f(ao),e)}}class co extends Ji{constructor(e){super(l.LOCATION,f(l.LOCATION),e)}}class lo extends Ji{constructor(e){super(l.REFERENCE,f(l.REFERENCE),e)}}class fo extends Ji{constructor(e){super(l.RICH_CONTENT,f(l.RICH_CONTENT),e)}}class vo extends Ji{constructor(e){super(l.SIGHT,f(l.SIGHT),e)}}class Eo extends Ji{constructor(e){super(l.TEXT,f(l.TEXT),e)}}class ho extends Ji{constructor(e){super(l.HQ_VOICE,f(l.HQ_VOICE),e)}}class mo extends Ji{constructor(e){super(l.VOICE,f(l.VOICE),e)}}var po;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(po||(po={}));class go{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>v?Promise.resolve(E(h.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>m&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function So(e){return Math.ceil(e/1024)||0}const _o={[po.QINIU]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t),this._promise=p({url:g(this._url),headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:s}=yield this._promise.result();return this._promise=null,200===s||204===s?S({uniqueName:o.fileName,uploadMethod:_.QINIU}):E(h.UPLOAD_FAIL,s.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.ALIYUN]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=g(`${o.ossBucketName}.${this._url}`),s=new FormData;s.set("token",o.token),s.set("OSSAccessKeyId",o.osskeyId),s.set("policy",o.ossPolicy),s.set("Signature",o.ossSign),s.set("success_action_status","200"),s.set("key",o.fileName),s.set("file",t),this._promise=p({url:r,onProgress:e=>null==n?void 0:n(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?S({uniqueName:o.fileName,uploadMethod:_.ALI}):E(h.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.S3]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i,contentDisposition:o}=e;let r=this._authInfo;const s=g(`${r.s3BucketName}.${this._url}`),a=new FormData;o?a.set("Content-Disposition",o):a.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),a.set("Content-Type",t.type),a.set("x-amz-credential",r.s3Credential),a.set("x-amz-algorithm",r.s3Algorithm),a.set("x-amz-date",r.s3Date),a.set("policy",r.s3Policy),a.set("x-amz-signature",r.s3Signature),a.set("key",r.fileName),a.set("file",t),this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u,data:d}=yield this._promise.result();return this._promise=null,200===u||204===u?S({uniqueName:r.fileName,uploadMethod:_.AWS}):E(h.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.MINIO]:class extends go{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=>Ci(this,void 0,void 0,(function*(){var t;const{file:n,fileType:i}=e;let o=yield this._getFileToken(i,n.name,"POST","uploads",void 0,So(n.size));if(!o.isOk)return o.wipe();let r=o.data;const s=g(`${this._url}/${r.minioBucketName}/${r.fileName}`),a=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploads`,headers:a,method:"POST"});const{status:u,data:d}=yield this._promise.result();this._promise=null;const c=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1];if(200!==u&&204!==u||!c)return E(h.UPLOAD_FAIL,"start upload fail");const l=[],f=yield this.requestUploadPart(s,n,c,r.fileName,e,l);if(!f.isOk)return f.wipe();if(o=yield this._getFileToken(i,r.fileName,"POST",`uploadId=${c}`,void 0,So(n.size)),!o.isOk)return o.wipe();r=o.data;let v=l.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");v=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${v}</CompleteMultipartUpload>`;const m=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploadId=${c}`,headers:m,method:"POST",body:v,timeout:0});const{status:I}=yield this._promise.result();return this._promise=null,200===I||204===I?S({uniqueName:r.fileName,uploadMethod:_.MINIO}):E(h.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=g(`${this._url}/${o.minioBucketName}/${o.fileName}`),s=this.getBaseHeaders(t,o,e);this._promise=p({url:r,headers:s,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"PUT",body:t,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?S({uniqueName:o.fileName,uploadMethod:_.MINIO}):E(h.UPLOAD_FAIL,a.toString())}))}requestUploadPart(e,t,n,i,o,r){return Ci(this,arguments,void 0,(function*(e,t,n,i,o,r,s=1,a=0){if(a>=5)return E(h.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const u=(s-1)*m,d=Math.min(m,t.size-u),c=`partNumber=${s}&uploadId=${n}`,l=yield this._getFileToken(o.fileType,i,"PUT",c,void 0,So(t.size));if(!l.isOk)return l.wipe();const f=l.data,v=t.slice(u,s*m),g=this.getBaseHeaders(t,f,o);this._promise=p({url:`${e}?${c}`,headers:g,method:"PUT",body:v,timeout:0,onProgress:e=>{var n;return null===(n=null==o?void 0:o.onProgress)||void 0===n?void 0:n.call(o,u+e.loaded,t.size)}});const{status:_,xhr:I}=yield this._promise.result();return this._promise=null,200===_||204===_?(r.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+d<t.size?this.requestUploadPart(e,t,n,i,o,r,s+1,0):S()):this.requestUploadPart(e,t,n,i,o,r,s,a+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:i}=n;return{"Content-Disposition":`${i||("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()}},[po.RCX]:class extends go{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=>Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e,o=I.gen();let r=this._authInfo;return this._requestUploadPart(o,t,r.token,n)}))})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t);const s=g(this._url);this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:a,data:u}=yield this._promise.result();if(this._promise=null,(200===a||204===a)&&u){const e=JSON.parse(u);return S({uniqueName:e.rc_url.file_name,downloadUrl:`${s}/${e.rc_url.path}`,uploadMethod:_.QINIU})}return E(h.UPLOAD_FAIL,a.toString())}))}_requestUploadPart(e,t,n,i){return Ci(this,arguments,void 0,(function*(e,t,n,i,o=0){const r=Math.min(m,t.size-o),s=e+t.name.substring(t.name.lastIndexOf(".")),a={Range:`bytes=${o}-${o+r}`,"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(o,o+r),d=new FormData;d.set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n);const c=g(this._url);this._promise=p({url:c,headers:a,onProgress:e=>null==i?void 0:i(o+e.loaded,t.size),method:"POST",body:d,timeout:0});const{status:l,data:f}=yield this._promise.result();if(this._promise=null,200===l||204===l){if(o+r<t.size)return this._requestUploadPart(e,t,n,i,o+r);const s=JSON.parse(f);return S({uniqueName:s.rc_url.file_name,downloadUrl:`${c}/${s.rc_url.path}`,uploadMethod:_.QINIU})}return E(h.UPLOAD_FAIL,l.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function Io(e,t,n){const{promise:i,resolve:o}=A(),r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;return a.onload=e=>{const{maxHeight:i=160,maxWidth:u=160,quality:d=1,scale:c=1}=n||{},l=Ao(a.width,a.height,{maxHeight:i,maxWidth:u,scale:c});r.width=Math.min(l.w,u),r.height=Math.min(l.h,i),s.drawImage(a,l.x,l.y,l.w,l.h);let f=To(r,d);f=f.replace(/data:image\/[^;]+;base64,/,""),o(S(Object.assign(Object.assign({},t),{thumbnail:f,width:Math.ceil(l.w),height:Math.ceil(l.h)})))},a.onerror=e=>{o(E(h.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},a.src=(window.URL||window.webkitURL).createObjectURL(e),i}function To(e,t){let n=e.toDataURL("image/jpeg",t);return n.length>R-10240?To(e,t-.1):n}const Ao=(e,t,n)=>{const{maxHeight:i=160,maxWidth:o=160,scale:r=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>r?(s?(a=e/160,u=160,d=t/a,d>i&&(l=(d-i)/2)):(a=t/160,d=160,u=e/a,u>o&&(c=(u-o)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/i,d=i,u=e/a):(a=e/o,u=o,d=t/a),{w:u,h:d,x:-c,y:-l})};let Ro=0;class Co{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:++Ro}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,t,n,i){return Ci(this,arguments,void 0,(function*(e,t,n,i,o=[]){for(let r=0;r<e.length;r++){const s=e[r],a=_o[s.type];if(!a){o.push({type:s.type,url:s.url,code:h.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new a(s.url,n,i);const u=yield this._client.upload(t);if(u.isOk)return u;const{code:d}=u;if([h.RC_FILE_SIZE_EXCEED_LIMIT,h.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(u.code))return u;if(this._client.isAbort())return this._client=null,u;this._client=null,o.push({type:s.type,url:s.url,code:d,msg:u.msg})}return E(h.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(o)}`)}))}_handleUpload(e,t){return Ci(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:i,uploadServer:o,ossConfig:r}=t,{file:s,fileType:a,thumbnailConfig:u}=e,d=yield n(a,s.name,void 0,void 0,void 0,So(s.size));if(!d.isOk)return d.wipe();const c=d.data,l=function(e,t,n){if(t)return[{type:po.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:po.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 i=[];return n&&i.push({type:po.QINIU,url:n,p:"1"}),i}(c.ossConfig||r,i,o);if(0===l.length)return E(h.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:f,data:v,msg:m,isOk:p}=yield this._uploadInLoop(l,e,c,n);if(!p)return E(f,m);let{downloadUrl:g,uploadMethod:_}=v;if(!g){const e=yield t.getFileUrl(a,v.uniqueName,_,s.name);if(!e.isOk)return E(e.code,"Get download url fail");g=e.data.downloadUrl}if(!g)return E(h.UPLOAD_FAIL,"Get download url fail");const I={downloadUrl:g,uniqueName:(null==v?void 0:v.uniqueName)||"",name:s.name,size:s.size,type:s.type};if(a===T.AUDIO){return function(e,t){const n=new AudioContext({sampleRate:16e3}),{promise:i,resolve:o}=A();return n.decodeAudioData(e,(e=>{var n,i;o(S(Object.assign(Object.assign({},t),{duration:e.duration,length:e.length,sampleRate:null!==(n=e.sampleRate)&&void 0!==n?n:void 0,numberOfChannels:null!==(i=e.numberOfChannels)&&void 0!==i?i:void 0})))}),(e=>{o(E(h.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),i}(yield s.arrayBuffer(),I)}return a===T.IMAGE?Io(s,I,u):S(I)}))}awaitResult(){return Ci(this,void 0,void 0,(function*(){return this._promise}))}}const No={};function Mo(e,t){const n=new Co(e,t);return function(e){Ci(this,void 0,void 0,(function*(){No[e.id]=e,yield e.awaitResult(),delete No[e.id]}))}(n),n}const Oo=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:M,getFileUrl:N,customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function Uo(e){return Ci(this,void 0,void 0,(function*(){return Fi().next((t=>Ci(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:i,file:o}=e;return C.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(h.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",i,T,!0).fail(h.INVALID_PARAMETER_MEDIA_TYPE).validate("file",o,(e=>e instanceof File&&(!(i===T.IMAGE&&!e.type.match(/^image\//))&&!(i===T.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(h.MEDIA_EXCEPTION).result().trans((()=>Mo(e,Oo(t,t.getOptions().uploadDomain))))}))))}))}function yo(e){return Ci(this,void 0,void 0,(function*(){return S(function(e){const t=No[e];return!!t&&(t.abort(),!0)}(e))}))}function Po(e){return Ci(this,void 0,void 0,(function*(){const{contentDisposition:t,fileType:n,file:i}=e;return Fi().next((o=>Ci(this,void 0,void 0,(function*(){const r=yield C.create("upload").validate("contentDisposition",t,(e=>"inline"===e||"attachment"===e),!1).fail(h.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",n,T,!0).fail(h.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(n===T.IMAGE&&!e.type.match(/^image\//))&&!(n===T.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(h.MEDIA_EXCEPTION).result().next((()=>function(e,t){return Ci(this,void 0,void 0,(function*(){return new Co(e,t).awaitResult()}))}(e,Oo(o,o.getOptions().uploadDomain))));return r}))))}))}function Do(e,t,n,i){return M(e,t,n,i)}function bo(e){return Fi().next((t=>Ci(this,void 0,void 0,(function*(){return(yield C.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(h.INVALID_PARAMETER_MEDIA_URL).result().next((()=>M(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))}function Lo(e,t,n,i,o){return Ci(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?S(i):N(e,t,o||_.QINIU,n)}))}function Go(e,t){return Ci(this,void 0,void 0,(function*(){return(yield K(e,t)).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>Ni(e)))})))}))}function xo(e,t,n,i,o){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),Go(e,{keyword:t,limit:i||J,order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{objectNames:o}})}))}function Fo(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("setMessageReceivedStatus","setMessageReceivedStatusInfo"),Y(e,t)}))}function wo(e){return Ci(this,void 0,void 0,(function*(){return y(e)}))}function Bo(e,t,n){return Ci(this,void 0,void 0,(function*(){return D(e,t,n)}))}function Ho(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){return t instanceof Ki?function(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:"",messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,searchContent:o,messageDirection:X.SEND,isUnread:i,messageUId:"",disableUpdateLastMessage:r,quoteInfo:n.quoteInfo};return(yield Q(e,s)).trans(Ni)}))}(e,t,n):function(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:null==t?void 0:t.senderUserId,messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,messageDirection:null==t?void 0:t.messageDirection,readStatus:"object"==typeof(null==t?void 0:t.receivedStatusInfo)?z(t.receivedStatusInfo):null==t?void 0:t.receivedStatus,sentTime:null==t?void 0:t.sentTime,sentStatus:null==t?void 0:t.sentStatus,searchContent:o,messageUId:"",isUnread:i,disableNotification:null==t?void 0:t.disableNotification,canIncludeExpansion:null==t?void 0:t.canIncludeExpansion,expansion:(null==t?void 0:t.expansion)||void 0,directedUserIds:null==t?void 0:t.directedUserIds,disableUpdateLastMessage:(null==t?void 0:t.disableUpdateLastMessage)||r,quoteInfo:null==t?void 0:t.quoteInfo};return(yield Q(e,s)).trans(Ni)}))}(e,t,n)}))}function ko(e){return Ci(this,void 0,void 0,(function*(){return(yield x(e)).trans((e=>Ni(e)))}))}function Vo(e,t){return Ci(this,void 0,void 0,(function*(){Oi("getConversationList","getConversationListByTimestamp");return(yield fe({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(Mi)))}))}function jo(e){return Ci(this,void 0,void 0,(function*(){return(yield ue(e)).trans((e=>e.map(Mi)))}))}function Yo(e){return Ci(this,void 0,void 0,(function*(){return(yield ve(e)).trans((e=>e.map(Mi)))}))}function zo(e){return Ci(this,void 0,void 0,(function*(){return(yield le(e)).trans((e=>Mi(e)))}))}const $o=ki("removeConversation",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return ye(e,t)}))));function qo(e){return Ci(this,void 0,void 0,(function*(){return Oi("batchRemoveConversation","batchDeleteConversations"),Wo({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))}function Wo(e){return Ci(this,void 0,void 0,(function*(){return Z(e)}))}function Xo(e){return Ci(this,void 0,void 0,(function*(){return Ie(e)}))}function Qo(e,t){return Ci(this,void 0,void 0,(function*(){return De(e,t)}))}function Ko(e){return Ci(this,void 0,void 0,(function*(){return se(e)}))}function Jo(e,t){return Ci(this,void 0,void 0,(function*(){return Ae(t,e)}))}function Zo(e,t){return Ci(this,void 0,void 0,(function*(){return Re(e,t)}))}function er(e,t){return Ci(this,void 0,void 0,(function*(){return Re(e,t,!0)}))}function tr(e){return Ci(this,void 0,void 0,(function*(){return Ne(e)}))}const nr=ki("clearMessagesUnreadStatus",(e=>Ci(void 0,void 0,void 0,(function*(){return oe(e)}))));function ir(){return Ci(this,void 0,void 0,(function*(){return ie()}))}const or=ki("setConversationNotificationLevel",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return ee([e],t)}))));function rr(e,t){return Ci(this,void 0,void 0,(function*(){return ee(e,t)}))}function sr(e,t){return Ci(this,void 0,void 0,(function*(){return ne(e,t)}))}function ar(e,t){return Ci(this,void 0,void 0,(function*(){return Fi().next((n=>Ci(this,void 0,void 0,(function*(){if(t!==be.CLOSE&&t!==be.OPEN)return E(h.INVALID_PARAMETER_NOTIFICATION_LEVEL);const n=Le(t);return ee([e],n)}))))}))}function ur(e){return Ci(this,void 0,void 0,(function*(){return Ee(e)}))}function dr(e){return Ci(this,void 0,void 0,(function*(){return(yield Ee(e)).trans((e=>he(e)))}))}function cr(){return Ci(this,void 0,void 0,(function*(){return(yield ce()).trans((e=>e.map(Mi)))}))}function lr(e,t){return Ci(this,void 0,void 0,(function*(){return Ge(e,t)}))}function fr(e){return Ci(this,void 0,void 0,(function*(){return me(e)}))}const vr=ki("setConversationToTop",((e,...t)=>Ci(void 0,[e,...t],void 0,(function*(e,t=!0,n=!0,i=!1){return te([e],!!t,n,i)}))));function Er(e,t){return Ci(this,arguments,void 0,(function*(e,t,n=!0,i=!0){return te(e,!!t,i,n)}))}function hr(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Te(e,t)).trans((e=>e.map(Mi)))}))}function mr(e){return Ci(this,void 0,void 0,(function*(){return(yield Ce(e)).trans((e=>e.map(Mi)))}))}function pr(e){return Ci(this,void 0,void 0,(function*(){return Oe(e)}))}function gr(){return Ci(this,void 0,void 0,(function*(){return de()}))}function Sr(e){return Ci(this,void 0,void 0,(function*(){var t,n,i;return(yield _e(null!==(t=null==e?void 0:e.count)&&void 0!==t?t:30,null!==(n=null==e?void 0:e.startTime)&&void 0!==n?n:0,null!==(i=null==e?void 0:e.order)&&void 0!==i?i:0)).trans((e=>e.map(Mi)))}))}function _r(){return Ci(this,void 0,void 0,(function*(){return ge()}))}function Ir(e){return Ci(this,void 0,void 0,(function*(){return re(e)}))}function Tr(e){return Ci(this,void 0,void 0,(function*(){return Pe(e)}))}function Ar(e){return Ci(this,void 0,void 0,(function*(){return Se(e)}))}function Rr(e){return Ci(this,void 0,void 0,(function*(){return(yield Me(e)).trans((e=>e.map(Mi)))}))}function Cr(e){return Ci(this,void 0,void 0,(function*(){return ae(e)}))}function Nr(e){return Ci(this,void 0,void 0,(function*(){return(yield pe(e)).trans((e=>e.map(Mi)))}))}function Mr(e){return Ci(this,void 0,void 0,(function*(){return Ue(e)}))}function Or(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return(yield Ve(e,t,n,i)).trans((e=>e.map((e=>Mi(e)))))}))}const Ur=ko,yr=ki("sendMessage",((e,t,n)=>Ci(void 0,void 0,void 0,(function*(){const{disableNotification:i,isMentioned:o,directionalUserIdList:r,canIncludeExpansion:s,onSendBefore:a,expansion:u,pushConfig:d,isStatusMessage:l,disableUpdateLastMessage:f}=n||{},v=function(e,t){const{disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:E,disableUpdateLastMessage:h,needReceipt:m,quoteInfo:p}=e;return Object.assign({disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:E,disableUpdateLastMessage:h,needReceipt:m,quoteInfo:p},t)}(n||{},t),h=Object.assign(Object.assign({},e),{isMentioned:!!o,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!i,canIncludeExpansion:!!s,expansion:u||null,senderUserId:"",messageUId:"",messageDirection:X.SEND,receivedTime:0,isStatusMessage:!!l,receivedStatus:Rt.UNREAD,isOffLineMessage:!1,pushConfig:d,sentStatus:At.SENDING,sentTime:0,directedUserIds:r||[],disableUpdateLastMessage:f,quoteInfo:v.quoteInfo}),m=yield Fi().next((t=>{h.senderUserId=t.getCurrentUserId();return t.sendMessage(e,v,(e=>{h.messageId=e;try{a&&a(Ni(h))}catch(e){t.logger.error(c.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return m.isOk?m.trans((e=>Ni(e))):(h.sentStatus=At.FAILED,E(m.code,m.msg,Ni(h)))}))));function Pr(e,t,n){return yr(e,new Eo(t),n)}function Dr(e,t){return(n,i,o,r)=>Ci(this,void 0,void 0,(function*(){var a;const u=Fi();if(!u.isOk)return u.wipe();const d=u.data;if(!je("sendOptions.contentDisposition",null==r?void 0:r.contentDisposition,(e=>["inline","attachment"].includes(e))))return E(h.INVALID_PARAMETER_SENDOPTIONS);const c={contentDisposition:null==r?void 0:r.contentDisposition};if(r&&"thumbnailConfig"in r){const e=null==r?void 0:r.thumbnailConfig;if(!(je("sendOptions.maxHeight",null==e?void 0:e.maxHeight,s.NUMBER)&&je("sendOptions.maxWidth",null==e?void 0:e.maxWidth,s.NUMBER)&&je("sendOptions.quality",null==e?void 0:e.quality,s.NUMBER)&&je("sendOptions.scale",null==e?void 0:e.scale,s.NUMBER)))return E(h.INVALID_PARAMETER_SENDOPTIONS);c.thumbnailConfig=e}const{logger:l}=d,f=l.createTraceId();l.info("L-media_upload-T",JSON.stringify({filesize:i.file.size,type:e}),f);const v=yield Po({file:i.file,fileType:e,onProgress:(e,t)=>{var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig}),{code:m,data:p,msg:g}=v;if(m===h.SUCCESS&&p){const e=(null===(a=null==o?void 0:o.onComplete)||void 0===a?void 0:a.call(o,Object.assign({url:p.downloadUrl},p)))||t(p,i);return l.info("L-media_upload-R",JSON.stringify({downurl:p.downloadUrl,code:h.SUCCESS}),f),yr(n,e,r)}return E(m,g)}))}const br=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},Lr=Dr(T.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:br(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 no(n)})),Gr=Dr(T.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 so(n)})),xr=Dr(T.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 io(n)})),Fr=Dr(T.AUDIO,((e,t)=>{var n;const i={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(i.user=t.user),t.extra&&(i.extra=t.extra),t.mentionedInfo&&(i.mentionedInfo=t.mentionedInfo),t.audit&&(i.audit=t.audit),new ho(i)})),wr=Dr(T.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 vo(n)}));function Br(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Ke(e,t)).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>Ni(e)))})))}))}function Hr(e,t){return Ci(this,void 0,void 0,(function*(){return(yield st(e,t)).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>Ni(e)))})))}))}function kr(t,n,i,o){return Ci(this,void 0,void 0,(function*(){return vt({targetId:t,conversationType:e.PRIVATE,channelId:o},n,i)}))}function Vr(t,n,i){return Ci(this,void 0,void 0,(function*(){return ht({targetId:t,conversationType:e.GROUP,channelId:i},n)}))}function jr(e,t,n){return Ci(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}function Yr(t,n,i){return Ci(this,void 0,void 0,(function*(){return mt({targetId:t,conversationType:e.GROUP,channelId:i},n)}))}function zr(e,t){return Ci(this,void 0,void 0,(function*(){return gt(e,t)}))}function $r(e,t,n){return Ci(this,void 0,void 0,(function*(){return Et(e,t,n)}))}function qr(e,t){return Ci(this,void 0,void 0,(function*(){return tt(e,t)}))}function Wr(e,t){return Ci(this,void 0,void 0,(function*(){return ze(e,t)}))}Dr(T.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 Zi(n)}));const Xr=ki("recallMessage",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return(yield ut(e,t)).trans((e=>Ni(e)))}))));function Qr(e,t){return Ci(this,void 0,void 0,(function*(){return We(e,t)}))}function Kr(e,t){return Ci(this,void 0,void 0,(function*(){return $e(e,t)}))}function Jr(e,t){return Ci(this,void 0,void 0,(function*(){return Ye(e,t)}))}function Zr(e,t){return Ci(this,void 0,void 0,(function*(){return Tt(e,t)}))}function es(e,t){return Ci(this,void 0,void 0,(function*(){return ct(e,t)}))}function ts(e,t){return Ci(this,void 0,void 0,(function*(){return(yield St(e,t)).trans(Ni)}))}function ns(e,t,n){return Ci(this,void 0,void 0,(function*(){return nt(e,t,n)}))}function is(e,t,n,i,o){return xi(((a,u)=>(r("messageType",e,s.STRING,!0),r("isPersited",t,s.BOOLEAN,!0),r("isCounted",n,s.BOOLEAN,!0),r("isStatusMessage",o,s.BOOLEAN),r("searchProps",i,s.ARRAY),u.info("A-regtyp-O",JSON.stringify({messageType:e,isCounted:n,isStatusMessage:o,isPersited:t,searchProps:i})),a.registerMessageType(e,t,n,i,o),function(e,t=!0,n=!0){return function(i){return new Ki(e,i,t,n)}}(e,t,n))))}function os(e){return Ci(this,void 0,void 0,(function*(){return(yield Xe(e)).trans((e=>e?Ni(e):null))}))}function rs(e){return Ci(this,void 0,void 0,(function*(){return Qe(e)}))}function ss(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){return Oi("insertMessage","electronExtension.insertMessage"),Ho(e,t,n)}))}function as(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")}function us(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),xo(e,t,n,i)}))}function ds(e,t,n){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),Bo(e,t,n)}))}function cs(e){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),wo(e)}))}function ls(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Oi("searchConversationByContent","electronExtension.searchConversationByContent"),Or(e,null!=n?n:[l.TEXT,l.FILE],i,t)}))}function fs(e,t){return Ci(this,void 0,void 0,(function*(){return qe(e,t)}))}function vs(e,t){return Ci(this,void 0,void 0,(function*(){return Fo(e,t)}))}function Es(e){return ft(e)}function hs(e,t){return Ci(this,void 0,void 0,(function*(){return pt(e,t)}))}function ms(e,t){return Ci(this,void 0,void 0,(function*(){return Ze(e,t)}))}function ps(e){return Ci(this,void 0,void 0,(function*(){return et(e)}))}function gs(e,t,n){return Ci(this,void 0,void 0,(function*(){return rt(e,t,n)}))}function Ss(e,t,n){return Ci(this,void 0,void 0,(function*(){return ot(e,t,n)}))}function _s(e,t){return lt(e,t)}function Is(e){return _t(e)}function Ts(e){return It(e)}function As(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("modifyMessage","modifyMessageWithParams"),Rs({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}})}))}function Rs(e){return at(e)}function Cs(e){const t=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?Ni(e.message):void 0,code:e.code})));return dt(Object.assign(Object.assign({},e),{remoteMessageBlock:n=>{e.remoteMessageBlock&&e.remoteMessageBlock(t(n))},localMessageBlock:n=>{e.localMessageBlock&&e.localMessageBlock(t(n))}}))}function Ns(e){return Ci(this,void 0,void 0,(function*(){return(yield it(e.conversationIdentifier,e.messageUIds)).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?Ni(e.message):void 0,code:e.code})))))}))}function Ms(e,t){return Ci(this,void 0,void 0,(function*(){return Je(e,t)}))}function Os(e){return Ci(this,void 0,void 0,(function*(){return(yield Ot(e)).trans((e=>e))}))}function Us(){return Ci(this,void 0,void 0,(function*(){return(yield Ct()).trans((e=>e.map((e=>Mi(e)))))}))}function ys(e){return Ci(this,void 0,void 0,(function*(){return Lt(e)}))}function Ps(e,t){return Ci(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t.map((e=>null==e?void 0:e.messageUId)):t;return(yield Ut(e,n)).trans((e=>{const n={};return e.forEach((e=>{n[e.messageUId]=Ni(e)})),t.forEach((({messageUId:e})=>{e in n||(n[e]=void 0)})),n}))}))}function Ds(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("updateExpansionForUltraGroupMessage","updateMessageExpansion"),Zr(e,t)}))}function bs(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),es(e,t)}))}function Ls(e){return Ci(this,void 0,void 0,(function*(){return bt(e)}))}function Gs(e,t){return Ci(this,void 0,void 0,(function*(){return yt(e,t,!0)}))}function xs(e){return Ci(this,void 0,void 0,(function*(){return Nt(null==e?void 0:e.targetId,null==e?void 0:e.channelId)}))}function Fs(e,t){return Ci(this,void 0,void 0,(function*(){return Gt(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)}))}function ws(e,t){return Ci(this,void 0,void 0,(function*(){return yt(e,t,!1)}))}function Bs(){return Ci(this,void 0,void 0,(function*(){return Oi("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),Zo([e.ULTRA_GROUP],[])}))}function Hs(){return Ci(this,void 0,void 0,(function*(){return Oi("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),er([e.ULTRA_GROUP],[])}))}function ks(e){return Ci(this,void 0,void 0,(function*(){return Dt(e)}))}function Vs(t){return Ci(this,void 0,void 0,(function*(){return Mt(Object.assign(Object.assign({},t),{conversationType:e.ULTRA_GROUP}))}))}function js(e){return Ci(this,void 0,void 0,(function*(){return Pt(e)}))}function Ys(e){return Ci(this,void 0,void 0,(function*(){return xt(e)}))}function zs(e){return Ci(this,void 0,void 0,(function*(){return Bt(e)}))}function $s(){return Ci(this,void 0,void 0,(function*(){return Ft()}))}function qs(e){return Ci(this,void 0,void 0,(function*(){return(yield wt(e)).trans((e=>0===e))}))}function Ws(e){return Ci(this,void 0,void 0,(function*(){return kt(e)}))}function Xs(e){return Ci(this,void 0,void 0,(function*(){return qt(e)}))}function Qs(e){return Ci(this,void 0,void 0,(function*(){return Qt(e)}))}function Ks(){return Ci(this,void 0,void 0,(function*(){return jt()}))}function Js(e){return Ci(this,void 0,void 0,(function*(){return Yt(e)}))}function Zs(e,t){return Ci(this,void 0,void 0,(function*(){return Ht(e,t)}))}function ea(e,t){return Ci(this,void 0,void 0,(function*(){return $t(e,t)}))}function ta(e,t){return Ci(this,void 0,void 0,(function*(){return Wt(e,t)}))}function na(e,t){return Ci(this,void 0,void 0,(function*(){return $t(e,t)}))}function ia(e,t,n){return Ci(this,void 0,void 0,(function*(){Oi("getConversationsFromTagByPage","createConversationListLoader");return(yield Vt(e,n,t)).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},Mi(t)),{isTopInTag:t.isTopInTag});var t}))))}))}function oa(e,t){return Ci(this,void 0,void 0,(function*(){return zt(e,t)}))}function ra(e,t,n){return Ci(this,void 0,void 0,(function*(){return Xt(e,t,{isTop:n})}))}var sa=Object.freeze({__proto__:null,batchClearMessagesByTimestamp:function(e){return Ci(this,void 0,void 0,(function*(){return O(e)}))},batchInsertMessage:function(e,t){return Ci(this,void 0,void 0,(function*(){return U(e,t)}))},clearEditedMessageDraft:function(e){return Ci(this,void 0,void 0,(function*(){return xe(e)}))},clearLocalData:function(){return Ci(this,void 0,void 0,(function*(){return Kt()}))},clearMessages:wo,deleteMessages:function(e){return Ci(this,void 0,void 0,(function*(){return P(e)}))},deleteMessagesByTimestamp:Bo,deleteUltraGroupMessagesForAllChannel:function(e,t){return b(e,t)},enable:function(){return Jt()},getAllConversationList:function(e){return Ci(this,void 0,void 0,(function*(){return Oi("electronExtension.getAllConversationList","getAllConversationList"),jo(e)}))},getContinuousMessages:function(e,t){return Ci(this,void 0,void 0,(function*(){return(yield L(e,t)).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(Ni),timestamp:n})))}))},getConversationList:function(e,t,n,i){return Ci(this,void 0,void 0,(function*(){Oi("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield fe({startTime:e,count:t,channelId:n,topPriority:i})).trans((e=>e.map((e=>Mi(e)))))}))},getConversations:function(e){return Ci(this,void 0,void 0,(function*(){return(yield Fe(e)).trans((e=>e.map(Mi)))}))},getEditedMessageDraft:function(e){return Ci(this,void 0,void 0,(function*(){return we(e)}))},getHistoryMessagesByMessageTypes:function(e,t){return Ci(this,void 0,void 0,(function*(){return(yield G(e,t)).trans((({list:e,hasMore:t})=>{const n=e.map(Ni);return{messages:n,hasMore:t,list:n}}))}))},getLocalMessage:ko,getMessageCount:function(e){return Ci(this,void 0,void 0,(function*(){return F(e)}))},getMessagesAroundTimestamp:function(e,t){return Ci(this,void 0,void 0,(function*(){const n=null==t?void 0:t.timestamp,i=null==t?void 0:t.beforeCount,o=null==t?void 0:t.afterCount;return(yield w(e,n,i,o)).trans((e=>e.map(Ni)))}))},getRemoteConversations:function(){return Ci(this,void 0,void 0,(function*(){return Be()}))},getUnreadMentionedMessages:function(e){return Ci(this,void 0,void 0,(function*(){return(yield B(e)).trans((e=>e.map(Ni)))}))},getUntaggedConversationListByPage:function(e,t,n){return Ci(this,void 0,void 0,(function*(){return(yield He(e,t,n)).trans((e=>e.map((e=>Mi(e)))))}))},insertMessage:Ho,saveEditedMessageDraft:function(e,t){return Ci(this,void 0,void 0,(function*(){return ke(e,t)}))},searchConversationByContent:Or,searchMessageInTimeRange:function(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),Go(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}})}))},searchMessages:xo,searchMessagesByUser:function(e,t,n,i){return Ci(this,void 0,void 0,(function*(){Oi("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield Go(e,{limit:i,keyword:"",order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},searchMessagesWithParams:function(e){return Ci(this,void 0,void 0,(function*(){return(yield H(e)).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>Ni(e)))})))}))},setCheckChatRoomDuplicateMessage:function(e){return Ci(this,void 0,void 0,(function*(){return k(!!e)}))},setCheckDuplicateMessage:function(e){return Ci(this,void 0,void 0,(function*(){return V(e)}))},setMessageContent:function(e,t,n){return Ci(this,void 0,void 0,(function*(){return j(e,t,n)}))},setMessageReceivedStatus:Fo,setMessageReceivedStatusInfo:function(e,t){return Ci(this,void 0,void 0,(function*(){const n=z(t||{});return Y(e,n)}))},setMessageSentStatus:function(e,t){return Ci(this,void 0,void 0,(function*(){return $(e,t)}))},setMessageSpeechToTextVisible:function(e,t){return q(e,t)},setMessageStatusToRead:function(e,t){return Ci(this,void 0,void 0,(function*(){return W(e,t)}))}});function aa(e){return Ci(this,void 0,void 0,(function*(){return en(e)}))}function ua(){return Ci(this,void 0,void 0,(function*(){return Zt()}))}function da(e,t){return Ci(this,void 0,void 0,(function*(){return tn(e,t)}))}function ca(e,t,n){return Ci(this,void 0,void 0,(function*(){return cn(e,t,n)}))}function la(e,t){return Ci(this,void 0,void 0,(function*(){return(yield ln(e,t)).wipe()}))}function fa(e,t,n){return Ci(this,void 0,void 0,(function*(){return rn(e,t,n)}))}function va(e,t){return Ci(this,void 0,void 0,(function*(){return sn(e,t)}))}function Ea(e){return fn(e)}function ha(e){return un(e)}function ma(){return nn()}function pa(e){return vn(e)}function ga(){return on()}function Sa(e){return dn(e)}function _a(e){return an(e)}function Ia(e,t){return Ci(this,void 0,void 0,(function*(){return gn(e,t)}))}function Ta(e){return Ci(this,void 0,void 0,(function*(){return Hn(e)}))}function Aa(e){return Ci(this,void 0,void 0,(function*(){return Rn(e)}))}function Ra(e,t,n){return Ci(this,void 0,void 0,(function*(){return Un(e,t,n)}))}function Ca(e,t){return Ci(this,void 0,void 0,(function*(){return yn(e,t)}))}function Na(e){return Ci(this,void 0,void 0,(function*(){return Sn(e)}))}function Ma(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Bn(e,t,!!n,i)}))}function Oa(e,t){return Ci(this,void 0,void 0,(function*(){return pn(e,t)}))}function Ua(e,t){return Ci(this,void 0,void 0,(function*(){return Ln(e,t)}))}function ya(e,t,n){return Ci(this,void 0,void 0,(function*(){return An(e,t,n)}))}function Pa(e,t){return Ci(this,void 0,void 0,(function*(){return Tn(e,t)}))}function Da(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Fn(e,t,n,i)}))}function ba(e,t,n){return Ci(this,void 0,void 0,(function*(){return Gn(e,t,n)}))}function La(e){return Ci(this,void 0,void 0,(function*(){return On(e)}))}function Ga(e,t){return Ci(this,void 0,void 0,(function*(){return Mn(e,t)}))}function xa(e,t){return Ci(this,void 0,void 0,(function*(){return(yield hn(e,t)).wipe()}))}function Fa(e,t,n){return Ci(this,void 0,void 0,(function*(){return(yield Dn(e,t,n)).wipe()}))}function wa(e,t,n){return Ci(this,void 0,void 0,(function*(){return En(e,t,n)}))}function Ba(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return(yield Pn(e,t,n,i)).wipe()}))}function Ha(e,t,n){return Ci(this,void 0,void 0,(function*(){return _n(e,t,n)}))}function ka(e,t){return Ci(this,void 0,void 0,(function*(){return Nn(t,e)}))}function Va(e,t){return Ci(this,void 0,void 0,(function*(){return xn(e,t)}))}function ja(e){return Ci(this,void 0,void 0,(function*(){return Cn(e)}))}function Ya(e,t){return Ci(this,void 0,void 0,(function*(){return wn(e,t)}))}function za(e,t){return Ci(this,void 0,void 0,(function*(){return mn(e,t)}))}function $a(e,t){return Ci(this,void 0,void 0,(function*(){return bn(e,t)}))}function qa(e){return Ci(this,void 0,void 0,(function*(){return In(e)}))}function Wa(e,t,n){return Vn(e,t,n)}function Xa(e,t){return Yn(e,t)}function Qa(e){return kn(e)}function Ka(e){return Xn(e)}function Ja(e,t,n){return Jn(e,t||"",n)}function Za(e,t){return jn(e,t)}function eu(e,t){return qn(e,t)}function tu(e,t,n){return $n(e,t,n)}function nu(e){return Wn(e)}function iu(e){return Qn(e)}function ou(e){return Kn(e)}function ru(){return zn()}function su(e){!function(e){var t,n,i;bi?Gi.warn(c.A_INIT_REPEAT_O):(r("options.appkey",e.appkey,s.STRING,!0),r("options.navigators",e.navigators,(e=>a(e)&&(0===e.length||e.every(u)))),r("options.loggerProxy",e.loggerProxy,(e=>e instanceof d)),Li=e,bi=o.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!==(t=e.environment)&&void 0!==t?t:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null===(n=e.enableReadReceiptStorage)||void 0===n||n,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),Gi=bi.logger,bi.assignWatcher(Pi))}(e)}function au(){return Ci(this,void 0,void 0,(function*(){return Qi(),function(){return Ci(this,void 0,void 0,(function*(){bi&&(yield o.destroy(),Li=null,bi=null,Gi=null)}))}()}))}function uu(){return xi((e=>e.getConnectionStatus()))}function du(){return xi((e=>e.getServerTime()))}function cu(){return xi((e=>e.getCurrentUserId()))}function lu(e,t){i.add(e,t)}function fu(){return xi((e=>e.getDeviceId()))}function vu(){const e=Zn();return e.isOk?e.data:null}const Eu={COMET:"_",WEBSOCKET:"_"};function hu(e){return ni(e)}function mu(){return ti()}function pu(){return ei()}function gu(e,t){return Ci(this,void 0,void 0,(function*(){return(yield ci(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)).wipe()}))}function Su(e,t){return Ci(this,void 0,void 0,(function*(){return ci(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)}))}function _u(e,t){return Ci(this,void 0,void 0,(function*(){return li(e,t)}))}function Iu(e,t){return Ci(this,void 0,void 0,(function*(){return ui(e,null==t?void 0:t.count,null==t?void 0:t.order)}))}function Tu(e,t){return Ci(this,void 0,void 0,(function*(){return ri(e,t,!1)}))}function Au(e,t){return Ci(this,void 0,void 0,(function*(){return(yield vi(e,t)).wipe()}))}function Ru(e,t){return Ci(this,void 0,void 0,(function*(){return ri(e,t,!0)}))}function Cu(e,t){return Ci(this,void 0,void 0,(function*(){return oi(e,t,!1)}))}function Nu(e,t){return Ci(this,void 0,void 0,(function*(){return fi(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})}))}function Mu(e,t){return Ci(this,void 0,void 0,(function*(){return oi(e,t,!0)}))}function Ou(e,t){return Ci(this,void 0,void 0,(function*(){return ai(e,t)}))}function Uu(e){return Ci(this,void 0,void 0,(function*(){return si(e)}))}function yu(e,t){return Ci(this,void 0,void 0,(function*(){return(yield di(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=>Ni(e)))})))}))}function Pu(e){return Ci(this,void 0,void 0,(function*(){return ii(e)}))}function Du(e){return Ci(this,void 0,void 0,(function*(){return pi(e)}))}function bu(){return Ci(this,void 0,void 0,(function*(){return hi()}))}function Lu(e){return Ci(this,void 0,void 0,(function*(){return mi(e)}))}function Gu(){return Ci(this,void 0,void 0,(function*(){return Ei()}))}function xu(){return gi()}function Fu(e){return Si(e)}function wu(e){return _i(e)}function Bu(e){return Ri(e)}function Hu(e){return Ii(e)}function ku(e){return Ai(e)}function Vu(e){return Ti(e)}export{Ki as BaseMessage,Zi as CombineMessage,eo as CombineV2Message,to as CommandMessage,Eu as ConnectType,Ui as Events,no as FileMessage,io as GIFMessage,ro as GroupNotificationMessage,ho as HQVoiceMessage,so as ImageMessage,uo as InformationNotificationMessage,co as LocationMessage,lo as ReferenceMessage,fo as RichContentMessage,vo as SightMessage,Eo as TextMessage,Co as UploadTask,mo as VoiceMessage,lu as __addSDKVersion,Qa as acceptFriendApplication,wa as acceptGroupApplication,xa as acceptGroupInvite,Zs as addConversationsToTag,$i as addEventListener,Wa as addFriend,za as addGroupFollows,Oa as addGroupManagers,wu as addMessageReaction,Vi as addMonitor,Ws as addTag,Ys as addToBlacklist,Jr as batchClearRemoteHistoryMessages,Wo as batchDeleteConversations,Hu as batchGetMessageReactionSummaries,Wr as batchGetMessageReadReceiptInfoV4,qo as batchRemoveConversation,rr as batchSetConversationNotificationLevel,Er as batchSetConversationToTop,sr as batchSetConversationTranslateStrategy,Pu as bindRTCRoomForChatroom,Za as checkFriends,ir as clearAllMessagesUnreadStatus,Qi as clearEventListeners,Kr as clearHistoryMessages,cs as clearMessages,nr as clearMessagesUnreadStatus,Ir as clearRealtimeConUnreadCount,Ko as clearTextMessageDraft,fs as clearUnreadCountByTimestamp,Yi as connect,Cr as createConversationListLoader,Ia as createGroup,Uo as createUploadTask,Xa as deleteFriends,ds as deleteLocalMessagesByTimestamp,Qr as deleteMessages,au as destroy,zi as disconnect,Na as dismissGroup,sa as electronExtension,Mu as forceRemoveChatRoomEntry,Ru as forceSetChatRoomEntry,Uu as getAllChatRoomEntries,jo as getAllConversationList,xu as getAllRobots,Bs as getAllUltraGroupUnreadCount,Hs as getAllUltraGroupUnreadMentionedCount,gr as getAllUnreadMentionedCount,vu as getAppSettings,Gu as getAutoTranslateEnabled,$s as getBlacklist,qs as getBlacklistStatus,Us as getBlockUltraGroupList,cr as getBlockedConversationList,Ou as getChatRoomEntry,Iu as getChatRoomInfo,yu as getChatroomHistoryMessages,uu as getConnectionStatus,zo as getConversation,Vo as getConversationList,Yo as getConversationListByTimestamp,ur as getConversationNotificationLevel,dr as getConversationNotificationStatus,fr as getConversationTypeNotificationLevel,ia as getConversationsFromTagByPage,Nr as getConversationsIncludingRobots,cu as getCurrentUserId,fu as getDeviceId,bo as getDownloadAuth,Do as getFileToken,Lo as getFileUrl,os as getFirstUnreadMessage,rs as getFirstUnreadMessageInfo,ru as getFriendAddPermission,tu as getFriendApplications,eu as getFriends,nu as getFriendsInfo,Ha as getGroupApplications,qa as getGroupFollows,Pa as getGroupMembers,ya as getGroupMembersByRole,Aa as getGroupsInfo,Br as getHistoryMessages,ja as getJoinedGroups,ka as getJoinedGroupsByRole,Ur as getMessage,Ms as getMessageCountDetail,Vu as getMessageReactionUsers,ku as getMessageReactions,ms as getMessageReadReceiptInfoV5,ps as getMessageReadReceiptInfoV5ByIdentifiers,qr as getMessageReadReceiptV4,ns as getMessageReader,Ns as getMessagesByUIds,Ss as getMessagesReadReceiptByUsersV5,gs as getMessagesReadReceiptUsersByPageV5,ma as getMyUserProfile,ga as getMyUserProfileVisibility,pu as getNotificationQuietHoursSetting,ua as getProxy,_r as getRealtimeConTotalUnreadCount,Ar as getRealtimeConUnreadCounts,Sr as getRealtimeConversations,Hr as getRemoteHistoryMessages,Fu as getRobotById,du as getServerTime,fa as getSubscribeUserList,va as getSubscribeUserStatus,_a as getSubscribeUsersOnlineStatus,Ks as getTags,Js as getTagsFromConversation,Xo as getTextMessageDraft,hr as getTopConversationList,Jo as getTotalUnreadCount,Zo as getTotalUnreadCountByLevels,er as getTotalUnreadMentionedCountByLevels,bu as getTranslationLanguage,xs as getUltraGroupDefaultNotificationLevel,Vs as getUltraGroupFirstUnreadMessageTimestamp,Os as getUltraGroupList,Ps as getUltraGroupMessageListByMessageUId,ws as getUltraGroupUnreadCountByTargetId,js as getUltraGroupUnreadInfoList,Gs as getUltraGroupUnreadMentionedCountByTargetId,ks as getUltraGroupUnreadMentionedMessages,mr as getUnreadConversationList,tr as getUnreadCount,oa as getUnreadCountByTag,Rr as getUnreadMentionMeConversationList,pr as getUnreadMentionedCount,as as getUnreadMentionedMessages,ha as getUserProfiles,su as init,ss as insertMessage,wi as installPlugin,Ga as inviteUsersToGroup,gu as joinChatRoom,Su as joinExistChatRoom,La as joinGroup,Ra as kickGroupMembers,Mr as markRemoteConversationAsRead,As as modifyMessage,Rs as modifyMessageWithParams,qi as onceEventListener,_u as quitChatRoom,Ca as quitGroup,Xr as recallMessage,Cs as refreshReferenceMessageWithParams,Ka as refuseFriendApplication,Ba as refuseGroupApplication,Fa as refuseGroupInvite,is as registerMessageType,Ls as removeAllExpansionForUltraGroupMessage,Nu as removeChatRoomEntries,Cu as removeChatRoomEntry,$o as removeConversation,ea as removeConversationsFromTag,Wi as removeEventListener,Xi as removeEventListeners,bs as removeExpansionForUltraGroupMessage,zs as removeFromBlacklist,$a as removeGroupFollows,Ua as removeGroupManagers,es as removeMessageExpansionForKey,Bu as removeMessageReaction,ji as removeMonitor,mu as removeNotificationQuietHoursSetting,Tr as removeRealtimeConversations,Xs as removeTag,na as removeTagFromConversations,ta as removeTagsFromConversation,_s as requestSpeechToTextForMessage,Es as requestStreamMessageContent,Qo as saveTextMessageDraft,ls as searchConversationByContent,iu as searchFriendsInfo,ba as searchGroupMembers,Va as searchJoinedGroups,us as searchMessages,Sa as searchUserProfileByUniqueId,Lr as sendFileMessage,xr as sendGIFMessage,Fr as sendHQVoiceMessage,Gr as sendImageMessage,yr as sendMessage,kr as sendReadReceiptMessage,$r as sendReadReceiptMessageV4,Vr as sendReadReceiptRequest,jr as sendReadReceiptResponse,Yr as sendReadReceiptResponseV2,hs as sendReadReceiptResponseV5,wr as sendSightMessage,zr as sendSyncReadStatusMessage,Pr as sendTextMessage,ts as sendTypingStatusMessage,ys as sendUltraGroupTypingStatus,Lu as setAutoTranslateEnabled,Au as setChatRoomEntries,Tu as setChatRoomEntry,or as setConversationNotificationLevel,ar as setConversationNotificationStatus,vr as setConversationToTop,ra as setConversationToTopInTag,lr as setConversationTypeNotificationLevel,ou as setFriendAddPermission,Ja as setFriendInfo,Da as setGroupMemberInfo,Ya as setGroupRemark,vs as setMessageReceivedStatus,hu as setNotificationQuietHoursWithSetting,aa as setProxy,Du as setTranslationLanguage,Fs as setUltraGroupDefaultNotificationLevel,yo as stopUploadTask,ca as subscribeUserStatus,da as testProxy,Ma as transferGroupOwner,Is as translateMessagesWithParams,Ts as translateTextsWithParams,la as unSubscribeUserStatus,Ds as updateExpansionForUltraGroupMessage,Ta as updateGroupInfo,Zr as updateMessageExpansion,Ea as updateMyUserProfile,pa as updateMyUserProfileVisibility,Qs as updateTag,Po as upload};
|