@rongcloud/electron 5.18.0-alpha.2 → 5.20.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{platform as t,arch as e,networkInterfaces as n,type as o,version as r,release as i,uptime as s,cpus as a,freemem as _,totalmem as c}from"os";import{dirname as u,resolve as E}from"path";import{createRequire as R}from"module";import{createDecipheriv as l,createHash as d}from"crypto";import{existsSync as p,mkdirSync as C,readFileSync as T,writeFileSync as S}from"fs";import{fileURLToPath as I,parse as N}from"url";import{fork as h}from"child_process";import{Agent as f,request as O}from"http";import{Agent as A,request as g}from"https";import v from"zlib";import{isIP as P,Socket as L}from"net";import{EventEmitter as m}from"events";import{connect as y}from"tls";
1
+ import{platform as e,arch as t,networkInterfaces as r,type as n,version as i,release as o,uptime as a,cpus as s,freemem as u,totalmem as c}from"os";import{dirname as l,resolve as _}from"path";import{createRequire as E}from"module";import{createDecipheriv as d,createHash as f}from"crypto";import{existsSync as p,mkdirSync as R,readFileSync as b,writeFileSync as O}from"fs";import{fileURLToPath as C,parse as g}from"url";import{fork as T}from"child_process";import{request as h,Agent as I}from"http";import{request as S,Agent as v}from"https";import N from"zlib";import{isIP as P,Socket as m}from"net";import{EventEmitter as A}from"events";import{connect as y}from"tls";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -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
- ***************************************************************************** */var M=function(t,e){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},M(t,e)};function U(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}M(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var D,G,V,b,F,w,x,H,B,k,J,W,Y,K,X,j,Q,Z,q,z,$,tt,et,nt,ot,rt,it,st,at,_t,ct,ut,Et,Rt,lt,dt,pt,Ct,Tt,St,It,Nt,ht,ft,Ot,At,gt,vt,Pt,Lt,mt,yt,Mt,Ut,Dt,Gt,Vt,bt,Ft,wt,xt,Ht,Bt,kt,Jt,Wt,Yt,Kt,Xt=function(){return Xt=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Xt.apply(this,arguments)};function jt(t,e,n,o){return new(n||(n=Promise))((function(r,i){function s(t){try{_(o.next(t))}catch(t){i(t)}}function a(t){try{_(o.throw(t))}catch(t){i(t)}}function _(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}_((o=o.apply(t,e||[])).next())}))}function Qt(t,e){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function Zt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function qt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}function zt(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function $t(t,e,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(t):o?o.value:e.get(t)}function te(t,e,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,n):r?r.value=n:e.set(t,n),n}!function(t){t[t.QINIU=1]="QINIU",t[t.ALI=2]="ALI",t[t.AWS=3]="AWS",t[t.STC=4]="STC",t[t.MINIO=5]="MINIO"}(D||(D={})),function(t){t.L_IMSDK_VER_O="L-imsdk_ver-O",t.A_INIT_REPEAT_O="A_INIT_REPEAT_O",t.L_INIT_O="L-init-O",t.A_DESTROY_O="A_DESTROY_O",t.L_DESTROY_O="L_DESTROY_O",t.A_CONNECT_T="A-connect-T",t.A_CONNECT_R="A-connect-R",t.A_CONNECT_S="A-connect-S",t.A_DISCONNECT_O="A-disconnect-O",t.A_RECONNECT_T="A-reconnect-T",t.A_RECONNECT_R="A_RECONNECT_R",t.L_CONNECT_T="L-connect-T",t.L_CONNECT_R="L-connect-R",t.L_CONNECT_S="L-connect-S",t.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",t.L_DB_UPGRATING_S="L-db_upgrating-S",t.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",t.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",t.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",t.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",t.A_MSG_LISTENER_E="A-MSG_LISTENER-E",t.O="L-original-O",t.T="L-TEST-O",t.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",t.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",t.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",t.L_NAVI_CMP_R="L-NAVI_CPM-R",t.A_SEND_MSG_T="A-send_msg-T",t.A_SEND_MSG_R="A-send_msg-R",t.L_SEND_MSG_T="L-send_msg-T",t.L_SEND_MSG_R="L-send_msg-R",t.L_PULL_MSG_T="L-pull_msg-T",t.L_PULL_MSG_R="L-pull_msg-R",t.L_PULL_MSG_E="L-pull_msg-E",t.L_PULL_MSG_O="L-pull_msg-O",t.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",t.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",t.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",t.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",t.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",t.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",t.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",t.L_RECV_S_MSG_O="L-recv_s_msg-O",t.A_DELETE_MESSAGES_S="A-delete_messages-S",t.P_DELETE_MSG_S="P-delete_msg-S",t.L_PULL_CONVERSATION_S="L-pull_conversation-S",t.A_RECALL_MESSAGE_T="A-recall_msg-T",t.A_RECALL_MESSAGE_R="A-recall_msg-R",t.A_RECALL_MESSAGE_E="A-recall_msg-E",t.A_REGTYP_O="A-regtyp-O",t.P_REGTYP_E="P-regtype-E",t.L_GET_NAVI_T="L-get_navi-T",t.L_GET_NAVI_R="L-get_navi-R",t.L_REQUEST_T="L-request-T",t.L_REQUEST_R="L-request-R",t.L_PARSE_NAVI_E="L-parse_navi-E",t.L_ENV_S="L-Env-S",t.L_GET_INDEX_NAVI_S="L-get_index_navi-S",t.A_JOIN_CHATROOM_T="A-join_chatroom-T",t.A_JOIN_CHATROOM_R="A-join_chatroom-R",t.L_JOIN_CHATROOM_T="L-join_chatroom-T",t.L_JOIN_CHATROOM_R="L-join_chatroom-R",t.A_QUIT_CHATROOM_T="A-quit_chatroom-T",t.A_QUIT_CHATROOM_R="A-quit_chatroom-R",t.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",t.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",t.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",t.L_MEDIA_S="L-media-S",t.L_MEDIA_UPLOAD_T="L-media_upload-T",t.L_MEDIA_UPLOAD_R="L-media_upload-R",t.G_UPLOAD_LOG_S="G-upload_log-S",t.G_REPORT_LOG_S="G-report_log-S",t.G_UPLOAD_LOG_E="G-upload_log-E",t.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",t.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",t.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",t.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",t.A_GET_LOCAL_MESSAGE_T="A-get_local_message-T",t.A_GET_LOCAL_MESSAGE_R="A-get_local_message-R",t.A_GET_HISTORY_MSG_T="A-get_history_msg-T",t.A_GET_HISTORY_MSG_R="A-get_history_msg-R",t.L_GET_HISTORY_MSG_T="L-get_history_msg-T",t.L_GET_HISTORY_MSG_R="L-get_history_msg-R",t.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",t.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",t.A_CALLBACK_O="A-callback-O",t.A_CALLBACK_E="A-callback-E",t.L_CALLBACK_E="L-callback-E",t.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",t.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",t.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",t.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",t.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",t.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",t.A_SYNC_READ_STATUS_T="A-sync_read_status-T",t.A_SYNC_READ_STATUS_R="A-sync_read_status-R",t.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",t.L_PB_ENCODE_E="L-pb-encode-E",t.L_PB_DECODE_E="L-pb-decode-E",t.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",t.L_REPORT_FULL_LOG_O="L-report_full_log-O",t.L_REPORT_FULL_LOG_T="L-report_full_log-T",t.L_REPORT_FULL_LOG_R="L-report_full_log-R",t.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",t.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",t.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",t.L_LOGDB_CLOSED_S="L-logDB_closed-S",t.L_LOGDB_ERROR_E="L-logDB_error-S",t.L_LOGDB_ABORT_S="L-logDB_abort-S",t.L_REALTIME_LOG_R="L_REALTIME_LOG_R",t.L_REALTIME_LOG_O="L_REALTIME_LOG_O",t.L_REALTIME_LOG_T="L_REALTIME_LOG_T",t.L_STATISTIC_LOG_R="L_STATISTIC_LOG_R",t.L_STATISTIC_LOG_O="L_STATISTIC_LOG_O",t.L_STATISTIC_LOG_T="L_STATISTIC_LOG_T",t.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",t.L_RECV_RMTP_O="L_RECV_RMTP_O",t.L_RECV_RMTP_E="L_RECV_RMTP_E",t.L_RECV_S_NTF_O="L-recv_s_ntf_O",t.L_VER_REPORT_T="L-VER_REPORT-T",t.L_VER_REPORT_R="L-VER_REPORT-R",t.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",t.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",t.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",t.A_REMOVE_PROXY_O="A-remove_proxy-O",t.A_SET_PROXY_O="A-set_proxy-O",t.A_TEST_PROXY_O="A-test_proxy-O",t.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",t.A_SEARCH_MESSAGE_BY_USER_T="A-search_messages_by_user-T",t.A_SEARCH_MESSAGE_BY_USER_R="A-search_messages_by_user-R",t.L_GET_STATIC_CONF_T="L-get_static_conf-T",t.L_GET_STATIC_CONF_R="L-get_static_conf-R",t.L_GET_STATIC_CONF_E="L-get_static_conf-E",t.L_CLOUD_DISABLED="L-cloud_disabled",t.L_CLOUD_EXPIRE="L-cloud_expire",t.L_CLOUD_OVERCLOCK="L-cloud_overclock",t.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",t.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",t.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",t.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",t.L_CLOUD_MSG_NTF_O="L-cloud_msg_ntf-O",t.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",t.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",t.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",t.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",t.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",t.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",t.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",t.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",t.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",t.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",t.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",t.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",t.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",t.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",t.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",t.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",t.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",t.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",t.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S="L-pull_event_change_notify_ultra_online-S",t.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",t.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",t.L_PARSE_JSON_E="L-parse_json-E",t.L_REQ_STREAM_MSG_CONTENT_T="L-req_stream_msg_content-T",t.L_REQ_STREAM_MSG_CONTENT_R="L-req_stream_msg_content-R",t.L_REQ_STREAM_MSG_CONTENT_O="L-req_stream_msg_content-O",t.L_REQ_STREAM_MSG_CONTENT_E="L-req_stream_msg_content-E"}(G||(G={})),function(t){t[t.BOTH=2]="BOTH"}(V||(V={})),function(t){t[t.BOTH=2]="BOTH"}(b||(b={})),function(t){t[t.FREE=1]="FREE",t[t.NEED_VERIFY=2]="NEED_VERIFY",t[t.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(F||(F={})),function(t){t[t.NONE=0]="NONE",t[t.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",t[t.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",t[t.BOTH_WAY=3]="BOTH_WAY"}(w||(w={})),function(t){t[t.SENT=1]="SENT",t[t.RECEIVED=2]="RECEIVED"}(x||(x={})),function(t){t[t.UNHANDLED=0]="UNHANDLED",t[t.ACCEPTED=1]="ACCEPTED",t[t.REFUSED=2]="REFUSED",t[t.EXPIRED=3]="EXPIRED"}(H||(H={})),function(t){t[t.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(B||(B={})),function(t){t[t.FRIEND_APPLY=0]="FRIEND_APPLY",t[t.FRIEND_REFUSE=1]="FRIEND_REFUSE",t[t.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",t[t.FRIENDS_INPUT=3]="FRIENDS_INPUT",t[t.FRIEND_CLEAR=4]="FRIEND_CLEAR",t[t.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",t[t.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(k||(k={})),function(t){t[t.OWNER_VERIFY=0]="OWNER_VERIFY",t[t.FREE=1]="FREE",t[t.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",t[t.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(J||(J={})),function(t){t[t.OWNER=0]="OWNER",t[t.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",t[t.EVERYONE=2]="EVERYONE"}(W||(W={})),function(t){t[t.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",t[t.OWNER_OR_SELF=1]="OWNER_OR_SELF",t[t.SELF=2]="SELF"}(Y||(Y={})),function(t){t[t.FREE=0]="FREE",t[t.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(K||(K={})),function(t){t[t.UNDEF=0]="UNDEF",t[t.NORMAL=1]="NORMAL",t[t.MANAGER=2]="MANAGER",t[t.OWNER=3]="OWNER"}(X||(X={})),function(t){t[t.CREATE=0]="CREATE",t[t.JOIN=1]="JOIN",t[t.KICK=2]="KICK",t[t.QUIT=3]="QUIT",t[t.DISMISS=4]="DISMISS",t[t.ADD_MANAGER=5]="ADD_MANAGER",t[t.REMOVE_MANAGER=6]="REMOVE_MANAGER",t[t.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(j||(j={})),function(t){t[t.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",t[t.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",t[t.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",t[t.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(Q||(Q={})),function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE"}(Z||(Z={})),function(t){t[t.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",t[t.MANAGER_REFUSED=1]="MANAGER_REFUSED",t[t.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",t[t.INVITEE_REFUSED=3]="INVITEE_REFUSED",t[t.JOINED=4]="JOINED",t[t.EXPIRED=5]="EXPIRED"}(q||(q={})),function(t){t[t.REFUSE=0]="REFUSE",t[t.ACCEPT=1]="ACCEPT"}(z||(z={})),function(t){t[t.APPLICANT=0]="APPLICANT",t[t.MANAGER=1]="MANAGER"}($||($={})),function(t){t[t.GROUP_OPERATION=11]="GROUP_OPERATION",t[t.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",t[t.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",t[t.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(tt||(tt={})),function(t){t[t.APPLICATION=0]="APPLICATION",t[t.INVITATION=1]="INVITATION"}(et||(et={})),function(t){t[t.APPLICATION_SENT=0]="APPLICATION_SENT",t[t.INVITATION_SENT=1]="INVITATION_SENT",t[t.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",t[t.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(nt||(nt={})),function(t){t[t.UPDATE=1]="UPDATE",t[t.DELETE=2]="DELETE"}(ot||(ot={})),function(t){t[t.QUIT=0]="QUIT",t[t.JOIN=1]="JOIN"}(rt||(rt={})),function(t){t[t.LeaveOnMyOwn=0]="LeaveOnMyOwn",t[t.OtherDeviceLogin=1]="OtherDeviceLogin"}(it||(it={})),function(t){t[t.QUIT=0]="QUIT",t[t.JOIN=1]="JOIN"}(st||(st={})),function(t){t[t.UnmuteUsers=0]="UnmuteUsers",t[t.MuteUsers=1]="MuteUsers",t[t.UnmuteAll=2]="UnmuteAll",t[t.MuteAll=3]="MuteAll",t[t.RemoveWhitelist=4]="RemoveWhitelist",t[t.AddWhitelist=5]="AddWhitelist",t[t.UnmuteGloble=6]="UnmuteGloble",t[t.MuteGloble=7]="MuteGloble"}(at||(at={})),function(t){t[t.Deblock=0]="Deblock",t[t.Blocked=1]="Blocked"}(_t||(_t={})),function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",t[t.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",t[t.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",t[t.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",t[t.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",t[t.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",t[t.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",t[t.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",t[t.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",t[t.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",t[t.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",t[t.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",t[t.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",t[t.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",t[t.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",t[t.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",t[t.NOT_IN_GROUP=22406]="NOT_IN_GROUP",t[t.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",t[t.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",t[t.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",t[t.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",t[t.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",t[t.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",t[t.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",t[t.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",t[t.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",t[t.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",t[t.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",t[t.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",t[t.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",t[t.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",t[t.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",t[t.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",t[t.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",t[t.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",t[t.HAVNODEVICEID=24001]="HAVNODEVICEID",t[t.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",t[t.FEILD=24009]="FEILD",t[t.INTERNALERRROR=24015]="INTERNALERRROR",t[t.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",t[t.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",t[t.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",t[t.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",t[t.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",t[t.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",t[t.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",t[t.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",t[t.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",t[t.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",t[t.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",t[t.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",t[t.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",t[t.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",t[t.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",t[t.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",t[t.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",t[t.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",t[t.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",t[t.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",t[t.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",t[t.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",t[t.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",t[t.RECALL_MESSAGE=25101]="RECALL_MESSAGE",t[t.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",t[t.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",t[t.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",t[t.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",t[t.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",t[t.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",t[t.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",t[t.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",t[t.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",t[t.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",t[t.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",t[t.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",t[t.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",t[t.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",t[t.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",t[t.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",t[t.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",t[t.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",t[t.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",t[t.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",t[t.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",t[t.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",t[t.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",t[t.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",t[t.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",t[t.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",t[t.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",t[t.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",t[t.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",t[t.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",t[t.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",t[t.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",t[t.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",t[t.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",t[t.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",t[t.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",t[t.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",t[t.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",t[t.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",t[t.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",t[t.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",t[t.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",t[t.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",t[t.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",t[t.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",t[t.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",t[t.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",t[t.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",t[t.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",t[t.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",t[t.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",t[t.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",t[t.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",t[t.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",t[t.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",t[t.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",t[t.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",t[t.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",t[t.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",t[t.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",t[t.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",t[t.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",t[t.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",t[t.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",t[t.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",t[t.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",t[t.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",t[t.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",t[t.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",t[t.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",t[t.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",t[t.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",t[t.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",t[t.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",t[t.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",t[t.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",t[t.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",t[t.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",t[t.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",t[t.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",t[t.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",t[t.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",t[t.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",t[t.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",t[t.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",t[t.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",t[t.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",t[t.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",t[t.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",t[t.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",t[t.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",t[t.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",t[t.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",t[t.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",t[t.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",t[t.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",t[t.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",t[t.RC_OTP_USED=31027]="RC_OTP_USED",t[t.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",t[t.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",t[t.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",t[t.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",t[t.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",t[t.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",t[t.RC_TCP_RESET=32054]="RC_TCP_RESET",t[t.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",t[t.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",t[t.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",t[t.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",t[t.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",t[t.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",t[t.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",t[t.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",t[t.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",t[t.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",t[t.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",t[t.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",t[t.TAG_EXISTS=33101]="TAG_EXISTS",t[t.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",t[t.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",t[t.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",t[t.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",t[t.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",t[t.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",t[t.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",t[t.UPLOAD_FAIL=34011]="UPLOAD_FAIL",t[t.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",t[t.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",t[t.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",t[t.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",t[t.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",t[t.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",t[t.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",t[t.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",t[t.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",t[t.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",t[t.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",t[t.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",t[t.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",t[t.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",t[t.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",t[t.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",t[t.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",t[t.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",t[t.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",t[t.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",t[t.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",t[t.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",t[t.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",t[t.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",t[t.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",t[t.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",t[t.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",t[t.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",t[t.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",t[t.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",t[t.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",t[t.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",t[t.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",t[t.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",t[t.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",t[t.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",t[t.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",t[t.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",t[t.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",t[t.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",t[t.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",t[t.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",t[t.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",t[t.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",t[t.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",t[t.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",t[t.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",t[t.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",t[t.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",t[t.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",t[t.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",t[t.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",t[t.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",t[t.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",t[t.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",t[t.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",t[t.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",t[t.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",t[t.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",t[t.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",t[t.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",t[t.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",t[t.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",t[t.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",t[t.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",t[t.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",t[t.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",t[t.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",t[t.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",t[t.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",t[t.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",t[t.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",t[t.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",t[t.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",t[t.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",t[t.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",t[t.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",t[t.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",t[t.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",t[t.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",t[t.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",t[t.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",t[t.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",t[t.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",t[t.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",t[t.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",t[t.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",t[t.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",t[t.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",t[t.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",t[t.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",t[t.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",t[t.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",t[t.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",t[t.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",t[t.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",t[t.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",t[t.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",t[t.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",t[t.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",t[t.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",t[t.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",t[t.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",t[t.NOT_SUPPORT=35004]="NOT_SUPPORT",t[t.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",t[t.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",t[t.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",t[t.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",t[t.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",t[t.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",t[t.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",t[t.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",t[t.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",t[t.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",t[t.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",t[t.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",t[t.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",t[t.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",t[t.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",t[t.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",t[t.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",t[t.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",t[t.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",t[t.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",t[t.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",t[t.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",t[t.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",t[t.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",t[t.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",t[t.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",t[t.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",t[t.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",t[t.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",t[t.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",t[t.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",t[t.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",t[t.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",t[t.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",t[t.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",t[t.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",t[t.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",t[t.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",t[t.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",t[t.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",t[t.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",t[t.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",t[t.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",t[t.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",t[t.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",t[t.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",t[t.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",t[t.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",t[t.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",t[t.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",t[t.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",t[t.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",t[t.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",t[t.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",t[t.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",t[t.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",t[t.TIMEOUT=-1]="TIMEOUT"}(ct||(ct={})),function(t){t[t.NONE=0]="NONE",t[t.PRIVATE=1]="PRIVATE",t[t.DISCUSSION=2]="DISCUSSION",t[t.GROUP=3]="GROUP",t[t.CHATROOM=4]="CHATROOM",t[t.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",t[t.SYSTEM=6]="SYSTEM",t[t.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",t[t.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",t[t.ULTRA_GROUP=10]="ULTRA_GROUP",t[t.RTC_ROOM=12]="RTC_ROOM"}(ut||(ut={})),function(t){t[t.RMTP=1]="RMTP",t[t.TLS=2]="TLS",t[t.RPP=3]="RPP",t[t.QUIC=4]="QUIC",t[t.WS=5]="WS",t[t.WSS=6]="WSS",t[t.HTTP=11]="HTTP",t[t.HTTPS=12]="HTTPS"}(Et||(Et={})),function(t){t[t.IMAGE=1]="IMAGE",t[t.AUDIO=2]="AUDIO",t[t.VIDEO=3]="VIDEO",t[t.FILE=4]="FILE",t[t.SIGHT=5]="SIGHT",t[t.COMBINE_HTML=6]="COMBINE_HTML"}(Rt||(Rt={})),function(t){t[t.ALL=1]="ALL",t[t.SINGAL=2]="SINGAL"}(lt||(lt={})),function(t){t.TextMessage="RC:TxtMsg",t.VOICE="RC:VcMsg",t.HQ_VOICE="RC:HQVCMsg",t.IMAGE="RC:ImgMsg",t.GIF="RC:GIFMsg",t.RICH_CONTENT="RC:ImgTextMsg",t.LOCATION="RC:LBSMsg",t.FILE="RC:FileMsg",t.SIGHT="RC:SightMsg",t.COMBINE="RC:CombineMsg",t.COMBINE_V2="RC:CombineV2Msg",t.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",t.LOG_COMMAND="RC:LogCmdMsg",t.EXPANSION_NOTIFY="RC:MsgExMsg",t.REFERENCE="RC:ReferenceMsg",t.RECALL="RC:RcCmd",t.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",t.READ_RECEIPT="RC:ReadNtf",t.READ_RECEIPT_REQUEST="RC:RRReqMsg",t.READ_RECEIPT_RESPONSE="RC:RRRspMsg",t.SYNC_READ_STATUS="RC:SRSMsg",t.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",t.READ_STATE="RC:RSMsg",t.DELIVERED="RC:Delivered",t.DELIVERED_MSG="RC:DRMsg",t.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",t.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",t.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",t.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",t.TYPING_STATUS="RC:TypSts",t.INTERCEPT="RC:InterceptMsg",t.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg",t.STREAM_MESSAGE="RC:StreamMsg"}(dt||(dt={})),function(t){t[t.PUBLIC=0]="PUBLIC",t[t.PRIVATE=1]="PRIVATE"}(pt||(pt={})),function(t){t[t.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",t[t.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",t[t.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Ct||(Ct={})),function(t){t[t.MSG_EXPANSION=1]="MSG_EXPANSION",t[t.MSG_MODIFY=2]="MSG_MODIFY",t[t.MSG_RECALL=3]="MSG_RECALL",t[t.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",t[t.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE"}(Tt||(Tt={})),function(t){t[t.CHANNEL_DELETE=1]="CHANNEL_DELETE",t[t.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",t[t.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",t[t.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",t[t.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",t[t.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(St||(St={})),function(t){t[t.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",t[t.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",t[t.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",t[t.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",t[t.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(It||(It={})),function(t){t[t.NOT_MENTIONED=0]="NOT_MENTIONED",t[t.ALL=1]="ALL",t[t.ME=2]="ME"}(Nt||(Nt={})),function(t){t[t.SENDING=10]="SENDING",t[t.FAILED=20]="FAILED",t[t.SENT=30]="SENT",t[t.RECEIVED=40]="RECEIVED",t[t.READ=50]="READ",t[t.DESTROYED=60]="DESTROYED"}(ht||(ht={})),function(t){t[t.typing=0]="typing"}(ft||(ft={})),function(t){t[t.ONLINE=1]="ONLINE",t[t.OFFLINE=0]="OFFLINE"}(Ot||(Ot={})),function(t){t[t.Other=0]="Other",t[t.iOS=1]="iOS",t[t.Android=2]="Android",t[t.Web=3]="Web",t[t.PC=4]="PC",t[t.Mini=5]="Mini",t[t.HarmonyOS=6]="HarmonyOS"}(At||(At={})),function(t){t[t.ONLINE_STATUS=1]="ONLINE_STATUS",t[t.USER_PROFILE=2]="USER_PROFILE",t[t.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",t[t.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(gt||(gt={})),function(t){t[t.SUBSCRIBE=0]="SUBSCRIBE",t[t.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(vt||(vt={})),function(t){t[t.NOT_SET=0]="NOT_SET",t[t.INVISIBLE=1]="INVISIBLE",t[t.EVERYONE=2]="EVERYONE",t[t.FriendVisible=3]="FriendVisible"}(Pt||(Pt={})),function(t){t[t.CONNECTED=0]="CONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.DISCONNECTED=2]="DISCONNECTED",t[t.SUSPENDED=3]="SUSPENDED"}(Lt||(Lt={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.CUSTOM=2]="CUSTOM",t[t.THIRD_PARTY=3]="THIRD_PARTY"}(mt||(mt={})),function(t){t[t.MSG_ORIGINAL=0]="MSG_ORIGINAL",t[t.MSG_EXPANSION=1]="MSG_EXPANSION",t[t.MSG_MODIFY=2]="MSG_MODIFY"}(yt||(yt={})),function(t){t[t.SEND=1]="SEND",t[t.RECEIVE=2]="RECEIVE"}(Mt||(Mt={})),function(t){t.NORMAL="NORMAL",t.LOW="LOW"}(Ut||(Ut={})),function(t){t.IM_NAVI="IM-stats_navi-S",t.IM_WEBSOCKET="IM-stats_websocket-S",t.IM_CONNECTION_DURATION="IM-stats_con_dur-S",t.IM_CMP="IM-stats_cmp-S",t.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",t.IM_STATS_CS="IM-stats_cs-S",t.IM_NETWORK_CHANGE="IM-stats_network_change-S",t.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",t.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",t.IM_MSG_SEND="IM-msg_send-S",t.IM_MSG_RECEIVE="IM-msg_receive-S"}(Dt||(Dt={})),function(t){t[t.OPEN=1]="OPEN",t[t.CLOSE=2]="CLOSE"}(Gt||(Gt={})),function(t){t[t.ALL_MESSAGE=-1]="ALL_MESSAGE",t[t.NOT_SET=0]="NOT_SET",t[t.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",t[t.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",t[t.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",t[t.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(Vt||(Vt={})),function(t){t[t.READ=1]="READ",t[t.LISTENED=2]="LISTENED",t[t.DOWNLOADED=4]="DOWNLOADED",t[t.RETRIEVED=8]="RETRIEVED",t[t.UNREAD=0]="UNREAD"}(bt||(bt={})),function(t){t[t.PRIVATE=1]="PRIVATE",t[t.OPEN=0]="OPEN"}(Ft||(Ft={})),function(t){t[t.NAVI=1]="NAVI",t[t.TCP=2]="TCP",t[t.WS=3]="WS"}(wt||(wt={})),function(t){t[t.REQUEST=0]="REQUEST",t[t.LOCAL=1]="LOCAL"}(xt||(xt={})),function(t){t[t.CURRENT=2]="CURRENT"}(Ht||(Ht={})),function(t){t[t.CONNECT=0]="CONNECT",t[t.RECONNECT=1]="RECONNECT"}(Bt||(Bt={})),function(t){t[t.CONNECT=0]="CONNECT",t[t.RECONNECT=1]="RECONNECT",t[t.REDIRECTED=3]="REDIRECTED",t[t.TIMEOUT=4]="TIMEOUT"}(kt||(kt={})),function(t){t.PASSIVE="passive",t.ACTIVE="active",t.TIME_SENSITIVE="time-sensitive",t.CRITICAL="critical"}(Jt||(Jt={})),function(t){t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(Wt||(Wt={})),function(t){t.WIFI="wifi",t.FOUR_G="4g",t.THREE_G="3g",t.TWO_G="2g",t.FIVE_G="2g",t.THREE_GENT="3gnet",t.UNKONWN="unknown"}(Yt||(Yt={})),function(t){t.GET="GET",t.POST="POST",t.PUT="PUT"}(Kt||(Kt={}));var ee=72e5,ne={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0,searchProps:["name"]},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:CombineV2Msg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:StreamMsg":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcNtf":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RcCmd":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:Delivered":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1},"RC:CCConfigChangeRequestMsg":{isCounted:!1,isPersited:!1}},oe="5.18.0-alpha.2".replace(/-.+$/,""),re="rongcloudsystem",ie="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};ie.engine="5.18.0-alpha.2";var se=function(){function t(){}return t.add=function(t,e){ie[t]=e},t.validEngine=function(t){var e=t.match(/\d+\.\d+\.\d+/);if(!e)return!1;var n=e[0].split(".").map((function(t){return t.padStart(3,"0")})).join("");return ie.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(t){return t.padStart(3,"0")})).join("")>=n},t.getInfo=function(){return ie},t}();var ae=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=Math.floor(36*Math.random());return("x"===t?e:3&e|8).toString(36)}))},_e=function(t){void 0===t&&(t=22);var e,n=Date.now(),o=n.toString(36),r=Math.floor(Math.random()*n).toString(36),i=t-o.length-r.length;return[r,o,i>0?(e=i,Array.from({length:e}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,t)}(22),ce=Date.now();!function(t){function e(e){var n=t.call(this,e)||this;return n.name="CMSYError",n}U(e,t),e.InvalidParameters=function(t){return(null==t?void 0:t.length)?new e("Invalid parameter -> ".concat(t)):new e("Invalid parameters.")},e.ParameterTypeError=function(){return new e("Wrong parameter type")}}(Error);var ue=function(){function t(){this._map=new Map,this._piped=new Set}return t.prototype._addItem=function(t,e,n,o,r){void 0===r&&(r=0);var i=Symbol(),s=this._map.get(t)||this._map.set(t,[]).get(t),a={symbol:i,priority:Math.min(r,100),listener:e.bind(o),once:n},_=s.findIndex((function(t){return t.priority>r}));return-1===_?s.push(a):s.splice(_,0,a),i},t.prototype.on=function(t,e,n,o){return void 0===o&&(o=0),this._addItem(t,e,!1,n,o)},t.prototype.once=function(t,e,n,o){return void 0===o&&(o=0),this._addItem(t,e,!0,n,o)},t.prototype.off=function(t){var e,n;try{for(var o=Zt(this._map),r=o.next();!r.done;r=o.next()){var i=qt(r.value,2),s=(i[0],i[1]),a=s.findIndex((function(e){return e.symbol===t}));if(-1!==a)return void s.splice(a,1)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this._map.get(t);if(o&&o.length>0)for(var r=o.length-1;r>=0;r-=1){var i=o[r],s=i.once,a=i.listener;s&&o.splice(r,1);try{a.apply(void 0,zt([],qt(e),!1))}catch(t){null===console||void 0===console||console.error(t)}}zt([],qt(this._piped.values()),!1).forEach((function(n){return n.emit.apply(n,zt([t],qt(e),!1))}))},t.prototype.removeAll=function(t){this._map.delete(t)},t.prototype.clear=function(){this._piped.clear(),this._map.clear()},t.prototype.pipe=function(t){this._piped.add(t)},t}();!function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._versionQueue=[],e._isPulling=null,e._dataVersion=0,e._invervalTimer=-1,e._intervalGap=0,e}U(e,t),e.prototype.setInitVersion=function(t,e){return jt(this,void 0,void 0,(function(){return Qt(this,(function(n){switch(n.label){case 0:return 0!==this._dataVersion?[2]:(this._dataVersion=t,e?[4,this._execPulling()]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.push=function(t){t<this._dataVersion||(this._versionQueue.push(t),0!==this._dataVersion&&this._execPulling())},e.prototype._execPulling=function(){return jt(this,void 0,void 0,(function(){var t,e,n,o,r;return Qt(this,(function(i){switch(i.label){case 0:return this._isPulling?[4,this._isPulling]:[3,2];case 1:return i.sent(),[2];case 2:return this._isPulling=this._sendRequest(this._dataVersion),[4,this._isPulling];case 3:if(t=i.sent(),e=t.code,n=t.version,o=t.hasNext,this._isPulling=null,0!==e)return[2];if(void 0===n||n<this._dataVersion)throw new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(n));return r=this._versionQueue.filter((function(t){return t>n})),this._versionQueue=zt([],qt(r),!1),this._dataVersion=n,this._resetIntervalTimer(),o?(this._execPulling(),[2]):(this._versionQueue.length>0&&(this._versionQueue.length=0,this._execPulling()),[2])}}))}))},e.prototype.startInterval=function(t){var e=this;-1===this._invervalTimer&&(this._intervalGap=t,this._invervalTimer=setInterval((function(){return e._execPulling()}),t))},e.prototype._resetIntervalTimer=function(){var t=this;-1!==this._invervalTimer&&(clearInterval(this._invervalTimer),this._invervalTimer=setInterval((function(){return t._execPulling()}),this._intervalGap))},e.prototype.stopInterval=function(){-1!==this._invervalTimer&&clearInterval(this._invervalTimer)},e.prototype.reset=function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=0}}(ue);var Ee=function(){function t(t,e,n){this.code=t,this.msg=e,this.data=n,this.isOk=0===t}return t.prototype.next=function(t){return jt(this,void 0,void 0,(function(){return Qt(this,(function(e){return this.isOk?[2,t(this.data)]:[2,this.wipe()]}))}))},t.prototype.or=function(t){return jt(this,void 0,void 0,(function(){return Qt(this,(function(e){return this.isOk?[2,this]:[2,t(this.code)]}))}))},t.prototype.trans=function(t){return this.isOk?Re(t(this.data)):this.wipe()},t.prototype.tryTrans=function(t){return this.isOk?t(this.data):this.wipe()},t.prototype.errmsg=function(){return JSON.stringify({code:this.code,msg:this.msg})},t.prototype.wipe=function(){return this.isOk?Re(void 0,this.msg):le(this.code,this.msg)},t}(),Re=function(t,e){return new Ee(0,e||"success",t)},le=function(t,e,n){return new Ee(t,e||"fail: ".concat(t),n)},de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function pe(t){var e,n,o,r,i,s,a="",_=0;for(t=t.replace(/[^A-Za-z0-9+/=]/g,"");_<t.length;)e=de.indexOf(t.charAt(_++))<<2|(r=de.indexOf(t.charAt(_++)))>>4,n=(15&r)<<4|(i=de.indexOf(t.charAt(_++)))>>2,o=(3&i)<<6|(s=de.indexOf(t.charAt(_++))),a+=String.fromCharCode(e),64!==i&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(o));return a}var Ce=function(t){return-1!==Object.prototype.toString.call(t).indexOf("Array")},Te=function(t){return"[object Object]"===Object.prototype.toString.call(t)},Se=function(t){return void 0===t||"[object Undefined]"===Object.prototype.toString.call(t)},Ie=function(t){return function(t){return"string"==typeof t}(t)&&/https?:\/\//.test(t)},Ne=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1},he=function(t){return{isRead:(t&bt.READ)===bt.READ,isListened:(t&bt.LISTENED)===bt.LISTENED,isDownload:(t&bt.DOWNLOADED)===bt.DOWNLOADED,isRetrieved:(t&bt.RETRIEVED)===bt.RETRIEVED}},fe=function(t){return[At.Android,At.iOS,At.Web,At.PC,At.Mini,At.HarmonyOS].map((function(e){var n=t.findIndex((function(t){return t.platform===e}));return-1===n?{platform:e,changeTime:0,eventValue:0}:t[n]}))},Oe=function(t,e,n){return e?1===n?Et.TLS:Et.RMTP:"http"===t?Et.WS:Et.WSS},Ae=function(t,e){var n=t.server,o=t.backupServer,r=t.bs,i=t.serverAddr,s=t.protocol,a=t.openTLS;if(i)return zt([],qt(i.filter((function(t){return t.addr}))),!1);var _=[],c=[];return n&&c.push(n),(o||r||"").split(",").forEach((function(t){c.indexOf(t)<0&&c.push(t)})),c.forEach((function(t,o){t&&_.push({addr:t,protocol:Oe(s,e,a),weight:n.length-o,race:!1})})),zt([],qt(_),!1)},ge=function(t){if(void 0!==t){var e=Number(t);return Number.isNaN(e)?void 0:e}},ve=function(t){return t.reduce((function(t,e){return t[e.key]=e.value,t}),{})},Pe=function(t,e){var n=Math.floor(1e3*Math.random()%1e4),o=ae(),r=function(t){t=t||"-";var e=new Date,n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return"".concat(n).concat(t).concat(o).concat(t).concat(r)}(),i=(new Date).getTime(),s="";if(e){var a=e.split(".");s=".".concat(a[a.length-1])}return"".concat(t,"__RC-").concat(r,"_").concat(n,"_").concat(i).concat(o).concat(s)},Le=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var o=e.channelIdMi,r=e.channelIdHW,i=e.channelIdOPPO,s=e.typeVivo,a=e.importanceHW,_=e.categoryHW,c=e.imageUrlHW,u=e.categoryVivo,E=e.importanceHonor,R=e.imageUrlHonor,l=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=t.threadId,o=t.apnsCollapseId,r=t.category,i=t.richMediaUri,s=t.interruptionLevel,a=e.googleConfig,_={};_["thread-id"]=n||"",_["apns-collapse-id"]=o||"",_.category=r||"",_.richMediaUri=i||"",_["interruption-level"]=s||"active";var c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;var u=null==a?void 0:a.priority;return u&&!["high","normal"].includes(u)&&(u="normal"),c.priority=u,{APNS:_,FCM:c}}(t,e),d=[{HW:{channelId:r||"",importance:a||"NORMAL",image:c||"",category:_||""}},{MI:{channelId:o||""}},{OPPO:{channelId:i||""}},{VIVO:{classification:s||"",category:u||""}},{APNS:l.APNS},{FCM:l.FCM},{HONOR:{importance:E||Ut.NORMAL,image:R||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(d)},me=function(){var t=se.getInfo(),e="electron";for(var n in t)"engine"!==n&&(e=["imlib-v2-adapter","imlib-next"].includes(n)?n:"electron");return e};function ye(t,e){var n;if(!t)return"";var o="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(t)?o?t.replace(/^https?:\/\//i,"https://"):t:e!==Et.HTTP||o?"https://".concat(t):"http://".concat(t)}var Me,Ue,De,Ge=function(t,e){if(!t)return"";var n=t.ossConfig,o=void 0===n?"":n,r="";try{var i=JSON.parse(o);if(i.length>0){var s=i.find((function(t){return t.minio}));s&&(r=s.minio)}}catch(t){e.warn(G.L_PARSE_JSON_E,JSON.stringify({ossConfig:o,error:t}))}return r};!function(t){t[t.add=1]="add",t[t.update=2]="update",t[t.delete=3]="delete"}(Me||(Me={})),function(t){t[t.BJ=1]="BJ",t[t.SG=2]="SG",t[t.NA=3]="NA",t[t.SG_A=4]="SG_A",t[t.SG_B=4]="SG_B",t[t.SA=5]="SA"}(De||(De={}));var Ve=((Ue={})[De.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:Et.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Ue[De.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:Et.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Ue[De.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:Et.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Ue[De.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:Et.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Ue[De.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:Et.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Ue);function be(t){return De[t]?t:De.BJ}var Fe,we=function(){function t(){this.initOption={}}return t.prototype.init=function(t){this.initOption=t},t.prototype.getNaviUrlList=function(t,e){var n,o=this.initOption||{},r=o.areaCode,i=o.navigators,s=(n=r,void 0===n&&(n=De.BJ),Ve[be(n)].naviUrlBase64).map((function(t){return pe(t)})),a=[],_=qt(t.split("@"),2)[1];e&&(a=_?_.split(";"):[]);var c=i&&i.length>0?zt(zt([],qt(a),!1),qt(i),!1):zt(zt([],qt(a),!1),qt(s),!1);return c.filter((function(t,e){return c.indexOf(t)===e})).map((function(t){return ye(t)}))},t.prototype.getLogUrlPolicyList=function(t,e){var n,o=t||{},r=o.log,i=o.logPolicy,s=this.initOption||{},a=s.areaCode,_=s.logServerUrl,c=(n=a,void 0===n&&(n=De.BJ),Ve[be(n)].logUrlBase64).map((function(t){return Xt(Xt({},t),{addr:pe(t.addr)})})),u=[],E={level:1,itv:6,times:5};if(r)u.push.apply(u,zt([],qt(r.addrs),!1)),Object.assign(E,r.policy);else if(i)try{var R=JSON.parse(i);u.push({addr:R.url,protocol:Et.HTTPS,weight:1}),E.level=R.level,E.itv=R.itv,E.times=R.times}catch(n){e.warn(G.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:t.logPolicy}))}var l=_?zt([{addr:_,protocol:Et.HTTPS,weight:101}],qt(u),!1):zt(zt([],qt(u),!1),qt(c),!1);return{policy:E,addrs:l.filter((function(t,e){return l.findIndex((function(e){return e.addr===t.addr&&e.protocol===t.protocol}))===e})).map((function(t){return Xt(Xt({},t),{addr:ye(t.addr,t.protocol)})})).sort((function(t,e){return e.weight-t.weight}))}},t.prototype.getMiniCmpUrlList=function(){var t,e,n=(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===e&&(e=De.BJ),Ve[be(e)].miniCmpBase64).map((function(t){return pe(t)})),o=(this.initOption||{}).miniCMPProxy;return o&&o.length>0?o:n},t.prototype.getStaticConfigUrl=function(){var t,e;return(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===e&&(e=De.BJ),Ve[be(e)].staticConfigUrlBase64).map((function(t){return pe(t)}))},t.prototype.getCloudControllerUrl=function(t){var e,n,o=null!=t?t:null===(e=this.initOption)||void 0===e?void 0:e.areaCode;return(n=o,void 0===n&&(n=De.BJ),Ve[be(n)].cloudControllerUrlBase64).map((function(t){return pe(t)}))},t.prototype.getAreaCode=function(){var t,e;return null!==(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode)&&void 0!==e?e:De.BJ},t.prototype.setAreaCode=function(t){return!(!t||!De[t]||t===this.initOption.areaCode)&&(this.initOption.areaCode=t,!0)},t.prototype.getStatsUrlList=function(t){var e,n,o=(t||{}).active,r=(null==o?void 0:o.addrs)||[],i=(n=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===n&&(n=De.BJ),Ve[be(n)].statsUrlBase64).map((function(t){return pe(t)}));return 0===r.length?i:zt(zt([],qt(r.sort((function(t,e){return e.weight-t.weight})).map((function(t){return ye(t.addr,t.protocol)}))),!1),qt(i),!1)},t}(),xe=new we,He=function(){function t(t,e){this.appkey=t,this.logger=e,this.staticUrls=[]}return t.prototype.getStaticConfig=function(){var t;return jt(this,void 0,void 0,(function(){var e,n,o,r,i,s,a,_;return Qt(this,(function(c){switch(c.label){case 0:if(!(e=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),n=JSON.parse(e),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return o=c.sent(),(r=o.resources.navi.slice()).sort((function(t,e){return e.weight-t.weight})),[2,{navi:r.map((function(t){return ye(t.addr,t.protocol)}))||[]}];case 3:return[3,5];case 4:return i=c.sent(),this.logger.error(G.L_GET_STATIC_CONF_E,JSON.stringify({error:null==i?void 0:i.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=c.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(a=c.sent())?void 0:a.areaCode)!==xe.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==a?void 0:a.bootstrap)||[],(_=null===(t=null==a?void 0:a.resources)||void 0===t?void 0:t.navi.slice()).sort((function(t,e){return e.weight-t.weight})),[2,{navi:_.map((function(t){return ye(t.addr,t.protocol)}))||[]}])}}))}))},t.prototype._requestHandle=function(){return jt(this,void 0,void 0,(function(){var t,e,n,o,r,i,s,a,_,c,u;return Qt(this,(function(E){switch(E.label){case 0:t=(t=zt(zt([],qt(this.staticUrls),!1),qt(xe.getStaticConfigUrl()),!1).map((function(t){return ye(t)}))).filter((function(e,n){return t.indexOf(e)===n})),E.label=1;case 1:E.trys.push([1,6,7,8]),e=Zt(t),n=e.next(),E.label=2;case 2:return n.done?[3,5]:(o=n.value,this.logger.info(G.L_GET_STATIC_CONF_T,JSON.stringify({url:o})),r=Date.now(),[4,this.sendRequest("".concat(o,"/").concat(this.appkey))]);case 3:if(i=E.sent(),s=i.code,a=i.data,200===s)return this.logger.info(G.L_GET_STATIC_CONF_R,JSON.stringify({url:o,code:s,duration:Date.now()-r})),[2,a];this.logger.warn(G.L_GET_STATIC_CONF_R,JSON.stringify({url:o,code:s,duration:Date.now()-r})),E.label=4;case 4:return n=e.next(),[3,2];case 5:return[3,8];case 6:return _=E.sent(),c={error:_},[3,8];case 7:try{n&&!n.done&&(u=e.return)&&u.call(e)}finally{if(c)throw c.error}return[7];case 8:return[2]}}))}))},t}();!function(t){t[t.STATISTICS=-2]="STATISTICS",t[t.RECORD=-1]="RECORD",t[t.FATAL=0]="FATAL",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG"}(Fe||(Fe={}));var Be,ke=function(){function t(t,e,n){this._appkey=t,this._id=e,this._type=n,this.outputLevel=Fe.WARN,this.debug=this._log.bind(this,Fe.DEBUG),this.info=this._log.bind(this,Fe.INFO),this.warn=this._log.bind(this,Fe.WARN),this.error=this._log.bind(this,Fe.ERROR),this.__statistics=this._log.bind(this,Fe.STATISTICS),this.record=this.__statistics}return t.prototype._write=function(t){var e=t.tag,n=t.level,o=t.content,r=t.traceId;/^[\w-]+$/.test(e)?n!==Fe.DEBUG&&this._handleWrite(t):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(e," | ").concat(o," | ").concat(r))},t.prototype.createTraceId=function(){return"".concat(++t._traceIdCount)},t.prototype.getSessionId=function(){return _e},t.prototype._stdout=function(t){var e=t.time,n=t.tag,o=t.content,r=t.traceId,i=t.level,s=t.loggerId;if(console&&!(i<=Fe.FATAL||i>this.outputLevel)){var a=["error","warn","info","debug"][i-1],_="".concat(new Date(e).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(n," | ").concat(o," | ").concat(r);console[a||"warn"](_)}},t.prototype.setOutputLevel=function(t){(function(t){return[Fe.DEBUG,Fe.INFO,Fe.WARN,Fe.ERROR].some((function(e){return e===t}))})(t)&&(this.outputLevel=t)},t.prototype._log=function(t,e,n,o){var r={time:Date.now(),level:t,tag:e,content:n,traceId:o,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(r),this._write(r)},t.prototype.summary=function(t,e,n,o,r,i){var s,a;void 0===o&&(o={}),e.isOk?this.info(t,null!==(s=null==r?void 0:r())&&void 0!==s?s:JSON.stringify(Xt({isOk:!0},o)),n):this.warn(t,null!==(a=null==i?void 0:i())&&void 0!==a?a:JSON.stringify(Xt({code:e.code,msg:e.msg},o)),n)},t._traceIdCount=0,t}(),Je=function(){function t(t,e,n,o,r,i){void 0===i&&(i=!1),this.appkey=t,this.deviceId=e,this.deviceInfo=n,this.logDB=o,this.logger=r,this.disableLogReport=i,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return t.prototype.checkStart=function(t,e){return jt(this,void 0,void 0,(function(){var n,o,r;return Qt(this,(function(i){return this.started?[2]:(this.userId=t.userId,!t.logSwitch||this.disableLogReport||(n=xe.getLogUrlPolicyList(t,this.logger),o=n.policy,r=n.addrs,this.started=!0,this.itvByNavi=o.itv,this.timesByNavi=o.times,r.length>0&&this.realtimeReport(r[0].addr,o.level,o.itv,e)),[2])}))}))},t.prototype._sendLogs2Realtime=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R,l;return Qt(this,(function(d){switch(d.label){case 0:return this.logger.debug(G.L_REALTIME_LOG_O,"compress logs: ".concat(t.length)),[4,this.compressLogs(t)];case 1:return r=d.sent(),i=r.success,s=r.data,i?(this.logger.debug(G.L_REALTIME_LOG_O,"compress done",e),a=Ie(n)?n:"https://".concat(n),a+="?version=".concat("5.18.0-alpha.2","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:a,body:s,method:"POST"})]):(this.logger.warn(G.L_REALTIME_LOG_R,"compress failed",e),[2,{isOk:!1,itv:o}]);case 2:if(_=d.sent(),c=_.status,u=_.data,this.logger.debug(G.L_REALTIME_LOG_R,JSON.stringify({status:c,data:u}),e),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(o+=o),this.reportFailedNumber++,[2,{isOk:!1,itv:o}];if(this.reportFailedNumber=0,u)try{(l=JSON.parse(u)).nextTime&&(o=l.nextTime),E=l.level,R=l.logSwitch}catch(t){this.logger.warn(G.L_PARSE_JSON_E,JSON.stringify({error:null==t?void 0:t.stack}),e)}return[2,{isOk:!0,itv:o,level:E,logSwitch:R}]}}))}))},t.prototype.realtimeReport=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R,l,d,p,C=this;return Qt(this,(function(T){switch(T.label){case 0:return r=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||ce,s=Math.max(r-3e4,i+1),a=this.logger.createTraceId(),this.logger.debug(G.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:s,level:e,itv:n}),a),[4,this.logDB.getLogs(i,s,e,!0,o)];case 1:return _=T.sent(),c=_.dbReady,u=_.logs,c?[3,2]:(this.logger.warn(G.L_REALTIME_LOG_R,"get logs failed",a),[3,5]);case 2:return 0!==u.length?[3,3]:(this.logger.debug(G.L_REALTIME_LOG_R,"no logs",a),[3,5]);case 3:return u.length>0?[4,this._sendLogs2Realtime(u,a,t,n)]:[3,5];case 4:E=T.sent(),R=E.itv,l=E.level,d=E.logSwitch,E.isOk&&(p=Math.max.apply(Math,zt([],qt(u.map((function(t){return t.time}))),!1)),this.logDB.setTimestamp4RealtimeLog(p+1),0===d&&(this.started=!1),void 0!==l&&(e=l)),n=R,T.label=5;case 5:return this.started&&(n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return C.realtimeReport(t,e,n,o)}),1e3*n)),[2]}}))}))},t.prototype.report=function(t,e,n,o,r,i,s){return void 0===s&&(s=!1),jt(this,void 0,void 0,(function(){var a,_,c,u,E,R,l,d,p,C;return Qt(this,(function(T){switch(T.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(a=this.logger.createTraceId(),this.logger.info(G.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:t,endTime:e,logId:r,messageUId:i,isCloudControl:s}),a),[4,this.logDB.getLogs(t,e,Fe.DEBUG,!1)]);case 1:return _=T.sent(),c=_.dbReady,u=_.logs,this.logger.info(G.L_REPORT_FULL_LOG_O,JSON.stringify({count:u.length}),a),E=Ie(o)?o:"https://".concat(o),E+="?version=".concat("5.18.0-alpha.2","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(r),c?u.length>0?[4,this.compressLogs(u)]:[3,3]:[3,5];case 2:return l=T.sent(),d=l.success,p=l.data,R=d?p:"compress failed",[3,4];case 3:R="no data",T.label=4;case 4:return[3,6];case 5:R="no database",T.label=6;case 6:return this.logger.debug(G.L_REPORT_FULL_LOG_O,"compress done",a),s&&(E+="&source=cloud"),[4,this.send({url:E,body:R,method:"POST"})];case 7:return C=T.sent().status,this.logger.info(G.L_REPORT_FULL_LOG_R,JSON.stringify({status:C}),a),[2]}}))}))},t.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},t}();!function(t){t[t.init=1]="init",t[t.newWorkChange=2]="newWorkChange",t[t.other=3]="other"}(Be||(Be={}));var We=function(){function t(t){this.reporter=t,this.logId="",this.uploadTask=[],this.taskLock=!0}return t.prototype.uploadLogCmdTask=function(t){this.uploadTask.push(t),this.enqueueTask()},t.prototype.reportLogCmdTask=function(t){var e,n,o,r,i=this;this.taskLock=!1;var s=null!==(e=t.startTime)&&void 0!==e?e:0,a=null!==(n=t.endTime)&&void 0!==n?n:0,_=null!==(o=t.platform)&&void 0!==o?o:"",c=null!==(r=t.uri)&&void 0!==r?r:"";t.logId!==this.logId&&""!==c&&(this.logId=t.logId,this.reporter.report(s,a,_,c,t.logId,"",!0).finally((function(){i.taskLock=!0,i.uploadTask.length>0&&i.enqueueTask()})))},t.prototype.enqueueTask=function(){if(this.taskLock){var t=this.uploadTask.shift();t&&this.reportLogCmdTask(t)}},t}();var Ye,Ke,Xe,je,Qe=function(){function t(t,e,n){this.logger=t,this.appkey=e,this.reporter=n,this.isEable=!0,this.expire=0,this.interval=0,this.timestamp=0,this.lastRequestTime=0,this.changeAreaCode=0,this._cache=null,this.uploadTaskManage=new We(n)}return t.prototype.init=function(){try{var t=this.getLocalCloudControllerCache();this._cache=t?JSON.parse(t):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(t){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))},t.prototype.isExire=function(){return(new Date).getTime()-this.timestamp<this.expire},t.prototype.isOverclock=function(){return(new Date).getTime()-this.lastRequestTime<this.interval},t.prototype.logCmdMsgTasks=function(t){var e=this;t.uploadLog&&t.uploadLog.tasks.forEach((function(t){t.objectName===dt.LOG_COMMAND&&e.uploadTaskManage.uploadLogCmdTask(t)}))},t.prototype.dataHandle=function(t){var e=this._cache;e.lastRequestTime=this.lastRequestTime,Ne(t)&&(e.timestamp=t.timestamp,t.uploadLog&&!t.uploadLog.temporary&&(e.uploadLog=t.uploadLog),t.cc&&!t.cc.temporary&&(e.cc=t.cc),t.mrtr&&!t.mrtr.temporary&&(e.mrtr=this._handleMrtrData(t.mrtr)),t.mrtr&&this.setMRTRConfig(this._handleMrtrData(t.mrtr))),this.setCloudControllerCache(e),this.expire=e.cc.expire,this.interval=e.cc.interval,this.timestamp=e.timestamp,this.logCmdMsgTasks(t)},t.prototype.request=function(t,e,n){return jt(this,void 0,void 0,(function(){var o,r,i,s,a,_,c,u,E,R;return Qt(this,(function(l){switch(l.label){case 0:return!this.isEable&&e===Be.init&&this.isExire()?(this.logger.info(G.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&e===Be.newWorkChange&&this.isOverclock()?(this.logger.info(G.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(o=ye(t),this.lastRequestTime=(new Date).getTime(),r="".concat(o,"/v1/config"),i={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(i["RC-Token"]=n),s={platform:"web",version:"5.18.0-alpha.2",timestamp:this.timestamp},this.logger.record(Dt.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:r})),[4,this.httpRequest(r,Kt.POST,i,s)]);case 1:return a=l.sent(),_=a.code,c=a.data,this.logger.record(Dt.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),_===ct.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(u=c.targetRegion,this.changeAreaCode===u?[2,this.timestamp]:(E=xe.setAreaCode(u),this.logger.info(G.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:E,originAreaCode:xe.getAreaCode(),newAreaCode:u})),this.changeAreaCode=u,(R=xe.getCloudControllerUrl(u))[0]?[2,this.request(R[0],Be.other)]:(this.logger.info(G.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:r,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))},t.prototype._handleMrtrData=function(t){return{chatroom:(null==t?void 0:t.chatroom)||0,group:(null==t?void 0:t.group)||0,private:(null==t?void 0:t.private)||0,ultraGroup:(null==t?void 0:t.ultraGroup)||0,temporary:!!(null==t?void 0:t.temporary)}},t}(),Ze=function(t){return t===ct.RC_CONN_REDIRECTED},qe=function(t){function e(e,n,o){var r=t.call(this)||this;return r.appkey=e,r.navi=n,r.logger=o,Ye.add(r),r.token="",r.curCmpUrl="",r.retryCount=0,r.uuid="",je.set(r,0),r._doConnectReason=0,r._network={status:!0,type:Yt.UNKONWN},r._checkAliveTimer=null,r._crtConnectionStatus=Lt.DISCONNECTED,r._crtUserId="",r._openCallPlus=!1,r._crtConnectionTask=null,r.reconnectTimer=null,r._failedCount=0,r.ALLOW_FAILED_TIMES=2,r}return U(e,t),e.prototype.getToken=function(){return this.token},Object.defineProperty(e.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),e.prototype.getCurrentUserId=function(){return this._crtUserId},e.prototype.setConnectionStatus=function(t,e){if(this._crtConnectionStatus!==t){if(this._crtConnectionStatus===Lt.DISCONNECTED&&t===Lt.CONNECTING&&(this._doConnectReason=kt.CONNECT,$t(this,Ye,"m",Xe).call(this)),this._crtConnectionStatus===Lt.CONNECTED&&t===Lt.SUSPENDED&&(e===ct.RC_PING_EXCEED_LIMIT?this._doConnectReason=kt.TIMEOUT:e===ct.RC_CONN_REDIRECTED?this._doConnectReason=kt.REDIRECTED:this._doConnectReason=kt.RECONNECT),this._crtConnectionStatus===Lt.CONNECTED){var n={bid:me(),cod:e,net:this.getNetwork().type,dur:Date.now()-$t(this,je,"f"),cid:this.cid};this.logger.record(Dt.IM_CONNECTION_DURATION,JSON.stringify(n)),t===Lt.SUSPENDED&&$t(this,Ye,"m",Xe).call(this)}switch(this._crtConnectionStatus=t,t){case Lt.CONNECTED:this.logger.info(G.L_CONNECT_S,"status: ".concat(t)),this.checkAlive(),$t(this,Ye,"m",Ke).call(this).emit("onConnected");break;case Lt.CONNECTING:this.logger.warn(G.L_CONNECT_S,"status: ".concat(t)),$t(this,Ye,"m",Ke).call(this).emit("onConnecting");break;case Lt.SUSPENDED:this.logger.warn(G.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),Ze(e)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),$t(this,Ye,"m",Ke).call(this).emit("onSuspend",e);break;default:this.logger.warn(G.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),$t(this,Ye,"m",Ke).call(this).emit("onDisconnected",e)}}},e.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},e.prototype.setNetwork=function(t,e){if(!e){var n={cid:this.cid,cn:t.type,on:this._network.type};this.logger.record(Dt.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=t},e.prototype.getNetwork=function(){return this._network},e.prototype.connect=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s;return Qt(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===Lt.CONNECTED?[2,Re(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.token=t,this.setConnectionStatus(Lt.CONNECTING),[4,this.try2Connect(t,e,!1,o,!0)]);case 1:return r=a.sent(),i=r.code,s=r.data,i!==ct.SUCCESS?(this.setConnectionStatus(Lt.DISCONNECTED,i),[2,le(i)]):(this.setConnectionStatus(Lt.CONNECTED),[2,Re(s)])}}))}))},e.prototype.try2Connect=function(t,e,n,o,r){return jt(this,void 0,void 0,(function(){var i;return Qt(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(t,e,n,o,r),[4,this._crtConnectionTask]);case 1:return i=s.sent(),this._crtConnectionTask=null,[2,i]}}))}))},e.prototype.createConnectionTask=function(t,e,n,o,r){return jt(this,void 0,void 0,(function(){var i,s,a,_,c,u,E,R,l,d;return Qt(this,(function(p){switch(p.label){case 0:return i={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(Dt.IM_STATS_CS,JSON.stringify(i)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(t,n,!1,o,s)];case 1:return a=p.sent(),_=a.code,c=a.data,_!==ct.SUCCESS?[2,le(_)]:1===(u=c).type?[2,le(ct.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(G.L_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:e}),o),[4,this.connectWithToken(t.replace(/@.+$/,"@"),u,e,o)]);case 2:return E=p.sent(),R=E.code,l=E.data,r||R===ct.SUCCESS||(this.retryCount+=1),Ze(R)?(this.logger.warn(G.L_CONNECT_R,"redirect code: ".concat(R),o),this.clearCmpWeightCache(),[2,this.createConnectionTask(t,e,!0,o,r)]):[ct.RC_TCP_RESET,ct.RC_CONN_ACK_TIMEOUT,ct.RC_TCP_DISCONNECTED_NO_RMTP].includes(R)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),d=this.cmpWeightCache.every((function(t){return t.failed})),r&&d?(this.logger.warn(G.L_CONNECT_R,"cpp code:".concat(R,",reture code:").concat(ct.SERVER_UNAVAILABLE),o),[2,le(ct.SERVER_UNAVAILABLE)]):(this.logger.warn(G.L_CONNECT_R,"cmp ack timeout, code: ".concat(R),o),this.setConnectionStatus(Lt.SUSPENDED,R),this.setConnectionStatus(Lt.CONNECTING),[2,this.createConnectionTask(t,e,!1,o,r)])):R!==ct.SUCCESS?(this.logger.warn(G.L_CONNECT_R,"code: ".concat(R),o),[2,le(R)]):(this.logger.info(G.L_CONNECT_R,"userId: ".concat(l),o),te(this,je,Date.now(),"f"),this._crtUserId=l,[2,Re(l)])}}))}))},e.prototype.try2Reconnect=function(t,e){return jt(this,void 0,void 0,(function(){var n,o,r=this;return Qt(this,(function(i){return n=this.logger.createTraceId(),this.logger.debug(G.T,"try2Reconnect -> ignoreNaviCache: ".concat(t,", reason: ").concat(e),n),this.stopReconnectTimer(),o=function(){return jt(r,void 0,void 0,(function(){var r;return Qt(this,(function(i){switch(i.label){case 0:return this._crtConnectionStatus!==Lt.SUSPENDED?[2]:(this.setConnectionStatus(Lt.CONNECTING,e),[4,this.try2Connect(this.token,!0,t,n,!1)]);case 1:return r=i.sent().code,this.reconnectTimer=null,r===ct.SUCCESS?(this.setConnectionStatus(Lt.CONNECTED),[2]):[ct.SERVER_UNAVAILABLE,ct.TIMEOUT,ct.RC_SOCKET_DISCONNECTED,ct.RC_SOCKET_NOT_CREATED,ct.RC_CONN_ACK_TIMEOUT,ct.RC_TCP_RESET,ct.RC_NAVI_REQ_FAILED,ct.RC_NETWORK_DOWN,ct.RC_TCP_DISCONNECTED_NO_RMTP].includes(r)?(this._crtConnectionStatus!==Lt.CONNECTING||(this.setConnectionStatus(Lt.SUSPENDED,r),this.reconnectTimer=setTimeout(o,5e3)),[2]):(this.setConnectionStatus(Lt.DISCONNECTED,r),[2])}}))}))},o(),[2]}))}))},e.prototype.onDisconnectByServer=function(t,e){var n=this;return Ze(t)?(this.setConnectionStatus(Lt.SUSPENDED,t),void this.try2Reconnect(!0,t)):t===ct.RC_UDP_DISCONNECTED?(this.setConnectionStatus(Lt.SUSPENDED,t),void setTimeout((function(){n.try2Reconnect(!0,t)}),1e3*(e||0))):void this.setConnectionStatus(Lt.DISCONNECTED,t)},e.prototype.onDisconenctUnusual=function(t){this.setConnectionStatus(Lt.SUSPENDED,t),this.try2Reconnect(!1,t)},e.prototype.checkAlive=function(){return jt(this,void 0,void 0,(function(){var t,e,n=this;return Qt(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==Lt.CONNECTED?(this._failedCount=0,this.logger.debug(G.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(t=this.logger.createTraceId(),this.logger.debug(G.L_CHECK_ALIVE_IM_T,null,t),[4,this.sendPing(15e3)]);case 1:return(e=o.sent())===ct.SUCCESS?(this.logger.debug(G.L_CHECK_ALIVE_IM_R,e,t),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==Lt.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(G.L_CHECK_ALIVE_IM_R,"code: ".concat(e,", count: ").concat(this._failedCount),t),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(G.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),this.close(!0,!1),this.setConnectionStatus(Lt.SUSPENDED,ct.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,ct.RC_PING_EXCEED_LIMIT),[2]))}}))}))},e.prototype.disconnect=function(t){return jt(this,void 0,void 0,(function(){return Qt(this,(function(e){switch(e.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.setConnectionStatus(Lt.DISCONNECTED,ct.ACTIVE_DISCONNECT),this.close(!1,t),[2]}}))}))},e.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},e.prototype.getCmpList=function(t,e){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return zt([],qt(this.cmpWeightCache),!1);var n=Ae(t,e);return this.cmpWeightCache=zt([],qt(n),!1),zt([],qt(n),!1)},e.prototype.updateCmpWeight=function(t,e,n){if(this.cmpWeightCache){var o=this.cmpWeightCache.find((function(e){return n?e.addr===t&&e.protocol===Et.QUIC:e.addr===t}));if(o)if(e){var r=Math.max.apply(Math,zt([],qt(this.cmpWeightCache.map((function(t){return t.weight}))),!1));o.weight!==r&&(o.weight=r+1)}else{var i=Math.min.apply(Math,zt([],qt(this.cmpWeightCache.map((function(t){return t.weight}))),!1));o.weight!==i&&(o.weight=i-1),o.failed=!0}}},e.prototype.clearCmpWeightCache=function(){this.cmpWeightCache=void 0},e.prototype.reconnect=function(t,e,n,o){this.token=t,this._openCallPlus=n,this.onDisconenctUnusual(o)},e}(ue);je=new WeakMap,Ye=new WeakSet,Ke=function(){return this},Xe=function(){this.uuid=ae(),this.retryCount=0};var ze,$e,tn=function(t){return t.replace(/@.+$/,"@")},en=function(){function t(t,e,n,o,r){void 0===o&&(o=!0),void 0===r&&(r=!0),this.appkey=t,this.logger=e,this.staticConfigManager=n,this.isRequestProfile=o,this.isUseDynamicNaviUrl=r,this.crtRequest=null,this._environment="default"}return t.prototype.getCatchKey=function(t){return t+(this._environment?"-".concat(this._environment):"")},t.prototype.request=function(t,e,n,o,r){return jt(this,void 0,void 0,(function(){var i;return Qt(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(t,e,n,o,r),[4,this.crtRequest]);case 1:return i=s.sent(),this.crtRequest=null,[2,i]}}))}))},t.prototype.sendRequest=function(t,e,n,o,r){var i;return jt(this,void 0,void 0,(function(){var s,a,_,c,u,E,R,l,d,p,C,T,S,I,N,h,f;return Qt(this,(function(O){switch(O.label){case 0:return s=tn(t),a=this.getNaviCache(s),!e&&a&&(_=a.timestamp,c=a.naviInfo,n||Date.now()-_<ee)?(this.logger.info(G.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),o),r&&(u=r.uuid,E=r.retryCount,R=r.reason,l={bid:me(),ptc:wt.NAVI,cod:ct.SUCCESS,net:r.type,dur:0,spr:0,pr:null!==(i=c.type)&&void 0!==i?i:0,hos:"",cache:xt.LOCAL,v:Ht.CURRENT,rsn:R,cid:"".concat(u,"_").concat(E),count:E},this.logger.record(Dt.IM_NAVI,JSON.stringify(l),o)),[2,Re(c)]):(d=xe.getNaviUrlList(t,this.isUseDynamicNaviUrl),this.logger.info(G.L_GET_NAVI_T,JSON.stringify({token:t,uris:d}),o),[4,this.requestHandler(d,t,o,r)]);case 1:return p=O.sent(),C=p.code,T=p.data,C===ct.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(S=O.sent())?void 0:S.navi)&&(null==S?void 0:S.navi.length)>0?(I=S.navi,[4,this.requestHandler(I,t,o,r)]):[3,4];case 3:N=O.sent(),C=N.code,T=N.data,O.label=4;case 4:return C!==ct.SUCCESS?(this.logger.warn(G.L_GET_NAVI_R,C,o),[2,le(C)]):(h=T).code&&200!==h.code?(this.logger.warn(G.L_GET_NAVI_R,h.code,o),[2,le(this.transHttpCode(h.code))]):Ae(h).length>0?(this.logger.info(G.L_GET_NAVI_R,JSON.stringify({naviInfo:h}),o),this.setNaviCache(s,h),[2,Re(h)]):(f={server:h.server,backupServer:h.backupServer,serverAddr:h.serverAddr,bs:h.bs},this.logger.warn(G.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(f)),o),[2,le(ct.SERVER_UNAVAILABLE)])}}))}))},t.prototype.requestHandler=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R;return Qt(this,(function(l){switch(l.label){case 0:r=0,i=t.length,l.label=1;case 1:return r<i?(s=r===t.length-1,a=this.useV2Navi()?this.httpRequestV2:this.httpRequest,_=Date.now(),[4,a.call(this,t[r],this.appkey,e,n,s)]):[3,4];case 2:if(c=l.sent(),u=c.code,E=c.data,R={bid:me(),ptc:wt.NAVI,cod:u,net:null==o?void 0:o.type,dur:Date.now()-_,spr:0,pr:(null==E?void 0:E.type)||0,hos:t[r],cache:xt.REQUEST,v:Ht.CURRENT,rsn:null==o?void 0:o.reason,cid:"".concat(null==o?void 0:o.uuid,"_").concat(null==o?void 0:o.retryCount),count:null==o?void 0:o.retryCount},this.logger.record(Dt.IM_NAVI,JSON.stringify(R),n),[ct.SUCCESS,ct.RC_CONN_TOKEN_INCORRECT,ct.RC_LICENSE_EXPIRED].includes(u))return[2,u===ct.SUCCESS?Re(E):le(u)];l.label=3;case 3:return r+=1,[3,1];case 4:return[2,le(ct.RC_NAVI_REQ_FAILED)]}}))}))},t.prototype.transHttpCode=function(t){switch(t){case 401:case 403:return ct.RC_CONN_TOKEN_INCORRECT;case 416:return ct.RC_LICENSE_EXPIRED;default:return ct.RC_NAVI_REQ_FAILED}},t.prototype.getNaviInfoFromCache=function(t){var e=this.getNaviCache(tn(t));return e?e.naviInfo:null},t.prototype.updateVoipCallInfo=function(t,e){var n=this.getNaviInfoFromCache(t);n&&this.setNaviCache(tn(t),Xt(Xt({},n),{voipCallInfo:e}))},t.prototype.getNaviV2RequestOption=function(t){var e,n=t.uri,o=t.token,r=t.platform,i=t.protocol,s=t.mac;e="".concat(n,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(o),"&version=").concat("5.18.0-alpha.2","&platfrom=").concat(r);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(i,";rtc=4;log=2;iptype=v4,v6")},body:a,url:e,timeout:1e4}},t.prototype.useV2Navi=function(){return!0},t}();!function(t){t.P_INIT_O="P-init-O",t.P_DB_OPEN_O="P-db_open-O",t.P_DB_UPGRATE_START_S="P-db_upgrate_start-S",t.P_DB_UPGRATING_S="P-db_upgrating-S",t.P_DB_UPGRATE_COMPLETE_S="P-db_upgrate_complete-S",t.P_CALL_MAIN_SYNC_E="P-call_main_sync-E",t.P_CALL_MAIN_E="P-call_main-E",t.P_SEND_2_MAIN_E="P-send_2_main-E",t.P_REGTYP_O="P-regtype-O",t.P_CALL_ADDON_E="P-call_addon-E",t.P_CALL_ADDON_T="P-call_addon-T",t.P_CALL_ADDON_O="P-call_addon-O",t.P_CALL_ADDON_R="P-call_addon-R",t.P_CALL_EXTRA_E="P-call_extra-E",t.P_CONNECT_S="P-connect-S",t.P_CONNECT_ENTRY_S="P-connect_entry-S",t.P_REPORT_VER_O="P-report_version-O",t.P_PARSE_JSON_MSGS_E="P-parse_json_messsages-E",t.P_PARSE_JSON_MSGS_R="P-parse_json_messsages-R",t.P_RECEIVE_MESSAGE_E="P-receive_message-E",t.P_HTTP_REQ_E="P-http_request-E",t.P_SET_MSG_EXTEN_O="P-set_msg_extension-O",t.P_SEND_MSG_T="P-send_msg-T",t.P_SEND_MSG_R="P-send_msg-R",t.P_PARSE_JSON_SUBSCRIBE_DATA_E="P-parse_json_subscribe_data-E",t.P_PARSE_JSON_USER_PROFILE_E="P-parse_json_user_profile-E",t.P_PARSE_JSON_USER_PROFILE_LIST_E="P-parse_json_user_profile_list-E",t.P_WRITE_LOG_O="P_WRITE_LOG_O",t.P_PARSE_JSON_E="P-parse_json-E"}(ze||(ze={})),function(t){t[t.ERROR=-1]="ERROR",t[t.RESPONSE=0]="RESPONSE",t[t.EVENT=1]="EVENT",t[t.CALLBACK=2]="CALLBACK"}($e||($e={}));var nn=function(t){return{sendError:function(e){t.send({type:$e.ERROR,data:{msg:e}})},sendEvent:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];t.send({type:$e.EVENT,data:{eventName:e,data:n}})},sendResponse:function(e){t.send({type:$e.RESPONSE,data:e})},sendCallback:function(e){t.send({type:$e.CALLBACK,data:e})}}},on=function(t,e,n){return jt(void 0,void 0,void 0,(function(){var o,r;return Qt(this,(function(i){return o=l("aes-256-cbc",e,n),r=o.update(t,"base64","utf-8"),[2,r+=o.final("utf8")]}))}))},rn=function(t){if(!p(t)){var e=E(t,"..");p(e)||rn(e),C(t)}},sn=function(t){return Object.entries(t).map((function(t){var e=qt(t,2),n=e[0],o=e[1];return{key:n,value:String(o)}}))},an=function(t){return{removeMute:!!(null==t?void 0:t.removeMuteStatus),removeWhiteList:!!(null==t?void 0:t.removeWhiteList),removeFavoriteMembers:!!(null==t?void 0:t.removeFollow)}},_n=function(){return"undefined"==typeof __dirname?u(I(import.meta.url)):__dirname};function cn(t){return JSON.parse(t).list.map((function(t){return t.value}))}var un=E(_n(),"binding","electron-".concat(t(),"-").concat(e(),".node")),En={addon:null},Rn=nn(process).sendError;try{var ln=R(import.meta.url);En.addon=ln(un)}catch(t){console.error("error ->",un,"\n",t),Rn(t.toString())}En.addon||console.error("error -> cannot find module: ",un);var dn,pn,Cn,Tn,Sn,In=En.addon,Nn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return dn.add(e),pn.set(e,!0),Cn.set(e,[]),Tn.set(e,void 0),e}return U(e,t),e.prototype._handleWrite=function(t){var e=this;$t(this,pn,"f")&&($t(this,Cn,"f").push(t),$t(this,Tn,"f")||te(this,Tn,setImmediate((function(){return $t(e,dn,"m",Sn).call(e)})),"f"))},e.prototype.recvRendererLog=function(t){this._stdout(t),this._write(t)},e.prototype.destroy=function(){te(this,pn,!1,"f")},e}(ke);pn=new WeakMap,Cn=new WeakMap,Tn=new WeakMap,dn=new WeakSet,Sn=function(){if($t(this,Tn,"f")&&(clearImmediate($t(this,Tn,"f")),te(this,Tn,null,"f")),$t(this,Cn,"f").length){var t=$t(this,Cn,"f").splice(0).map((function(t){var e=t.sessionId,n=t.level,o=t.time,r=t.type,i=t.tag,s=t.loggerId,a=t.content,_=t.traceId;return{level:n,time:o,type:r,tag:i,sessionId:"".concat(_e,":").concat(_e===e?"main":e),content:JSON.stringify({loggerId:s,content:a,traceId:_})}})),e=JSON.stringify(t),n=Date.now();In.writeLog(e),this.debug(ze.P_WRITE_LOG_O,"write ".concat(t.length," logs, cost ").concat(Date.now()-n,"ms, waiting queue len ").concat($t(this,Cn,"f").length))}};var hn=function(t,e){var n,o=Buffer.from(t),r=o.length;for(e.push(r),n=0;n<r;n++)e.push(o[n])},fn=function(t){return"string"==typeof t},On=function(t){return fn(t)?t.toUpperCase():""},An=function(t,e){var n="";return 2!==t.length?n="Unexpected number of bytes received.":5!==t[0]?n="Unexpected SOCKS version number: ".concat(t[0],"."):255===t[1]?n="No acceptable authentication methods were offered.":-1===e.indexOf(t[1])&&(n="Unexpected SOCKS authentication method: ".concat(t[1],".")),n},gn=function(t){var e="";return 2!==t.length?e="Unexpected number of bytes received.":1!==t[0]?e="Unexpected authentication method code: ".concat(t[0],"."):0!==t[1]&&(e="Username and password authentication failure: ".concat(t[1],".")),e},vn=function(t){var e=On(t.method)||"GET",n=t.pathname||"/",o=t.headers||{},r=t.search||"";o.Host=t.host||"loclahost";var i="";for(var s in i="".concat(e," ").concat(n+r," HTTP/1.1\n"),o)if(Object.hasOwnProperty.call(o,s)){var a=o[s];i+="".concat(s,": ").concat(a,"\n")}return t.body&&(i+="Content-Length: ".concat(t.body.length,"\n")),i+="\n","POST"===e&&t.body&&(i+="".concat(t.body)),i},Pn=function(t){return new Promise((function(e){var n,o;t.socket.once("data",(function(o){var r,i=An(o,n);if(!i)return 2===o[1]?(t.socket.once("data",(function(n){var o=gn(n);o?t.emit("error",new Error("SOCKS authentication failed. ".concat(o))):e()})),r=[1],hn(t.socksUsername,r),hn(t.socksPassword,r),void t.write(Buffer.from(r))):void e();t.emit("error",new Error("SOCKS authentication failed. ".concat(i)))})),n=[0],t.socksUsername&&n.push(2),(o=Buffer.alloc(2+n.length))[0]=5,o[1]=n.length,n.forEach((function(t,e){o[2+e]=t})),t.write(o)}))},Ln=function(t,e,n){return new Promise((function(o){var r,i;switch(t.socket.once("data",(function(e){var n;5!==e[0]?n="Unexpected SOCKS version number: ".concat(e[0],"."):0!==e[1]?n="".concat(function(t){switch(t){case 1:return"General SOCKS server failure";case 2:return"Connection not allowed by ruleset";case 3:return"Network unreachable";case 4:return"Host unreachable";case 5:return"Connection refused";case 6:return"TTL expired";case 7:return"Command not supported";case 8:return"Address type not supported";default:return"Unknown status code ".concat(t)}}(e[1]),"."):0!==e[2]&&(n="The reserved byte must be 0x00."),n?t.emit("error",new Error("SOCKS connection failed. ".concat(n))):o()})),(r=[]).push(5),r.push(1),r.push(0),P(e)){case 0:r.push(3),hn(e,r);break;case 4:r.push(1),function(t,e){var n,o,r=t.split(".");for(n=0;n<4;n++)o=parseInt(r[n],10),e.push(o)}(e,r);break;case 6:t.emit("error",new Error("Does not support IPV6"))}r.length+=2,(i=Buffer.from(r)).writeUInt16BE(n,i.length-2),t.write(i)}))},mn=function(t){function e(e){var n=t.call(this)||this;return n.readable=!0,n.socket=new L,n.options=e,n.socksHost=e.socksHost||"localhost",n.socksPort=e.socksPort||1080,n.socksUsername=e.socksUsername||"",n.socksPassword=e.socksPassword||"",n.socket.on("error",(function(t){n.emit("error",t)})),n.on("error",(function(){n.socket.destroyed||n.socket.destroy()})),n.on("end",n.end),n}return U(e,t),e.prototype.ref=function(){return this.socket.ref()},e.prototype.unref=function(){return this.socket.unref()},e.prototype.setTimeout=function(t,e){return this.socket.setTimeout(t,e)},e.prototype.setNoDelay=function(t){return this.socket.setNoDelay(t)},e.prototype.setKeepAlive=function(t,e){return this.socket.setKeepAlive(t,e)},e.prototype.address=function(){return this.socket.address()},e.prototype.cork=function(){return this.socket.cork()},e.prototype.uncork=function(){return this.socket.uncork()},e.prototype.pause=function(){return this.socket.pause()},e.prototype.resume=function(){return this.socket.resume()},e.prototype.pipe=function(t){return this.socket.pipe(t)},e.prototype.end=function(t,e){var n=this.socket.end(t,e);return this.writable=this.socket.writable,n},e.prototype.destroy=function(t){return this.socket.destroy(t)},e.prototype.setEncoding=function(t){return this.socket.setEncoding(t)},e.prototype.write=function(t,e,n){return this.socket.write(t,e,n)},e.prototype.read=function(t){return this.socket.read(t)},e.prototype.connect=function(t,e){var n=this;if("string"==typeof t&&/^\d+$/.test(t)&&(t=parseInt(t,10)),!Number.isInteger(t)||t<1||t>65535)throw new TypeError("Invalid port: ".concat(t));if(!e||"string"!=typeof e)throw new TypeError("Invalid host: ".concat(e));return this.socket.connect({port:this.socksPort,host:this.socksHost},(function(){return jt(n,void 0,void 0,(function(){var n;return Qt(this,(function(o){switch(o.label){case 0:return[4,Pn(this)];case 1:return o.sent(),[4,Ln(this,e,t)];case 2:return o.sent(),this.onProxied(),n=vn(this.options),this.socket.write(Buffer.from(n)),[2]}}))}))})),this},e.prototype.onProxied=function(){var t=this;this.socket.on("close",(function(e){t.emit("close",e)})),this.socket.on("end",(function(){t.emit("end")})),this.socket.on("data",(function(e){t.emit("data",e)})),this.writable=!0,this.readable=!0,this.emit("connect")},e}(m),yn=function(t){var e,n=t.hostname,o=t.port;return!t.host||n&&o||(e=t.host.split(":")),!o&&e&&(o=parseInt(e[1],10)||0),!n&&e&&(n=qt(e,1)[0]),new mn(t).connect(o,n)},Mn=function(t){function e(e){var n=t.call(this)||this;return n.createConnection=yn,n}return U(e,t),e}(f),Un=function(t,e,n){return(e=Xt(Xt({},e),N(t))).port||(e.port=80),e.agent=new Mn(e),O(e,n)},Dn=function(t){var e,n;return e=yn(t),n=e.onProxied,e.onProxied=function(){var o;t.socket=e.socket,t.hostname?t.servername=t.hostname:t.host&&(o=qt(t.host.split(":"),1),t.servername=o[0]),e.socket=y(t,(function(){e.authorized=e.socket.authorized,n.call(e)})),e.socket.on("error",(function(t){e.emit("error",t)}))},e},Gn=function(t){function e(e,n){var o=t.call(this,n)||this;return o.url=e,o.socksHost=n.socksHost||"localhost",o.socksPort=n.socksPort||1080,o.createConnection=Dn,o}return U(e,t),e}(A),Vn=function(t,e,n,o){var r,i;return e.protocol="https:",!e.port&&e.host&&(r=qt(e.host.split(":"),2),e.port=r[0],e.port=r[1]),e.port||(e.port=443),i=new Gn(t,e),e.agent=i,g(t,e,n)},bn=null;function Fn(t,e,n){void 0===n&&(n=!1);var o=e.url,r=e.headers,i=e.body,s=e.method,a=e.query,_=e.timeout,c=void 0===_?6e4:_;return new Promise((function(e){var _=/^https/.test(o),u={headers:Xt(Xt({},r),{"Accept-Encoding":"gzip, br"}),method:s};_&&(u.rejectUnauthorized=n);var E=null;bn?((u=Xt(Xt({},u),bn)).body=i,E=_?Vn:Un):(E=O,_&&(u.agent=new A(u),E=g));var R=E(function(t,e){if(t=t.replace(/\?$/,""),!e)return t;var n=Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).filter((function(t){return!!t}));return n.length?[t,n.join("&")].join("?"):t}(o,a),u,(function(t){var n,o,r=t.statusCode,i="";if("gzip"===(null===(n=t.headers)||void 0===n?void 0:n["content-encoding"])){var s=v.createGunzip();t.pipe(s),s.on("data",(function(t){i+=t})),s.on("end",(function(){e({status:r,data:i})}))}else if("br"===(null===(o=t.headers)||void 0===o?void 0:o["content-encoding"])){var a=v.createBrotliDecompress();t.pipe(a),a.on("data",(function(t){i+=t})),a.on("end",(function(){e({status:r,data:i})}))}else t.setEncoding("utf8"),t.on("data",(function(t){i+=t})),t.once("end",(function(){e({status:r||0,data:i})}))}));R.once("timeout",(function(){t.warn(ze.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:o,method:s,query:a,timeout:c})),e({status:0})})),R.setTimeout(c),R.once("error",(function(n){t.warn(ze.P_HTTP_REQ_E,JSON.stringify({msg:n.stack,url:o,method:s,query:a,timeout:c})),e({status:0})})),R.write(i),R.end()}))}function wn(t,e){return t?(bn=Xt(Xt({},bn),t),e.info(G.A_SET_PROXY_O,JSON.stringify({msg:"set proxy",data:bn})),{code:ct.SUCCESS}):(bn=null,e.info(G.A_REMOVE_PROXY_O,JSON.stringify({msg:"remove proxy"})),{code:ct.SUCCESS})}function xn(){var t=bn||void 0;return{code:ct.SUCCESS,data:t}}var Hn=function(){function t(t,e,n,o){var r=this;this.p=t,this.emit=e,this.callback=n,this.errorHandle=o,this.count=0,this.maps={},this.p.on("message",(function(t){var i=t.type,s=t.data;switch(i){case $e.EVENT:var a=s,_=a.eventName,c=a.data;null==e||e.apply(void 0,zt([_],qt(c),!1));break;case $e.RESPONSE:var u=s,E=u.reqId,R=u.success,l=u.data,d=r.maps[E];if(!d)return;d({success:R,data:l}),delete r.maps[E];break;case $e.CALLBACK:null==n||n(s);break;case $e.ERROR:var p=s.msg;null==o||o(p)}})),this.p.on("error",(function(t){null==o||o("SubProcessProxy error ".concat(t))})),this.p.on("exit",(function(t,e){if(0!==t){for(var n in r.maps){if(Object.prototype.hasOwnProperty.call(r.maps,n))(0,r.maps[n])({success:!0,data:{code:ct.SUB_PROCESS_EXIT,msg:"sub process exit"}})}null==o||o("SubProcessProxy exit ".concat(t," ").concat(e),!0)}})),this.p.on("close",(function(t,e){console.log("SubProcessProxy close",t,e)}))}return t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return jt(this,void 0,void 0,(function(){var n=this;return Qt(this,(function(o){return this.p.killed||this.p.exitCode?[2,Promise.resolve({success:!1,data:{code:ct.SUB_PROCESS_EXIT,msg:"sub process exit"}})]:[2,new Promise((function(o){var r=++n.count;n.maps[r]=o;var i={reqId:r,method:t,args:e,hasResponse:!0};n.p.send(i)}))]}))}))},t.prototype.send=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return jt(this,void 0,void 0,(function(){var o;return Qt(this,(function(r){return(this.p.killed||this.p.exitCode)&&(null===(e=this.errorHandle)||void 0===e||e.call(this,"sub process exit")),o={reqId:-1,method:t,args:n},this.p.send(o),[2]}))}))},t.prototype.destroy=function(){this.send("destroy")},t}(),Bn="rc-realtime-log-timestamp",kn=[],Jn=!1,Wn=function(){return jt(void 0,void 0,void 0,(function(){var t,e,n,o,r,i,s,a,_,c,u,E;return Qt(this,(function(R){return Jn||0===kn.length||(Jn=!0,t=kn.shift(),e=t.args,n=t.resolve,o=e.startTime,r=e.endTime,i=e.level,s=e.realtimeReport,a=0,_=0,c=!1,u=[],E=function(t){a+=t.length;var e=qt(t.split(",")),n=e[0],o=e[1],r=e[2],E=e[3],R=e[4],l=e.slice(5),d=parseInt(o,10);if(!((c=c||a>=20971520)&&d>=_)){_=Math.max(_,d);try{if(!s&&i<0)return;var p={time:d,level:parseInt(E,10),sessionId:n,type:r,tag:R,content:l.join(",")};u.push(p)}catch(t){console.error(t)}}},In.getFullLog(i,o,r,!1,(function(t){JSON.parse(t).forEach((function(t){return E(t)}))}),(function(t){n(u),Jn=!1,Wn()}))),[2]}))}))},Yn=function(t){function e(e,n,o,r){void 0===r&&(r=!1);var i,s=process.versions.electron,a="Electron|".concat(s,"|").concat(process.arch,"|").concat(process.platform);return i=t.call(this,e,n,a,{getLogs:function(t,e,n,o){return jt(this,void 0,void 0,(function(){return Qt(this,(function(r){switch(r.label){case 0:return[4,(i={startTime:t,endTime:e,level:n,realtimeReport:o},jt(void 0,void 0,void 0,(function(){return Qt(this,(function(t){return[2,new Promise((function(t){kn.push({resolve:t,args:i}),Wn()}))]}))})))];case 1:return[2,{logs:r.sent(),dbReady:!0}]}var i}))}))},getTimestamp4RealtimeLog:function(){var t=In.getStoreValue(Bn);return parseInt(t,10)||0},setTimestamp4RealtimeLog:function(t){In.setStoreValue(Bn,t.toString())}},o,r)||this,i}return U(e,t),e.prototype.send=function(t){return Fn(this.logger,t)},e.prototype.stop=function(){this._subProcess&&this._subProcess.destroy(),t.prototype.stop.call(this)},e.prototype.compressLogs=function(t){return jt(this,void 0,void 0,(function(){var e,n,o,r;return Qt(this,(function(i){switch(i.label){case 0:return this._subProcess||(e=h(E(_n(),"sub-process.cjs.js"),{stdio:["inherit","inherit","inherit","ipc"]}),this._subProcess=new Hn(e)),[4,this._subProcess.call("compressLogs",t)];case 1:return n=i.sent(),o=n.success,r=n.data,o?[2,{success:o,data:r.data}]:[2,{success:o,data:""}]}}))}))},e}(Je),Kn=function(){var n,o=Date.now(),r=[e(),t(),process.pid,o,Math.floor(Math.random()*o)].join("__");return n=r,d("md5").update(n).digest("hex")},Xn=function(){function t(t){this._callCppProxy=t,this._setTime=15962112e5}return t.prototype._setToProtocol=function(t,e,n,o,r,i){var s=JSON.stringify(r);"{}"!==s&&t.info(ze.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:o,ext:r})),this._callCppProxy("setMessageExtension",e,n,o,s,i)},t.prototype.setLocalFromReceiveMsg=function(t,e){var n=e.channelId,o=e.conversationType,r=e.targetId,i=e.messageUId,s=e.expansion,a=e.sentTime;if(s&&0!==Object.keys(s).length){var _={};for(var c in s)_[c]={v:"",ts:0},_[c].v=s[c],_[c].ts=a;this._setToProtocol(t,o,r,i,_,n||"")}},t.prototype.setLocalFromExtMsg=function(t,e){var n=e.channelId,o=e.conversationType,r=e.targetId,i=e.content,s=e.sentTime,a=i,_=a.put,c=this._callCppProxy("getMessage",a.mid),u=JSON.parse(c).extMsg,E=JSON.parse(u||"{}");if(_)for(var R in _){var l=E[R];l&&l.ts<s-this._setTime?(l.v=_[R],l.ts=s-this._setTime):(E[R]={v:"",ts:0},E[R].v=_[R],E[R].ts=s-this._setTime)}a.del&&a.del.forEach((function(t){delete E[t]})),this._setToProtocol(t,o,r,a.mid,E,n||"")},t.prototype.parseReceiveExpansion=function(t){var e=JSON.parse(t.extMsg||"{}"),n={};for(var o in e)n[o]=e[o].v;return n},t.prototype.parseConverOrHisExpansion=function(t){var e=JSON.parse(t.extMsg),n=JSON.parse(e||"{}"),o={};for(var r in n)o[r]=n[r].v;return o},t}(),jn=[Et.RMTP,Et.TLS];"darwin"===process.platform&&jn.push(Et.QUIC);var Qn=function(t){return"RongCloud/navis/".concat(t,"/navi-cache.json")},Zn=function(t){return"RongCloud/caches/".concat(t,"/staticConfig.json")},qn=function(t){return"RongCloud/cloudControl/".concat(t,"/cloudControl.json")};function zn(t){var e,o;void 0===t&&(t="IPv4");var r=n(),i=[];try{for(var s=Zt(Object.values(r)),a=s.next();!a.done;a=s.next()){var _=a.value;if(_&&-1!==Object.prototype.toString.call(_).indexOf("Array")){var c=_.filter((function(e){return!(e.internal||(n=e.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(n))||e.family&&e.family!==t);var n})).map((function(t){return t.mac}));i.push.apply(i,zt([],qt(c),!1))}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(e)throw e.error}}return i.length?zt([],qt(i),!1).sort()[0]:""}var $n,to,eo=function(t){function e(e,n,o,r){var i=t.call(this,e,n,r)||this;i.naviPath="",i._caches={},i.naviPath="".concat(o,"/").concat(Qn(e));var s=u(i.naviPath);return p(s)||rn(s),i}return U(e,t),e.prototype.httpRequest=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s,a,_;return Qt(this,(function(c){switch(c.label){case 0:return r="token=".concat(encodeURIComponent(n),"&v=").concat(oe,"&p=PC&ev=").concat("5.18.0-alpha.2","&m=").concat(zn()),i="".concat(t,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(G.L_REQUEST_T,JSON.stringify({url:i,body:r}),o),[4,Fn(this.logger,{method:"POST",headers:{appId:e},body:r,url:i,timeout:1e4})];case 1:if(200!==(s=c.sent()).status)return this.logger.warn(G.L_REQUEST_R,JSON.stringify({url:i,code:s.status}),o),[2,le(this.transHttpCode(s.status))];this.logger.info(G.L_REQUEST_R,JSON.stringify({url:i,data:s.data}),o);try{return a=JSON.parse(s.data),_=/^https/.test(i)?"https":"http",a.protocol=_,a.code&&200!==a.code?[2,le(this.transHttpCode(a.code))]:[2,Re(a)]}catch(t){return this.logger.error(G.L_PARSE_NAVI_E,s.data,o),[2,le(ct.RC_NAVI_REQ_FAILED)]}return[2]}}))}))},e.prototype.httpRequestV2=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s,a;return Qt(this,(function(_){switch(_.label){case 0:return r=this.getNaviV2RequestOption({appkey:e,token:n,uri:t,platform:"electron",protocol:jn.join(","),mac:zn()}),this.logger.info(G.L_REQUEST_T,JSON.stringify({url:r.url,body:r.body,headers:r.headers}),o),[4,Fn(this.logger,r)];case 1:if(200!==(i=_.sent()).status)return this.logger.warn(G.L_REQUEST_R,JSON.stringify({url:r.url,code:i.status}),o),[2,le(this.transHttpCode(i.status))];this.logger.info(G.L_REQUEST_R,JSON.stringify({url:r.url,data:i.data}),o);try{return s=JSON.parse(i.data),a=/^https/.test(r.url)?"https":"http",s.protocol=a,[2,Re(s)]}catch(t){return this.logger.error(G.L_PARSE_NAVI_E,i.data,o),[2,le(ct.RC_NAVI_REQ_FAILED)]}return[2]}}))}))},e.prototype.getNaviCache=function(t){var e=this.getCatchKey(t),n=this._caches[e];if(n)return n;if(!p(this.naviPath))return null;var o=T(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(o),this._caches[e]}catch(t){this.logger.error(G.L_PARSE_NAVI_E,o)}return null},e.prototype.setNaviCache=function(t,e){var n=Date.now(),o=this.getCatchKey(t);if(Ne(this._caches))for(var r in this._caches){(n-this._caches[r].timestamp>ee||o===r)&&delete this._caches[r]}this._caches[o]={token:t,naviInfo:e,timestamp:Date.now(),environment:this._environment},S(this.naviPath,JSON.stringify(this._caches))},e.prototype.setEnvironment=function(t){this._environment=t},e}(en);var no,oo,ro,io,so,ao=function(){function t(t,e,n){var o=this;this._logger=t,this._method=e,$n.add(this),this._traceId=null!=n?n:this._logger.createTraceId(),this._promise=new Promise((function(t){o._resolve=t}))}return t.create=function(e,n,o){return new t(e,n,o)},t.prototype.invoke=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=$t(this,$n,"m",to)).call.apply(t,zt([this,!0],qt(e),!1))},t.prototype.asyncInvoke=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=$t(this,$n,"m",to)).call.apply(t,zt([this,!1],qt(e),!1))},t.prototype.ok=function(t){this._logger.debug(ze.P_CALL_ADDON_R,"success",this._traceId),this._flush(Re(t))},t.prototype.fail=function(t,e){this._logger.warn(ze.P_CALL_ADDON_R,"faile: ".concat(t),this._traceId),this._flush(le(t,"",e))},t.prototype._flush=function(t){var e=this;setTimeout((function(){return e._resolve(t)}),0)},t.prototype.result=function(){return this._promise},t}();$n=new WeakSet,to=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=this,i=r._method,s=r._traceId,a=r._logger;a.debug(ze.P_CALL_ADDON_T,JSON.stringify({method:i,params:n}),s);try{e=In[i].apply(In,zt([],qt(n),!1))}catch(t){throw a.error(ze.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:i}),s),t}return t&&e!==ct.SUCCESS&&this.fail(e),this},function(t){t[t.SUCCESS=0]="SUCCESS",t[t.NOT_INIT=-1]="NOT_INIT",t[t.CANCELED=-2]="CANCELED",t[t.REPEAT=-3]="REPEAT"}(so||(so={}));var _o=function(t){function e(e,n,o,r){var i=t.call(this,e,o,r)||this;return i.callCppProxy=n,no.add(i),i._connectedTime=0,i._naviInfo=null,i._excludeLogTag=["P-API_RCGetValueForKey-T","P-API_RCGetValueForKey-E","P-API_RCGetValueForKey-R","P-API_RCSetValueForKey-T","P-API_RCSetValueForKey-E","P-API_RCSetValueForKey-R"],i._connectingTask=null,i._tcpDuration=0,i.pingResolve=null,i.callCppProxy("setConnectionStatusListener",$t(i,no,"m",ro).bind(i),(function(t){return i.logger.info(ze.P_DB_OPEN_O,t)}),(function(){return i.recvPong(ct.SUCCESS)}),$t(i,no,"m",oo).bind(i),i._onTcpConnectResponse.bind(i),(function(){i.logger.info(ze.P_DB_UPGRATE_START_S),i.emit("onDBUpgrateStart")}),(function(t){i.logger.info(ze.P_DB_UPGRATING_S,t),i.emit("onDBUpgrading",t)}),(function(t){i.logger.info(ze.P_DB_UPGRATE_COMPLETE_S,t),i.emit("onDBUpgradeComplete",t)})),i}return U(e,t),e.prototype.getConnectedTime=function(){return this._connectedTime},e.prototype.connectWithToken=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R,l,d,p,C,T,S=this;return Qt(this,(function(I){switch(I.label){case 0:return r=this._connectingTask=ao.create(this.logger,"connectWithToken",o),this._naviInfo=e,i={},(s=xn().data)&&(i={proxy_passwd:s.socksPassword||"",proxy_name:s.socksUsername||"",proxy_port:s.socksPort||1082,proxy_host:s.socksHost||"localhost",proxy_type:0}),a=JSON.stringify(Xt(Xt({},i),{call_plus:this._openCallPlus,cid:this.cid})),_=this.getCmpList(e,!0).filter((function(t){return jn.includes(t.protocol)})).sort((function(t,e){return e.weight-t.weight})),c=[],_.forEach((function(t){var e=c.find((function(e){return e.addr===t.addr}));e?e.protocol!==Et.QUIC&&t.protocol!==Et.QUIC||(e.race=!0,e.protocol=Et.QUIC):(t.race=!1,c.push(t))})),u=Date.now(),[4,r.asyncInvoke(t,oe,JSON.stringify(Xt(Xt({},e),{serverAddr:c,tagBlacklist:this._excludeLogTag.join(",")})),n,a).result()];case 1:return E=I.sent(),R=JSON.parse(E.data),l=R.cid,d=R.userId,p=R.sessionId,C=Date.now()-(u+this._tcpDuration),T={bid:me(),cod:E.code,net:this.getNetwork().type,dur:C,spr:0,cid:l,v:Ht.CURRENT,count:this.retryCount,sts:Date.now(),ssid:p},this.logger.record(Dt.IM_CMP_RMTP,JSON.stringify(T)),this._connectingTask=null,[2,E.trans((function(t){return S._connectedTime=Date.now()-S.callCppProxy("getDeltaTime"),d}))]}}))}))},e.prototype.close=function(t,e){void 0===e&&(e=!0),t||this.callCppProxy("disconnect",e)},e.prototype.sendPing=function(t){var e=this;return new Promise((function(n){e.pingResolve=n,e.callCppProxy("sendHeartbeat"),setTimeout((function(){return e.recvPong(ct.TIMEOUT)}),t)}))},e.prototype.recvPong=function(t){this.pingResolve&&(this.pingResolve(t),this.pingResolve=null)},e.prototype.recvConnectRes=function(t,e,n,o){if(this._connectingTask)t===ct.SUCCESS?this._connectingTask.ok(n):this._connectingTask.fail(t,n);else if(e)this.onDisconnectByServer(t,o);else{if(t===ct.RC_SOCKET_DISCONNECTED)if(this.getConnectionStatus()!==Lt.CONNECTED)return;this.onDisconenctUnusual(t)}},e.prototype._onTcpConnectResponse=function(t,e,n,o,r,i,s){var a,_=this.cmpWeightCache.findIndex((function(t){return t.addr==="".concat(e,":").concat(n)})),c={bid:me(),ptc:wt.TCP,cod:t,net:this.getNetwork().type,dur:o,spr:0,pr:(null===(a=this._naviInfo)||void 0===a?void 0:a.type)||0,hos:"".concat(e,":").concat(n),idx:_,rct:this.retryCount?Bt.RECONNECT:Bt.CONNECT,cid:this.cid,v:Ht.CURRENT,rsn:this._doConnectReason,ddu:r,count:this.retryCount,weight:_>=0?this.cmpWeightCache[_].weight:-1};if(this.logger.record(Dt.IM_CMP,JSON.stringify(c)),this.logger.info(ze.P_CONNECT_ENTRY_S,JSON.stringify({code:t,host:e,port:n,duration:o,dnsDuration:r,index:i,isQuic:s})),t===so.SUCCESS)this.curCmpUrl="".concat(e,":").concat(n),this.updateCmpWeight("".concat(e,":").concat(n),!0,s);else if(t!==so.NOT_INIT){var u=n&&0!==n?"".concat(e,":").concat(n):"".concat(e);this.updateCmpWeight(u,!1)}},e}(qe);no=new WeakSet,oo=function(t,e){$t(this,no,"m",io).call(this,t,void 0,e)},ro=function(t,e){$t(this,no,"m",io).call(this,t,e)},io=function(t,e,n){switch(this.logger.info(ze.P_CONNECT_S,JSON.stringify({status:t,delay:n,jsonData:e})),t){case ct.SUCCESS:this.recvConnectRes(ct.SUCCESS,!1,e);break;case ct.RC_CONN_REDIRECTED:case 32061:this.recvConnectRes(ct.RC_CONN_REDIRECTED,!0,e);break;case 11:case 10:case 12:break;case ct.RC_SOCKET_DISCONNECTED:case ct.RC_SOCKET_NOT_CREATED:case ct.RC_CONN_ACK_TIMEOUT:case ct.RC_TCP_RESET:this.recvConnectRes(t,!1,e);break;case ct.RC_UDP_DISCONNECTED:this.recvConnectRes(t,!0,e,n);break;default:this.recvConnectRes(t,!0,e)}};var co,uo,Eo,Ro=function(t){function e(e,n,o){var r=t.call(this,e,n)||this;r.appkey=e,r.logger=n,r.dbpath=o,r._cachePath="",r._cachePath="".concat(o,"/").concat(Zn(e));var i=u(r._cachePath);return p(i)||rn(i),r}return U(e,t),e.prototype.getCache=function(){return p(this._cachePath)&&T(this._cachePath,{encoding:"utf8"})||null},e.prototype.setCache=function(t){S(this._cachePath,t)},e.prototype.clearCache=function(){S(this._cachePath,"")},e.prototype.sendRequest=function(t){return jt(this,void 0,void 0,(function(){var e,n,o;return Qt(this,(function(r){switch(r.label){case 0:return[4,Fn(this.logger,{url:t,body:""})];case 1:return e=r.sent(),n=e.status,o=e.data,[2,{code:n,data:o}]}}))}))},e.prototype.decryptData=function(t){return jt(this,void 0,void 0,(function(){var e,n;return Qt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,on(t,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return e=o.sent(),[2,JSON.parse(e)];case 2:return n=o.sent(),this.logger.error(G.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))},e}(He),lo=function(t){function e(e,n,o,r,i){var s=t.call(this,n,e,o)||this;s.deviceId=r,s.model="",s.catchFilePath="",s.model="Electron|".concat(process.platform,"|").concat(process.arch),s.catchFilePath="".concat(i,"/").concat(qn(e));var a=u(s.catchFilePath);return p(a)||rn(a),s.init(),s}return U(e,t),e.prototype.httpRequest=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E;return Qt(this,(function(R){switch(R.label){case 0:return(r=o).deviceId=this.deviceId,r.model=this.model,i={url:t,method:e,headers:n,body:JSON.stringify(r)},this.logger.info(G.L_REQUEST_T,JSON.stringify(i)),[4,Fn(this.logger,i)];case 1:s=R.sent(),a=s.status,_=s.data,c=void 0===_?"":_,this.logger.info(G.L_REQUEST_R,JSON.stringify({status:a,data:c}));try{return u=JSON.parse(c),E=u.data,[2,{code:a,data:E}]}catch(t){return this.logger.warn(G.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:a,data:c,error:t})),[2,{code:a,msg:t}]}return[2]}}))}))},e.prototype.setCloudControllerCache=function(t){S(this.catchFilePath,JSON.stringify(t)),this.logger.info(G.L_CLOUD_SET_CACHE_O,JSON.stringify(t))},e.prototype.getLocalCloudControllerCache=function(){if(!p(this.catchFilePath))return null;var t=T(this.catchFilePath,{encoding:"utf8"});return this.logger.info(G.L_CLOUD_GET_CACHE_O,JSON.stringify({appkey:this.appkey,data:t})),t},e.prototype.setMRTRConfig=function(t){var e={mrtrChatroom:t.chatroom,mrtrGroup:t.group,mrtrPrivate:t.private,mrtrUltraGroup:t.ultraGroup};this.logger.info(G.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),In.setCloudConfig(JSON.stringify(e))},e}(Qe);!function(t){t[t.cuid=1]="cuid",t[t.uid=2]="uid",t[t.all=4]="all"}(Eo||(Eo={}));var po,Co,To=function(){function u(t,e,n,o,r,i){var s=this;this._appkey=t,this._dbpath=e,this._dispatchEvent=n,this._enableSyncEmptyTopConversation=o,this._logOutputLevel=r,co.add(this),this._customMessageType={},this.cloudControllerUri="",this.cloudControllerLock=!0,this.cloudControllerMsgs=[],this._buildSubscribeEventData=function(t){var e=[];try{JSON.parse(t).list.forEach((function(t){var n=JSON.parse(t.obj),o=n.userId,r=n.subscribeType,i=n.subscribeTime,a=n.duration,_=n.operationType,c=n.details,u=void 0===c?[]:c,E=n.userProfile,R={userId:o,subscribeType:r,subscribeTime:i,expiry:a,operationType:_};[gt.ONLINE_STATUS,gt.FRIEND_ONLINE_STATUS].includes(r)&&(R.details=u.map((function(t){var e=JSON.parse(t);return{changeTime:e.changeTime,eventValue:e.changeValue,platform:e.platform}}))),[gt.USER_PROFILE,gt.FRIEND_USER_PROFILE].includes(r)&&(R.userProfile=s._string2userProfileInfo(E)),e.push(R)}))}catch(e){s.logger.error(ze.P_PARSE_JSON_SUBSCRIBE_DATA_E,JSON.stringify({error:null==e?void 0:e.stack,data:t}))}return e},this._chatroomCache=[],this.rtcHeartbeatResolves={};var a=this._dbpath,_=this._deviceId=Kn();this.logger=new Nn(this._appkey,"RC-M","IM"),In.initWithAppkey(t,a,oe,this.logger.getSessionId()),In.setConsoleLogLevel((this._logOutputLevel||Fe.WARN)+1),this.logger.setOutputLevel(this._logOutputLevel),this.reporter=new Yn(t,_,this.logger,i),this.logger.info(ze.P_INIT_O,JSON.stringify({appkey:t,dbpath:a,proto_commit:In.getNodeVersion(),deviceId:_,commit:"4b48aa9b1af1d50bc814d6dde78ab46547dba9a9",processName:process.title,processPId:process.pid,disableLogReport:i})),this._callCppProxy("setDeviceId",_),this._staticConfigManager=new Ro(t,this.logger,a),this.navi=new eo(t,this.logger,a,this._staticConfigManager),this.tcpMgr=new _o(t,this._callCppProxy.bind(this),this.navi,this.logger),this.tcpMgr.on("onConnected",this.onConnected,this),this.tcpMgr.on("onSuspend",this.onSuspend,this),this.tcpMgr.on("onDisconnected",this.onDisconnected,this),this.tcpMgr.on("onConnecting",this.onConnecting,this),this.tcpMgr.on("onDBUpgrateStart",this.dbUpgradeStart,this),this.tcpMgr.on("onDBUpgrading",this.dbUpgrading,this),this.tcpMgr.on("onDBUpgradeComplete",this.dbUpgradeComplete,this),this._enableCreateEmptyTopConversation(this._enableSyncEmptyTopConversation),this._initCloudController(_,a),this._registerMsgTypes(),this._setOnReceiveMessageListener(),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),this._msgExpansionHandler=new Xn(this._callCppProxy.bind(this))}return u.prototype._initCloudController=function(t,e){var n;n=qt(xe.getCloudControllerUrl(),1),this.cloudControllerUri=n[0],this.cloudController=new lo(this._appkey,this.logger,this.reporter,t,e),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Be.init)},u.prototype.callProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return jt(this,void 0,void 0,(function(){var n,o,r;return Qt(this,(function(i){switch(i.label){case 0:if(!(n=this[t]))return this.logger.warn(ze.P_CALL_MAIN_E,JSON.stringify({method:t,error:"not found"})),[2,Promise.resolve({code:ct.NOT_SUPPORT})];o="",i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.call.apply(n,zt([this],qt(e),!1))];case 2:return[2,i.sent()];case 3:return r=i.sent(),o=JSON.stringify({error:null==r?void 0:r.stack,method:t}),this.logger.error(ze.P_CALL_MAIN_E,o),[3,4];case 4:return[2,{code:ct.MAIN_PROCESS_ERROR,msg:o}]}}))}))},u.prototype.sendProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return jt(this,void 0,void 0,(function(){var n;return Qt(this,(function(o){if(!(n=this[t]))return this.logger.warn(ze.P_CALL_MAIN_E,JSON.stringify({method:t,error:"not found"})),[2];try{n.call.apply(n,zt([this],qt(e),!1))}catch(e){this.logger.error(ze.P_CALL_MAIN_E,JSON.stringify({error:null==e?void 0:e.stack,method:t}))}return[2]}))}))},u.prototype.registerRenderers=function(t){var e=t.navigators,n=t.areaCode,o=t.logServerUrl,r=t.environment;this._environment=r||"default",this.navi.setEnvironment(r),xe.init({areaCode:n,navigators:e,logServerUrl:o})},u.prototype.onConnected=function(){return jt(this,void 0,void 0,(function(){var t,e,n;return Qt(this,(function(o){switch(o.label){case 0:return t=this.getNaviInfoFromCache(),this.reporter.checkStart(t,""),this._try2RejoinChatroom(),e=this._dispatchEvent,n=["onConnected"],[4,this.getMainProcessCache()];case 1:return e.apply(this,n.concat([o.sent()])),[2]}}))}))},u.prototype.onConnecting=function(){this._dispatchEvent("onConnecting",void 0)},u.prototype.onSuspend=function(t){this._dispatchEvent("onSuspend",t)},u.prototype.onDisconnected=function(t){this._dispatchEvent("onDisconnected",t)},u.prototype.dbUpgradeStart=function(){this._dispatchEvent("databaseUpgradeWillStart")},u.prototype.dbUpgrading=function(t){this._dispatchEvent("databaseUpgrading",t)},u.prototype.dbUpgradeComplete=function(t){this._dispatchEvent("databaseUpgradeDidComplete",t)},u.prototype._callCppProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this.logger.createTraceId();try{return this.logger.debug(ze.P_CALL_ADDON_O,JSON.stringify({method:t,content:e}),o),In[t].apply(In,zt([],qt(e),!1))}catch(e){throw this.logger.error(ze.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:t}),o),e}},u.prototype.refetchNaviInfo=function(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())},u.prototype.sendHTTPRequest=function(t){return Fn(this.logger,t)},u.prototype.onReceiveRendererLog=function(t){this.logger.recvRendererLog(t)},u.prototype.setNetwork=function(t,e){if(this.tcpMgr.setNetwork(t,e),t.status&&this.cloudController){var n=this.tcpMgr.getToken();this.cloudController.request(this.cloudControllerUri,Be.newWorkChange,n)}},u.prototype.destroy=function(){this.reporter.stop(),this.logger.destroy(),In.destroy(),process.exit(0)},u.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this[t];if(!o)return this.logger.warn(ze.P_CALL_EXTRA_E,JSON.stringify({method:t,error:"not found"})),Promise.resolve({code:ct.NOT_SUPPORT});try{return o.call.apply(o,zt([this],qt(e),!1))}catch(e){this.logger.error(ze.P_CALL_EXTRA_E,JSON.stringify({error:null==e?void 0:e.stack,method:t}))}return Promise.resolve({code:ct.MAIN_PROCESS_ERROR})},u.prototype.getConversationsByPage=function(t,e,n,o,r){var i,s=this,a=this._callCppProxy("getConversationListByPageWithTopPriority",t,e,n,r||!1,o||"");try{i=JSON.parse(a).list.map((function(t){return s._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:ct.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ct.SUCCESS,data:i})},u.prototype.getUnreadConversationList=function(t){var e,n=this,o=this._callCppProxy("getUnreadConversationList",t);try{e=JSON.parse(o).list.map((function(t){return n._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:ct.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ct.SUCCESS,data:e})},u.prototype.getConversationListWithAllChannel=function(){var t,e=this,n=[ut.PRIVATE,ut.GROUP,ut.SYSTEM,ut.APP_PUBLIC_SERVICE,ut.PUBLIC_SERVICE],o=this._callCppProxy("getConversationListWithAllChannel",n);try{t=JSON.parse(o).list.map((function(t){return e._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:ct.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ct.SUCCESS,data:t})},u.prototype.getConversationListWithAllChannelByPage=function(t,e){var n,o=this,r=[ut.PRIVATE,ut.GROUP,ut.SYSTEM,ut.APP_PUBLIC_SERVICE,ut.PUBLIC_SERVICE],i=this._callCppProxy("getConversationListWithAllChannelByPage",r,t,e);try{n=JSON.parse(i).list.map((function(t){return o._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:ct.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ct.SUCCESS,data:n})},u.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,s){var a=0===i,_=o+1,c=this._callCppProxy("getHistoryMessagesByObjectNames",t,e,n,_,r,a,s||""),u=[];try{var E=JSON.parse(c).list;E.reverse();for(var R=0;R<E.length;R++){var l=this._buildMessage(E[R].obj);u[R]=l}}catch(t){return Promise.resolve({code:ct.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ct.SUCCESS,data:{list:_===u.length?u.slice(1,_):u,hasMore:o<u.length}})},u.prototype.updateMessageReceiptStatus=function(t,e,n,o){void 0===o&&(o="");var r=this._callCppProxy("updateMessageReceiptStatus",t,e,n,o);return Promise.resolve({code:ct.SUCCESS,data:r})},u.prototype.getNaviInfoFromCache=function(){return this.tcpMgr.getConnectionStatus()!==Lt.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())},u.prototype.createLogger=function(t,e){return/^RC/.test(t)?null:new Nn(this._appkey,t,e)},u.prototype.getConnectedTime=function(){return this.tcpMgr.getConnectedTime()},u.prototype.getServerTime=function(){return Date.now()-In.getDeltaTime()},u.prototype.getCurrentUserId=function(){return this.tcpMgr.getCurrentUserId()},u.prototype.getMainProcessCache=function(){var t=this.tcpMgr.getConnectedTime(),e=this.tcpMgr.getConnectionStatus(),n=this.getNaviInfoFromCache(),o=this.tcpMgr.getCurrentUserId(),r=this.getDeviceId(),i=In.getDeltaTime();return Promise.resolve({connectedTime:t,deviceId:r,crtUserId:o,naviInfo:n,connectionStatus:e,deltaTime:i})},u.prototype._enableCreateEmptyTopConversation=function(t){this._callCppProxy("enableCreateEmptyTopConversation",t)},u.prototype._registerMsgTypes=function(){for(var t in ne["RC:RcCmd"]={isCounted:!1,isPersited:!1},ne){var e=ne[t],n=e.isCounted,o=e.isPersited,r=e.searchProps,i=0;o&&(i|=1),n&&(i|=2),"RC:TypSts"===t&&(i=16),this._callCppProxy("registerMessageType",t,i,r||[])}},u.prototype._buildIsMentioned=function(t,e){var n,o=!1;if(Te(t))n=t;else try{n=t?JSON.parse(t):t}catch(e){n=t,this.logger.error(ze.P_PARSE_JSON_MSGS_E,JSON.stringify({content:t}))}return Te(n)&&(o=!!n.mentionedInfo),{isMentioned:o,msgContent:n}},u.prototype._buildMsgOption=function(t){var e={isCounted:!1,isPersited:!1};return t in ne?e=ne[t]:t in this._customMessageType&&(e=this._customMessageType[t]),e},u.prototype._buildSupportExt=function(t,e,n){var o=null;return t&&(o=this._msgExpansionHandler.parseReceiveExpansion(n),"conversation"!==e&&"history"!==e||(o=this._msgExpansionHandler.parseConverOrHisExpansion(n))),o},u.prototype._handleReadReceiptRequest=function(t){var e=JSON.parse(t),n=this.getNaviInfoFromCache();if(!(null==n?void 0:n.grpRRVer))return e;var o=e,r=o.hasRespond,i=o.readerInfo,s=void 0===i?{}:i,a=o.readCount,_=o.totalCount,c=o.readerList,u=void 0===c?[]:c,E={readCount:a,totalCount:_};if(1===(null==n?void 0:n.grpRRVer)){var R=[];for(var l in s)R.push({userId:l,readTime:s[l]});E.readerList=R,E.hasRespond=r}return 3===(null==n?void 0:n.grpRRVer)&&(E.readerList=u),E},u.prototype._buildMessage=function(t,e){var n;void 0===e&&(e={});var o=e.isOffLineMessage,r=e.buildFrom,i=JSON.parse(t),s=i.channelId,a=i.conversationType,_=i.targetId,c=i.senderUserId,u=i.content,E=i.objectName,R=i.messageUid,l=i.direction,d=i.status,p=i.messageId,C=i.sentTime,T=i.readReceiptRequest,S=i.supportExt,I=i.pushContent,N=i.pushTitle,h=i.pushId,f=i.pushConfig,O=i.templateId,A=i.disableTitle,g=i.forcePushDetail,v=i.hasMore,P=i.directedUsers,L=i.noNotification,m=i.disableUpdateLastMessage,y=this._buildIsMentioned(u,p),M=y.isMentioned,U=y.msgContent,D=this._buildMsgOption(E),V=this._buildSupportExt(S,r,i),b=Se(o)?C<this.tcpMgr.getConnectedTime():o,F={};f&&(F=function(t,e,n){var o={},r={notificationId:n||""},i={};if(!e)return{iOSConfig:o,androidConfig:r,harmonyOSConfig:i};try{var s=JSON.parse(e);null==s||s.forEach((function(t){var e,n,s,a,_,c,u,E,R,l,d,p,C=Object.keys(t);if(0!==C.length){var T=C[0];switch(T){case"HW":return r.channelIdHW=null===(e=t[T])||void 0===e?void 0:e.channelId,r.importanceHW=null===(n=t[T])||void 0===n?void 0:n.importance,r.imageUrlHW=null===(s=t[T])||void 0===s?void 0:s.image,void(r.categoryHW=null===(a=t[T])||void 0===a?void 0:a.category);case"MI":return void(r.channelIdMi=null===(_=t[T])||void 0===_?void 0:_.channelId);case"OPPO":return void(r.channelIdOPPO=null===(c=t[T])||void 0===c?void 0:c.channelId);case"VIVO":return r.typeVivo=null===(u=t[T])||void 0===u?void 0:u.classification,void(r.categoryVivo=null===(E=t[T])||void 0===E?void 0:E.category);case"APNS":return o.threadId=t[T]["thread-id"],o.apnsCollapseId=t[T]["apns-collapse-id"],o.category=t[T].category,o.richMediaUri=t[T].richMediaUri,void(o.interruptionLevel=t[T]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:t[T].collapse_key||"",imageUrl:t[T].imageUrl||"",priority:t[T].priority||""});case"HONOR":return r.importanceHonor=null===(R=t[T])||void 0===R?void 0:R.importance,void(r.imageUrlHonor=null===(l=t[T])||void 0===l?void 0:l.image);case"OHOS":i.category=null===(d=t[T])||void 0===d?void 0:d.category,i.image=null===(p=t[T])||void 0===p?void 0:p.image}}}))}catch(n){t.error(G.O,"Wrong format for pushConfigs field! content: ".concat(e))}return{iOSConfig:o,androidConfig:r,harmonyOSConfig:i}}(this.logger,f,h));var w=Xt(Xt({},F),{pushTitle:N,pushContent:I,pushData:I,disablePushTitle:A,forceShowDetailContent:g,templateId:O}),x={channelId:s,conversationType:a,targetId:_,senderUserId:c,content:U||{},messageType:E,messageUId:R||"",messageDirection:l,isOffLineMessage:b,sentTime:C,receivedTime:0,isPersited:D.isPersited,isCounted:D.isCounted,isMentioned:M,disableNotification:L,isStatusMessage:(null===(n=this._customMessageType[E])||void 0===n?void 0:n.isStatusMessage)||!1,canIncludeExpansion:S,expansion:S?V:null,receivedStatus:d,receivedStatusInfo:he(d),messageId:p,pushConfig:w,hasMore:v,directedUserIds:P||[],disableUpdateLastMessage:m};if(l===Mt.RECEIVE?x.receivedStatus=this._compatibleReceivedStatus(x.receivedStatusInfo):l===Mt.SEND&&(x.sentStatus=d),T){var H=this._handleReadReceiptRequest(T);x.readReceiptInfo=H}return x},u.prototype._compatibleReceivedStatus=function(t){var e=bt.UNREAD;return t.isRead?e=bt.READ:t.isListened?e=bt.LISTENED:t.isDownload?e=bt.DOWNLOADED:t.isRetrieved&&(e=bt.RETRIEVED),e},u.prototype._updateReadReceiptInfo=function(t,e){var n=this._callCppProxy("getMessage",t),o=JSON.parse(n),r=o.readReceiptRequest?JSON.parse(o.readReceiptRequest):{},i=Xt(Xt({},r),e);this._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify(i))},u.prototype._processRRRspMsg=function(t,e,n){var o,r,i,s;if(e!==this.getCurrentUserId()){var a=t[this.getCurrentUserId()]||[];try{for(var _=Zt(a),c=_.next();!c.done;c=_.next()){N=c.value;var u=this._callCppProxy("getMessage",N),E=JSON.parse(u),R=E.readReceiptRequest?JSON.parse(E.readReceiptRequest):{},l=R.isReceiptRequestMessage,d=R.readerList,p=void 0===d?[]:d;l&&!p.includes(e)&&(p.push(e),this._callCppProxy("updateReadReceiptRequestInfo",N,JSON.stringify({isReceiptRequestMessage:l,readerList:p})))}}catch(t){i={error:t}}finally{try{c&&!c.done&&(s=_.return)&&s.call(_)}finally{if(i)throw i.error}}}else for(var C in t){var T=t[C];try{for(var S=(o=void 0,Zt(T)),I=S.next();!I.done;I=S.next()){var N=I.value;this._callCppProxy("updateReadReceiptRequestInfo",N,JSON.stringify({isReceiptRequestMessage:!0,hasRespond:!0}))}}catch(t){o={error:t}}finally{try{I&&!I.done&&(r=S.return)&&r.call(S)}finally{if(o)throw o.error}}}},u.prototype._processRSMsg=function(t){var e=t.conversationType,n=t.targetId,o=t.content,r=t.channelId,i=o.msgId,s=o.rrn,a=o.tmn,_=o.endMsgTime;e===ut.PRIVATE?this.updateMessageReceiptStatus(e,n,_,r||""):this._updateReadReceiptInfo(i,{readCount:s,totalCount:a});var c={conversationType:e,targetId:n,channelId:r};this._sendMessageReadReceipt(e===ut.PRIVATE?{privateReadReceipt:Xt(Xt({},c),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:Xt(Xt({},c),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})},u.prototype._processSRSMsg=function(t){var e=this.getNaviInfoFromCache(),n=t.conversationType,o=t.targetId,r=t.content,i=t.channelId,s=t.senderUserId,a=t.sentTime;return s===this.tcpMgr.getCurrentUserId()&&(1!==(null==e?void 0:e.sesDriven)||(a>this.tcpMgr.getConnectedTime()||this._sendsyncReadStatus({conversationType:n,targetId:o,channelId:i,timestamp:r.lastMessageSendTime}),!1))},u.prototype._buildConversation=function(t){var e=JSON.parse(t),n=e.channelId,o=e.conversationType,r=e.targetId,i=e.unreadCount,s=e.lastestMsg,a=e.isTop,_=e.blockStatus,c=e.matchCount,u=e.hasUnreadMention,E=e.conversationTime,R=e.draft,l=_>0?Gt.OPEN:Gt.CLOSE;return{channelId:n,conversationType:o,targetId:r,unreadMessageCount:i,latestMessage:-1===JSON.parse(s).messageId?null:this._buildMessage(s),hasMentioned:u,mentionedInfo:null,notificationStatus:l,isTop:a,lastUnreadTime:0,matchCount:c,operationTime:E,notificationLevel:_,draft:R}},u.prototype._convertResultList=function(t,e){var n=JSON.parse(t).list;return n=n.map((function(t){var n=JSON.parse(t.obj);return e?e(n):n}))},u.prototype._handleNotNotificationMessage=function(t){var e,n=t.messageType,o=t.senderUserId,r=t.content;if(n===dt.LOG_COMMAND&&t.senderUserId===re){var i=t.content,s=i.startTime,a=i.endTime,_=i.platform,c=i.logId,u=i.uri;return this.reporter.report(parseInt(s,10),parseInt(a,10),_,u,c,t.messageUId),!0}if(n===dt.CLOUD_CONTROL&&o===re)return this.cloudControllerMsgs.push(t),this._ccMsgHandler(),!0;if(n===dt.READ_STATE)return this._processRSMsg(t),!0;if("RC:MsgExMsg"===n)return this._msgExpansionHandler.setLocalFromExtMsg(this.logger,t),this._sendMessageExpansion(t),!0;if(n===dt.SYNC_READ_STATUS&&!this._processSRSMsg(t))return!0;if(n===dt.DELIVERED)return this._callCppProxy("setMessageDeliverTime",JSON.stringify(r)),this._sendMessageDelivered(t.content.map((function(t){return{deliverTime:t.time,messageUId:t.messageUId,objectName:t.objectName,targetId:t.targetId}}))),!0;if(n===dt.DELIVERED_MSG){var E={totalCount:t.content.tmn,list:null===(e=t.content.dl)||void 0===e?void 0:e.map((function(t){return{MessageUId:t.msgId,deliveryCount:t.drn}}))};return this._sendGroupMessageDeliveredStatus(E),!0}return!1},u.prototype._setOnReceiveMessageListener=function(){var t=this;In.setOnReceiveMessageListener((function(e,n,o,r){try{var i=t._buildMessage(e,{isOffLineMessage:o}),s=i.messageType,a=i.channelId,_=void 0===a?"":a,c=i.senderUserId,u=i.content,E=i.sentTime,R=i.conversationType,l=i.targetId;if(t._handleNotNotificationMessage(i))return;if(s===dt.READ_RECEIPT_REQUEST&&u.messageUId&&t._updateReadReceiptInfo(u.messageUId,{isReceiptRequestMessage:!0,hasRespond:!1}),s===dt.READ_RECEIPT_RESPONSE&&u.receiptMessageDic&&t._processRRRspMsg(u.receiptMessageDic,c,E),s===dt.GROUP_READ_RECEIPT_REQUEST){var d=u.msgId,p=u.rrn,C=u.tmn;t._updateReadReceiptInfo(d,{readCount:p,totalCount:C})}i.canIncludeExpansion&&t._msgExpansionHandler.setLocalFromReceiveMsg(t.logger,i),s===dt.READ_RECEIPT&&c===t.tcpMgr.getCurrentUserId()&&t._callCppProxy("clearUnreadCountByTimestamp",R,l,u.lastMessageSendTime,_);var T=!0;if(0!==n||r||(T=!1),s===dt.RECALL_NOTIFICATION_MESSAGE)return;if(s===dt.RECALL){if(!$t(t,co,"m",uo).call(t,i))return;var S=t._fixRecallContentInfo(i);R=S.conversationType,l=S.targetId}t._sendMessageNotification(Object.assign(i,{hasMoreMsg:T,conversationType:R,targetId:l}))}catch(n){t.logger.error(ze.P_RECEIVE_MESSAGE_E,JSON.stringify({error:null==n?void 0:n.stack,message:e}))}}),(function(){t._sendPullOfflineFinished()}))},u.prototype._ccMsgHandler=function(){var t;return jt(this,void 0,void 0,(function(){var e,n;return Qt(this,(function(o){switch(o.label){case 0:return this.cloudControllerLock?(this.cloudControllerLock=!1,this.cloudControllerMsgs.shift()?(e=this.tcpMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Be.other,e)]):[3,2]):[2];case 1:n=o.sent()||0,this.cloudControllerMsgs=this.cloudControllerMsgs.filter((function(t){return t.sentTime>n})),this.cloudControllerLock=!0,this._ccMsgHandler(),o.label=2;case 2:return[2]}}))}))},u.prototype._fixRecallContentInfo=function(t){var e=t.conversationType,n=t.targetId;return t.senderUserId===this.tcpMgr.getCurrentUserId()&&(e=t.content.conversationType||e,n=t.content.targetId||n),{conversationType:e,targetId:n}},u.prototype._sendMessageExpansion=function(t){var e=t.channelId,n=void 0===e?"":e,o=t.content,r=t.conversationType,i=t.targetId,s=o,a=s.put,_=s.del,c=s.mid,u={};a&&(u.updatedExpansion={channelId:n,messageUId:c,expansion:a,conversationType:r,targetId:i}),_&&(u.deletedExpansion={channelId:n,messageUId:c,deletedKeys:_,conversationType:r,targetId:i}),this._dispatchEvent("expansion",u)},u.prototype._sendMessageNotification=function(t){this._dispatchEvent("batchMessage",t)},u.prototype._sendPullOfflineFinished=function(){this._dispatchEvent("pullFinished",null)},u.prototype._sendMessageDelivered=function(t){this._dispatchEvent("messageDelivered",t)},u.prototype._sendGroupMessageDeliveredStatus=function(t){this._dispatchEvent("groupMessageDeliveredStatus",t)},u.prototype._sendChatroomStatus=function(t){this._dispatchEvent("chatroom",t)},u.prototype._sendMessageReadReceipt=function(t){this._dispatchEvent("messageReadReceipt",t)},u.prototype._sendsyncReadStatus=function(t){this._dispatchEvent("syncReadStatus",t)},u.prototype._setConversationStatusListener=function(){var t=this;In.setConversationStatusListener((function(e){var n=JSON.parse(e).list,o=[];n.forEach((function(t){var e=JSON.parse(t.obj),n=e.conversationType,r=e.targetId,i=e.status,s=e.channelId,a={notificationStatus:2,isTop:!1};i.forEach((function(t){var e=JSON.parse(t.item);1===e.type?a.notificationStatus=1===Number(e.value)?Gt.OPEN:Gt.CLOSE:a.isTop=1===Number(e.value)})),o.push({channelId:s,conversationType:n,targetId:r,updatedItems:{notificationStatus:{val:a.notificationStatus,time:0},isTop:{val:a.isTop,time:0}}})})),t._dispatchEvent("conversation",o)}),(function(e){t._dispatchEvent("conversationTag",e)}),(function(e,n,o,r){t._callCppProxy("clearUnreadCountByTimestamp",e,n,r,o||""),t._sendsyncReadStatus({conversationType:e,targetId:n,channelId:o,timestamp:r})}))},u.prototype._setPushNotificationListener=function(){var t=this;In.setPushNotificationListener((function(){}),(function(e){t._dispatchEvent("tag",e),t._getRTCProfile()}))},u.prototype._getRTCProfile=function(){var t=this._callCppProxy("getRTCProfile");if(t){var e=this.tcpMgr.getToken();this.navi.updateVoipCallInfo(e,t);var n=this.navi.getNaviInfoFromCache(e);this._dispatchEvent("onNaviDataChange",n)}},u.prototype._setRTCLivingRoomEventListener=function(){var t=this;In.setRTCRoomEventListener((function(e){t._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(e))}))},u.prototype._setChatroomEventListener=function(){var t=this;In.setChatroomEventListener((function(e,n){t._sendChatroomStatus({chatroomDestroyed:e})}))},u.prototype._setCallInfoListener=function(){var t=this;In.setCallInfoListener((function(e){var n=[];try{JSON.parse(e).list.forEach((function(t){Object.entries(t).forEach((function(t){var e=qt(t,2),o=e[0],r=e[1];n.push({key:o,value:r})}))}))}catch(e){t.logger.error(ze.P_PARSE_JSON_E,JSON.stringify({error:e}))}t._dispatchEvent("callInfo",JSON.stringify({list:n}))}))},u.prototype._setSubscribeEventListener=function(){var t=this;In.setSubscribeEventListener((function(){}),(function(e){t._dispatchEvent("syncSubscribedUserStatusFinished",e)}),(function(e){var n=t._buildSubscribeEventData(e).map((function(t){return{userId:t.userId,subscribeType:t.subscribeType,subscribeTime:t.subscribeTime,expiry:t.expiry,operationType:t.operationType}}));t._dispatchEvent("subscribedRelationChange",n)}),(function(e){var n=t._buildSubscribeEventData(e).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s=t.userProfile,a={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return[gt.ONLINE_STATUS,gt.FRIEND_ONLINE_STATUS].includes(n)?a.details=i:[gt.USER_PROFILE,gt.FRIEND_USER_PROFILE].includes(n)&&(a.userProfile=s),a}));t._dispatchEvent("subscribedUserStatusChange",n)}))},u.prototype._setUserProfileListener=function(){var t=this;In.setUserProfileListener((function(e){t._dispatchEvent("syncSubscribedUserStatusFinished",e)}),(function(e){t._dispatchEvent("ownUserProfileChanged",t._string2userProfileInfo(e))}))},u.prototype._onGroupOperationChanged=function(t,e,n,o,r){var i,s,a,_=[];try{s=JSON.parse(o),_=JSON.parse(r),a=JSON.parse(t);var c={groupId:s[0]?s[0].groupId:"",operatorInfo:this._convertGroupMemberInfoList([a])[0],operation:e,operationTime:n};0===e?(i=qt(this._convertGroupInfoList(s),1),c.groupInfo=i[0]):c.memberInfos=this._convertGroupMemberInfoList(_),this._dispatchEvent("groupOperation",c)}catch(e){this.logger.error(ze.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:o,membersJson:r,operatorInfo:t}))}},u.prototype._onGroupInfoChanged=function(t,e,n,o,r,i){try{var s=JSON.parse(n),a=this._convertUpdateGroupInfoList(JSON.parse(r))[0];switch(t){case Q.GROUP_INFO_CHANGE:this._dispatchEvent("groupInfoChanged",{operatorInfo:this._convertGroupMemberInfoList([s])[0],operationTime:i,groupInfo:a,changedGroupInfo:a,fullGroupInfo:o?this._convertUpdateGroupInfoList(JSON.parse(o))[0]:void 0});break;case Q.GROUP_REMARK_DELETE:case Q.GROUP_REMARK_SET:var _=t===Q.GROUP_REMARK_SET?Z.ADD:Z.REMOVE;this._dispatchEvent("groupRemarkChangedSync",{groupId:e,operationType:_,operationTime:i,groupRemark:(null==a?void 0:a.remark)||""})}}catch(t){this.logger.error(ze.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:r,operatorInfoJson:n}))}},u.prototype._onGroupMemberInfoChanged=function(t,e,n,o){try{var r=JSON.parse(e),i=JSON.parse(n),s={groupId:t,operatorInfo:this._convertGroupMemberInfoList([r])[0],memberInfo:this._convertGroupMemberInfoList([i])[0],operationTime:o};this._dispatchEvent("groupMemberInfoChanged",s)}catch(t){this.logger.error(ze.P_PARSE_JSON_E,JSON.stringify({error:t,operatorInfoJson:e,updateMemberInfoJson:n}))}},u.prototype._onGroupRequestChanged=function(t,e,n,o){try{var r=JSON.parse(n),i=r.groupId,s=r.joinUser,a=r.approverUser,_=r.inviterUser,c=r.type,u=r.status,E=r.direction,R=r.remark,l=Xt(Xt(Xt(Xt({groupId:i},s&&{joinMemberInfo:this._convertGroupMemberInfoList([s])[0]}),_&&_.userId&&{inviterInfo:this._convertGroupMemberInfoList([_])[0]}),a&&a.userId&&{operatorInfo:this._convertGroupMemberInfoList([a])[0]}),{status:u,direction:E,type:c,operationTime:o,reason:R});this._dispatchEvent("groupApplicationEvent",l)}catch(t){this.logger.error(ze.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfo:e,requestInfoJson:n}))}},u.prototype._onFavoriteMembersChanged=function(t,e,n,o){try{var r=JSON.parse(n),i=[];r&&Ce(r.list)&&(i=r.list.map((function(t){return t.value}))),this._dispatchEvent("groupFollowsChangedSync",{groupId:t,operationType:e,operationTime:o,userIds:i})}catch(t){this.logger.error(ze.P_PARSE_JSON_E,JSON.stringify({error:t,memberIds:n}))}},u.prototype._setEntrustGroupListener=function(){In.setEntrustGroupListener(this._onGroupOperationChanged.bind(this),this._onGroupInfoChanged.bind(this),this._onGroupMemberInfoChanged.bind(this),this._onGroupRequestChanged.bind(this),this._onFavoriteMembersChanged.bind(this))},u.prototype._onFriendApplicationStatusChanged=function(t,e,n,o,r,i){this._dispatchEvent("friendApplicationStatusChanged",{userId:t,applicationType:e,applicationStatus:n,directionType:o,operationTime:r,extra:null!=i?i:""})},u.prototype._onFriendAdd=function(t,e,n,o,r){this._dispatchEvent("friendAdd",{userId:e,name:n,portraitUri:o,directionType:t,operationTime:r})},u.prototype._onFriendDelete=function(t,e,n){this._dispatchEvent("friendDelete",{userIds:e,directionType:t,operationTime:n})},u.prototype._onFriendsClearedFromServer=function(t){this._dispatchEvent("friendCleared",t)},u.prototype._onFriendInfoChangedSync=function(t,e,n){try{var o=JSON.parse(n);this._dispatchEvent("friendInfoChangedSync",{userId:t,remark:e,extProfile:o.list})}catch(t){this.logger.error(ze.P_PARSE_JSON_E,JSON.stringify({error:t,profiles:n}))}},u.prototype._setFriendEventListener=function(){In.setFriendEventListener(this._onFriendApplicationStatusChanged.bind(this),this._onFriendAdd.bind(this),this._onFriendDelete.bind(this),this._onFriendsClearedFromServer.bind(this),this._onFriendInfoChangedSync.bind(this))},u.prototype.registerMessageType=function(t,e,n,o,r){var i=0;e&&(i|=1),n&&(i|=2),r&&(i=16),this._customMessageType[t]={isCounted:n,isPersited:e,isStatusMessage:r},this.logger.info(ze.P_REGTYP_O,JSON.stringify({type:t,opt:i,search:o})),this._callCppProxy("registerMessageType",t,i,o||[])},u.prototype.connect=function(t,e,n,o){return this.tcpMgr.connect(t,e,n,o)},u.prototype.reconnect=function(t,e,n){var o=ct.RC_SOCKET_DISCONNECTED;return this.tcpMgr.reconnect(t,e,n,o)},u.prototype.reportSDKInfo=function(t){var e=JSON.stringify(Xt(Xt({},t),{"electron-main":"5.18.0-alpha.2"}));this.logger.info(ze.P_REPORT_VER_O,e),this._callCppProxy("uploadSDKVersion",e,"")},u.prototype.disconnect=function(t){t=t||!0,this._chatroomCache.length=0,this.reporter.stop(),wn(null,this.logger),this.tcpMgr.disconnect(t)},u.prototype.logout=function(){this.disconnect()},u.prototype.setUserStatusListener=function(t,e){In.setOnReceiveStatusListener((function(t,n){e({userId:t,status:n})}));var n=t.userIds||[];n.length&&this.subscribeUserStatus(n)},u.prototype.subscribeUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("subscribeUserStatus",t,(function(){setTimeout((function(){n(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},u.prototype.setUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("setUserStatus",t,(function(){setTimeout((function(){n(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},u.prototype.getUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserStatus",t,(function(t){setTimeout((function(){n({code:ct.SUCCESS,data:{status:t}})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},u.prototype._handleDirectionalUserIdList=function(t,e){var n=t.messageType,o=t.content,r=t.directionalUserIdList,i=void 0===r?[]:r,s=e===ut.GROUP;if(n===dt.READ_RECEIPT_RESPONSE&&o.receiptMessageDic&&s)for(var a in o.receiptMessageDic)i.push(a);return n===dt.SYNC_READ_STATUS&&function(t){return[ut.GROUP,ut.DISCUSSION,ut.ULTRA_GROUP,ut.PUBLIC_SERVICE,ut.APP_PUBLIC_SERVICE].includes(t)}(e)&&(i=[this.getCurrentUserId()]),i},u.prototype._handleMessage2Callback=function(t,e){var n=this;if("RC:MsgExMsg"===t.messageType&&this._msgExpansionHandler.setLocalFromExtMsg(this.logger,t),t.messageType===dt.READ_RECEIPT_REQUEST)this._updateReadReceiptInfo(e.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});else if(t.messageType===dt.READ_RECEIPT_RESPONSE){var o=e.content.receiptMessageDic;if(!o)return;for(var r in o)o[r].forEach((function(t){n._updateReadReceiptInfo(t,{isReceiptRequestMessage:!0,hasRespond:!0})}))}},u.prototype.sendMessage=function(t,e,n,o,r){var i=this;void 0===r&&(r=this.logger.createTraceId());var s=n.messageType,a=n.content,_=n.expansion,c=n.pushConfig,u=n.pushContent,E=void 0===u?"":u,R=n.pushData,l=void 0===R?"":R,d=n.directionalUserIdList,p=void 0===d?[]:d,C=n.disableNotification,T=void 0!==C&&C,S=n.canIncludeExpansion,I=void 0!==S&&S,N=n.isVoipPush,h=void 0!==N&&N,f=n.channelId,O=void 0===f?"":f,A=n.messageId,g=void 0===A?0:A,v=n.disableUpdateLastMessage,P=void 0!==v&&v,L=c||{},m=L.iOSConfig,y=L.androidConfig,M=L.harmonyOSConfig,U=L.templateId,D=void 0===U?"":U,G=L.pushTitle,V=void 0===G?"":G,b=L.pushContent,F=void 0===b?E:b,w=L.pushData,x=void 0===w?l:w,H=L.disablePushTitle,B=void 0!==H&&H,k=L.forceShowDetailContent,J=void 0!==k&&k,W=Le(m,y,M);return new Promise((function(c){E=F,l=x;var u=(null==y?void 0:y.notificationId)||"";p=i._handleDirectionalUserIdList(n,t);var R={};for(var d in _)R[d]={v:""},R[d].v=_[d];var C=D;i.logger.info(ze.P_SEND_MSG_T,JSON.stringify({messageType:s,conversationType:t,targetId:e,channelId:O}),r);var S=i._callCppProxy("sendMessage",(function(t,e){var o=i._buildMessage(t,{isOffLineMessage:!1});if(i.logger.info(ze.P_SEND_MSG_R,JSON.stringify({code:e,messageUId:o.messageUId}),r),e===ct.SENSITIVE_REPLACE)return setTimeout((function(){c({code:e})}),0);[dt.READ_RECEIPT_REQUEST,dt.READ_RECEIPT_RESPONSE,dt.EXPANSION_NOTIFY].findIndex((function(t){return t===o.messageType}))>-1&&i._handleMessage2Callback(o,n),o.canIncludeExpansion&&i._msgExpansionHandler.setLocalFromReceiveMsg(i.logger,o),setTimeout((function(){c({code:ct.SUCCESS,data:o})}),0)}),(function(t,e){var n=i._buildMessage(t,{isOffLineMessage:!1});i.logger.warn(ze.P_SEND_MSG_R,JSON.stringify({code:e,messageId:n.messageId}),r),n.sentTime=Date.now()-In.getDeltaTime(),setTimeout((function(){c({code:e,data:n})}),0)}),t,e,s,JSON.stringify(a),p,T,B,J,E,l,u,V,W,C,I,JSON.stringify(R),h,O,g,P),N=JSON.parse(S);null==o||o(N.messageId)}))},u.prototype.recallMsg=function(t,e){var n;return jt(this,void 0,void 0,(function(){var o,r,i,s,a,_,c,u,E,R,l,d,p,C,T,S,I,N,h=this;return Qt(this,(function(f){return o=t.channelId||"",r=t.targetId,i=t.conversationType,s=e.user,a=e.pushContent,_=e.extra,c=e.pushConfig,u=e.disableNotification,E=e.isDelete,R=e.directionalUserIdList,l=e.disableUpdateLastMessage,d=e.isAdmin,p=e.messageUId,C=e.sentTime,T={conversationType:i,targetId:r,messageUId:p,sentTime:C,user:s,extra:_,channelId:o,isDelete:E||!1,isAdmin:d},s&&(T.user=s),_&&(T.extra=_),S={conversationType:i,targetId:r,senderUserId:this.tcpMgr.getCurrentUserId(),content:T,objectName:dt.RECALL,messageUid:p,direction:Mt.SEND,status:bt.UNREAD,sentTime:C,channelId:o},I=this._buildMessage(JSON.stringify(S),{isOffLineMessage:!1}),[2,(N=ao.create(this.logger,"recallMessage")).asyncInvoke((function(t){return jt(h,void 0,void 0,(function(){return Qt(this,(function(t){return $t(this,co,"m",uo).call(this,I),I.pushConfig=c,N.ok(I),[2]}))}))}),(function(t){return N.fail(t)}),dt.RECALL,JSON.stringify(T),u||!1,(null==c?void 0:c.disablePushTitle)||!1,(null==c?void 0:c.forceShowDetailContent)||!1,a||"",(null==c?void 0:c.pushData)||"",(null===(n=null==c?void 0:c.androidConfig)||void 0===n?void 0:n.notificationId)||"",(null==c?void 0:c.pushTitle)||"",Le(null==c?void 0:c.iOSConfig,null==c?void 0:c.androidConfig,null==c?void 0:c.harmonyOSConfig),(null==c?void 0:c.templateId)||"",o,R||[],p,null!=l&&l).result()]}))}))},u.prototype.getHistoryMessage=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){n=n||0;var c=0===r,u=o+1,E=a._callCppProxy("getHistoryMessages",t,e,n,u,s,c,i),R=JSON.parse(E).list,l=[];R.reverse();for(var d=0;d<R.length;d++){var p=a._buildMessage(R[d].obj);l[d]=p}_({code:ct.SUCCESS,data:{list:u===l.length?l.slice(1,u):l,hasMore:o<l.length}})}))},u.prototype.getMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){var _=0===r,c=n,u=0!==n,E=o+1;u&&(c+=_?1:-1,E++);for(var R=s._callCppProxy("getMessages",t,e,c,E,_,i),l=JSON.parse(R).list,d=[],p=0;p<l.length;p++){var C=s._buildMessage(l[p].obj);d[p]=C}var T=s._computeRepairInfo(d,_,n,c,E),S=T.isNeedRepair,I=void 0!==S&&S,N=T.repairTime,h=void 0===N?0:N;if(!I)return u&&(d.shift(),E--),d.reverse(),void a({code:ct.SUCCESS,data:{list:E===d.length?d.slice(1,E):d,hasMore:o<d.length}});s._processRepairHisMsg(t,e,n,o,r,i,h,a)}))},u.prototype._computeRepairInfo=function(t,e,n,o,r){var i=!1,s=0,a=this.getNaviInfoFromCache()||{},_=a.repairHisMsg,c=void 0===_?0:_,u=a.historyMsg;if(1!==c||!u)return{isNeedRepair:i,repairTime:s};var E=t.findIndex((function(t){return t.hasMore||0===Object.keys(t.content).length}));return e&&E>=0?(i=!0,s=t[E].hasMore?t[E].sentTime:t[E].sentTime+1):!e&&E>=1?(i=!0,s=t[E-1].sentTime):t.length<r||0===n?(i=!0,s=n):t.length>0&&t[0].sentTime!==n&&(i=!0,s=o),{isNeedRepair:i,repairTime:s}},u.prototype._processRepairHisMsg=function(t,e,n,o,r,i,s,a){var _=this,c=function(s){for(var c=0===r,u=o+1,E=_._callCppProxy("getMessages",t,e,n,u,c,i),R=JSON.parse(E).list,l=[],d=0;d<R.length;d++){var p=_._buildMessage(R[d].obj);l[d]=p}l.reverse(),a({code:s,data:{list:u<=l.length?l.slice(1,u):l,hasMore:o<l.length}})},u=o+10>100?100:o+10;this._callCppProxy("getRemoteHistoryMessages",t,e,s,u,(function(){return c(0)}),(function(t){c(t)}),r,!0,i,!1)},u.prototype.getContinuousMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){n=n||0;var _=0===r;s._callCppProxy("getContinuousMessages",t,e,n,o,(function(t,e,n){var o=JSON.parse(t).list,r=[];o.reverse();for(var i=0;i<o.length;i++){var _=s._buildMessage(o[i].obj);r[i]=_}setTimeout((function(){a({code:ct.SUCCESS,data:{list:r,timestamp:e,hasMore:n}})}))}),(function(t){setTimeout((function(){a({code:t})}),0)}),_,i)}))},u.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){n=n||0;s._callCppProxy("getRemoteHistoryMessages",t,e,n,o,(function(t,e){var n=JSON.parse(t).list,o=[];n.reverse();for(var r=0;r<n.length;r++){var i=s._buildMessage(n[r].obj);o[r]=i}setTimeout((function(){a({code:ct.SUCCESS,data:{list:o,hasMore:!!e}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}),r,!0,i,!0)}))},u.prototype.deleteRemoteMessage=function(t,e,n,o){var r=this;return new Promise((function(i){var s=JSON.stringify(n);r._callCppProxy("deleteRemoteHistoryMessages",t,e,s,!1,o,(function(){setTimeout((function(){i(ct.SUCCESS)}),0)}),i)}))},u.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("clearRemoteHistoryMessages",t,e,n,(function(){setTimeout((function(){i(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}),o)}))},u.prototype.clearMessages=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("clearMessages",t,e,n),r(ct.SUCCESS)}))},u.prototype.getConversationList=function(t,e,n,o,r){var i=this;return void 0===r&&(r=""),new Promise((function(t){for(var e=i._callCppProxy("getConversationList",[1,3,6,7],r),n=JSON.parse(e).list,o=[],s=0;s<n.length;s++)o.push(i._buildConversation(n[s].obj));t({code:ct.SUCCESS,data:o})}))},u.prototype.getConversation=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getConversation",t,e,n);if(i)r({code:ct.SUCCESS,data:o._buildConversation(i)});else{var s=o._callCppProxy("getHistoryMessages",t,e,0,1,"",!0,n),a=void 0;try{a=JSON.parse(s).list}catch(t){o.logger.error(ze.P_PARSE_JSON_MSGS_E,null==t?void 0:t.stack),a=[]}var _=null;a.length>0&&(_=o._buildMessage(a[0].obj));var c=o._callCppProxy("getConversationNotificationStatus",t,e,n),u=o._callCppProxy("getConversationTopStatus",t,e,n);r({code:ct.SUCCESS,data:{conversationType:t,targetId:e,channelId:n,unreadMessageCount:0,latestMessage:_,notificationStatus:c?Gt.OPEN:Gt.CLOSE,isTop:Boolean(u),lastUnreadTime:0}})}}))},u.prototype.removeConversation=function(t,e,n){var o=this._callCppProxy("removeConversation",t,e,n);return Promise.resolve(o?ct.SUCCESS:ct.CONVER_REMOVE_ERROR)},u.prototype.batchRemoveConversation=function(t){var e=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId}})),n=this._callCppProxy("removeConversationInBatches",JSON.stringify(e));return Promise.resolve(n?ct.SUCCESS:ct.CONVER_REMOVE_ERROR)},u.prototype.clearConversations=function(t,e){var n=this;return new Promise((function(o){var r=[];r=Ce(t)?t:[ut.PRIVATE,ut.GROUP,ut.SYSTEM,ut.PUBLIC_SERVICE],n._callCppProxy("clearConversations",r,e||""),o(ct.SUCCESS)}))},u.prototype.getAllConversationUnreadCount=function(t,e,n){var o=this._callCppProxy("getTotalUnreadCount",e,n,t);return Promise.resolve({code:ct.SUCCESS,data:o})},u.prototype.getConversationUnreadCount=function(t,e,n){var o=this;return void 0===n&&(n=""),new Promise((function(r){var i=o._callCppProxy("getUnreadCount",t,e,n);r({code:ct.SUCCESS,data:i})}))},u.prototype.clearConversationUnreadCount=function(t,e,n){var o=this;return void 0===n&&(n=""),new Promise((function(r){o._callCppProxy("clearUnreadCount",t,e,n),r(ct.SUCCESS)}))},u.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("clearUnreadCountByTimestamp",t,e,n,o),i(ct.SUCCESS)}))},u.prototype.getFirstUnreadMessage=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getTheFirstUnreadMessage",t,e,n),s=o._buildMessage(i);r({code:ct.SUCCESS,data:-1!==s.messageId?s:null})}))},u.prototype.getFirstUnreadMessageInfo=function(t,e,n){var o=this;return new Promise((function(r,i){var s=o._callCppProxy("getTheFirstUnreadMessage",t,e,n),a=o._buildMessage(s);r({code:ct.SUCCESS,data:-1!==a.messageId?{messageUId:a.messageUId,sentTime:a.sentTime}:null})}))},u.prototype.batchSetConversationToTop=function(t,e,n){var o=this;return new Promise((function(r,i){var s=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId,is_top:e}}));o._callCppProxy("setIsTopInBatches",JSON.stringify(s),n||!1),r(ct.SUCCESS)}))},u.prototype.setConversationStatus=function(t,e,n,o,r,i){var s=this;return new Promise((function(i){s._callCppProxy("setConversationStatus",t,e,n,o,(function(){setTimeout((function(){i(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}),r,!0)}))},u.prototype.setConversationToTop=function(t,e,n,o,r){var i=this;return new Promise((function(r){r(i._callCppProxy("setConversationToTop",t,e,n,o,!0,!0)?ct.SUCCESS:ct.RC_MSG_DATA_INCOMPLETE)}))},u.prototype.getConversationNotificationStatus=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getConversationNotificationStatus",t,e,n);r({code:ct.SUCCESS,data:i?Gt.OPEN:Gt.CLOSE})}))},u.prototype.setConversationTypeNotificationLevel=function(t,e){var n=this;return new Promise((function(o,r){n._callCppProxy("setBlockPushLevelForType",t,e,(function(){o({code:ct.SUCCESS})}),(function(t){o({code:t})}))}))},u.prototype.getConversationTypeNotificationLevel=function(t){var e=this;return new Promise((function(n,o){var r=e._callCppProxy("getBlockPushLevelForType",t);n({code:ct.SUCCESS,data:r})}))},u.prototype.searchConversationByContent=function(t,e,n,o){var r=this;return new Promise((function(i){o=o||[1,3,6,7];for(var s=r._callCppProxy("searchConversationByContent",o,t,e,n),a=JSON.parse(s).list,_=[],c=0;c<a.length;c++)_[c]=r._buildConversation(a[c].obj);i({code:ct.SUCCESS,data:_})}))},u.prototype.searchConversationByContentWithAllChannel=function(t,e,n){var o=this;return new Promise((function(r){n=n||[1,3,6,7];for(var i=o._callCppProxy("searchConversationByContentWithAllChannel",n,t,e),s=JSON.parse(i).list,a=[],_=0;_<s.length;_++)a[_]=o._buildConversation(s[_].obj);r({code:ct.SUCCESS,data:a})}))},u.prototype.searchMessageByContent=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(i){a._callCppProxy("searchMessageByContent",t,e,n,o,r,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=a._buildMessage(n[r].obj);setTimeout((function(){i({code:ct.SUCCESS,data:{messages:o,count:e}})}),0)}),s)}))},u.prototype.searchMessageByContentAndMessageType=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){a._callCppProxy("searchMessageByContentAndObjectName",e,t,s||"",void 0===s,n,i,r,o,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=a._buildMessage(n[r].obj);setTimeout((function(){_({code:ct.SUCCESS,data:{messages:o,count:e}})}),0)}))}))},u.prototype.searchMessagesByUser=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){s._callCppProxy("getMessageBySender",t,e,n,o,r,i,(function(t){for(var e=t?JSON.parse(t).list:[],n=[],o=0;o<e.length;o++)n[o]=s._buildMessage(e[o].obj);setTimeout((function(){a({code:ct.SUCCESS,data:{messages:n}})}),0)}))}))},u.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){var i=this;return new Promise((function(s){i._callCppProxy("searchMessageByContentWithAllChannel",t,e,n,o,r,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=i._buildMessage(n[r].obj);setTimeout((function(){s({code:ct.SUCCESS,data:{messages:o,count:e}})}),0)}))}))},u.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){a._callCppProxy("searchMessageByTimestampWithAllChannel",t,e,n,o,r,i,s,(function(t){for(var e=t?JSON.parse(t).list:[],n=[],o=0;o<e.length;o++)n[o]=a._buildMessage(e[o].obj);setTimeout((function(){_({code:ct.SUCCESS,data:{messages:n}})}),0)}))}))},u.prototype.getUnreadMentionedMessages=function(t,e,n){for(var o=JSON.parse(this._callCppProxy("getUnreadMentionedMessages",t,e,n)).list,r=0;r<o.length;r++)o[r]=this._buildMessage(o[r].obj);return o},u.prototype.addToBlacklist=function(t){var e=this;return new Promise((function(n){e._callCppProxy("addToBlacklist",t,(function(){setTimeout((function(){n(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},u.prototype.removeFromBlacklist=function(t){var e=this;return new Promise((function(n){e._callCppProxy("removeFromBlacklist",t,(function(){setTimeout((function(){n(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},u.prototype.getBlacklist=function(){var t=this;return new Promise((function(e){t._callCppProxy("getBlacklist",(function(t){setTimeout((function(){e({code:ct.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){e({code:t})}),0)}))}))},u.prototype.getBlacklistStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getBlacklistStatus",t,(function(t){setTimeout((function(){n({code:ct.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},u.prototype.insertMessage=function(t,e,n){var o=this,r=n.content,i=n.senderUserId,s=n.messageType,a=n.messageDirection,_=n.readStatus,c=n.sentStatus,u=n.sentTime,E=n.searchContent,R=n.isUnread,l=n.messageUId,d=n.disableNotification,p=n.canIncludeExpansion,C=n.expansionMsg,T=n.channelId,S=n.directedUserIds,I=n.disableUpdateLastMessage;r=JSON.stringify(r);var N={};if(u=u||0,C){var h=JSON.parse(C);for(var f in h)N[f]={v:"",ts:0},N[f].v=h[f],N[f].ts=u}return new Promise((function(n){var C=R?0:1,h=o._callCppProxy("insertMessage",t,e,i,s,r,(function(){}),(function(t){setTimeout((function(){n({code:t})}),0)}),a,_||0,c||10,u,E||"",C,l||"",!!d,!!p,JSON.stringify(N),T||"",S||[],I||!1),f=o._buildMessage(h,{isOffLineMessage:!1});f.messageUId=l,f.sentTime=u,n({code:-1===f.messageId?ct.MSG_INSERT_ERROR:ct.SUCCESS,data:f})}))},u.prototype.batchInsertMessage=function(t,e){var n=this;return void 0===e&&(e=!1),new Promise((function(o){var r=t.map((function(t){var e=t.content,n=t.senderUserId,o=t.messageType,r=t.messageDirection,i=t.receivedStatus,s=void 0===i?0:i,a=t.sentStatus,_=t.sentTime,c=t.searchContent,u=t.isUnread,E=t.messageUId,R=t.disableNotification,l=t.canIncludeExpansion,d=t.expansion,p=t.channelId,C=t.conversationType,T=t.targetId,S=t.source,I=t.isMentioned,N=t.receivedStatusInfo,h=t.directedUserIds,f=t.disableUpdateLastMessage,O=s;N&&(O=function(t){var e=bt.UNREAD;return(null==t?void 0:t.isRead)&&(e|=bt.READ),(null==t?void 0:t.isListened)&&(e|=bt.LISTENED),(null==t?void 0:t.isDownload)&&(e|=bt.DOWNLOADED),(null==t?void 0:t.isRetrieved)&&(e|=bt.RETRIEVED),e}(N));var A={};if(_=_||0,d)for(var g in d)A[g]={v:"",ts:0},A[g].v=d[g],A[g].ts=_;return{conversationType:C,targetId:T,channelId:p||"",direction:r,senderUserId:n,status:a||10,sentTime:_,objectName:o,content:JSON.stringify(e),messageUid:E||"",noNotification:!!R,supportExt:!!l,extMsg:JSON.stringify(A),readStatus:O,searchContent:c||"",isUnread:!!u,source:S||"",isMention:I,directedUsers:h,disableUpdateLastMessage:f||!1}})),i=n._callCppProxy("insertMessages",JSON.stringify(r),e);o({code:i?ct.SUCCESS:ct.MSG_INSERT_ERROR,data:i||!1})}))},u.prototype.getMessageCount=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getMessageCount",t,e,n);r({code:ct.SUCCESS,data:i})}))},u.prototype.deleteMessages=function(t){var e=this;return new Promise((function(n){e._callCppProxy("deleteMessages",t),n(ct.SUCCESS)}))},u.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){var i=this;return new Promise((function(s){i._callCppProxy("deleteMessagesByTimestamp",t,e,n,o,r),s(ct.SUCCESS)}))},u.prototype.batchClearMessagesByTimestamp=function(t){var e=this;return new Promise((function(n,o){var r=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId||"",send_time:t.timestamp}}));e._callCppProxy("deleteMessageBySendTimeInBatches",JSON.stringify(r)),n(ct.SUCCESS)}))},u.prototype.batchClearRemoteHistoryMessages=function(t,e){var n=this;return new Promise((function(o,r){var i=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId||"",send_time:t.timestamp}}));n._callCppProxy("deleteRemoteMessageBySendTimeInBatches",JSON.stringify(i),e||!1,(function(){setTimeout((function(){o(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},u.prototype.getMessage=function(t){return jt(this,void 0,void 0,(function(){var e,n;return Qt(this,(function(o){return e=function(t,e,n){for(var o=[],r=3;r<arguments.length;r++)o[r-3]=arguments[r];var i,s=t.createTraceId();t.debug(ze.P_CALL_ADDON_T,JSON.stringify({method:n,params:o}),s);try{i=In[n].apply(In,zt([],qt(o),!1))}catch(e){throw t.error(ze.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:n}),s),e}return t.debug(ze.P_CALL_ADDON_R,JSON.stringify({method:n,params:o,result:e?i:void 0}),s),i}(this.logger,!0,"getMessage",t),(n=this._buildMessage(e,{isOffLineMessage:!1})).messageId<=0?[2,le(ct.RC_DB_DATA_NOT_FOUND,"msg not found: ".concat(t))]:[2,Re(n)]}))}))},u.prototype.setMessageContent=function(t,e,n){var o=this;return new Promise((function(r){e=JSON.stringify(e),o._callCppProxy("setMessageContent",t,e,n),r(ct.SUCCESS)}))},u.prototype.setMessageSearchField=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("setMessageSearchField",t,e,n),r(ct.SUCCESS)}))},u.prototype.setMessageSentStatus=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setMessageSentStatus",t,e),o(ct.SUCCESS)}))},u.prototype.setMessageReceivedStatus=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setMessageReceivedStatus",t,e),o(ct.SUCCESS)}))},u.prototype.saveConversationMessageDraft=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("saveTextMessageDraft",t,e,n,o||"")&&i(ct.SUCCESS),i(ct.DRAFT_SAVE_ERROR)}))},u.prototype.getConversationMessageDraft=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getTextMessageDraft",t,e,n||"");r({code:ct.SUCCESS,data:i})}))},u.prototype.clearConversationMessageDraft=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("clearTextMessageDraft",t,e,n||"")&&r(ct.SUCCESS),r(ct.DRAFT_REMOVE_ERROR)}))},u.prototype.pullConversationStatus=function(t){throw new Error("Method not implemented.")},u.prototype.batchSetConversationStatus=function(t){var e=t[0],n=e.conversationType,o=e.targetId,r=e.isTop,i=e.notificationStatus,s=e.channelId,a=e.isUpdateTime,_=void 0===a||a,c=this._callCppProxy("getConversationNotificationStatus",n,o,s||""),u=this._callCppProxy("getConversationTopStatus",n,o,s||""),E=Se(i)?Boolean(c):i===Gt.OPEN,R=Se(r)?Boolean(u):r;return this.setConversationStatus(n,o,E,R,s,_)},u.prototype.getConversationNotificationLevel=function(t,e,n){return jt(this,void 0,void 0,(function(){var o;return Qt(this,(function(r){return o=this._callCppProxy("getBlockPushLevelForConversation",e,n,t),[2,Promise.resolve({code:ct.SUCCESS,data:o})]}))}))},u.prototype.setConversationNotificationLevel=function(t,e,n,o){var r=this;return void 0===o&&(o=""),new Promise((function(i){r._callCppProxy("setBlockPushLevelForConversation",e,o,t,n,(function(){setTimeout((function(){i(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}))}))},u.prototype.batchSetConversationNotificationLevel=function(t,e){var n=this;return new Promise((function(o,r){var i=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId,level:e}}));n._callCppProxy("setBlockPushLevelInBatches",JSON.stringify(i),(function(){setTimeout((function(){o(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},u.prototype.getTotalUnreadCountByLevels=function(t,e,n){if(n){var o=this._callCppProxy("getUnreadMentionedCountByLevel",t,e);return Promise.resolve({code:ct.SUCCESS,data:o})}var r=this._callCppProxy("getUnreadCountByLevel",t,e);return Promise.resolve({code:ct.SUCCESS,data:r})},u.prototype.sendReadReceiptMessage=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("sendReadReceipt",t,n||"",e,(function(){e.forEach((function(t){o._updateReadReceiptInfo(t,{hasRespond:!0});try{var e=JSON.parse(o._callCppProxy("getMessage",t)).messageId;o.setMessageReceivedStatus(e,1)}catch(e){o.logger.error(ze.P_PARSE_JSON_MSGS_E,JSON.stringify({messageUId:t,error:null==e?void 0:e.stack}))}})),setTimeout((function(){r({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},u.prototype.getMessageReader=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getMessageReader",t,n,e,(function(t,n){var i=[],s={};(t=JSON.parse(t)).list.forEach((function(t){var e=JSON.parse(t.obj),n=e.id,o=e.time;i.push({userId:n,readTime:o}),s[n]=o}));var a={readerInfo:s,readCount:i.length,totalCount:n};o._updateReadReceiptInfo(e,a),setTimeout((function(){r({code:ct.SUCCESS,data:{list:i,totalMemberCount:n}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},u.prototype.sendReadReceiptMessageV4=function(t,e,n){var o=this;return new Promise((function(r){var i=t.conversationType,s=t.targetId,a=t.channelId;o._callCppProxy("sendMessageReadReceipt",i,s,a||"",e,n,(function(){setTimeout((function(){r({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},u.prototype.getMessageReadReceiptV4=function(t,e){var n=this;return new Promise((function(o){var r=t.targetId,i=t.channelId;n._callCppProxy("getMessageReadReceipt",r,i||"",e,(function(t,r,i){var s=[],a=n._callCppProxy("getMessage",e),_=JSON.parse(a);try{JSON.parse(i).list.forEach((function(t){var e=JSON.parse(t.obj),n=e.id,o=e.time;s.push({userId:n,readTime:o})}))}catch(t){n.logger.error(ze.P_PARSE_JSON_E,"method: getMessageReadReceipt, info: ".concat(i,", error: ").concat(t))}var c=JSON.parse(_.readReceiptRequest||"{}"),u=c.readerList,E=void 0===u?[]:u,R=c.readCount,l=void 0===R?0:R,d=!1;E.length<s.length&&(E=s,d=!0),l<r&&(l=r,d=!0),d&&n._callCppProxy("updateReadReceiptRequestInfo",e,JSON.stringify({readerList:E,readCount:l,totalCount:t})),setTimeout((function(){o({code:ct.SUCCESS,data:{list:s,totalCount:t,readCount:l}})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},u.prototype.updateConversationReadTime=function(t,e){var n=this;return new Promise((function(o){var r=t.conversationType,i=t.targetId,s=t.channelId;n._callCppProxy("updateConversationReadTime",r,i,s||"",e,(function(){setTimeout((function(){o({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},u.prototype._addChatroomCache=function(t,e,n,o){this._rmChatroomCache(t),this._chatroomCache.push({chatroomId:t,joinExist:n,count:e,extra:o})},u.prototype._rmChatroomCache=function(t){this._chatroomCache=this._chatroomCache.filter((function(e){return e.chatroomId!==t}))},u.prototype._try2RejoinChatroom=function(){var t=this;if(0!==this._chatroomCache.length){var e=this.logger.createTraceId();this._chatroomCache.forEach((function(n){return jt(t,void 0,void 0,(function(){var t,o,r,i,s,a,_;return Qt(this,(function(c){switch(c.label){case 0:return t=n.chatroomId,o=n.joinExist,r=n.count,i=n.extra,this.logger.info(G.L_REJOIN_CHATROOM_T,t,e),[4,this._joinChrm(t,r,o,!1,i)];case 1:return s=c.sent(),a=s.code,_=s.data,a===ct.SUCCESS?(this.logger.info(G.L_REJOIN_CHATROOM_R,t,e),this._sendChatroomStatus({rejoinedRoom:Xt({chatroomId:t,count:r},_)}),[2]):(a===ct.RC_CHATROOM_USER_KICKED&&this._rmChatroomCache(t),this._sendChatroomStatus({rejoinedRoom:{chatroomId:t,errorCode:a}}),this.logger.warn(G.L_REJOIN_CHATROOM_R,"chrmId: ".concat(t,", code: ").concat(a),e),[2])}}))}))}))}},u.prototype._joinChrm=function(t,e,n,o,r){var i=this,s=n?"joinExistChatRoom":"joinChatRoom";return new Promise((function(a){o&&i._callCppProxy("clearMessages",ut.CHATROOM,t,""),i._callCppProxy(s,t,e,(function(o,s,_,c,u,E,R){i._addChatroomCache(t,e,n,r||""),setTimeout((function(){a({code:ct.SUCCESS,data:{createTime:Number(o),memberCount:s,isAllChatroomBanned:_,isCurrentUserBanned:c,isCurrentChatroomBanned:u,isCurrentChatroomInWhitelist:E,joinTime:R}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}),r||"")}))},u.prototype.joinChatroom=function(t,e,n){return jt(this,void 0,void 0,(function(){return Qt(this,(function(o){switch(o.label){case 0:return[4,this._joinChrm(t,e,!1,!0,n)];case 1:return[2,o.sent().code]}}))}))},u.prototype.joinExistChatroom=function(t,e,n){return this._joinChrm(t,e,!0,!0,n)},u.prototype.quitChatroom=function(t){var e=this;return this._rmChatroomCache(t),new Promise((function(n){e._callCppProxy("quitChatRoom",t,(function(){setTimeout((function(){n(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},u.prototype.getChatroomInfo=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getChatroomInfo",t,e,n,(function(t,e){var n=t?JSON.parse(t).list:[],o=[];if(n.length>0)for(var i=0;i<n.length;i++)o.push(JSON.parse(n[i].obj));setTimeout((function(){r({code:ct.SUCCESS,data:{userInfos:o,userCount:e}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},u.prototype.getChatroomHistoryMessages=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("getChatroomHistoryMessage",t,e,n,o,(function(t){var e;try{e=JSON.parse(t)}catch(t){e={list:[],hasMore:!1}}var n=e.list;if(n&&n.length)try{e.list=n.map((function(t){return r._buildMessage(t.obj)}))}catch(t){e.list=[]}setTimeout((function(){i({code:ct.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){i({code:t})}),0)}),"")}))},u.prototype.setChatroomEntry=function(t,e){var n=this;return new Promise((function(o){var r='[{"key":"'.concat(e.key,'", "value":"').concat(e.value,'"}]');n._callCppProxy("setChatroomKV",t,r,!!e.isAutoDelete,!!e.isOverwrite,(function(){setTimeout((function(){o(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},u.prototype.setChatroomEntries=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setChatroomKV",t,JSON.stringify(e.entries),!!e.isAutoDelete,!!e.isOverwrite,(function(){o({code:ct.SUCCESS})}),(function(t){o({code:t})}))}))},u.prototype.forceSetChatroomEntry=function(t,e){return e.isOverwrite=!0,e.userId=e.userId||this.tcpMgr.getCurrentUserId(),this.setChatroomEntry(t,e)},u.prototype.removeChatroomEntry=function(t,e){var n=this,o=[e.key];return new Promise((function(r){n._callCppProxy("deleteChatroomKV",t,o,!!e.isOverwrite,(function(){r(ct.SUCCESS)}),(function(t){r(t)}))}))},u.prototype.forceRemoveChatroomEntry=function(t,e){return e.isOverwrite=!0,e.userId=e.userId||this.tcpMgr.getCurrentUserId(),this.removeChatroomEntry(t,e)},u.prototype.removeChatroomEntries=function(t,e){var n=this;return new Promise((function(o){var r=e.entries.map((function(t){return t.key}));n._callCppProxy("deleteChatroomKV",t,r,!!e.isOverwrite,(function(){o({code:ct.SUCCESS})}),(function(t){o({code:t})}))}))},u.prototype.getChatroomEntry=function(t,e){return jt(this,void 0,void 0,(function(){var n,o,r;return Qt(this,(function(i){switch(i.label){case 0:return[4,this.getAllChatroomEntry(t)];case 1:return n=i.sent(),o=n.code,r=n.data,o!==ct.SUCCESS?[2,{code:o}]:r&&r[e]?[2,{code:o,data:r[e]}]:[2,{code:ct.CHATROOM_KEY_NOT_EXIST}]}}))}))},u.prototype.getAllChatroomEntry=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getChatroomKV",t,(function(t){var e={};try{(t?JSON.parse(t):{list:[]}).list.map((function(t){return JSON.parse(t.obj)})).forEach((function(t){e[t.key]=t.value?t.value:""}))}catch(t){}setTimeout((function(){n({code:ct.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},u.prototype.removeChatroomFromCatch=function(t){this._rmChatroomCache(t)},u.prototype.getFileToken=function(t,e,n,o,r,i){var s=this;return n=n||"",o=o||"",r=r||"",new Promise((function(a){var _;_=o&&"uploads"!==o?e||"":Pe(t,e);var c=s.getNaviInfoFromCache(),u={uploadDomain:Ge(c,s.logger),env:s._environment};i=i?Math.ceil(i):0,s._callCppProxy("getUploadToken",t,_,n,o,r,JSON.stringify(u),i,c.ipType||0,(function(t,e,n,o,r,i,s,c,u,E,R,l,d,p,C,T,S,I,N,h,f,O,A,g){setTimeout((function(){a({code:ct.SUCCESS,data:{token:t,deadline:0,bosToken:e,bosDate:n,path:o,osskeyId:r,ossPolicy:i,ossSign:s,ossBucketName:c,fileName:_,s3Credential:u,s3Algorithm:E,s3Date:R,s3Policy:l,s3Signature:d,s3BucketName:p,stcAuthorization:C,stcContentSha256:T,stcDate:S,stcBucketName:I,minioAuthorization:N,minioContentSha256:h,minioDate:f,minioBucketName:O,downloadAuthInfo:A?JSON.parse(A):null}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}))}))},u.prototype.getFileUrl=function(t,e,n,o){var r=this;return new Promise((function(i){var s=r.getNaviInfoFromCache(),a={url:Ge(s,r.logger)};r._callCppProxy("getDownloadUrl",t,n,o,e-1,JSON.stringify(a),-1,s.ipType||0,(function(t){setTimeout((function(){i({code:ct.SUCCESS,data:{downloadUrl:t}})}),0)}),(function(t){setTimeout((function(){i({code:t})}),0)}))}))},u.prototype.clearData=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("clearData");e({code:ct.SUCCESS,data:n})}))},u.prototype.getDeviceId=function(){return this._deviceId},u.prototype.getVoIPKey=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("getVoIPKey",t,e,"",(function(t){setTimeout((function(){o({code:ct.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},u.prototype.bindRTCRoomForChatroom=function(t){var e=this;return new Promise((function(n){var o=t.chatRoomId,r=t.rtcRoomId;e._callCppProxy("bindRTCRoomForChatroom",o,r,(function(){setTimeout((function(){n(ct.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},u.prototype.getGroupMessageDeliverList=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getGroupMessageDeliverList",t,n,e,(function(t,e){var n=JSON.parse(t).list.map((function(t){return{time:JSON.parse(t.obj).time,userId:JSON.parse(t.obj).id}}));setTimeout((function(){r({code:ct.SUCCESS,data:{totalCount:e,list:n}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},u.prototype.getPrivateMessageDeliverTime=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("getMessageDeliverTime",t);if(r)o({code:ct.SUCCESS,data:r});else{n._callCppProxy("getPrivateMessageDeliverList",e,t,(function(t){var e=0,n=JSON.parse(t).list;if(n.length>0){var r=JSON.parse(n[0].obj).time;e=r}setTimeout((function(){o({code:ct.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}}))},u.prototype.rtcSignaling=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("rtcSignaling",t,e,n,o,(function(t){var e=Array.prototype.slice.call(t);i({code:ct.SUCCESS,buffer:e})}),(function(t){i({code:t})}),30)}))},u.prototype._setRTCHeartbeatListener=function(){var t=this;In.setRTCHeartbeatListener((function(e,n){var o=t.rtcHeartbeatResolves[e];if(o){var r=o.find((function(t){return""===t.seqId}));r&&(r.seqId=n)}}),(function(e,n,o,r){var i=t.rtcHeartbeatResolves[e];if(i){var s=i.findIndex((function(t){return t.seqId===o}));-1!==s&&i.splice(s,1)[0].resolve({code:n,data:{version:Number(r)}})}}))},u.prototype.rtcPing=function(t,e,n){var o=this;return new Promise((function(e){var n={resolve:e,seqId:""},r=o.rtcHeartbeatResolves[t];r?r.push(n):o.rtcHeartbeatResolves[t]=[n],o._callCppProxy("sendRTCHeartbeat",[t],30)}))},u.prototype.createTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("addTag",t.tagId,t.tagName,(function(){setTimeout((function(){n({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},u.prototype.removeTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("deleteTag",t,(function(){setTimeout((function(){n({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},u.prototype.updateTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("renameTag",t.tagId,t.tagName,(function(){setTimeout((function(){n({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},u.prototype.getTagList=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getTags"),o=t._convertResultList(n,(function(t){return{tagId:t.tagId,tagName:t.tagName,conversationCount:t.conversationCount,createdTime:t.tagTime}}));e({code:ct.SUCCESS,data:o})}))},u.prototype.addTagForConversations=function(t,e){var n=this;return new Promise((function(o){e.forEach((function(t){t.conversationType&&(t.type=t.conversationType)}));n._callCppProxy("addConversationsForTag",t,JSON.stringify(e),(function(){setTimeout((function(){o({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},u.prototype.removeTagForConversations=function(t,e){var n=this;return new Promise((function(o){e.forEach((function(t){t.conversationType&&(t.type=t.conversationType)})),n._callCppProxy("removeConversationsForTag",t,JSON.stringify(e),(function(){setTimeout((function(){o({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},u.prototype.removeTagsForConversation=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("removeTagsForConversation",t.conversationType,t.targetId,t.channelId||"",e,(function(){setTimeout((function(){o({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},u.prototype.getConversationListByTag=function(t,e,n,o){var r=this;return new Promise((function(i){var s=r._callCppProxy("getConversationsForTagByPage",t,e,n||20,o||""),a=r._convertResultList(s,(function(t){return Xt(Xt({},r._buildConversation(JSON.stringify(t))),{isTopInTag:t.topForTag})}));i({code:ct.SUCCESS,data:a})}))},u.prototype.getUnreadCountByTag=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("getConversationUnreadCountForTag",t,e);o({code:ct.SUCCESS,data:r})}))},u.prototype.setConversationStatusInTag=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("setConversationToTopForTag",t,e.conversationType,e.targetId,e.channelId||"",n.isTop||!1,(function(){setTimeout((function(){r({code:ct.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},u.prototype.getTagsForConversation=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getTagsForConversation",t.conversationType,t.targetId,t.channelId||""),r=e._convertResultList(o,(function(t){return{tagId:t.tagId,tagName:t.tagName,isTop:t.isTop,createdTime:t.tagTime}}));n({code:ct.SUCCESS,data:r})}))},u.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},u.prototype.getTopConversationList=function(t,e){var n=this;return new Promise((function(o){var r=Se(e)?n._callCppProxy("getTopConversations",t):n._callCppProxy("getTopConversations",t,e),i=JSON.parse(r).list.map((function(t){return n._buildConversation(t.obj)}));o({code:ct.SUCCESS,data:i})}))},u.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},u.prototype.getAllUnreadMentionedCount=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getUnreadAndMentionCount",[ut.GROUP],"");e({code:ct.SUCCESS,data:n})}))},u.prototype.getOSInfo=function(){return jt(this,void 0,void 0,(function(){var u;return Qt(this,(function(E){return u={arch:e(),platform:t(),type:o(),version:r(),release:i(),uptime:s(),cpus:a(),freemem:_(),totalmem:c(),networkInterfaces:n()},[2,{code:ct.SUCCESS,data:u}]}))}))},u.prototype.getMainProcessInfo=function(){return jt(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,{code:ct.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))},u.prototype.setCallInfo=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("callInfoSignaling",t,e,n,(function(t,e){setTimeout((function(){r({code:ct.SUCCESS,data:{key:t,value:e}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},u.prototype.setProxy=function(t){return this.tcpMgr.getConnectionStatus()!==Lt.DISCONNECTED?Promise.resolve({code:ct.RC_CONN_PROXY_UNAVAILABLE}):Promise.resolve(wn(t,this.logger))},u.prototype.getProxy=function(){return Promise.resolve(xn())},u.prototype.testProxy=function(t,e){return function(t,e,n){return new Promise((function(o){var r=/^https/.test(e)?Vn:Un;n.info(G.A_TEST_PROXY_O,JSON.stringify({msg:"test proxy",proxy:t,testHost:e}));var i=r(e,t,(function(t){var e=200===t.statusCode?0:t.statusCode;t.setEncoding("utf8");var n="";t.on("data",(function(t){n+=t})),t.once("end",(function(){o({status:e||0,data:n})}))}));i.once("timeout",(function(){return o({status:0})})),i.once("error",(function(t){return o({status:0,data:t.stack})})),i.end()}))}(t,e,this.logger)},u.prototype.checkDuplicateMessage=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("checkDuplicateMessage",t);n({code:ct.SUCCESS,data:o})}))},u.prototype.subscribeUser=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("updateSubscribeStatus",e,vt.SUBSCRIBE,t,(function(){r({code:ct.SUCCESS})}),(function(t,e){r({code:t,data:e})}),n)}))},u.prototype.unSubscribeUser=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("updateSubscribeStatus",e,vt.UNSUBSCRIBE,t,(function(){o({code:ct.SUCCESS})}),(function(t){o({code:t})}),0)}))},u.prototype.getSubscribeUserList=function(t,e,n){var o=this._callCppProxy("getSubscribeUserList",t,e,n),r=this._buildSubscribeEventData(o).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return n===gt.ONLINE_STATUS&&(s.details=fe(i)),s}));return Promise.resolve({code:ct.SUCCESS,data:r})},u.prototype.setDuplicateMessageConfig=function(t){var e=this._callCppProxy("setDuplicateMessageConfig",[ut.CHATROOM],Eo.cuid,t);return Promise.resolve({code:e})},u.prototype.getSubscribeUserStatus=function(t,e){var n=this._callCppProxy("getSubscribeStatusByUserIds",t,e),o=this._buildSubscribeEventData(n).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return n===gt.ONLINE_STATUS&&(s.details=fe(i)),s}));return Promise.resolve({code:ct.SUCCESS,data:o})},u.prototype.updateMyUserProfile=function(t){var e=[],n=[];Object.keys(t).forEach((function(o){var r;if("extraProfile"===o&&t.extraProfile){if(t.extraProfile){var i=t.extraProfile;Object.keys(i).forEach((function(t){n.push(JSON.stringify({key:t,value:i[t]||""}))}))}}else e.push(JSON.stringify({key:o,value:(null===(r=t[o])||void 0===r?void 0:r.toString())||""}))}));var o=ao.create(this.logger,"updateUserProfile");return o.invoke(e,n,(function(t,e){if(t===ct.SUCCESS)o.ok();else{var n=cn(e);o.fail(t,{errorKey:n[0],errorKeys:n})}})).result()},u.prototype.getUserProfiles=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserProfiles",t,(function(t,o){n({code:t,data:e._string2UserProfileInfoList(o)})}))}))},u.prototype.getMyUserProfile=function(){var t=this;return new Promise((function(e){t._callCppProxy("getOwnUserProfile",(function(n,o){e({code:n,data:t._string2userProfileInfo(o)})}))}))},u.prototype._string2userProfileInfo=function(t){var e;try{var n=JSON.parse(t),o=n.userProfile.reduce((function(t,e){var n=JSON.parse(e);return["gender","role","level"].includes(n.key)?t[n.key]=Number(n.value):t[n.key]=n.value,t}),{});return o.userId=n.userId,o.extraProfile=(null===(e=n.userExtProfile)||void 0===e?void 0:e.reduce((function(t,e){var n=JSON.parse(e);return t[n.key]=n.value,t}),{}))||{},o}catch(e){this.logger.error(ze.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==e?void 0:e.stack,str:t}))}return{}},u.prototype._string2UserProfileInfoList=function(t){var e=this;try{return JSON.parse(t).list.map((function(t){return e._string2userProfileInfo(t.obj)}))}catch(e){this.logger.error(ze.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==e?void 0:e.stack,str:t}))}return[]},u.prototype.updateMyUserProfileVisibility=function(t){var e=this;return new Promise((function(n){e._callCppProxy("updateUserProfilePermission",t,(function(){n({code:ct.SUCCESS})}),(function(t){n({code:t})}))}))},u.prototype.getMyUserProfileVisibility=function(){var t=this;return new Promise((function(e){t._callCppProxy("getUserProfilePermission",(function(t,n){e({code:t,data:n})}))}))},u.prototype.searchUserProfileByUniqueId=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserProfileByUniqueId",t,(function(t,o){n({code:t,data:e._string2userProfileInfo(o)})}))}))},u.prototype.getMatchedMessage=function(t,e,n,o){var r,i=this._callCppProxy("getMatchedMessage",t.conversationType,t.targetId,e,n,o,t.channelId||""),s=[];try{r=JSON.parse(i).list;for(var a=0;a<r.length;a++){var _=this._buildMessage(r[a].obj);s.push(_)}}catch(t){return this.logger.error(ze.P_PARSE_JSON_MSGS_E,i),Promise.resolve({code:ct.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ct.SUCCESS,data:s})},u.prototype.getConversations=function(t){var e,n=this,o=t.map((function(t){var e=t.conversationType,n=t.targetId,o=t.channelId;return{targetId:n,channelId:void 0===o?"":o,type:e}})),r=this._callCppProxy("getConversations",JSON.stringify(o));try{e=JSON.parse(r).list.map((function(t){return n._buildConversation(t.obj)}))}catch(t){return this.logger.error(ze.P_PARSE_JSON_MSGS_E,r),Promise.resolve({code:ct.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ct.SUCCESS,data:e})},u.prototype.handleErrorCode=function(t,e){t!==ct.SUCCESS&&setTimeout((function(){return e(le(t))}),0)},u.prototype._convertGroupInfoList=function(t,e){return t&&0!==t.length?t.map((function(t){var e=t.groupId,n=t.baseInfo,o=t.createTime,r=t.createUserId,i=t.extraInfo,s=t.memberCount,a=t.ownerId,_=t.remark,c=t.joinTime,u=t.role,E=ve(n),R=ve(i);return{groupId:e,groupName:E.name||"",portraitUri:E.portraitUrl||"",introduction:E.introduction||"",notice:E.announcement||"",joinPermission:~~E.joinPerm,removeMemberPermission:~~E.removePerm,invitePermission:~~E.memInvitePerm,inviteHandlePermission:~~E.invitePerm,groupInfoEditPermission:~~E.profilePerm,memberInfoEditPermission:~~E.memProfilePerm,extProfile:R,creatorId:r||"",ownerId:a||"",createTime:o||0,membersCount:s||0,remark:_||"",joinedTime:c||0,role:u||X.UNDEF}})):[]},u.prototype._convertUpdateGroupInfoList=function(t){return t&&0!==t.length?t.map((function(t){var e=t.groupId,n=t.baseInfo,o=t.createTime,r=t.createUserId,i=t.extraInfo,s=t.memberCount,a=t.ownerId,_=t.remark,c=t.joinTime,u=t.role,E=ve(n),R=ve(i);return JSON.parse(JSON.stringify(Xt(Xt(Xt(Xt(Xt(Xt(Xt(Xt(Xt({groupId:e},function(t){return JSON.parse(JSON.stringify({groupName:t.name,portraitUri:t.portraitUrl,introduction:t.introduction,notice:t.announcement,joinPermission:ge(t.joinPerm),removeMemberPermission:ge(t.removePerm),invitePermission:ge(t.memInvitePerm),inviteHandlePermission:ge(t.invitePerm),groupInfoEditPermission:ge(t.profilePerm),memberInfoEditPermission:ge(t.memProfilePerm)}))}(E)),i.length>0&&{extProfile:R}),r&&{creatorId:r}),a&&{ownerId:a}),o&&{createTime:o}),s&&{membersCount:s}),_&&{remark:_}),c&&{joinedTime:c}),u&&{role:u})))})):[]},u.prototype._convertGroupMemberInfoList=function(t){return t&&0!==t.length?t.map((function(t){var e=t.userId,n=t.nickname,o=t.groupNickname,r=t.portraitUrl,i=t.joinTime;return{userId:e,name:n||"",portraitUri:r||"",nickname:o||"",role:t.role||0,joinedTime:i||0,extra:t.extra||""}})):[]},u.prototype.createGroup=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r,i,s;return Qt(this,(function(a){return r=sn(e),i=sn(n||{}),[2,(s=ao.create(this.logger,"createGroup")).invoke(t,o,JSON.stringify(r),JSON.stringify(i),(function(t,e,n,o){t===ct.SUCCESS?s.ok():s.fail(t,{errorKeys:cn(o),processCode:e})})).result()]}))}))},u.prototype.updateGroupInfo=function(t,e,n){return jt(this,void 0,void 0,(function(){var o,r,i;return Qt(this,(function(s){return o=sn(e),r=sn(null!=n?n:{}),[2,(i=ao.create(this.logger,"updateGroupInfo")).invoke(t,JSON.stringify(o),JSON.stringify(r),(function(t,e,n,o){t===ct.SUCCESS?i.ok():i.fail(t,{errorKeys:cn(o)})})).result()]}))}))},u.prototype.getGroupsInfo=function(t){return jt(this,void 0,void 0,(function(){var e=this;return Qt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupInfoByIds",t,(function(t,o,r,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:ct.MAIN_PROCESS_ERROR})}),0)}setTimeout((function(){n({code:ct.SUCCESS,data:e._convertGroupInfoList(s)})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},u.prototype.kickGroupMembers=function(t,e,n){return jt(this,void 0,void 0,(function(){var o=this;return Qt(this,(function(r){return[2,new Promise((function(r){var i=an(n),s=o._callCppProxy("kickOutGroupMember",t,e,JSON.stringify(i),(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},u.prototype.quitGroup=function(t,e){return jt(this,void 0,void 0,(function(){var n=this;return Qt(this,(function(o){return[2,new Promise((function(o){var r=an(e),i=n._callCppProxy("quitGroup",t,JSON.stringify(r),(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},u.prototype.dismissGroup=function(t){return jt(this,void 0,void 0,(function(){var e=this;return Qt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("disbandGroup",t,(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},u.prototype.transferGroupOwner=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r=this;return Qt(this,(function(i){return[2,new Promise((function(i){var s=an(o),a=r._callCppProxy("transferGroup",t,e,n,JSON.stringify(s),(function(t,e){setTimeout((function(){i({code:t})}),0)}));r.handleErrorCode(a,i)}))]}))}))},u.prototype.setGroupManagers=function(t,e,n){return jt(this,void 0,void 0,(function(){var o=this;return Qt(this,(function(r){return[2,new Promise((function(r){var i=o._callCppProxy("updateGroupAdmins",e,n,t,(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))]}))}))},u.prototype.getGroupMembersByRole=function(t,e,n){return jt(this,void 0,void 0,(function(){var o=this;return Qt(this,(function(r){return[2,new Promise((function(r){var i=e===X.UNDEF?[1,2,3]:[e],s=o._callCppProxy("getGroupMembers",t,i,n.pageToken||"",n.count,n.order?1:0,(function(t,e,n,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=o._convertGroupMemberInfoList(s);setTimeout((function(){r({code:ct.SUCCESS,data:{totalCount:null!=n?n:0,data:a,pageToken:null!=e?e:""}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},u.prototype.getGroupMembers=function(t,e){return jt(this,void 0,void 0,(function(){var n=this;return Qt(this,(function(o){return[2,new Promise((function(o){var r=n._callCppProxy("getGroupMembersByIds",t,e,(function(t,e,r,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupMemberInfoList(s);setTimeout((function(){o({code:ct.SUCCESS,data:a})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))]}))}))},u.prototype.setGroupMemberInfo=function(t,e,n,o){return jt(this,void 0,void 0,(function(){var r;return Qt(this,(function(i){return[2,(r=ao.create(this.logger,"updateGroupMemberInfo")).invoke(t,e,n,o||"",(function(t,e,n,o){t===ct.SUCCESS?r.ok():r.fail(t,{errorKeys:cn(o)})})).result()]}))}))},u.prototype.searchGroupMembers=function(t,e,n){return jt(this,void 0,void 0,(function(){var o=this;return Qt(this,(function(r){return[2,new Promise((function(r){var i=n.order?1:0,s=o._callCppProxy("getGroupMembersByNickname",t,e,n.pageToken||"",n.count,i,(function(t,e,n,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=o._convertGroupMemberInfoList(s);setTimeout((function(){r({code:ct.SUCCESS,data:{data:a,pageToken:e,totalCount:n}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},u.prototype.joinGroup=function(t){return jt(this,void 0,void 0,(function(){var e=this;return Qt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("joinGroup",t,(function(t,e,o){t===ct.SUCCESS?setTimeout((function(){n({code:t,data:{processCode:e}})}),0):setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},u.prototype.inviteUsersToGroup=function(t,e){return jt(this,void 0,void 0,(function(){var n=this;return Qt(this,(function(o){return[2,new Promise((function(o){var r=n._callCppProxy("inviteUsersToGroup",t,e,(function(t,e,n){t===ct.SUCCESS?setTimeout((function(){o({code:t,data:{processCode:e}})}),0):setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))]}))}))},u.prototype.memberInviteResponse=function(t){return jt(this,void 0,void 0,(function(){var e=this;return Qt(this,(function(n){return[2,new Promise((function(n){var o=t.groupId,r=t.inviterId,i=t.optType,s=t.optResult,a=t.joinUserId,_=t.reason,c=1===i?1:0,u=c&&a?a:"",E=e._callCppProxy("handleGroupInvite",o,u,r,s,c,null!=_?_:"",(function(t,e,o){t===ct.SUCCESS?setTimeout((function(){n({code:t,data:{processCode:e}})}),0):setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(E,n)}))]}))}))},u.prototype.getGroupApplications=function(t,e,n){return void 0===e&&(e=[]),void 0===n&&(n=[]),jt(this,void 0,void 0,(function(){var o=this;return Qt(this,(function(r){return[2,new Promise((function(r){var i=t.order?1:0,s=o._callCppProxy("getGroupRequests",e,n,"",t.pageToken||"",t.count,i,(function(t,e,n,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=s.map((function(t){var e=t.groupId,n=t.joinUser,o=t.approverUser,r=t.inviterUser,i=t.type;return{groupId:e,joinMemberInfo:n,inviterInfo:r,operatorInfo:o,status:t.status,direction:t.direction,type:i,operationTime:t.operateTime,reason:t.remark}}));setTimeout((function(){r({code:t,data:{totalCount:n,data:a,pageToken:e}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},u.prototype.getJoinedGroupsByRole=function(t,e){return jt(this,void 0,void 0,(function(){var n=this;return Qt(this,(function(o){return[2,new Promise((function(o){var r=e.order?1:0,i=t===X.UNDEF?[1,2,3]:[t],s=n._callCppProxy("getGroups",i,e.pageToken||"",e.count,r,(function(t,e,r,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupInfoList(s);setTimeout((function(){o({code:t,data:{totalCount:r,data:a,pageToken:e}})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(s,o)}))]}))}))},u.prototype.searchJoinedGroups=function(t,e){return jt(this,void 0,void 0,(function(){var n=this;return Qt(this,(function(o){return[2,new Promise((function(o){var r=e.order?1:0,i=n._callCppProxy("getGroupsByGroupName",t,e.pageToken||"",e.count,r,(function(t,e,r,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupInfoList(s);setTimeout((function(){o({code:t,data:{totalCount:r,data:a,pageToken:e}})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},u.prototype.getJoinedGroups=function(t){return jt(this,void 0,void 0,(function(){var e=this;return Qt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupsByIds",t,(function(t,o,r,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=e._convertGroupInfoList(s);setTimeout((function(){n({code:t,data:a})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},u.prototype.setGroupRemark=function(t,e){return jt(this,void 0,void 0,(function(){var n=this;return Qt(this,(function(o){return[2,new Promise((function(o){var r=e?Z.ADD:Z.REMOVE,i=n._callCppProxy("updateGroupRemark",t,e||"",r,(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},u.prototype.setGroupFollows=function(t,e,n){return jt(this,void 0,void 0,(function(){var o=this;return Qt(this,(function(r){return[2,new Promise((function(r){var i=o._callCppProxy("updateFavoriteMembers",e,n,t,(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))]}))}))},u.prototype.getGroupFollows=function(t){return jt(this,void 0,void 0,(function(){var e=this;return Qt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupFavoriteMembers",t,"",1e3,0,(function(t,o,r,i){if(t===ct.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(ze.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:ct.MAIN_PROCESS_ERROR})}),0)}var a=s.map((function(t){return{userId:t.userId,time:t.followTime}}));setTimeout((function(){n({code:ct.SUCCESS,data:a})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},u.prototype.addFriend=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("addFriend",t,e,n,(function(t,e,n){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))},u.prototype.deleteFriends=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("removeFriends",t,e,(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},u.prototype.acceptFriendApplication=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("acceptFriendRequest",t,"",(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},u.prototype.refuseFriendApplication=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("rejectFriendRequest",t,e||"",(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},u.prototype.setFriendInfo=function(t,e,n){var o=ao.create(this.logger,"setFriendInfo"),r=sn(null!=n?n:{});return o.invoke(t,e,JSON.stringify(r),(function(t,e,n,r){t===ct.SUCCESS?o.ok():o.fail(t,{errorKeys:cn(r)})})).result()},u.prototype.checkFriends=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("checkFriendRelationship",t,e,(function(t,e){if(t===ct.SUCCESS){var n=JSON.parse(e).map((function(t){return{userId:t.userId,relationType:t.status}}));setTimeout((function(){o({code:t,data:n})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},u.prototype.getFriends=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriends",t,0,(function(t,o){try{if(t===ct.SUCCESS){var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:t,data:{data:i,pageToken:""}})}),0)}else setTimeout((function(){n({code:t})}),0)}catch(t){e.logger.error(ze.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:ct.MAIN_PROCESS_ERROR})}),0)}}));e.handleErrorCode(o,n)}))},u.prototype.getFriendApplications=function(t,e,n){var o=this;return new Promise((function(r){var i=t.order?1:0,s=3;e&&1===e.length&&(s=null==e?void 0:e[0]);var a=o._callCppProxy("getFriendRequestListByPage",s,n||[0,1,2,3],t.count,t.pageToken||"",i,(function(t,e,n){if(t===ct.SUCCESS){var i=[];try{i=JSON.parse(n)}catch(t){o.logger.error(ze.P_PARSE_JSON_MSGS_E,n),setTimeout((function(){r({code:ct.MAIN_PROCESS_ERROR})}),0)}var s=i.map((function(t){return{userId:t.userId,name:t.name,portraitUri:t.portraitUrl,applicationType:t.friendRequestType,applicationStatus:t.friendRequestStatus,operationTime:t.operateTime,remark:t.extra}}));setTimeout((function(){r({code:t,data:{data:s,pageToken:null!=e?e:""}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(a,r)}))},u.prototype.deleteFriendApplication=function(t,e){return Promise.resolve({code:ct.NOT_SUPPORT})},u.prototype._convertFriendInfo=function(t){return t.map((function(t){var e=t.userId,n=t.userName,o=t.remark;return{userId:e,name:n,portraitUri:t.portraitUrl,remark:o,directionType:t.friendType,extProfile:t.extProfiles,addTime:t.addTime,inBlackList:!!t.friendAttribute}}))},u.prototype.getFriendsInfo=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriendByIds",t,(function(t,o){if(t===ct.SUCCESS){var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:t,data:i})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},u.prototype.searchFriendsInfo=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriendByNickname",t,(function(t,o){if(t===ct.SUCCESS)try{var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:ct.SUCCESS,data:i})}),0)}catch(t){e.logger.error(ze.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:ct.MAIN_PROCESS_ERROR})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},u.prototype.setFriendAddPermission=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("setFriendAuthPermission",t,(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},u.prototype.getFriendAddPermission=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getFriendAuthPermission",(function(t,n){setTimeout((function(){e({code:t,data:n})}),0)}));t.handleErrorCode(n,e)}))},u.prototype.setNotificationQuietHoursWithSetting=function(t){var e=t.startTime,n=t.spanMinutes,o=t.level,r=t.timezone,i=ao.create(this.logger,"addPushSetting");return i.invoke(e,n,o,r||"",(function(){return i.ok()}),(function(t){return i.fail(t)})).result()},u.prototype.removeNotificationQuietHoursSetting=function(){var t=ao.create(this.logger,"removePushSetting");return t.invoke((function(){return t.ok()}),(function(e){return t.fail(e)})).result()},u.prototype.getNotificationQuietHoursSetting=function(){var t=ao.create(this.logger,"queryPushSetting");return t.invoke((function(e,n,o,r){var i={startTime:e,spanMinutes:n,level:o,timezone:r};t.ok(i)}),(function(e){return t.fail(e)})).result()},u.prototype.setDataBaseLogConfig=function(t){this._callCppProxy("setDataBaseLogConfig",t)},u.prototype.getStatsUrlList=function(){return Promise.resolve(Re(xe.getStatsUrlList(this.getNaviInfoFromCache())))},u}();co=new WeakSet,uo=function(t){var e=t.content,n=e.messageUId,o=e.sentTime;e.isAdmin;var r=e.isDelete,i=this._callCppProxy("getMessage",n),s=this._buildMessage(i,{isOffLineMessage:!1}),a=s.messageId>0;if(r)return a&&this._callCppProxy("deleteMessages",[s.messageId]),a;if(a&&s.messageType===dt.RECALL_NOTIFICATION_MESSAGE)return!1;var _={recallTime:Date.now(),admin:!!t.content.isAdmin,isDelete:!!t.content.isDelete,originalObjectName:s.messageType,originalMessageContent:s.content,recallActionTime:t.sentTime,operatorId:t.senderUserId};if(t.content.user&&(_.user=t.content.user),t.content.extra&&(_.extra=t.content.extra),s.messageType===dt.TextMessage&&(_.recallContent=s.content.content),!a){var c=t.conversationType,u=t.targetId,E=t.senderUserId,R=t.channelId,l=t.messageDirection;return this._callCppProxy("insertMessage",c,u,E,dt.RECALL_NOTIFICATION_MESSAGE,JSON.stringify(_),(function(){}),(function(){}),l,1,30,o,"",0,n,!1,!0,JSON.stringify({}),R||""),!0}return s.receivedStatus||this.setMessageReceivedStatus(s.messageId,1),this._callCppProxy("setMessageContent",s.messageId,JSON.stringify(_),dt.RECALL_NOTIFICATION_MESSAGE),!0},process.title="".concat((po=process.title,-1!==(Co=po.lastIndexOf("/"))?po.substring(Co+1):po)," PsService"),function(t){var e=this,n=qt(t.argv.slice(2),5),o=n[0],r=n[1],i=n[2],s=n[3],a=n[4],_="true"===i,c=nn(t),u=c.sendCallback,E=c.sendError,R=c.sendEvent,l=c.sendResponse,d=In?new To(o,r,R,_,~~s,"true"===a):null;t.on("message",(function(t){return jt(e,void 0,void 0,(function(){var e,n,o,r,i,s;return Qt(this,(function(a){switch(a.label){case 0:return e=t.reqId,n=t.method,o=t.args,r=t.hasResponse,d?r?("sendMessage"===n&&(i=o[3],o[3]=function(t){u({reqId:i,data:t})}),[4,d.callProxy.apply(d,zt([n],qt(o),!1))]):[3,2]:[2,l({reqId:e,success:!0,data:{code:ct.ADDON_NOT_EXIST,msg:"Cannot find module ".concat(un)}})];case 1:return s=a.sent(),l({reqId:e,success:true,data:s}),[3,3];case 2:d.sendProxy.apply(d,zt([n],qt(o),!1)),a.label=3;case 3:return[2]}}))}))})),t.on("beforeExit",(function(t){null==d||d.destroy()})),t.on("uncaughtException",(function(t){E("uncaughtException ".concat(t.stack||t.toString()))})),t.on("unhandledRejection",(function(t){E("unhandledRejection ".concat(t.stack))}))}(process);
15
+ ***************************************************************************** */var L=function(e,t){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},L(e,t)};function M(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}L(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var U,D,w,G,V,j,F,k,B,H,x,J,W,Y,K,X,Q,Z,q,z,$,ee,te,re,ne,ie,oe,ae,se,ue,ce,le,_e=function(){return _e=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_e.apply(this,arguments)};function Ee(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function de(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function fe(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function pe(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function Re(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function be(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function Oe(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(U||(U={})),function(e){e.L_IMSDK_VER_O="L-imsdk_ver-O",e.A_INIT_REPEAT_O="A_INIT_REPEAT_O",e.L_INIT_O="L-init-O",e.A_DESTROY_O="A_DESTROY_O",e.A_CONNECT_T="A-connect-T",e.A_CONNECT_R="A-connect-R",e.A_CONNECT_S="A-connect-S",e.L_QUERY_CMP_T="L-query_cmp-T",e.L_QUERY_CMP_R="L-query_cmp-R",e.A_DISCONNECT_O="A-disconnect-O",e.A_RECONNECT_T="A-reconnect-T",e.A_RECONNECT_R="A_RECONNECT_R",e.L_CONNECT_T="L-connect-T",e.L_CONNECT_R="L-connect-R",e.L_CONNECT_S="L-connect-S",e.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",e.L_DB_UPGRATING_S="L-db_upgrating-S",e.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",e.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",e.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",e.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",e.A_MSG_LISTENER_E="A-MSG_LISTENER-E",e.O="L-original-O",e.T="L-TEST-O",e.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",e.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",e.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",e.L_NAVI_CMP_R="L-NAVI_CPM-R",e.A_SEND_MSG_T="A-send_msg-T",e.A_SEND_MSG_R="A-send_msg-R",e.L_SEND_MSG_T="L-send_msg-T",e.L_SEND_MSG_R="L-send_msg-R",e.L_PULL_MSG_T="L-pull_msg-T",e.L_PULL_MSG_R="L-pull_msg-R",e.L_PULL_MSG_E="L-pull_msg-E",e.L_PULL_MSG_O="L-pull_msg-O",e.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",e.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",e.L_PULL_UG_RELATIONS_T="L-pull_ug_relations-T",e.L_PULL_UG_RELATIONS_R="L-pull_ug_relations-R",e.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",e.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",e.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",e.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",e.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",e.L_RECV_S_MSG_O="L-recv_s_msg-O",e.A_DELETE_MESSAGES_S="A-delete_messages-S",e.P_DELETE_MSG_S="P-delete_msg-S",e.A_RECALL_MESSAGE_T="A-recall_msg-T",e.A_RECALL_MESSAGE_R="A-recall_msg-R",e.A_RECALL_MESSAGE_E="A-recall_msg-E",e.A_REGTYP_O="A-regtyp-O",e.P_REGTYP_E="P-regtype-E",e.L_GET_NAVI_T="L-get_navi-T",e.L_GET_NAVI_R="L-get_navi-R",e.L_REQUEST_T="L-request-T",e.L_REQUEST_R="L-request-R",e.L_PARSE_NAVI_E="L-parse_navi-E",e.L_ENV_S="L-Env-S",e.L_GET_INDEX_NAVI_S="L-get_index_navi-S",e.A_JOIN_CHATROOM_T="A-join_chatroom-T",e.A_JOIN_CHATROOM_R="A-join_chatroom-R",e.L_JOIN_CHATROOM_T="L-join_chatroom-T",e.L_JOIN_CHATROOM_R="L-join_chatroom-R",e.A_QUIT_CHATROOM_T="A-quit_chatroom-T",e.A_QUIT_CHATROOM_R="A-quit_chatroom-R",e.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",e.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",e.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",e.L_MEDIA_S="L-media-S",e.L_MEDIA_UPLOAD_T="L-media_upload-T",e.L_MEDIA_UPLOAD_R="L-media_upload-R",e.G_UPLOAD_LOG_S="G-upload_log-S",e.G_REPORT_LOG_S="G-report_log-S",e.G_UPLOAD_LOG_E="G-upload_log-E",e.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",e.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",e.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",e.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",e.A_GET_LOCAL_MESSAGE_T="A-get_local_message-T",e.A_GET_LOCAL_MESSAGE_R="A-get_local_message-R",e.A_GET_HISTORY_MSG_T="A-get_history_msg-T",e.A_GET_HISTORY_MSG_R="A-get_history_msg-R",e.L_GET_HISTORY_MSG_T="L-get_history_msg-T",e.L_GET_HISTORY_MSG_R="L-get_history_msg-R",e.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",e.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",e.L_CALLBACK_E="L-callback-E",e.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",e.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",e.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",e.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",e.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",e.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",e.A_SYNC_READ_STATUS_T="A-sync_read_status-T",e.A_SYNC_READ_STATUS_R="A-sync_read_status-R",e.L_PB_ENCODE_E="L-pb-encode-E",e.L_PB_DECODE_E="L-pb-decode-E",e.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",e.L_REPORT_FULL_LOG_O="L-report_full_log-O",e.L_REPORT_FULL_LOG_T="L-report_full_log-T",e.L_REPORT_FULL_LOG_R="L-report_full_log-R",e.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",e.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",e.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",e.L_LOGDB_CLOSED_S="L-logDB_closed-S",e.L_LOGDB_ERROR_E="L-logDB_error-S",e.L_LOGDB_ABORT_S="L-logDB_abort-S",e.L_REALTIME_LOG_T="L_REALTIME_LOG_T",e.L_REALTIME_LOG_R="L_REALTIME_LOG_R",e.L_REALTIME_LOG_O="L_REALTIME_LOG_O",e.L_RECV_RMTP_O="L_RECV_RMTP_O",e.L_RECV_RMTP_E="L_RECV_RMTP_E",e.L_RECV_S_NTF_O="L-recv_s_ntf_O",e.L_RECV_S_CMD_O="L-recv_s_cmd_O",e.L_VER_REPORT_T="L-VER_REPORT-T",e.L_VER_REPORT_R="L-VER_REPORT-R",e.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",e.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",e.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",e.A_REMOVE_PROXY_O="A-remove_proxy-O",e.A_SET_PROXY_O="A-set_proxy-O",e.A_TEST_PROXY_O="A-test_proxy-O",e.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",e.L_GET_STATIC_CONF_T="L-get_static_conf-T",e.L_GET_STATIC_CONF_R="L-get_static_conf-R",e.L_GET_STATIC_CONF_E="L-get_static_conf-E",e.L_CLOUD_DISABLED="L-cloud_disabled",e.L_CLOUD_OVERCLOCK="L-cloud_overclock",e.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",e.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",e.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",e.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",e.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",e.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",e.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",e.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",e.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",e.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",e.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",e.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",e.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",e.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",e.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",e.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",e.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",e.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",e.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",e.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",e.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",e.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",e.L_SERVER_EVENT_NOTIFY_ONLINE_T="L-server_event_notify_online-T",e.L_SERVER_EVENT_NOTIFY_ONLINE_R="L-server_event_notify_online-R",e.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",e.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",e.L_PARSE_JSON_E="L-parse_json-E",e.L_REQ_STREAM_MSG_CONTENT_T="L-req_stream_msg_content-T",e.L_REQ_STREAM_MSG_CONTENT_R="L-req_stream_msg_content-R",e.L_REQ_STREAM_MSG_CONTENT_O="L-req_stream_msg_content-O",e.L_REQ_STREAM_MSG_CONTENT_E="L-req_stream_msg_content-E",e.L_PULL_CONVERSATION_SETTINGS_T="L-pull_conversation_settings-T",e.L_PULL_CONVERSATION_SETTINGS_R="L-pull_conversation_settings-R",e.L_PULL_SG_RELATIONS_T="L-pull_sg_relations-T",e.L_PULL_SG_RELATIONS_R="L-pull_sg_relations-R",e.A_REMOVE_CONVERSATION_T="A-remove_conversation-T",e.A_REMOVE_CONVERSATION_R="A-remove_conversation-R",e.A_GET_CONVERSATION_LIST_BY_FILTER_T="A-get_conversation_list_by_filter-T",e.A_GET_CONVERSATION_LIST_BY_FILTER_R="A-get_conversation_list_by_filter-R",e.A_GET_CONVERSATION_T="A-get_conversation-T",e.A_GET_CONVERSATION_R="A-get_conversation-R",e.A_BATCH_SET_CONVERSATION_TO_TOP_T="A-batch_set_conversation_to_top-T",e.A_BATCH_SET_CONVERSATION_TO_TOP_R="A-batch_set_conversation_to_top-R",e.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T="A-batch_set_conversation_notification_level-T",e.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R="A-batch_set_conversation_notification_level-R",e.A_CLEAR_ALL_UNREAD_COUNT_O="A-clear_all_unread_count-O",e.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T="A-delete_remote_message_by_timestamp-T",e.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R="A-delete_remote_message_by_timestamp-R",e.A_DELETE_REMOTE_MESSAGE_T="A-delete_remote_message-T",e.A_DELETE_REMOTE_MESSAGE_R="A-delete_remote_message-R",e.A_BATCH_CLEAR_REMOTE_MSG_T="A-batch_clear_remote_msg-T",e.A_BATCH_CLEAR_REMOTE_MSG_R="A-batch_clear_remote_msg-R",e.L_EVENT_LOOP_BLOCKING_S="L-event_loop_blocking-S",e.A_E_SEARCH_CONVERSATION_BY_CONTENT_T="A-e_search_conversation_by_content-T",e.A_E_SEARCH_CONVERSATION_BY_CONTENT_R="A-e_search_conversation_by_content-R"}(D||(D={})),function(e){e[e.BOTH=2]="BOTH"}(w||(w={})),function(e){e[e.BOTH=2]="BOTH"}(G||(G={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(V||(V={})),function(e){e[e.NONE=0]="NONE",e[e.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",e[e.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",e[e.BOTH_WAY=3]="BOTH_WAY"}(j||(j={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(F||(F={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(k||(k={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(B||(B={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(H||(H={})),function(e){e[e.OWNER_VERIFY=0]="OWNER_VERIFY",e[e.FREE=1]="FREE",e[e.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(x||(x={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(J||(J={})),function(e){e[e.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",e[e.OWNER_OR_SELF=1]="OWNER_OR_SELF",e[e.SELF=2]="SELF"}(W||(W={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(Y||(Y={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(K||(K={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK=2]="KICK",e[e.QUIT=3]="QUIT",e[e.DISMISS=4]="DISMISS",e[e.ADD_MANAGER=5]="ADD_MANAGER",e[e.REMOVE_MANAGER=6]="REMOVE_MANAGER",e[e.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(X||(X={})),function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(Q||(Q={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(Z||(Z={})),function(e){e[e.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",e[e.MANAGER_REFUSED=1]="MANAGER_REFUSED",e[e.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",e[e.INVITEE_REFUSED=3]="INVITEE_REFUSED",e[e.JOINED=4]="JOINED",e[e.EXPIRED=5]="EXPIRED"}(q||(q={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(z||(z={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}($||($={})),function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(ee||(ee={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(te||(te={})),function(e){e[e.APPLICATION_SENT=0]="APPLICATION_SENT",e[e.INVITATION_SENT=1]="INVITATION_SENT",e[e.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",e[e.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(re||(re={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(ne||(ne={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(ie||(ie={})),function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(oe||(oe={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(ae||(ae={})),function(e){e[e.UnmuteUsers=0]="UnmuteUsers",e[e.MuteUsers=1]="MuteUsers",e[e.UnmuteAll=2]="UnmuteAll",e[e.MuteAll=3]="MuteAll",e[e.RemoveWhitelist=4]="RemoveWhitelist",e[e.AddWhitelist=5]="AddWhitelist",e[e.UnmuteGloble=6]="UnmuteGloble",e[e.MuteGloble=7]="MuteGloble"}(se||(se={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(ue||(ue={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",e[e.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",e[e.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",e[e.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",e[e.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",e[e.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",e[e.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",e[e.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",e[e.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(ce||(ce={})),function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(le||(le={}));var Ce,ge,Te,he,Ie,Se,ve,Ne,Pe,me,Ae,ye,Le,Me,Ue,De,we,Ge,Ve,je,Fe,ke,Be,He,xe,Je=0,We=1,Ye=2,Ke=3,Xe=4,Qe=function(e){var t=[le.PRIVATE,le.GROUP,le.SYSTEM,le.PUBLIC_SERVICE,le.APP_PUBLIC_SERVICE];switch(e){case Je:return t;case We:return[le.PRIVATE,le.GROUP];case Ye:return Re(Re([],pe(t),!1),[le.ULTRA_GROUP],!1);case Ke:return Re(Re([],pe(t),!1),[le.ULTRA_GROUP,le.CHATROOM],!1);case Xe:return Re(Re([],pe(t),!1),[le.ULTRA_GROUP,le.CHATROOM,le.RTC_ROOM,le.CUSTOMER_SERVICE,le.DISCUSSION],!1)}};!function(e){e[e.RMTP=1]="RMTP",e[e.TLS=2]="TLS",e[e.RPP=3]="RPP",e[e.QUIC=4]="QUIC",e[e.WS=5]="WS",e[e.WSS=6]="WSS",e[e.HTTP=11]="HTTP",e[e.HTTPS=12]="HTTPS"}(Ce||(Ce={})),function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(ge||(ge={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(Te||(Te={})),function(e){e.TextMessage="RC:TxtMsg",e.VOICE="RC:VcMsg",e.HQ_VOICE="RC:HQVCMsg",e.IMAGE="RC:ImgMsg",e.GIF="RC:GIFMsg",e.RICH_CONTENT="RC:ImgTextMsg",e.LOCATION="RC:LBSMsg",e.FILE="RC:FileMsg",e.SIGHT="RC:SightMsg",e.COMBINE="RC:CombineMsg",e.COMBINE_V2="RC:CombineV2Msg",e.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",e.LOG_COMMAND="RC:LogCmdMsg",e.EXPANSION_NOTIFY="RC:MsgExMsg",e.REFERENCE="RC:ReferenceMsg",e.RECALL="RC:RcCmd",e.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",e.READ_RECEIPT="RC:ReadNtf",e.READ_RECEIPT_REQUEST="RC:RRReqMsg",e.READ_RECEIPT_RESPONSE="RC:RRRspMsg",e.SYNC_READ_STATUS="RC:SRSMsg",e.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",e.READ_STATE="RC:RSMsg",e.DELIVERED="RC:Delivered",e.DELIVERED_MSG="RC:DRMsg",e.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",e.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",e.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",e.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",e.TYPING_STATUS="RC:TypSts",e.INTERCEPT="RC:InterceptMsg",e.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg",e.STREAM_MESSAGE="RC:StreamMsg"}(he||(he={})),function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(Ie||(Ie={})),function(e){e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Se||(Se={})),function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE",e[e.UG_DEL=6]="UG_DEL"}(ve||(ve={})),function(e){e[e.CHANNEL_DELETE=1]="CHANNEL_DELETE",e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",e[e.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Ne||(Ne={})),function(e){e[e.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",e[e.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",e[e.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",e[e.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",e[e.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(Pe||(Pe={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(me||(me={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(Ae||(Ae={})),function(e){e[e.typing=0]="typing"}(ye||(ye={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(Le||(Le={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(Me||(Me={})),function(e){e[e.ONLINE_STATUS=1]="ONLINE_STATUS",e[e.USER_PROFILE=2]="USER_PROFILE",e[e.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",e[e.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(Ue||(Ue={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(De||(De={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(we||(we={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(Ge||(Ge={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(Ve||(Ve={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(je||(je={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(Fe||(Fe={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(ke||(ke={})),function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(Be||(Be={})),function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(He||(He={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(xe||(xe={}));var Ze,qe,ze,$e,et,tt,rt,nt,it,ot,at,st=function(e){return e<=He.NOT_SET?xe.CLOSE:xe.OPEN};!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(Ze||(Ze={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(qe||(qe={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(ze||(ze={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}($e||($e={})),function(e){e[e.CURRENT=2]="CURRENT"}(et||(et={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(tt||(tt={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(rt||(rt={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(nt||(nt={})),function(e){e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(it||(it={})),function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(ot||(ot={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(at||(at={}));var ut=72e5,ct="5.20.0-alpha.1".replace(/-.+$/,""),lt="rongcloudsystem",_t="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};_t.engine="5.20.0-alpha.1";var Et=function(){function e(){}return Object.defineProperty(e,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){["imlib-next","engine","electron-main","electron-renderer","imlib-v2-adapter","Global_IM_UIKit","IMKit","imkit-store","rtclib","calllib","callplus","plugin-wechat-rtc"].includes(e)&&(_t[e]=t)}}),Object.defineProperty(e,"validEngine",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var r=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return _t.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=r}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _t}}),e}();var dt,ft=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)}))},pt=function(e){void 0===e&&(e=22);var t,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}(22),Rt=Date.now(),bt=function(e){function t(t){var r=e.call(this,t)||this;return r.name="CMSYError",r}return M(t,e),Object.defineProperty(t,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new t("Invalid parameter -> ".concat(e)):new t("Invalid parameters.")}}),Object.defineProperty(t,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new t("Wrong parameter type")}}),t}(Error),Ot=function(){function e(){dt.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){Oe(this,dt,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return be(this,dt,"f")},enumerable:!1,configurable:!0}),e}();dt=new WeakMap;var Ct,gt,Tt,ht,It=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),a=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=a.findIndex((function(e){return e.priority>i}));return-1===u?a.push(s):a.splice(u,0,s),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=fe(this._map),i=n.next();!i.done;i=n.next()){var o=pe(i.value,2),a=(o[0],o[1]),s=a.findIndex((function(t){return t.symbol===e}));if(-1!==s)return void a.splice(s,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map.get(e);if(n&&n.length>0)for(var i=new Ot,o=0;o<n.length;o+=1){var a=n[o],s=a.once,u=a.listener;s&&n.splice(o,1);try{u.apply(void 0,Re([i],pe(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}Re([],pe(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,Re([e],pe(t),!1))}))}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._map.delete(e)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._piped.clear(),this._map.clear()}}),Object.defineProperty(e.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._piped.add(e)}}),e}(),St=function(){function e(e,t,r){Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e}return Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){return de(this,(function(t){return this.isOk?[2,e(this.data)]:[2,this.wipe()]}))}))}}),Object.defineProperty(e.prototype,"or",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){return de(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))}}),Object.defineProperty(e.prototype,"trans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?vt(e(this.data)):this.wipe()}}),Object.defineProperty(e.prototype,"tryTrans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?e(this.data):this.wipe()}}),Object.defineProperty(e.prototype,"errmsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify({code:this.code,msg:this.msg})}}),Object.defineProperty(e.prototype,"wipe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isOk?vt(void 0,this.msg):Nt(this.code,this.msg)}}),e}(),vt=function(e,t){return new St(0,t||"success",e)},Nt=function(e,t,r){return new St(e,t||"fail: ".concat(e),r)},Pt=function(){function e(e){var t=this;Ct.add(this),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(e){t._resolve=e})),e&&be(this,Ct,"m",gt).call(this,e)}return Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(vt(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resolve(Nt(e,"",t))}}),Object.defineProperty(e.prototype,"end",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),e}();Ct=new WeakSet,gt=function(e){var t=this;e().then((function(e){return t._resolve(e)}))},function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Tt.add(t),Object.defineProperty(t,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"_taskQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t}M(t,e),Object.defineProperty(t.prototype,"waitingQueueLength",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){return de(this,(function(t){return-1!==this._dataVersion||(this._dataVersion=e),[2]}))}))}}),Object.defineProperty(t.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(t.prototype,"pushTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=new Pt;return this._taskQueue.push({flag:r,handler:e,checkRetry:t,retryCount:0}),this._execPulling(),r.result()}}),Object.defineProperty(t.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return de(this,(function(s){switch(s.label){case 0:return this._pullingPromise?[4,this._pullingPromise]:[3,2];case 1:return s.sent(),[2];case 2:return this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise];case 3:if(e=s.sent(),t=e.isOk,r=e.data,!t)return this._pullingPromise=null,[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw this._pullingPromise=null,new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(null==r?void 0:r.version));return n=r.version,i=r.hasNext,o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=Re([],pe(o),!1),this._dataVersion=n,i?(this._pullingPromise=null,[2,this._execPulling()]):this._versionQueue.length>0?(this._versionQueue.length=0,this._pullingPromise=null,[2,this._execPulling()]):[4,be(this,Tt,"m",ht).call(this)];case 4:return a=s.sent(),this._pullingPromise=null,a?[2,this._execPulling()]:[2]}}))}))}}),Object.defineProperty(t.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return r._execPulling()}),e))}}),Object.defineProperty(t.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(t.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}})}(It),Tt=new WeakSet,ht=function(){return Ee(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c;return de(this,(function(l){switch(l.label){case 0:return 0===this._taskQueue.length?[2,!1]:(e=this._taskQueue.shift(),t=e.flag,r=e.handler,n=e.checkRetry,i=e.retryCount,[4,r(this._dataVersion)]);case 1:return(o=l.sent()).isOk?(a=o.data,s=a.version,u=a.data,t.ok(u),s>this._dataVersion&&(this._dataVersion=s),[2,!1]):((c=!!n&&n(o,i))&&(e.retryCount+=1,this._taskQueue.unshift(e)),[2,c])}}))}))},function(){function e(e,t){var r=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}})}(),function(){function e(e,t){var r=this;Object.defineProperty(this,"handler",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"validate",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_handlerPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._handlerPromise=new Promise((function(e){r._resolve=e}))}Object.defineProperty(e.prototype,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return Ee(this,void 0,void 0,(function(){return de(this,(function(r){if(!this._resolve)throw new Error("BatchSync is closed");return(null===(t=this.validate)||void 0===t?void 0:t.call(this,e))?(this._data.add(e),[2,this._handlerPromise]):[2]}))}))}}),Object.defineProperty(e.prototype,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){var e,t;return de(this,(function(r){switch(r.label){case 0:if(!this._resolve)throw new Error("BatchSync is closed");return e=this._resolve,this._resolve=null,t=Re([],pe(this._data.values()),!1),this._data.clear(),t.length>0?[4,this.handler(t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return e(),[2,Promise.resolve()]}}))}))}})}(),function(){function e(e){Object.defineProperty(this,"_apiName",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_isValid",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_code",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_errmsg",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}Object.defineProperty(e,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t)}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid||0!==this._code||(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._isValid&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this._isValid?vt():Nt(this._code,this._errmsg)}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;var i=n?r(t):null==t||r(t);return this._isValid=i,i||(this._errmsg="param '".concat(e,"' is invalid")),this}}),Object.defineProperty(e.prototype,"validate2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;if(!n&&null==t)return this;var i=r(t);return i.isOk||(this._isValid=!1,this.fail(i.code,i.msg||"param '".concat(e,"' is invalid"))),this}}),Object.defineProperty(e.prototype,"assert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;if(this.validate(e,t,r,n),!this._isValid)throw bt.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}})}();var mt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function At(e){var t,r,n,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=mt.indexOf(e.charAt(u++))<<2|(i=mt.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=mt.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(a=mt.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(r)),64!==a&&(s+=String.fromCharCode(n));return s}var yt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Lt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Mt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Ut=function(e){return function(e){return"string"==typeof e}(e)&&/https?:\/\//.test(e)},Dt=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},wt=function(e){return{isRead:(e&Ze.READ)===Ze.READ,isListened:(e&Ze.LISTENED)===Ze.LISTENED,isDownload:(e&Ze.DOWNLOADED)===Ze.DOWNLOADED,isRetrieved:(e&Ze.RETRIEVED)===Ze.RETRIEVED}},Gt=function(e){return[Me.Android,Me.iOS,Me.Web,Me.PC,Me.Mini,Me.HarmonyOS].map((function(t){var r=e.findIndex((function(e){return e.platform===t}));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]}))},Vt=function(e,t,r){return t?1===r?Ce.TLS:Ce.RMTP:"http"===e?Ce.WS:Ce.WSS},jt=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return Re([],pe(o.filter((function(e){return e.addr}))),!1);var u=[],c=[];return r&&c.push(r),(n||i||"").split(",").forEach((function(e){c.indexOf(e)<0&&c.push(e)})),c.forEach((function(e,n){e&&u.push({addr:e,protocol:Vt(a,t,s),weight:r.length-n,race:!1})})),Re([],pe(u),!1)},Ft=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},kt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Bt=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=ft(),i=function(e){e=e||"-";var t=new Date,r=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();return"".concat(r).concat(e).concat(n).concat(e).concat(i)}(),o=(new Date).getTime(),a="";if(t){var s=t.split(".");a=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(a)},Ht=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,c=t.imageUrlHW,l=t.categoryVivo,_=t.importanceHonor,E=t.imageUrlHonor,d=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=a||"active";var c={};c.collapse_key=null==s?void 0:s.collapseKey,c.imageUrl=null==s?void 0:s.imageUrl;var l=null==s?void 0:s.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),c.priority=l,{APNS:u,FCM:c}}(e,t),f=[{HW:{channelId:i||"",importance:s||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:l||""}},{APNS:d.APNS},{FCM:d.FCM},{HONOR:{importance:_||ke.NORMAL,image:E||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(f)},xt=function(){var e=Et.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t};function Jt(e,t){var r;if(!e)return"";var n="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?n?e.replace(/^https?:\/\//i,"https://"):e:t!==Ce.HTTP||n?"https://".concat(e):"http://".concat(e)}var Wt,Yt,Kt,Xt=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(D.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Wt||(Wt={})),function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA"}(Kt||(Kt={}));var Qt=((Yt={})[Kt.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:Ce.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Yt[Kt.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:Ce.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Yt[Kt.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:Ce.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Yt[Kt.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:Ce.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Yt[Kt.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:Ce.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Yt);function Zt(e){return Kt[e]?e:Kt.BJ}var qt,zt=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this.initOption||{},i=n.areaCode,o=n.navigators,a=(r=i,void 0===r&&(r=Kt.BJ),Qt[Zt(r)].naviUrlBase64).map((function(e){return At(e)})),s=[],u=pe(e.split("@"),2)[1];t&&(s=u?u.split(";"):[]);var c=o&&o.length>0?Re(Re([],pe(s),!1),pe(o),!1):Re(Re([],pe(s),!1),pe(a),!1);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return Jt(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=e||{},i=n.log,o=n.logPolicy,a=this.initOption||{},s=a.areaCode,u=a.logServerUrl,c=(r=s,void 0===r&&(r=Kt.BJ),Qt[Zt(r)].logUrlBase64).map((function(e){return _e(_e({},e),{addr:At(e.addr)})})),l=[],_={level:1,itv:6,times:5};if(i)l.push.apply(l,Re([],pe(i.addrs),!1)),Object.assign(_,i.policy);else if(o)try{var E=JSON.parse(o);l.push({addr:E.url,protocol:Ce.HTTPS,weight:1}),_.level=E.level,_.itv=E.itv,_.times=E.times}catch(r){t.warn(D.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var d=u?Re([{addr:u,protocol:Ce.HTTPS,weight:101}],pe(l),!1):Re(Re([],pe(l),!1),pe(c),!1);return{policy:_,addrs:d.filter((function(e,t){return d.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return _e(_e({},e),{addr:Jt(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}}}),Object.defineProperty(e.prototype,"getMiniCmpUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t,r=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Kt.BJ),Qt[Zt(t)].miniCmpBase64).map((function(e){return At(e)})),n=(this.initOption||{}).miniCMPProxy;return n&&n.length>0?n:r}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Kt.BJ),Qt[Zt(t)].staticConfigUrlBase64).map((function(e){return At(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(r=n,void 0===r&&(r=Kt.BJ),Qt[Zt(r)].cloudControllerUrlBase64).map((function(e){return At(e)}))}}),Object.defineProperty(e.prototype,"getAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:Kt.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Kt[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=(e||{}).active,i=(null==n?void 0:n.addrs)||[],o=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=Kt.BJ),Qt[Zt(r)].statsUrlBase64).map((function(e){return At(e)}));return 0===i.length?o:Re(Re([],pe(i.sort((function(e,t){return t.weight-e.weight})).map((function(e){return Jt(e.addr,e.protocol)}))),!1),pe(o),!1)}}),e}(),$t=new zt,er=function(){function e(e,t){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticUrls",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"getStaticConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return Ee(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return de(this,(function(c){switch(c.label){case 0:if(!(t=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),r=JSON.parse(t),Date.now()-(null==r?void 0:r.time)<18e5?[4,this.decryptData(r.val)]:[3,3];case 2:return n=c.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return Jt(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=c.sent(),this.logger.error(D.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=c.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(s=c.sent())?void 0:s.areaCode)!==$t.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),this.staticUrls=(null==s?void 0:s.bootstrap)||[],(u=null===(e=null==s?void 0:s.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:u.map((function(e){return Jt(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l;return de(this,(function(_){switch(_.label){case 0:e=(e=Re(Re([],pe(this.staticUrls),!1),pe($t.getStaticConfigUrl()),!1).map((function(e){return Jt(e)}))).filter((function(t,r){return e.indexOf(t)===r})),_.label=1;case 1:_.trys.push([1,6,7,8]),t=fe(e),r=t.next(),_.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(D.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=_.sent(),a=o.code,s=o.data,200===a)return this.logger.info(D.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:a,duration:Date.now()-i})),[2,s];this.logger.warn(D.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:a,duration:Date.now()-i})),_.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return u=_.sent(),c={error:u},[3,8];case 7:try{r&&!r.done&&(l=t.return)&&l.call(t)}finally{if(c)throw c.error}return[7];case 8:return[2]}}))}))}}),e}();!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD",e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG"}(qt||(qt={}));var tr,rr=function(){function e(e,t,r){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:qt.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,qt.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,qt.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,qt.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,qt.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,qt.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}return Object.defineProperty(e.prototype,"_write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tag,r=e.level,n=e.content,i=e.traceId;/^[\w-]+$/.test(t)?r!==qt.DEBUG&&this._handleWrite(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(n," | ").concat(i))}}),Object.defineProperty(e.prototype,"createTraceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"".concat(++e._traceIdCount)}}),Object.defineProperty(e.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return pt}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=qt.FATAL||o>this.outputLevel)){var s=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=a?a:this._id,"][").concat((s||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[qt.DEBUG,qt.INFO,qt.WARN,qt.ERROR].some((function(t){return t===e}))})(e)&&(this.outputLevel=e)}}),Object.defineProperty(e.prototype,"_log",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i={time:Date.now(),level:e,tag:t,content:r,traceId:n,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}}),Object.defineProperty(e.prototype,"summary",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){if(void 0===n&&(n={}),t.isOk){var a=null==i?void 0:i(t.data);this.info(e,JSON.stringify(_e(_e({isOk:!0},n),a)),r)}else{a=null==o?void 0:o(t.data);this.warn(e,JSON.stringify(_e(_e({code:t.code,msg:t.msg},n),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),nr=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r,n,i;return de(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=$t.getLogUrlPolicyList(e,this.logger),n=r.policy,i=r.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,i.length>0&&this.realtimeReport(i[0].addr,n.level,n.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,_,E,d;return de(this,(function(f){switch(f.label){case 0:return this.logger.debug(D.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=f.sent(),o=i.success,a=i.data,o?(this.logger.debug(D.L_REALTIME_LOG_O,"compress done",t),s=Ut(r)?r:"https://".concat(r),s+="?version=".concat("5.20.0-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:s,body:a,method:"POST"})]):(this.logger.warn(D.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:n}]);case 2:if(u=f.sent(),c=u.status,l=u.data,this.logger.debug(D.L_REALTIME_LOG_R,JSON.stringify({status:c,data:l}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,l)try{(d=JSON.parse(l)).nextTime&&(n=d.nextTime),_=d.level,E=d.logSwitch}catch(e){this.logger.warn(D.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:_,logSwitch:E}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,_,E,d,f,p,R=this;return de(this,(function(b){switch(b.label){case 0:return i=Date.now(),o=this.logDB.getTimestamp4RealtimeLog()||Rt,a=Math.max(i-3e4,o+1),s=this.logger.createTraceId(),this.logger.debug(D.L_REALTIME_LOG_T,JSON.stringify({startTime:o,endTime:a,level:t,itv:r}),s),[4,this.logDB.getLogs(o,a,t,!0,n)];case 1:return u=b.sent(),c=u.dbReady,l=u.logs,c?[3,2]:(this.logger.warn(D.L_REALTIME_LOG_R,"get logs failed",s),[3,5]);case 2:return 0!==l.length?[3,3]:(this.logger.debug(D.L_REALTIME_LOG_R,"no logs",s),[3,5]);case 3:return l.length>0?[4,this._sendLogs2Realtime(l,s,e,r)]:[3,5];case 4:_=b.sent(),E=_.itv,d=_.level,f=_.logSwitch,_.isOk&&(p=Math.max.apply(Math,Re([],pe(l.map((function(e){return e.time}))),!1)),this.logDB.setTimestamp4RealtimeLog(p+1),0===f&&(this.started=!1),void 0!==d&&(t=d)),r=E,b.label=5;case 5:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return R.realtimeReport(e,t,r,n)}),1e3*r)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){return void 0===a&&(a=!1),Ee(this,void 0,void 0,(function(){var s,u,c,l,_,E,d,f,p,R;return de(this,(function(b){switch(b.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(s=this.logger.createTraceId(),this.logger.info(D.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:a}),s),[4,this.logDB.getLogs(e,t,qt.DEBUG,!1)]);case 1:return u=b.sent(),c=u.dbReady,l=u.logs,this.logger.info(D.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),s),_=Ut(n)?n:"https://".concat(n),_+="?version=".concat("5.20.0-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),c?l.length>0?[4,this.compressLogs(l)]:[3,3]:[3,5];case 2:return d=b.sent(),f=d.success,p=d.data,E=f?p:"compress failed",[3,4];case 3:E="no data",b.label=4;case 4:return[3,6];case 5:E="no database",b.label=6;case 6:return this.logger.debug(D.L_REPORT_FULL_LOG_O,"compress done",s),a&&(_+="&source=cloud"),[4,this.send({url:_,body:E,method:"POST"})];case 7:return R=b.sent().status,this.logger.info(D.L_REPORT_FULL_LOG_R,JSON.stringify({status:R}),s),[2]}}))}))}}),Object.defineProperty(e.prototype,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1}}),e}(),ir=function(){function e(){}var t,r,n,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){be(this,t,"f",r)||(Oe(this,t,e,"f",r),e.info(D.L_EVENT_LOOP_BLOCKING_S,"start"),be(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){be(this,t,"f",r)&&(be(this,t,"f",r).info(D.L_EVENT_LOOP_BLOCKING_S,"stop"),Oe(this,t,null,"f",r),be(this,t,"f",n)&&(clearTimeout(be(this,t,"f",n)),Oe(this,t,null,"f",n)))}}),t=e,a=function e(){var a=this,s=Date.now();Oe(this,t,setTimeout((function(){var n=Date.now()-s;n>=be(a,t,"f",o)&&be(a,t,"f",r).warn(D.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),be(a,t,"m",e).call(a)}),be(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(tr||(tr={}));var or=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(r=e.endTime)&&void 0!==r?r:0,u=null!==(n=e.platform)&&void 0!==n?n:"",c=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(a,s,u,c,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))}}),Object.defineProperty(e.prototype,"enqueueTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}}),e}();var ar,sr,ur,cr,lr=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new or(r)}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(e){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))}}),Object.defineProperty(e.prototype,"isExire",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.timestamp<this.expire}}),Object.defineProperty(e.prototype,"isOverclock",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.lastRequestTime<this.interval}}),Object.defineProperty(e.prototype,"logCmdMsgTasks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===he.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))}}),Object.defineProperty(e.prototype,"dataHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,Dt(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,_,E;return de(this,(function(d){switch(d.label){case 0:return!this.isEable&&t===tr.init&&this.isExire()?(this.logger.info(D.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===tr.newWorkChange&&this.isOverclock()?(this.logger.info(D.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=Jt(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.20.0-alpha.1",timestamp:this.timestamp},this.logger.record(Be.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,at.POST,o,a)]);case 1:return s=d.sent(),u=s.code,c=s.data,this.logger.record(Be.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),u===ce.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(l=c.targetRegion,this.changeAreaCode===l?[2,this.timestamp]:(_=$t.setAreaCode(l),this.logger.info(D.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:_,originAreaCode:$t.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(E=$t.getCloudControllerUrl(l))[0]?[2,this.request(E[0],tr.other)]:(this.logger.info(D.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))}}),Object.defineProperty(e.prototype,"_handleMrtrData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}),e}(),_r=function(e){return e===ce.RC_CONN_REDIRECTED},Er=function(e){function t(t,r,n){var i=e.call(this)||this;return ar.add(i),Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),cr.set(i,0),Object.defineProperty(i,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:ot.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ge.DISCONNECTED}),Object.defineProperty(i,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2}),i}return M(t,e),Object.defineProperty(t.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(t.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(t.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===Ge.DISCONNECTED&&e===Ge.CONNECTING&&(this._doConnectReason=rt.CONNECT,be(this,ar,"m",ur).call(this)),this._crtConnectionStatus===Ge.CONNECTED&&e===Ge.SUSPENDED&&(t===ce.RC_PING_EXCEED_LIMIT?this._doConnectReason=rt.TIMEOUT:t===ce.RC_CONN_REDIRECTED?this._doConnectReason=rt.REDIRECTED:this._doConnectReason=rt.RECONNECT),this._crtConnectionStatus===Ge.CONNECTED){var r={bid:xt(),cod:t,net:this.getNetwork().type,dur:Date.now()-be(this,cr,"f"),cid:this.cid};this.logger.record(Be.IM_CONNECTION_DURATION,JSON.stringify(r)),e===Ge.SUSPENDED&&be(this,ar,"m",ur).call(this)}switch(this._crtConnectionStatus=e,e){case Ge.CONNECTED:this.logger.info(D.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),be(this,ar,"m",sr).call(this).emit("onConnected",this._fromSuspend);break;case Ge.CONNECTING:this.logger.warn(D.L_CONNECT_S,"status: ".concat(e)),be(this,ar,"m",sr).call(this).emit("onConnecting");break;case Ge.SUSPENDED:this._fromSuspend=!0,this.logger.warn(D.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),_r(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),be(this,ar,"m",sr).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(D.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),be(this,ar,"m",sr).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(t.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===Ge.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var r={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(Be.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(t.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(t.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a;return de(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===Ge.CONNECTED?[2,vt(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(Ge.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==ce.SUCCESS?(this.setConnectionStatus(Ge.DISCONNECTED,o),[2,Nt(o)]):(this.setConnectionStatus(Ge.CONNECTED),[2,vt(a)])}}))}))}}),Object.defineProperty(t.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return Ee(this,void 0,void 0,(function(){var o;return de(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(t.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return Ee(this,void 0,void 0,(function(){var o,a,s,u,c,l,_,E,d,f;return de(this,(function(p){switch(p.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(Be.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return s=p.sent(),u=s.code,c=s.data,u!==ce.SUCCESS?[2,Nt(u)]:1===(l=c).type?[2,Nt(ce.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(D.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),l,t,n)]);case 2:return _=p.sent(),E=_.code,d=_.data,i||E===ce.SUCCESS||(this.retryCount+=1),_r(E)?(this.logger.warn(D.L_CONNECT_R,"redirect code: ".concat(E),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[ce.RC_TCP_RESET,ce.RC_CONN_ACK_TIMEOUT,ce.RC_TCP_DISCONNECTED_NO_RMTP].includes(E)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),f=this.cmpWeightCache.every((function(e){return e.failed})),i&&f?(this.logger.warn(D.L_CONNECT_R,"cpp code:".concat(E,",reture code:").concat(ce.SERVER_UNAVAILABLE),n),[2,Nt(ce.SERVER_UNAVAILABLE)]):(this.logger.warn(D.L_CONNECT_R,"cmp ack timeout, code: ".concat(E),n),this.setConnectionStatus(Ge.SUSPENDED,E),this.setConnectionStatus(Ge.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):E!==ce.SUCCESS?(this.logger.warn(D.L_CONNECT_R,"code: ".concat(E),n),[2,Nt(E)]):(this.logger.info(D.L_CONNECT_R,"userId: ".concat(d),n),Oe(this,cr,Date.now(),"f"),this._crtUserId=d,[2,vt(d)])}}))}))}}),Object.defineProperty(t.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r,n,i=this;return de(this,(function(o){return r=this.logger.createTraceId(),this.logger.debug(D.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return Ee(i,void 0,void 0,(function(){var i;return de(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==Ge.SUSPENDED?[2]:(this.setConnectionStatus(Ge.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=o.sent().code,this.reconnectTimer=null,i===ce.SUCCESS?(this.setConnectionStatus(Ge.CONNECTED),[2]):[ce.SERVER_UNAVAILABLE,ce.TIMEOUT,ce.RC_SOCKET_DISCONNECTED,ce.RC_SOCKET_NOT_CREATED,ce.RC_CONN_ACK_TIMEOUT,ce.RC_TCP_RESET,ce.RC_NAVI_REQ_FAILED,ce.RC_NETWORK_DOWN,ce.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?(this._crtConnectionStatus!==Ge.CONNECTING||(this.setConnectionStatus(Ge.SUSPENDED,i),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(Ge.DISCONNECTED,i),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(t.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return _r(e)?(this.setConnectionStatus(Ge.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===ce.RC_UDP_DISCONNECTED?(this.setConnectionStatus(Ge.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(Ge.DISCONNECTED,e)}}),Object.defineProperty(t.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(Ge.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(t.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){var e,t,r=this;return de(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==Ge.CONNECTED?(this._failedCount=0,this.logger.debug(D.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(D.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===ce.SUCCESS?(this.logger.debug(D.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==Ge.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(D.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(D.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(Ge.SUSPENDED,ce.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,ce.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(t.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){return de(this,(function(r){switch(r.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.setConnectionStatus(Ge.DISCONNECTED,ce.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(t.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(t.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return Re([],pe(this.cmpWeightCache),!1);var r=jt(e,t);return this.cmpWeightCache=Re([],pe(r),!1),Re([],pe(r),!1)}}),Object.defineProperty(t.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(this.cmpWeightCache){var n=this.cmpWeightCache.find((function(t){return r?t.addr===e&&t.protocol===Ce.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,Re([],pe(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,Re([],pe(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-1),n.failed=!0}}}}),Object.defineProperty(t.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(t.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),t}(It);cr=new WeakMap,ar=new WeakSet,sr=function(){return this},ur=function(){this.uuid=ft(),this.retryCount=0};var dr=function(e){return e.replace(/@.+$/,"@")},fr=function(){function e(e,t,r,n,i){void 0===n&&(n=!0),void 0===i&&(i=!0),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return Ee(this,void 0,void 0,(function(){var o;return de(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=a.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o;return Ee(this,void 0,void 0,(function(){var a,s,u,c,l,_,E,d,f,p,R,b,O,C,g,T,h;return de(this,(function(I){switch(I.label){case 0:return a=dr(e),s=this.getNaviCache(a),!t&&s&&(u=s.timestamp,c=s.naviInfo,r||Date.now()-u<ut)?(this.logger.info(D.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(l=i.uuid,_=i.retryCount,E=i.reason,d={bid:xt(),ptc:ze.NAVI,cod:ce.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(o=c.type)&&void 0!==o?o:0,hos:"",cache:$e.LOCAL,v:et.CURRENT,rsn:E,cid:"".concat(l,"_").concat(_),count:_},this.logger.record(Be.IM_NAVI,JSON.stringify(d),n)),[2,vt(c)]):(f=$t.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(D.L_GET_NAVI_T,JSON.stringify({token:e,uris:f}),n),[4,this.requestHandler(f,e,n,i)]);case 1:return p=I.sent(),R=p.code,b=p.data,R===ce.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(O=I.sent())?void 0:O.navi)&&(null==O?void 0:O.navi.length)>0?(C=O.navi,[4,this.requestHandler(C,e,n,i)]):[3,4];case 3:g=I.sent(),R=g.code,b=g.data,I.label=4;case 4:return R!==ce.SUCCESS?(this.logger.warn(D.L_GET_NAVI_R,R,n),[2,Nt(R)]):(T=b).code&&200!==T.code?(this.logger.warn(D.L_GET_NAVI_R,T.code,n),[2,Nt(this.transHttpCode(T.code))]):jt(T).length>0?(this.logger.info(D.L_GET_NAVI_R,JSON.stringify({naviInfo:T}),n),this.setNaviCache(a,T),[2,vt(T)]):(h={server:T.server,backupServer:T.backupServer,serverAddr:T.serverAddr,bs:T.bs},this.logger.warn(D.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(h)),n),[2,Nt(ce.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,_,E;return de(this,(function(d){switch(d.label){case 0:i=0,o=e.length,d.label=1;case 1:return i<o?(a=i===e.length-1,s=this.useV2Navi()?this.httpRequestV2:this.httpRequest,u=Date.now(),[4,s.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(c=d.sent(),l=c.code,_=c.data,E={bid:xt(),ptc:ze.NAVI,cod:l,net:null==n?void 0:n.type,dur:Date.now()-u,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:$e.REQUEST,v:et.CURRENT,rsn:null==n?void 0:n.reason,cid:"".concat(null==n?void 0:n.uuid,"_").concat(null==n?void 0:n.retryCount),count:null==n?void 0:n.retryCount},this.logger.record(Be.IM_NAVI,JSON.stringify(E),r),[ce.SUCCESS,ce.RC_CONN_TOKEN_INCORRECT,ce.RC_LICENSE_EXPIRED].includes(l))return[2,l===ce.SUCCESS?vt(_):Nt(l)];d.label=3;case 3:return i+=1,[3,1];case 4:return[2,Nt(ce.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(e.prototype,"transHttpCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){switch(e){case 401:case 403:return ce.RC_CONN_TOKEN_INCORRECT;case 416:return ce.RC_LICENSE_EXPIRED;default:return ce.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(dr(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(dr(e),_e(_e({},r),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.uri,n=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(n),"&version=").concat("5.20.0-alpha.1","&platfrom=").concat(i);return a&&(s+="&m=".concat(a)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(o,";rtc=4;log=2;iptype=v4,v6")},body:s,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),pr=new Map([["RC:TxtMsg",{isCounted:!0,isPersited:!0}],["RC:ImgMsg",{isCounted:!0,isPersited:!0}],["RC:VcMsg",{isCounted:!0,isPersited:!0}],["RC:ImgTextMsg",{isCounted:!0,isPersited:!0,searchProps:["content","title"]}],["RC:FileMsg",{isCounted:!0,isPersited:!0,searchProps:["name"]}],["RC:HQVCMsg",{isCounted:!0,isPersited:!0}],["RC:LBSMsg",{isCounted:!0,isPersited:!0}],["RC:PSImgTxtMsg",{isCounted:!0,isPersited:!0}],["RC:PSMultiImgTxtMsg",{isCounted:!0,isPersited:!0}],["RCJrmf:RpMsg",{isCounted:!0,isPersited:!0}],["RCJrmf:RpOpendMsg",{isCounted:!0,isPersited:!0}],["RC:CombineMsg",{isCounted:!0,isPersited:!0}],["RC:CombineV2Msg",{isCounted:!0,isPersited:!0}],["RC:ReferenceMsg",{isCounted:!0,isPersited:!0,searchProps:["content"]}],["RC:SightMsg",{isCounted:!0,isPersited:!0}],["RC:GIFMsg",{isCounted:!0,isPersited:!0}],["RC:RLStart",{isCounted:!0,isPersited:!0}],["RC:RLEnd",{isCounted:!0,isPersited:!0}],["RC:StreamMsg",{isCounted:!0,isPersited:!0}],["RC:InfoNtf",{isCounted:!1,isPersited:!0}],["RC:ContactNtf",{isCounted:!1,isPersited:!0}],["RC:ProfileNtf",{isCounted:!1,isPersited:!0}],["RC:CmdNtf",{isCounted:!1,isPersited:!0}],["RC:GrpNtf",{isCounted:!1,isPersited:!0}],["RC:RcNtf",{isCounted:!1,isPersited:!0}],["RC:CmdMsg",{isCounted:!1,isPersited:!1}],["RC:TypSts",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:PSCmd",{isCounted:!1,isPersited:!1}],["RC:SRSMsg",{isCounted:!1,isPersited:!1}],["RC:RcCmd",{isCounted:!1,isPersited:!0}],["RC:RRReqMsg",{isCounted:!1,isPersited:!1}],["RC:RRRspMsg",{isCounted:!1,isPersited:!1}],["RC:CsChaR",{isCounted:!1,isPersited:!1}],["RC:CSCha",{isCounted:!1,isPersited:!1}],["RC:CsEva",{isCounted:!1,isPersited:!1}],["RC:CsContact",{isCounted:!1,isPersited:!1}],["RC:CsHs",{isCounted:!1,isPersited:!1}],["RC:CsHsR",{isCounted:!1,isPersited:!1}],["RC:CsSp",{isCounted:!1,isPersited:!1}],["RC:CsEnd",{isCounted:!1,isPersited:!1}],["RC:CsUpdate",{isCounted:!1,isPersited:!1}],["RC:ReadNtf",{isCounted:!1,isPersited:!1}],["RC:chrmKVNotiMsg",{isCounted:!1,isPersited:!1}],["RC:VCAccept",{isCounted:!1,isPersited:!1}],["RC:VCRinging",{isCounted:!1,isPersited:!1}],["RC:VCSummary",{isCounted:!1,isPersited:!1}],["RC:VCHangup",{isCounted:!1,isPersited:!1}],["RC:VCInvite",{isCounted:!1,isPersited:!1}],["RC:VCModifyMedia",{isCounted:!1,isPersited:!1}],["RC:VCModifyMem",{isCounted:!1,isPersited:!1}],["RC:MsgExMsg",{isCounted:!1,isPersited:!1}],["RC:Delivered",{isCounted:!1,isPersited:!1}],["RC:RRMsg",{isCounted:!1,isPersited:!1}],["RC:LogCmdMsg",{isCounted:!1,isPersited:!1}],["RC:InterceptMsg",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:RLJoin",{isCounted:!1,isPersited:!1}],["RC:RLQuit",{isCounted:!1,isPersited:!1}],["RC:RL",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:CCConfigChangeRequestMsg",{isCounted:!1,isPersited:!1}]]);function Rr(){return Array.from(pr.keys()).map((function(e){return _e({objectName:e},pr.get(e))})).filter((function(e){return!e.isCustom}))}var br,Or,Cr=0,gr=1,Tr=2,hr=3,Ir=4,Sr=5,vr=0;!function(e){e.P_INIT_O="P-init-O",e.P_DB_OPEN_O="P-db_open-O",e.P_DB_UPGRATE_START_S="P-db_upgrate_start-S",e.P_DB_UPGRATING_S="P-db_upgrating-S",e.P_DB_UPGRATE_COMPLETE_S="P-db_upgrate_complete-S",e.P_CALL_MAIN_SYNC_E="P-call_main_sync-E",e.P_CALL_MAIN_E="P-call_main-E",e.P_SEND_2_MAIN_E="P-send_2_main-E",e.P_REGTYP_O="P-regtype-O",e.P_CALL_ADDON_E="P-call_addon-E",e.P_CALL_ADDON_T="P-call_addon-T",e.P_CALL_ADDON_O="P-call_addon-O",e.P_CALL_ADDON_R="P-call_addon-R",e.P_CALL_EXTRA_E="P-call_extra-E",e.P_CONNECT_S="P-connect-S",e.P_CONNECT_T="P-connect-T",e.P_CONNECT_R="P-connect-R",e.P_CONNECT_E="P-connect-E",e.P_CONNECT_ENTRY_S="P-connect_entry-S",e.P_REPORT_VER_O="P-report_version-O",e.P_PARSE_JSON_MSGS_E="P-parse_json_messsages-E",e.P_PARSE_JSON_MSGS_R="P-parse_json_messsages-R",e.P_RECEIVE_MESSAGE_E="P-receive_message-E",e.P_HTTP_REQ_E="P-http_request-E",e.P_SET_MSG_EXTEN_O="P-set_msg_extension-O",e.P_SEND_MSG_T="P-send_msg-T",e.P_SEND_MSG_R="P-send_msg-R",e.P_PARSE_JSON_SUBSCRIBE_DATA_E="P-parse_json_subscribe_data-E",e.P_PARSE_JSON_USER_PROFILE_E="P-parse_json_user_profile-E",e.P_PARSE_JSON_USER_PROFILE_LIST_E="P-parse_json_user_profile_list-E",e.P_WRITE_LOG_O="P_WRITE_LOG_O",e.P_PARSE_JSON_E="P-parse_json-E"}(br||(br={})),function(e){e[e.ERROR=-1]="ERROR",e[e.RESPONSE=0]="RESPONSE",e[e.EVENT=1]="EVENT",e[e.CALLBACK=2]="CALLBACK"}(Or||(Or={}));var Nr=function(e){return{sendError:function(t){e.send({type:Or.ERROR,data:{msg:t}})},sendEvent:function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];e.send({type:Or.EVENT,data:{eventName:t,data:r}})},sendResponse:function(t){e.send({type:Or.RESPONSE,data:t})},sendCallback:function(t){e.send({type:Or.CALLBACK,data:t})}}},Pr=function(e,t,r){return Ee(void 0,void 0,void 0,(function(){var n,i;return de(this,(function(o){return n=d("aes-256-cbc",t,r),i=n.update(e,"base64","utf-8"),[2,i+=n.final("utf8")]}))}))},mr=function(e){if(!p(e)){var t=_(e,"..");p(t)||mr(t),R(e)}},Ar=function(e){return Object.entries(e).map((function(e){var t=pe(e,2),r=t[0],n=t[1];return{key:r,value:String(n)}}))},yr=function(e){return{removeMute:!!(null==e?void 0:e.removeMuteStatus),removeWhiteList:!!(null==e?void 0:e.removeWhiteList),removeFavoriteMembers:!!(null==e?void 0:e.removeFollow)}},Lr=function(){return"undefined"==typeof __dirname?l(C(import.meta.url)):__dirname};function Mr(e){return JSON.parse(e).list.map((function(e){return e.value}))}var Ur=_(Lr(),"binding","electron-".concat(e(),"-").concat(t(),".node")),Dr={addon:null},wr=Nr(process).sendError;try{var Gr=E(import.meta.url);Dr.addon=Gr(Ur)}catch(e){console.error("error ->",Ur,"\n",e),wr(e.toString())}Dr.addon||console.error("error -> cannot find module: ",Ur);var Vr,jr,Fr,kr,Br,Hr=Dr.addon,xr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Vr.add(t),jr.set(t,!0),Fr.set(t,[]),kr.set(t,void 0),t}return M(t,e),Object.defineProperty(t.prototype,"_handleWrite",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;be(this,jr,"f")&&(be(this,Fr,"f").push(e),be(this,kr,"f")||Oe(this,kr,setImmediate((function(){return be(t,Vr,"m",Br).call(t)})),"f"))}}),Object.defineProperty(t.prototype,"recvRendererLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._stdout(e),this._write(e)}}),Object.defineProperty(t.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){Oe(this,jr,!1,"f")}}),t}(rr);jr=new WeakMap,Fr=new WeakMap,kr=new WeakMap,Vr=new WeakSet,Br=function(){if(be(this,kr,"f")&&(clearImmediate(be(this,kr,"f")),Oe(this,kr,null,"f")),be(this,Fr,"f").length){var e=be(this,Fr,"f").splice(0).map((function(e){var t=e.sessionId,r=e.level,n=e.time,i=e.type,o=e.tag,a=e.loggerId,s=e.content,u=e.traceId;return{level:r,time:n,type:i,tag:o,sessionId:"".concat(pt,":").concat(pt===t?"main":t),content:JSON.stringify({loggerId:a,content:s,traceId:u})}})),t=JSON.stringify(e),r=Date.now();Hr.writeLog(t),this.debug(br.P_WRITE_LOG_O,"write ".concat(e.length," logs, cost ").concat(Date.now()-r,"ms, waiting queue len ").concat(be(this,Fr,"f").length))}};var Jr=function(e,t){var r,n=Buffer.from(e),i=n.length;for(t.push(i),r=0;r<i;r++)t.push(n[r])},Wr=function(e){return"string"==typeof e},Yr=function(e){return Wr(e)?e.toUpperCase():""},Kr=function(e,t){var r="";return 2!==e.length?r="Unexpected number of bytes received.":5!==e[0]?r="Unexpected SOCKS version number: ".concat(e[0],"."):255===e[1]?r="No acceptable authentication methods were offered.":-1===t.indexOf(e[1])&&(r="Unexpected SOCKS authentication method: ".concat(e[1],".")),r},Xr=function(e){var t="";return 2!==e.length?t="Unexpected number of bytes received.":1!==e[0]?t="Unexpected authentication method code: ".concat(e[0],"."):0!==e[1]&&(t="Username and password authentication failure: ".concat(e[1],".")),t},Qr=function(e){var t=Yr(e.method)||"GET",r=e.pathname||"/",n=e.headers||{},i=e.search||"";n.Host=e.host||"loclahost";var o="";for(var a in o="".concat(t," ").concat(r+i," HTTP/1.1\n"),n)if(Object.hasOwnProperty.call(n,a)){var s=n[a];o+="".concat(a,": ").concat(s,"\n")}return e.body&&(o+="Content-Length: ".concat(e.body.length,"\n")),o+="\n","POST"===t&&e.body&&(o+="".concat(e.body)),o},Zr=function(e){return new Promise((function(t){var r,n;e.socket.once("data",(function(n){var i,o=Kr(n,r);if(!o)return 2===n[1]?(e.socket.once("data",(function(r){var n=Xr(r);n?e.emit("error",new Error("SOCKS authentication failed. ".concat(n))):t()})),i=[1],Jr(e.socksUsername,i),Jr(e.socksPassword,i),void e.write(Buffer.from(i))):void t();e.emit("error",new Error("SOCKS authentication failed. ".concat(o)))})),r=[0],e.socksUsername&&r.push(2),(n=Buffer.alloc(2+r.length))[0]=5,n[1]=r.length,r.forEach((function(e,t){n[2+t]=e})),e.write(n)}))},qr=function(e,t,r){return new Promise((function(n){var i,o;switch(e.socket.once("data",(function(t){var r;5!==t[0]?r="Unexpected SOCKS version number: ".concat(t[0],"."):0!==t[1]?r="".concat(function(e){switch(e){case 1:return"General SOCKS server failure";case 2:return"Connection not allowed by ruleset";case 3:return"Network unreachable";case 4:return"Host unreachable";case 5:return"Connection refused";case 6:return"TTL expired";case 7:return"Command not supported";case 8:return"Address type not supported";default:return"Unknown status code ".concat(e)}}(t[1]),"."):0!==t[2]&&(r="The reserved byte must be 0x00."),r?e.emit("error",new Error("SOCKS connection failed. ".concat(r))):n()})),(i=[]).push(5),i.push(1),i.push(0),P(t)){case 0:i.push(3),Jr(t,i);break;case 4:i.push(1),function(e,t){var r,n,i=e.split(".");for(r=0;r<4;r++)n=parseInt(i[r],10),t.push(n)}(t,i);break;case 6:e.emit("error",new Error("Does not support IPV6"))}i.length+=2,(o=Buffer.from(i)).writeUInt16BE(r,o.length-2),e.write(o)}))},zr=function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"socket",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksUsername",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksPassword",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"writable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"readable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),r.socket=new m,r.options=t,r.socksHost=t.socksHost||"localhost",r.socksPort=t.socksPort||1080,r.socksUsername=t.socksUsername||"",r.socksPassword=t.socksPassword||"",r.socket.on("error",(function(e){r.emit("error",e)})),r.on("error",(function(){r.socket.destroyed||r.socket.destroy()})),r.on("end",r.end),r}return M(t,e),Object.defineProperty(t.prototype,"ref",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.ref()}}),Object.defineProperty(t.prototype,"unref",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.unref()}}),Object.defineProperty(t.prototype,"setTimeout",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.socket.setTimeout(e,t)}}),Object.defineProperty(t.prototype,"setNoDelay",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.setNoDelay(e)}}),Object.defineProperty(t.prototype,"setKeepAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.socket.setKeepAlive(e,t)}}),Object.defineProperty(t.prototype,"address",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.address()}}),Object.defineProperty(t.prototype,"cork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.cork()}}),Object.defineProperty(t.prototype,"uncork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.uncork()}}),Object.defineProperty(t.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.pause()}}),Object.defineProperty(t.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.resume()}}),Object.defineProperty(t.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.pipe(e)}}),Object.defineProperty(t.prototype,"end",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.socket.end(e,t);return this.writable=this.socket.writable,r}}),Object.defineProperty(t.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.destroy(e)}}),Object.defineProperty(t.prototype,"setEncoding",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.setEncoding(e)}}),Object.defineProperty(t.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this.socket.write(e,t,r)}}),Object.defineProperty(t.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.read(e)}}),Object.defineProperty(t.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if("string"==typeof e&&/^\d+$/.test(e)&&(e=parseInt(e,10)),!Number.isInteger(e)||e<1||e>65535)throw new TypeError("Invalid port: ".concat(e));if(!t||"string"!=typeof t)throw new TypeError("Invalid host: ".concat(t));return this.socket.connect({port:this.socksPort,host:this.socksHost},(function(){return Ee(r,void 0,void 0,(function(){var r;return de(this,(function(n){switch(n.label){case 0:return[4,Zr(this)];case 1:return n.sent(),[4,qr(this,t,e)];case 2:return n.sent(),this.onProxied(),r=Qr(this.options),this.socket.write(Buffer.from(r)),[2]}}))}))})),this}}),Object.defineProperty(t.prototype,"onProxied",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.socket.on("close",(function(t){e.emit("close",t)})),this.socket.on("end",(function(){e.emit("end")})),this.socket.on("data",(function(t){e.emit("data",t)})),this.writable=!0,this.readable=!0,this.emit("connect")}}),t}(A),$r=function(e){var t,r=e.hostname,n=e.port;return!e.host||r&&n||(t=e.host.split(":")),!n&&t&&(n=parseInt(t[1],10)||0),!r&&t&&(r=pe(t,1)[0]),new zr(e).connect(n,r)},en=function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.createConnection=$r,r}return M(t,e),t}(I),tn=function(e,t,r){return(t=_e(_e({},t),g(e))).port||(t.port=80),t.agent=new en(t),h(t,r)},rn=function(e){var t,r;return t=$r(e),r=t.onProxied,t.onProxied=function(){var n;e.socket=t.socket,e.hostname?e.servername=e.hostname:e.host&&(n=pe(e.host.split(":"),1),e.servername=n[0]),t.socket=y(e,(function(){t.authorized=t.socket.authorized,r.call(t)})),t.socket.on("error",(function(e){t.emit("error",e)}))},t},nn=function(e){function t(t,r){var n=e.call(this,r)||this;return Object.defineProperty(n,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n.url=t,n.socksHost=r.socksHost||"localhost",n.socksPort=r.socksPort||1080,n.createConnection=rn,n}return M(t,e),t}(v),on=function(e,t,r,n){var i,o;return t.protocol="https:",!t.port&&t.host&&(i=pe(t.host.split(":"),2),t.port=i[0],t.port=i[1]),t.port||(t.port=443),o=new nn(e,t),t.agent=o,S(e,t,r)},an=null;function sn(e,t,r){void 0===r&&(r=!1);var n=t.url,i=t.headers,o=t.body,a=t.method,s=t.query,u=t.timeout,c=void 0===u?6e4:u;return new Promise((function(t){var u=/^https/.test(n),l={headers:_e(_e({},i),{"Accept-Encoding":"gzip, br"}),method:a};u&&(l.rejectUnauthorized=r);var _=null;an?((l=_e(_e({},l),an)).body=o,_=u?on:tn):(_=h,u&&(l.agent=new v(l),_=S));var E=_(function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e}(n,s),l,(function(e){var r,n,i=e.statusCode,o="";if("gzip"===(null===(r=e.headers)||void 0===r?void 0:r["content-encoding"])){var a=N.createGunzip();e.pipe(a),a.on("data",(function(e){o+=e})),a.on("end",(function(){t({status:i,data:o})}))}else if("br"===(null===(n=e.headers)||void 0===n?void 0:n["content-encoding"])){var s=N.createBrotliDecompress();e.pipe(s),s.on("data",(function(e){o+=e})),s.on("end",(function(){t({status:i,data:o})}))}else e.setEncoding("utf8"),e.on("data",(function(e){o+=e})),e.once("end",(function(){t({status:i||0,data:o})}))}));E.once("timeout",(function(){e.warn(br.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:n,method:a,query:s,timeout:c})),t({status:0})})),E.setTimeout(c),E.once("error",(function(r){e.warn(br.P_HTTP_REQ_E,JSON.stringify({msg:r.stack,url:n,method:a,query:s,timeout:c})),t({status:0})})),E.write(o),E.end()}))}function un(e,t){return e?(an=_e(_e({},an),e),t.info(D.A_SET_PROXY_O,JSON.stringify({msg:"set proxy",data:an})),{code:ce.SUCCESS}):(an=null,t.info(D.A_REMOVE_PROXY_O,JSON.stringify({msg:"remove proxy"})),{code:ce.SUCCESS})}function cn(){var e=an||void 0;return{code:ce.SUCCESS,data:e}}var ln=function(){function e(e,t,r,n){var i=this;Object.defineProperty(this,"p",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"emit",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"callback",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"errorHandle",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"count",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.p.on("message",(function(e){var o=e.type,a=e.data;switch(o){case Or.EVENT:var s=a,u=s.eventName,c=s.data;null==t||t.apply(void 0,Re([u],pe(c),!1));break;case Or.RESPONSE:var l=a,_=l.reqId,E=l.success,d=l.data,f=i.maps[_];if(!f)return;f({success:E,data:d}),delete i.maps[_];break;case Or.CALLBACK:null==r||r(a);break;case Or.ERROR:var p=a.msg;null==n||n(p)}})),this.p.on("error",(function(e){null==n||n("SubProcessProxy error ".concat(e))})),this.p.on("exit",(function(e,t){if(0!==e){for(var r in i.maps){if(Object.prototype.hasOwnProperty.call(i.maps,r))(0,i.maps[r])({success:!0,data:{code:ce.SUB_PROCESS_EXIT,msg:"sub process exit"}})}null==n||n("SubProcessProxy exit ".concat(e," ").concat(t),!0)}})),this.p.on("close",(function(e,t){console.log("SubProcessProxy close",e,t)}))}return Object.defineProperty(e.prototype,"call",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Ee(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return this.p.killed||this.p.exitCode?[2,Promise.resolve({success:!1,data:{code:ce.SUB_PROCESS_EXIT,msg:"sub process exit"}})]:[2,new Promise((function(n){var i=++r.count;r.maps[i]=n;var o={reqId:i,method:e,args:t,hasResponse:!0};r.p.send(o)}))]}))}))}}),Object.defineProperty(e.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return Ee(this,void 0,void 0,(function(){var n;return de(this,(function(i){return(this.p.killed||this.p.exitCode)&&(null===(t=this.errorHandle)||void 0===t||t.call(this,"sub process exit")),n={reqId:-1,method:e,args:r},this.p.send(n),[2]}))}))}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.send("destroy")}}),e}(),_n="rc-realtime-log-timestamp",En=[],dn=!1,fn=function(){return Ee(void 0,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l,_;return de(this,(function(E){return dn||0===En.length||(dn=!0,e=En.shift(),t=e.args,r=e.resolve,n=t.startTime,i=t.endTime,o=t.level,a=t.realtimeReport,s=0,u=0,c=!1,l=[],_=function(e){s+=e.length;var t=pe(e.split(",")),r=t[0],n=t[1],i=t[2],_=t[3],E=t[4],d=t.slice(5),f=parseInt(n,10);if(!((c=c||s>=20971520)&&f>=u)){u=Math.max(u,f);try{if(!a&&o<0)return;var p={time:f,level:parseInt(_,10),sessionId:r,type:i,tag:E,content:d.join(",")};l.push(p)}catch(e){console.error(e)}}},Hr.getFullLog(o,n,i,!1,(function(e){JSON.parse(e).forEach((function(e){return _(e)}))}),(function(e){r(l),dn=!1,fn()}))),[2]}))}))},pn=function(e){function t(t,r,n,i){void 0===i&&(i=!1);var o,a=process.versions.electron,s="Electron|".concat(a,"|").concat(process.arch,"|").concat(process.platform);return o=e.call(this,t,r,s,{getLogs:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){return de(this,(function(i){switch(i.label){case 0:return[4,(o={startTime:e,endTime:t,level:r,realtimeReport:n},Ee(void 0,void 0,void 0,(function(){return de(this,(function(e){return[2,new Promise((function(e){En.push({resolve:e,args:o}),fn()}))]}))})))];case 1:return[2,{logs:i.sent(),dbReady:!0}]}var o}))}))},getTimestamp4RealtimeLog:function(){var e=Hr.getStoreValue(_n);return parseInt(e,10)||0},setTimestamp4RealtimeLog:function(e){Hr.setStoreValue(_n,e.toString())}},n,i)||this,Object.defineProperty(o,"_subProcess",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o}return M(t,e),Object.defineProperty(t.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return sn(this.logger,e)}}),Object.defineProperty(t.prototype,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subProcess&&this._subProcess.destroy(),e.prototype.stop.call(this)}}),Object.defineProperty(t.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t,r,n,i;return de(this,(function(o){switch(o.label){case 0:return this._subProcess||(t=T(_(Lr(),"sub-process.cjs.js"),{stdio:["inherit","inherit","inherit","ipc"]}),this._subProcess=new ln(t)),[4,this._subProcess.call("compressLogs",e)];case 1:return r=o.sent(),n=r.success,i=r.data,n?[2,{success:n,data:i.data}]:[2,{success:n,data:""}]}}))}))}}),t}(nr),Rn=function(){var r,n=Date.now(),i=[t(),e(),process.pid,n,Math.floor(Math.random()*n)].join("__");return r=i,f("md5").update(r).digest("hex")},bn=function(){function e(e){Object.defineProperty(this,"_callCppProxy",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_setTime",{enumerable:!0,configurable:!0,writable:!0,value:15962112e5})}return Object.defineProperty(e.prototype,"_setToProtocol",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){var a=JSON.stringify(i);"{}"!==a&&e.info(br.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:n,ext:i})),this._callCppProxy("setMessageExtension",t,r,n,a,o)}}),Object.defineProperty(e.prototype,"setLocalFromReceiveMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.channelId,n=t.conversationType,i=t.targetId,o=t.messageUId,a=t.expansion,s=t.sentTime;if(a&&0!==Object.keys(a).length){var u={};for(var c in a)u[c]={v:"",ts:0},u[c].v=a[c],u[c].ts=s;this._setToProtocol(e,n,i,o,u,r||"")}}}),Object.defineProperty(e.prototype,"setLocalFromExtMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.channelId,n=t.conversationType,i=t.targetId,o=t.content,a=t.sentTime,s=o,u=s.put,c=this._callCppProxy("getMessage",s.mid),l=JSON.parse(c).extMsg,_=JSON.parse(l||"{}");if(u)for(var E in u){var d=_[E];d&&d.ts<a-this._setTime?(d.v=u[E],d.ts=a-this._setTime):(_[E]={v:"",ts:0},_[E].v=u[E],_[E].ts=a-this._setTime)}s.del&&s.del.forEach((function(e){delete _[e]})),this._setToProtocol(e,n,i,s.mid,_,r||"")}}),Object.defineProperty(e.prototype,"parseReceiveExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e.extMsg||"{}"),r={};for(var n in t)r[n]=t[n].v;return r}}),Object.defineProperty(e.prototype,"parseConverOrHisExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e.extMsg),r=JSON.parse(t||"{}"),n={};for(var i in r)n[i]=r[i].v;return n}}),e}(),On=[Ce.RMTP,Ce.TLS];"darwin"===process.platform&&On.push(Ce.QUIC);var Cn=function(e){return"RongCloud/navis/".concat(e,"/navi-cache.json")},gn=function(e){return"RongCloud/caches/".concat(e,"/staticConfig.json")},Tn=function(e){return"RongCloud/cloudControl/".concat(e,"/cloudControl.json")};function hn(e){var t,n;void 0===e&&(e="IPv4");var i=r(),o=[];try{for(var a=fe(Object.values(i)),s=a.next();!s.done;s=a.next()){var u=s.value;if(u&&-1!==Object.prototype.toString.call(u).indexOf("Array")){var c=u.filter((function(t){return!(t.internal||(r=t.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(r))||t.family&&t.family!==e);var r})).map((function(e){return e.mac}));o.push.apply(o,Re([],pe(c),!1))}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o.length?Re([],pe(o),!1).sort()[0]:""}var In,Sn,vn=function(e){function t(t,r,n,i){var o=e.call(this,t,r,i)||this;Object.defineProperty(o,"naviPath",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(o,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),o.naviPath="".concat(n,"/").concat(Cn(t));var a=l(o.naviPath);return p(a)||mr(a),o}return M(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a,s,u;return de(this,(function(c){switch(c.label){case 0:return i="token=".concat(encodeURIComponent(r),"&v=").concat(ct,"&p=PC&ev=").concat("5.20.0-alpha.1","&m=").concat(hn()),o="".concat(e,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(D.L_REQUEST_T,JSON.stringify({url:o,body:i}),n),[4,sn(this.logger,{method:"POST",headers:{appId:t},body:i,url:o,timeout:1e4})];case 1:if(200!==(a=c.sent()).status)return this.logger.warn(D.L_REQUEST_R,JSON.stringify({url:o,code:a.status}),n),[2,Nt(this.transHttpCode(a.status))];this.logger.info(D.L_REQUEST_R,JSON.stringify({url:o,data:a.data}),n);try{return s=JSON.parse(a.data),u=/^https/.test(o)?"https":"http",s.protocol=u,s.code&&200!==s.code?[2,Nt(this.transHttpCode(s.code))]:[2,vt(s)]}catch(e){return this.logger.error(D.L_PARSE_NAVI_E,a.data,n),[2,Nt(ce.RC_NAVI_REQ_FAILED)]}return[2]}}))}))}}),Object.defineProperty(t.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a,s;return de(this,(function(u){switch(u.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:"electron",protocol:On.join(","),mac:hn()}),this.logger.info(D.L_REQUEST_T,JSON.stringify({url:i.url,body:i.body,headers:i.headers}),n),[4,sn(this.logger,i)];case 1:if(200!==(o=u.sent()).status)return this.logger.warn(D.L_REQUEST_R,JSON.stringify({url:i.url,code:o.status}),n),[2,Nt(this.transHttpCode(o.status))];this.logger.info(D.L_REQUEST_R,JSON.stringify({url:i.url,data:o.data}),n);try{return a=JSON.parse(o.data),s=/^https/.test(i.url)?"https":"http",a.protocol=s,[2,vt(a)]}catch(e){return this.logger.error(D.L_PARSE_NAVI_E,o.data,n),[2,Nt(ce.RC_NAVI_REQ_FAILED)]}return[2]}}))}))}}),Object.defineProperty(t.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getCatchKey(e),r=this._caches[t];if(r)return r;if(!p(this.naviPath))return null;var n=b(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(n),this._caches[t]}catch(e){this.logger.error(D.L_PARSE_NAVI_E,n)}return null}}),Object.defineProperty(t.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Date.now(),n=this.getCatchKey(e);if(Dt(this._caches))for(var i in this._caches){(r-this._caches[i].timestamp>ut||n===i)&&delete this._caches[i]}this._caches[n]={token:e,naviInfo:t,timestamp:Date.now(),environment:this._environment},O(this.naviPath,JSON.stringify(this._caches))}}),Object.defineProperty(t.prototype,"setEnvironment",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._environment=e}}),t}(fr);function Nn(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];var o,a=e.createTraceId();e.debug(br.P_CALL_ADDON_T,JSON.stringify({method:r,params:n}),a);try{o=Hr[r].apply(Hr,Re([],pe(n),!1))}catch(t){throw e.error(br.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:r}),a),t}return e.debug(br.P_CALL_ADDON_R,JSON.stringify({method:r,params:n,result:t?o:void 0}),a),o}var Pn,mn,An,yn,Ln=function(){function e(e,t,r){var n=this;In.add(this),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_method",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_traceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._traceId=null!=r?r:this._logger.createTraceId(),this._promise=new Promise((function(e){n._resolve=e}))}return Object.defineProperty(e,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r,n)}}),Object.defineProperty(e.prototype,"invoke",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=be(this,In,"m",Sn)).call.apply(e,Re([this,!0],pe(t),!1))}}),Object.defineProperty(e.prototype,"asyncInvoke",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=be(this,In,"m",Sn)).call.apply(e,Re([this,!1],pe(t),!1))}}),Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.debug(br.P_CALL_ADDON_R,"success",this._traceId),this._flush(vt(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.warn(br.P_CALL_ADDON_R,"faile: ".concat(e),this._traceId),this._flush(Nt(e,"",t))}}),Object.defineProperty(e.prototype,"_flush",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;setImmediate((function(){return t._resolve(e)}))}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),e}();In=new WeakSet,Sn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=this,o=i._method,a=i._traceId,s=i._logger;s.debug(br.P_CALL_ADDON_T,JSON.stringify({method:o,params:r}),a);try{t=Hr[o].apply(Hr,Re([],pe(r),!1))}catch(e){throw s.error(br.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:o}),a),e}return e&&t!==ce.SUCCESS&&this.fail(t),this},function(e){e[e.SUCCESS=0]="SUCCESS",e[e.NOT_INIT=-1]="NOT_INIT",e[e.CANCELED=-2]="CANCELED",e[e.REPEAT=-3]="REPEAT"}(yn||(yn={}));var Mn=function(e){function t(t,r,n,i){var o=e.call(this,t,n,i)||this;return Pn.add(o),Object.defineProperty(o,"callCppProxy",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"_naviInfo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(o,"_excludeLogTag",{enumerable:!0,configurable:!0,writable:!0,value:["P-API_RCGetValueForKey-T","P-API_RCGetValueForKey-E","P-API_RCGetValueForKey-R","P-API_RCSetValueForKey-T","P-API_RCSetValueForKey-E","P-API_RCSetValueForKey-R"]}),Object.defineProperty(o,"_connectingTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(o,"_tcpDuration",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),o.callCppProxy("setConnectionStatusListener",be(o,Pn,"m",mn).bind(o),(function(e){return o.logger.info(br.P_DB_OPEN_O,e)}),(function(){return o.recvPong(ce.SUCCESS)}),be(o,Pn,"m",An).bind(o),o._onTcpConnectResponse.bind(o),(function(){o.logger.info(br.P_DB_UPGRATE_START_S),o.emit("onDBUpgrateStart")}),(function(e){o.logger.info(br.P_DB_UPGRATING_S,e),o.emit("onDBUpgrading",e)}),(function(e){o.logger.info(br.P_DB_UPGRATE_COMPLETE_S,e),o.emit("onDBUpgradeComplete",e)})),o}return M(t,e),Object.defineProperty(t.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(t.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,_,E,d,f,p,R,b,O=this;return de(this,(function(C){switch(C.label){case 0:return i=this._connectingTask=Ln.create(this.logger,"connectWithToken",n),this._naviInfo=t,o={},(a=cn().data)&&(o={proxy_passwd:a.socksPassword||"",proxy_name:a.socksUsername||"",proxy_port:a.socksPort||1082,proxy_host:a.socksHost||"localhost",proxy_type:0}),s=JSON.stringify(_e(_e({},o),{call_plus:this._openCallPlus,cid:this.cid})),u=this.getCmpList(t,!0).filter((function(e){return On.includes(e.protocol)})).sort((function(e,t){return t.weight-e.weight})),c=[],u.forEach((function(e){var t=c.find((function(t){return t.addr===e.addr}));t?t.protocol!==Ce.QUIC&&e.protocol!==Ce.QUIC||(t.race=!0,t.protocol=Ce.QUIC):(e.race=!1,c.push(e))})),this.logger.info(br.P_CONNECT_T,JSON.stringify({}),n),l=Date.now(),[4,i.asyncInvoke(e,ct,JSON.stringify(_e(_e({},t),{serverAddr:c,tagBlacklist:this._excludeLogTag.join(",")})),r,s).result()];case 1:return _=C.sent(),this.logger.summary(br.P_CONNECT_R,_,n,{data:_.data}),E=JSON.parse(_.data),d=E.cid,f=E.userId,p=E.sessionId,R=Date.now()-(l+this._tcpDuration),b={bid:xt(),cod:_.code,net:this.getNetwork().type,dur:R,spr:0,cid:d,v:et.CURRENT,count:this.retryCount,sts:Date.now(),ssid:p},this.logger.record(Be.IM_CMP_RMTP,JSON.stringify(b)),this._connectingTask=null,[2,_.trans((function(e){return O._connectedTime=Date.now()-O.callCppProxy("getDeltaTime"),f}))]}}))}))}}),Object.defineProperty(t.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){return de(this,(function(n){return e||this.callCppProxy("disconnect","boolean"!=typeof t||t,!!r),[2]}))}))}}),Object.defineProperty(t.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t.pingResolve=r,t.callCppProxy("sendHeartbeat"),setTimeout((function(){return t.recvPong(ce.TIMEOUT)}),e)}))}}),Object.defineProperty(t.prototype,"recvPong",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.pingResolve&&(this.pingResolve(e),this.pingResolve=null)}}),Object.defineProperty(t.prototype,"recvConnectRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){t?this.onDisconnectByServer(e,r):e===ce.RC_SOCKET_DISCONNECTED&&this.getConnectionStatus()!==Ge.CONNECTED||this.onDisconenctUnusual(e)}}),Object.defineProperty(t.prototype,"_onTcpConnectResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){var s,u=this.cmpWeightCache.findIndex((function(e){return e.addr==="".concat(t,":").concat(r)})),c={bid:xt(),ptc:ze.TCP,cod:e,net:this.getNetwork().type,dur:n,spr:0,pr:(null===(s=this._naviInfo)||void 0===s?void 0:s.type)||0,hos:"".concat(t,":").concat(r),idx:u,rct:this.retryCount?tt.RECONNECT:tt.CONNECT,cid:this.cid,v:et.CURRENT,rsn:this._doConnectReason,ddu:i,count:this.retryCount,weight:u>=0?this.cmpWeightCache[u].weight:-1};if(this.logger.record(Be.IM_CMP,JSON.stringify(c)),this.logger.info(br.P_CONNECT_ENTRY_S,JSON.stringify({code:e,host:t,port:r,duration:n,dnsDuration:i,index:o,isQuic:a})),e===yn.SUCCESS)this.curCmpUrl="".concat(t,":").concat(r),this.updateCmpWeight("".concat(t,":").concat(r),!0,a);else if(e!==yn.NOT_INIT){var l=r&&0!==r?"".concat(t,":").concat(r):"".concat(t);this.updateCmpWeight(l,!1)}}}),t}(Er);Pn=new WeakSet,mn=function(e,t){10!==e&&(this._connectingTask?e===ce.SUCCESS?this._connectingTask.ok(t):this._connectingTask.fail(e,t):this.logger.warn(br.P_CONNECT_E,JSON.stringify({msg:"connect complete but no connecting task"})))},An=function(e,t){switch(this.logger.info(br.P_CONNECT_S,JSON.stringify({status:e,delay:t})),e){case ce.RC_CONN_REDIRECTED:case 32061:this.recvConnectRes(ce.RC_CONN_REDIRECTED,!0);break;case 11:case 10:case 12:break;case ce.RC_SOCKET_DISCONNECTED:case ce.RC_SOCKET_NOT_CREATED:case ce.RC_CONN_ACK_TIMEOUT:case ce.RC_TCP_RESET:this.recvConnectRes(e,!1);break;case ce.RC_UDP_DISCONNECTED:this.recvConnectRes(e,!0,t);break;default:this.recvConnectRes(e,!0)}};var Un,Dn,wn,Gn,Vn,jn,Fn,kn,Bn,Hn,xn,Jn,Wn=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"dbpath",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_cachePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),i._cachePath="".concat(n,"/").concat(gn(t));var o=l(i._cachePath);return p(o)||mr(o),i}return M(t,e),Object.defineProperty(t.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return p(this._cachePath)&&b(this._cachePath,{encoding:"utf8"})||null}}),Object.defineProperty(t.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){O(this._cachePath,e)}}),Object.defineProperty(t.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){O(this._cachePath,"")}}),Object.defineProperty(t.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t,r,n;return de(this,(function(i){switch(i.label){case 0:return[4,sn(this.logger,{url:e,body:""})];case 1:return t=i.sent(),r=t.status,n=t.data,[2,{code:r,data:n}]}}))}))}}),Object.defineProperty(t.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t,r;return de(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Pr(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(D.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),t}(er),Yn=function(e){function t(t,r,n,i,o){var a=e.call(this,r,t,n)||this;Object.defineProperty(a,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"model",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(a,"catchFilePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),a.model="Electron|".concat(process.platform,"|").concat(process.arch),a.catchFilePath="".concat(o,"/").concat(Tn(t));var s=l(a.catchFilePath);return p(s)||mr(s),a.init(),a}return M(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,_;return de(this,(function(E){switch(E.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},this.logger.info(D.L_REQUEST_T,JSON.stringify(o)),[4,sn(this.logger,o)];case 1:a=E.sent(),s=a.status,u=a.data,c=void 0===u?"":u,this.logger.info(D.L_REQUEST_R,JSON.stringify({status:s,data:c}));try{return l=JSON.parse(c),_=l.data,[2,{code:s,data:_}]}catch(e){return this.logger.warn(D.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:s,data:c,error:e})),[2,{code:s,msg:e}]}return[2]}}))}))}}),Object.defineProperty(t.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){O(this.catchFilePath,JSON.stringify(e)),this.logger.info(D.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(t.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!p(this.catchFilePath))return null;var e=b(this.catchFilePath,{encoding:"utf8"});return this.logger.info(D.L_CLOUD_GET_CACHE_O,JSON.stringify({appkey:this.appkey,data:e})),e}}),Object.defineProperty(t.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={mrtrChatroom:e.chatroom,mrtrGroup:e.group,mrtrPrivate:e.private,mrtrUltraGroup:e.ultraGroup};this.logger.info(D.L_CLOUD_SET_MRTR_O,JSON.stringify(t)),Hr.setCloudConfig(JSON.stringify(t))}}),t}(lr);!function(e){e[e.cuid=1]="cuid",e[e.uid=2]="uid",e[e.all=4]="all"}(Jn||(Jn={}));var Kn,Xn,Qn=function(){function l(e,t,r,n,i,o,a){var s=this;Un.add(this),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_dbpath",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_dispatchEvent",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_enableSyncEmptyTopConversation",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logOutputLevel",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_customMessageType",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_msgExpansionHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tcpMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"cloudControllerLock",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"cloudControllerMsgs",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_buildSubscribeEventData",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=[];try{JSON.parse(e).list.forEach((function(e){var r=JSON.parse(e.obj),n=r.userId,i=r.subscribeType,o=r.subscribeTime,a=r.duration,u=r.operationType,c=r.details,l=void 0===c?[]:c,_=r.userProfile,E={userId:n,subscribeType:i,subscribeTime:o,expiry:a,operationType:u};[Ue.ONLINE_STATUS,Ue.FRIEND_ONLINE_STATUS].includes(i)&&(E.details=l.map((function(e){var t=JSON.parse(e);return{changeTime:t.changeTime,eventValue:t.changeValue,platform:t.platform}}))),[Ue.USER_PROFILE,Ue.FRIEND_USER_PROFILE].includes(i)&&(E.userProfile=s._string2userProfileInfo(_)),t.push(E)}))}catch(t){s.logger.error(br.P_PARSE_JSON_SUBSCRIBE_DATA_E,JSON.stringify({error:null==t?void 0:t.stack,data:e}))}return t}}),Object.defineProperty(this,"_chatroomCache",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"rtcHeartbeatResolves",{enumerable:!0,configurable:!0,writable:!0,value:{}});var u=this._dbpath,c=this._deviceId=Rn();this.logger=new xr(this._appkey,"RC-M","IM"),Hr.initWithAppkey(e,u,ct,this.logger.getSessionId()),Hr.setConsoleLogLevel((this._logOutputLevel||qt.WARN)+1),this.logger.setOutputLevel(this._logOutputLevel),this.reporter=new pn(e,c,this.logger,o),this.logger.info(br.P_INIT_O,JSON.stringify({appkey:e,dbpath:u,proto_commit:Hr.getNodeVersion(),deviceId:c,commit:"657448b1e27468d896c045d2094f87014f72838b",processName:process.title,processPId:process.pid,disableLogReport:o,eventLoopBlockingCheck:a})),a&&ir.start(this.logger),this._callCppProxy("setDeviceId",c),this._staticConfigManager=new Wn(e,this.logger,u),this.navi=new vn(e,this.logger,u,this._staticConfigManager),this.tcpMgr=new Mn(e,this._callCppProxy.bind(this),this.navi,this.logger),this.tcpMgr.on("onConnected",this.onConnected,this),this.tcpMgr.on("onSuspend",this.onSuspend,this),this.tcpMgr.on("onDisconnected",this.onDisconnected,this),this.tcpMgr.on("onConnecting",this.onConnecting,this),this.tcpMgr.on("onDBUpgrateStart",this.dbUpgradeStart,this),this.tcpMgr.on("onDBUpgrading",this.dbUpgrading,this),this.tcpMgr.on("onDBUpgradeComplete",this.dbUpgradeComplete,this),this._enableCreateEmptyTopConversation(this._enableSyncEmptyTopConversation),this._initCloudController(c,u),this._registerBuildinMessageTypes(),this._setOnReceiveMessageListener(),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),Hr.setReadReceiptListener((function(e,t){var r=JSON.parse(e),n=JSON.parse(t).map((function(e){return JSON.parse(e)})).map((function(e){return{identifier:{conversationType:r.type,targetId:r.targetId,channelId:r.channelId},messageUId:e.msgUid,users:e.readUsers.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:e.mentioned}})),readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.unreadCount}}));s._dispatchEvent("readReceiptResponseV5",n)})),this._msgExpansionHandler=new bn(this._callCppProxy.bind(this))}return Object.defineProperty(l.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;r=pe($t.getCloudControllerUrl(),1),this.cloudControllerUri=r[0],this.cloudController=new Yn(this._appkey,this.logger,this.reporter,e,t),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,tr.init)}}),Object.defineProperty(l.prototype,"callProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Ee(this,void 0,void 0,(function(){var r,n,i;return de(this,(function(o){switch(o.label){case 0:if(!(r=this[e]))return this.logger.warn(br.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),[2,Promise.resolve({code:ce.NOT_SUPPORT})];n="",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.call.apply(r,Re([this],pe(t),!1))];case 2:return[2,o.sent()];case 3:return i=o.sent(),n=JSON.stringify({error:null==i?void 0:i.stack,method:e}),this.logger.error(br.P_CALL_MAIN_E,n),[3,4];case 4:return[2,{code:ce.MAIN_PROCESS_ERROR,msg:n}]}}))}))}}),Object.defineProperty(l.prototype,"sendProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Ee(this,void 0,void 0,(function(){var r;return de(this,(function(n){if(!(r=this[e]))return this.logger.warn(br.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),[2];try{r.call.apply(r,Re([this],pe(t),!1))}catch(t){this.logger.error(br.P_CALL_MAIN_E,JSON.stringify({error:null==t?void 0:t.stack,method:e}))}return[2]}))}))}}),Object.defineProperty(l.prototype,"registerRenderers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.navigators,r=e.areaCode,n=e.logServerUrl,i=e.environment;this._environment=i||"default",this.navi.setEnvironment(i),$t.init({areaCode:r,navigators:t,logServerUrl:n})}}),Object.defineProperty(l.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){var e,t,r;return de(this,(function(n){switch(n.label){case 0:return e=this.getNaviInfoFromCache(),this.reporter.checkStart(e,""),this._try2RejoinChatroom(),t=this._dispatchEvent,r=["onConnected"],[4,this.getMainProcessCache()];case 1:return t.apply(this,r.concat([n.sent()])),[2]}}))}))}}),Object.defineProperty(l.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._dispatchEvent("onConnecting",void 0)}}),Object.defineProperty(l.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("onSuspend",t)}}),Object.defineProperty(l.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("onDisconnected",t)}}),Object.defineProperty(l.prototype,"dbUpgradeStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._dispatchEvent("databaseUpgradeWillStart")}}),Object.defineProperty(l.prototype,"dbUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgrading",t)}}),Object.defineProperty(l.prototype,"dbUpgradeComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgradeDidComplete",t)}}),Object.defineProperty(l.prototype,"_callCppProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.logger.createTraceId();try{return this.logger.debug(br.P_CALL_ADDON_O,JSON.stringify({method:e,content:t}),n),Hr[e].apply(Hr,Re([],pe(t),!1))}catch(t){throw this.logger.error(br.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:e}),n),t}}}),Object.defineProperty(l.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(l.prototype,"sendHTTPRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return sn(this.logger,e)}}),Object.defineProperty(l.prototype,"onReceiveRendererLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.recvRendererLog(e)}}),Object.defineProperty(l.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.tcpMgr.setNetwork(e,t),e.status&&this.cloudController){var r=this.tcpMgr.getToken();this.cloudController.request(this.cloudControllerUri,tr.newWorkChange,r)}}}),Object.defineProperty(l.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){ir.stop(),this.reporter.stop(),this.logger.destroy(),Hr.destroy(),process.exit(0)}}),Object.defineProperty(l.prototype,"callExtra",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this[e];if(!n)return this.logger.warn(br.P_CALL_EXTRA_E,JSON.stringify({method:e,error:"not found"})),Promise.resolve({code:ce.NOT_SUPPORT});try{return n.call.apply(n,Re([this],pe(t),!1))}catch(t){this.logger.error(br.P_CALL_EXTRA_E,JSON.stringify({error:null==t?void 0:t.stack,method:e}))}return Promise.resolve({code:ce.MAIN_PROCESS_ERROR})}}),Object.defineProperty(l.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){var s=0===o,u=n+1,c=this._callCppProxy("getHistoryMessagesByObjectNames",e,t,r,u,i,s,a||""),l=[];try{var _=JSON.parse(c).list;_.reverse();for(var E=0;E<_.length;E++){var d=this._buildMessage(_[E].obj);l[E]=d}}catch(e){return Promise.resolve({code:ce.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ce.SUCCESS,data:{list:u===l.length?l.slice(1,u):l,hasMore:n<l.length}})}}),Object.defineProperty(l.prototype,"updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this._callCppProxy("updateMessageReceiptStatus",e,t,r,n||"");return Promise.resolve({code:ce.SUCCESS,data:i})}}),Object.defineProperty(l.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectionStatus()!==Ge.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())}}),Object.defineProperty(l.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectedTime()}}),Object.defineProperty(l.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-Hr.getDeltaTime()}}),Object.defineProperty(l.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getCurrentUserId()}}),Object.defineProperty(l.prototype,"getMainProcessCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.tcpMgr.getConnectedTime(),t=this.tcpMgr.getConnectionStatus(),r=this.getNaviInfoFromCache(),n=this.tcpMgr.getCurrentUserId(),i=this.getDeviceId(),o=Hr.getDeltaTime();return Promise.resolve({connectedTime:e,deviceId:i,crtUserId:n,naviInfo:r,connectionStatus:t,deltaTime:o})}}),Object.defineProperty(l.prototype,"_enableCreateEmptyTopConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._callCppProxy("enableCreateEmptyTopConversation",e)}}),Object.defineProperty(l.prototype,"_registerBuildinMessageTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Rr().forEach((function(t){e.registerMessageType(t.objectName,t)}))}}),Object.defineProperty(l.prototype,"_buildIsMentioned",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=!1;if(Lt(e))r=e;else try{r=e?JSON.parse(e):e}catch(t){r=e,this.logger.error(br.P_PARSE_JSON_MSGS_E,JSON.stringify({content:e}))}return Lt(r)&&(n=!!r.mentionedInfo),{isMentioned:n,msgContent:r}}}),Object.defineProperty(l.prototype,"_buildMsgOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return function(e){return pr.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}(e)}}),Object.defineProperty(l.prototype,"_buildSupportExt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=null;return e&&(n=this._msgExpansionHandler.parseReceiveExpansion(r),"conversation"!==t&&"history"!==t||(n=this._msgExpansionHandler.parseConverOrHisExpansion(r))),n}}),Object.defineProperty(l.prototype,"_handleReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e),r=this.getNaviInfoFromCache();if(!(null==r?void 0:r.grpRRVer))return t;var n=t,i=n.hasRespond,o=n.readerInfo,a=void 0===o?{}:o,s=n.readCount,u=n.totalCount,c=n.readerList,l=void 0===c?[]:c,_={readCount:s,totalCount:u};if(1===(null==r?void 0:r.grpRRVer)){var E=[];for(var d in a)E.push({userId:d,readTime:a[d]});_.readerList=E,_.hasRespond=i}return 3===(null==r?void 0:r.grpRRVer)&&(_.readerList=l),_}}),Object.defineProperty(l.prototype,"_buildMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t={});var r=JSON.parse(e);return be(this,Un,"m",Dn).call(this,r,t)}}),Object.defineProperty(l.prototype,"_compatibleReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ze.UNREAD;return e.isRead?t=Ze.READ:e.isListened?t=Ze.LISTENED:e.isDownload?t=Ze.DOWNLOADED:e.isRetrieved&&(t=Ze.RETRIEVED),t}}),Object.defineProperty(l.prototype,"_updateReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._callCppProxy("getMessage",e),n=JSON.parse(r),i=n.readReceiptRequest?JSON.parse(n.readReceiptRequest):{},o=_e(_e({},i),t);this._callCppProxy("updateReadReceiptRequestInfo",e,JSON.stringify(o))}}),Object.defineProperty(l.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,o,a;if(t!==this.getCurrentUserId()){var s=e[this.getCurrentUserId()]||[];try{for(var u=fe(s),c=u.next();!c.done;c=u.next()){g=c.value;var l=this._callCppProxy("getMessage",g),_=JSON.parse(l),E=_.readReceiptRequest?JSON.parse(_.readReceiptRequest):{},d=E.isReceiptRequestMessage,f=E.readerList,p=void 0===f?[]:f;d&&!p.includes(t)&&(p.push(t),this._callCppProxy("updateReadReceiptRequestInfo",g,JSON.stringify({isReceiptRequestMessage:d,readerList:p})))}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}}else for(var R in e){var b=e[R];try{for(var O=(n=void 0,fe(b)),C=O.next();!C.done;C=O.next()){var g=C.value;this._callCppProxy("updateReadReceiptRequestInfo",g,JSON.stringify({isReceiptRequestMessage:!0,hasRespond:!0}))}}catch(e){n={error:e}}finally{try{C&&!C.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}}}),Object.defineProperty(l.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.content,i=e.channelId,o=n.msgId,a=n.rrn,s=n.tmn,u=n.endMsgTime;t===le.PRIVATE?this.updateMessageReceiptStatus(t,r,u,i||""):this._updateReadReceiptInfo(o,{readCount:a,totalCount:s});var c={conversationType:t,targetId:r,channelId:i};this._sendMessageReadReceipt(t===le.PRIVATE?{privateReadReceipt:_e(_e({},c),{endMsgTime:n.endMsgTime})}:{groupReadReceipt:_e(_e({},c),{totalCount:n.tmn,readedCount:n.rrn,messageUId:n.msgId})})}}),Object.defineProperty(l.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviInfoFromCache(),r=e.conversationType,n=e.targetId,i=e.content,o=e.channelId,a=e.senderUserId,s=e.sentTime;return a===this.tcpMgr.getCurrentUserId()&&(1!==(null==t?void 0:t.sesDriven)||(s>this.tcpMgr.getConnectedTime()||this._sendsyncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i.lastMessageSendTime}),!1))}}),Object.defineProperty(l.prototype,"_buildConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e);return be(this,Un,"m",wn).call(this,t)}}),Object.defineProperty(l.prototype,"_convertResultList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=JSON.parse(e).list;return r=r.map((function(e){var r=JSON.parse(e.obj);return t?t(r):r}))}}),Object.defineProperty(l.prototype,"_handleNotNotificationMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.messageType,n=e.senderUserId,i=e.content;if(r===he.LOG_COMMAND&&e.senderUserId===lt){var o=e.content,a=o.startTime,s=o.endTime,u=o.platform,c=o.logId,l=o.uri;return this.reporter.report(parseInt(a,10),parseInt(s,10),u,l,c,e.messageUId),!0}if(r===he.CLOUD_CONTROL&&n===lt)return this.cloudControllerMsgs.push(e),this._ccMsgHandler(),!0;if(r===he.READ_STATE)return this._processRSMsg(e),!0;if("RC:MsgExMsg"===r)return this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e),this._sendMessageExpansion(e),!0;if(r===he.SYNC_READ_STATUS&&!this._processSRSMsg(e))return!0;if(r===he.DELIVERED)return this._callCppProxy("setMessageDeliverTime",JSON.stringify(i)),this._sendMessageDelivered(e.content.map((function(e){return{deliverTime:e.time,messageUId:e.messageUId,objectName:e.objectName,targetId:e.targetId}}))),!0;if(r===he.DELIVERED_MSG){var _={totalCount:e.content.tmn,list:null===(t=e.content.dl)||void 0===t?void 0:t.map((function(e){return{MessageUId:e.msgId,deliveryCount:e.drn}}))};return this._sendGroupMessageDeliveredStatus(_),!0}return!1}}),Object.defineProperty(l.prototype,"_setOnReceiveMessageListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setOnReceiveMessageListener((function(t,r,n,i){try{var o=e._buildMessage(t,{isOffLineMessage:n}),a=o.messageType,s=o.channelId,u=void 0===s?"":s,c=o.senderUserId,l=o.content,_=o.sentTime,E=o.conversationType,d=o.targetId;if(e._handleNotNotificationMessage(o))return;if(a===he.READ_RECEIPT_REQUEST&&l.messageUId&&e._updateReadReceiptInfo(l.messageUId,{isReceiptRequestMessage:!0,hasRespond:!1}),a===he.READ_RECEIPT_RESPONSE&&l.receiptMessageDic&&e._processRRRspMsg(l.receiptMessageDic,c,_),a===he.GROUP_READ_RECEIPT_REQUEST){var f=l.msgId,p=l.rrn,R=l.tmn;e._updateReadReceiptInfo(f,{readCount:p,totalCount:R})}o.canIncludeExpansion&&e._msgExpansionHandler.setLocalFromReceiveMsg(e.logger,o),a===he.READ_RECEIPT&&c===e.tcpMgr.getCurrentUserId()&&e._callCppProxy("clearUnreadCountByTimestamp",E,d,l.lastMessageSendTime,u);var b=!0;if(0!==r||i||(b=!1),a===he.RECALL_NOTIFICATION_MESSAGE)return;if(a===he.RECALL){if(!be(e,Un,"m",Vn).call(e,o))return;var O=e._fixRecallContentInfo(o);E=O.conversationType,d=O.targetId}e._sendMessageNotification(Object.assign(o,{hasMoreMsg:b,conversationType:E,targetId:d}))}catch(r){e.logger.error(br.P_RECEIVE_MESSAGE_E,JSON.stringify({error:null==r?void 0:r.stack,message:t}))}}),(function(){e._sendPullOfflineFinished()}))}}),Object.defineProperty(l.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return Ee(this,void 0,void 0,(function(){var t,r;return de(this,(function(n){switch(n.label){case 0:return this.cloudControllerLock?(this.cloudControllerLock=!1,this.cloudControllerMsgs.shift()?(t=this.tcpMgr.getToken(),[4,null===(e=this.cloudController)||void 0===e?void 0:e.request(this.cloudControllerUri,tr.other,t)]):[3,2]):[2];case 1:r=n.sent()||0,this.cloudControllerMsgs=this.cloudControllerMsgs.filter((function(e){return e.sentTime>r})),this.cloudControllerLock=!0,this._ccMsgHandler(),n.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(l.prototype,"_fixRecallContentInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId;return e.senderUserId===this.tcpMgr.getCurrentUserId()&&(t=e.content.conversationType||t,r=e.content.targetId||r),{conversationType:t,targetId:r}}}),Object.defineProperty(l.prototype,"_sendMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.channelId,r=void 0===t?"":t,n=e.content,i=e.conversationType,o=e.targetId,a=n,s=a.put,u=a.del,c=a.mid,l={};s&&(l.updatedExpansion={channelId:r,messageUId:c,expansion:s,conversationType:i,targetId:o}),u&&(l.deletedExpansion={channelId:r,messageUId:c,deletedKeys:u,conversationType:i,targetId:o}),this._dispatchEvent("expansion",l)}}),Object.defineProperty(l.prototype,"_sendMessageNotification",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("batchMessage",e)}}),Object.defineProperty(l.prototype,"_sendPullOfflineFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._dispatchEvent("pullFinished",null)}}),Object.defineProperty(l.prototype,"_sendMessageDelivered",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("messageDelivered",e)}}),Object.defineProperty(l.prototype,"_sendGroupMessageDeliveredStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("groupMessageDeliveredStatus",e)}}),Object.defineProperty(l.prototype,"_sendChatroomStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("chatroom",e)}}),Object.defineProperty(l.prototype,"_sendMessageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("messageReadReceipt",e)}}),Object.defineProperty(l.prototype,"_sendsyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("syncReadStatus",e)}}),Object.defineProperty(l.prototype,"_setConversationStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setConversationStatusListener((function(t){var r=JSON.parse(t).list.map((function(e){var t=JSON.parse(e.obj),r={channelId:t.channelId,conversationType:t.conversationType,targetId:t.targetId,updatedItems:{}};return t.status.forEach((function(e){var t=JSON.parse(e.item),n=t.type,i=t.value;if(1===n){var o=Number(i)||He.NOT_SET;r.updatedItems.notificationLevel={val:o,time:0},r.updatedItems.notificationStatus={val:st(o),time:0}}else 2===n&&(r.updatedItems.isTop={val:"1"===i,time:0})})),r}));e._dispatchEvent("conversation",r)}),(function(t){e._dispatchEvent("conversationTag",t)}),(function(t,r,n,i){e._callCppProxy("clearUnreadCountByTimestamp",t,r,i,n||""),e._sendsyncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i})}))}}),Object.defineProperty(l.prototype,"_setPushNotificationListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setPushNotificationListener((function(){}),(function(t){e._dispatchEvent("tag",t),e._getRTCProfile()}))}}),Object.defineProperty(l.prototype,"_getRTCProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callCppProxy("getRTCProfile");if(e){var t=this.tcpMgr.getToken();this.navi.updateVoipCallInfo(t,e);var r=this.navi.getNaviInfoFromCache(t);this._dispatchEvent("onNaviDataChange",r)}}}),Object.defineProperty(l.prototype,"_setRTCLivingRoomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setRTCRoomEventListener((function(t){e._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(t))}))}}),Object.defineProperty(l.prototype,"_setChatroomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setChatroomEventListener((function(t,r){e._sendChatroomStatus({chatroomDestroyed:t})}))}}),Object.defineProperty(l.prototype,"_setCallInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setCallInfoListener((function(t){var r=[];try{JSON.parse(t).list.forEach((function(e){Object.entries(e).forEach((function(e){var t=pe(e,2),n=t[0],i=t[1];r.push({key:n,value:i})}))}))}catch(t){e.logger.error(br.P_PARSE_JSON_E,JSON.stringify({error:t}))}e._dispatchEvent("callInfo",JSON.stringify({list:r}))}))}}),Object.defineProperty(l.prototype,"_setSubscribeEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setSubscribeEventListener((function(){}),(function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)}),(function(t){var r=e._buildSubscribeEventData(t).map((function(e){return{userId:e.userId,subscribeType:e.subscribeType,subscribeTime:e.subscribeTime,expiry:e.expiry,operationType:e.operationType}}));e._dispatchEvent("subscribedRelationChange",r)}),(function(t){var r=e._buildSubscribeEventData(t).map((function(e){var t=e.userId,r=e.subscribeType,n=e.subscribeTime,i=e.expiry,o=e.details,a=e.userProfile,s={userId:t,subscribeType:r,subscribeTime:n,expiry:i};return[Ue.ONLINE_STATUS,Ue.FRIEND_ONLINE_STATUS].includes(r)?s.details=o:[Ue.USER_PROFILE,Ue.FRIEND_USER_PROFILE].includes(r)&&(s.userProfile=a),s}));e._dispatchEvent("subscribedUserStatusChange",r)}))}}),Object.defineProperty(l.prototype,"_setUserProfileListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setUserProfileListener((function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)}),(function(t){e._dispatchEvent("ownUserProfileChanged",e._string2userProfileInfo(t))}))}}),Object.defineProperty(l.prototype,"_onGroupOperationChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o,a,s,u=[];try{a=JSON.parse(n),u=JSON.parse(i),s=JSON.parse(e);var c={groupId:a[0]?a[0].groupId:"",operatorInfo:this._convertGroupMemberInfoList([s])[0],operation:t,operationTime:r};0===t?(o=pe(this._convertGroupInfoList(a),1),c.groupInfo=o[0]):c.memberInfos=this._convertGroupMemberInfoList(u),this._dispatchEvent("groupOperation",c)}catch(t){this.logger.error(br.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:n,membersJson:i,operatorInfo:e}))}}}),Object.defineProperty(l.prototype,"_onGroupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){try{var a=JSON.parse(r),s=this._convertUpdateGroupInfoList(JSON.parse(i))[0];switch(e){case Q.GROUP_INFO_CHANGE:this._dispatchEvent("groupInfoChanged",{operatorInfo:this._convertGroupMemberInfoList([a])[0],operationTime:o,groupInfo:s,changedGroupInfo:s,fullGroupInfo:n?this._convertUpdateGroupInfoList(JSON.parse(n))[0]:void 0});break;case Q.GROUP_REMARK_DELETE:case Q.GROUP_REMARK_SET:var u=e===Q.GROUP_REMARK_SET?Z.ADD:Z.REMOVE;this._dispatchEvent("groupRemarkChangedSync",{groupId:t,operationType:u,operationTime:o,groupRemark:(null==s?void 0:s.remark)||""})}}catch(e){this.logger.error(br.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:i,operatorInfoJson:r}))}}}),Object.defineProperty(l.prototype,"_onGroupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(t),o=JSON.parse(r),a={groupId:e,operatorInfo:this._convertGroupMemberInfoList([i])[0],memberInfo:this._convertGroupMemberInfoList([o])[0],operationTime:n};this._dispatchEvent("groupMemberInfoChanged",a)}catch(e){this.logger.error(br.P_PARSE_JSON_E,JSON.stringify({error:e,operatorInfoJson:t,updateMemberInfoJson:r}))}}}),Object.defineProperty(l.prototype,"_onGroupRequestChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(r),o=i.groupId,a=i.joinUser,s=i.approverUser,u=i.inviterUser,c=i.type,l=i.status,_=i.direction,E=i.remark,d=_e(_e(_e(_e({groupId:o},a&&{joinMemberInfo:this._convertGroupMemberInfoList([a])[0]}),u&&u.userId&&{inviterInfo:this._convertGroupMemberInfoList([u])[0]}),s&&s.userId&&{operatorInfo:this._convertGroupMemberInfoList([s])[0]}),{status:l,direction:_,type:c,operationTime:n,reason:E});this._dispatchEvent("groupApplicationEvent",d)}catch(e){this.logger.error(br.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfo:t,requestInfoJson:r}))}}}),Object.defineProperty(l.prototype,"_onFavoriteMembersChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(r),o=[];i&&yt(i.list)&&(o=i.list.map((function(e){return e.value}))),this._dispatchEvent("groupFollowsChangedSync",{groupId:e,operationType:t,operationTime:n,userIds:o})}catch(e){this.logger.error(br.P_PARSE_JSON_E,JSON.stringify({error:e,memberIds:r}))}}}),Object.defineProperty(l.prototype,"_setEntrustGroupListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){Hr.setEntrustGroupListener(this._onGroupOperationChanged.bind(this),this._onGroupInfoChanged.bind(this),this._onGroupMemberInfoChanged.bind(this),this._onGroupRequestChanged.bind(this),this._onFavoriteMembersChanged.bind(this))}}),Object.defineProperty(l.prototype,"_onFriendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){this._dispatchEvent("friendApplicationStatusChanged",{userId:e,applicationType:t,applicationStatus:r,directionType:n,operationTime:i,extra:null!=o?o:""})}}),Object.defineProperty(l.prototype,"_onFriendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){this._dispatchEvent("friendAdd",{userId:t,name:r,portraitUri:n,directionType:e,operationTime:i})}}),Object.defineProperty(l.prototype,"_onFriendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={directionType:e,operationTime:r,userIds:JSON.parse(t).list.map((function(e){return e.value}))};this._dispatchEvent("friendDelete",n)}}),Object.defineProperty(l.prototype,"_onFriendsClearedFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("friendCleared",e)}}),Object.defineProperty(l.prototype,"_onFriendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){try{var n=JSON.parse(r);this._dispatchEvent("friendInfoChangedSync",{userId:e,remark:t,extProfile:n.list})}catch(e){this.logger.error(br.P_PARSE_JSON_E,JSON.stringify({error:e,profiles:r}))}}}),Object.defineProperty(l.prototype,"_setFriendEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){Hr.setFriendEventListener(this._onFriendApplicationStatusChanged.bind(this),this._onFriendAdd.bind(this),this._onFriendDelete.bind(this),this._onFriendsClearedFromServer.bind(this),this._onFriendInfoChangedSync.bind(this))}}),Object.defineProperty(l.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0,n=t.isCounted,i=t.isCustom,o=t.isPersited,a=t.isStatusMessage,s=t.searchProps;o&&(r|=1),n&&(r|=2),a&&(r=16),i&&(!function(e,t){var r=pr.get(e);!r||r.isCustom?(t.isStatusMessage&&(t.isCounted=t.isPersited=!1),pr.set(e,_e(_e({},t),{isCustom:!0}))):console.error("Builtin message type '".concat(e,"' cannot be registered"))}(e,t),this.logger.info(br.P_REGTYP_O,JSON.stringify({type:e,opt:r,search:s}))),this._callCppProxy("registerMessageType",e,r,s||[])}}),Object.defineProperty(l.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.tcpMgr.connect(e,t,r,n)}}),Object.defineProperty(l.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=ce.RC_SOCKET_DISCONNECTED;return this.tcpMgr.reconnect(e,t,r,n)}}),Object.defineProperty(l.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.stringify(_e(_e({},e),{"electron-main":"5.20.0-alpha.1"}));this.logger.info(br.P_REPORT_VER_O,t),this._callCppProxy("uploadSDKVersion",t,"")}}),Object.defineProperty(l.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){return de(this,(function(r){return e=e||!0,this._chatroomCache.length=0,this.reporter.stop(),un(null,this.logger),[2,this.tcpMgr.disconnect(e,t)]}))}))}}),Object.defineProperty(l.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){Hr.setOnReceiveStatusListener((function(e,r){t({userId:e,status:r})}));var r=e.userIds||[];r.length&&this.subscribeUserStatus(r)}}),Object.defineProperty(l.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("subscribeUserStatus",e,(function(){setTimeout((function(){r(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){r(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("setUserStatus",e,(function(){setTimeout((function(){r(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){r(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("getUserStatus",e,(function(e){setTimeout((function(){r({code:ce.SUCCESS,data:{status:e}})}),0)}),(function(e){setTimeout((function(){r({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"_handleDirectionalUserIdList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.messageType,n=e.content,i=e.directionalUserIdList,o=void 0===i?[]:i,a=t===le.GROUP;if(r===he.READ_RECEIPT_RESPONSE&&n.receiptMessageDic&&a)for(var s in n.receiptMessageDic)o.push(s);return r===he.SYNC_READ_STATUS&&function(e){return[le.GROUP,le.DISCUSSION,le.ULTRA_GROUP,le.PUBLIC_SERVICE,le.APP_PUBLIC_SERVICE].includes(e)}(t)&&(o=[this.getCurrentUserId()]),o}}),Object.defineProperty(l.prototype,"_handleMessage2Callback",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if("RC:MsgExMsg"===e.messageType&&this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e),e.messageType===he.READ_RECEIPT_REQUEST)this._updateReadReceiptInfo(t.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});else if(e.messageType===he.READ_RECEIPT_RESPONSE){var n=t.content.receiptMessageDic;if(!n)return;for(var i in n)n[i].forEach((function(e){r._updateReadReceiptInfo(e,{isReceiptRequestMessage:!0,hasRespond:!0})}))}}}),Object.defineProperty(l.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this;void 0===i&&(i=this.logger.createTraceId());var a=r.messageType,s=r.content,u=r.expansion,c=r.pushConfig,l=r.pushContent,_=void 0===l?"":l,E=r.pushData,d=void 0===E?"":E,f=r.directionalUserIdList,p=void 0===f?[]:f,R=r.disableNotification,b=void 0!==R&&R,O=r.canIncludeExpansion,C=void 0!==O&&O,g=r.isVoipPush,T=void 0!==g&&g,h=r.channelId,I=void 0===h?"":h,S=r.messageId,v=void 0===S?0:S,N=r.disableUpdateLastMessage,P=void 0!==N&&N,m=r.needReceipt,A=c||{},y=A.iOSConfig,L=A.androidConfig,M=A.harmonyOSConfig,U=A.templateId,D=void 0===U?"":U,w=A.pushTitle,G=void 0===w?"":w,V=A.pushContent,j=void 0===V?_:V,F=A.pushData,k=void 0===F?d:F,B=A.disablePushTitle,H=void 0!==B&&B,x=A.forceShowDetailContent,J=void 0!==x&&x,W=Ht(y,L,M);return new Promise((function(c){_=j,d=k;var l=(null==L?void 0:L.notificationId)||"";p=o._handleDirectionalUserIdList(r,e);var E={};for(var f in u)E[f]={v:""},E[f].v=u[f];var R=D;o.logger.info(br.P_SEND_MSG_T,JSON.stringify({messageType:a,conversationType:e,targetId:t,channelId:I}),i);var O=o._callCppProxy("sendMessage",(function(e,t){var n=o._buildMessage(e,{isOffLineMessage:!1});if(o.logger.info(br.P_SEND_MSG_R,JSON.stringify({code:t,messageUId:n.messageUId}),i),t===ce.SENSITIVE_REPLACE)return setImmediate((function(){c({code:t})}));[he.READ_RECEIPT_REQUEST,he.READ_RECEIPT_RESPONSE,he.EXPANSION_NOTIFY].findIndex((function(e){return e===n.messageType}))>-1&&o._handleMessage2Callback(n,r),n.canIncludeExpansion&&o._msgExpansionHandler.setLocalFromReceiveMsg(o.logger,n),setImmediate((function(){c({code:ce.SUCCESS,data:n})}))}),(function(e,t){var r=o._buildMessage(e,{isOffLineMessage:!1});o.logger.warn(br.P_SEND_MSG_R,JSON.stringify({code:t,messageId:r.messageId}),i),r.sentTime=Date.now()-Hr.getDeltaTime(),setImmediate((function(){c({code:t,data:r})}))}),e,t,a,JSON.stringify(s),p,b,H,J,_,d,l,G,W,R,C,JSON.stringify(E),T,I,v,P,!!m),g=JSON.parse(O);null==n||n(g.messageId)}))}}),Object.defineProperty(l.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return Ee(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,_,E,d,f,p,R,b,O,C,g,T=this;return de(this,(function(h){return n=e.channelId||"",i=e.targetId,o=e.conversationType,a=t.user,s=t.pushContent,u=t.extra,c=t.pushConfig,l=t.disableNotification,_=t.isDelete,E=t.directionalUserIdList,d=t.disableUpdateLastMessage,f=t.isAdmin,p=t.messageUId,R=t.sentTime,b={conversationType:o,targetId:i,messageUId:p,sentTime:R,user:a,extra:u,channelId:n,isDelete:_||!1,isAdmin:f},a&&(b.user=a),u&&(b.extra=u),O={conversationType:o,targetId:i,senderUserId:this.tcpMgr.getCurrentUserId(),content:b,objectName:he.RECALL,messageUid:p,direction:Fe.SEND,status:Ze.UNREAD,sentTime:R,channelId:n},C=this._buildMessage(JSON.stringify(O),{isOffLineMessage:!1}),[2,(g=Ln.create(this.logger,"recallMessage")).asyncInvoke((function(e){return Ee(T,void 0,void 0,(function(){return de(this,(function(e){return be(this,Un,"m",Vn).call(this,C),C.pushConfig=c,g.ok(C),[2]}))}))}),(function(e){return g.fail(e)}),he.RECALL,JSON.stringify(b),l||!1,(null==c?void 0:c.disablePushTitle)||!1,(null==c?void 0:c.forceShowDetailContent)||!1,s||"",(null==c?void 0:c.pushData)||"",(null===(r=null==c?void 0:c.androidConfig)||void 0===r?void 0:r.notificationId)||"",(null==c?void 0:c.pushTitle)||"",Ht(null==c?void 0:c.iOSConfig,null==c?void 0:c.androidConfig,null==c?void 0:c.harmonyOSConfig),(null==c?void 0:c.templateId)||"",n,E||[],p,null!=d&&d).result()]}))}))}}),Object.defineProperty(l.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){var s=this;return new Promise((function(u){r=r||0;var c=0===i,l=n+1,_=s._callCppProxy("getHistoryMessages",e,t,r,l,a,c,o),E=JSON.parse(_).list,d=[];E.reverse();for(var f=0;f<E.length;f++){var p=s._buildMessage(E[f].obj);d[f]=p}u({code:ce.SUCCESS,data:{list:l===d.length?d.slice(1,l):d,hasMore:n<d.length}})}))}}),Object.defineProperty(l.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){var a=this;return new Promise((function(s){var u=0===i,c=r,l=0!==r,_=n+1;l&&(c+=u?1:-1,_++);for(var E=a._callCppProxy("getMessages",e,t,c,_,u,o),d=JSON.parse(E).list,f=[],p=0;p<d.length;p++){var R=a._buildMessage(d[p].obj);f[p]=R}var b=a._computeRepairInfo(f,u,r,c,_),O=b.isNeedRepair,C=void 0!==O&&O,g=b.repairTime,T=void 0===g?0:g;if(!C)return l&&(f.shift(),_--),f.reverse(),void s({code:ce.SUCCESS,data:{list:_===f.length?f.slice(1,_):f,hasMore:n<f.length}});a._processRepairHisMsg(e,t,r,n,i,o,T,s)}))}}),Object.defineProperty(l.prototype,"_computeRepairInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=!1,a=0,s=this.getNaviInfoFromCache()||{},u=s.repairHisMsg,c=void 0===u?0:u,l=s.historyMsg;if(1!==c||!l)return{isNeedRepair:o,repairTime:a};var _=e.findIndex((function(e){return e.hasMore||0===Object.keys(e.content).length}));return t&&_>=0?(o=!0,a=e[_].hasMore?e[_].sentTime:e[_].sentTime+1):!t&&_>=1?(o=!0,a=e[_-1].sentTime):e.length<i||0===r?(o=!0,a=r):e.length>0&&e[0].sentTime!==r&&(o=!0,a=n),{isNeedRepair:o,repairTime:a}}}),Object.defineProperty(l.prototype,"_processRepairHisMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a,s){var u=this,c=function(a){for(var c=0===i,l=n+1,_=u._callCppProxy("getMessages",e,t,r,l,c,o),E=JSON.parse(_).list,d=[],f=0;f<E.length;f++){var p=u._buildMessage(E[f].obj);d[f]=p}d.reverse(),s({code:a,data:{list:l<=d.length?d.slice(1,l):d,hasMore:n<d.length}})},l=n+10>100?100:n+10;this._callCppProxy("getRemoteHistoryMessages",e,t,a,l,(function(){return c(0)}),(function(e){c(e)}),i,!0,o,!1)}}),Object.defineProperty(l.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){var a=this;return new Promise((function(s){r=r||0;var u=0===i;a._callCppProxy("getContinuousMessages",e,t,r,n,(function(e,t,r){var n=JSON.parse(e).list,i=[];n.reverse();for(var o=0;o<n.length;o++){var u=a._buildMessage(n[o].obj);i[o]=u}setTimeout((function(){s({code:ce.SUCCESS,data:{list:i,timestamp:t,hasMore:r}})}))}),(function(e){setTimeout((function(){s({code:e})}),0)}),u,o)}))}}),Object.defineProperty(l.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){var a=this;return new Promise((function(s){r=r||0;a._callCppProxy("getRemoteHistoryMessages",e,t,r,n,(function(e,t){var r=JSON.parse(e).list,n=[];r.reverse();for(var i=0;i<r.length;i++){var o=a._buildMessage(r[i].obj);n[i]=o}setTimeout((function(){s({code:ce.SUCCESS,data:{list:n,hasMore:!!t}})}),0)}),(function(e){setTimeout((function(){s({code:e})}),0)}),i,!0,o,!0)}))}}),Object.defineProperty(l.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId,o=JSON.stringify(t),a=this.logger.createTraceId(),s=Ln.create(this.logger,"deleteRemoteHistoryMessages",a);return s.asyncInvoke(r,n,o,!1,i||"",(function(){return s.ok()}),(function(e){return s.fail(e)})).result()}}),Object.defineProperty(l.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=Ln.create(this.logger,"clearRemoteHistoryMessages",r);return n.asyncInvoke(e.conversationType,e.targetId,t,(function(){return n.ok()}),(function(e){return n.fail(e)}),e.channelId).result()}}),Object.defineProperty(l.prototype,"clearMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("clearMessages",e,t,r),i(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){return de(this,(function(t){switch(e.type){case Cr:return[2,be(this,Un,"m",jn).call(this,e.params)];case Tr:return[2,Nt(ce.NOT_SUPPORT)];case gr:return[2,be(this,Un,"m",Fn).call(this,e.params)];case hr:return[2,be(this,Un,"m",kn).call(this,e.params)];case Ir:return[2,be(this,Un,"m",Bn).call(this,e.params)];case Sr:return[2,be(this,Un,"m",Hn).call(this,e.params)]}return[2]}))}))}}),Object.defineProperty(l.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,_;return de(this,(function(E){switch(E.label){case 0:return(n=Nn(this.logger,!0,"getConversation",e,t,r))?[2,vt(this._buildConversation(n))]:[4,this.getHistoryMessage(e,t,0,1,0,r,"")];case 1:return i=E.sent(),o=i.data,a=(null==o?void 0:o.list[0])||null,s=JSON.parse(Nn(this.logger,!1,"getConversationStatus",JSON.stringify([{conversation_type:e,target_id:t,channel_id:r,channel_id_valid:"string"==typeof r&&r.length>0}])))[0],u=!!(null==s?void 0:s.is_top),[4,this.getConversationNotificationLevel({conversationType:e,targetId:t,channelId:r})];case 2:return c=E.sent(),l=c.data,_={conversationType:e,targetId:t,channelId:r,latestMessage:a,lastUnreadTime:0,isTop:u,notificationLevel:l,notificationStatus:st(l)},[2,vt(_)]}}))}))}}),Object.defineProperty(l.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t,r,n;return de(this,(function(i){return t=e.conversationType,r=e.targetId,n=e.channelId,[2,Nn(this.logger,!0,"removeConversation",t,r,n||"")?vt():Nt(ce.CONVER_REMOVE_ERROR)]}))}))}}),Object.defineProperty(l.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId}})),r=this._callCppProxy("removeConversationInBatches",JSON.stringify(t));return Promise.resolve(r?ce.SUCCESS:ce.CONVER_REMOVE_ERROR)}}),Object.defineProperty(l.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=[];i=yt(e)?e:Qe(Ye),r._callCppProxy("clearConversations",i,t||""),n(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n,i;return de(this,(function(o){return n=t&&t.length>0?t:Qe(Ye),i=Nn(this.logger,!0,"getTotalUnreadCount",n,r,e),[2,vt(i)]}))}))}}),Object.defineProperty(l.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return void 0===r&&(r=""),new Promise((function(i){var o=n._callCppProxy("getUnreadCount",e,t,r);i({code:ce.SUCCESS,data:o})}))}}),Object.defineProperty(l.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return void 0===r&&(r=""),new Promise((function(i){n._callCppProxy("clearUnreadCount",e,t,r),i(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){var e,t=this;return de(this,(function(r){switch(r.label){case 0:return[4,be(this,Un,"m",kn).call(this)];case 1:return(e=r.sent()).isOk?(e.data.list.forEach((function(e){var r=e.conversationType,n=e.targetId,i=e.channelId;Nn(t.logger,!1,"clearUnreadCount",r,n,i||"")})),[2,vt()]):[2,e.wipe()]}}))}))}}),Object.defineProperty(l.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;return new Promise((function(o){i._callCppProxy("clearUnreadCountByTimestamp",e,t,r,n),o(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){var o=n._callCppProxy("getTheFirstUnreadMessage",e,t,r),a=n._buildMessage(o);i({code:ce.SUCCESS,data:-1!==a.messageId?a:null})}))}}),Object.defineProperty(l.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i,o){var a=n._callCppProxy("getTheFirstUnreadMessage",e,t,r),s=n._buildMessage(a);i({code:ce.SUCCESS,data:-1!==s.messageId?{messageUId:s.messageUId,sentTime:s.sentTime}:null})}))}}),Object.defineProperty(l.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return be(this,Un,"m",xn).call(this,e,-1,t?1:0,r,n)}}),Object.defineProperty(l.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=Ln.create(this.logger,"setBlockPushLevelInBatches",r),i=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId,level:t}}));return n.asyncInvoke(JSON.stringify(i),(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(l.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ln.create(this.logger,"setBlockPushLevelForType",this.logger.createTraceId());return r.asyncInvoke(e,t,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(l.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t;return de(this,(function(r){return t=Nn(this.logger,!0,"getBlockPushLevelForType",e),[2,vt(t)]}))}))}}),Object.defineProperty(l.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a=this;return de(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),[4,(o=Ln.create(this.logger,"searchConversationByContent",i)).asyncInvoke(n,e,t,r,(function(e,t,r){e===ce.SUCCESS?o.ok({result:t,matchedNumber:r}):o.fail(e)})).result()];case 1:return[2,s.sent().trans((function(e){return JSON.parse(e.result).map((function(e){return be(a,Un,"m",wn).call(a,e)}))}))]}}))}))}}),Object.defineProperty(l.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n,i,o=this;return de(this,(function(a){switch(a.label){case 0:return r=r||[1,3,6,7],n=this.logger.createTraceId(),[4,(i=Ln.create(this.logger,"searchConversationByContentWithAllChannel",n)).asyncInvoke(r,e,t,(function(e,t,r){e===ce.SUCCESS?i.ok({result:t,matchedNumber:r}):i.fail(e)})).result()];case 1:return[2,a.sent().trans((function(e){return JSON.parse(e.result).map((function(e){return be(o,Un,"m",wn).call(o,e)}))}))]}}))}))}}),Object.defineProperty(l.prototype,"searchMessageByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){return Ee(this,void 0,void 0,(function(){var o,s,u=this;return de(this,(function(c){switch(c.label){case 0:return o=this.logger.createTraceId(),[4,(s=Ln.create(this.logger,"searchMessageByContent",o)).asyncInvoke(e,t,r,n,i,!0,(function(e,t,r){e===ce.SUCCESS?s.ok({result:t,matchedNumber:r}):s.fail(e)}),a).result()];case 1:return[2,c.sent().trans((function(e){return{messages:JSON.parse(e.result).map((function(e){return be(u,Un,"m",Dn).call(u,e)})),count:e.matchedNumber}}))]}}))}))}}),Object.defineProperty(l.prototype,"searchMessageByContentAndMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){return Ee(this,void 0,void 0,(function(){var s,u,c=this;return de(this,(function(l){switch(l.label){case 0:return s=this.logger.createTraceId(),[4,(u=Ln.create(this.logger,"searchMessageByContentAndObjectName",s)).asyncInvoke(t,e,a||"",void 0===a,r,o,i,n,!0,(function(e,t,r){e===ce.SUCCESS?u.ok({result:t,matchedNumber:r}):u.fail(e)})).result()];case 1:return[2,l.sent().trans((function(e){return{messages:JSON.parse(e.result).map((function(e){return be(c,Un,"m",Dn).call(c,e)})),count:e.matchedNumber}}))]}}))}))}}),Object.defineProperty(l.prototype,"searchMessagesByUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return Ee(this,void 0,void 0,(function(){var a,s,u=this;return de(this,(function(c){switch(c.label){case 0:return a=this.logger.createTraceId(),[4,(s=Ln.create(this.logger,"getMessageBySender",a)).asyncInvoke(e,t,r,n,i,o,(function(e){return s.ok(e)})).result()];case 1:return[2,c.sent().trans((function(e){return{messages:(e?JSON.parse(e).list:[]).map((function(e){return u._buildMessage(e.obj)}))}}))]}}))}))}}),Object.defineProperty(l.prototype,"searchMessageByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return Ee(this,void 0,void 0,(function(){var o,a,s=this;return de(this,(function(u){switch(u.label){case 0:return o=this.logger.createTraceId(),[4,(a=Ln.create(this.logger,"searchMessageByContentWithAllChannel",o)).asyncInvoke(e,t,r,n,i,!0,(function(e,t,r){e===ce.SUCCESS?a.ok({result:t,matchedNumber:r}):a.fail(e)})).result()];case 1:return[2,u.sent().trans((function(e){return{messages:JSON.parse(e.result).map((function(e){return be(s,Un,"m",Dn).call(s,e)})),count:e.matchedNumber}}))]}}))}))}}),Object.defineProperty(l.prototype,"searchMessageByContentInTimeRangeWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){return Ee(this,void 0,void 0,(function(){var s,u,c=this;return de(this,(function(l){switch(l.label){case 0:return s=this.logger.createTraceId(),[4,(u=Ln.create(this.logger,"searchMessageByTimestampWithAllChannel",s)).asyncInvoke(e,t,r,n,i,o,a,(function(e,t,r){e===ce.SUCCESS?u.ok({result:t,matchedNumber:r}):u.fail(e)})).result()];case 1:return[2,l.sent().trans((function(e){return{messages:JSON.parse(e.result).map((function(e){return be(c,Un,"m",Dn).call(c,e)}))}}))]}}))}))}}),Object.defineProperty(l.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){for(var n=JSON.parse(this._callCppProxy("getUnreadMentionedMessages",e,t,r)).list,i=0;i<n.length;i++)n[i]=this._buildMessage(n[i].obj);return n}}),Object.defineProperty(l.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("addToBlacklist",e,(function(){setTimeout((function(){r(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){r(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("removeFromBlacklist",e,(function(){setTimeout((function(){r(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){r(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return new Promise((function(t){e._callCppProxy("getBlacklist",(function(e){setTimeout((function(){t({code:ce.SUCCESS,data:e})}),0)}),(function(e){setTimeout((function(){t({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("getBlacklistStatus",e,(function(e){setTimeout((function(){r({code:ce.SUCCESS,data:e})}),0)}),(function(e){setTimeout((function(){r({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=r.content,o=r.senderUserId,a=r.messageType,s=r.messageDirection,u=r.readStatus,c=r.sentStatus,l=r.sentTime,_=r.searchContent,E=r.isUnread,d=r.messageUId,f=r.disableNotification,p=r.canIncludeExpansion,R=r.expansionMsg,b=r.channelId,O=r.directedUserIds,C=r.disableUpdateLastMessage;i=JSON.stringify(i);var g={};if(l=l||0,R){var T=JSON.parse(R);for(var h in T)g[h]={v:"",ts:0},g[h].v=T[h],g[h].ts=l}return new Promise((function(r){var R=E?0:1,T=n._callCppProxy("insertMessage",e,t,o,a,i,(function(){}),(function(e){setTimeout((function(){r({code:e})}),0)}),s,u||0,c||10,l,_||"",R,d||"",!!f,!!p,JSON.stringify(g),b||"",O||[],C||!1),h=n._buildMessage(T,{isOffLineMessage:!1});h.messageUId=d,h.sentTime=l,r({code:-1===h.messageId?ce.MSG_INSERT_ERROR:ce.SUCCESS,data:h})}))}}),Object.defineProperty(l.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return void 0===t&&(t=!1),new Promise((function(n){var i=e.map((function(e){var t=e.content,r=e.senderUserId,n=e.messageType,i=e.messageDirection,o=e.receivedStatus,a=void 0===o?0:o,s=e.sentStatus,u=e.sentTime,c=e.searchContent,l=e.isUnread,_=e.messageUId,E=e.disableNotification,d=e.canIncludeExpansion,f=e.expansion,p=e.channelId,R=e.conversationType,b=e.targetId,O=e.source,C=e.isMentioned,g=e.receivedStatusInfo,T=e.directedUserIds,h=e.disableUpdateLastMessage,I=a;g&&(I=function(e){var t=Ze.UNREAD;return(null==e?void 0:e.isRead)&&(t|=Ze.READ),(null==e?void 0:e.isListened)&&(t|=Ze.LISTENED),(null==e?void 0:e.isDownload)&&(t|=Ze.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=Ze.RETRIEVED),t}(g));var S={};if(u=u||0,f)for(var v in f)S[v]={v:"",ts:0},S[v].v=f[v],S[v].ts=u;return{conversationType:R,targetId:b,channelId:p||"",direction:i,senderUserId:r,status:s||10,sentTime:u,objectName:n,content:JSON.stringify(t),messageUid:_||"",noNotification:!!E,supportExt:!!d,extMsg:JSON.stringify(S),readStatus:I,searchContent:c||"",isUnread:!!l,source:O||"",isMention:C,directedUsers:T,disableUpdateLastMessage:h||!1}})),o=r._callCppProxy("insertMessages",JSON.stringify(i),t);n({code:o?ce.SUCCESS:ce.MSG_INSERT_ERROR,data:o||!1})}))}}),Object.defineProperty(l.prototype,"getMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){var o=n._callCppProxy("getMessageCount",e,t,r);i({code:ce.SUCCESS,data:o})}))}}),Object.defineProperty(l.prototype,"deleteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("deleteMessages",e),r(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"deleteMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this;return new Promise((function(a){o._callCppProxy("deleteMessagesByTimestamp",e,t,r,n,i),a(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"batchClearMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r,n){var i=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}}));t._callCppProxy("deleteMessageBySendTimeInBatches",JSON.stringify(i)),r(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}})),n=Ln.create(this.logger,"deleteRemoteMessageBySendTimeInBatches",this.logger.createTraceId());return n.asyncInvoke(JSON.stringify(r),!!t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(l.prototype,"getMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t,r;return de(this,(function(n){return t=Nn(this.logger,!0,"getMessage",e),(r=this._buildMessage(t,{isOffLineMessage:!1})).messageId<=0?[2,Nt(ce.RC_DB_DATA_NOT_FOUND,"msg not found: ".concat(e))]:[2,vt(r)]}))}))}}),Object.defineProperty(l.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){t=JSON.stringify(t),n._callCppProxy("setMessageContent",e,t,r),i(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("setMessageSearchField",e,t,r),i(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("setMessageSentStatus",e,t),n(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("setMessageReceivedStatus",e,t),n(ce.SUCCESS)}))}}),Object.defineProperty(l.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;return new Promise((function(o){i._callCppProxy("saveTextMessageDraft",e,t,r,n||"")&&o(ce.SUCCESS),o(ce.DRAFT_SAVE_ERROR)}))}}),Object.defineProperty(l.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){var o=n._callCppProxy("getTextMessageDraft",e,t,r||"");i({code:ce.SUCCESS,data:o})}))}}),Object.defineProperty(l.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("clearTextMessageDraft",e,t,r||"")&&i(ce.SUCCESS),i(ce.DRAFT_REMOVE_ERROR)}))}}),Object.defineProperty(l.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t,r,n,i;return de(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=Nn(this.logger,!0,"getBlockPushLevelForConversation",r,n||"",t),[2,vt(i)]}))}))}}),Object.defineProperty(l.prototype,"setConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;return void 0===n&&(n=""),new Promise((function(o){i._callCppProxy("setBlockPushLevelForConversation",t,n,e,r,(function(){setTimeout((function(){o(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){o(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(r){var n=this._callCppProxy("getUnreadMentionedCountByLevel",e,t);return Promise.resolve({code:ce.SUCCESS,data:n})}var i=this._callCppProxy("getUnreadCountByLevel",e,t);return Promise.resolve({code:ce.SUCCESS,data:i})}}),Object.defineProperty(l.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("sendReadReceipt",e,r||"",t,(function(){t.forEach((function(e){n._updateReadReceiptInfo(e,{hasRespond:!0});try{var t=JSON.parse(n._callCppProxy("getMessage",e)).messageId;n.setMessageReceivedStatus(t,1)}catch(t){n.logger.error(br.P_PARSE_JSON_MSGS_E,JSON.stringify({messageUId:e,error:null==t?void 0:t.stack}))}})),setTimeout((function(){i({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){i({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("getMessageReader",e,r,t,(function(e,r){var o=[],a={};(e=JSON.parse(e)).list.forEach((function(e){var t=JSON.parse(e.obj),r=t.id,n=t.time;o.push({userId:r,readTime:n}),a[r]=n}));var s={readerInfo:a,readCount:o.length,totalCount:r};n._updateReadReceiptInfo(t,s),setTimeout((function(){i({code:ce.SUCCESS,data:{list:o,totalMemberCount:r}})}),0)}),(function(e){setTimeout((function(){i({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){var o=e.conversationType,a=e.targetId,s=e.channelId;n._callCppProxy("sendMessageReadReceipt",o,a,s||"",t,r,(function(){setTimeout((function(){i({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){i({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=e.targetId,o=e.channelId;r._callCppProxy("getMessageReadReceipt",i,o||"",t,(function(e,i,o){var a=[],s=r._callCppProxy("getMessage",t),u=JSON.parse(s);try{JSON.parse(o).list.forEach((function(e){var t=JSON.parse(e.obj),r=t.id,n=t.time;a.push({userId:r,readTime:n})}))}catch(e){r.logger.error(br.P_PARSE_JSON_E,"method: getMessageReadReceipt, info: ".concat(o,", error: ").concat(e))}var c=JSON.parse(u.readReceiptRequest||"{}"),l=c.readerList,_=void 0===l?[]:l,E=c.readCount,d=void 0===E?0:E,f=!1;_.length<a.length&&(_=a,f=!0),d<i&&(d=i,f=!0),f&&r._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify({readerList:_,readCount:d,totalCount:e})),setTimeout((function(){n({code:ce.SUCCESS,data:{list:a,totalCount:e,readCount:d}})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=e.conversationType,o=e.targetId,a=e.channelId;r._callCppProxy("updateConversationReadTime",i,o,a||"",t,(function(){setTimeout((function(){n({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"_addChatroomCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this._rmChatroomCache(e),this._chatroomCache.push({chatroomId:e,joinExist:r,count:t,extra:n})}}),Object.defineProperty(l.prototype,"_rmChatroomCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._chatroomCache=this._chatroomCache.filter((function(t){return t.chatroomId!==e}))}}),Object.defineProperty(l.prototype,"_try2RejoinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(0!==this._chatroomCache.length){var t=this.logger.createTraceId();this._chatroomCache.forEach((function(r){return Ee(e,void 0,void 0,(function(){var e,n,i,o,a,s,u;return de(this,(function(c){switch(c.label){case 0:return e=r.chatroomId,n=r.joinExist,i=r.count,o=r.extra,this.logger.info(D.L_REJOIN_CHATROOM_T,e,t),[4,this._joinChrm(e,i,n,!1,o)];case 1:return a=c.sent(),s=a.code,u=a.data,s===ce.SUCCESS?(this.logger.info(D.L_REJOIN_CHATROOM_R,e,t),this._sendChatroomStatus({rejoinedRoom:_e({chatroomId:e,count:i},u)}),[2]):(s===ce.RC_CHATROOM_USER_KICKED&&this._rmChatroomCache(e),this._sendChatroomStatus({rejoinedRoom:{chatroomId:e,errorCode:s}}),this.logger.warn(D.L_REJOIN_CHATROOM_R,"chrmId: ".concat(e,", code: ").concat(s),t),[2])}}))}))}))}}}),Object.defineProperty(l.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this,a=r?"joinExistChatRoom":"joinChatRoom";return new Promise((function(s){n&&o._callCppProxy("clearMessages",le.CHATROOM,e,""),o._callCppProxy(a,e,t,(function(n,a,u,c,l,_,E){o._addChatroomCache(e,t,r,i||""),setTimeout((function(){s({code:ce.SUCCESS,data:{createTime:Number(n),memberCount:a,isAllChatroomBanned:u,isCurrentUserBanned:c,isCurrentChatroomBanned:l,isCurrentChatroomInWhitelist:_,joinTime:E}})}),0)}),(function(e){setTimeout((function(){s({code:e})}),0)}),i||"")}))}}),Object.defineProperty(l.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){return de(this,(function(n){switch(n.label){case 0:return[4,this._joinChrm(e,t,!1,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(l.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._joinChrm(e,t,!0,!0,r)}}),Object.defineProperty(l.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this._rmChatroomCache(e),new Promise((function(r){t._callCppProxy("quitChatRoom",e,(function(){setTimeout((function(){r(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){r(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("getChatroomInfo",e,t,r,(function(e,t){var r=e?JSON.parse(e).list:[],n=[];if(r.length>0)for(var o=0;o<r.length;o++)n.push(JSON.parse(r[o].obj));setTimeout((function(){i({code:ce.SUCCESS,data:{userInfos:n,userCount:t}})}),0)}),(function(e){setTimeout((function(){i({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;return new Promise((function(o){i._callCppProxy("getChatroomHistoryMessage",e,t,r,n,(function(e){var t;try{t=JSON.parse(e)}catch(e){t={list:[],hasMore:!1}}var r=t.list;if(r&&r.length)try{t.list=r.map((function(e){return i._buildMessage(e.obj)}))}catch(e){t.list=[]}setTimeout((function(){o({code:ce.SUCCESS,data:t})}),0)}),(function(e){setTimeout((function(){o({code:e})}),0)}),"")}))}}),Object.defineProperty(l.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i='[{"key":"'.concat(t.key,'", "value":"').concat(t.value,'"}]');r._callCppProxy("setChatroomKV",e,i,!!t.isAutoDelete,!!t.isOverwrite,(function(){setTimeout((function(){n(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){n(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("setChatroomKV",e,JSON.stringify(t.entries),!!t.isAutoDelete,!!t.isOverwrite,(function(){n({code:ce.SUCCESS})}),(function(e){n({code:e})}))}))}}),Object.defineProperty(l.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return t.isOverwrite=!0,t.userId=t.userId||this.tcpMgr.getCurrentUserId(),this.setChatroomEntry(e,t)}}),Object.defineProperty(l.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[t.key];return new Promise((function(i){r._callCppProxy("deleteChatroomKV",e,n,!!t.isOverwrite,(function(){i(ce.SUCCESS)}),(function(e){i(e)}))}))}}),Object.defineProperty(l.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return t.isOverwrite=!0,t.userId=t.userId||this.tcpMgr.getCurrentUserId(),this.removeChatroomEntry(e,t)}}),Object.defineProperty(l.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=t.entries.map((function(e){return e.key}));r._callCppProxy("deleteChatroomKV",e,i,!!t.isOverwrite,(function(){n({code:ce.SUCCESS})}),(function(e){n({code:e})}))}))}}),Object.defineProperty(l.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r,n,i;return de(this,(function(o){switch(o.label){case 0:return[4,this.getAllChatroomEntry(e)];case 1:return r=o.sent(),n=r.code,i=r.data,n!==ce.SUCCESS?[2,{code:n}]:i&&i[t]?[2,{code:n,data:i[t]}]:[2,{code:ce.CHATROOM_KEY_NOT_EXIST}]}}))}))}}),Object.defineProperty(l.prototype,"getAllChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("getChatroomKV",e,(function(e){var t={};try{(e?JSON.parse(e):{list:[]}).list.map((function(e){return JSON.parse(e.obj)})).forEach((function(e){t[e.key]=e.value?e.value:""}))}catch(e){}setTimeout((function(){r({code:ce.SUCCESS,data:t})}),0)}),(function(e){setTimeout((function(){r({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"removeChatroomFromCatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rmChatroomCache(e)}}),Object.defineProperty(l.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){var a=this;return r=r||"",n=n||"",i=i||"",new Promise((function(s){var u;u=n&&"uploads"!==n?t||"":Bt(e,t);var c=a.getNaviInfoFromCache(),l={uploadDomain:Xt(c,a.logger),env:a._environment};o=o?Math.ceil(o):0,a._callCppProxy("getUploadToken",e,u,r,n,i,JSON.stringify(l),o,c.ipType||0,(function(e,t,r,n,i,o,a,c,l,_,E,d,f,p,R,b,O,C,g,T,h,I,S,v){setTimeout((function(){s({code:ce.SUCCESS,data:{token:e,deadline:0,bosToken:t,bosDate:r,path:n,osskeyId:i,ossPolicy:o,ossSign:a,ossBucketName:c,fileName:u,s3Credential:l,s3Algorithm:_,s3Date:E,s3Policy:d,s3Signature:f,s3BucketName:p,stcAuthorization:R,stcContentSha256:b,stcDate:O,stcBucketName:C,minioAuthorization:g,minioContentSha256:T,minioDate:h,minioBucketName:I,downloadAuthInfo:S?JSON.parse(S):null}})}),0)}),(function(e){setTimeout((function(){s({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;return new Promise((function(o){var a=i.getNaviInfoFromCache(),s={url:Xt(a,i.logger)};i._callCppProxy("getDownloadUrl",e,r,n,t-1,JSON.stringify(s),-1,a.ipType||0,(function(e){setTimeout((function(){o({code:ce.SUCCESS,data:{downloadUrl:e}})}),0)}),(function(e){setTimeout((function(){o({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"clearData",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return new Promise((function(t){var r=e._callCppProxy("clearData");t({code:ce.SUCCESS,data:r})}))}}),Object.defineProperty(l.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._deviceId}}),Object.defineProperty(l.prototype,"getVoIPKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("getVoIPKey",e,t,"",(function(e){setTimeout((function(){n({code:ce.SUCCESS,data:e})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=e.chatRoomId,i=e.rtcRoomId;t._callCppProxy("bindRTCRoomForChatroom",n,i,(function(){setTimeout((function(){r(ce.SUCCESS)}),0)}),(function(e){setTimeout((function(){r(e)}),0)}))}))}}),Object.defineProperty(l.prototype,"getGroupMessageDeliverList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("getGroupMessageDeliverList",e,r,t,(function(e,t){var r=JSON.parse(e).list.map((function(e){return{time:JSON.parse(e.obj).time,userId:JSON.parse(e.obj).id}}));setTimeout((function(){i({code:ce.SUCCESS,data:{totalCount:t,list:r}})}),0)}),(function(e){setTimeout((function(){i({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getPrivateMessageDeliverTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=r._callCppProxy("getMessageDeliverTime",e);if(i)n({code:ce.SUCCESS,data:i});else{r._callCppProxy("getPrivateMessageDeliverList",t,e,(function(e){var t=0,r=JSON.parse(e).list;if(r.length>0){var i=JSON.parse(r[0].obj).time;t=i}setTimeout((function(){n({code:ce.SUCCESS,data:t})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}}))}}),Object.defineProperty(l.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;return new Promise((function(o){i._callCppProxy("rtcSignaling",e,t,r,n,(function(e){var t=Array.prototype.slice.call(e);o({code:ce.SUCCESS,buffer:t})}),(function(e){o({code:e})}),30)}))}}),Object.defineProperty(l.prototype,"_setRTCHeartbeatListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Hr.setRTCHeartbeatListener((function(t,r){var n=e.rtcHeartbeatResolves[t];if(n){var i=n.find((function(e){return""===e.seqId}));i&&(i.seqId=r)}}),(function(t,r,n,i){var o=e.rtcHeartbeatResolves[t];if(o){var a=o.findIndex((function(e){return e.seqId===n}));-1!==a&&o.splice(a,1)[0].resolve({code:r,data:{version:Number(i)}})}}))}}),Object.defineProperty(l.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(t){var r={resolve:t,seqId:""},i=n.rtcHeartbeatResolves[e];i?i.push(r):n.rtcHeartbeatResolves[e]=[r],n._callCppProxy("sendRTCHeartbeat",[e],30)}))}}),Object.defineProperty(l.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("addTag",e.tagId,e.tagName,(function(){setTimeout((function(){r({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){r({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("deleteTag",e,(function(){setTimeout((function(){r({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){r({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("renameTag",e.tagId,e.tagName,(function(){setTimeout((function(){r({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){r({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return new Promise((function(t){var r=e._callCppProxy("getTags"),n=e._convertResultList(r,(function(e){return{tagId:e.tagId,tagName:e.tagName,conversationCount:e.conversationCount,createdTime:e.tagTime}}));t({code:ce.SUCCESS,data:n})}))}}),Object.defineProperty(l.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){t.forEach((function(e){e.conversationType&&(e.type=e.conversationType)}));r._callCppProxy("addConversationsForTag",e,JSON.stringify(t),(function(){setTimeout((function(){n({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){t.forEach((function(e){e.conversationType&&(e.type=e.conversationType)})),r._callCppProxy("removeConversationsForTag",e,JSON.stringify(t),(function(){setTimeout((function(){n({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("removeTagsForConversation",e.conversationType,e.targetId,e.channelId||"",t,(function(){setTimeout((function(){n({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;return new Promise((function(o){var a=i._callCppProxy("getConversationsForTagByPage",e,t,r||20,n||""),s=i._convertResultList(a,(function(e){return _e(_e({},i._buildConversation(JSON.stringify(e))),{isTopInTag:e.topForTag})}));o({code:ce.SUCCESS,data:s})}))}}),Object.defineProperty(l.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=r._callCppProxy("getConversationUnreadCountForTag",e,t);n({code:ce.SUCCESS,data:i})}))}}),Object.defineProperty(l.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("setConversationToTopForTag",e,t.conversationType,t.targetId,t.channelId||"",r.isTop||!1,(function(){setTimeout((function(){i({code:ce.SUCCESS})}),0)}),(function(e){setTimeout((function(){i({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=t._callCppProxy("getTagsForConversation",e.conversationType,e.targetId,e.channelId||""),i=t._convertResultList(n,(function(e){return{tagId:e.tagId,tagName:e.tagName,isTop:e.isTop,createdTime:e.tagTime}}));r({code:ce.SUCCESS,data:i})}))}}),Object.defineProperty(l.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return new Promise((function(t){var r=e._callCppProxy("getUnreadAndMentionCount",[le.GROUP],"");t({code:ce.SUCCESS,data:r})}))}}),Object.defineProperty(l.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){var l;return de(this,(function(_){return l={arch:t(),platform:e(),type:n(),version:i(),release:o(),uptime:a(),cpus:s(),freemem:u(),totalmem:c(),networkInterfaces:r()},[2,{code:ce.SUCCESS,data:l}]}))}))}}),Object.defineProperty(l.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){return de(this,(function(e){return[2,{code:ce.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))}}),Object.defineProperty(l.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("callInfoSignaling",e,t,r,(function(e,t){setTimeout((function(){i({code:ce.SUCCESS,data:{key:e,value:t}})}),0)}),(function(e){setTimeout((function(){i({code:e})}),0)}))}))}}),Object.defineProperty(l.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.tcpMgr.getConnectionStatus()!==Ge.DISCONNECTED?Promise.resolve({code:ce.RC_CONN_PROXY_UNAVAILABLE}):Promise.resolve(un(e,this.logger))}}),Object.defineProperty(l.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve(cn())}}),Object.defineProperty(l.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return function(e,t,r){return new Promise((function(n){var i=/^https/.test(t)?on:tn;r.info(D.A_TEST_PROXY_O,JSON.stringify({msg:"test proxy",proxy:e,testHost:t}));var o=i(t,e,(function(e){var t=200===e.statusCode?0:e.statusCode;e.setEncoding("utf8");var r="";e.on("data",(function(e){r+=e})),e.once("end",(function(){n({status:t||0,data:r})}))}));o.once("timeout",(function(){return n({status:0})})),o.once("error",(function(e){return n({status:0,data:e.stack})})),o.end()}))}(e,t,this.logger)}}),Object.defineProperty(l.prototype,"checkDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=t._callCppProxy("checkDuplicateMessage",e);r({code:ce.SUCCESS,data:n})}))}}),Object.defineProperty(l.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){n._callCppProxy("updateSubscribeStatus",t,De.SUBSCRIBE,e,(function(){i({code:ce.SUCCESS})}),(function(e,t){i({code:e,data:t})}),r)}))}}),Object.defineProperty(l.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("updateSubscribeStatus",t,De.UNSUBSCRIBE,e,(function(){n({code:ce.SUCCESS})}),(function(e){n({code:e})}),0)}))}}),Object.defineProperty(l.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._callCppProxy("getSubscribeUserList",e,t,r),i=this._buildSubscribeEventData(n).map((function(e){var t=e.userId,r=e.subscribeType,n=e.subscribeTime,i=e.expiry,o=e.details,a={userId:t,subscribeType:r,subscribeTime:n,expiry:i};return r===Ue.ONLINE_STATUS&&(a.details=Gt(o)),a}));return Promise.resolve({code:ce.SUCCESS,data:i})}}),Object.defineProperty(l.prototype,"setDuplicateMessageConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._callCppProxy("setDuplicateMessageConfig",[le.CHATROOM],Jn.cuid,e);return Promise.resolve({code:t})}}),Object.defineProperty(l.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._callCppProxy("getSubscribeStatusByUserIds",e,t),n=this._buildSubscribeEventData(r).map((function(e){var t=e.userId,r=e.subscribeType,n=e.subscribeTime,i=e.expiry,o=e.details,a={userId:t,subscribeType:r,subscribeTime:n,expiry:i};return r===Ue.ONLINE_STATUS&&(a.details=Gt(o)),a}));return Promise.resolve({code:ce.SUCCESS,data:n})}}),Object.defineProperty(l.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=[];Object.keys(e).forEach((function(n){var i;if("extraProfile"===n&&e.extraProfile){if(e.extraProfile){var o=e.extraProfile;Object.keys(o).forEach((function(e){r.push(JSON.stringify({key:e,value:o[e]||""}))}))}}else t.push(JSON.stringify({key:n,value:(null===(i=e[n])||void 0===i?void 0:i.toString())||""}))}));var n=Ln.create(this.logger,"updateUserProfile");return n.invoke(t,r,(function(e,t){if(e===ce.SUCCESS)n.ok();else{var r=Mr(t);n.fail(e,{errorKey:r[0],errorKeys:r})}})).result()}}),Object.defineProperty(l.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("getUserProfiles",e,(function(e,n){r({code:e,data:t._string2UserProfileInfoList(n)})}))}))}}),Object.defineProperty(l.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return new Promise((function(t){e._callCppProxy("getOwnUserProfile",(function(r,n){t({code:r,data:e._string2userProfileInfo(n)})}))}))}}),Object.defineProperty(l.prototype,"_string2userProfileInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;try{var r=JSON.parse(e),n=r.userProfile.reduce((function(e,t){var r=JSON.parse(t);return["gender","role","level"].includes(r.key)?e[r.key]=Number(r.value):e[r.key]=r.value,e}),{});return n.userId=r.userId,n.extraProfile=(null===(t=r.userExtProfile)||void 0===t?void 0:t.reduce((function(e,t){var r=JSON.parse(t);return e[r.key]=r.value,e}),{}))||{},n}catch(t){this.logger.error(br.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return{}}}),Object.defineProperty(l.prototype,"_string2UserProfileInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;try{return JSON.parse(e).list.map((function(e){return t._string2userProfileInfo(e.obj)}))}catch(t){this.logger.error(br.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return[]}}),Object.defineProperty(l.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("updateUserProfilePermission",e,(function(){r({code:ce.SUCCESS})}),(function(e){r({code:e})}))}))}}),Object.defineProperty(l.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return new Promise((function(t){e._callCppProxy("getUserProfilePermission",(function(e,r){t({code:e,data:r})}))}))}}),Object.defineProperty(l.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callCppProxy("getUserProfileByUniqueId",e,(function(e,n){r({code:e,data:t._string2userProfileInfo(n)})}))}))}}),Object.defineProperty(l.prototype,"getMatchedMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i,o=this._callCppProxy("getMatchedMessage",e.conversationType,e.targetId,t,r,n,e.channelId||""),a=[];try{i=JSON.parse(o).list;for(var s=0;s<i.length;s++){var u=this._buildMessage(i[s].obj);a.push(u)}}catch(e){return this.logger.error(br.P_PARSE_JSON_MSGS_E,o),Promise.resolve({code:ce.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ce.SUCCESS,data:a})}}),Object.defineProperty(l.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=this,n=e.map((function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return{targetId:r,channelId:void 0===n?"":n,type:t}})),i=this._callCppProxy("getConversations",JSON.stringify(n));try{t=JSON.parse(i).list.map((function(e){return r._buildConversation(e.obj)}))}catch(e){return this.logger.error(br.P_PARSE_JSON_MSGS_E,i),Promise.resolve({code:ce.MAIN_PROCESS_ERROR})}return Promise.resolve({code:ce.SUCCESS,data:t})}}),Object.defineProperty(l.prototype,"handleErrorCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e!==ce.SUCCESS&&setTimeout((function(){return t(Nt(e))}),0)}}),Object.defineProperty(l.prototype,"_convertGroupInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e&&0!==e.length?e.map((function(e){var t=e.groupId,r=e.baseInfo,n=e.createTime,i=e.createUserId,o=e.extraInfo,a=e.memberCount,s=e.ownerId,u=e.remark,c=e.joinTime,l=e.role,_=kt(r),E=kt(o);return{groupId:t,groupName:_.name||"",portraitUri:_.portraitUrl||"",introduction:_.introduction||"",notice:_.announcement||"",joinPermission:~~_.joinPerm,removeMemberPermission:~~_.removePerm,invitePermission:~~_.memInvitePerm,inviteHandlePermission:~~_.invitePerm,groupInfoEditPermission:~~_.profilePerm,memberInfoEditPermission:~~_.memProfilePerm,extProfile:E,creatorId:i||"",ownerId:s||"",createTime:n||0,membersCount:a||0,remark:u||"",joinedTime:c||0,role:l||K.UNDEF}})):[]}}),Object.defineProperty(l.prototype,"_convertUpdateGroupInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&0!==e.length?e.map((function(e){var t=e.groupId,r=e.baseInfo,n=e.createTime,i=e.createUserId,o=e.extraInfo,a=e.memberCount,s=e.ownerId,u=e.remark,c=e.joinTime,l=e.role,_=kt(r),E=kt(o);return JSON.parse(JSON.stringify(_e(_e(_e(_e(_e(_e(_e(_e(_e({groupId:t},function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Ft(e.joinPerm),removeMemberPermission:Ft(e.removePerm),invitePermission:Ft(e.memInvitePerm),inviteHandlePermission:Ft(e.invitePerm),groupInfoEditPermission:Ft(e.profilePerm),memberInfoEditPermission:Ft(e.memProfilePerm)}))}(_)),o.length>0&&{extProfile:E}),i&&{creatorId:i}),s&&{ownerId:s}),n&&{createTime:n}),a&&{membersCount:a}),u&&{remark:u}),c&&{joinedTime:c}),l&&{role:l})))})):[]}}),Object.defineProperty(l.prototype,"_convertGroupMemberInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&0!==e.length?e.map((function(e){var t=e.userId,r=e.nickname,n=e.groupNickname,i=e.portraitUrl,o=e.joinTime;return{userId:t,name:r||"",portraitUri:i||"",nickname:n||"",role:e.role||0,joinedTime:o||0,extra:e.extra||""}})):[]}}),Object.defineProperty(l.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i,o,a;return de(this,(function(s){return i=Ar(t),o=Ar(r||{}),[2,(a=Ln.create(this.logger,"createGroup")).invoke(e,n,JSON.stringify(i),JSON.stringify(o),(function(e,t,r,n){e===ce.SUCCESS?a.ok():a.fail(e,{errorKeys:Mr(n),processCode:t})})).result()]}))}))}}),Object.defineProperty(l.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n,i,o;return de(this,(function(a){return n=Ar(t),i=Ar(null!=r?r:{}),[2,(o=Ln.create(this.logger,"updateGroupInfo")).invoke(e,JSON.stringify(n),JSON.stringify(i),(function(e,t,r,n){e===ce.SUCCESS?o.ok():o.fail(e,{errorKeys:Mr(n)})})).result()]}))}))}}),Object.defineProperty(l.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t=this;return de(this,(function(r){return[2,new Promise((function(r){var n=t._callCppProxy("getGroupInfoByIds",e,(function(e,n,i,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){t.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){r({code:ce.MAIN_PROCESS_ERROR})}),0)}setTimeout((function(){r({code:ce.SUCCESS,data:t._convertGroupInfoList(a)})}),0)}else setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))]}))}))}}),Object.defineProperty(l.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n=this;return de(this,(function(i){return[2,new Promise((function(i){var o=yr(r),a=n._callCppProxy("kickOutGroupMember",e,t,JSON.stringify(o),(function(e,t){setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(a,i)}))]}))}))}}),Object.defineProperty(l.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return[2,new Promise((function(n){var i=yr(t),o=r._callCppProxy("quitGroup",e,JSON.stringify(i),(function(e,t){setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(o,n)}))]}))}))}}),Object.defineProperty(l.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t=this;return de(this,(function(r){return[2,new Promise((function(r){var n=t._callCppProxy("disbandGroup",e,(function(e,t){setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))]}))}))}}),Object.defineProperty(l.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i=this;return de(this,(function(o){return[2,new Promise((function(o){var a=yr(n),s=i._callCppProxy("transferGroup",e,t,r,JSON.stringify(a),(function(e,t){setTimeout((function(){o({code:e})}),0)}));i.handleErrorCode(s,o)}))]}))}))}}),Object.defineProperty(l.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n=this;return de(this,(function(i){return[2,new Promise((function(i){var o=n._callCppProxy("updateGroupAdmins",t,r,e,(function(e,t){setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(o,i)}))]}))}))}}),Object.defineProperty(l.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n=this;return de(this,(function(i){return[2,new Promise((function(i){var o=t===K.UNDEF?[1,2,3]:[t],a=n._callCppProxy("getGroupMembers",e,o,r.pageToken||"",r.count,r.order?1:0,(function(e,t,r,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){n.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){i({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=n._convertGroupMemberInfoList(a);setTimeout((function(){i({code:ce.SUCCESS,data:{totalCount:null!=r?r:0,data:s,pageToken:null!=t?t:""}})}),0)}else setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(a,i)}))]}))}))}}),Object.defineProperty(l.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return[2,new Promise((function(n){var i=r._callCppProxy("getGroupMembersByIds",e,t,(function(e,t,i,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){r.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=r._convertGroupMemberInfoList(a);setTimeout((function(){n({code:ce.SUCCESS,data:s})}),0)}else setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(i,n)}))]}))}))}}),Object.defineProperty(l.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return Ee(this,void 0,void 0,(function(){var i;return de(this,(function(o){return[2,(i=Ln.create(this.logger,"updateGroupMemberInfo")).invoke(e,t,r,n||"",(function(e,t,r,n){e===ce.SUCCESS?i.ok():i.fail(e,{errorKeys:Mr(n)})})).result()]}))}))}}),Object.defineProperty(l.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n=this;return de(this,(function(i){return[2,new Promise((function(i){var o=r.order?1:0,a=n._callCppProxy("getGroupMembersByNickname",e,t,r.pageToken||"",r.count,o,(function(e,t,r,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){n.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){i({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=n._convertGroupMemberInfoList(a);setTimeout((function(){i({code:ce.SUCCESS,data:{data:s,pageToken:t,totalCount:r}})}),0)}else setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(a,i)}))]}))}))}}),Object.defineProperty(l.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t=this;return de(this,(function(r){return[2,new Promise((function(r){var n=t._callCppProxy("joinGroup",e,(function(e,t,n){e===ce.SUCCESS?setTimeout((function(){r({code:e,data:{processCode:t}})}),0):setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))]}))}))}}),Object.defineProperty(l.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return[2,new Promise((function(n){var i=r._callCppProxy("inviteUsersToGroup",e,t,(function(e,t,r){e===ce.SUCCESS?setTimeout((function(){n({code:e,data:{processCode:t}})}),0):setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(i,n)}))]}))}))}}),Object.defineProperty(l.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t=this;return de(this,(function(r){return[2,new Promise((function(r){var n=e.groupId,i=e.inviterId,o=e.optType,a=e.optResult,s=e.joinUserId,u=e.reason,c=1===o?1:0,l=c&&s?s:"",_=t._callCppProxy("handleGroupInvite",n,l,i,a,c,null!=u?u:"",(function(e,t,n){e===ce.SUCCESS?setTimeout((function(){r({code:e,data:{processCode:t}})}),0):setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(_,r)}))]}))}))}}),Object.defineProperty(l.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r=[]),Ee(this,void 0,void 0,(function(){var n=this;return de(this,(function(i){return[2,new Promise((function(i){var o=e.order?1:0,a=n._callCppProxy("getGroupRequests",t,r,"",e.pageToken||"",e.count,o,(function(e,t,r,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){n.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){i({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=a.map((function(e){var t=e.groupId,r=e.joinUser,n=e.approverUser,i=e.inviterUser,o=e.type;return{groupId:t,joinMemberInfo:r,inviterInfo:i,operatorInfo:n,status:e.status,direction:e.direction,type:o,operationTime:e.operateTime,reason:e.remark}}));setTimeout((function(){i({code:e,data:{totalCount:r,data:s,pageToken:t}})}),0)}else setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(a,i)}))]}))}))}}),Object.defineProperty(l.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return[2,new Promise((function(n){var i=t.order?1:0,o=e===K.UNDEF?[1,2,3]:[e],a=r._callCppProxy("getGroups",o,t.pageToken||"",t.count,i,(function(e,t,i,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){r.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=r._convertGroupInfoList(a);setTimeout((function(){n({code:e,data:{totalCount:i,data:s,pageToken:t}})}),0)}else setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(a,n)}))]}))}))}}),Object.defineProperty(l.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return[2,new Promise((function(n){var i=t.order?1:0,o=r._callCppProxy("getGroupsByGroupName",e,t.pageToken||"",t.count,i,(function(e,t,i,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){r.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=r._convertGroupInfoList(a);setTimeout((function(){n({code:e,data:{totalCount:i,data:s,pageToken:t}})}),0)}else setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(o,n)}))]}))}))}}),Object.defineProperty(l.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t=this;return de(this,(function(r){return[2,new Promise((function(r){var n=t._callCppProxy("getGroupsByIds",e,(function(e,n,i,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){t.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){r({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=t._convertGroupInfoList(a);setTimeout((function(){r({code:e,data:s})}),0)}else setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))]}))}))}}),Object.defineProperty(l.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Ee(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return[2,new Promise((function(n){var i=t?Z.ADD:Z.REMOVE,o=r._callCppProxy("updateGroupRemark",e,t||"",i,(function(e,t){setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(o,n)}))]}))}))}}),Object.defineProperty(l.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Ee(this,void 0,void 0,(function(){var n=this;return de(this,(function(i){return[2,new Promise((function(i){var o=n._callCppProxy("updateFavoriteMembers",t,r,e,(function(e,t){setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(o,i)}))]}))}))}}),Object.defineProperty(l.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ee(this,void 0,void 0,(function(){var t=this;return de(this,(function(r){return[2,new Promise((function(r){var n=t._callCppProxy("getGroupFavoriteMembers",e,"",1e3,0,(function(e,n,i,o){if(e===ce.SUCCESS){var a=[];try{a=JSON.parse(o)}catch(e){t.logger.error(br.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){r({code:ce.MAIN_PROCESS_ERROR})}),0)}var s=a.map((function(e){return{userId:e.userId,time:e.followTime}}));setTimeout((function(){r({code:ce.SUCCESS,data:s})}),0)}else setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))]}))}))}}),Object.defineProperty(l.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){var o=n._callCppProxy("addFriend",e,t,r,(function(e,t,r){setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(o,i)}))}}),Object.defineProperty(l.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=r._callCppProxy("removeFriends",e,t,(function(e,t){setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(i,n)}))}}),Object.defineProperty(l.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=t._callCppProxy("acceptFriendRequest",e,"",(function(e,t){setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))}}),Object.defineProperty(l.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=r._callCppProxy("rejectFriendRequest",e,t||"",(function(e,t){setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(i,n)}))}}),Object.defineProperty(l.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Ln.create(this.logger,"setFriendInfo"),i=Ar(null!=r?r:{});return n.invoke(e,t,JSON.stringify(i),(function(e,t,r,i){e===ce.SUCCESS?n.ok():n.fail(e,{errorKeys:Mr(i)})})).result()}}),Object.defineProperty(l.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){var i=r._callCppProxy("checkFriendRelationship",e,t,(function(e,t){if(e===ce.SUCCESS){var r=JSON.parse(t).map((function(e){return{userId:e.userId,relationType:e.status}}));setTimeout((function(){n({code:e,data:r})}),0)}else setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(i,n)}))}}),Object.defineProperty(l.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=t._callCppProxy("getFriends",e,0,(function(e,n){try{if(e===ce.SUCCESS){var i=JSON.parse(n),o=t._convertFriendInfo(i);setTimeout((function(){r({code:e,data:{data:o,pageToken:""}})}),0)}else setTimeout((function(){r({code:e})}),0)}catch(e){t.logger.error(br.P_PARSE_JSON_MSGS_E,n),setTimeout((function(){r({code:ce.MAIN_PROCESS_ERROR})}),0)}}));t.handleErrorCode(n,r)}))}}),Object.defineProperty(l.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return new Promise((function(i){var o=e.order?1:0,a=3;t&&1===t.length&&(a=null==t?void 0:t[0]);var s=n._callCppProxy("getFriendRequestListByPage",a,r||[0,1,2,3],e.count,e.pageToken||"",o,(function(e,t,r){if(e===ce.SUCCESS){var o=[];try{o=JSON.parse(r)}catch(e){n.logger.error(br.P_PARSE_JSON_MSGS_E,r),setTimeout((function(){i({code:ce.MAIN_PROCESS_ERROR})}),0)}var a=o.map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.friendRequestType,applicationStatus:e.friendRequestStatus,operationTime:e.operateTime,remark:e.extra}}));setTimeout((function(){i({code:e,data:{data:a,pageToken:null!=t?t:""}})}),0)}else setTimeout((function(){i({code:e})}),0)}));n.handleErrorCode(s,i)}))}}),Object.defineProperty(l.prototype,"deleteFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({code:ce.NOT_SUPPORT})}}),Object.defineProperty(l.prototype,"_convertFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.map((function(e){var t=e.userId,r=e.userName,n=e.remark;return{userId:t,name:r,portraitUri:e.portraitUrl,remark:n,directionType:e.friendType,extProfile:e.extProfiles,addTime:e.addTime,inBlackList:!!e.friendAttribute}}))}}),Object.defineProperty(l.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=t._callCppProxy("getFriendByIds",e,(function(e,n){if(e===ce.SUCCESS){var i=JSON.parse(n),o=t._convertFriendInfo(i);setTimeout((function(){r({code:e,data:o})}),0)}else setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))}}),Object.defineProperty(l.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=t._callCppProxy("getFriendByNickname",e,(function(e,n){if(e===ce.SUCCESS)try{var i=JSON.parse(n),o=t._convertFriendInfo(i);setTimeout((function(){r({code:ce.SUCCESS,data:o})}),0)}catch(e){t.logger.error(br.P_PARSE_JSON_MSGS_E,n),setTimeout((function(){r({code:ce.MAIN_PROCESS_ERROR})}),0)}else setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))}}),Object.defineProperty(l.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){var n=t._callCppProxy("setFriendAuthPermission",e,(function(e,t){setTimeout((function(){r({code:e})}),0)}));t.handleErrorCode(n,r)}))}}),Object.defineProperty(l.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return new Promise((function(t){var r=e._callCppProxy("getFriendAuthPermission",(function(e,r){setTimeout((function(){t({code:e,data:r})}),0)}));e.handleErrorCode(r,t)}))}}),Object.defineProperty(l.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.startTime,r=e.spanMinutes,n=e.level,i=e.timezone,o=Ln.create(this.logger,"addPushSetting");return o.invoke(t,r,n,i||"",(function(){return o.ok()}),(function(e){return o.fail(e)})).result()}}),Object.defineProperty(l.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Ln.create(this.logger,"removePushSetting");return e.invoke((function(){return e.ok()}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(l.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Ln.create(this.logger,"queryPushSetting");return e.invoke((function(t,r,n,i){var o={startTime:t,spanMinutes:r,level:n,timezone:i};e.ok(o)}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(l.prototype,"setDataBaseLogConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._callCppProxy("setDataBaseLogConfig",e)}}),Object.defineProperty(l.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ee(this,void 0,void 0,(function(){return de(this,(function(e){return[2,vt($t.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),Object.defineProperty(l.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ln.create(this.logger,"sendReadReceiptByReadReceiptType");return r.invoke(e.conversationType,e.targetId,e.channelId||"",vr,t,(function(e,t,n){e!==ce.SUCCESS?r.fail(e):r.ok()})).result()}}),Object.defineProperty(l.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ln.create(this.logger,"getReadReceiptCount");return r.invoke(e.conversationType,e.targetId,e.channelId||"",t,(function(e,t){if(e===ce.SUCCESS){var n=JSON.parse(t).map((function(e){return JSON.parse(e)})).map((function(e){return{messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount}}));r.ok(n)}else r.fail(e)})).result()}}),Object.defineProperty(l.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Ln.create(this.logger,"getReadReceiptUsersByUid");return n.invoke(e.conversationType,e.targetId,e.channelId||"",t,r.pageToken||"",!r.readStatus,r.pageCount,0===r.order,(function(e,t,r,i){if(e===ce.SUCCESS){var o={pageToken:t,totalCount:i,users:JSON.parse(r).map((function(e){return JSON.parse(e)})).map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}}))};n.ok(o)}else n.fail(e)})).result()}}),Object.defineProperty(l.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Ln.create(this.logger,"getReadReceiptStatusForUsersInMessage");return n.invoke(e.conversationType,e.targetId,e.channelId||"",t,r,(function(e,t,r,i){if(e===ce.SUCCESS){var o=JSON.parse(r).map((function(e){return JSON.parse(e)})).map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}}));n.ok({pageToken:"",totalCount:0,users:o})}else n.fail(e)})).result()}}),l}();Un=new WeakSet,Dn=function(e,t){var r;void 0===t&&(t={});var n=t.isOffLineMessage,i=t.buildFrom,o=e.channelId,a=e.conversationType,s=e.targetId,u=e.senderUserId,c=e.content,l=e.objectName,_=e.messageUid,E=e.direction,d=e.status,f=e.messageId,p=e.sentTime,R=e.readReceiptRequest,b=e.supportExt,O=e.pushContent,C=e.pushTitle,g=e.pushId,T=e.pushConfig,h=e.templateId,I=e.disableTitle,S=e.forcePushDetail,v=e.hasMore,N=e.directedUsers,P=e.noNotification,m=e.disableUpdateLastMessage,A=e.needReceipt,y=e.sendReceipt,L=this._buildIsMentioned(c,f),M=L.isMentioned,U=L.msgContent,D=this._buildMsgOption(l),w=this._buildSupportExt(b,i,e),G=Mt(n)?p<this.tcpMgr.getConnectedTime():n,V={};T&&(V=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,c,l,_,E,d,f,p,R=Object.keys(e);if(0!==R.length){var b=R[0];switch(b){case"HW":return n.channelIdHW=null===(t=e[b])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[b])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(a=e[b])||void 0===a?void 0:a.image,void(n.categoryHW=null===(s=e[b])||void 0===s?void 0:s.category);case"MI":return void(n.channelIdMi=null===(u=e[b])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(c=e[b])||void 0===c?void 0:c.channelId);case"VIVO":return n.typeVivo=null===(l=e[b])||void 0===l?void 0:l.classification,void(n.categoryVivo=null===(_=e[b])||void 0===_?void 0:_.category);case"APNS":return r.threadId=e[b]["thread-id"],r.apnsCollapseId=e[b]["apns-collapse-id"],r.category=e[b].category,r.richMediaUri=e[b].richMediaUri,void(r.interruptionLevel=e[b]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[b].collapse_key||"",imageUrl:e[b].imageUrl||"",priority:e[b].priority||""});case"HONOR":return n.importanceHonor=null===(E=e[b])||void 0===E?void 0:E.importance,void(n.imageUrlHonor=null===(d=e[b])||void 0===d?void 0:d.image);case"OHOS":i.category=null===(f=e[b])||void 0===f?void 0:f.category,i.image=null===(p=e[b])||void 0===p?void 0:p.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}}(T,g));var j=_e(_e({},V),{pushTitle:C,pushContent:O,pushData:O,disablePushTitle:I,forceShowDetailContent:S,templateId:h}),F={channelId:o,conversationType:a,targetId:s,senderUserId:u,content:U||{},messageType:l,messageUId:_||"",messageDirection:E,isOffLineMessage:G,sentTime:p,receivedTime:0,isPersited:D.isPersited,isCounted:D.isCounted,isMentioned:M,disableNotification:P,isStatusMessage:(null===(r=this._customMessageType[l])||void 0===r?void 0:r.isStatusMessage)||!1,canIncludeExpansion:b,expansion:b?w:null,receivedStatus:d,receivedStatusInfo:wt(d),messageId:f,pushConfig:j,hasMore:v,directedUserIds:N||[],disableUpdateLastMessage:m,needReceipt:A,sendReceipt:y};if(E===Fe.RECEIVE?F.receivedStatus=this._compatibleReceivedStatus(F.receivedStatusInfo):E===Fe.SEND&&(F.sentStatus=d),R){var k=this._handleReadReceiptRequest(R);F.readReceiptInfo=k}return F},wn=function(e){var t=e.channelId,r=e.conversationType,n=e.targetId,i=e.unreadCount,o=e.lastestMsg,a=e.isTop,s=e.blockStatus,u=e.matchCount,c=e.hasUnreadMention,l=e.conversationTime,_=e.draft;return{channelId:t,conversationType:r,targetId:n,unreadMessageCount:i,latestMessage:-1===JSON.parse(o).messageId?null:this._buildMessage(o),hasMentioned:c,notificationStatus:st(s),isTop:a,lastUnreadTime:0,matchCount:u,operationTime:l,notificationLevel:s,draft:_}},Gn=function(e,t){var r=this;try{var n=JSON.parse(e).list.map((function(e){return r._buildConversation(e.obj)})).reverse();return vt({list:n,hasNext:t})}catch(e){return Nt(ce.MAIN_PROCESS_ERROR,"parse conversation list result error")}},Vn=function(e){var t=e.content,r=t.messageUId,n=t.sentTime;t.isAdmin;var i=t.isDelete,o=this._callCppProxy("getMessage",r),a=this._buildMessage(o,{isOffLineMessage:!1}),s=a.messageId>0;if(i)return s&&this._callCppProxy("deleteMessages",[a.messageId]),s;if(s&&a.messageType===he.RECALL_NOTIFICATION_MESSAGE)return!1;var u={recallTime:Date.now(),admin:!!e.content.isAdmin,isDelete:!!e.content.isDelete,originalObjectName:a.messageType,originalMessageContent:a.content,recallActionTime:e.sentTime,operatorId:e.senderUserId};if(e.content.user&&(u.user=e.content.user),e.content.extra&&(u.extra=e.content.extra),a.messageType===he.TextMessage&&(u.recallContent=a.content.content),!s){var c=e.conversationType,l=e.targetId,_=e.senderUserId,E=e.channelId,d=e.messageDirection;return this._callCppProxy("insertMessage",c,l,_,he.RECALL_NOTIFICATION_MESSAGE,JSON.stringify(u),(function(){}),(function(){}),d,1,30,n,"",0,r,!1,!0,JSON.stringify({}),E||""),!0}return a.receivedStatus||this.setMessageReceivedStatus(a.messageId,1),this._callCppProxy("setMessageContent",a.messageId,JSON.stringify(u),he.RECALL_NOTIFICATION_MESSAGE),!0},jn=function(e){return Ee(this,void 0,void 0,(function(){var t,r,n,i,o,a,s;return de(this,(function(u){return t=e.channelId,r=e.count,n=e.startTime,i=e.conversationTypes,o=e.topPriority,a=i&&i.length>0?i:Qe(Je),s=void 0===t?Nn(this.logger,!1,"getConversationListWithAllChannel",a):Nn(this.logger,!1,"getConversationListByPageWithTopPriority",a,n,r,!!o,t||""),[2,be(this,Un,"m",Gn).call(this,s)]}))}))},Fn=function(e){var t;return Ee(this,void 0,void 0,(function(){var r,n,i;return de(this,(function(o){return r=null==e?void 0:e.channelId,n=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:Qe(Je),i=Mt(r)?Nn(this.logger,!1,"getTopConversations",n):Nn(this.logger,!1,"getTopConversations",n,r),[2,be(this,Un,"m",Gn).call(this,i,!1)]}))}))},kn=function(e){var t;return Ee(this,void 0,void 0,(function(){var r,n;return de(this,(function(i){return r=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:Qe(Je),n=Nn(this.logger,!1,"getUnreadConversationList",r),[2,be(this,Un,"m",Gn).call(this,n,!1)]}))}))},Bn=function(e){return Ee(this,void 0,void 0,(function(){var t,r,n;return de(this,(function(i){return t=null==e?void 0:e.channelId,r=Qe(Je),n=void 0===t?Nn(this.logger,!1,"getConversationListWithAllChannel",r):Nn(this.logger,!1,"getConversationList",r,t),[2,be(this,Un,"m",Gn).call(this,n,!1)]}))}))},Hn=function(e){return Ee(this,void 0,void 0,(function(){var t,r,n,i,o;return de(this,(function(a){return t=e.index,r=e.limit,n=e.conversationTypes,i=n&&n.length>0?n:Qe(Je),o=Nn(this.logger,!1,"getConversationListWithAllChannelByPage",i,t,r),[2,be(this,Un,"m",Gn).call(this,o)]}))}))},xn=function(e,t,r,n,i){var o=this.logger.createTraceId(),a=Ln.create(this.logger,"updateConversationStatus",o),s=JSON.stringify(e.map((function(e){return{conversation_query_param:{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId,channel_id_valid:"string"==typeof e.channelId&&e.channelId.length>0},block_op:t,top_op:r,create_conversation:!!i,update_time:!!n}})));return a.invoke(s,(function(){return a.ok()}),(function(e){return a.fail(e)})).result()},process.title="".concat((Kn=process.title,-1!==(Xn=Kn.lastIndexOf("/"))?Kn.substring(Xn+1):Kn)," PsService"),function(e){var t=this,r=pe(e.argv.slice(2),6),n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],c="true"===o,l=Nr(e),_=l.sendCallback,E=l.sendError,d=l.sendEvent,f=l.sendResponse,p=Hr?new Qn(n,i,d,c,~~a,"true"===s,"true"===u):null;e.on("message",(function(e){return Ee(t,void 0,void 0,(function(){var t,r,n,i,o,a;return de(this,(function(s){switch(s.label){case 0:return t=e.reqId,r=e.method,n=e.args,i=e.hasResponse,p?i?("sendMessage"===r&&(o=n[3],n[3]=function(e){_({reqId:o,data:e})}),[4,p.callProxy.apply(p,Re([r],pe(n),!1))]):[3,2]:[2,f({reqId:t,success:!0,data:{code:ce.ADDON_NOT_EXIST,msg:"Cannot find module ".concat(Ur)}})];case 1:return a=s.sent(),f({reqId:t,success:true,data:a}),[3,3];case 2:p.sendProxy.apply(p,Re([r],pe(n),!1)),s.label=3;case 3:return[2]}}))}))})),e.on("beforeExit",(function(e){null==p||p.destroy()})),e.on("uncaughtException",(function(e){E("uncaughtException ".concat(e.stack||e.toString()))})),e.on("unhandledRejection",(function(e){E("unhandledRejection ".concat(e.stack))}))}(process);