@rongcloud/electron 5.30.0 → 5.32.0-c-rtc-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.
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{app as e,ipcMain as t}from"electron";import{dirname as r,resolve as n}from"path";import{platform as i,arch as o,networkInterfaces as a,cpus as s,release as u,type as c,version as l,uptime as d,freemem as f,totalmem as _}from"os";import{fork as p,execSync as E}from"child_process";import{createRequire as h}from"module";import{createDecipheriv as b,createHash as g}from"crypto";import{existsSync as R,mkdirSync as v,readFileSync as I,writeFileSync as O}from"fs";import{fileURLToPath as T,parse as m}from"url";import{request as C,Agent as N}from"http";import{request as S,Agent as y}from"https";import P from"zlib";import{isIP as A,Socket as L}from"net";import{EventEmitter as M}from"events";import{connect as U}from"tls";var D;!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"}(D||(D={}));var w,j,V,G,k,F,B,H,J,x,W,Y,K,X,Q,Z,q,z,$,ee,te,re,ne,ie,oe,ae,se,ue,ce,le="L-connect-T",de="L-connect-R",fe="L-connect-S",_e="L-TEST-O",pe="L-get_navi-T",Ee="L-get_navi-R",he="L-request-T",be="L-request-R",ge="L-parse_navi-E",Re="L-rejoin_chatroom-T",ve="L-rejoin_chatroom-R",Ie="L-check_alive_im-T",Oe="L-check_alive_im-R",Te="L-check_alive_im-S",me="L-report_full_log-O",Ce="L-report_full_log-T",Ne="L-report_full_log-R",Se="L-parse_navi_logpolicy-E",ye="L_REALTIME_LOG_T",Pe="L_REALTIME_LOG_R",Ae="L_REALTIME_LOG_O",Le="A-remove_proxy-O",Me="A-set_proxy-O",Ue="A-test_proxy-O",De="L-get_static_conf-T",we="L-get_static_conf-R",je="L-get_static_conf-E",Ve="L-cloud_disabled",Ge="L-cloud_overclock",ke="L-cloud_appkey_region_error",Fe="L-cloud_config_data_error",Be="L-cloud_set_cache-O",He="L-cloud_get_cache-O",Je="L-cloud_set_area_code-O",xe="L-cloud_set_mrtr-O",We="L-parse_json-E",Ye="L-event_loop_blocking-S",Ke="P-get_sys_version-E",Xe="L-pull_offline_message_finished-S";!function(e){e[e.BOTH=2]="BOTH"}(w||(w={})),function(e){e[e.BOTH=2]="BOTH"}(j||(j={})),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"}(G||(G={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(k||(k={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(F||(F={})),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"}(J||(J={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(x||(x={})),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.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",e[e.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",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.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",e[e.TRANS_FAILED=28401]="TRANS_FAILED",e[e.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",e[e.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",e[e.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",e[e.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",e[e.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",e[e.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",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.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",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.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",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.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",e[e.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",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.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",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={}));
1
+ import{ipcMain as e,app as t}from"electron";import{dirname as r,resolve as n}from"path";import{platform as i,arch as o,networkInterfaces as a,cpus as s,release as u,type as c,version as l,uptime as d,freemem as f,totalmem as _}from"os";import{fork as p,execSync as E}from"child_process";import{createRequire as h}from"module";import{createDecipheriv as g,createHash as b}from"crypto";import{existsSync as R,mkdirSync as v,readFileSync as I,writeFileSync as O}from"fs";import{fileURLToPath as T,parse as N}from"url";import{Agent as m,request as C}from"http";import{Agent as y,request as S}from"https";import P from"zlib";import{isIP as A,Socket as L}from"net";import{EventEmitter as M}from"events";import{connect as U}from"tls";var D;!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"}(D||(D={}));var w,j,V,G,k,F,H,B,J,x,W,Y,K,X,Q,Z,q,z,$,ee,te,re,ne,ie,oe,ae,se,ue,ce,le="L-connect-T",de="L-connect-R",fe="L-connect-S",_e="L-TEST-O",pe="L-get_navi-T",Ee="L-get_navi-R",he="L-request-T",ge="L-request-R",be="L-parse_navi-E",Re="L-rejoin_chatroom-T",ve="L-rejoin_chatroom-R",Ie="L-check_alive_im-T",Oe="L-check_alive_im-R",Te="L-check_alive_im-S",Ne="L-report_full_log-O",me="L-report_full_log-T",Ce="L-report_full_log-R",ye="L-parse_navi_logpolicy-E",Se="L_REALTIME_LOG_T",Pe="L_REALTIME_LOG_R",Ae="L_REALTIME_LOG_O",Le="A-remove_proxy-O",Me="L-set_proxy-O",Ue="L-test_proxy-T",De="L-test_proxy-R",we="L-get_static_conf-T",je="L-get_static_conf-R",Ve="L-get_static_conf-E",Ge="L-cloud_disabled",ke="L-cloud_overclock",Fe="L-cloud_appkey_region_error",He="L-cloud_config_data_error",Be="L-cloud_set_cache-O",Je="L-cloud_get_cache-O",xe="L-cloud_set_area_code-O",We="L-cloud_set_mrtr-O",Ye="L-parse_json-E",Ke="L-event_loop_blocking-S",Xe="P-get_sys_version-E",Qe="L-pull_offline_message_finished-S";!function(e){e[e.BOTH=2]="BOTH"}(w||(w={})),function(e){e[e.BOTH=2]="BOTH"}(j||(j={})),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"}(G||(G={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(k||(k={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(F||(F={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(H||(H={})),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"}(B||(B={})),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"}(J||(J={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(x||(x={})),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.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",e[e.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",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.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",e[e.TRANS_FAILED=28401]="TRANS_FAILED",e[e.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",e[e.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",e[e.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",e[e.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",e[e.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",e[e.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",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.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",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.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",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.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",e[e.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",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.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",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={}));
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@ 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
15
  ***************************************************************************** */
16
- var Qe=function(e,t){return Qe=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])},Qe(e,t)};function Ze(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}Qe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var qe,ze=function(){return ze=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},ze.apply(this,arguments)};function $e(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 et(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 tt(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 rt(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 nt(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 it(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 ot(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.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"}(qe||(qe={}));var at,st,ut,ct=0,lt=1,dt=2,ft=3,_t=4,pt=5,Et=function(e){var t=[qe.PRIVATE,qe.GROUP,qe.SYSTEM,qe.PUBLIC_SERVICE,qe.APP_PUBLIC_SERVICE];switch(e){case ct:return t;case lt:return[qe.PRIVATE,qe.GROUP];case dt:return nt(nt([],rt(t),!1),[qe.ULTRA_GROUP],!1);case ft:return nt(nt([],rt(t),!1),[qe.ULTRA_GROUP,qe.CHATROOM],!1);case _t:return nt(nt([],rt(t),!1),[qe.ULTRA_GROUP,qe.CHATROOM,qe.RTC_ROOM,qe.CUSTOMER_SERVICE,qe.DISCUSSION],!1);case pt:return[qe.PRIVATE,qe.GROUP,qe.ULTRA_GROUP]}};!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"}(at||(at={})),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"}(st||(st={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(ut||(ut={}));var ht,bt,gt,Rt,vt,It,Ot,Tt,mt,Ct,Nt,St,yt,Pt,At,Lt,Mt,Ut,Dt,wt,jt,Vt="RC:TxtMsg",Gt="RC:VcMsg",kt="RC:HQVCMsg",Ft="RC:LogCmdMsg",Bt="RC:MsgExMsg",Ht="RC:ReferenceMsg",Jt="RC:RcCmd",xt="RC:RcNtf",Wt="RC:ReadNtf",Yt="RC:RRReqMsg",Kt="RC:RRRspMsg",Xt="RC:SRSMsg",Qt="RC:RRMsg",Zt="RC:RSMsg",qt="RC:Delivered",zt="RC:DRMsg",$t="RC:ChrmMemChange",er="RC:ChrmSyncMsg",tr="RC:ChrmBlockMsg",rr="RC:ChrmBanMsg",nr="RC:CCConfigChangeRequestMsg";!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(ht||(ht={})),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"}(bt||(bt={})),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"}(gt||(gt={})),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"}(Rt||(Rt={})),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"}(vt||(vt={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(It||(It={})),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"}(Ot||(Ot={})),function(e){e[e.typing=0]="typing"}(Tt||(Tt={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(mt||(mt={})),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"}(Ct||(Ct={})),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"}(Nt||(Nt={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(St||(St={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(yt||(yt={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(Pt||(Pt={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(At||(At={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(Lt||(Lt={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(Mt||(Mt={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Ut||(Ut={})),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"}(Dt||(Dt={})),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"}(wt||(wt={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(jt||(jt={}));var ir,or,ar,sr,ur,cr,lr,dr,fr,_r=function(e){return e<=wt.NOT_SET?jt.CLOSE:jt.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"}(ir||(ir={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(or||(or={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(ar||(ar={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(sr||(sr={})),function(e){e[e.CURRENT=2]="CURRENT"}(ur||(ur={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(cr||(cr={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(lr||(lr={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(dr||(dr={})),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"}(fr||(fr={}));var pr,Er,hr=0;!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"}(pr||(pr={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(Er||(Er={}));var br=72e5,gr="5.30.0".replace(/-.+$/,""),Rr="rongcloudsystem",vr="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};vr.engine="5.30.0";var Ir=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)&&(vr[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 vr.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 vr}}),e}();var Or=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)}))},Tr=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),mr=Date.now(),Cr=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Nr=function(e){return function(e){return"string"==typeof e}(e)&&/https?:\/\//.test(e)},Sr=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},yr=function(e){return{isRead:(e&ir.READ)===ir.READ,isListened:(e&ir.LISTENED)===ir.LISTENED,isDownload:(e&ir.DOWNLOADED)===ir.DOWNLOADED,isRetrieved:(e&ir.RETRIEVED)===ir.RETRIEVED}},Pr=function(e){return[Ct.iOS,Ct.Android,Ct.Web,Ct.PC,Ct.Mini,Ct.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]}))},Ar=function(e,t,r){return t?1===r?at.TLS:at.RMTP:"http"===e?at.WS:at.WSS},Lr=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 nt([],rt(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:Ar(a,t,s),weight:r.length-n,race:!1})})),nt([],rt(u),!1)},Mr=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Ur=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Dr=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=Or(),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)},wr=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,d=t.importanceHonor,f=t.imageUrlHonor,_=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),p=[{HW:{channelId:i||"",importance:s||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:l||""}},{APNS:_.APNS},{FCM:_.FCM},{HONOR:{importance:d||Ut.NORMAL,image:f||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(p)},jr=function(){var e=Ir.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t};function Vr(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!==at.HTTP||n?"https://".concat(e):"http://".concat(e)}var Gr=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(We,JSON.stringify({ossConfig:n,error:e}))}return i};var kr,Fr=function(e){function t(t){var r=e.call(this,t)||this;return r.name="RCError",r}return Ze(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),Br=function(){function e(){kr.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){ot(this,kr,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return it(this,kr,"f")},enumerable:!1,configurable:!0}),e}();kr=new WeakMap;var Hr=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=tt(this._map),i=n.next();!i.done;i=n.next()){var o=rt(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 Br,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,nt([i],rt(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}nt([],rt(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,nt([e],rt(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}();!function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(r,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(r,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}Ze(t,e),Object.defineProperty(t.prototype,"length",{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,t){return void 0===t&&(t=!1),$e(this,void 0,void 0,(function(){return et(this,(function(r){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[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,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e,t,r,n,i,o;return et(this,(function(a){switch(a.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=a.sent(),t=e.isOk,r=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw new Error("".concat(this._name,": 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=nt([],rt(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[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}})}(Hr),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){return $e(this,void 0,void 0,(function(){return et(this,(function(t){if(!this._resolve)throw new Error("BatchSync is closed");return this.validate&&!this.validate(e)||this._data.add(e),[2,this._handlerPromise]}))}))}}),Object.defineProperty(e.prototype,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e,t;return et(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=nt([],rt(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()]}}))}))}})}();var Jr=function(){function e(e,t,r){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=r}return Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){return et(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 $e(this,void 0,void 0,(function(){return et(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))}}),Object.defineProperty(e.prototype,"orSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?this:e(this.code)}}),Object.defineProperty(e.prototype,"trans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?xr(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?xr(void 0,this.msg):Wr(this.code,this.msg)}}),e}(),xr=function(e,t){return new Jr(0,t||"success",e)},Wr=function(e,t,r){return new Jr(e,t||"fail: ".concat(e),r)};!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,"isFailed",{get:function(){return!this._isValid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isFailed&&(0===this._code||r)&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"setFailed",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid=!1,this.fail(e,t)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?Wr(this._code,this._errmsg):xr()}}),Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isFailed||e(this),this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;var i=n?r(t):null==t||r(t);return this._isValid=i,this.isFailed&&(this._errmsg="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.isFailed)return this;if(this.validate(e,t,r,n),this.isFailed)throw Fr.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,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),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,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,0xe677d21fdbff,r)}}),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 Yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Kr(e){var t,r,n,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=Yr.indexOf(e.charAt(u++))<<2|(i=Yr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=Yr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(a=Yr.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(r)),64!==a&&(s+=String.fromCharCode(n));return s}var Xr,Qr=1732584193,Zr=4023233417,qr=2562383102,zr=271733878,$r=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],en=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];function tn(e,t){return e<<t|e>>>32-t}function rn(e,t,r){return e&r|t&~r}function nn(e,t,r){return e^t^r}function on(e,t,r){return t^(e|~r)}function an(e){for(var t=[],r=0;r<e.length;r+=4)t.push((e[r]||0)|(e[r+1]||0)<<8|(e[r+2]||0)<<16|(e[r+3]||0)<<24);return t}function sn(e){var t=new Uint8Array(4);return t[0]=255&e,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}function un(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(sn(a),0),o.set(sn(s),4),n.set(o,e.length+r);var u,c=Qr,l=Zr,d=qr,f=zr;for(i=0;i<n.length;i+=64){for(var _=an(n.slice(i,i+64)),p=c,E=l,h=d,b=f,g=0;g<64;g++){var R=void 0,v=void 0;g<16?(R=(u=l)&d|~u&f,v=g):g<32?(R=rn(l,d,f),v=(5*g+1)%16):g<48?(R=nn(l,d,f),v=(3*g+5)%16):(R=on(l,d,f),v=7*g%16);var I=f;f=d,d=l,l+=tn(c+R+en[g]+_[v]&4294967295,$r[g]),c=I}c=c+p&4294967295,l=l+E&4294967295,d=d+h&4294967295,f=f+b&4294967295}var O=new Uint8Array(16);return O.set(sn(c),0),O.set(sn(l),4),O.set(sn(d),8),O.set(sn(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(O)}function cn(e){var t=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e);return un(t)}function ln(e){if(!e||0===e.length)return[];var t=new Set;return e.forEach((function(e){t.add(e)})),Array.from(t)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Xr||(Xr={}));var dn,fn,_n=0,pn=1;!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"}(fn||(fn={}));var En=((dn={})[fn.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:at.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},dn[fn.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:at.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},dn[fn.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:at.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},dn[fn.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:at.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},dn[fn.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:at.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},dn);function hn(e){return fn[e]?e:fn.BJ}var bn,gn=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=fn.BJ),En[hn(r)].naviUrlBase64).map((function(e){return Kr(e)})),s=[],u=rt(e.split("@"),2)[1];t&&(s=u?u.split(";"):[]);var c=o&&o.length>0?nt(nt([],rt(s),!1),rt(o),!1):nt(nt([],rt(s),!1),rt(a),!1);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return Vr(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=fn.BJ),En[hn(r)].logUrlBase64).map((function(e){return ze(ze({},e),{addr:Kr(e.addr)})})),l=[],d={level:1,itv:6,times:5};if(i)l.push.apply(l,nt([],rt(i.addrs),!1)),Object.assign(d,i.policy);else if(o)try{var f=JSON.parse(o);l.push({addr:f.url,protocol:at.HTTPS,weight:1}),d.level=f.level,d.itv=f.itv,d.times=f.times}catch(r){t.warn(Se,JSON.stringify({policy:e.logPolicy}))}var _=u?nt([{addr:u,protocol:at.HTTPS,weight:101}],rt(l),!1):nt(nt([],rt(l),!1),rt(c),!1);return{policy:d,addrs:_.filter((function(e,t){return _.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return ze(ze({},e),{addr:Vr(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=fn.BJ),En[hn(t)].miniCmpBase64).map((function(e){return Kr(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=fn.BJ),En[hn(t)].staticConfigUrlBase64).map((function(e){return Kr(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=fn.BJ),En[hn(r)].cloudControllerUrlBase64).map((function(e){return Kr(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:fn.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!fn[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||{},i=n.active,o=n.activeServer,a=(null==i?void 0:i.addrs)||[],s=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=fn.BJ),En[hn(r)].statsUrlBase64).map((function(e){return Kr(e)})),u=[];return 0!==a.length?u.push.apply(u,nt([],rt(a.sort((function(e,t){return t.weight-e.weight})).map((function(e){return Vr(e.addr,e.protocol)}))),!1)):o&&u.push(Vr(o,at.HTTPS)),s.forEach((function(e){u.includes(e)||u.push(e)})),u}}),e}(),Rn=new gn,vn=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 $e(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return et(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 Vr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=c.sent(),this.logger.error(je,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)!==Rn.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 Vr(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l;return et(this,(function(d){switch(d.label){case 0:e=(e=nt(nt([],rt(this.staticUrls),!1),rt(Rn.getStaticConfigUrl()),!1).map((function(e){return Vr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),d.label=1;case 1:d.trys.push([1,6,7,8]),t=tt(e),r=t.next(),d.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(De,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=d.sent(),a=o.code,s=o.data,200===a)return this.logger.info(we,JSON.stringify({url:n,code:a,duration:Date.now()-i})),[2,s];this.logger.warn(we,JSON.stringify({url:n,code:a,duration:Date.now()-i})),d.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return u=d.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"}(bn||(bn={}));var In,On,Tn=function(){function e(e,t,r,n){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,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:bn.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.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!==bn.DEBUG&&this.logDB.write(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 Tr}}),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<=bn.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[bn.DEBUG,bn.INFO,bn.WARN,bn.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(ze(ze({isOk:!0},n),a)),r)}else{a=null==o?void 0:o(t.data);this.warn(e,JSON.stringify(ze(ze({code:t.code,msg:t.msg},n),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),mn=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,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return $e(this,void 0,void 0,(function(){var a,s,u,c=this;return et(this,(function(l){switch(l.label){case 0:a=[],l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,o)];case 2:return s=l.sent(),Cr(s.logs)?a=s.logs.filter((function(e){return!(!e||"object"!=typeof e)||(c.logger.warn(Pe,"Invalid log entry: not an object",i),!1)})):this.logger.warn(Pe,"Invalid logs result: not an array",i),[3,4];case 3:return u=l.sent(),this.logger.warn(Pe,"Error getting logs: ".concat(u instanceof Error?u.message:String(u)),i),[3,4];case 4:return[2,{logs:a}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i;return et(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=Rn.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 $e(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_;return et(this,(function(p){switch(p.label){case 0:return this.logger.debug(Ae,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=p.sent(),o=i.success,a=i.data,o?(this.logger.debug(Ae,"compress done",t),s=Nr(r)?r:"https://".concat(r),s+="?version=".concat("5.30.0","&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(Pe,"compress failed",t),[2,{isOk:!1,itv:n}]);case 2:if(u=p.sent(),c=u.status,l=u.data,this.logger.debug(Pe,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{(_=JSON.parse(l)).nextTime&&(n=_.nextTime),d=_.level,f=_.logSwitch}catch(e){this.logger.warn(We,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:d,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p=this;return et(this,(function(E){switch(E.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||mr,a=Math.max(i-3e4,o+1),s=this.logger.createTraceId(),this.logger.debug(ye,JSON.stringify({startTime:o,endTime:a,level:t,itv:r}),s),[4,this._getLogs(o,a,t,!0,s,n)];case 1:return 0!==(u=E.sent().logs).length?[3,2]:(this.logger.debug(Pe,"no logs",s),[3,4]);case 2:return u.length>0?[4,this._sendLogs2Realtime(u,s,e,r)]:[3,4];case 3:c=E.sent(),l=c.itv,d=c.level,f=c.logSwitch,c.isOk&&(_=Math.max.apply(Math,nt([],rt(u.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(_+1),0===f&&(this.started=!1),void 0!==d&&(t=d)),r=l,E.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return p.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),$e(this,void 0,void 0,(function(){var s,u,c,l,d,f,_,p;return et(this,(function(E){switch(E.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(s=this.logger.createTraceId(),this.logger.info(Ce,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:a}),s),[4,this._getLogs(e,t,bn.DEBUG,!1,s)]);case 1:return u=E.sent().logs,this.logger.info(me,JSON.stringify({count:u.length}),s),c=Nr(n)?n:"https://".concat(n),c+="?version=".concat("5.30.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),u.length>0?[4,this.compressLogs(u)]:[3,3];case 2:return d=E.sent(),f=d.success,_=d.data,l=f?_:"compress failed",[3,4];case 3:l="no data or no database",E.label=4;case 4:return this.logger.debug(me,"compress done",s),a&&(c+="&source=cloud"),[4,this.send({url:c,body:l,method:"POST"})];case 5:return p=E.sent().status,this.logger.info(Ne,JSON.stringify({status:p}),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}();function Cn(e){try{return!(!e||"object"!=typeof e)&&("number"==typeof e.time&&("string"==typeof e.tag&&("string"==typeof e.sessionId&&("string"==typeof e.type&&"number"==typeof e.level))))}catch(e){return!1}}function Nn(){return $e(this,void 0,void 0,(function(){return et(this,(function(e){return[2,{logs:[]}]}))}))}function Sn(){}var yn=function(){function e(e,t){In.set(this,void 0),On.set(this,void 0),ot(this,In,e,"f"),ot(this,On,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return $e(this,void 0,void 0,(function(){var o,a;return et(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,it(this,In,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(Cn)}]:[2,{logs:[]}];case 2:return a=s.sent(),console.error("[LogDBProxy] read error",a),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{it(this,On,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}}),Object.defineProperty(e.prototype,"setLogReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&ot(this,In,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&ot(this,On,e,"f"),this}}),e}();In=new WeakMap,On=new WeakMap;var Pn,An=function(){function e(){}var t,r,n,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){it(this,t,"f",r)||(ot(this,t,e,"f",r),e.info(Ye,"start"),it(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){it(this,t,"f",r)&&(it(this,t,"f",r).info(Ye,"stop"),ot(this,t,null,"f",r),it(this,t,"f",n)&&(clearTimeout(it(this,t,"f",n)),ot(this,t,null,"f",n)))}}),t=e,a=function e(){var a=this,s=Date.now();ot(this,t,setTimeout((function(){var n=Date.now()-s;n>=it(a,t,"f",o)&&it(a,t,"f",r).warn(Ye,"delta time: ".concat(n,"ms")),it(a,t,"m",e).call(a)}),it(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"}(Pn||(Pn={}));var Ln=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 Mn,Un,Dn,wn,jn=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 Ln(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===Ft&&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,Sr(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 $e(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return et(this,(function(_){switch(_.label){case 0:return!this.isEable&&t===Pn.init&&this.isExire()?(this.logger.info(Ve,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Pn.newWorkChange&&this.isOverclock()?(this.logger.info(Ge,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=Vr(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.30.0",timestamp:this.timestamp},this.logger.record(Dt.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,Er.POST,o,a)]);case 1:return s=_.sent(),u=s.code,c=s.data,this.logger.record(Dt.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]:(d=Rn.setAreaCode(l),this.logger.info(Je,JSON.stringify({isChangeSuccess:d,originAreaCode:Rn.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(f=Rn.getCloudControllerUrl(l))[0]?[2,this.request(f[0],Pn.other)]:(this.logger.info(ke,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}(),Vn=function(e){return e===ce.RC_CONN_REDIRECTED},Gn=function(e){function t(t,r,n){var i=e.call(this)||this;return Mn.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:""}),wn.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:pr.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:Pt.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 Ze(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===Pt.DISCONNECTED&&e===Pt.CONNECTING&&(this._doConnectReason=lr.CONNECT,it(this,Mn,"m",Dn).call(this)),this._crtConnectionStatus===Pt.CONNECTED&&e===Pt.SUSPENDED&&(t===ce.RC_PING_EXCEED_LIMIT?this._doConnectReason=lr.TIMEOUT:t===ce.RC_CONN_REDIRECTED?this._doConnectReason=lr.REDIRECTED:this._doConnectReason=lr.RECONNECT),this._crtConnectionStatus===Pt.CONNECTED){var r={bid:jr(),cod:t,net:this.getNetwork().type,dur:Date.now()-it(this,wn,"f"),cid:this.cid};this.logger.record(Dt.IM_CONNECTION_DURATION,JSON.stringify(r)),e===Pt.SUSPENDED&&it(this,Mn,"m",Dn).call(this)}switch(this._crtConnectionStatus=e,e){case Pt.CONNECTED:this.logger.info(fe,"status: ".concat(e)),this.checkAlive(),it(this,Mn,"m",Un).call(this).emit("onConnected",this._fromSuspend);break;case Pt.CONNECTING:this.logger.warn(fe,"status: ".concat(e)),it(this,Mn,"m",Un).call(this).emit("onConnecting");break;case Pt.SUSPENDED:this._fromSuspend=!0,this.logger.warn(fe,"status: ".concat(e,", code: ").concat(t)),Vn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),it(this,Mn,"m",Un).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(fe,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),it(this,Mn,"m",Un).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===Pt.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(Dt.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 $e(this,void 0,void 0,(function(){var i,o,a;return et(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===Pt.CONNECTED?[2,xr(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(Pt.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(Pt.DISCONNECTED,o),[2,Wr(o)]):(this.setConnectionStatus(Pt.CONNECTED),[2,xr(a)])}}))}))}}),Object.defineProperty(t.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return $e(this,void 0,void 0,(function(){var o;return et(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 $e(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,_,p;return et(this,(function(E){switch(E.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(Dt.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=E.sent(),u=s.code,c=s.data,u!==ce.SUCCESS?[2,Wr(u)]:1===(l=c).type?[2,Wr(ce.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(le,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),l,t,n)]);case 2:return d=E.sent(),f=d.code,_=d.data,i||f===ce.SUCCESS||(this.retryCount+=1),Vn(f)?(this.logger.warn(de,"redirect code: ".concat(f),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,ce.CONNECTION_REFUSED].includes(f)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),p=this.cmpWeightCache.every((function(e){return e.failed})),i&&p?(this.logger.warn(de,"cpp code:".concat(f,",reture code:").concat(ce.SERVER_UNAVAILABLE),n),[2,Wr(ce.SERVER_UNAVAILABLE)]):(this.logger.warn(de,"cmp ack timeout, code: ".concat(f),n),this.setConnectionStatus(Pt.SUSPENDED,f),this.setConnectionStatus(Pt.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):f!==ce.SUCCESS?(this.logger.warn(de,"code: ".concat(f),n),[2,Wr(f)]):(this.logger.info(de,"userId: ".concat(_),n),ot(this,wn,Date.now(),"f"),this._crtUserId=_,[2,xr(_)])}}))}))}}),Object.defineProperty(t.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i=this;return et(this,(function(o){return r=this.logger.createTraceId(),this.logger.debug(_e,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return $e(i,void 0,void 0,(function(){var i,o,a;return et(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==Pt.SUSPENDED?[2]:(this.setConnectionStatus(Pt.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=s.sent(),o=i.code,a=i.isOk,this.reconnectTimer=null,a?(this.setConnectionStatus(Pt.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(o)?(this._crtConnectionStatus!==Pt.CONNECTING||(this.setConnectionStatus(Pt.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(Pt.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(t.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return Vn(e)?(this.setConnectionStatus(Pt.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===ce.RC_UDP_DISCONNECTED?(this.setConnectionStatus(Pt.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(Pt.DISCONNECTED,e)}}),Object.defineProperty(t.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(Pt.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(t.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e,t,r=this;return et(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==Pt.CONNECTED?(this._failedCount=0,this.logger.debug(Te,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(Ie,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===ce.SUCCESS?(this.logger.debug(Oe,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==Pt.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(Oe,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(Te,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(Pt.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 $e(this,void 0,void 0,(function(){return et(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(Pt.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 nt([],rt(this.cmpWeightCache),!1);var r=Lr(e,t);return this.cmpWeightCache=nt([],rt(r),!1),nt([],rt(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===at.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,nt([],rt(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,nt([],rt(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}(Hr);wn=new WeakMap,Mn=new WeakSet,Un=function(){return this},Dn=function(){this.uuid=Or(),this.retryCount=0};var kn=function(e){return e.replace(/@.+$/,"@")},Fn=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),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,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),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 $e(this,void 0,void 0,(function(){var o;return et(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 $e(this,void 0,void 0,(function(){var a,s,u,c,l,d,f,_,p,E,h,b,g,R,v,I,O;return et(this,(function(T){switch(T.label){case 0:return a=kn(e),s=this.getNaviCache(a),!t&&s&&(u=s.timestamp,c=s.naviInfo,r||Date.now()-u<br)?(this.logger.info(he,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(l=i.uuid,d=i.retryCount,f=i.reason,_={bid:jr(),ptc:ar.NAVI,cod:ce.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(o=c.type)&&void 0!==o?o:0,hos:"",cache:sr.LOCAL,v:ur.CURRENT,rsn:f,cid:"".concat(l,"_").concat(d),count:d},this.logger.record(Dt.IM_NAVI,JSON.stringify(_),n)),[2,xr(c)]):(p=Rn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(pe,JSON.stringify({token:e,uris:p}),n),[4,this.requestHandler(p,e,n,i)]);case 1:return E=T.sent(),h=E.code,b=E.data,h===ce.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(g=T.sent())?void 0:g.navi)&&(null==g?void 0:g.navi.length)>0?(R=g.navi,[4,this.requestHandler(R,e,n,i)]):[3,4];case 3:v=T.sent(),h=v.code,b=v.data,T.label=4;case 4:return h!==ce.SUCCESS?(this.logger.warn(Ee,h,n),[2,Wr(h)]):(I=b).code&&200!==I.code?(this.logger.warn(Ee,I.code,n),[2,Wr(this.transHttpCode(I.code))]):Lr(I).length>0?(this.logger.info(Ee,JSON.stringify({naviInfo:I}),n),this.setNaviCache(a,I),[2,xr(I)]):(O={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(Ee,"navi server address invalid: ".concat(JSON.stringify(O)),n),[2,Wr(ce.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return et(this,(function(_){switch(_.label){case 0:i=0,o=e.length,_.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=_.sent(),l=c.code,d=c.data,f={bid:jr(),ptc:ar.NAVI,cod:l,net:null==n?void 0:n.type,dur:Date.now()-u,spr:0,pr:(null==d?void 0:d.type)||0,hos:e[i],cache:sr.REQUEST,v:ur.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(Dt.IM_NAVI,JSON.stringify(f),r),[ce.SUCCESS,ce.RC_CONN_TOKEN_INCORRECT,ce.RC_LICENSE_EXPIRED].includes(l))return[2,l===ce.SUCCESS?xr(d):Wr(l)];_.label=3;case 3:return i+=1,[3,1];case 4:return[2,Wr(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(kn(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(kn(e),ze(ze({},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),"&v=").concat(gr,"&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}(),Bn=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 Hn(e,t){var r=Bn.get(e);r&&!r.isCustom&&console.warn("Builtin message type '".concat(e,"' cannot be registered")),t.isStatusMessage&&(t.isCounted=t.isPersited=!1),Bn.set(e,ze(ze({},t),{isCustom:!0}))}function Jn(e){return Bn.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function xn(){return Array.from(Bn.keys()).map((function(e){return ze({objectName:e},Bn.get(e))})).filter((function(e){return!e.isCustom}))}var Wn=function(){function e(e,t,r,n){Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sourceLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.identifier=e,this.sourceLanguage=t||"auto",this.targetLanguage=r,this.text=n}return Object.defineProperty(e.prototype,"isValid",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"string"==typeof this.identifier&&this.identifier.length>0&&"string"==typeof this.sourceLanguage&&(void 0===this.targetLanguage||"string"==typeof this.targetLanguage)&&(e?"string"==typeof this.text:void 0===this.text||"string"==typeof this.text)}}),Object.defineProperty(e.prototype,"toInnerParam",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{identifier:this.identifier,sourceLanguage:this.sourceLanguage,targetLanguage:this.targetLanguage,content:this.text}}}),e}();!function(e){function t(t,r,n,i){return e.call(this,t,r,n,i)||this}Ze(t,e)}(Wn),function(e){function t(t,r,n){return e.call(this,cn(t),r,n,t)||this}Ze(t,e)}(Wn);var Yn,Kn,Xn=0,Qn=0,Zn=4,qn=5;!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",e.L_HANDLE_LOW_PRIORITY_MESSAGES_T="L-handle_low_priority_messages-T",e.L_HANDLE_LOW_PRIORITY_MESSAGES_R="L-handle_low_priority_messages-R",e.L_JS_CALLBACK_EXCEPTION_E="L-js_callback_exception-E",e.L_DISCARD_MSG_O="L-discard_msg-O"}(Yn||(Yn={})),function(e){e[e.ERROR=-1]="ERROR",e[e.RESPONSE=0]="RESPONSE",e[e.EVENT=1]="EVENT",e[e.CALLBACK=2]="CALLBACK"}(Kn||(Kn={}));var zn=function(e,t,r){return $e(void 0,void 0,void 0,(function(){var n,i;return et(this,(function(o){return n=b("aes-256-cbc",t,r),i=n.update(e,"base64","utf-8"),[2,i+=n.final("utf8")]}))}))},$n=function(e){if(!R(e)){var t=n(e,"..");R(t)||$n(t),v(e)}},ei=function(e){return Object.entries(e).map((function(e){var t=rt(e,2),r=t[0],n=t[1];return{key:r,value:String(n)}}))},ti=function(e){return{removeMute:!!(null==e?void 0:e.removeMuteStatus),removeWhiteList:!!(null==e?void 0:e.removeWhiteList),removeFavoriteMembers:!!(null==e?void 0:e.removeFollow)}},ri=function(){return"undefined"==typeof __dirname?r(T(import.meta.url)):__dirname};function ni(e){return JSON.parse(e).list.map((function(e){return e.value}))}var ii,oi=n(ri(),"binding","electron-".concat(i(),"-").concat(o(),".node")),ai={addon:null},si=(ii=process,{sendError:function(e){ii.send({type:Kn.ERROR,data:{msg:e}})},sendEvent:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];ii.send({type:Kn.EVENT,data:{eventName:e,data:t}})},sendResponse:function(e){ii.send({type:Kn.RESPONSE,data:e})},sendCallback:function(e){ii.send({type:Kn.CALLBACK,data:e})}}).sendError;try{var ui=h(import.meta.url);ai.addon=ui(oi)}catch(e){console.error("error ->",oi,"\n",e),si(e.toString())}ai.addon||console.error("error -> cannot find module: ",oi);var ci=ai.addon,li=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])},di=function(e){return"string"==typeof e},fi=function(e){return di(e)?e.toUpperCase():""},_i=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},pi=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},Ei=function(e){var t=fi(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},hi=function(e){return new Promise((function(t){var r,n;e.socket.once("data",(function(n){var i,o=_i(n,r);if(!o)return 2===n[1]?(e.socket.once("data",(function(r){var n=pi(r);n?e.emit("error",new Error("SOCKS authentication failed. ".concat(n))):t()})),i=[1],li(e.socksUsername,i),li(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)}))},bi=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),A(t)){case 0:i.push(3),li(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)}))},gi=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 L,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 Ze(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 $e(r,void 0,void 0,(function(){var r;return et(this,(function(n){switch(n.label){case 0:return[4,hi(this)];case 1:return n.sent(),[4,bi(this,t,e)];case 2:return n.sent(),this.onProxied(),r=Ei(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}(M),Ri=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=rt(t,1)[0]),new gi(e).connect(n,r)},vi=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=Ri,r}return Ze(t,e),t}(N),Ii=function(e,t,r){return(t=ze(ze({},t),m(e))).port||(t.port=80),t.agent=new vi(t),C(t,r)},Oi=function(e){var t,r;return t=Ri(e),r=t.onProxied,t.onProxied=function(){var n;e.socket=t.socket,e.hostname?e.servername=e.hostname:e.host&&(n=rt(e.host.split(":"),1),e.servername=n[0]),t.socket=U(e,(function(){t.authorized=t.socket.authorized,r.call(t)})),t.socket.on("error",(function(e){t.emit("error",e)}))},t},Ti=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=Oi,n}return Ze(t,e),t}(y),mi=function(e,t,r,n){var i,o;return t.protocol="https:",!t.port&&t.host&&(i=rt(t.host.split(":"),2),t.port=i[0],t.port=i[1]),t.port||(t.port=443),o=new Ti(e,t),t.agent=o,S(e,t,r)},Ci=null;function Ni(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:ze(ze({},i),{"Accept-Encoding":"gzip, br"}),method:a};u&&(l.rejectUnauthorized=r);var d=null;Ci?((l=ze(ze({},l),Ci)).body=o,d=u?mi:Ii):(d=C,u&&(l.agent=new y(l),d=S));var f=d(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=P.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=P.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})}))}));f.once("timeout",(function(){e.warn(Yn.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:n,method:a,query:s,timeout:c})),t({status:0})})),f.setTimeout(c),f.once("error",(function(r){e.warn(Yn.P_HTTP_REQ_E,JSON.stringify({msg:r.stack,url:n,method:a,query:s,timeout:c})),t({status:0})})),f.write(o),f.end()}))}function Si(e,t){return e?(Ci=ze(ze({},Ci),e),t.info(Me,JSON.stringify({msg:"set proxy",data:Ci})),{code:ce.SUCCESS}):(Ci=null,t.info(Le,JSON.stringify({msg:"remove proxy"})),{code:ce.SUCCESS})}function yi(){var e=Ci||void 0;return{code:ce.SUCCESS,data:e}}var Pi,Ai=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 Kn.EVENT:var s=a,u=s.eventName,c=s.data;null==t||t.apply(void 0,nt([u],rt(c),!1));break;case Kn.RESPONSE:var l=a,d=l.reqId,f=l.success,_=l.data,p=i.maps[d];if(!p)return;p({success:f,data:_}),delete i.maps[d];break;case Kn.CALLBACK:null==r||r(a);break;case Kn.ERROR:var E=a.msg;null==n||n(E)}})),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 $e(this,void 0,void 0,(function(){var r=this;return et(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 $e(this,void 0,void 0,(function(){var n;return et(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}(),Li=function(e,t,r,n,i){return $e(void 0,void 0,void 0,(function(){var o,a,s,u,c,l;return et(this,(function(d){switch(d.label){case 0:return o=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}}(),a=o.resolve,s=o.promise,ci.getLog(e,t,r,n,(function(e){a(xr(e))}),(function(e){a(Wr(e))})),[4,s];case 1:return(u=d.sent()).isOk?(c=0,l=JSON.parse(u.data).filter((function(e){return c+=function(e){return e.content.length+e.tag.length+e.sessionId.length+e.type.length+2+13+6}(e),!!i||e.level>0})),[2,xr({logs:l,size:c})]):[2,u.wipe()]}}))}))},Mi=function(e,t,r){return $e(void 0,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return et(this,(function(_){switch(_.label){case 0:return n=e.startTime,i=e.endTime,o=e.level,a=e.isRealtimeReport,[4,Li(o,n,i,s=300,a)];case 1:return(u=_.sent()).isOk?(c=u.data,l=c.logs,d=c.size,0===l.length||(t+=d)>=20971520?[2]:l.length<s?(r.push.apply(r,nt([],rt(l),!1)),[2]):(f=l[l.length-1].time,n===f&&(f+=1),e.startTime=f,r.push.apply(r,nt([],rt(l.filter((function(e){return e.time<f}))),!1)),[2,Mi(e,t,r)])):[2]}}))}))},Ui=[],Di=!1,wi=function(){return $e(void 0,void 0,void 0,(function(){var e,t,r,n;return et(this,(function(i){switch(i.label){case 0:return Di||0===Ui.length?[2]:(Di=!0,e=Ui.shift(),t=e.resolve,r=e.args,[4,Mi(r,0,n=[])]);case 1:return i.sent(),t({logs:n,dbReady:!0}),Di=!1,wi(),[2]}}))}))},ji=function(e){function t(t,r,n,i,o){void 0===i&&(i=!1);var a,s=process.versions.electron,u="Electron|".concat(s,"|").concat(process.arch,"|").concat(process.platform);return a=e.call(this,t,r,u,o,n,i)||this,Object.defineProperty(a,"_subProcess",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Ze(t,e),Object.defineProperty(t.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ni(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 $e(this,void 0,void 0,(function(){var t,r,i,o;return et(this,(function(a){switch(a.label){case 0:return this._subProcess||(t=p(n(ri(),"sub-process.cjs.js"),{stdio:["inherit","inherit","inherit","ipc"]}),this._subProcess=new Ai(t)),[4,this._subProcess.call("compressLogs",e)];case 1:return r=a.sent(),i=r.success,o=r.data,i?[2,{success:i,data:o.data}]:[2,{success:i,data:""}]}}))}))}}),t}(mn),Vi="rc-realtime-log-timestamp",Gi=!1,ki=function(){var e=new yn(Nn,Sn);return e.setLogReader((function(e,t,r,n){return $e(void 0,void 0,void 0,(function(){return et(this,(function(i){switch(i.label){case 0:return[4,(o={startTime:e,endTime:t,level:r,isRealtimeReport:n},$e(void 0,void 0,void 0,(function(){return et(this,(function(e){return[2,new Promise((function(e){Ui.push({resolve:e,args:o}),wi()}))]}))})))];case 1:return[2,{logs:i.sent().logs}]}var o}))}))})),e.setLogWriter((function(e){Bi(e)})),e},Fi=[],Bi=function(e){Gi&&(Fi.push(e),Pi||(Pi=setImmediate((function(){return function(){if(Pi&&(clearImmediate(Pi),Pi=null),Fi.length){var e=Fi.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(Tr,":").concat(Tr===t?"main":t),content:JSON.stringify({loggerId:a,content:s,traceId:u})}})),t=JSON.stringify(e);ci.writeLog(t)}}()}))))},Hi=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return Gi||(Gi=!0),o}return Ze(t,e),Object.defineProperty(t.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=ci.getStoreValue(Vi);return parseInt(e,10)||0}}),Object.defineProperty(t.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){ci.setStoreValue(Vi,e.toString())}}),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(){Gi=!1}}),t}(Tn),Ji=function(){var e,t=Date.now(),r=[o(),i(),process.pid,t,Math.floor(Math.random()*t)].join("__");return e=r,g("md5").update(e).digest("hex")},xi=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){var n=JSON.stringify(r);"{}"!==n&&e.info(Yn.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:t,ext:r})),this._callCppProxy("setMessageExtension",1,"1",t,n,"")}}),Object.defineProperty(e.prototype,"setLocalFromExtMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t.channelId,t.conversationType,t.targetId;var r=t.content,n=t.sentTime,i=r,o=i.put,a=this._callCppProxy("getMessage",i.mid),s=JSON.parse(a).extMsg,u=JSON.parse(s||"{}");if(o)for(var c in o){var l=u[c];l&&l.ts<n-this._setTime?(l.v=o[c],l.ts=n-this._setTime):(u[c]={v:"",ts:0},u[c].v=o[c],u[c].ts=n-this._setTime)}i.del&&i.del.forEach((function(e){delete u[e]})),this._setToProtocol(e,i.mid,u)}}),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}}),e}(),Wi=[at.RMTP,at.TLS];"darwin"===process.platform&&Wi.push(at.QUIC);var Yi=function(e){return"RongCloud/navis/".concat(e,"/navi-cache.json")},Ki=function(e){return"RongCloud/caches/".concat(e,"/staticConfig.json")},Xi=function(e){return"RongCloud/cloudControl/".concat(e,"/cloudControl.json")};function Qi(e){var t,r;void 0===e&&(e="IPv4");var n=a(),i=[];try{for(var o=tt(Object.values(n)),s=o.next();!s.done;s=o.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}));i.push.apply(i,nt([],rt(c),!1))}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i.length?nt([],rt(i),!1).sort()[0]:""}var Zi,qi,zi=function(e){function t(t,n,i,o){var a=e.call(this,t,n,o)||this;Object.defineProperty(a,"naviPath",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(a,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),a.naviPath="".concat(i,"/").concat(Yi(t));var s=r(a.naviPath);return R(s)||$n(s),a}return Ze(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a,s,u;return et(this,(function(c){switch(c.label){case 0:return i="token=".concat(encodeURIComponent(r),"&v=").concat(gr,"&p=PC&ev=").concat("5.30.0","&m=").concat(Qi()),o="".concat(e,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(he,JSON.stringify({url:o,body:i}),n),[4,Ni(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(be,JSON.stringify({url:o,code:a.status}),n),[2,Wr(this.transHttpCode(a.status))];this.logger.info(be,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,Wr(this.transHttpCode(s.code))]:[2,xr(s)]}catch(e){return this.logger.error(ge,a.data,n),[2,Wr(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 $e(this,void 0,void 0,(function(){var i,o,a,s;return et(this,(function(u){switch(u.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:"electron",protocol:Wi.join(","),mac:Qi()}),this.logger.info(he,JSON.stringify({url:i.url,body:i.body,headers:i.headers}),n),[4,Ni(this.logger,i)];case 1:if(200!==(o=u.sent()).status)return this.logger.warn(be,JSON.stringify({url:i.url,code:o.status}),n),[2,Wr(this.transHttpCode(o.status))];this.logger.info(be,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,xr(a)]}catch(e){return this.logger.error(ge,o.data,n),[2,Wr(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(!R(this.naviPath))return null;var n=I(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(n),this._caches[t]}catch(e){this.logger.error(ge,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(Sr(this._caches))for(var i in this._caches){(r-this._caches[i].timestamp>br||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}}),Object.defineProperty(t.prototype,"setUseNaviV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.useNaviV2=e}}),t}(Fn);function $i(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];var o,a=e.createTraceId();if(e.debug(Yn.P_CALL_ADDON_T,JSON.stringify({method:r,params:n}),a),!ci[r])throw e.error(Yn.P_CALL_ADDON_E,"Method ".concat(r," not found in addon"),a),new Error("Method ".concat(r," not found in addon"));try{o=ci[r].apply(ci,nt([],rt(n),!1))}catch(t){throw e.error(Yn.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:r}),a),t}return e.debug(Yn.P_CALL_ADDON_R,JSON.stringify({method:r,printResult:t,result:t?o:void 0}),a),o}var eo,to,ro,no,io=function(){function e(e,t,r){var n=this;Zi.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=it(this,Zi,"m",qi)).call.apply(e,nt([this,!0],rt(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=it(this,Zi,"m",qi)).call.apply(e,nt([this,!1],rt(t),!1))}}),Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.debug(Yn.P_CALL_ADDON_R,"success",this._traceId),this._flush(xr(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.warn(Yn.P_CALL_ADDON_R,"faile: ".concat(e),this._traceId),this._flush(Wr(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}();Zi=new WeakSet,qi=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(Yn.P_CALL_ADDON_T,JSON.stringify({method:o,params:r}),a);try{t=ci[o].apply(ci,nt([],rt(r),!1))}catch(e){throw s.error(Yn.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"}(no||(no={}));var oo=function(e){function t(t,r,n,i){var o=e.call(this,t,n,i)||this;return eo.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",it(o,eo,"m",to).bind(o),(function(e,t,r){o.logger.info(Yn.P_DB_OPEN_O,JSON.stringify({code:e,recreate:t,recreateReason:r})),o.emit("onDBOpen",e,t,r)}),(function(){return o.recvPong(ce.SUCCESS)}),it(o,eo,"m",ro).bind(o),o._onTcpConnectResponse.bind(o),(function(){o.logger.info(Yn.P_DB_UPGRATE_START_S),o.emit("onDBUpgrateStart")}),(function(e){o.logger.info(Yn.P_DB_UPGRATING_S,e),o.emit("onDBUpgrading",e)}),(function(e){o.logger.info(Yn.P_DB_UPGRATE_COMPLETE_S,e),o.emit("onDBUpgradeComplete",e)})),o}return Ze(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 $e(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p,E,h,b,g=this;return et(this,(function(R){switch(R.label){case 0:return i=this._connectingTask=io.create(this.logger,"connectWithToken",n),this._naviInfo=t,o={},(a=yi().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(ze(ze({},o),{call_plus:this._openCallPlus,cid:this.cid})),u=this.getCmpList(t,!0).filter((function(e){return Wi.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!==at.QUIC&&e.protocol!==at.QUIC||(t.race=!0,t.protocol=at.QUIC):(e.race=!1,c.push(e))})),this.logger.info(Yn.P_CONNECT_T,JSON.stringify({}),n),l=Date.now(),[4,i.asyncInvoke(e,gr,JSON.stringify(ze(ze({},t),{serverAddr:c,tagBlacklist:this._excludeLogTag.join(",")})),r,s).result()];case 1:return d=R.sent(),this.logger.summary(Yn.P_CONNECT_R,d,n,{data:d.data}),f=JSON.parse(d.data),_=f.cid,p=f.userId,E=f.sessionId,h=Date.now()-(l+this._tcpDuration),b={bid:jr(),cod:d.code,net:this.getNetwork().type,dur:h,spr:0,cid:_,v:ur.CURRENT,count:this.retryCount,sts:Date.now(),ssid:E},this.logger.record(Dt.IM_CMP_RMTP,JSON.stringify(b)),this._connectingTask=null,[2,d.trans((function(e){return g._connectedTime=Date.now()-g.callCppProxy("getDeltaTime"),p}))]}}))}))}}),Object.defineProperty(t.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){return et(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()!==Pt.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:jr(),ptc:ar.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?cr.RECONNECT:cr.CONNECT,cid:this.cid,v:ur.CURRENT,rsn:this._doConnectReason,ddu:i,count:this.retryCount,weight:u>=0?this.cmpWeightCache[u].weight:-1};if(this.logger.record(Dt.IM_CMP,JSON.stringify(c)),this.logger.info(Yn.P_CONNECT_ENTRY_S,JSON.stringify({code:e,host:t,port:r,duration:n,dnsDuration:i,index:o,isQuic:a})),e===no.SUCCESS)this.curCmpUrl="".concat(t,":").concat(r),this.updateCmpWeight("".concat(t,":").concat(r),!0,a);else if(e!==no.NOT_INIT){var l=r&&0!==r?"".concat(t,":").concat(r):"".concat(t);this.updateCmpWeight(l,!1)}}}),t}(Gn);eo=new WeakSet,to=function(e,t){10!==e&&(this._connectingTask?e===ce.SUCCESS?this._connectingTask.ok(t):this._connectingTask.fail(e,t):this.logger.warn(Yn.P_CONNECT_E,JSON.stringify({msg:"connect complete but no connecting task"})))},ro=function(e,t){switch(this.logger.info(Yn.P_CONNECT_S,JSON.stringify({status:e,delay:t})),e){case ce.RC_CONN_REDIRECTED:this.recvConnectRes(e,!0);break;case 11:case 10:case 12:break;case ce.CONNECTION_REFUSED: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 ao,so,uo,co,lo,fo,_o,po,Eo,ho,bo,go,Ro,vo,Io,Oo,To,mo,Co,No,So,yo,Po,Ao,Lo,Mo,Uo,Do,wo,jo,Vo,Go,ko,Fo,Bo,Ho,Jo,xo=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"dbpath",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_cachePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),o._cachePath="".concat(i,"/").concat(Ki(t));var a=r(o._cachePath);return R(a)||$n(a),o}return Ze(t,e),Object.defineProperty(t.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this._cachePath)&&I(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 $e(this,void 0,void 0,(function(){var t,r,n;return et(this,(function(i){switch(i.label){case 0:return[4,Ni(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 $e(this,void 0,void 0,(function(){var t,r;return et(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,zn(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(je,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),t}(vn),Wo=function(e){function t(t,n,i,o,a){var s=e.call(this,n,t,i)||this;Object.defineProperty(s,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(s,"model",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(s,"catchFilePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),s.model="Electron|".concat(process.platform,"|").concat(process.arch),s.catchFilePath="".concat(a,"/").concat(Xi(t));var u=r(s.catchFilePath);return R(u)||$n(u),s.init(),s}return Ze(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return et(this,(function(_){switch(_.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},a=this.logger.createTraceId(),this.logger.info(he,JSON.stringify(o),a),[4,Ni(this.logger,o)];case 1:s=_.sent(),u=s.status,c=s.data,l=void 0===c?"":c,this.logger.info(be,JSON.stringify({status:u,data:l}),a);try{return d=JSON.parse(l),f=d.data,[2,{code:u,data:f}]}catch(e){return this.logger.warn(Fe,JSON.stringify({status:u,data:l,error:e})),[2,{code:u,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(Be,JSON.stringify(e))}}),Object.defineProperty(t.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!R(this.catchFilePath))return null;var e=I(this.catchFilePath,{encoding:"utf8"});return this.logger.info(He,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(xe,JSON.stringify(t)),ci.setCloudConfig(JSON.stringify(t))}}),t}(jn),Yo=[Ft,nr,Bt,Xt,Zt,Yt,Kt,Wt,Qt,qt,zt],Ko=function(){return{logCmdQueue:[],cloudControllerVers:[],srsmsgs:[],readNtfs:[],expansionMsgQueue:new Map,v1ReceiptMsgs:[],privateRSMsgs:[],groupRSMsgs:new Map,rrmsgs:new Map,messageUIds:new Set}},Xo=function(){function e(){Object.defineProperty(this,"_report",{enumerable:!0,configurable:!0,writable:!0,value:Ko()}),Object.defineProperty(this,"_count",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"isLowPriorityMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Yo.includes(e)}}),Object.defineProperty(e.prototype,"isEmpty",{enumerable:!1,configurable:!0,writable:!0,value:function(){return 0===this._count}}),Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._count++;var n=e.messageType,i=e.senderUserId,o=e.content;if(n!==Ft)if(n!==nr)if(n!==Xt)if(n!==Bt)if(n!==Wt){if(n===Yt){var a=o.messageUId;if(!a)return;return this._report.messageUIds.add(a),void this._report.v1ReceiptMsgs.push(e)}if(n===Kt){var s=o.receiptMessageDic;if(i!==t){var u=s[t];if(!u||0===u.length)return;return u.forEach((function(e){return r._report.messageUIds.add(e)})),void this._report.v1ReceiptMsgs.push(e)}return Object.values(s).forEach((function(e){e.forEach((function(e){return r._report.messageUIds.add(e)}))})),void this._report.v1ReceiptMsgs.push(e)}n!==Qt?n===Zt&&this._handleRSMsg(e):this._handleRRMsg(e)}else this._handleReadNtf(e);else this._handleExpansionNotify(e);else this._handleSRSMsg(e,t);else i===Rr&&this._report.cloudControllerVers.push(e.sentTime);else if(i===Rr){var c=o.startTime,l=o.endTime,d=o.platform,f=o.logId,_=o.uri;this._report.logCmdQueue.push({startTime:parseInt(c,10),endTime:parseInt(l,10),platform:d,logId:f,uri:_,messageUId:e.messageUId})}}}),Object.defineProperty(e.prototype,"_handleRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.senderUserId;var t=e.content,r=e.conversationType,n=e.targetId,i=e.channelId;if(r!==qe.PRIVATE){var o=t,a=o.msgId,s=o.rrn,u=o.tmn,c=this._report.groupRSMsgs.get(a);c?(c.totalCount=u,c.readedCount=s):this._report.groupRSMsgs.set(a,{totalCount:u,readedCount:s}),this._report.messageUIds.add(a)}else{var l=this._report.privateRSMsgs.find((function(e){return e.conversationType===r&&e.targetId===n&&e.channelId===i}));l?l.timestamp=Math.max(l.timestamp,t.endMsgTime):this._report.privateRSMsgs.push({conversationType:r,targetId:n,channelId:i,timestamp:t.endMsgTime})}}}),Object.defineProperty(e.prototype,"_handleRRMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content.msgId;this._report.rrmsgs.set(t,e),this._report.messageUIds.add(t)}}),Object.defineProperty(e.prototype,"_handleExpansionNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=t.put,n=t.mid,i=t.del,o=t.clear;this._report.messageUIds.add(n),this._report.expansionMsgQueue.has(n)&&!o?this._report.expansionMsgQueue.get(n).push({put:r,del:i,clear:o}):this._report.expansionMsgQueue.set(n,[{put:r,del:i,clear:o}])}}),Object.defineProperty(e.prototype,"_handleSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId;e.senderUserId===t&&(this._report.srsmsgs=this._report.srsmsgs.filter((function(e){return e.conversationType!==r||e.targetId!==n||e.channelId!==i})),this._report.srsmsgs.push(e))}}),Object.defineProperty(e.prototype,"_handleReadNtf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;t===qe.PRIVATE&&(this._report.readNtfs=this._report.readNtfs.filter((function(i){return i.conversationType!==t||i.targetId!==r||i.channelId!==n||i.senderUserId!==e.senderUserId})),this._report.readNtfs.push(e))}}),Object.defineProperty(e.prototype,"build",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._report;return this._report=Ko(),this._count=0,e}}),e}(),Qo=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{t.apply(void 0,nt([],rt(n),!1))}catch(t){r.logger.error(Yn.L_JS_CALLBACK_EXCEPTION_E,"name: ".concat(e,"\n").concat(t.stack))}}}}),e}();function Zo(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}}!function(e){e[e.cuid=1]="cuid",e[e.uid=2]="uid",e[e.all=4]="all"}(Jo||(Jo={}));var qo=function(){function e(e,t,r,n,i,o,a){var s=this;ao.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,"_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,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isConnected",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_offlineFinishedPending",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullOfflineMessageFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_lowPriorityMessageHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_catcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_needDispatchMessageModifiedSyncCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!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,d=r.userProfile,f={userId:n,subscribeType:i,subscribeTime:o,expiry:a,operationType:u};[Nt.ONLINE_STATUS,Nt.FRIEND_ONLINE_STATUS].includes(i)&&(f.details=l.map((function(e){var t=JSON.parse(e);return{changeTime:t.changeTime,eventValue:t.changeValue,platform:t.platform}}))),[Nt.USER_PROFILE,Nt.FRIEND_USER_PROFILE].includes(i)&&(f.userProfile=s._string2userProfileInfo(d)),t.push(f)}))}catch(t){s.logger.error(Yn.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:new Map}),Object.defineProperty(this,"rtcHeartbeatResolves",{enumerable:!0,configurable:!0,writable:!0,value:{}});var u=this._dbpath,c=this._deviceId=Ji(),l=ki();this.logger=new Hi(this._appkey,"RC-M","IM",l),this._catcher=new Qo(this.logger),ci.initWithAppkey(e,u,gr,this.logger.getSessionId()),ci.setConsoleLogLevel((this._logOutputLevel||bn.WARN)+1),this.logger.setOutputLevel(this._logOutputLevel),this.reporter=new ji(e,c,this.logger,o,l),this.logger.info(Yn.P_INIT_O,JSON.stringify({appkey:e,dbpath:u,proto_commit:ci.getNodeVersion(),deviceId:c,commit:"acab3f166cca4662e50a05343d2bc1135437ab73",processName:process.title,processPId:process.pid,disableLogReport:o,eventLoopBlockingCheck:a})),a&&An.start(this.logger),this._callCppProxy("setDeviceId",c),this._staticConfigManager=new xo(e,this.logger,u),this._lowPriorityMessageHandler=new Xo,this.navi=new zi(e,this.logger,u,this._staticConfigManager),this.tcpMgr=new oo(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("onDBOpen",this.dbOpened,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(),ci.setOnReceiveMessageListener(it(this,ao,"m",vo).bind(this),it(this,ao,"m",Io).bind(this),this._handleMessageModified.bind(this)),ci.setRTConversationListener((function(e){return s._dispatchEvent("sgRelationsSynced",e)})),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),ci.setReadReceiptListener((function(e,t){var r=JSON.parse(t).map((function(e){return{identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount,users:e.readUsers.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:e.mentioned}}))}}));s._dispatchEvent("readReceiptResponseV5",r)})),ci.setTranslateEventListener((function(e){var t=JSON.parse(e).map((function(e){return{translateInfo:{targetLanguage:e.translateResult.targetLanguage,translatedText:e.translateResult.translatedText,status:e.translateResult.translateStatus},code:e.code,identifier:e.messageRecognitionIdentifier.messageUid,from:e.messageRecognitionIdentifier.inputSource}}));s._dispatchEvent("translateResponse",t)})),this._msgExpansionHandler=new xi(this._callCppProxy.bind(this)),ci.setUltraGroupListener((function(e){return s._dispatchEvent("ultraGroupEnable")}),(function(e,t,r){return it(s,ao,"m",co).call(s,e,t,r)}),(function(e){return it(s,ao,"m",lo).call(s,e)}),(function(e){return it(s,ao,"m",fo).call(s,e)}),(function(e){return it(s,ao,"m",_o).call(s,e)}),(function(e){return it(s,ao,"m",po).call(s,e)}),(function(e){return it(s,ao,"m",Eo).call(s,e)}),(function(e){return it(s,ao,"m",so).call(s,e)}),(function(e){return it(s,ao,"m",uo).call(s,e)}))}return Object.defineProperty(e.prototype,"_setDeviceInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=s()[0].model,t=u();try{"darwin"===process.platform?t=E("sw_vers -ProductVersion",{encoding:"utf-8"}):"win32"===process.platform&&(t=E("ver",{encoding:"utf-8"}))}catch(e){this.logger.error(Ke,JSON.stringify({error:e}))}ci.setDeviceInfo("",e,"PC",t,"","")}}),Object.defineProperty(e.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;r=rt(Rn.getCloudControllerUrl(),1),this.cloudControllerUri=r[0],this.cloudController=new Wo(this._appkey,this.logger,this.reporter,e,t),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Pn.init)}}),Object.defineProperty(e.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 $e(this,void 0,void 0,(function(){var r,n,i;return et(this,(function(o){switch(o.label){case 0:if(!(r=this[e]))return this.logger.warn(Yn.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,nt([this],rt(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(Yn.P_CALL_MAIN_E,n),[3,4];case 4:return[2,{code:ce.MAIN_PROCESS_ERROR,msg:n}]}}))}))}}),Object.defineProperty(e.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 $e(this,void 0,void 0,(function(){var r;return et(this,(function(n){if(!(r=this[e]))return this.logger.warn(Yn.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),[2];try{r.call.apply(r,nt([this],rt(t),!1))}catch(t){this.logger.error(Yn.P_CALL_MAIN_E,JSON.stringify({error:null==t?void 0:t.stack,method:e}))}return[2]}))}))}}),Object.defineProperty(e.prototype,"registerRenderers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.navigators,r=e.areaCode,n=e.logServerUrl,i=e.environment,o=e.useNaviV2,a=e.enableReadReceiptStorage;this._environment=i||"default",this.navi.setEnvironment(i),this._enableReadReceiptStorage=a,this.navi.setUseNaviV2(o),Rn.init({areaCode:r,navigators:t,logServerUrl:n})}}),Object.defineProperty(e.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected=!0;var e=this.getNaviInfoFromCache();this.reporter.checkStart(e,""),this._try2RejoinChatroom();var t=this._getMainProcessCache();this._dispatchEvent("onConnected",t),this._offlineFinishedPending&&(this._offlineFinishedPending=!1,this.logger.info(Xe),this._dispatchEvent("pullFinished")),this._needDispatchMessageModifiedSyncCompleted&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}}),Object.defineProperty(e.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._needDispatchMessageModifiedSyncCompleted=!0,this._dispatchEvent("onConnecting")}}),Object.defineProperty(e.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onSuspend",t)}}),Object.defineProperty(e.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onDisconnected",t)}}),Object.defineProperty(e.prototype,"dbOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this._dispatchEvent("databaseOpened",t,r)}}),Object.defineProperty(e.prototype,"dbUpgradeStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._dispatchEvent("databaseUpgradeWillStart")}}),Object.defineProperty(e.prototype,"dbUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgrading",t)}}),Object.defineProperty(e.prototype,"dbUpgradeComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgradeDidComplete",t)}}),Object.defineProperty(e.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(Yn.P_CALL_ADDON_O,JSON.stringify({method:e,content:t}),n),ci[e].apply(ci,nt([],rt(t),!1))}catch(t){throw this.logger.error(Yn.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:e}),n),t}}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"sendHTTPRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ni(this.logger,e)}}),Object.defineProperty(e.prototype,"onReceiveRendererLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.recvRendererLog(e)}}),Object.defineProperty(e.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,Pn.newWorkChange,r)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){An.stop(),this.reporter.stop(),this.logger.destroy(),ci.destroy(),process.exit(0)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l,d,f=this;return et(this,(function(_){return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,a=t.count,s=t.order,u=t.messageTypes,c=a+1,l=$i(this.logger,!1,"getHistoryMessagesByObjectNames",r,n,o,c,u,0===s,i||""),d=JSON.parse(l).list.reverse().map((function(e){var t=e.obj;return f._buildMessage(t)})),[2,xr({list:c===d.length?d.slice(1,c):d,hasMore:a<d.length})]}))}))}}),Object.defineProperty(e.prototype,"_updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $i(this.logger,!0,"updateMessageReceiptStatus",e,t,r,n||"")}}),Object.defineProperty(e.prototype,"updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i;return et(this,(function(o){return i=this._updateMessageReceiptStatus(e,t,r,n),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectionStatus()!==Pt.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectedTime()}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-ci.getDeltaTime()}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getCurrentUserId()}}),Object.defineProperty(e.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();return{connectedTime:e,deviceId:this.getDeviceId(),crtUserId:n,naviInfo:r,connectionStatus:t,deltaTime:ci.getDeltaTime()}}}),Object.defineProperty(e.prototype,"getMainProcessCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){return et(this,(function(e){return[2,this._getMainProcessCache()]}))}))}}),Object.defineProperty(e.prototype,"_enableCreateEmptyTopConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._callCppProxy("enableCreateEmptyTopConversation",e)}}),Object.defineProperty(e.prototype,"_registerBuildinMessageTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;xn().forEach((function(t){e.registerMessageType(t.objectName,t)}))}}),Object.defineProperty(e.prototype,"_parseMessageJsonContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;try{r=e?JSON.parse(e):{}}catch(n){r=e,this.logger.error(Yn.P_PARSE_JSON_MSGS_E,JSON.stringify({content:e,messageId:t}))}return r}}),Object.defineProperty(e.prototype,"_buildSupportExt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=null;return e&&(r=this._msgExpansionHandler.parseReceiveExpansion(t)),r}}),Object.defineProperty(e.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,d={readCount:s,totalCount:u};if(1===(null==r?void 0:r.grpRRVer)){var f=[];for(var _ in a)f.push({userId:_,readTime:a[_]});d.readerList=f,d.hasRespond=i}return 3===(null==r?void 0:r.grpRRVer)&&(d.readerList=l),d}}),Object.defineProperty(e.prototype,"_buildMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=JSON.parse(e);return it(this,ao,"m",ho).call(this,r,t)}}),Object.defineProperty(e.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=ze(ze({},i),t);this._callCppProxy("updateReadReceiptRequestInfo",e,JSON.stringify(o))}}),Object.defineProperty(e.prototype,"_buildConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e);return it(this,ao,"m",bo).call(this,t)}}),Object.defineProperty(e.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(e.prototype,"_getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0===e.length)return[];var r=$i(this.logger,!1,"getMessageByUids",e);return JSON.parse(r).list.map((function(e){return it(t,ao,"m",ho).call(t,JSON.parse(e.obj))}))}}),Object.defineProperty(e.prototype,"_handleLowPriorityMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;if(!this._lowPriorityMessageHandler.isEmpty()){var i=Date.now(),o=this._lowPriorityMessageHandler.count,a=this.logger.createTraceId();this.logger.info(Yn.L_HANDLE_LOW_PRIORITY_MESSAGES_T,JSON.stringify({startTime:i,count:o}),a);var s=this._lowPriorityMessageHandler.build(),u=s.srsmsgs,c=s.readNtfs,l=s.expansionMsgQueue,d=s.v1ReceiptMsgs,f=s.privateRSMsgs,_=s.groupRSMsgs,p=s.rrmsgs,E=s.logCmdQueue,h=s.cloudControllerVers,b=s.messageUIds,g=new Map;this._getMessagesByUIds(nt([],rt(b.values()),!1)).forEach((function(e){g.set(e.messageUId,e)})),this._handleExpansionMsgQueue(l,g),this._sendMessageNotification(c,!1),this._handlerReadReceiptMsgV1(d,g,e),this._handleSRSMsgs(u,t),this._handlerPrivateRSMsgs(f),this._handlerGroupRSMsgs(_,g),this._handlerRRMsgs(p,g),h.length>0&&((r=this.cloudControllerMsgs).push.apply(r,nt([],rt(h),!1)),this._ccMsgHandler()),E.forEach((function(e){var t=e.startTime,r=e.endTime,i=e.platform,o=e.logId,a=e.uri,s=e.messageUId;n.reporter.report(t,r,i,a,o,s)})),this.logger.info(Yn.L_HANDLE_LOW_PRIORITY_MESSAGES_R,JSON.stringify({startTime:i,cost:Date.now()-i}),a)}}}),Object.defineProperty(e.prototype,"_updateReadReceiptRequestInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(0!==e.length){var t=e.map((function(e){return JSON.stringify({message_uid:e.messageUId,request_info:e.readReceiptInfo})}));$i(this.logger,!1,"updateReadReceiptRequestInfoList",t)}}}),Object.defineProperty(e.prototype,"_handlerRRMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=[],n=[];Array.from(e.entries()).forEach((function(e){var i=rt(e,2),o=i[0],a=i[1],s=t.get(o);if(s){var u=a.content,c=u.rrn,l=u.tmn,d=s.readReceiptInfo||{};d=ze(ze({},d),{readCount:c,totalCount:l}),s.readReceiptInfo=d,r.push({messageUId:o,readReceiptInfo:d}),n.push(a)}})),this._updateReadReceiptRequestInfoList(r),this._sendMessageNotification(n,!1)}}),Object.defineProperty(e.prototype,"_handlerGroupRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[];Array.from(e.entries()).forEach((function(e){var r=rt(e,2),o=r[0],a=r[1],s=a.totalCount,u=a.readedCount,c=t.get(o);if(c){var l=c.conversationType,d=c.targetId,f=c.channelId,_=c.readReceiptInfo||{};_=ze(ze({},_),{readCount:u,totalCount:s}),c.readReceiptInfo=_,n.push({messageUId:o,readReceiptInfo:_}),i.push({conversationType:l,targetId:d,channelId:f,readedCount:u,totalCount:s,messageUId:o})}})),this._updateReadReceiptRequestInfoList(n),i.forEach((function(e){return r._sendMessageReadReceipt({groupReadReceipt:e})}))}}),Object.defineProperty(e.prototype,"_handlerPrivateRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r=e.conversationType,n=e.targetId,i=e.channelId,o=e.timestamp;t._updateMessageReceiptStatus(r,n,o,i||""),t._sendMessageReadReceipt({privateReadReceipt:{conversationType:r,targetId:n,channelId:i||"",endMsgTime:o}})}))}}),Object.defineProperty(e.prototype,"_handleSRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;1!==this.getNaviInfoFromCache().sesDriven?this._sendMessageNotification(e,!1):e.forEach((function(e){var n=e.conversationType,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.content;a>t||r._sendsyncReadStatus({conversationType:n,targetId:i,channelId:o,timestamp:s.lastMessageSendTime})}))}}),Object.defineProperty(e.prototype,"_handlerReadReceiptMsgV1",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(0!==e.length){var n=new Set,i=[];e.forEach((function(e){var o=e.messageType,a=e.senderUserId,s=e.content;if(o===Yt){var u=s.messageUId,c=t.get(u);if(!c||c.senderUserId!==a)return;return c.readReceiptInfo=a===r?{isReceiptRequestMessage:!0,readerList:[]}:{isReceiptRequestMessage:!0,hasRespond:!1},n.add(c),void i.push(e)}var l=s.receiptMessageDic;if(a===r)return Object.values(l).forEach((function(e){e.forEach((function(e){var r=t.get(e);r&&(r.readReceiptInfo=ze(ze({},r.readReceiptInfo),{hasRespond:!0}),n.add(r))}))})),void i.push(e);var d=l[r];d&&0!==d.length&&(d.forEach((function(e){var r=t.get(e);if(r){var i=r.readReceiptInfo,o=((null==i?void 0:i.readerList)||[]).concat(a);r.readReceiptInfo=ze(ze({},r.readReceiptInfo),{readerList:o}),n.add(r)}})),i.push(e))})),this._enableReadReceiptStorage&&this._updateReadReceiptRequestInfoList(Array.from(n.values()).map((function(e){return{messageUId:e.messageUId,readReceiptInfo:e.readReceiptInfo}}))),this._sendMessageNotification(i,!1)}}}),Object.defineProperty(e.prototype,"_handleExpansionMsgQueue",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if(0!==e.size){var n=[],i=[];Array.from(e.entries()).forEach((function(e){var r=rt(e,2),o=r[0],a=r[1],s=t.get(o);if(s&&a.length){var u=new Set,c=new Set,l=s.expansion||{};a.forEach((function(e){var t=e.put,r=e.del;if(e.clear)return Object.keys(l).forEach((function(e){u.add(e),c.clear()})),void(l={});t&&(Object.keys(t).forEach((function(e){u.delete(e),c.add(e)})),l=ze(ze({},l),t)),r&&r.forEach((function(e){u.add(e),c.delete(e),delete l[e]}))})),s.expansion=l;var d={};Object.keys(l).forEach((function(e){d[e]={v:l[e]}})),n.push({messageUId:o,expansion:JSON.stringify(d)});var f={},_=s.conversationType,p=s.targetId,E=s.channelId,h=!1;u.size>0&&(h=!0,f.deletedExpansion={conversationType:_,targetId:p,channelId:E||"",messageUId:o,deletedKeys:Array.from(u)}),c.size>0&&(h=!0,f.updatedExpansion={conversationType:_,targetId:p,channelId:E||"",messageUId:o,expansion:l}),h&&i.push(f)}})),it(this,ao,"m",Oo).call(this,n),i.forEach((function(e){return r._dispatchEvent("expansion",e)}))}}}),Object.defineProperty(e.prototype,"_handleHighPriorityMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.filter((function(e){var t=e.messageType,n=e.conversationType;return t!==xt&&(t===Jt?it(r,ao,"m",To).call(r,e):n!==qe.CHATROOM||it(r,ao,"m",Ro).call(r,e))}));this._sendMessageNotification(n,t)}}),Object.defineProperty(e.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return $e(this,void 0,void 0,(function(){var t,r;return et(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,Pn.other,t)]):[3,2]):[2];case 1:r=n.sent()||0,this.cloudControllerMsgs=this.cloudControllerMsgs.filter((function(e){return e>r})),this.cloudControllerLock=!0,this._ccMsgHandler(),n.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_sendMessageNotification",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.length>0&&this._dispatchEvent("batchMessage",e,void 0,t)}}),Object.defineProperty(e.prototype,"_sendPullOfflineFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected?(this.logger.info(Xe),this._dispatchEvent("pullFinished")):this._offlineFinishedPending=!0}}),Object.defineProperty(e.prototype,"_handleMessageModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;try{var n=JSON.parse(e).list;if(n.length>0){var i=n.map((function(e){return r._buildMessage(e.obj)}));this._dispatchEvent("messagesModified",i)}}catch(t){this.logger.error(Yn.P_PARSE_JSON_E,JSON.stringify({error:t,result:e}))}this._needDispatchMessageModifiedSyncCompleted&&!t&&this._isConnected&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}}),Object.defineProperty(e.prototype,"_handleChatroomKVUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.roomId,i=r.key,o=r.value;return r.operator,{chatroomId:n,key:i,value:o,timestamp:r.version,type:r.isDeleted?ne.DELETE:ne.UPDATE}}));t.length&&this._sendChatroomEvents({updatedEntries:t})}}),Object.defineProperty(e.prototype,"_handleChatroomFullKVSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._chatroomCache.get(e);if(n){n.isKVSynced||(n.isKVSynced=!0,this._sendChatroomEvents({entriesSynced:e}));var i=function(e){return JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})).reduce((function(e,t){return e.set(t.key,t)}),new Map)},o=i(t),a=i(r),s=[];Array.from(o.entries()).forEach((function(e){var t=rt(e,2),r=t[0],n=t[1],i=n.roomId,o=n.value;n.operator;var u=n.version;n.isDeleted;var c=a.get(r);c?(a.delete(r),s.push({chatroomId:i,key:r,value:c.value,timestamp:c.version,type:ne.UPDATE})):s.push({chatroomId:i,key:r,value:o,timestamp:u,type:ne.DELETE})})),Array.from(a.entries()).forEach((function(t){var r=rt(t,2),n=r[0],i=r[1];s.push({chatroomId:e,key:n,value:i.value,timestamp:i.version,type:ne.UPDATE})})),s.length&&this._sendChatroomEvents({updatedEntries:s})}}}),Object.defineProperty(e.prototype,"_sendChatroomEvents",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("chatroom",e)}}),Object.defineProperty(e.prototype,"_sendMessageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("messageReadReceipt",e)}}),Object.defineProperty(e.prototype,"_sendsyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("syncReadStatus",e)}}),Object.defineProperty(e.prototype,"_setConversationStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.setConversationStatusListener((function(t){var r=JSON.parse(t).list.map((function(e){var t=JSON.parse(e.obj),r={conversation:{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)||wt.NOT_SET;r.updatedItems.notificationLevel={val:o,time:0},r.updatedItems.notificationStatus={val:_r(o),time:0}}else 2===n?r.updatedItems.isTop={val:"1"===i,time:0}:4===n&&(r.updatedItems.translateStrategy={val:Number(i),time:0})})),r}));r.length>0&&e._dispatchEvent("conversation",r)}),(function(t){e._dispatchEvent("conversationTag")}),(function(t,r,n,i){e._callCppProxy("clearUnreadCountByTimestamp",t,r,i,n||""),e._sendsyncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i})}),(function(t){return e._dispatchEvent("conversationStatusSynced",t)}))}}),Object.defineProperty(e.prototype,"_setPushNotificationListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.setPushNotificationListener((function(t){return e._getRTCProfile()}),(function(){return e._dispatchEvent("tag")}),(function(t){return e._dispatchEvent("userSettingsSynced",t)}),(function(t){return e._dispatchEvent("userSettingsChanged",{key:pn,value:t})}),(function(t){return e._dispatchEvent("userSettingsChanged",{key:_n,value:t})}))}}),Object.defineProperty(e.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(e.prototype,"_setRTCLivingRoomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.setRTCRoomEventListener((function(t){e._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(t))}))}}),Object.defineProperty(e.prototype,"_setChatroomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.setChatroomEventListener((function(t,r){return e._sendChatroomEvents({chatroomDestroyed:t})})),ci.setChatroomStatusListener((function(t,r,n){return e._handleChatroomFullKVSync(t,r,n)}),(function(t){return e._handleChatroomKVUpdate(t)}))}}),Object.defineProperty(e.prototype,"_setCallInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.setCallInfoListener((function(t){var r=[];try{JSON.parse(t).list.forEach((function(e){Object.entries(e).forEach((function(e){var t=rt(e,2),n=t[0],i=t[1];r.push({key:n,value:i})}))}))}catch(t){e.logger.error(Yn.P_PARSE_JSON_E,JSON.stringify({error:t}))}e._dispatchEvent("callInfo",JSON.stringify({list:r}))}))}}),Object.defineProperty(e.prototype,"_setSubscribeEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.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[Nt.ONLINE_STATUS,Nt.FRIEND_ONLINE_STATUS].includes(r)?s.details=o:[Nt.USER_PROFILE,Nt.FRIEND_USER_PROFILE].includes(r)&&(s.userProfile=a),s}));e._dispatchEvent("subscribedUserStatusChange",r)}))}}),Object.defineProperty(e.prototype,"_setUserProfileListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.setUserProfileListener((function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)}),(function(t){e._dispatchEvent("ownUserProfileChanged",e._string2userProfileInfo(t))}))}}),Object.defineProperty(e.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=rt(this._convertGroupInfoList(a),1),c.groupInfo=o[0]):c.memberInfos=this._convertGroupMemberInfoList(u),this._dispatchEvent("groupOperation",c)}catch(t){this.logger.error(Yn.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:n,membersJson:i,operatorInfo:e}))}}}),Object.defineProperty(e.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]:s});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(Yn.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:i,operatorInfoJson:r}))}}}),Object.defineProperty(e.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(Yn.P_PARSE_JSON_E,JSON.stringify({error:e,operatorInfoJson:t,updateMemberInfoJson:r}))}}}),Object.defineProperty(e.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,d=i.direction,f=i.remark,_=ze(ze(ze(ze({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:d,type:c,operationTime:n,reason:f});this._dispatchEvent("groupApplicationEvent",_)}catch(e){this.logger.error(Yn.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfo:t,requestInfoJson:r}))}}}),Object.defineProperty(e.prototype,"_onFavoriteMembersChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(r),o=[];i&&Cr(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(Yn.P_PARSE_JSON_E,JSON.stringify({error:e,memberIds:r}))}}}),Object.defineProperty(e.prototype,"_setEntrustGroupListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){ci.setEntrustGroupListener(this._onGroupOperationChanged.bind(this),this._onGroupInfoChanged.bind(this),this._onGroupMemberInfoChanged.bind(this),this._onGroupRequestChanged.bind(this),this._onFavoriteMembersChanged.bind(this))}}),Object.defineProperty(e.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(e.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(e.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(e.prototype,"_onFriendsClearedFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("friendCleared",e)}}),Object.defineProperty(e.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,operationTime:0})}catch(e){this.logger.error(Yn.P_PARSE_JSON_E,JSON.stringify({error:e,profiles:r}))}}}),Object.defineProperty(e.prototype,"_setFriendEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){ci.setFriendEventListener(this._onFriendApplicationStatusChanged.bind(this),this._onFriendAdd.bind(this),this._onFriendDelete.bind(this),this._onFriendsClearedFromServer.bind(this),this._onFriendInfoChangedSync.bind(this))}}),Object.defineProperty(e.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&&(Hn(e,t),this.logger.info(Yn.P_REGTYP_O,JSON.stringify({type:e,opt:r,search:s}))),this._callCppProxy("registerMessageType",e,r,s||[])}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.tcpMgr.connect(e,t,r,n)}}),Object.defineProperty(e.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(e.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.stringify(ze(ze({},e),{"electron-main":"5.30.0"}));this.logger.info(Yn.P_REPORT_VER_O,t),this._callCppProxy("uploadSDKVersion",t,"")}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){return et(this,(function(r){return e=e||!0,this._chatroomCache.clear(),this.reporter.stop(),Si(null,this.logger),[2,this.tcpMgr.disconnect(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){ci.setOnReceiveStatusListener((function(e,r){t({userId:e,status:r})}));var r=e.userIds||[];r.length&&this.subscribeUserStatus(r)}}),Object.defineProperty(e.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(e.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(e.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(e.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===qe.GROUP;if(r===Kt&&n.receiptMessageDic&&a)for(var s in n.receiptMessageDic)o.push(s);return r===Xt&&function(e){return[qe.GROUP,qe.DISCUSSION,qe.ULTRA_GROUP,qe.PUBLIC_SERVICE,qe.APP_PUBLIC_SERVICE].includes(e)}(t)&&(o=[this.getCurrentUserId()]),o}}),Object.defineProperty(e.prototype,"_handleMessage2Callback",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;switch(e.messageType){case Bt:this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e);break;case Yt:this._enableReadReceiptStorage&&this._updateReadReceiptInfo(t.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});break;case Kt:if(this._enableReadReceiptStorage){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(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return $e(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,_,p,E,h,b,g,R,v,I,O,T,m,C,N,S,y,P,A,L,M,U,D,w,j,V,G,k,F,B,H,J,x,W,Y,K,X,Q,Z,q,z,$,ee=this;return et(this,(function(te){for(K in o=r.messageType,a=r.content,s=r.expansion,u=r.pushConfig,c=r.pushContent,l=void 0===c?"":c,d=r.pushData,f=void 0===d?"":d,_=r.directionalUserIdList,void 0===_?[]:_,E=r.disableNotification,h=void 0!==E&&E,b=r.canIncludeExpansion,g=void 0!==b&&b,R=r.isVoipPush,v=void 0!==R&&R,I=r.channelId,O=void 0===I?"":I,T=r.messageId,m=void 0===T?0:T,C=r.disableUpdateLastMessage,N=void 0!==C&&C,S=r.needReceipt,P=(y=u||{}).iOSConfig,A=y.androidConfig,L=y.harmonyOSConfig,M=y.templateId,U=void 0===M?"":M,D=y.pushTitle,w=void 0===D?"":D,j=y.pushContent,V=void 0===j?l:j,G=y.pushData,k=void 0===G?f:G,F=y.disablePushTitle,B=void 0!==F&&F,H=y.forceShowDetailContent,J=void 0!==H&&H,x=wr(P,A,L),l=V,f=k,W=(null==A?void 0:A.notificationId)||"",p=this._handleDirectionalUserIdList(r,e),Y={},s)Y[K]={v:s[K]};return X=U,this.logger.info(Yn.P_SEND_MSG_T,JSON.stringify({messageType:o,conversationType:e,targetId:t,channelId:O}),n),Q=io.create(this.logger,"sendMessage"),Z=function(e,t){var i=ee._buildMessage(e,!1);ee.logger.info(Yn.P_SEND_MSG_R,JSON.stringify({code:t,messageUId:i.messageUId}),n),t!==ce.SENSITIVE_REPLACE?(ee._handleMessage2Callback(i,r),Q.ok(i)):Q.fail(t)},q=function(e,t){var r=ee._buildMessage(e,!1);ee.logger.warn(Yn.P_SEND_MSG_R,JSON.stringify({code:t,messageId:r.messageId}),n),r.sentTime=Date.now()-ci.getDeltaTime(),Q.fail(t,r)},z=$i(this.logger,!1,"sendMessage",Z,q,e,t,o,JSON.stringify(a),p,h,B,J,l,f,W,w,x,X,g,JSON.stringify(Y),v,O,m,N,!!S),$=JSON.parse(z),null==i||i($.messageId),[2,Q.result()]}))}))}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return $e(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f,_,p,E,h,b,g,R,v,I=this;return et(this,(function(O){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,d=t.isDelete,f=t.directionalUserIdList,_=t.disableUpdateLastMessage,p=t.isAdmin,E=t.messageUId,h=t.sentTime,b={conversationType:o,targetId:i,messageUId:E,sentTime:h,user:a,extra:u,channelId:n,isDelete:d||!1,isAdmin:p},a&&(b.user=a),u&&(b.extra=u),g={conversationType:o,targetId:i,senderUserId:this.tcpMgr.getCurrentUserId(),content:b,objectName:Jt,messageUid:E,direction:Mt.SEND,status:ir.UNREAD,sentTime:h,channelId:n},R=this._buildMessage(JSON.stringify(g),!1),[2,(v=io.create(this.logger,"recallMessage")).asyncInvoke((function(e){return $e(I,void 0,void 0,(function(){return et(this,(function(e){return it(this,ao,"m",To).call(this,R),o===qe.ULTRA_GROUP&&this._dispatchEvent("ultraGroupMessageRecalled",[R]),R.pushConfig=c,v.ok(R),[2]}))}))}),(function(e){return v.fail(e)}),Jt,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)||"",wr(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,f||[],E,null!=_&&_).result()]}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){return et(this,(function(n){return r?[2,xr(it(this,ao,"m",mo).call(this,e,t))]:[2,it(this,ao,"m",Co).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return et(this,(function(l){switch(l.label){case 0:return r=t.timestamp,n=t.count,i=t.order,o=e.conversationType,a=e.targetId,s=e.channelId,[4,(u=io.create(this.logger,"getContinuousMessages",this.logger.createTraceId())).asyncInvoke(o,a,r,n,(function(e,t,r){return u.ok({listJson:e,hasMore:r,nextTime:t})}),(function(e){return u.fail(e)}),0===i,s||"").result()];case 1:return[2,l.sent().trans((function(e){var t=e.listJson,r=e.hasMore,n=e.nextTime,i=JSON.parse(t).list.map((function(e){var t=e.obj;return c._buildMessage(t)})).reverse();return{list:i,hasMore:!!r,timestamp:n}}))]}}))}))}}),Object.defineProperty(e.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=io.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(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=io.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(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){return et(this,(function(t){return it(this,ao,"m",No).call(this,e),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l=this;return et(this,(function(d){return r=e.channelId,n=e.count,i=e.startTime,o=e.conversationTypes,a=e.topPriority,s=o&&o.length>0?o:Et(t?dt:ct),u=s.map((function(e){return{conversationType:e,channelId:e===qe.ULTRA_GROUP?it(l,ao,"m",yo).call(l,""):r,channelIdValid:e===qe.ULTRA_GROUP||"string"==typeof r}})),c=$i(this.logger,!1,"getConversationListByPageWithTopPriorityV2",u,i,n,!!a),[2,it(this,ao,"m",go).call(this,c)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i,o,a=this;return et(this,(function(s){return n=((null==t?void 0:t.length)||0)>0?t:Et(e?dt:ct),i=n.map((function(e){return{conversationType:e,channelId:e===qe.ULTRA_GROUP?it(a,ao,"m",yo).call(a,""):r,channelIdValid:e===qe.ULTRA_GROUP||"string"==typeof r}})),o=$i(this.logger,!1,"getTopConversationsV2",i),[2,it(this,ao,"m",go).call(this,o)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i,o=this;return et(this,(function(a){return r=((null==t?void 0:t.length)||0)>0?t:Et(e?dt:ct),n=r.map((function(e){return{conversationType:e,channelId:e===qe.ULTRA_GROUP?it(o,ao,"m",yo).call(o,""):"",channelIdValid:e===qe.ULTRA_GROUP}})),i=$i(this.logger,!1,"getUnreadConversationListV2",n),[2,it(this,ao,"m",go).call(this,i)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i,o=this;return et(this,(function(a){return r=Et(e?dt:ct),n=r.map((function(e){return{conversationType:e,channelId:e===qe.ULTRA_GROUP?it(o,ao,"m",yo).call(o,""):t,channelIdValid:e===qe.ULTRA_GROUP||"string"==typeof t}})),i=$i(this.logger,!1,"getConversationsV2",n),[2,it(this,ao,"m",go).call(this,i)]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n;return et(this,(function(i){return r=Et(ct).map((function(e){return{conversationType:e,channelIdValid:!1}})),n=$i(this.logger,!1,"getConversationListByPageWithTopPriorityV2",r,e,t,!0),[2,it(this,ao,"m",go).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n;return et(this,(function(i){return n=$i(this.logger,!1,"getConversationsByPageWithoutTag",e,t,r),[2,it(this,ao,"m",go).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l,d,f;return et(this,(function(_){switch(_.label){case 0:return t=e.conversationType,r=e.targetId,n=e.channelId,(i=it(this,ao,"m",Po).call(this,e))?[2,xr(i)]:(o=it(this,ao,"m",mo).call(this,e,{timestamp:0,count:1,order:0,messageType:""}),a=(null==o?void 0:o.list[0])||null,s=JSON.parse($i(this.logger,!1,"getConversationStatus",JSON.stringify([{conversation_type:t,target_id:r,channel_id:n,channel_id_valid:"string"==typeof n&&n.length>0}])))[0],u=!!(null==s?void 0:s.is_top),c=(null==s?void 0:s.translate_strategy)||Xn,[4,this.getConversationNotificationLevel(e)]);case 1:return l=_.sent(),d=l.data,f={conversationType:t,targetId:r,channelId:n,latestMessage:a,lastUnreadTime:0,isTop:u,notificationLevel:d,notificationStatus:_r(d),translateStrategy:c,unreadMessageCount:it(this,ao,"m",Ao).call(this,e)},[2,xr(f)]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.identifiers,r=e.deleteRemotely,n=e.deleteMessages,i=io.create(this.logger,"batchDeleteConversations",this.logger.createTraceId());return i.invoke({conversationIdentifiers:t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),deleteMessages:n,deleteRemotely:r},(function(){return i.ok()}),(function(e){return i.fail(e)})).result()}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var t,r,n;return et(this,(function(i){return t=e instanceof Array?e:Et(dt),r=t.map((function(e){return{conversationType:e,channelIdValid:!1}})),[2,(n=$i(this.logger,!0,"clearConversationsV2",r))===ce.SUCCESS?xr():Wr(n)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i,o=this;return et(this,(function(a){return n=e.map((function(e){return{conversationType:e,channelId:e===qe.ULTRA_GROUP?it(o,ao,"m",yo).call(o,""):r,channelIdValid:e===qe.ULTRA_GROUP||"string"==typeof r}})),i=$i(this.logger,!0,"getTotalUnreadCount2",n,t),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return t=it(this,ao,"m",Ao).call(this,e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i,o;return et(this,(function(a){return t=e.conversationType,r=e.targetId,n=e.channelId,t===qe.ULTRA_GROUP?(i=this.getServerTime(),[2,(o=io.create(this.logger,"setReadTimestamp",this.logger.createTraceId())).asyncInvoke(t,r,i,(function(){return o.ok()}),(function(e){return o.fail(e)}),n||"").result()]):(it(this,ao,"m",Lo).call(this,e),[2,xr()])}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e,t=this;return et(this,(function(r){switch(r.label){case 0:return[4,this.getUnreadConversationList(!1)];case 1:return(e=r.sent()).isOk?(e.data.forEach((function(e){e.conversationType!==qe.ULTRA_GROUP&&it(t,ao,"m",Lo).call(t,e)})),[2,xr()]):[2,e.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){$i(this.logger,!1,"clearUnreadCountByTimestamp",e,t,r,n)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){return et(this,(function(i){return this._clearUnreadCountByTimestamp(e,t,r,n),[2,ce.SUCCESS]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return t=it(this,ao,"m",Mo).call(this,e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return t=it(this,ao,"m",Mo).call(this,e),[2,xr(t?{messageUId:t.messageUId,sentTime:t.sentTime}:null)]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return it(this,ao,"m",Uo).call(this,e,-1,t?1:0,-1,r,n)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=io.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(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return it(this,ao,"m",Uo).call(this,e,-1,-1,t,!1,!1)}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.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(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return t=$i(this.logger,!0,"getBlockPushLevelForType",e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a,s,u=this;return et(this,(function(c){switch(c.label){case 0:return i=this.logger.createTraceId(),o=io.create(this.logger,"searchConversationByContentV2",i),a=n.map((function(e){return{conversationType:e,channelId:r,channelIdValid:!0}})),[4,o.asyncInvoke(a,e,t,(function(e,t,r){e===ce.SUCCESS?o.ok({result:t,matchedNumber:r}):o.fail(e)})).result()];case 1:return(s=c.sent()).isOk?[2,s.trans((function(e){return JSON.parse(e.result).map((function(e){return it(u,ao,"m",bo).call(u,e)}))}))]:[2,xr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i,o,a,s=this;return et(this,(function(u){switch(u.label){case 0:return r=r||Et(ct),n=this.logger.createTraceId(),i=io.create(this.logger,"searchConversationByContentV2",n),o=r.map((function(e){return{conversationType:e,channelIdValid:!1}})),[4,i.asyncInvoke(o,e,t,(function(e,t,r){e===ce.SUCCESS?i.ok({result:t,matchedNumber:r}):i.fail(e)})).result()];case 1:return(a=u.sent()).isOk?[2,a.trans((function(e){return JSON.parse(e.result).map((function(e){return it(s,ao,"m",bo).call(s,e)}))}))]:[2,xr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o;return $e(this,void 0,void 0,(function(){var a,s,u,c,l=this;return et(this,(function(d){switch(d.label){case 0:return a=this.logger.createTraceId(),s=function(e){if(!e)return[];var t=[],r=function(e){if(0!==t.length){var r=[];e.forEach((function(e){r.push.apply(r,nt([],rt(t.map((function(t){return ze(ze({},t),e)}))),!1))})),t=r}else t.push.apply(t,nt([],rt(e),!1))},n=e.conversationTypes,i=void 0===n?[]:n,o=e.targetIds,a=void 0===o?[]:o,s=e.channelIds,u=void 0===s?[]:s,c=ln(i).map((function(e){return{conversationType:e}})),l=ln(a).map((function(e){return{targetId:e}})),d=ln(u).length?u.map((function(e){return{channelId:e}})):[{channelIdValid:!1}];return r(c),r(l),r(d),t}(e.conversationFilter),u={keyword:e.keyword,limit:e.limit,desc:!e.order,offset:null!==(t=e.offset)&&void 0!==t?t:0,needMatchCount:!0,startTime:null===(r=e.timeRange)||void 0===r?void 0:r.startTime,endTime:null===(n=e.timeRange)||void 0===n?void 0:n.endTime,objectNames:ln((null===(i=e.messageFilter)||void 0===i?void 0:i.objectNames)||[]),senderIds:ln((null===(o=e.messageFilter)||void 0===o?void 0:o.senderIds)||[])},[4,(c=io.create(this.logger,"searchMessage",a)).invoke(s,u,(function(e,t,r,n){e===ce.SUCCESS?c.ok({result:t,totalMatched:r,conditionsMatched:n}):c.fail(e)})).result()];case 1:return[2,d.sent().trans((function(e){var t=e.result,r=e.totalMatched,n=e.conditionsMatched;return{messages:JSON.parse(t).list.map((function(e){return JSON.parse(e.obj)})).map((function(e){return it(l,ao,"m",ho).call(l,e)})),totalMatched:r,conditionsMatched:n}}))]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i,o,a=this;return et(this,(function(s){return t=e.conversationType,r=e.targetId,n=e.channelId,i=$i(this.logger,!1,"getUnreadMentionedMessages",t,r,n||""),o=JSON.parse(i).list.map((function(e){var t=e.obj;return it(a,ao,"m",ho).call(a,JSON.parse(t))})),[2,xr(o)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return $e(this,void 0,void 0,(function(){var r;return et(this,(function(n){return r=it(this,ao,"m",Po).call(this,e),[2,xr(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.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(e.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(e.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(e.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(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r;return et(this,(function(n){return[2,-1===(r=it(this,ao,"m",Do).call(this,e,t)).messageId?Wr(ce.MSG_INSERT_ERROR,"insert message failed",r):xr(r)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),$e(this,void 0,void 0,(function(){var r;return et(this,(function(n){return r=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,d=e.messageUId,f=e.disableNotification,_=e.canIncludeExpansion,p=e.expansion,E=e.channelId,h=e.conversationType,b=e.targetId,g=e.source,R=e.isMentioned,v=e.receivedStatusInfo,I=e.directedUserIds,O=e.disableUpdateLastMessage,T=v?function(e){var t=ir.UNREAD;return(null==e?void 0:e.isRead)&&(t|=ir.READ),(null==e?void 0:e.isListened)&&(t|=ir.LISTENED),(null==e?void 0:e.isDownload)&&(t|=ir.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=ir.RETRIEVED),t}(v):a,m=u||0,C={};if(p)for(var N in p)C[N]={v:p[N],ts:m};return{conversationType:h,targetId:b,channelId:E||"",direction:i,senderUserId:r,status:s||10,sentTime:m,objectName:n,content:JSON.stringify(t),messageUid:d||"",noNotification:!!f,supportExt:!!_,extMsg:JSON.stringify(C),readStatus:T,searchContent:c||"",isUnread:!!l,source:g||"",isMention:R,directedUsers:I,disableUpdateLastMessage:!!O}})),[2,$i(this.logger,!0,"insertMessages",JSON.stringify(r),t)?xr(!0):Wr(ce.MSG_INSERT_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i;return et(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=$i(this.logger,!0,"getMessageCount",t,r,n||""),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){return et(this,(function(t){return it(this,ao,"m",wo).call(this,e),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){return et(this,(function(n){return it(this,ao,"m",jo).call(this,e,t,r),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return t=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}})),$i(this.logger,!1,"deleteMessageBySendTimeInBatches",JSON.stringify(t)),[2,xr()]}))}))}}),Object.defineProperty(e.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=io.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(e.prototype,"getMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r;return et(this,(function(n){return t=$i(this.logger,!0,"getMessage",e),(r=this._buildMessage(t,!1)).messageId<=0?[2,Wr(ce.RC_DB_DATA_NOT_FOUND,"msg not found: ".concat(e))]:[2,xr(r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){return et(this,(function(n){return it(this,ao,"m",Vo).call(this,e,t,r),[2,xr()]}))}))}}),Object.defineProperty(e.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(e.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(e.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(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i;return et(this,(function(o){return r=e.conversationType,n=e.targetId,i=e.channelId,[2,$i(this.logger,!1,"saveTextMessageDraft",r,n,t,i||"")?xr():Wr(ce.DRAFT_SAVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i;return et(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=$i(this.logger,!0,"getTextMessageDraft",t,r,n||""),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n;return et(this,(function(i){return t=e.conversationType,r=e.targetId,n=e.channelId,[2,$i(this.logger,!1,"clearTextMessageDraft",t,r,n||"")?xr():Wr(ce.DRAFT_REMOVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i;return et(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=$i(this.logger,!0,"getBlockPushLevelForConversation",r,n||"",t),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i;return et(this,(function(o){return n=e.map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(i=$i(this.logger,!0,"getUnreadAndMentionCountByLevel",n,t)).code?[2,Wr(i.code)]:[2,xr(r?i.mention:i.unread)]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i,o=this;return et(this,(function(a){switch(a.label){case 0:return[4,(n=io.create(this.logger,"sendReadReceipt",this.logger.createTraceId())).asyncInvoke(e,r||"",t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){o._updateReadReceiptInfo(e,{hasRespond:!0});try{var t=JSON.parse(o._callCppProxy("getMessage",e)).messageId;o.setMessageReceivedStatus(t,1)}catch(t){o.logger.error(Yn.P_PARSE_JSON_MSGS_E,JSON.stringify({messageUId:e,error:null==t?void 0:t.stack}))}})),[2,i]}}))}))}}),Object.defineProperty(e.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(e.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(e.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(Yn.P_PARSE_JSON_E,"method: getMessageReadReceipt, info: ".concat(o,", error: ").concat(e))}var c=JSON.parse(u.readReceiptRequest||"{}"),l=c.readerList,d=void 0===l?[]:l,f=c.readCount,_=void 0===f?0:f,p=!1;d.length<a.length&&(d=a,p=!0),_<i&&(_=i,p=!0),p&&r._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify({readerList:d,readCount:_,totalCount:e})),setTimeout((function(){n({code:ce.SUCCESS,data:{list:a,totalCount:e,readCount:_}})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(e.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(e.prototype,"_try2RejoinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(0!==this._chatroomCache.size){var t=this.logger.createTraceId();this._chatroomCache.forEach((function(r){return $e(e,void 0,void 0,(function(){var e,n,i,o,a,s,u;return et(this,(function(c){switch(c.label){case 0:return e=r.chatroomId,n=r.count,i=r.extra,this.logger.info(Re,e,t),[4,this._joinChrm(e,n,!1,!0,i)];case 1:return o=c.sent(),this.logger.summary(ve,o,t),a=o.code,s=o.isOk,u=o.data,s?(this._sendChatroomEvents({rejoinedRoom:ze({chatroomId:e,count:n},u)}),[2]):(a!==ce.RC_CHATROOM_USER_KICKED&&a!==ce.RC_CHATROOM_NOT_EXIST||this._chatroomCache.delete(e),this._sendChatroomEvents({rejoinedRoom:{chatroomId:e,errorCode:a}}),[2])}}))}))}))}}}),Object.defineProperty(e.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this,a=r?"joinChatRoom":"joinExistChatRoom";n||it(this,ao,"m",So).call(this,e,!0,!0);var s=io.create(this.logger,a,this.logger.createTraceId());return s.asyncInvoke(e,t,(function(r,a,u,c,l,d,f){o._chatroomCache.set(e,{chatroomId:e,count:t,extra:i||"",isKVSynced:n}),s.ok({createTime:Number(r),memberCount:a,isAllChatroomBanned:u,isCurrentUserBanned:c,isCurrentChatroomBanned:l,isCurrentChatroomInWhitelist:d,joinTime:f})}),(function(e){return s.fail(e)}),i||"").result()}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){return et(this,(function(i){return[2,this._joinChrm(e,t,r,!1,n)]}))}))}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._chatroomCache.delete(e);var t=io.create(this.logger,"quitChatRoom",this.logger.createTraceId());return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.create(this.logger,"getChatroomInfo",this.logger.createTraceId());return n.asyncInvoke(e,t,r,(function(e,t){var r=(e?JSON.parse(e).list:[]).map((function(e){return JSON.parse(e.obj)}));n.ok({userInfos:r,userCount:t})}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a=this;return et(this,(function(s){return i=this.logger.createTraceId(),[2,(o=io.create(this.logger,"getChatroomHistoryMessage",i)).asyncInvoke(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 a._buildMessage(e.obj)}))}catch(e){t.list=[]}o.ok(t)}),(function(e){return o.fail(e)}),"").result()]}))}))}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.create(this.logger,"setChatroomStatus",this.logger.createTraceId());return n.asyncInvoke(e,t.key,t.value,!!t.isAutoDelete,r,!!t.isSendNotification,t.notificationExtra||"",(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.create(this.logger,"setChatroomKV");return r.asyncInvoke(e,JSON.stringify(t.entries),!!t.isAutoDelete,!!t.isForce,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.create(this.logger,"deleteChatroomStatus",this.logger.createTraceId());return n.asyncInvoke(e,t.key,r,!!t.isSendNotification,t.notificationExtra||"",(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.create(this.logger,"deleteChatroomKV",this.logger.createTraceId());return r.asyncInvoke(e,t.keys,!1,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){return et(this,(function(r){switch(r.label){case 0:return[4,this.getAllChatroomEntries(e)];case 1:return[2,r.sent().tryTrans((function(e){var r=e[t];return"string"!=typeof r?Wr(ce.CHATROOM_KEY_NOT_EXIST):xr(r)}))]}}))}))}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"getChatroomKV",this.logger.createTraceId());return t.asyncInvoke(e,(function(e){var r={};try{(e?JSON.parse(e):{list:[]}).list.forEach((function(e){var t=e.obj,n=JSON.parse(t);r[n.key]=n.value?n.value:""}))}catch(e){}t.ok(r)}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.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||"":Dr(e,t);var c=a.getNaviInfoFromCache(),l={uploadDomain:Gr(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,d,f,_,p,E,h,b,g,R,v,I,O,T,m,C){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:d,s3Date:f,s3Policy:_,s3Signature:p,s3BucketName:E,stcAuthorization:h,stcContentSha256:b,stcDate:g,stcBucketName:R,minioAuthorization:v,minioContentSha256:I,minioDate:O,minioBucketName:T,downloadAuthInfo:m?JSON.parse(m):null}})}),0)}),(function(e){setTimeout((function(){s({code:e})}),0)}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this.getNaviInfoFromCache(),o=Gr(i,this.logger),a=this.logger.createTraceId(),s=io.create(this.logger,"getDownloadUrl",a);return s.asyncInvoke(e,r,n,t-1,JSON.stringify({url:o}),-1,i.ipType||0,(function(e){return s.ok({downloadUrl:e})}),(function(e){return s.fail(e)})).result()}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e;return et(this,(function(t){return e=$i(this.logger,!0,"clearData"),[2,xr(e)]}))}))}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._deviceId}}),Object.defineProperty(e.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(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"bindRTCRoomForChatroom",this.logger.createTraceId());return t.asyncInvoke(e.chatRoomId,e.rtcRoomId,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.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(e.prototype,"_setRTCHeartbeatListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ci.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(e.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(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"addTag");return t.asyncInvoke(e.tagId,e.tagName,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"deleteTag");return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"renameTag");return t.asyncInvoke(e.tagId,e.tagName,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e,t;return et(this,(function(r){return e=$i(this.logger,!1,"getTags"),t=this._convertResultList(e,(function(e){return{tagId:e.tagId,tagName:e.tagName,conversationCount:e.conversationCount,createdTime:e.tagTime}})),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.create(this.logger,"addConversationsForTag"),n=t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId}}));return r.asyncInvoke(e,JSON.stringify(n),(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.create(this.logger,"removeConversationsForTag"),n=t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId}}));return r.asyncInvoke(e,JSON.stringify(n),(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.create(this.logger,"removeTagsForConversation");return r.asyncInvoke(e.conversationType,e.targetId,e.channelId||"",t,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i,o=this;return et(this,(function(a){return n=$i(this.logger,!1,"getConversationsForTagByPage",e,t,r,""),i=this._convertResultList(n,(function(e){return ze(ze({},o._buildConversation(JSON.stringify(e))),{isTopInTag:e.topForTag})})),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r;return et(this,(function(n){return r=$i(this.logger,!0,"getConversationUnreadCountForTag",e,t),[2,xr(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.create(this.logger,"setConversationToTopForTag");return n.asyncInvoke(e,t.conversationType,t.targetId,t.channelId||"",!!r.isTop,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r;return et(this,(function(n){return t=$i(this.logger,!1,"getTagsForConversation",e.conversationType,e.targetId,e.channelId||""),r=this._convertResultList(t,(function(e){return{tagId:e.tagId,tagName:e.tagName,isTop:e.isTop,createdTime:e.tagTime}})),[2,xr(r)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e,t;return et(this,(function(r){return e=[qe.GROUP].map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(t=$i(this.logger,!0,"getUnreadAndMentionCountV2",e)).code?[2,Wr(t.code)]:[2,xr(t.mention)]}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e;return et(this,(function(t){return e={arch:o(),platform:i(),type:c(),version:l(),release:u(),uptime:d(),cpus:s(),freemem:f(),totalmem:_(),networkInterfaces:a()},[2,{code:ce.SUCCESS,data:e}]}))}))}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){return et(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(e.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(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.tcpMgr.getConnectionStatus()!==Pt.DISCONNECTED?Promise.resolve({code:ce.RC_CONN_PROXY_UNAVAILABLE}):Promise.resolve(Si(e,this.logger))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve(yi())}}),Object.defineProperty(e.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)?mi:Ii;r.info(Ue,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(e.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(e.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,St.SUBSCRIBE,e,(function(){i({code:ce.SUCCESS})}),(function(e,t){i({code:e,data:t})}),r)}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("updateSubscribeStatus",t,St.UNSUBSCRIBE,e,(function(){n({code:ce.SUCCESS})}),(function(e){n({code:e})}),0)}))}}),Object.defineProperty(e.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===Nt.ONLINE_STATUS&&(a.details=Pr(o)),a}));return Promise.resolve({code:ce.SUCCESS,data:i})}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return[2,(t=$i(this.logger,!1,"setDuplicateMessageConfig",[qe.CHATROOM],Jo.cuid,e))===ce.SUCCESS?xr():Wr(t)]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r=this;return et(this,(function(n){switch(n.label){case 0:return[4,it(this,ao,"m",Ho).call(this,[e],t)];case 1:return[2,n.sent().trans((function(e){var t=r._buildSubscribeEventData(e).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===Nt.ONLINE_STATUS&&(a.details=Pr(o)),a}));return t}))]}}))}))}}),Object.defineProperty(e.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=io.create(this.logger,"updateUserProfile");return n.invoke(t,r,(function(e,t){if(e===ce.SUCCESS)n.ok();else{var r=ni(t);n.fail(e,{errorKey:r[0],errorKeys:r})}})).result()}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=io.create(this.logger,"getUserProfiles");return r.invoke(e,(function(e,n){e===ce.SUCCESS?r.ok(t._string2UserProfileInfoList(n)):r.fail(e)})).result()}}),Object.defineProperty(e.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(e.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(Yn.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return{}}}),Object.defineProperty(e.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(Yn.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return[]}}),Object.defineProperty(e.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(e.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(e.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(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a,s,u,c=this;return et(this,(function(l){return i=e.conversationType,o=e.targetId,a=e.channelId,s=$i(this.logger,!1,"getMatchedMessage",i,o,t,r,n,a||""),u=JSON.parse(s).list.map((function(e){var t=e.obj;return c._buildMessage(t)})),[2,xr(u)]}))}))}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return t=it(this,ao,"m",Go).call(this,e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"handleErrorCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e!==ce.SUCCESS&&setTimeout((function(){return t(Wr(e))}),0)}}),Object.defineProperty(e.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,d=Ur(r),f=Ur(o);return{groupId:t,groupName:d.name||"",portraitUri:d.portraitUrl||"",introduction:d.introduction||"",notice:d.announcement||"",joinPermission:~~d.joinPerm,removeMemberPermission:~~d.removePerm,invitePermission:~~d.memInvitePerm,inviteHandlePermission:~~d.invitePerm,groupInfoEditPermission:~~d.profilePerm,memberInfoEditPermission:~~d.memProfilePerm,extProfile:f,creatorId:i||"",ownerId:s||"",createTime:n||0,membersCount:a||0,remark:u||"",joinedTime:c||0,role:l||K.UNDEF}})):[]}}),Object.defineProperty(e.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,d=Ur(r),f=Ur(o);return JSON.parse(JSON.stringify(ze(ze(ze(ze(ze(ze(ze(ze(ze({groupId:t},function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Mr(e.joinPerm),removeMemberPermission:Mr(e.removePerm),invitePermission:Mr(e.memInvitePerm),inviteHandlePermission:Mr(e.invitePerm),groupInfoEditPermission:Mr(e.profilePerm),memberInfoEditPermission:Mr(e.memProfilePerm)}))}(d)),o.length>0&&{extProfile:f}),i&&{creatorId:i}),s&&{ownerId:s}),n&&{createTime:n}),a&&{membersCount:a}),u&&{remark:u}),c&&{joinedTime:c}),l&&{role:l})))})):[]}}),Object.defineProperty(e.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(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a;return et(this,(function(s){return i=ei(t),o=ei(r||{}),[2,(a=io.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:ni(n),processCode:t})})).result()]}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i,o;return et(this,(function(a){return n=ei(t),i=ei(null!=r?r:{}),[2,(o=io.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:ni(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t=this;return et(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(Yn.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(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n=this;return et(this,(function(i){return[2,new Promise((function(i){var o=ti(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(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r=this;return et(this,(function(n){return[2,new Promise((function(n){var i=ti(t),o=r._callCppProxy("quitGroup",e,JSON.stringify(i),(function(e,t){setTimeout((function(){n({code:e})}),0)}));r.handleErrorCode(o,n)}))]}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t=this;return et(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(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i=this;return et(this,(function(o){return[2,new Promise((function(o){var a=ti(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(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n=this;return et(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(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n=this;return et(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(Yn.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(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r=this;return et(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(Yn.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(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i;return et(this,(function(o){return[2,(i=io.create(this.logger,"updateGroupMemberInfo")).invoke(e,t,r,n||"",(function(e,t,r,n){e===ce.SUCCESS?i.ok():i.fail(e,{errorKeys:ni(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n=this;return et(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(Yn.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(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t=this;return et(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(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r=this;return et(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(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t=this;return et(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:"",d=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(d,r)}))]}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r=[]),$e(this,void 0,void 0,(function(){var n=this;return et(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(Yn.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(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r=this;return et(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(Yn.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(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r=this;return et(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(Yn.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(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t=this;return et(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(Yn.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(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r=this;return et(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(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n=this;return et(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(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t=this;return et(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(Yn.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(e.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(e.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(e.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(e.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(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.create(this.logger,"setFriendInfo"),i=ei(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:ni(i)})})).result()}}),Object.defineProperty(e.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(e.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(Yn.P_PARSE_JSON_MSGS_E,n),setTimeout((function(){r({code:ce.MAIN_PROCESS_ERROR})}),0)}}));t.handleErrorCode(n,r)}))}}),Object.defineProperty(e.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(Yn.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(e.prototype,"deleteFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({code:ce.NOT_SUPPORT})}}),Object.defineProperty(e.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(e.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(e.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(Yn.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(e.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(e.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(e.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=io.create(this.logger,"addPushSetting");return o.invoke(t,r,n,i||"",(function(){return o.ok()}),(function(e){return o.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=io.create(this.logger,"removePushSetting");return e.invoke((function(){return e.ok()}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=io.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(e.prototype,"setDataBaseLogConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._callCppProxy("setDataBaseLogConfig",e)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){return et(this,(function(e){return[2,xr(Rn.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.create(this.logger,"sendReadReceiptByReadReceiptType");return r.invoke(e.conversationType,e.targetId,e.channelId||"",Qn,t,(function(e,t,n){e!==ce.SUCCESS?r.fail(e):r.ok()})).result()}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r;return et(this,(function(n){switch(n.label){case 0:return t=e.map((function(e){var t=e.identifier,r=e.messageUId;return{conIdentifier:{type:t.conversationType,targetId:t.targetId,channelId:t.channelId||""},uid:r}})),[4,(r=io.create(this.logger,"getReadReceiptCount")).invoke(JSON.stringify(t),(function(e,t){e!==ce.SUCCESS?r.fail(e):r.ok(t)})).result()];case 1:return[2,n.sent().trans((function(e){return JSON.parse(e).map((function(e){return{identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.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(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.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()}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n=this;return et(this,(function(i){return t=function(t,r){var i=JSON.parse(r),o={status:i.status,text:i.text,isVisible:i.visible};setImmediate((function(){n._dispatchEvent("speechToTextResponse",{code:t,messageUId:e,sttInfo:o})}))},[2,(r=$i(this.logger,!0,"speechToText",e,t))===ce.SUCCESS?xr():Wr(r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r;return et(this,(function(n){return[2,(r=$i(this.logger,!0,"updateSpeechToTextVisible",e,t))===ce.SUCCESS?xr():Wr(r)]}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"setPushSetting");return t.invoke(Zn,e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e;return et(this,(function(t){return e=$i(this.logger,!0,"getPushSetting",Zn),[2,xr(e)]}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"setPushSetting");return t.invoke(qn,e?"1":"0",(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e;return et(this,(function(t){return e=$i(this.logger,!0,"getPushSetting",qn),[2,xr("1"===e)]}))}))}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return $e(this,void 0,void 0,(function(){var i,o,a;return et(this,(function(s){return i=$i(this.logger,!0,"getPushSetting",Zn)||"zh",o=io.create(this.logger,"translateMessages"),a=e.map((function(e){return{messageRecognitionIdentifier:{messageUid:e.identifier,customText:0===n?"":e.content,inputSource:n},sourceLanguage:e.sourceLanguage,targetLanguage:e.targetLanguage||i}})),[2,o.invoke(a,{forceRetranslate:r,translationServiceType:t},(function(e){e!==ce.SUCCESS?o.fail(e):o.ok()})).result()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.stringify(e.messageContent),r=io.create(this.logger,"editMessage",this.logger.createTraceId());return r.asyncInvoke((function(){return r.ok()}),(function(e){return r.fail(e)}),e.messageUId,t).result()}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this,o=io.create(this.logger,"getQuotingMessageByUId");return o.asyncInvoke(t.conversationType,t.targetId,t.channelId||"",e,(function(e){o.fail(e)}),(function(e){o.ok(),setTimeout((function(){return it(i,ao,"m",Fo).call(i,e,n)}),0)}),(function(e){o.ok(),setTimeout((function(){return it(i,ao,"m",Fo).call(i,e,r)}),0)})).result()}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){var e;return et(this,(function(t){return[2,(e=$i(this.logger,!0,"getRemoteConversations"))===ce.SUCCESS?xr():Wr(e)]}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=io.create(this.logger,"sendUGOperateStatus",this.logger.createTraceId());return t.asyncInvoke(e.targetId,0,e.channelId,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i,o=this;return et(this,(function(a){return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=$i(this.logger,!1,"getUGConversationListForAllChannel"),i=JSON.parse(n).list.map((function(e){var t=e.obj,r=JSON.parse(t);return it(o,ao,"m",bo).call(o,r)})).filter((function(e){return!("string"==typeof t&&t!==e.targetId||"number"==typeof r&&r!==e.channelType)})).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i,o,a=this;return et(this,(function(s){switch(s.label){case 0:return r=io.create(this.logger,"getRemoteMessageByUids",this.logger.createTraceId()),n=e.targetId,i=e.conversationType,o=e.channelId,[4,r.asyncInvoke(n,i,t.map((function(e){return{messageUId:e,channelId:o||"",sentTime:0}})),(function(e){return r.ok(e)}),(function(e){return r.fail(e)})).result()];case 1:return[2,s.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return it(a,ao,"m",ho).call(a,r)}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i,o;return et(this,(function(a){switch(a.label){case 0:return t=io.create(this.logger,"getUltraGroupUnreadMentionedDigest",this.logger.createTraceId()),r=e.targetId,n=e.channelId,i=e.sentTime,o=e.count,[4,t.asyncInvoke(r,n||"",i,o,(function(e){return t.ok(e)}),(function(e){return t.fail(e)})).result()];case 1:return[2,a.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return{messageUId:r.msgUId,messageType:r.objectName,sentTime:r.sentTime,mentionedType:r.isMentionedAll?ut.ALL:ut.SINGAL}}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){return et(this,(function(r){return $i(this.logger,!1,"clearUGMessageByTimestamp",e,t,!1),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.create(this.logger,"updateUGMessageExpansion",this.logger.createTraceId());return n.asyncInvoke(e.targetId,t.mid,r,JSON.stringify(t),e.channelId,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=io.create(this.logger,"setDefaultBlockPushLevel",this.logger.createTraceId());return n.asyncInvoke(e,r||"",qe.ULTRA_GROUP,t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=io.create(this.logger,"getDefaultBlockPushLevel",this.logger.createTraceId());return r.asyncInvoke(e,t||"",qe.ULTRA_GROUP,(function(e){return r.ok(e)}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i;return et(this,(function(o){return t.length>0?(n=$i(this.logger,!0,r?"getUltraGroupUnreadMentionedCount":"getUltraGroupUnreadCount",e,t),[2,xr(n)]):(i=$i(this.logger,!0,r?"getUGMentionCount":"getUGUnreadCount",e),[2,xr(i)])}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r;return et(this,(function(n){return t=$i(this.logger,!1,"getInfoForConversations",e),r=JSON.parse(t).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.targetId,i=r.conversationType,o=r.channelId,a=r.unreadCount;return{targetId:n,conversationType:i,channelId:o,unreadCount:a,mentionedCount:r.mentionCount,mentionedMeCount:r.mentionMeCount,notificationLevel:r.blockStatus,type:qe.ULTRA_GROUP,unreadMessageCount:a}})),[2,xr(r)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return(t=it(this,ao,"m",Mo).call(this,e))?[2,xr({sentTime:t.sentTime,messageType:t.messageType,messageUId:t.messageUId})]:[2,Wr(ce.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e(this,void 0,void 0,(function(){return et(this,(function(e){return[2,it(this,ao,"m",Bo).call(this,[{conversationType:qe.ULTRA_GROUP,channelIdValid:!1}])]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n=this;return et(this,(function(i){return t=Et(e?dt:ct),r=t.map((function(e){return{conversationType:e,channelId:e===qe.ULTRA_GROUP?it(n,ao,"m",yo).call(n,""):"",channelIdValid:e===qe.ULTRA_GROUP}})),[2,it(this,ao,"m",Bo).call(this,r).trans((function(e){return e.reverse()}))]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){return et(this,(function(t){switch(t.label){case 0:return[4,it(this,ao,"m",Ho).call(this,[Nt.ONLINE_STATUS,Nt.FRIEND_ONLINE_STATUS],e)];case 1:return[2,t.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t,r=e.obj,n=JSON.parse(r),i=n.userId,o=n.details,a=(void 0===o?[]:o).map((function(e){var t=JSON.parse(e),r=t.changeTime,n=t.changeValue;return{platform:t.platform,isOnline:!!n,updateTime:r}})),s=a.some((function(e){return e.isOnline}));return t={userId:i,isOnline:s,details:a},[Ct.iOS,Ct.Android,Ct.Web,Ct.PC,Ct.Mini,Ct.HarmonyOS].forEach((function(e){t.details.some((function(t){return t.platform===e}))||t.details.push({platform:e,isOnline:!1,updateTime:0})})),t}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var r;return et(this,(function(n){return[2,(r=$i(this.logger,!1,"saveEditedMessageDraft",Zo(t),e.messageUId,e.content))===ce.SUCCESS?xr():Wr(r)]}))}))}}),Object.defineProperty(e.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t,r,n,i,o;return et(this,(function(a){return t=$i(this.logger,!1,"getConversationMetadata",Zo(e)),(r=t.find((function(e){return"edited_message_draft"===e.key})))?(n=JSON.parse(r.value),i=n.msg_uid,o=n.content,[2,xr({messageUId:i,content:o})]):[2,xr(null)]}))}))}}),Object.defineProperty(e.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $e(this,void 0,void 0,(function(){var t;return et(this,(function(r){return[2,(t=$i(this.logger,!1,"removeConversationMetadata",Zo(e),["edited_message_draft"]))===ce.SUCCESS?xr():Wr(t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return $e(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l=this;return et(this,(function(d){return t=e.timestamp,r=e.count,n=e.conversationTypes,i=n.map((function(e){return{conversationType:e,channelId:e===qe.ULTRA_GROUP?"RCDefault":"",channelIdValid:e===qe.ULTRA_GROUP}})),o=$i(this.logger,!1,"getUnreadMentionMeConversationsByPageWithTopPriority",i,t,r,!!e.topPriority),a=JSON.parse(o),s=a.code,u=a.list,s!==ce.SUCCESS?[2,Wr(s)]:(c=u.map((function(e){return l._buildConversation(e.obj)})),[2,xr(c)])}))}))}}),e}();ao=new WeakSet,so=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})),r=[],n=[],i=[];t.forEach((function(e){var t=e.changeTime,o=e.changeType,a=e.channelId,s=e.channelType,u=e.targetId,c=e.userId;switch(o){case Rt.CHANNEL_DELETE:n.push({targetId:u,channelId:a,channelType:s,deleteTime:t});break;case Rt.PUBLIC_TO_PRIVATE:r.push({targetId:u,channelId:a,changeType:bt.PUBLIC_TO_PRIVATE,channelType:ht.PRIVATE});break;case Rt.PRIVATE_TO_PUBLIC:r.push({targetId:u,channelId:a,changeType:bt.PRIVATE_TO_PUBLIC,channelType:ht.PUBLIC});break;case Rt.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:break;case Rt.CHANNEL_USER_KICKED:i.push({targetId:u,channelId:a,userId:c,channelType:s});break;case Rt.PUBLIC_TO_PRIVATE_USER_NOT_IN:r.push({targetId:u,channelId:a,changeType:bt.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:s})}})),r.length>0&&this._dispatchEvent("ultraGroupChannelChangeType",r),n.length>0&&this._dispatchEvent("ultraGroupChannelDelete",n),i.length>0&&this._dispatchEvent("ultraGroupChannelUserKicked",i)},uo=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})),r=[],n=[],i=[],o=[],a=[],s=qe.ULTRA_GROUP;t.forEach((function(e){var t=e.targetId,u=e.userGroupId,c=e.eventType,l=e.channelId,d=e.channelType;switch(c){case vt.REMOVE_USER_GROUP:r.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case vt.JOIN_USER_GROUP:n.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case vt.EXIT_USER_GROUP:i.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case vt.CHANNEL_BIND_USER_GROUP:o.push({conversation:{conversationType:s,targetId:t,channelId:l},channelType:d,userGroupIds:u});break;case vt.CHANNEL_UNBIND_USER_GROUP:a.push({conversation:{conversationType:s,targetId:t,channelId:l},channelType:d,userGroupIds:u})}}));var u={};r.length>0&&(u.userGroupDisband=r),n.length>0&&(u.userAdded=n),i.length>0&&(u.userRemoved=i),o.length>0&&(u.userGroupBindChannel=o),a.length>0&&(u.userGroupUnBindChannel=a),this._dispatchEvent("userGroupStatus",u)},co=function(e,t,r){return $e(this,void 0,void 0,(function(){var n,i;return et(this,(function(o){switch(o.label){case 0:return[4,this.getConversation({conversationType:qe.ULTRA_GROUP,targetId:e,channelId:t})];case 1:return n=o.sent(),i=n.data,this._dispatchEvent("conversation",[{conversation:i,updatedItems:{unreadMessageCount:{val:i.unreadMessageCount,time:r}}}]),[2]}}))}))},lo=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.channelId,i=r.operateTime;return{channelId:n,operationType:r.operateType,operationTime:i,targetId:r.targetId,userId:r.userId}}));this._dispatchEvent("operateStatus",{conversationType:qe.ULTRA_GROUP,info:t,hasInfo:!0,hasSummary:!1,summary:[]})},fo=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return{targetId:r.targetId,channelId:r.channelId,count:r.userNum,operationType:r.operateType}}));this._dispatchEvent("operateStatus",{conversationType:qe.ULTRA_GROUP,info:[],hasInfo:!1,hasSummary:!0,summary:t})},_o=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var r=e.obj;return t._buildMessage(r)}));this._dispatchEvent("ultraGroupMessageExpansionUpdated",r)},po=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var r=e.obj;return t._buildMessage(r)}));this._dispatchEvent("messagesModified",r)},Eo=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.channelId,i=r.conversationType,o=r.isAdmin,a=r.isDel;r.mentionType;var s=r.msgUId,u=r.operatorId,c=r.sentTime,l=r.targetId;return{targetId:l,conversationType:i,sentTime:c,messageUId:s,senderUserId:u,channelId:n,content:{conversationType:i,targetId:l,channelId:n,isAdmin:o,isDelete:a,sentTime:c,messageUId:s},messageDirection:1,messageType:Jt,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:ir.UNREAD,receivedStatusInfo:yr(ir.UNREAD)}}));r.slice().forEach((function(e){return it(t,ao,"m",To).call(t,e)})),r.length>0&&this._dispatchEvent("ultraGroupMessageRecalled",r)},ho=function(e,t){var r=e.channelId,n=e.senderUserId,i=e.content,o=e.objectName,a=e.direction,s=e.status,u=e.messageId,c=e.sentTime,l=e.readReceiptRequest,d=e.supportExt,f=e.pushContent,_=e.pushTitle,p=e.pushId,E=e.pushConfig,h=e.templateId,b=e.disableTitle,g=e.forcePushDetail,R=e.hasMore,v=e.directedUsers,I=e.noNotification,O=e.disableUpdateLastMessage,T=e.needReceipt,m=e.sendReceipt,C=e.contentRecognition,N=e.convertExt,S=e.editTime,y=e.editContent,P=e.editStatus,A=e.quotedMsgStatus,L=e.hasChanged,M=e.conversationType,U=e.targetId,D=e.messageUid,w=this._parseMessageJsonContent(i,u),j=!!w.mentionedInfo;if(o===Jt&&n===this.tcpMgr.getCurrentUserId()&&(M=w.conversationType,U=w.targetId,D=w.messageUId),N){var V=JSON.parse(N);if(V.trans){var G=V.trans,k={targetLanguage:G.targetLanguage,translatedText:G.translatedText,status:G.translateStatus};w.translateInfo=k}}if(o===Gt||o===kt){var F=C?JSON.parse(C):{status:hr,text:"",visible:!1},B={status:F.status,text:F.text,isVisible:F.visible};w.sttInfo=B}var H,J=Jn(o),x=this._buildSupportExt(d,e),W=void 0===(H=t)||"[object Undefined]"===Object.prototype.toString.call(H)?c<this.tcpMgr.getConnectedTime():t,Y={};E&&(Y=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,d,f,_,p,E,h=Object.keys(e);if(0!==h.length){var b=h[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===(d=e[b])||void 0===d?void 0:d.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===(f=e[b])||void 0===f?void 0:f.importance,void(n.imageUrlHonor=null===(_=e[b])||void 0===_?void 0:_.image);case"OHOS":i.category=null===(p=e[b])||void 0===p?void 0:p.category,i.image=null===(E=e[b])||void 0===E?void 0:E.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}}(E,p));var K=ze(ze({},Y),{pushTitle:_,pushContent:f,pushData:f,disablePushTitle:b,forceShowDetailContent:g,templateId:h}),X={channelId:r,conversationType:M,targetId:U,senderUserId:n,content:w||{},messageType:o,messageUId:D||"",messageDirection:a,isOffLineMessage:W,sentTime:c,receivedTime:0,isPersited:J.isPersited,isCounted:J.isCounted,isMentioned:j,disableNotification:I,isStatusMessage:Jn(o).isStatusMessage||!1,canIncludeExpansion:d,expansion:d?x:null,receivedStatus:0,receivedStatusInfo:void 0,sentStatus:void 0,messageId:u,pushConfig:K,hasMore:R,directedUserIds:v||[],disableUpdateLastMessage:O,needReceipt:T,sendReceipt:m};if(a===Mt.RECEIVE?(X.receivedStatus=s,X.receivedStatusInfo=yr(s)):X.sentStatus=s,l){var Q=this._handleReadReceiptRequest(l);X.readReceiptInfo=Q}return M===qe.ULTRA_GROUP?X.isModifyMessage=!!L:(X.isModifyMessage=!(!S&&!P),X.isModifyMessage&&(X.modifyInfo={timestamp:S,content:y?JSON.parse(y):{},status:P})),o===Ht&&(X.content.referMsgStatus=A),X},bo=function(e){var t=e.channelId,r=e.conversationType,n=e.targetId,i=e.lastestMsg,o=e.isTop,a=e.blockStatus,s=e.matchCount,u=e.hasUnreadMention,c=e.unreadCount,l=e.mentionCount,d=e.mentionMeCount,f=e.conversationTime,_=e.draft,p=e.translateStrategy,E=e.channelType,h=e.metadata,b=-1===JSON.parse(i).messageId?null:this._buildMessage(i),g=h?JSON.parse(h):{},R=g.edited_message_draft?JSON.parse(g.edited_message_draft):void 0;return{channelId:t,conversationType:r,targetId:n,channelType:E,unreadMessageCount:c,unreadMentionedCount:l,unreadMentionedMeCount:d,hasMentioned:u,latestMessage:b,notificationStatus:_r(a),isTop:o,lastUnreadTime:0,matchCount:s,operationTime:f,notificationLevel:a,draft:_,translateStrategy:p,editedMessageDraft:R?{messageUId:R.msg_uid,content:R.content}:void 0}},go=function(e){var t=this;try{var r=JSON.parse(e).list.map((function(e){return t._buildConversation(e.obj)}));return xr(r)}catch(e){return Wr(ce.MAIN_PROCESS_ERROR,"parse conversation list result error")}},Ro=function(e){var t,r=e.messageType,n=e.targetId;if(r===$t){var i=function(e){var t={},r=[],n=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:n,userList:r}}(e);return this._sendChatroomEvents({userChange:i}),!1}if(r===er){var o=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return this._sendChatroomEvents({chatroomNotifyMultiLoginSync:o}),!1}if(r===tr){var a=function(e){var t=e.content;return{chatroomId:t.chatroomId,operateType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return a.operateType===ue.Blocked&&(null===(t=null==a?void 0:a.userIdList)||void 0===t?void 0:t.includes(this.tcpMgr.getCurrentUserId()))&&this._chatroomCache.delete(n),this._sendChatroomEvents({chatroomNotifyBlock:a}),!1}if(r===rr){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return this._sendChatroomEvents({chatroomNotifyBan:s}),!1}return!0},vo=function(e){var t=JSON.parse(e),r=it(this,ao,"m",ho).call(this,t,!1),n=r.messageType,i=r.conversationType;if(n!==Jt||i!==qe.ULTRA_GROUP){if(this._lowPriorityMessageHandler.isLowPriorityMessage(n)){var o=this.tcpMgr.getCurrentUserId();return this._lowPriorityMessageHandler.push(r,o),void this._handleLowPriorityMessages(o,this.tcpMgr.getConnectedTime())}this._handleHighPriorityMessages([r],!1)}},Io=function(e,t){var r=this,n=this.tcpMgr.getConnectedTime(),i=this.tcpMgr.getCurrentUserId(),o=[],a=[];JSON.parse(e).list.forEach((function(e){var t=JSON.parse(e.obj),s=t.sentTime<n,u=it(r,ao,"m",ho).call(r,t,s),c=u.messageType;r._lowPriorityMessageHandler.isLowPriorityMessage(c)?r._lowPriorityMessageHandler.push(u,i):s?o.push(u):a.push(u)})),o.length>0&&this._handleHighPriorityMessages(o,!!t);var s=!1;(!t||a.length>0)&&!this._pullOfflineMessageFinished&&(s=this._pullOfflineMessageFinished=!0),a.length>0&&this._handleHighPriorityMessages(a,!!t),(this._pullOfflineMessageFinished||this._lowPriorityMessageHandler.count>=1e4)&&this._handleLowPriorityMessages(i,n),s&&this._sendPullOfflineFinished()},Oo=function(e){0!==e.length&&$i(this.logger,!1,"setExtraMessageInBatches",e)},To=function(e){var t=e.content,r=t.messageUId,n=t.sentTime;t.isAdmin;var i=t.isDelete;if("number"!=typeof n||"string"!=typeof r||!r.length)return this.logger.warn(Yn.L_DISCARD_MSG_O,JSON.stringify({messageUId:e.messageUId,messageType:e.messageType})),!1;var o=this._callCppProxy("getMessage",r),a=this._buildMessage(o,!1),s=a.messageId>0;if(i)return s&&it(this,ao,"m",wo).call(this,[a.messageId]),s;if(s&&a.messageType===xt)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===Vt&&(u.recallContent=a.content.content),!s){var c=e.conversationType,l=e.targetId,d=e.senderUserId,f=e.channelId,_=e.messageDirection;return it(this,ao,"m",Do).call(this,{conversationType:c,targetId:l,channelId:f},{content:u,senderUserId:d,messageType:xt,messageDirection:_,sentTime:n,messageUId:r}),!0}return a.receivedStatus||this.setMessageReceivedStatus(a.messageId,1),it(this,ao,"m",Vo).call(this,a.messageId,JSON.stringify(u),xt),!0},mo=function(e,t){var r=this,n=t.timestamp,i=t.count,o=t.order,a=t.messageType,s=e.conversationType,u=e.targetId,c=e.channelId,l=$i(this.logger,!1,"getHistoryMessages",s,u,n,i+1,a,0===o,c||""),d=JSON.parse(l).list.map((function(e){var t=e.obj;return r._buildMessage(t)})).reverse();return{list:i===d.length-1?d.slice(1):d,hasMore:i<d.length}},Co=function(e,t){return $e(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return et(this,(function(l){switch(l.label){case 0:return r=t.timestamp,n=t.count,i=t.order,o=e.conversationType,a=e.targetId,s=e.channelId,[4,(u=io.create(this.logger,"getRemoteHistoryMessages",this.logger.createTraceId())).asyncInvoke(o,a,r,n,(function(e,t){return u.ok({listJson:e,hasMore:t})}),(function(e){return u.fail(e)}),i,!0,s||"",!0).result()];case 1:return[2,l.sent().trans((function(e){var t=e.listJson,r=e.hasMore,n=JSON.parse(t).list.map((function(e){var t=e.obj;return c._buildMessage(t)}));return{list:n,hasMore:!!r}}))]}}))}))},No=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;$i(this.logger,!1,"clearMessages",t,r,n||"")},So=function(e,t,r){$i(this.logger,!1,"deleteChatroomMessageAndKV",e,t,r)},yo=function(e){var t;return!!(2&((null===(t=this.getNaviInfoFromCache())||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e||""},Po=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=$i(this.logger,!0,"getConversation",t,r,n||"");return i?this._buildConversation(i):null},Ao=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return $i(this.logger,!0,"getUnreadCount",t,r,n||"")},Lo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return $i(this.logger,!1,"clearUnreadCount",t,r,n||"")},Mo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=$i(this.logger,!0,"getTheFirstUnreadMessage",t,r,n||""),o=this._buildMessage(i);return-1!==o.messageId?o:null},Uo=function(e,t,r,n,i,o){var a=this.logger.createTraceId(),s=io.create(this.logger,"updateConversationStatus",a),u=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,translate_strategy_op:n,top_op:r,create_conversation:!!o,update_time:!!i}})));return s.invoke(u,(function(){return s.ok()}),(function(e){return s.fail(e)})).result()},Do=function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId,o=t.content,a=t.senderUserId,s=t.messageType,u=t.messageDirection,c=t.readStatus,l=t.sentStatus,d=t.sentTime,f=t.searchContent,_=t.isUnread,p=t.messageUId,E=t.disableNotification,h=t.canIncludeExpansion,b=t.expansion,g=t.directedUserIds,R=t.disableUpdateLastMessage,v=d||0,I={};if(b)for(var O in b)I[O]={v:b[O],ts:v};var T=function(){},m=$i(this.logger,!0,"insertMessage",r,n,a,s,JSON.stringify(o),T,T,u,c||1,l||30,v,f||"",_?0:1,p||"",!!E,!!h,JSON.stringify(I),i||"",g||[],!!R),C=this._buildMessage(m,!1);return C.messageUId=p,C.sentTime=d,C},wo=function(e){$i(this.logger,!1,"deleteMessages",e)},jo=function(e,t,r){$i(this.logger,!1,"deleteMessagesByTimestamp",e.conversationType,e.targetId,t,r,e.channelId||"")},Vo=function(e,t,r){return $i(this.logger,!1,"setMessageContent",e,t,r)},Go=function(e){var t=this,r=e.map((function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return{targetId:r,channelId:void 0===n?"":n,type:t}})),n=$i(this.logger,!0,"getConversations",JSON.stringify(r));return JSON.parse(n).list.map((function(e){return t._buildConversation(e.obj)}))},ko=function(e){var t=this,r=[];return e&&e.length>0&&(r=e.map((function(e){var r=JSON.parse(e.obj);return{messageUId:r.msg_uid,message:r.msg?t._buildMessage(r.msg):void 0,code:r.code}}))),r},Fo=function(e,t){try{var r=JSON.parse(e).list;t(it(this,ao,"m",ko).call(this,r))}catch(t){this.logger.error(Yn.P_PARSE_JSON_MSGS_E,e)}},Bo=function(e){var t=$i(this.logger,!1,"getBlockedConversations",e);return it(this,ao,"m",go).call(this,t)},Ho=function(e,t){return $e(this,void 0,void 0,(function(){var r;return et(this,(function(n){return[2,(r=io.create(this.logger,"getSubscribeStatusByUserIds",this.logger.createTraceId())).invoke(e,t,(function(e,t){e!==ce.SUCCESS?r.fail(e):r.ok(t)})).result()]}))}))};var zo,$o=function(){function e(e,t,r,n,i,o,a,s){Object.defineProperty(this,"sendCallback",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_cppService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._cppService=new qo(e,t,i,n,r,a,s)}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 $e(this,void 0,void 0,(function(){var r,n,i,o,a=this;return et(this,(function(s){switch(s.label){case 0:return"sendMessage"===e&&(r=t[4],t[4]=function(e){a.sendCallback({reqId:r,data:e})}),"refreshReferenceMessageWithParams"===e&&(n=t[2],i=t[3],t[2]=function(e){a.sendCallback({reqId:n,data:e})},t[3]=function(e){a.sendCallback({reqId:i,data:e})}),[4,(o=this._cppService).callProxy.apply(o,nt([e],rt(t),!1))];case 1:return[2,{success:!0,data:s.sent()}]}}))}))}}),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];(t=this._cppService).sendProxy.apply(t,nt([e],rt(r),!1))}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._cppService.destroy()}}),e}(),ea=function(){function r(r,n,i,o,a,s){var u=this;void 0===a&&(a=!1),void 0===s&&(s=!1),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_dbpath",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logOutputLevel",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_enableSyncEmptyTopConversation",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_eventLoopBlockingCheck",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_cppServiceProcessProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_catch",{enumerable:!0,configurable:!0,writable:!0,value:{crtUserId:"",connectedTime:0,naviInfo:null,connectionStatus:2,deviceId:"",deltaTime:0}}),Object.defineProperty(this,"_rendererInitOptions",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_senders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_callbackCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._createServiceProxy(),t.on("__RC_CHANNEL_CALL_MAIN_SYNC__",(function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return $e(u,void 0,void 0,(function(){var n,i;return et(this,(function(o){switch(o.label){case 0:return[4,(i=this._cppServiceProcessProxy).call.apply(i,nt([t],rt(r),!1))];case 1:return n=o.sent(),e.returnValue=n.data,[2]}}))}))})),t.on("__RC_CHANNEL_CALL_MAIN__",(function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return $e(u,void 0,void 0,(function(){var i,o,a,s,u;return et(this,(function(c){switch(c.label){case 0:return"sendMessage"===r&&(i=n[4],this._callbackCache[i]=e.sender),"refreshReferenceMessageWithParams"===r&&(o=n[2],a=n[3],this._callbackCache[a]=e.sender,this._callbackCache[o]=e.sender),[4,(u=this._cppServiceProcessProxy).call.apply(u,nt([r],rt(n),!1))];case 1:if(!(s=c.sent()).success)throw new Error(s.data.msg);return this._send2Renderer(e.sender,"__RC_CHANNEL_RESULT_FROM_MAIN__",t,s.data),[2]}}))}))})),t.on("__RC_CHANNEL_SEND_2_MAIN__",(function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];"registerMessageType"===t&&Hn(n[0],n[1]),(r=u._cppServiceProcessProxy).send.apply(r,nt([t],rt(n),!1))})),t.on("__RC_INNER_COMMAND_INIT__",this._registerRenderers.bind(this)),e.on("before-quit",(function(){return u.destroy()})),e.on("window-all-closed",(function(){return u.destroy()}))}return Object.defineProperty(r.prototype,"_send2Renderer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];e.isDestroyed()?delete this._senders[e.id]:e.send.apply(e,nt([t],rt(r),!1))}}),Object.defineProperty(r.prototype,"_send2AllRenderer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];Object.keys(this._senders).forEach((function(n){var i=t._senders[n];t._send2Renderer.apply(t,nt([i,"__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",e],rt(r),!1))}))}}),Object.defineProperty(r.prototype,"_registerRenderers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.sender,i=n.id;this._rendererInitOptions||(this._rendererInitOptions=t),this._cppServiceProcessProxy.send("registerRenderers",t),this._senders[i]||(this._senders[i]=n,n.once("destroyed",(function(){delete r._senders[i]})))}}),Object.defineProperty(r.prototype,"getMainCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._catch}}),Object.defineProperty(r.prototype,"_callbackHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.reqId,r=e.data;this._callbackCache[t]&&this._send2Renderer(this._callbackCache[t],"__RC_CHANNEL_RESULT_FROM_MAIN__",t,r)}}),Object.defineProperty(r.prototype,"_createServiceProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this._dbpath||n(e.getPath("userData"));this._cppServiceProcessProxy=new $o(this._appkey,t,this._logOutputLevel,this._enableSyncEmptyTopConversation,this._send2AllRenderer.bind(this),this._callbackHandler.bind(this),this._disableLogReport,this._eventLoopBlockingCheck)}}),Object.defineProperty(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._cppServiceProcessProxy.destroy()}}),Object.defineProperty(r.prototype,"setDataBaseLogConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._cppServiceProcessProxy.call("setDataBaseLogConfig",e)}}),r}(),ta=function(){function e(e,t,r,n,i,o){Object.defineProperty(this,"_rcMain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rcMain=new ea(e,t,r,n,i,o)}return Object.defineProperty(e.prototype,"getCppProto",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return{destroy:function(){console.warn("`.getCppProto().destroy()` has being deprecated, use `.destroy()` instead."),e.destroy()}}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._rcMain.destroy()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._rcMain.getMainCache().deviceId}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._rcMain.getMainCache().connectedTime}}),Object.defineProperty(e.prototype,"setDatabaseOperationTimeThreshold",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._rcMain.setDataBaseLogConfig(e)}}),e}(),ra=function(e){return function(e){if(zo)return zo;if(!e.appkey)throw new Error("Initializ failed, `appkey` is required!");return zo=new ta(e.appkey,(null==e?void 0:e.dbpath)||"",(null==e?void 0:e.logOutputLevel)||bn.WARN,!!(null==e?void 0:e.enableSyncEmptyTopConversation),(null==e?void 0:e.disableLogReport)||!1,(null==e?void 0:e.eventLoopBlockingCheck)||!1)}(e)};export{ra as default};
16
+ var Ze=function(e,t){return Ze=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])},Ze(e,t)};function qe(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}Ze(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ze,$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 et(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 tt(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 rt(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 nt(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 it(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 ot(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 at(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.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"}(ze||(ze={}));var st,ut,ct,lt=0,dt=1,ft=2,_t=3,pt=4,Et=5,ht=6,gt=7,bt=function(e){var t=[ze.PRIVATE,ze.GROUP,ze.SYSTEM,ze.PUBLIC_SERVICE,ze.APP_PUBLIC_SERVICE];switch(e){case lt:return t;case dt:return[ze.PRIVATE,ze.GROUP];case ft:return it(it([],nt(t),!1),[ze.ULTRA_GROUP],!1);case _t:return it(it([],nt(t),!1),[ze.ULTRA_GROUP,ze.CHATROOM],!1);case pt:return it(it([],nt(t),!1),[ze.ULTRA_GROUP,ze.CHATROOM,ze.RTC_ROOM,ze.CUSTOMER_SERVICE,ze.DISCUSSION],!1);case Et:return[ze.PRIVATE,ze.GROUP,ze.ULTRA_GROUP];case ht:return[ze.GROUP];case gt:return[ze.PRIVATE]}};!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"}(st||(st={})),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"}(ut||(ut={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(ct||(ct={}));var Rt,vt,It,Ot,Tt,Nt,mt,Ct,yt,St,Pt,At,Lt,Mt,Ut,Dt,wt,jt,Vt,Gt,kt,Ft="RC:TxtMsg",Ht="RC:VcMsg",Bt="RC:HQVCMsg",Jt="RC:LogCmdMsg",xt="RC:MsgExMsg",Wt="RC:ReferenceMsg",Yt="RC:RcCmd",Kt="RC:RcNtf",Xt="RC:ReadNtf",Qt="RC:RRReqMsg",Zt="RC:RRRspMsg",qt="RC:SRSMsg",zt="RC:RRMsg",$t="RC:RSMsg",er="RC:Delivered",tr="RC:DRMsg",rr="RC:ChrmMemChange",nr="RC:ChrmSyncMsg",ir="RC:ChrmBlockMsg",or="RC:ChrmBanMsg",ar="RC:CCConfigChangeRequestMsg";!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(Rt||(Rt={})),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"}(vt||(vt={})),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"}(It||(It={})),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"}(Ot||(Ot={})),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"}(Tt||(Tt={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(Nt||(Nt={})),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"}(mt||(mt={})),function(e){e[e.typing=0]="typing"}(Ct||(Ct={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(yt||(yt={})),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"}(St||(St={})),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"}(Pt||(Pt={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(At||(At={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(Lt||(Lt={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(Mt||(Mt={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(Ut||(Ut={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(Dt||(Dt={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(wt||(wt={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(jt||(jt={})),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"}(Vt||(Vt={})),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"}(Gt||(Gt={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(kt||(kt={}));var sr,ur,cr,lr,dr,fr,_r,pr,Er,hr=function(e){return e<=Gt.NOT_SET?kt.CLOSE:kt.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"}(sr||(sr={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(ur||(ur={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(cr||(cr={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(lr||(lr={})),function(e){e[e.CURRENT=2]="CURRENT"}(dr||(dr={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(fr||(fr={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(_r||(_r={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(pr||(pr={})),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"}(Er||(Er={}));var gr,br,Rr=0;!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"}(gr||(gr={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(br||(br={}));var vr=72e5,Ir="5.32.0-c-rtc-alpha.1".replace(/-.+$/,""),Or="rongcloudsystem",Tr="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};Tr.engine="5.32.0-c-rtc-alpha.1";var Nr=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)&&(Tr[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 Tr.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 Tr}}),e}();var mr=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)}))},Cr=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),yr=Date.now(),Sr=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Pr=function(e){return function(e){return"string"==typeof e}(e)&&/https?:\/\//.test(e)},Ar=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Lr=function(e){return{isRead:(e&sr.READ)===sr.READ,isListened:(e&sr.LISTENED)===sr.LISTENED,isDownload:(e&sr.DOWNLOADED)===sr.DOWNLOADED,isRetrieved:(e&sr.RETRIEVED)===sr.RETRIEVED}},Mr=function(e){return[St.iOS,St.Android,St.Web,St.PC,St.Mini,St.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]}))},Ur=function(e,t,r){return t?1===r?st.TLS:st.RMTP:"http"===e?st.WS:st.WSS},Dr=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 it([],nt(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:Ur(a,t,s),weight:r.length-n,race:!1})})),it([],nt(u),!1)},wr=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},jr=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Vr=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=mr(),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)},Gr=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,d=t.importanceHonor,f=t.imageUrlHonor,_=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),p=[{HW:{channelId:i||"",importance:s||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:l||""}},{APNS:_.APNS},{FCM:_.FCM},{HONOR:{importance:d||jt.NORMAL,image:f||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(p)},kr=function(){var e=Nr.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t};function Fr(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!==st.HTTP||n?"https://".concat(e):"http://".concat(e)}var Hr=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(Ye,JSON.stringify({ossConfig:n,error:e}))}return i};var Br,Jr=function(e){function t(t){var r=e.call(this,t)||this;return r.name="RCError",r}return qe(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),xr=function(){function e(){Br.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){at(this,Br,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return ot(this,Br,"f")},enumerable:!1,configurable:!0}),e}();Br=new WeakMap;var Wr=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=rt(this._map),i=n.next();!i.done;i=n.next()){var o=nt(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 xr,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,it([i],nt(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}it([],nt(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,it([e],nt(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}();!function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(r,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(r,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}qe(t,e),Object.defineProperty(t.prototype,"length",{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,t){return void 0===t&&(t=!1),et(this,void 0,void 0,(function(){return tt(this,(function(r){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[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,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e,t,r,n,i,o;return tt(this,(function(a){switch(a.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=a.sent(),t=e.isOk,r=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw new Error("".concat(this._name,": 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=it([],nt(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[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}})}(Wr);var Yr=function(){function e(e,t,r){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=r}return Object.defineProperty(e,"from",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r||"fail: ".concat(t),n)}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){return tt(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 et(this,void 0,void 0,(function(){return tt(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))}}),Object.defineProperty(e.prototype,"orSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?this:e(this.code)}}),Object.defineProperty(e.prototype,"trans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?Kr(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?Kr(void 0,this.msg):Xr(this.code,this.msg)}}),e}(),Kr=function(e,t){return new Yr(0,t||"success",e)},Xr=function(e,t,r){return new Yr(e,t||"fail: ".concat(e),r)};!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,"isFailed",{get:function(){return!this._isValid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isFailed&&(0===this._code||r)&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"setFailed",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid=!1,this.fail(e,t)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?Xr(this._code,this._errmsg):Kr()}}),Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isFailed||e(this),this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;var i=n?r(t):null==t||r(t);return this._isValid=i,this.isFailed&&(this._errmsg="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.isFailed)return this;if(this.validate(e,t,r,n),this.isFailed)throw Jr.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,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),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,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,0xe677d21fdbff,r)}}),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 Qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Zr(e){var t,r,n,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=Qr.indexOf(e.charAt(u++))<<2|(i=Qr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=Qr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(a=Qr.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(r)),64!==a&&(s+=String.fromCharCode(n));return s}var qr,zr=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},$r=1732584193,en=4023233417,tn=2562383102,rn=271733878,nn=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],on=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];function an(e,t){return e<<t|e>>>32-t}function sn(e,t,r){return e&r|t&~r}function un(e,t,r){return e^t^r}function cn(e,t,r){return t^(e|~r)}function ln(e){for(var t=[],r=0;r<e.length;r+=4)t.push((e[r]||0)|(e[r+1]||0)<<8|(e[r+2]||0)<<16|(e[r+3]||0)<<24);return t}function dn(e){var t=new Uint8Array(4);return t[0]=255&e,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}function fn(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(dn(a),0),o.set(dn(s),4),n.set(o,e.length+r);var u,c=$r,l=en,d=tn,f=rn;for(i=0;i<n.length;i+=64){for(var _=ln(n.slice(i,i+64)),p=c,E=l,h=d,g=f,b=0;b<64;b++){var R=void 0,v=void 0;b<16?(R=(u=l)&d|~u&f,v=b):b<32?(R=sn(l,d,f),v=(5*b+1)%16):b<48?(R=un(l,d,f),v=(3*b+5)%16):(R=cn(l,d,f),v=7*b%16);var I=f;f=d,d=l,l+=an(c+R+on[b]+_[v]&4294967295,nn[b]),c=I}c=c+p&4294967295,l=l+E&4294967295,d=d+h&4294967295,f=f+g&4294967295}var O=new Uint8Array(16);return O.set(dn(c),0),O.set(dn(l),4),O.set(dn(d),8),O.set(dn(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(O)}function _n(e){var t=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e);return fn(t)}function pn(e){if(!e||0===e.length)return[];var t=new Set;return e.forEach((function(e){t.add(e)})),Array.from(t)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(qr||(qr={}));var En,hn,gn=0,bn=1;!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"}(hn||(hn={}));var Rn=((En={})[hn.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:st.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},En[hn.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:st.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},En[hn.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:st.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},En[hn.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:st.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},En[hn.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:st.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},En);function vn(e){return hn[e]?e:hn.BJ}var In,On=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=hn.BJ),Rn[vn(r)].naviUrlBase64).map((function(e){return Zr(e)})),s=[],u=nt(e.split("@"),2)[1];t&&(s=u?u.split(";"):[]);var c=o&&o.length>0?it(it([],nt(s),!1),nt(o),!1):it(it([],nt(s),!1),nt(a),!1);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return Fr(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=hn.BJ),Rn[vn(r)].logUrlBase64).map((function(e){return $e($e({},e),{addr:Zr(e.addr)})})),l=[],d={level:1,itv:6,times:5};if(i)l.push.apply(l,it([],nt(i.addrs),!1)),Object.assign(d,i.policy);else if(o)try{var f=JSON.parse(o);l.push({addr:f.url,protocol:st.HTTPS,weight:1}),d.level=f.level,d.itv=f.itv,d.times=f.times}catch(r){t.warn(ye,JSON.stringify({policy:e.logPolicy}))}var _=u?it([{addr:u,protocol:st.HTTPS,weight:101}],nt(l),!1):it(it([],nt(l),!1),nt(c),!1);return{policy:d,addrs:_.filter((function(e,t){return _.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return $e($e({},e),{addr:Fr(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=hn.BJ),Rn[vn(t)].miniCmpBase64).map((function(e){return Zr(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=hn.BJ),Rn[vn(t)].staticConfigUrlBase64).map((function(e){return Zr(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=hn.BJ),Rn[vn(r)].cloudControllerUrlBase64).map((function(e){return Zr(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:hn.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!hn[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||{},i=n.active,o=n.activeServer,a=(null==i?void 0:i.addrs)||[],s=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=hn.BJ),Rn[vn(r)].statsUrlBase64).map((function(e){return Zr(e)})),u=[];return 0!==a.length?u.push.apply(u,it([],nt(a.sort((function(e,t){return t.weight-e.weight})).map((function(e){return Fr(e.addr,e.protocol)}))),!1)):o&&u.push(Fr(o,st.HTTPS)),s.forEach((function(e){u.includes(e)||u.push(e)})),u}}),e}(),Tn=new On,Nn=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 et(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return tt(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 Fr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=c.sent(),this.logger.error(Ve,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)!==Tn.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 Fr(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l;return tt(this,(function(d){switch(d.label){case 0:e=(e=it(it([],nt(this.staticUrls),!1),nt(Tn.getStaticConfigUrl()),!1).map((function(e){return Fr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),d.label=1;case 1:d.trys.push([1,6,7,8]),t=rt(e),r=t.next(),d.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(we,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=d.sent(),a=o.code,s=o.data,200===a)return this.logger.info(je,JSON.stringify({url:n,code:a,duration:Date.now()-i})),[2,s];this.logger.warn(je,JSON.stringify({url:n,code:a,duration:Date.now()-i})),d.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return u=d.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"}(In||(In={}));var mn,Cn,yn=function(){function e(e,t,r,n){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,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:In.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,In.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,In.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,In.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,In.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,In.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!==In.DEBUG&&this.logDB.write(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 Cr}}),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<=In.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[In.DEBUG,In.INFO,In.WARN,In.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}(),Sn=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,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return et(this,void 0,void 0,(function(){var a,s,u,c=this;return tt(this,(function(l){switch(l.label){case 0:a=[],l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,o)];case 2:return s=l.sent(),Sr(s.logs)?a=s.logs.filter((function(e){return!(!e||"object"!=typeof e)||(c.logger.warn(Pe,"Invalid log entry: not an object",i),!1)})):this.logger.warn(Pe,"Invalid logs result: not an array",i),[3,4];case 3:return u=l.sent(),this.logger.warn(Pe,"Error getting logs: ".concat(u instanceof Error?u.message:String(u)),i),[3,4];case 4:return[2,{logs:a}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i;return tt(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=Tn.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 et(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_;return tt(this,(function(p){switch(p.label){case 0:return this.logger.debug(Ae,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=p.sent(),o=i.success,a=i.data,o?(this.logger.debug(Ae,"compress done",t),s=Pr(r)?r:"https://".concat(r),s+="?version=".concat("5.32.0-c-rtc-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(Pe,"compress failed",t),[2,{isOk:!1,itv:n}]);case 2:if(u=p.sent(),c=u.status,l=u.data,this.logger.debug(Pe,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{(_=JSON.parse(l)).nextTime&&(n=_.nextTime),d=_.level,f=_.logSwitch}catch(e){this.logger.warn(Ye,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:d,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p=this;return tt(this,(function(E){switch(E.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||yr,a=Math.max(i-3e4,o+1),s=this.logger.createTraceId(),this.logger.debug(Se,JSON.stringify({startTime:o,endTime:a,level:t,itv:r}),s),[4,this._getLogs(o,a,t,!0,s,n)];case 1:return 0!==(u=E.sent().logs).length?[3,2]:(this.logger.debug(Pe,"no logs",s),[3,4]);case 2:return u.length>0?[4,this._sendLogs2Realtime(u,s,e,r)]:[3,4];case 3:c=E.sent(),l=c.itv,d=c.level,f=c.logSwitch,c.isOk&&(_=Math.max.apply(Math,it([],nt(u.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(_+1),0===f&&(this.started=!1),void 0!==d&&(t=d)),r=l,E.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return p.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),et(this,void 0,void 0,(function(){var s,u,c,l,d,f,_,p;return tt(this,(function(E){switch(E.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(s=this.logger.createTraceId(),this.logger.info(me,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:a}),s),[4,this._getLogs(e,t,In.DEBUG,!1,s)]);case 1:return u=E.sent().logs,this.logger.info(Ne,JSON.stringify({count:u.length}),s),c=Pr(n)?n:"https://".concat(n),c+="?version=".concat("5.32.0-c-rtc-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),u.length>0?[4,this.compressLogs(u)]:[3,3];case 2:return d=E.sent(),f=d.success,_=d.data,l=f?_:"compress failed",[3,4];case 3:l="no data or no database",E.label=4;case 4:return this.logger.debug(Ne,"compress done",s),a&&(c+="&source=cloud"),[4,this.send({url:c,body:l,method:"POST"})];case 5:return p=E.sent().status,this.logger.info(Ce,JSON.stringify({status:p}),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}();function Pn(e){try{return!(!e||"object"!=typeof e)&&("number"==typeof e.time&&("string"==typeof e.tag&&("string"==typeof e.sessionId&&("string"==typeof e.type&&"number"==typeof e.level))))}catch(e){return!1}}function An(){return et(this,void 0,void 0,(function(){return tt(this,(function(e){return[2,{logs:[]}]}))}))}function Ln(){}var Mn=function(){function e(e,t){mn.set(this,void 0),Cn.set(this,void 0),at(this,mn,e,"f"),at(this,Cn,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return et(this,void 0,void 0,(function(){var o,a;return tt(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,ot(this,mn,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(Pn)}]:[2,{logs:[]}];case 2:return a=s.sent(),console.error("[LogDBProxy] read error",a),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{ot(this,Cn,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}}),Object.defineProperty(e.prototype,"setLogReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&at(this,mn,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&at(this,Cn,e,"f"),this}}),e}();mn=new WeakMap,Cn=new WeakMap;var Un,Dn=function(){function e(){}var t,r,n,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){ot(this,t,"f",r)||(at(this,t,e,"f",r),e.info(Ke,"start"),ot(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){ot(this,t,"f",r)&&(ot(this,t,"f",r).info(Ke,"stop"),at(this,t,null,"f",r),ot(this,t,"f",n)&&(clearTimeout(ot(this,t,"f",n)),at(this,t,null,"f",n)))}}),t=e,a=function e(){var a=this,s=Date.now();at(this,t,setTimeout((function(){var n=Date.now()-s;n>=ot(a,t,"f",o)&&ot(a,t,"f",r).warn(Ke,"delta time: ".concat(n,"ms")),ot(a,t,"m",e).call(a)}),ot(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"}(Un||(Un={}));var wn=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 jn,Vn,Gn,kn,Fn=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 wn(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===Jt&&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,Ar(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 et(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return tt(this,(function(_){switch(_.label){case 0:return!this.isEable&&t===Un.init&&this.isExire()?(this.logger.info(Ge,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Un.newWorkChange&&this.isOverclock()?(this.logger.info(ke,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=Fr(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.32.0-c-rtc-alpha.1",timestamp:this.timestamp},this.logger.record(Vt.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,br.POST,o,a)]);case 1:return s=_.sent(),u=s.code,c=s.data,this.logger.record(Vt.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]:(d=Tn.setAreaCode(l),this.logger.info(xe,JSON.stringify({isChangeSuccess:d,originAreaCode:Tn.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(f=Tn.getCloudControllerUrl(l))[0]?[2,this.request(f[0],Un.other)]:(this.logger.info(Fe,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}(),Hn=function(e){return e===ce.RC_CONN_REDIRECTED},Bn=function(e){function t(t,r,n){var i=e.call(this)||this;return jn.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:""}),kn.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:gr.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:Mt.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 qe(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===Mt.DISCONNECTED&&e===Mt.CONNECTING&&(this._doConnectReason=_r.CONNECT,ot(this,jn,"m",Gn).call(this)),this._crtConnectionStatus===Mt.CONNECTED&&e===Mt.SUSPENDED&&(t===ce.RC_PING_EXCEED_LIMIT?this._doConnectReason=_r.TIMEOUT:t===ce.RC_CONN_REDIRECTED?this._doConnectReason=_r.REDIRECTED:this._doConnectReason=_r.RECONNECT),this._crtConnectionStatus===Mt.CONNECTED){var r={bid:kr(),cod:t,net:this.getNetwork().type,dur:Date.now()-ot(this,kn,"f"),cid:this.cid};this.logger.record(Vt.IM_CONNECTION_DURATION,JSON.stringify(r)),e===Mt.SUSPENDED&&ot(this,jn,"m",Gn).call(this)}switch(this._crtConnectionStatus=e,e){case Mt.CONNECTED:this.logger.info(fe,"status: ".concat(e)),this.checkAlive(),ot(this,jn,"m",Vn).call(this).emit("onConnected",this._fromSuspend);break;case Mt.CONNECTING:this.logger.warn(fe,"status: ".concat(e)),ot(this,jn,"m",Vn).call(this).emit("onConnecting");break;case Mt.SUSPENDED:this._fromSuspend=!0,this.logger.warn(fe,"status: ".concat(e,", code: ").concat(t)),Hn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),ot(this,jn,"m",Vn).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(fe,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),ot(this,jn,"m",Vn).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===Mt.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(Vt.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 et(this,void 0,void 0,(function(){var i,o,a;return tt(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===Mt.CONNECTED?[2,Kr(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(Mt.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(Mt.DISCONNECTED,o),[2,Xr(o)]):(this.setConnectionStatus(Mt.CONNECTED),[2,Kr(a)])}}))}))}}),Object.defineProperty(t.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return et(this,void 0,void 0,(function(){var o;return tt(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 et(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,_,p;return tt(this,(function(E){switch(E.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(Vt.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=E.sent(),u=s.code,c=s.data,u!==ce.SUCCESS?[2,Xr(u)]:1===(l=c).type?[2,Xr(ce.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(le,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),l,t,n)]);case 2:return d=E.sent(),f=d.code,_=d.data,i||f===ce.SUCCESS||(this.retryCount+=1),Hn(f)?(this.logger.warn(de,"redirect code: ".concat(f),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,ce.CONNECTION_REFUSED].includes(f)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),p=this.cmpWeightCache.every((function(e){return e.failed})),i&&p?(this.logger.warn(de,"cpp code:".concat(f,",reture code:").concat(ce.SERVER_UNAVAILABLE),n),[2,Xr(ce.SERVER_UNAVAILABLE)]):(this.logger.warn(de,"cmp ack timeout, code: ".concat(f),n),this.setConnectionStatus(Mt.SUSPENDED,f),this.setConnectionStatus(Mt.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):f!==ce.SUCCESS?(this.logger.warn(de,"code: ".concat(f),n),[2,Xr(f)]):(this.logger.info(de,"userId: ".concat(_),n),at(this,kn,Date.now(),"f"),this._crtUserId=_,[2,Kr(_)])}}))}))}}),Object.defineProperty(t.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i=this;return tt(this,(function(o){return r=this.logger.createTraceId(),this.logger.debug(_e,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return et(i,void 0,void 0,(function(){var i,o,a;return tt(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==Mt.SUSPENDED?[2]:(this.setConnectionStatus(Mt.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=s.sent(),o=i.code,a=i.isOk,this.reconnectTimer=null,a?(this.setConnectionStatus(Mt.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(o)?(this._crtConnectionStatus!==Mt.CONNECTING||(this.setConnectionStatus(Mt.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(Mt.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(t.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return Hn(e)?(this.setConnectionStatus(Mt.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===ce.RC_UDP_DISCONNECTED?(this.setConnectionStatus(Mt.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(Mt.DISCONNECTED,e)}}),Object.defineProperty(t.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(Mt.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(t.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e,t,r=this;return tt(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==Mt.CONNECTED?(this._failedCount=0,this.logger.debug(Te,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(Ie,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===ce.SUCCESS?(this.logger.debug(Oe,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==Mt.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(Oe,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(Te,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(Mt.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 et(this,void 0,void 0,(function(){return tt(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(Mt.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 it([],nt(this.cmpWeightCache),!1);var r=Dr(e,t);return this.cmpWeightCache=it([],nt(r),!1),it([],nt(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===st.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,it([],nt(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,it([],nt(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}(Wr);kn=new WeakMap,jn=new WeakSet,Vn=function(){return this},Gn=function(){this.uuid=mr(),this.retryCount=0};var Jn=function(e){return e.replace(/@.+$/,"@")},xn=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),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,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),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 et(this,void 0,void 0,(function(){var o;return tt(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 et(this,void 0,void 0,(function(){var a,s,u,c,l,d,f,_,p,E,h,g,b,R,v,I,O;return tt(this,(function(T){switch(T.label){case 0:return a=Jn(e),s=this.getNaviCache(a),!t&&s&&(u=s.timestamp,c=s.naviInfo,r||Date.now()-u<vr)?(this.logger.info(he,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(l=i.uuid,d=i.retryCount,f=i.reason,_={bid:kr(),ptc:cr.NAVI,cod:ce.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(o=c.type)&&void 0!==o?o:0,hos:"",cache:lr.LOCAL,v:dr.CURRENT,rsn:f,cid:"".concat(l,"_").concat(d),count:d},this.logger.record(Vt.IM_NAVI,JSON.stringify(_),n)),[2,Kr(c)]):(p=Tn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(pe,JSON.stringify({token:e,uris:p}),n),[4,this.requestHandler(p,e,n,i)]);case 1:return E=T.sent(),h=E.code,g=E.data,h===ce.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(b=T.sent())?void 0:b.navi)&&(null==b?void 0:b.navi.length)>0?(R=b.navi,[4,this.requestHandler(R,e,n,i)]):[3,4];case 3:v=T.sent(),h=v.code,g=v.data,T.label=4;case 4:return h!==ce.SUCCESS?(this.logger.warn(Ee,h,n),[2,Xr(h)]):(I=g).code&&200!==I.code?(this.logger.warn(Ee,I.code,n),[2,Xr(this.transHttpCode(I.code))]):Dr(I).length>0?(this.logger.info(Ee,JSON.stringify({naviInfo:I}),n),this.setNaviCache(a,I),[2,Kr(I)]):(O={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(Ee,"navi server address invalid: ".concat(JSON.stringify(O)),n),[2,Xr(ce.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return tt(this,(function(_){switch(_.label){case 0:i=0,o=e.length,_.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=_.sent(),l=c.code,d=c.data,f={bid:kr(),ptc:cr.NAVI,cod:l,net:null==n?void 0:n.type,dur:Date.now()-u,spr:0,pr:(null==d?void 0:d.type)||0,hos:e[i],cache:lr.REQUEST,v:dr.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(Vt.IM_NAVI,JSON.stringify(f),r),[ce.SUCCESS,ce.RC_CONN_TOKEN_INCORRECT,ce.RC_LICENSE_EXPIRED].includes(l))return[2,l===ce.SUCCESS?Kr(d):Xr(l)];_.label=3;case 3:return i+=1,[3,1];case 4:return[2,Xr(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(Jn(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(Jn(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),"&v=").concat(Ir,"&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}(),Wn=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 Yn(e,t){var r=Wn.get(e);r&&!r.isCustom&&console.warn("Builtin message type '".concat(e,"' cannot be registered")),t.isStatusMessage&&(t.isCounted=t.isPersited=!1),Wn.set(e,$e($e({},t),{isCustom:!0}))}function Kn(e){return Wn.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function Xn(){return Array.from(Wn.keys()).map((function(e){return $e({objectName:e},Wn.get(e))})).filter((function(e){return!e.isCustom}))}var Qn=function(){function e(e,t,r,n){Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sourceLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.identifier=e,this.sourceLanguage=t||"auto",this.targetLanguage=r,this.text=n}return Object.defineProperty(e.prototype,"isValid",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"string"==typeof this.identifier&&this.identifier.length>0&&"string"==typeof this.sourceLanguage&&(void 0===this.targetLanguage||"string"==typeof this.targetLanguage)&&(e?"string"==typeof this.text:void 0===this.text||"string"==typeof this.text)}}),Object.defineProperty(e.prototype,"toInnerParam",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{identifier:this.identifier,sourceLanguage:this.sourceLanguage,targetLanguage:this.targetLanguage,content:this.text}}}),e}();!function(e){function t(t,r,n,i){return e.call(this,t,r,n,i)||this}qe(t,e)}(Qn),function(e){function t(t,r,n){return e.call(this,_n(t),r,n,t)||this}qe(t,e)}(Qn);var Zn,qn,zn=0,$n=0,ei=4,ti=5;!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",e.L_HANDLE_LOW_PRIORITY_MESSAGES_T="L-handle_low_priority_messages-T",e.L_HANDLE_LOW_PRIORITY_MESSAGES_R="L-handle_low_priority_messages-R",e.L_JS_CALLBACK_EXCEPTION_E="L-js_callback_exception-E",e.L_DISCARD_MSG_O="L-discard_msg-O"}(Zn||(Zn={})),function(e){e[e.ERROR=-1]="ERROR",e[e.RESPONSE=0]="RESPONSE",e[e.EVENT=1]="EVENT",e[e.CALLBACK=2]="CALLBACK"}(qn||(qn={}));var ri=function(e,t,r){return et(void 0,void 0,void 0,(function(){var n,i;return tt(this,(function(o){return n=g("aes-256-cbc",t,r),i=n.update(e,"base64","utf-8"),[2,i+=n.final("utf8")]}))}))},ni=function(e){if(!R(e)){var t=n(e,"..");R(t)||ni(t),v(e)}},ii=function(e){return Object.entries(e).map((function(e){var t=nt(e,2),r=t[0],n=t[1];return{key:r,value:String(n)}}))},oi=function(e){return{removeMute:!!(null==e?void 0:e.removeMuteStatus),removeWhiteList:!!(null==e?void 0:e.removeWhiteList),removeFavoriteMembers:!!(null==e?void 0:e.removeFollow)}},ai=function(){return"undefined"==typeof __dirname?r(T(import.meta.url)):__dirname};function si(e){return JSON.parse(e).list.map((function(e){return e.value}))}var ui,ci=n(ai(),"binding","electron-".concat(i(),"-").concat(o(),".node")),li={addon:null},di=(ui=process,{sendError:function(e){ui.send({type:qn.ERROR,data:{msg:e}})},sendEvent:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];ui.send({type:qn.EVENT,data:{eventName:e,data:t}})},sendResponse:function(e){ui.send({type:qn.RESPONSE,data:e})},sendCallback:function(e){ui.send({type:qn.CALLBACK,data:e})}}).sendError;try{var fi=h(import.meta.url);li.addon=fi(ci)}catch(e){console.error("error ->",ci,"\n",e),di(e.toString())}li.addon||console.error("error -> cannot find module: ",ci);var _i=li.addon,pi=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])},Ei=function(e){return"string"==typeof e},hi=function(e){return Ei(e)?e.toUpperCase():""},gi=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},bi=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},Ri=function(e){var t=hi(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},vi=function(e){return new Promise((function(t){var r,n;e.socket.once("data",(function(n){var i,o=gi(n,r);if(!o)return 2===n[1]?(e.socket.once("data",(function(r){var n=bi(r);n?e.emit("error",new Error("SOCKS authentication failed. ".concat(n))):t()})),i=[1],pi(e.socksUsername,i),pi(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)}))},Ii=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),A(t)){case 0:i.push(3),pi(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)}))},Oi=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 L,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 qe(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 et(r,void 0,void 0,(function(){var r;return tt(this,(function(n){switch(n.label){case 0:return[4,vi(this)];case 1:return n.sent(),[4,Ii(this,t,e)];case 2:return n.sent(),this.onProxied(),r=Ri(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}(M),Ti=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=nt(t,1)[0]),new Oi(e).connect(n,r)},Ni=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=Ti,r}return qe(t,e),t}(m),mi=function(e,t,r){return(t=$e($e({},t),N(e))).port||(t.port=80),t.agent=new Ni(t),C(t,r)},Ci=function(e){var t,r;return t=Ti(e),r=t.onProxied,t.onProxied=function(){var n;e.socket=t.socket,e.hostname?e.servername=e.hostname:e.host&&(n=nt(e.host.split(":"),1),e.servername=n[0]),t.socket=U(e,(function(){t.authorized=t.socket.authorized,r.call(t)})),t.socket.on("error",(function(e){t.emit("error",e)}))},t},yi=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=Ci,n}return qe(t,e),t}(y),Si=function(e,t,r,n){var i,o;return t.protocol="https:",!t.port&&t.host&&(i=nt(t.host.split(":"),2),t.port=i[0],t.port=i[1]),t.port||(t.port=443),o=new yi(e,t),t.agent=o,S(e,t,r)},Pi=null;function Ai(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 d=null;Pi?((l=$e($e({},l),Pi)).body=o,d=u?Si:mi):(d=C,u&&(l.agent=new y(l),d=S));var f=d(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=P.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=P.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})}))}));f.once("timeout",(function(){e.warn(Zn.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:n,method:a,query:s,timeout:c})),t({status:0})})),f.setTimeout(c),f.once("error",(function(r){e.warn(Zn.P_HTTP_REQ_E,JSON.stringify({msg:r.stack,url:n,method:a,query:s,timeout:c})),t({status:0})})),f.write(o),f.end()}))}function Li(e,t){return e?(Pi=$e($e({},Pi),e),t.info(Me,JSON.stringify({socks5Proxy:Pi})),Kr()):(Pi=null,t.info(Le),Kr())}function Mi(){return Kr(Pi||void 0)}var Ui,Di=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 qn.EVENT:var s=a,u=s.eventName,c=s.data;null==t||t.apply(void 0,it([u],nt(c),!1));break;case qn.RESPONSE:var l=a,d=l.reqId,f=l.success,_=l.data,p=i.maps[d];if(!p)return;p({success:f,data:_}),delete i.maps[d];break;case qn.CALLBACK:null==r||r(a);break;case qn.ERROR:var E=a.msg;null==n||n(E)}})),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 et(this,void 0,void 0,(function(){var r=this;return tt(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 et(this,void 0,void 0,(function(){var n;return tt(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}(),wi=function(e,t,r,n,i){return et(void 0,void 0,void 0,(function(){var o,a,s,u,c,l;return tt(this,(function(d){switch(d.label){case 0:return o=zr(),a=o.resolve,s=o.promise,_i.getLog(e,t,r,n,(function(e){a(Kr(e))}),(function(e){a(Xr(e))})),[4,s];case 1:return(u=d.sent()).isOk?(c=0,l=JSON.parse(u.data).filter((function(e){return c+=function(e){return e.content.length+e.tag.length+e.sessionId.length+e.type.length+2+13+6}(e),!!i||e.level>0})),[2,Kr({logs:l,size:c})]):[2,u.wipe()]}}))}))},ji=function(e,t,r){return et(void 0,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return tt(this,(function(_){switch(_.label){case 0:return n=e.startTime,i=e.endTime,o=e.level,a=e.isRealtimeReport,[4,wi(o,n,i,s=300,a)];case 1:return(u=_.sent()).isOk?(c=u.data,l=c.logs,d=c.size,0===l.length||(t+=d)>=20971520?[2]:l.length<s?(r.push.apply(r,it([],nt(l),!1)),[2]):(f=l[l.length-1].time,n===f&&(f+=1),e.startTime=f,r.push.apply(r,it([],nt(l.filter((function(e){return e.time<f}))),!1)),[2,ji(e,t,r)])):[2]}}))}))},Vi=[],Gi=!1,ki=function(){return et(void 0,void 0,void 0,(function(){var e,t,r,n;return tt(this,(function(i){switch(i.label){case 0:return Gi||0===Vi.length?[2]:(Gi=!0,e=Vi.shift(),t=e.resolve,r=e.args,[4,ji(r,0,n=[])]);case 1:return i.sent(),t({logs:n,dbReady:!0}),Gi=!1,ki(),[2]}}))}))},Fi=function(e){function t(t,r,n,i,o){void 0===i&&(i=!1);var a,s=process.versions.electron,u="Electron|".concat(s,"|").concat(process.arch,"|").concat(process.platform);return a=e.call(this,t,r,u,o,n,i)||this,Object.defineProperty(a,"_subProcess",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return qe(t,e),Object.defineProperty(t.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ai(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 et(this,void 0,void 0,(function(){var t,r,i,o;return tt(this,(function(a){switch(a.label){case 0:return this._subProcess||(t=p(n(ai(),"sub-process.cjs.js"),{stdio:["inherit","inherit","inherit","ipc"]}),this._subProcess=new Di(t)),[4,this._subProcess.call("compressLogs",e)];case 1:return r=a.sent(),i=r.success,o=r.data,i?[2,{success:i,data:o.data}]:[2,{success:i,data:""}]}}))}))}}),t}(Sn),Hi="rc-realtime-log-timestamp",Bi=!1,Ji=function(){var e=new Mn(An,Ln);return e.setLogReader((function(e,t,r,n){return et(void 0,void 0,void 0,(function(){return tt(this,(function(i){switch(i.label){case 0:return[4,(o={startTime:e,endTime:t,level:r,isRealtimeReport:n},et(void 0,void 0,void 0,(function(){return tt(this,(function(e){return[2,new Promise((function(e){Vi.push({resolve:e,args:o}),ki()}))]}))})))];case 1:return[2,{logs:i.sent().logs}]}var o}))}))})),e.setLogWriter((function(e){Wi(e)})),e},xi=[],Wi=function(e){Bi&&(xi.push(e),Ui||(Ui=setImmediate((function(){return function(){if(Ui&&(clearImmediate(Ui),Ui=null),xi.length){var e=xi.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(Cr,":").concat(Cr===t?"main":t),content:JSON.stringify({loggerId:a,content:s,traceId:u})}})),t=JSON.stringify(e);_i.writeLog(t)}}()}))))},Yi=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return Bi||(Bi=!0),o}return qe(t,e),Object.defineProperty(t.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=_i.getStoreValue(Hi);return parseInt(e,10)||0}}),Object.defineProperty(t.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){_i.setStoreValue(Hi,e.toString())}}),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(){Bi=!1}}),t}(yn),Ki=function(){var e,t=Date.now(),r=[o(),i(),process.pid,t,Math.floor(Math.random()*t)].join("__");return e=r,b("md5").update(e).digest("hex")},Xi=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){var n=JSON.stringify(r);"{}"!==n&&e.info(Zn.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:t,ext:r})),this._callCppProxy("setMessageExtension",1,"1",t,n,"")}}),Object.defineProperty(e.prototype,"setLocalFromExtMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t.channelId,t.conversationType,t.targetId;var r=t.content,n=t.sentTime,i=r,o=i.put,a=this._callCppProxy("getMessage",i.mid),s=JSON.parse(a).extMsg,u=JSON.parse(s||"{}");if(o)for(var c in o){var l=u[c];l&&l.ts<n-this._setTime?(l.v=o[c],l.ts=n-this._setTime):(u[c]={v:"",ts:0},u[c].v=o[c],u[c].ts=n-this._setTime)}i.del&&i.del.forEach((function(e){delete u[e]})),this._setToProtocol(e,i.mid,u)}}),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}}),e}(),Qi=[st.RMTP,st.TLS];"darwin"===process.platform&&Qi.push(st.QUIC);var Zi=function(e){return"RongCloud/navis/".concat(e,"/navi-cache.json")},qi=function(e){return"RongCloud/caches/".concat(e,"/staticConfig.json")},zi=function(e){return"RongCloud/cloudControl/".concat(e,"/cloudControl.json")};function $i(e){var t,r;void 0===e&&(e="IPv4");var n=a(),i=[];try{for(var o=rt(Object.values(n)),s=o.next();!s.done;s=o.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}));i.push.apply(i,it([],nt(c),!1))}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i.length?it([],nt(i),!1).sort()[0]:""}var eo,to,ro=function(e){function t(t,n,i,o){var a=e.call(this,t,n,o)||this;Object.defineProperty(a,"naviPath",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(a,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),a.naviPath="".concat(i,"/").concat(Zi(t));var s=r(a.naviPath);return R(s)||ni(s),a}return qe(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a,s,u;return tt(this,(function(c){switch(c.label){case 0:return i="token=".concat(encodeURIComponent(r),"&v=").concat(Ir,"&p=PC&ev=").concat("5.32.0-c-rtc-alpha.1","&m=").concat($i()),o="".concat(e,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(he,JSON.stringify({url:o,body:i}),n),[4,Ai(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(ge,JSON.stringify({url:o,code:a.status}),n),[2,Xr(this.transHttpCode(a.status))];this.logger.info(ge,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,Xr(this.transHttpCode(s.code))]:[2,Kr(s)]}catch(e){return this.logger.error(be,a.data,n),[2,Xr(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 et(this,void 0,void 0,(function(){var i,o,a,s;return tt(this,(function(u){switch(u.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:"electron",protocol:Qi.join(","),mac:$i()}),this.logger.info(he,JSON.stringify({url:i.url,body:i.body,headers:i.headers}),n),[4,Ai(this.logger,i)];case 1:if(200!==(o=u.sent()).status)return this.logger.warn(ge,JSON.stringify({url:i.url,code:o.status}),n),[2,Xr(this.transHttpCode(o.status))];this.logger.info(ge,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,Kr(a)]}catch(e){return this.logger.error(be,o.data,n),[2,Xr(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(!R(this.naviPath))return null;var n=I(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(n),this._caches[t]}catch(e){this.logger.error(be,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(Ar(this._caches))for(var i in this._caches){(r-this._caches[i].timestamp>vr||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}}),Object.defineProperty(t.prototype,"setUseNaviV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.useNaviV2=e}}),t}(xn);function no(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];var o,a=e.createTraceId();if(e.debug(Zn.P_CALL_ADDON_T,JSON.stringify({method:r,params:n}),a),!_i[r])throw e.error(Zn.P_CALL_ADDON_E,"Method ".concat(r," not found in addon"),a),new Error("Method ".concat(r," not found in addon"));try{o=_i[r].apply(_i,it([],nt(n),!1))}catch(t){throw e.error(Zn.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:r}),a),t}return e.debug(Zn.P_CALL_ADDON_R,JSON.stringify({method:r,printResult:t,result:t?o:void 0}),a),o}var io,oo,ao,so,uo=function(){function e(e,t,r){var n=this;eo.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,null!=n?n:t.createTraceId())}}),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=ot(this,eo,"m",to)).call.apply(e,it([this,!0],nt(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=ot(this,eo,"m",to)).call.apply(e,it([this,!1],nt(t),!1))}}),Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.debug(Zn.P_CALL_ADDON_R,"success",this._traceId),this._flush(Kr(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.warn(Zn.P_CALL_ADDON_R,"faile: ".concat(e),this._traceId),this._flush(Xr(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,"flush",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._flush(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),e}();eo=new WeakSet,to=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(Zn.P_CALL_ADDON_T,JSON.stringify({method:o,params:r}),a);try{t=_i[o].apply(_i,it([],nt(r),!1))}catch(e){throw s.error(Zn.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"}(so||(so={}));var co=function(e){function t(t,r,n,i){var o=e.call(this,t,n,i)||this;return io.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",ot(o,io,"m",oo).bind(o),(function(e,t,r){o.logger.info(Zn.P_DB_OPEN_O,JSON.stringify({code:e,recreate:t,recreateReason:r})),o.emit("onDBOpen",e,t,r)}),(function(){return o.recvPong(ce.SUCCESS)}),ot(o,io,"m",ao).bind(o),o._onTcpConnectResponse.bind(o),(function(){o.logger.info(Zn.P_DB_UPGRATE_START_S),o.emit("onDBUpgrateStart")}),(function(e){o.logger.info(Zn.P_DB_UPGRATING_S,e),o.emit("onDBUpgrading",e)}),(function(e){o.logger.info(Zn.P_DB_UPGRATE_COMPLETE_S,e),o.emit("onDBUpgradeComplete",e)})),o}return qe(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 et(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p,E,h,g,b=this;return tt(this,(function(R){switch(R.label){case 0:return i=this._connectingTask=uo.create(this.logger,"connectWithToken",n),this._naviInfo=t,o={},(a=Mi().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 Qi.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!==st.QUIC&&e.protocol!==st.QUIC||(t.race=!0,t.protocol=st.QUIC):(e.race=!1,c.push(e))})),this.logger.info(Zn.P_CONNECT_T,JSON.stringify({}),n),l=Date.now(),[4,i.asyncInvoke(e,Ir,JSON.stringify($e($e({},t),{serverAddr:c,tagBlacklist:this._excludeLogTag.join(",")})),r,s).result()];case 1:return d=R.sent(),this.logger.summary(Zn.P_CONNECT_R,d,n,{data:d.data}),f=JSON.parse(d.data),_=f.cid,p=f.userId,E=f.sessionId,h=Date.now()-(l+this._tcpDuration),g={bid:kr(),cod:d.code,net:this.getNetwork().type,dur:h,spr:0,cid:_,v:dr.CURRENT,count:this.retryCount,sts:Date.now(),ssid:E},this.logger.record(Vt.IM_CMP_RMTP,JSON.stringify(g)),this._connectingTask=null,[2,d.trans((function(e){return b._connectedTime=Date.now()-b.callCppProxy("getDeltaTime"),p}))]}}))}))}}),Object.defineProperty(t.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){return tt(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()!==Mt.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:kr(),ptc:cr.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?fr.RECONNECT:fr.CONNECT,cid:this.cid,v:dr.CURRENT,rsn:this._doConnectReason,ddu:i,count:this.retryCount,weight:u>=0?this.cmpWeightCache[u].weight:-1};if(this.logger.record(Vt.IM_CMP,JSON.stringify(c)),this.logger.info(Zn.P_CONNECT_ENTRY_S,JSON.stringify({code:e,host:t,port:r,duration:n,dnsDuration:i,index:o,isQuic:a})),e===so.SUCCESS)this.curCmpUrl="".concat(t,":").concat(r),this.updateCmpWeight("".concat(t,":").concat(r),!0,a);else if(e!==so.NOT_INIT){var l=r&&0!==r?"".concat(t,":").concat(r):"".concat(t);this.updateCmpWeight(l,!1)}}}),t}(Bn);io=new WeakSet,oo=function(e,t){10!==e&&(this._connectingTask?e===ce.SUCCESS?this._connectingTask.ok(t):this._connectingTask.fail(e,t):this.logger.warn(Zn.P_CONNECT_E,JSON.stringify({msg:"connect complete but no connecting task"})))},ao=function(e,t){switch(this.logger.info(Zn.P_CONNECT_S,JSON.stringify({status:e,delay:t})),e){case ce.RC_CONN_REDIRECTED:this.recvConnectRes(e,!0);break;case 11:case 10:case 12:break;case ce.CONNECTION_REFUSED: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 lo,fo,_o,po,Eo,ho,go,bo,Ro,vo,Io,Oo,To,No,mo,Co,yo,So,Po,Ao,Lo,Mo,Uo,Do,wo,jo,Vo,Go,ko,Fo,Ho,Bo,Jo,xo,Wo,Yo,Ko,Xo,Qo,Zo,qo=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"dbpath",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_cachePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),o._cachePath="".concat(i,"/").concat(qi(t));var a=r(o._cachePath);return R(a)||ni(a),o}return qe(t,e),Object.defineProperty(t.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this._cachePath)&&I(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 et(this,void 0,void 0,(function(){var t,r,n;return tt(this,(function(i){switch(i.label){case 0:return[4,Ai(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 et(this,void 0,void 0,(function(){var t,r;return tt(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,ri(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(Ve,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),t}(Nn),zo=function(e){function t(t,n,i,o,a){var s=e.call(this,n,t,i)||this;Object.defineProperty(s,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(s,"model",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(s,"catchFilePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),s.model="Electron|".concat(process.platform,"|").concat(process.arch),s.catchFilePath="".concat(a,"/").concat(zi(t));var u=r(s.catchFilePath);return R(u)||ni(u),s.init(),s}return qe(t,e),Object.defineProperty(t.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return tt(this,(function(_){switch(_.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},a=this.logger.createTraceId(),this.logger.info(he,JSON.stringify(o),a),[4,Ai(this.logger,o)];case 1:s=_.sent(),u=s.status,c=s.data,l=void 0===c?"":c,this.logger.info(ge,JSON.stringify({status:u,data:l}),a);try{return d=JSON.parse(l),f=d.data,[2,{code:u,data:f}]}catch(e){return this.logger.warn(He,JSON.stringify({status:u,data:l,error:e})),[2,{code:u,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(Be,JSON.stringify(e))}}),Object.defineProperty(t.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!R(this.catchFilePath))return null;var e=I(this.catchFilePath,{encoding:"utf8"});return this.logger.info(Je,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(We,JSON.stringify(t)),_i.setCloudConfig(JSON.stringify(t))}}),t}(Fn),$o=[Jt,ar,xt,qt,$t,Qt,Zt,Xt,zt,er,tr],ea=function(){return{logCmdQueue:[],cloudControllerVers:[],srsmsgs:[],readNtfs:[],expansionMsgQueue:new Map,v1ReceiptMsgs:[],privateRSMsgs:[],groupRSMsgs:new Map,rrmsgs:new Map,messageUIds:new Set}},ta=function(){function e(){Object.defineProperty(this,"_report",{enumerable:!0,configurable:!0,writable:!0,value:ea()}),Object.defineProperty(this,"_count",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"isLowPriorityMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return $o.includes(e)}}),Object.defineProperty(e.prototype,"isEmpty",{enumerable:!1,configurable:!0,writable:!0,value:function(){return 0===this._count}}),Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._count++;var n=e.messageType,i=e.senderUserId,o=e.content;if(n!==Jt)if(n!==ar)if(n!==qt)if(n!==xt)if(n!==Xt){if(n===Qt){var a=o.messageUId;if(!a)return;return this._report.messageUIds.add(a),void this._report.v1ReceiptMsgs.push(e)}if(n===Zt){var s=o.receiptMessageDic;if(i!==t){var u=s[t];if(!u||0===u.length)return;return u.forEach((function(e){return r._report.messageUIds.add(e)})),void this._report.v1ReceiptMsgs.push(e)}return Object.values(s).forEach((function(e){e.forEach((function(e){return r._report.messageUIds.add(e)}))})),void this._report.v1ReceiptMsgs.push(e)}n!==zt?n===$t&&this._handleRSMsg(e):this._handleRRMsg(e)}else this._handleReadNtf(e);else this._handleExpansionNotify(e);else this._handleSRSMsg(e,t);else i===Or&&this._report.cloudControllerVers.push(e.sentTime);else if(i===Or){var c=o.startTime,l=o.endTime,d=o.platform,f=o.logId,_=o.uri;this._report.logCmdQueue.push({startTime:parseInt(c,10),endTime:parseInt(l,10),platform:d,logId:f,uri:_,messageUId:e.messageUId})}}}),Object.defineProperty(e.prototype,"_handleRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.senderUserId;var t=e.content,r=e.conversationType,n=e.targetId,i=e.channelId;if(r!==ze.PRIVATE){var o=t,a=o.msgId,s=o.rrn,u=o.tmn,c=this._report.groupRSMsgs.get(a);c?(c.totalCount=u,c.readedCount=s):this._report.groupRSMsgs.set(a,{totalCount:u,readedCount:s}),this._report.messageUIds.add(a)}else{var l=this._report.privateRSMsgs.find((function(e){return e.conversationType===r&&e.targetId===n&&e.channelId===i}));l?l.timestamp=Math.max(l.timestamp,t.endMsgTime):this._report.privateRSMsgs.push({conversationType:r,targetId:n,channelId:i,timestamp:t.endMsgTime})}}}),Object.defineProperty(e.prototype,"_handleRRMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content.msgId;this._report.rrmsgs.set(t,e),this._report.messageUIds.add(t)}}),Object.defineProperty(e.prototype,"_handleExpansionNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=t.put,n=t.mid,i=t.del,o=t.clear;this._report.messageUIds.add(n),this._report.expansionMsgQueue.has(n)&&!o?this._report.expansionMsgQueue.get(n).push({put:r,del:i,clear:o}):this._report.expansionMsgQueue.set(n,[{put:r,del:i,clear:o}])}}),Object.defineProperty(e.prototype,"_handleSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId;e.senderUserId===t&&(this._report.srsmsgs=this._report.srsmsgs.filter((function(e){return e.conversationType!==r||e.targetId!==n||e.channelId!==i})),this._report.srsmsgs.push(e))}}),Object.defineProperty(e.prototype,"_handleReadNtf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;t===ze.PRIVATE&&(this._report.readNtfs=this._report.readNtfs.filter((function(i){return i.conversationType!==t||i.targetId!==r||i.channelId!==n||i.senderUserId!==e.senderUserId})),this._report.readNtfs.push(e))}}),Object.defineProperty(e.prototype,"build",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._report;return this._report=ea(),this._count=0,e}}),e}(),ra=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{t.apply(void 0,it([],nt(n),!1))}catch(t){r.logger.error(Zn.L_JS_CALLBACK_EXCEPTION_E,"name: ".concat(e,"\n").concat(t.stack))}}}}),e}();function na(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}}!function(e){e[e.cuid=1]="cuid",e[e.uid=2]="uid",e[e.all=4]="all"}(Zo||(Zo={}));var ia=function(){function e(e,t,r,n,i,o,a){var s=this;lo.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,"_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,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isConnected",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_offlineFinishedPending",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullOfflineMessageFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_lowPriorityMessageHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_catcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_needDispatchMessageModifiedSyncCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!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,d=r.userProfile,f={userId:n,subscribeType:i,subscribeTime:o,expiry:a,operationType:u};[Pt.ONLINE_STATUS,Pt.FRIEND_ONLINE_STATUS].includes(i)&&(f.details=l.map((function(e){var t=JSON.parse(e);return{changeTime:t.changeTime,eventValue:t.changeValue,platform:t.platform}}))),[Pt.USER_PROFILE,Pt.FRIEND_USER_PROFILE].includes(i)&&(f.userProfile=s._string2userProfileInfo(d)),t.push(f)}))}catch(t){s.logger.error(Zn.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:new Map}),Object.defineProperty(this,"rtcHeartbeatResolves",{enumerable:!0,configurable:!0,writable:!0,value:{}});var u=this._dbpath,c=this._deviceId=Ki(),l=Ji();this.logger=new Yi(this._appkey,"RC-M","IM",l),this._catcher=new ra(this.logger),_i.initWithAppkey(e,u,Ir,this.logger.getSessionId()),_i.setConsoleLogLevel((this._logOutputLevel||In.WARN)+1),this.logger.setOutputLevel(this._logOutputLevel),this.reporter=new Fi(e,c,this.logger,o,l),this.logger.info(Zn.P_INIT_O,JSON.stringify({appkey:e,dbpath:u,proto_commit:_i.getNodeVersion(),deviceId:c,commit:"c5ab5a0b9ca2539f6f3b50a525b7e5071e92da58",processName:process.title,processPId:process.pid,disableLogReport:o,eventLoopBlockingCheck:a})),a&&Dn.start(this.logger),this._callCppProxy("setDeviceId",c),this._staticConfigManager=new qo(e,this.logger,u),this._lowPriorityMessageHandler=new ta,this.navi=new ro(e,this.logger,u,this._staticConfigManager),this.tcpMgr=new co(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("onDBOpen",this.dbOpened,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(),_i.setOnReceiveMessageListener(ot(this,lo,"m",No).bind(this),ot(this,lo,"m",mo).bind(this),this._handleMessageModified.bind(this)),_i.setRTConversationListener((function(e){return s._dispatchEvent("sgRelationsSynced",e)})),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),_i.setReadReceiptListener((function(e,t){var r=JSON.parse(t).map((function(e){return{identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount,users:e.readUsers.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:e.mentioned}}))}}));s._dispatchEvent("readReceiptResponseV5",r)})),_i.setTranslateEventListener((function(e){var t=JSON.parse(e).map((function(e){return{translateInfo:{targetLanguage:e.translateResult.targetLanguage,translatedText:e.translateResult.translatedText,status:e.translateResult.translateStatus},code:e.code,identifier:e.messageRecognitionIdentifier.messageUid,from:e.messageRecognitionIdentifier.inputSource}}));s._dispatchEvent("translateResponse",t)})),this._msgExpansionHandler=new Xi(this._callCppProxy.bind(this)),_i.setUltraGroupListener((function(e){return s._dispatchEvent("ultraGroupEnable")}),(function(e,t,r){return ot(s,lo,"m",po).call(s,e,t,r)}),(function(e){return ot(s,lo,"m",Eo).call(s,e)}),(function(e){return ot(s,lo,"m",ho).call(s,e)}),(function(e){return ot(s,lo,"m",go).call(s,e)}),(function(e){return ot(s,lo,"m",bo).call(s,e)}),(function(e){return ot(s,lo,"m",Ro).call(s,e)}),(function(e){return ot(s,lo,"m",fo).call(s,e)}),(function(e){return ot(s,lo,"m",_o).call(s,e)}))}return Object.defineProperty(e.prototype,"_setDeviceInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=s()[0].model,t=u();try{"darwin"===process.platform?t=E("sw_vers -ProductVersion",{encoding:"utf-8"}):"win32"===process.platform&&(t=E("ver",{encoding:"utf-8"}))}catch(e){this.logger.error(Xe,JSON.stringify({error:e}))}_i.setDeviceInfo("",e,"PC",t,"","")}}),Object.defineProperty(e.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;r=nt(Tn.getCloudControllerUrl(),1),this.cloudControllerUri=r[0],this.cloudController=new zo(this._appkey,this.logger,this.reporter,e,t),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Un.init)}}),Object.defineProperty(e.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 et(this,void 0,void 0,(function(){var r,n,i;return tt(this,(function(o){switch(o.label){case 0:if(!(r=this[e]))return this.logger.warn(Zn.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),[2,Xr(ce.NOT_SUPPORT)];n="",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.call.apply(r,it([this],nt(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(Zn.P_CALL_MAIN_E,n),[3,4];case 4:return[2,Xr(ce.MAIN_PROCESS_ERROR,n)]}}))}))}}),Object.defineProperty(e.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 et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){if(!(r=this[e]))return this.logger.warn(Zn.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),[2];try{r.call.apply(r,it([this],nt(t),!1))}catch(t){this.logger.error(Zn.P_CALL_MAIN_E,JSON.stringify({error:null==t?void 0:t.stack,method:e}))}return[2]}))}))}}),Object.defineProperty(e.prototype,"registerRenderers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.navigators,r=e.areaCode,n=e.logServerUrl,i=e.environment,o=e.useNaviV2,a=e.enableReadReceiptStorage;this._environment=i||"default",this.navi.setEnvironment(i),this._enableReadReceiptStorage=a,this.navi.setUseNaviV2(o),Tn.init({areaCode:r,navigators:t,logServerUrl:n})}}),Object.defineProperty(e.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected=!0;var e=this.getNaviInfoFromCache();this.reporter.checkStart(e,""),this._try2RejoinChatroom();var t=this._getMainProcessCache();this._dispatchEvent("onConnected",t),this._offlineFinishedPending&&(this._offlineFinishedPending=!1,this.logger.info(Qe),this._dispatchEvent("pullFinished")),this._needDispatchMessageModifiedSyncCompleted&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}}),Object.defineProperty(e.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._needDispatchMessageModifiedSyncCompleted=!0,this._dispatchEvent("onConnecting")}}),Object.defineProperty(e.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onSuspend",t)}}),Object.defineProperty(e.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onDisconnected",t)}}),Object.defineProperty(e.prototype,"dbOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this._dispatchEvent("databaseOpened",t,r)}}),Object.defineProperty(e.prototype,"dbUpgradeStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._dispatchEvent("databaseUpgradeWillStart")}}),Object.defineProperty(e.prototype,"dbUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgrading",t)}}),Object.defineProperty(e.prototype,"dbUpgradeComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgradeDidComplete",t)}}),Object.defineProperty(e.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(Zn.P_CALL_ADDON_O,JSON.stringify({method:e,content:t}),n),_i[e].apply(_i,it([],nt(t),!1))}catch(t){throw this.logger.error(Zn.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:e}),n),t}}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"sendHTTPRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Ai(this.logger,e)}}),Object.defineProperty(e.prototype,"onReceiveRendererLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.recvRendererLog(e)}}),Object.defineProperty(e.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,Un.newWorkChange,r)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){Dn.stop(),this.reporter.stop(),this.logger.destroy(),_i.destroy(),process.exit(0)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l,d,f=this;return tt(this,(function(_){return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,a=t.count,s=t.order,u=t.messageTypes,c=a+1,l=no(this.logger,!1,"getHistoryMessagesByObjectNames",r,n,o,c,u,0===s,i||""),d=JSON.parse(l).list.reverse().map((function(e){var t=e.obj;return f._buildMessage(t)})),[2,Kr({list:c===d.length?d.slice(1,c):d,hasMore:a<d.length})]}))}))}}),Object.defineProperty(e.prototype,"_updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return no(this.logger,!0,"updateMessageReceiptStatus",e,t,r,n||"")}}),Object.defineProperty(e.prototype,"updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i;return tt(this,(function(o){return i=this._updateMessageReceiptStatus(e,t,r,n),[2,Kr(i)]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectionStatus()!==Mt.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectedTime()}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-_i.getDeltaTime()}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getCurrentUserId()}}),Object.defineProperty(e.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();return{connectedTime:e,deviceId:this.getDeviceId(),crtUserId:n,naviInfo:r,connectionStatus:t,deltaTime:_i.getDeltaTime()}}}),Object.defineProperty(e.prototype,"getMainProcessCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){return tt(this,(function(e){return[2,this._getMainProcessCache()]}))}))}}),Object.defineProperty(e.prototype,"_enableCreateEmptyTopConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._callCppProxy("enableCreateEmptyTopConversation",e)}}),Object.defineProperty(e.prototype,"_registerBuildinMessageTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Xn().forEach((function(t){e.registerMessageType(t.objectName,t)}))}}),Object.defineProperty(e.prototype,"_parseMessageJsonContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;try{r=e?JSON.parse(e):{}}catch(n){r=e,this.logger.error(Zn.P_PARSE_JSON_MSGS_E,JSON.stringify({content:e,messageId:t}))}return r}}),Object.defineProperty(e.prototype,"_buildSupportExt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=null;return e&&(r=this._msgExpansionHandler.parseReceiveExpansion(t)),r}}),Object.defineProperty(e.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,d={readCount:s,totalCount:u};if(1===(null==r?void 0:r.grpRRVer)){var f=[];for(var _ in a)f.push({userId:_,readTime:a[_]});d.readerList=f,d.hasRespond=i}return 3===(null==r?void 0:r.grpRRVer)&&(d.readerList=l),d}}),Object.defineProperty(e.prototype,"_buildMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=JSON.parse(e);return ot(this,lo,"m",vo).call(this,r,t)}}),Object.defineProperty(e.prototype,"_updateReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=ot(this,lo,"m",Ho).call(this,e);if(r.isOk){var n=r.data,i=n.readReceiptRequest?JSON.parse(n.readReceiptRequest):{},o=$e($e({},i),t);no(this.logger,!1,"updateReadReceiptRequestInfo",e,JSON.stringify(o))}}}),Object.defineProperty(e.prototype,"_buildConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e);return ot(this,lo,"m",Io).call(this,t)}}),Object.defineProperty(e.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(e.prototype,"_getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0===e.length)return[];var r=no(this.logger,!1,"getMessageByUids",e);return JSON.parse(r).list.map((function(e){return ot(t,lo,"m",vo).call(t,JSON.parse(e.obj))}))}}),Object.defineProperty(e.prototype,"_handleLowPriorityMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;if(!this._lowPriorityMessageHandler.isEmpty()){var i=Date.now(),o=this._lowPriorityMessageHandler.count,a=this.logger.createTraceId();this.logger.info(Zn.L_HANDLE_LOW_PRIORITY_MESSAGES_T,JSON.stringify({startTime:i,count:o}),a);var s=this._lowPriorityMessageHandler.build(),u=s.srsmsgs,c=s.readNtfs,l=s.expansionMsgQueue,d=s.v1ReceiptMsgs,f=s.privateRSMsgs,_=s.groupRSMsgs,p=s.rrmsgs,E=s.logCmdQueue,h=s.cloudControllerVers,g=s.messageUIds,b=new Map;this._getMessagesByUIds(it([],nt(g.values()),!1)).forEach((function(e){b.set(e.messageUId,e)})),this._handleExpansionMsgQueue(l,b),this._sendMessageNotification(c,!1),this._handlerReadReceiptMsgV1(d,b,e),this._handleSRSMsgs(u,t),this._handlerPrivateRSMsgs(f),this._handlerGroupRSMsgs(_,b),this._handlerRRMsgs(p,b),h.length>0&&((r=this.cloudControllerMsgs).push.apply(r,it([],nt(h),!1)),this._ccMsgHandler()),E.forEach((function(e){var t=e.startTime,r=e.endTime,i=e.platform,o=e.logId,a=e.uri,s=e.messageUId;n.reporter.report(t,r,i,a,o,s)})),this.logger.info(Zn.L_HANDLE_LOW_PRIORITY_MESSAGES_R,JSON.stringify({startTime:i,cost:Date.now()-i}),a)}}}),Object.defineProperty(e.prototype,"_updateReadReceiptRequestInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(0!==e.length){var t=e.map((function(e){return JSON.stringify({message_uid:e.messageUId,request_info:e.readReceiptInfo})}));no(this.logger,!1,"updateReadReceiptRequestInfoList",t)}}}),Object.defineProperty(e.prototype,"_handlerRRMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=[],n=[];Array.from(e.entries()).forEach((function(e){var i=nt(e,2),o=i[0],a=i[1],s=t.get(o);if(s){var u=a.content,c=u.rrn,l=u.tmn,d=s.readReceiptInfo||{};d=$e($e({},d),{readCount:c,totalCount:l}),s.readReceiptInfo=d,r.push({messageUId:o,readReceiptInfo:d}),n.push(a)}})),this._updateReadReceiptRequestInfoList(r),this._sendMessageNotification(n,!1)}}),Object.defineProperty(e.prototype,"_handlerGroupRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[];Array.from(e.entries()).forEach((function(e){var r=nt(e,2),o=r[0],a=r[1],s=a.totalCount,u=a.readedCount,c=t.get(o);if(c){var l=c.conversationType,d=c.targetId,f=c.channelId,_=c.readReceiptInfo||{};_=$e($e({},_),{readCount:u,totalCount:s}),c.readReceiptInfo=_,n.push({messageUId:o,readReceiptInfo:_}),i.push({conversationType:l,targetId:d,channelId:f,readedCount:u,totalCount:s,messageUId:o})}})),this._updateReadReceiptRequestInfoList(n),i.forEach((function(e){return r._sendMessageReadReceipt({groupReadReceipt:e})}))}}),Object.defineProperty(e.prototype,"_handlerPrivateRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r=e.conversationType,n=e.targetId,i=e.channelId,o=e.timestamp;t._updateMessageReceiptStatus(r,n,o,i||""),t._sendMessageReadReceipt({privateReadReceipt:{conversationType:r,targetId:n,channelId:i||"",endMsgTime:o}})}))}}),Object.defineProperty(e.prototype,"_handleSRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;1!==this.getNaviInfoFromCache().sesDriven?this._sendMessageNotification(e,!1):e.forEach((function(e){var n=e.conversationType,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.content;a>t||r._sendsyncReadStatus({conversationType:n,targetId:i,channelId:o,timestamp:s.lastMessageSendTime})}))}}),Object.defineProperty(e.prototype,"_handlerReadReceiptMsgV1",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(0!==e.length){var n=new Set,i=[];e.forEach((function(e){var o=e.messageType,a=e.senderUserId,s=e.content;if(o===Qt){var u=s.messageUId,c=t.get(u);if(!c||c.senderUserId!==a)return;return c.readReceiptInfo=a===r?{isReceiptRequestMessage:!0,readerList:[]}:{isReceiptRequestMessage:!0,hasRespond:!1},n.add(c),void i.push(e)}var l=s.receiptMessageDic;if(a===r)return Object.values(l).forEach((function(e){e.forEach((function(e){var r=t.get(e);r&&(r.readReceiptInfo=$e($e({},r.readReceiptInfo),{hasRespond:!0}),n.add(r))}))})),void i.push(e);var d=l[r];d&&0!==d.length&&(d.forEach((function(e){var r=t.get(e);if(r){var i=r.readReceiptInfo,o=((null==i?void 0:i.readerList)||[]).concat(a);r.readReceiptInfo=$e($e({},r.readReceiptInfo),{readerList:o}),n.add(r)}})),i.push(e))})),this._enableReadReceiptStorage&&this._updateReadReceiptRequestInfoList(Array.from(n.values()).map((function(e){return{messageUId:e.messageUId,readReceiptInfo:e.readReceiptInfo}}))),this._sendMessageNotification(i,!1)}}}),Object.defineProperty(e.prototype,"_handleExpansionMsgQueue",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if(0!==e.size){var n=[],i=[];Array.from(e.entries()).forEach((function(e){var r=nt(e,2),o=r[0],a=r[1],s=t.get(o);if(s&&a.length){var u=new Set,c=new Set,l=s.expansion||{};a.forEach((function(e){var t=e.put,r=e.del;if(e.clear)return Object.keys(l).forEach((function(e){u.add(e),c.clear()})),void(l={});t&&(Object.keys(t).forEach((function(e){u.delete(e),c.add(e)})),l=$e($e({},l),t)),r&&r.forEach((function(e){u.add(e),c.delete(e),delete l[e]}))})),s.expansion=l;var d={};Object.keys(l).forEach((function(e){d[e]={v:l[e]}})),n.push({messageUId:o,expansion:JSON.stringify(d)});var f={},_=s.conversationType,p=s.targetId,E=s.channelId,h=!1;u.size>0&&(h=!0,f.deletedExpansion={conversationType:_,targetId:p,channelId:E||"",messageUId:o,deletedKeys:Array.from(u)}),c.size>0&&(h=!0,f.updatedExpansion={conversationType:_,targetId:p,channelId:E||"",messageUId:o,expansion:l}),h&&i.push(f)}})),ot(this,lo,"m",Co).call(this,n),i.forEach((function(e){return r._dispatchEvent("expansion",e)}))}}}),Object.defineProperty(e.prototype,"_handleHighPriorityMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.filter((function(e){var t=e.messageType,n=e.conversationType;return t!==Kt&&(t===Yt?ot(r,lo,"m",yo).call(r,e):n!==ze.CHATROOM||ot(r,lo,"m",To).call(r,e))}));this._sendMessageNotification(n,t)}}),Object.defineProperty(e.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return et(this,void 0,void 0,(function(){var t,r;return tt(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,Un.other,t)]):[3,2]):[2];case 1:r=n.sent()||0,this.cloudControllerMsgs=this.cloudControllerMsgs.filter((function(e){return e>r})),this.cloudControllerLock=!0,this._ccMsgHandler(),n.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_sendMessageNotification",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.length>0&&this._dispatchEvent("batchMessage",e,void 0,t)}}),Object.defineProperty(e.prototype,"_sendPullOfflineFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected?(this.logger.info(Qe),this._dispatchEvent("pullFinished")):this._offlineFinishedPending=!0}}),Object.defineProperty(e.prototype,"_handleMessageModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=JSON.parse(e).list.map((function(e){var t=e.obj;return n._buildMessage(t)}));1===r?i.length&&this._dispatchEvent("messagesModified",i):2===r&&i.forEach((function(e){return ot(n,lo,"m",yo).call(n,e)})),this._needDispatchMessageModifiedSyncCompleted&&!t&&this._isConnected&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}}),Object.defineProperty(e.prototype,"_handleChatroomKVUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.roomId,i=r.key,o=r.value;return r.operator,{chatroomId:n,key:i,value:o,timestamp:r.version,type:r.isDeleted?ne.DELETE:ne.UPDATE}}));t.length&&this._sendChatroomEvents({updatedEntries:t})}}),Object.defineProperty(e.prototype,"_handleChatroomFullKVSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._chatroomCache.get(e);if(n){n.isKVSynced||(n.isKVSynced=!0,this._sendChatroomEvents({entriesSynced:e}));var i=function(e){return JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})).reduce((function(e,t){return e.set(t.key,t)}),new Map)},o=i(t),a=i(r),s=[];Array.from(o.entries()).forEach((function(e){var t=nt(e,2),r=t[0],n=t[1],i=n.roomId,o=n.value;n.operator;var u=n.version;n.isDeleted;var c=a.get(r);c?(a.delete(r),s.push({chatroomId:i,key:r,value:c.value,timestamp:c.version,type:ne.UPDATE})):s.push({chatroomId:i,key:r,value:o,timestamp:u,type:ne.DELETE})})),Array.from(a.entries()).forEach((function(t){var r=nt(t,2),n=r[0],i=r[1];s.push({chatroomId:e,key:n,value:i.value,timestamp:i.version,type:ne.UPDATE})})),s.length&&this._sendChatroomEvents({updatedEntries:s})}}}),Object.defineProperty(e.prototype,"_sendChatroomEvents",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("chatroom",e)}}),Object.defineProperty(e.prototype,"_sendMessageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("messageReadReceipt",e)}}),Object.defineProperty(e.prototype,"_sendsyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("syncReadStatus",e)}}),Object.defineProperty(e.prototype,"_setConversationStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.setConversationStatusListener((function(t){var r=JSON.parse(t).list.map((function(e){var t=JSON.parse(e.obj),r={conversation:{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)||Gt.NOT_SET;r.updatedItems.notificationLevel={val:o,time:0},r.updatedItems.notificationStatus={val:hr(o),time:0}}else 2===n?r.updatedItems.isTop={val:"1"===i,time:0}:4===n&&(r.updatedItems.translateStrategy={val:Number(i),time:0})})),r}));r.length>0&&e._dispatchEvent("conversation",r)}),(function(t){e._dispatchEvent("conversationTag")}),(function(t,r,n,i){e._clearUnreadCountByTimestamp({conversationType:t,targetId:r,channelId:n},i),e._sendsyncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i})}),(function(t){return e._dispatchEvent("conversationStatusSynced",t)}))}}),Object.defineProperty(e.prototype,"_setPushNotificationListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.setPushNotificationListener((function(t){return e._getRTCProfile()}),(function(){return e._dispatchEvent("tag")}),(function(t){return e._dispatchEvent("userSettingsSynced",t)}),(function(t){return e._dispatchEvent("userSettingsChanged",{key:bn,value:t})}),(function(t){return e._dispatchEvent("userSettingsChanged",{key:gn,value:t})}))}}),Object.defineProperty(e.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(e.prototype,"_setRTCLivingRoomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.setRTCRoomEventListener((function(t){e._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(t))}))}}),Object.defineProperty(e.prototype,"_setChatroomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.setChatroomEventListener((function(t,r){return e._sendChatroomEvents({chatroomDestroyed:t})})),_i.setChatroomStatusListener((function(t,r,n){return e._handleChatroomFullKVSync(t,r,n)}),(function(t){return e._handleChatroomKVUpdate(t)}))}}),Object.defineProperty(e.prototype,"_setCallInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.setCallInfoListener((function(t){var r=[];try{JSON.parse(t).list.forEach((function(e){Object.entries(e).forEach((function(e){var t=nt(e,2),n=t[0],i=t[1];r.push({key:n,value:i})}))}))}catch(t){e.logger.error(Zn.P_PARSE_JSON_E,JSON.stringify({error:t}))}e._dispatchEvent("callInfo",JSON.stringify({list:r}))}))}}),Object.defineProperty(e.prototype,"_setSubscribeEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.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[Pt.ONLINE_STATUS,Pt.FRIEND_ONLINE_STATUS].includes(r)?s.details=o:[Pt.USER_PROFILE,Pt.FRIEND_USER_PROFILE].includes(r)&&(s.userProfile=a),s}));e._dispatchEvent("subscribedUserStatusChange",r)}))}}),Object.defineProperty(e.prototype,"_setUserProfileListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.setUserProfileListener((function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)}),(function(t){e._dispatchEvent("ownUserProfileChanged",e._string2userProfileInfo(t))}))}}),Object.defineProperty(e.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=nt(this._convertGroupInfoList(a),1),c.groupInfo=o[0]):c.memberInfos=this._convertGroupMemberInfoList(u),this._dispatchEvent("groupOperation",c)}catch(t){this.logger.error(Zn.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:n,membersJson:i,operatorInfo:e}))}}}),Object.defineProperty(e.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]:s});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(Zn.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:i,operatorInfoJson:r}))}}}),Object.defineProperty(e.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(Zn.P_PARSE_JSON_E,JSON.stringify({error:e,operatorInfoJson:t,updateMemberInfoJson:r}))}}}),Object.defineProperty(e.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,d=i.direction,f=i.remark,_=$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:d,type:c,operationTime:n,reason:f});this._dispatchEvent("groupApplicationEvent",_)}catch(e){this.logger.error(Zn.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfo:t,requestInfoJson:r}))}}}),Object.defineProperty(e.prototype,"_onFavoriteMembersChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(r),o=[];i&&Sr(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(Zn.P_PARSE_JSON_E,JSON.stringify({error:e,memberIds:r}))}}}),Object.defineProperty(e.prototype,"_setEntrustGroupListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){_i.setEntrustGroupListener(this._onGroupOperationChanged.bind(this),this._onGroupInfoChanged.bind(this),this._onGroupMemberInfoChanged.bind(this),this._onGroupRequestChanged.bind(this),this._onFavoriteMembersChanged.bind(this))}}),Object.defineProperty(e.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(e.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(e.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(e.prototype,"_onFriendsClearedFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("friendCleared",e)}}),Object.defineProperty(e.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,operationTime:0})}catch(e){this.logger.error(Zn.P_PARSE_JSON_E,JSON.stringify({error:e,profiles:r}))}}}),Object.defineProperty(e.prototype,"_setFriendEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){_i.setFriendEventListener(this._onFriendApplicationStatusChanged.bind(this),this._onFriendAdd.bind(this),this._onFriendDelete.bind(this),this._onFriendsClearedFromServer.bind(this),this._onFriendInfoChangedSync.bind(this))}}),Object.defineProperty(e.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&&(Yn(e,t),this.logger.info(Zn.P_REGTYP_O,JSON.stringify({type:e,opt:r,search:s}))),this._callCppProxy("registerMessageType",e,r,s||[])}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.tcpMgr.connect(e,t,r,n)}}),Object.defineProperty(e.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(e.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.stringify($e($e({},e),{"electron-main":"5.32.0-c-rtc-alpha.1"}));this.logger.info(Zn.P_REPORT_VER_O,t),this._callCppProxy("uploadSDKVersion",t,"")}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){return tt(this,(function(r){return e=e||!0,this._chatroomCache.clear(),this.reporter.stop(),Li(null,this.logger),[2,this.tcpMgr.disconnect(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){_i.setOnReceiveStatusListener((function(e,r){t({userId:e,status:r})}));var r=e.userIds||[];r.length&&this.subscribeUserStatus(r)}}),Object.defineProperty(e.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(e.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(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"getUserStatus");return t.asyncInvoke(e,(function(e){return t.ok({status:e})}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.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===ze.GROUP;if(r===Zt&&n.receiptMessageDic&&a)for(var s in n.receiptMessageDic)o.push(s);return r===qt&&function(e){return[ze.GROUP,ze.DISCUSSION,ze.ULTRA_GROUP,ze.PUBLIC_SERVICE,ze.APP_PUBLIC_SERVICE].includes(e)}(t)&&(o=[this.getCurrentUserId()]),o}}),Object.defineProperty(e.prototype,"_handleMessage2Callback",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;switch(e.messageType){case xt:this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e);break;case Qt:this._enableReadReceiptStorage&&this._updateReadReceiptInfo(t.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});break;case Zt:if(this._enableReadReceiptStorage){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(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p,E,h,g,b,R,v,I,O,T,N,m,C,y,S,P,A,L,M,U,D,w,j,V,G,k,F,H,B,J,x,W,Y,K,X,Q,Z,q,z,$,ee,te=this;return tt(this,(function(re){for(X in i=e.conversationType,o=e.targetId,a=e.channelId,s=void 0===a?"":a,u=t.messageType,c=t.content,l=t.expansion,d=t.pushConfig,f=t.pushContent,_=void 0===f?"":f,p=t.pushData,E=void 0===p?"":p,h=t.directionalUserIdList,void 0===h?[]:h,b=t.disableNotification,R=void 0!==b&&b,v=t.canIncludeExpansion,I=void 0!==v&&v,O=t.isVoipPush,T=void 0!==O&&O,N=t.messageId,m=void 0===N?0:N,C=t.disableUpdateLastMessage,y=void 0!==C&&C,S=t.needReceipt,A=(P=d||{}).iOSConfig,L=P.androidConfig,M=P.harmonyOSConfig,U=P.templateId,D=void 0===U?"":U,w=P.pushTitle,j=void 0===w?"":w,V=P.pushContent,G=void 0===V?_:V,k=P.pushData,F=void 0===k?E:k,H=P.disablePushTitle,B=void 0!==H&&H,J=P.forceShowDetailContent,x=void 0!==J&&J,W=Gr(A,L,M),_=G,E=F,Y=(null==L?void 0:L.notificationId)||"",g=this._handleDirectionalUserIdList(t,i),K={},l)K[X]={v:l[X]};return Q=D,this.logger.info(Zn.P_SEND_MSG_T,JSON.stringify({messageType:u,conversationType:i,targetId:o,channelId:s}),r),Z=uo.create(this.logger,"sendMessage"),q=function(e,n){var i=te._buildMessage(e,!1);te.logger.info(Zn.P_SEND_MSG_R,JSON.stringify({code:n,messageUId:i.messageUId}),r),n!==ce.SENSITIVE_REPLACE?(te._handleMessage2Callback(i,t),Z.ok(i)):Z.fail(n)},z=function(e,t){var n=te._buildMessage(e,!1);te.logger.warn(Zn.P_SEND_MSG_R,JSON.stringify({code:t,messageId:n.messageId}),r),n.sentTime=Date.now()-_i.getDeltaTime(),Z.fail(t,n)},$=no(this.logger,!1,"sendMessage",q,z,i,o,u,JSON.stringify(c),g,R,B,x,_,E,Y,j,W,Q,I,JSON.stringify(K),T,s,m,y,!!S),ee=JSON.parse($),null==n||n(ee.messageId),[2,Z.result()]}))}))}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return et(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f,_,p,E,h,g,b,R,v,I=this;return tt(this,(function(O){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,d=t.isDelete,f=t.directionalUserIdList,_=t.disableUpdateLastMessage,p=t.isAdmin,E=t.messageUId,h=t.sentTime,g={conversationType:o,targetId:i,messageUId:E,sentTime:h,user:a,extra:u,channelId:n,isDelete:d||!1,isAdmin:p},a&&(g.user=a),u&&(g.extra=u),b={conversationType:o,targetId:i,senderUserId:this.tcpMgr.getCurrentUserId(),content:g,objectName:Yt,messageUid:E,direction:wt.SEND,status:sr.UNREAD,sentTime:h,channelId:n},R=this._buildMessage(JSON.stringify(b),!1),[2,(v=uo.create(this.logger,"recallMessage")).asyncInvoke((function(e){return et(I,void 0,void 0,(function(){return tt(this,(function(e){return ot(this,lo,"m",yo).call(this,R),o===ze.ULTRA_GROUP&&this._dispatchEvent("ultraGroupMessageRecalled",[R]),R.pushConfig=c,v.ok(R),[2]}))}))}),(function(e){return v.fail(e)}),Yt,JSON.stringify(g),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)||"",Gr(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,f||[],E,null!=_&&_).result()]}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){return tt(this,(function(n){return r?[2,Kr(ot(this,lo,"m",So).call(this,e,t))]:[2,ot(this,lo,"m",Po).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return tt(this,(function(l){switch(l.label){case 0:return r=t.timestamp,n=t.count,i=t.order,o=e.conversationType,a=e.targetId,s=e.channelId,[4,(u=uo.create(this.logger,"getContinuousMessages",this.logger.createTraceId())).asyncInvoke(o,a,r,n,(function(e,t,r){return u.ok({listJson:e,hasMore:r,nextTime:t})}),(function(e){return u.fail(e)}),0===i,s||"").result()];case 1:return[2,l.sent().trans((function(e){var t=e.listJson,r=e.hasMore,n=e.nextTime,i=JSON.parse(t).list.map((function(e){var t=e.obj;return c._buildMessage(t)})).reverse();return{list:i,hasMore:!!r,timestamp:n}}))]}}))}))}}),Object.defineProperty(e.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=uo.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(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=uo.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(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){return tt(this,(function(t){return ot(this,lo,"m",Ao).call(this,e),[2,Kr()]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l=this;return tt(this,(function(d){return r=e.channelId,n=e.count,i=e.startTime,e.order,o=e.conversationTypes,a=e.topPriority,s=o&&o.length>0?o:bt(t?ft:lt),u=s.map((function(e){return{conversationType:e,channelId:e===ze.ULTRA_GROUP?ot(l,lo,"m",Mo).call(l,""):r,channelIdValid:e===ze.ULTRA_GROUP||"string"==typeof r}})),c=no(this.logger,!1,"getConversationListByPageWithTopPriorityV2",u,i,n,!!a),[2,ot(this,lo,"m",Oo).call(this,c)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o,a=this;return tt(this,(function(s){return n=((null==t?void 0:t.length)||0)>0?t:bt(e?ft:lt),i=n.map((function(e){return{conversationType:e,channelId:e===ze.ULTRA_GROUP?ot(a,lo,"m",Mo).call(a,""):r,channelIdValid:e===ze.ULTRA_GROUP||"string"==typeof r}})),o=no(this.logger,!1,"getTopConversationsV2",i),[2,ot(this,lo,"m",Oo).call(this,o)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o=this;return tt(this,(function(a){return r=((null==t?void 0:t.length)||0)>0?t:bt(e?ft:lt),n=r.map((function(e){return{conversationType:e,channelId:e===ze.ULTRA_GROUP?ot(o,lo,"m",Mo).call(o,""):"",channelIdValid:e===ze.ULTRA_GROUP}})),i=no(this.logger,!1,"getUnreadConversationListV2",n),[2,ot(this,lo,"m",Oo).call(this,i)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o=this;return tt(this,(function(a){return r=bt(e?ft:lt),n=r.map((function(e){return{conversationType:e,channelId:e===ze.ULTRA_GROUP?ot(o,lo,"m",Mo).call(o,""):t,channelIdValid:e===ze.ULTRA_GROUP||"string"==typeof t}})),i=no(this.logger,!1,"getConversationsV2",n),[2,ot(this,lo,"m",Oo).call(this,i)]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n;return tt(this,(function(i){return r=bt(lt).map((function(e){return{conversationType:e,channelIdValid:!1}})),n=no(this.logger,!1,"getConversationListByPageWithTopPriorityV2",r,e,t,!0),[2,ot(this,lo,"m",Oo).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n;return tt(this,(function(i){return n=no(this.logger,!1,"getConversationsByPageWithoutTag",e,t,r),[2,ot(this,lo,"m",Oo).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l,d,f;return tt(this,(function(_){switch(_.label){case 0:return t=e.conversationType,r=e.targetId,n=e.channelId,(i=ot(this,lo,"m",Uo).call(this,e))?[2,Kr(i)]:(o=ot(this,lo,"m",So).call(this,e,{timestamp:0,count:1,order:0,messageType:""}),a=(null==o?void 0:o.list[0])||null,s=JSON.parse(no(this.logger,!1,"getConversationStatus",JSON.stringify([{conversation_type:t,target_id:r,channel_id:n,channel_id_valid:"string"==typeof n&&n.length>0}])))[0],u=!!(null==s?void 0:s.is_top),c=(null==s?void 0:s.translate_strategy)||zn,[4,this.getConversationNotificationLevel(e)]);case 1:return l=_.sent(),d=l.data,f={conversationType:t,targetId:r,channelId:n,latestMessage:a,lastUnreadTime:0,isTop:u,notificationLevel:d,notificationStatus:hr(d),translateStrategy:c,unreadMessageCount:ot(this,lo,"m",Do).call(this,e)},[2,Kr(f)]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.identifiers,r=e.deleteRemotely,n=e.deleteMessages,i=uo.create(this.logger,"batchDeleteConversations",this.logger.createTraceId());return i.invoke({conversationIdentifiers:t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),deleteMessages:n,deleteRemotely:r},(function(){return i.ok()}),(function(e){return i.fail(e)})).result()}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var t,r,n;return tt(this,(function(i){return t=e instanceof Array?e:bt(ft),r=t.map((function(e){return{conversationType:e,channelIdValid:!1}})),[2,(n=no(this.logger,!0,"clearConversationsV2",r))===ce.SUCCESS?Kr():Xr(n)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o=this;return tt(this,(function(a){return n=e.map((function(e){return{conversationType:e,channelId:e===ze.ULTRA_GROUP?ot(o,lo,"m",Mo).call(o,""):r,channelIdValid:e===ze.ULTRA_GROUP||"string"==typeof r}})),i=no(this.logger,!0,"getTotalUnreadCount2",n,t),[2,Kr(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return t=ot(this,lo,"m",Do).call(this,e),[2,Kr(t)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i,o;return tt(this,(function(a){return t=e.conversationType,r=e.targetId,n=e.channelId,t===ze.ULTRA_GROUP?(i=this.getServerTime(),[2,(o=uo.create(this.logger,"setReadTimestamp",this.logger.createTraceId())).asyncInvoke(t,r,i,(function(){return o.ok()}),(function(e){return o.fail(e)}),n||"").result()]):(ot(this,lo,"m",wo).call(this,e),[2,Kr()])}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e,t=this;return tt(this,(function(r){switch(r.label){case 0:return[4,this.getUnreadConversationList(!1)];case 1:return(e=r.sent()).isOk?(e.data.forEach((function(e){e.conversationType!==ze.ULTRA_GROUP&&ot(t,lo,"m",wo).call(t,e)})),[2,Kr()]):[2,e.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId;no(this.logger,!1,"clearUnreadCountByTimestamp",r,n,t,i||"")}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){return tt(this,(function(r){return this._clearUnreadCountByTimestamp(e,t),[2,Kr()]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return t=ot(this,lo,"m",jo).call(this,e),[2,Kr(t)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return t=ot(this,lo,"m",jo).call(this,e),[2,Kr(t?{messageUId:t.messageUId,sentTime:t.sentTime}:null)]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return ot(this,lo,"m",Vo).call(this,e,-1,t?1:0,-1,r,n)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=uo.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(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return ot(this,lo,"m",Vo).call(this,e,-1,-1,t,!1,!1)}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.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(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return t=no(this.logger,!0,"getBlockPushLevelForType",e),[2,Kr(t)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a,s,u=this;return tt(this,(function(c){switch(c.label){case 0:return i=this.logger.createTraceId(),o=uo.create(this.logger,"searchConversationByContentV2",i),a=n.map((function(e){return{conversationType:e,channelId:r,channelIdValid:!0}})),[4,o.asyncInvoke(a,e,t,(function(e,t,r){e===ce.SUCCESS?o.ok({result:t,matchedNumber:r}):o.fail(e)})).result()];case 1:return(s=c.sent()).isOk?[2,s.trans((function(e){return JSON.parse(e.result).map((function(e){return ot(u,lo,"m",Io).call(u,e)}))}))]:[2,Kr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o,a,s=this;return tt(this,(function(u){switch(u.label){case 0:return r=r||bt(lt),n=this.logger.createTraceId(),i=uo.create(this.logger,"searchConversationByContentV2",n),o=r.map((function(e){return{conversationType:e,channelIdValid:!1}})),[4,i.asyncInvoke(o,e,t,(function(e,t,r){e===ce.SUCCESS?i.ok({result:t,matchedNumber:r}):i.fail(e)})).result()];case 1:return(a=u.sent()).isOk?[2,a.trans((function(e){return JSON.parse(e.result).map((function(e){return ot(s,lo,"m",Io).call(s,e)}))}))]:[2,Kr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o;return et(this,void 0,void 0,(function(){var a,s,u,c,l=this;return tt(this,(function(d){switch(d.label){case 0:return a=this.logger.createTraceId(),s=function(e){if(!e)return[];var t=[],r=function(e){if(0!==t.length){var r=[];e.forEach((function(e){r.push.apply(r,it([],nt(t.map((function(t){return $e($e({},t),e)}))),!1))})),t=r}else t.push.apply(t,it([],nt(e),!1))},n=e.conversationTypes,i=void 0===n?[]:n,o=e.targetIds,a=void 0===o?[]:o,s=e.channelIds,u=void 0===s?[]:s,c=pn(i).map((function(e){return{conversationType:e}})),l=pn(a).map((function(e){return{targetId:e}})),d=pn(u).length?u.map((function(e){return{channelId:e}})):[{channelIdValid:!1}];return r(c),r(l),r(d),t}(e.conversationFilter),u={keyword:e.keyword,limit:e.limit,desc:!e.order,offset:null!==(t=e.offset)&&void 0!==t?t:0,needMatchCount:!0,startTime:null===(r=e.timeRange)||void 0===r?void 0:r.startTime,endTime:null===(n=e.timeRange)||void 0===n?void 0:n.endTime,objectNames:pn((null===(i=e.messageFilter)||void 0===i?void 0:i.objectNames)||[]),senderIds:pn((null===(o=e.messageFilter)||void 0===o?void 0:o.senderIds)||[])},[4,(c=uo.create(this.logger,"searchMessage",a)).invoke(s,u,(function(e,t,r,n){e===ce.SUCCESS?c.ok({result:t,totalMatched:r,conditionsMatched:n}):c.fail(e)})).result()];case 1:return[2,d.sent().trans((function(e){var t=e.result,r=e.totalMatched,n=e.conditionsMatched;return{messages:JSON.parse(t).list.map((function(e){return JSON.parse(e.obj)})).map((function(e){return ot(l,lo,"m",vo).call(l,e)})),totalMatched:r,conditionsMatched:n}}))]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i,o,a=this;return tt(this,(function(s){return t=e.conversationType,r=e.targetId,n=e.channelId,i=no(this.logger,!1,"getUnreadMentionedMessages",t,r,n||""),o=JSON.parse(i).list.map((function(e){var t=e.obj;return ot(a,lo,"m",vo).call(a,JSON.parse(t))})),[2,Kr(o)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return r=ot(this,lo,"m",Uo).call(this,e),[2,Kr(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"addToBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"removeFromBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=uo.create(this.logger,"getBlacklist",this.logger.createTraceId());return e.asyncInvoke((function(t){return e.ok(t)}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"getBlacklistStatus",this.logger.createTraceId());return t.asyncInvoke(e,(function(e){return t.ok(e)}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return[2,-1===(r=ot(this,lo,"m",Go).call(this,e,t)).messageId?Xr(ce.MSG_INSERT_ERROR,"insert message failed",r):Kr(r)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return r=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,d=e.messageUId,f=e.disableNotification,_=e.canIncludeExpansion,p=e.expansion,E=e.channelId,h=e.conversationType,g=e.targetId,b=e.source,R=e.isMentioned,v=e.receivedStatusInfo,I=e.directedUserIds,O=e.disableUpdateLastMessage,T=v?function(e){var t=sr.UNREAD;return(null==e?void 0:e.isRead)&&(t|=sr.READ),(null==e?void 0:e.isListened)&&(t|=sr.LISTENED),(null==e?void 0:e.isDownload)&&(t|=sr.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=sr.RETRIEVED),t}(v):a,N=u||0,m={};if(p)for(var C in p)m[C]={v:p[C],ts:N};return{conversationType:h,targetId:g,channelId:E||"",direction:i,senderUserId:r,status:s||10,sentTime:N,objectName:n,content:JSON.stringify(t),messageUid:d||"",noNotification:!!f,supportExt:!!_,extMsg:JSON.stringify(m),readStatus:T,searchContent:c||"",isUnread:!!l,source:b||"",isMention:R,directedUsers:I,disableUpdateLastMessage:!!O}})),[2,no(this.logger,!0,"insertMessages",JSON.stringify(r),t)?Kr(!0):Xr(ce.MSG_INSERT_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i;return tt(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=no(this.logger,!0,"getMessageCount",t,r,n||""),[2,Kr(i)]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){return tt(this,(function(t){return ot(this,lo,"m",ko).call(this,e),[2,Kr()]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){return tt(this,(function(n){return ot(this,lo,"m",Fo).call(this,e,t,r),[2,Kr()]}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return t=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}})),no(this.logger,!1,"deleteMessageBySendTimeInBatches",JSON.stringify(t)),[2,Kr()]}))}))}}),Object.defineProperty(e.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=uo.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(e.prototype,"getMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){return tt(this,(function(t){return[2,ot(this,lo,"m",Bo).call(this,e)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){return tt(this,(function(n){return ot(this,lo,"m",Jo).call(this,e,t,r),[2,Kr()]}))}))}}),Object.defineProperty(e.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(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){return tt(this,(function(r){return no(this.logger,!1,"setMessageSentStatus",e,t),[2,Kr()]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){return tt(this,(function(r){return ot(this,lo,"m",xo).call(this,e,t),[2,Kr()]}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i;return tt(this,(function(o){return r=e.conversationType,n=e.targetId,i=e.channelId,[2,no(this.logger,!1,"saveTextMessageDraft",r,n,t,i||"")?Kr():Xr(ce.DRAFT_SAVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i;return tt(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=no(this.logger,!0,"getTextMessageDraft",t,r,n||""),[2,Kr(i)]}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n;return tt(this,(function(i){return t=e.conversationType,r=e.targetId,n=e.channelId,[2,no(this.logger,!1,"clearTextMessageDraft",t,r,n||"")?Kr():Xr(ce.DRAFT_REMOVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i;return tt(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=no(this.logger,!0,"getBlockPushLevelForConversation",r,n||"",t),[2,Kr(i)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i;return tt(this,(function(o){return n=e.map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(i=no(this.logger,!0,"getUnreadAndMentionCountByLevel",n,t)).code?[2,Xr(i.code)]:[2,Kr(r?i.mention:i.unread)]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o=this;return tt(this,(function(a){switch(a.label){case 0:return[4,(n=uo.create(this.logger,"sendReadReceipt",this.logger.createTraceId())).asyncInvoke(e,r||"",t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){o._updateReadReceiptInfo(e,{hasRespond:!0});var t=ot(o,lo,"m",Ho).call(o,e);t.isOk&&ot(o,lo,"m",xo).call(o,t.data.messageId,1)})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=uo.create(this.logger,"getMessageReader",this.logger.createTraceId());return i.asyncInvoke(e,r,t,(function(e,r){var o=[],a={};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),i.ok({list:o,totalMemberCount:r})}),(function(e){return i.fail(e)})).result()}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"sendMessageReadReceipt",this.logger.createTraceId()),i=e.conversationType,o=e.targetId,a=e.channelId;return n.asyncInvoke(i,o,a||"",t,r,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.targetId,i=e.channelId,o=uo.create(this.logger,"getMessageReadReceipt",this.logger.createTraceId());return o.asyncInvoke(n,i||"",t,(function(e,n,i){return et(r,void 0,void 0,(function(){var r,a,s,u,c,l,d,f,_;return tt(this,(function(p){r=[],a=this._callCppProxy("getMessage",t),s=JSON.parse(a);try{JSON.parse(i).list.forEach((function(e){var t=JSON.parse(e.obj),n=t.id,i=t.time;r.push({userId:n,readTime:i})}))}catch(e){this.logger.error(Zn.P_PARSE_JSON_E,"method: getMessageReadReceipt, info: ".concat(i,", error: ").concat(e))}return u=JSON.parse(s.readReceiptRequest||"{}"),c=u.readerList,l=void 0===c?[]:c,d=u.readCount,f=void 0===d?0:d,_=!1,l.length<r.length&&(l=r,_=!0),f<n&&(f=n,_=!0),_&&this._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify({readerList:l,readCount:f,totalCount:e})),o.ok({list:r,totalCount:e,readCount:f}),[2]}))}))}),(function(e){return o.fail(e)})).result()}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"updateConversationReadTime",this.logger.createTraceId()),n=e.conversationType,i=e.targetId,o=e.channelId;return r.asyncInvoke(n,i,o||"",t,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"_try2RejoinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(0!==this._chatroomCache.size){var t=this.logger.createTraceId();this._chatroomCache.forEach((function(r){return et(e,void 0,void 0,(function(){var e,n,i,o,a,s,u;return tt(this,(function(c){switch(c.label){case 0:return e=r.chatroomId,n=r.count,i=r.extra,this.logger.info(Re,e,t),[4,this._joinChrm(e,n,!1,!0,i)];case 1:return o=c.sent(),this.logger.summary(ve,o,t),a=o.code,s=o.isOk,u=o.data,s?(this._sendChatroomEvents({rejoinedRoom:$e({chatroomId:e,count:n},u)}),[2]):(a!==ce.RC_CHATROOM_USER_KICKED&&a!==ce.RC_CHATROOM_NOT_EXIST||this._chatroomCache.delete(e),this._sendChatroomEvents({rejoinedRoom:{chatroomId:e,errorCode:a}}),[2])}}))}))}))}}}),Object.defineProperty(e.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this,a=r?"joinChatRoom":"joinExistChatRoom";n||ot(this,lo,"m",Lo).call(this,e,!0,!0);var s=uo.create(this.logger,a,this.logger.createTraceId());return s.asyncInvoke(e,t,(function(r,a,u,c,l,d,f){o._chatroomCache.set(e,{chatroomId:e,count:t,extra:i||"",isKVSynced:n}),s.ok({createTime:Number(r),memberCount:a,isAllChatroomBanned:u,isCurrentUserBanned:c,isCurrentChatroomBanned:l,isCurrentChatroomInWhitelist:d,joinTime:f})}),(function(e){return s.fail(e)}),i||"").result()}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){return tt(this,(function(i){return[2,this._joinChrm(e,t,r,!1,n)]}))}))}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._chatroomCache.delete(e);var t=uo.create(this.logger,"quitChatRoom",this.logger.createTraceId());return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"getChatroomInfo",this.logger.createTraceId());return n.asyncInvoke(e,t,r,(function(e,t){var r=(e?JSON.parse(e).list:[]).map((function(e){return JSON.parse(e.obj)}));n.ok({userInfos:r,userCount:t})}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a=this;return tt(this,(function(s){return i=this.logger.createTraceId(),[2,(o=uo.create(this.logger,"getChatroomHistoryMessage",i)).asyncInvoke(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 a._buildMessage(e.obj)}))}catch(e){t.list=[]}o.ok(t)}),(function(e){return o.fail(e)}),"").result()]}))}))}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"setChatroomStatus",this.logger.createTraceId());return n.asyncInvoke(e,t.key,t.value,!!t.isAutoDelete,r,!!t.isSendNotification,t.notificationExtra||"",(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"setChatroomKV");return r.asyncInvoke(e,JSON.stringify(t.entries),!!t.isAutoDelete,!!t.isForce,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"deleteChatroomStatus",this.logger.createTraceId());return n.asyncInvoke(e,t.key,r,!!t.isSendNotification,t.notificationExtra||"",(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"deleteChatroomKV",this.logger.createTraceId());return r.asyncInvoke(e,t.keys,!1,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){return tt(this,(function(r){switch(r.label){case 0:return[4,this.getAllChatroomEntries(e)];case 1:return[2,r.sent().tryTrans((function(e){var r=e[t];return"string"!=typeof r?Xr(ce.CHATROOM_KEY_NOT_EXIST):Kr(r)}))]}}))}))}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"getChatroomKV",this.logger.createTraceId());return t.asyncInvoke(e,(function(e){var r={};try{(e?JSON.parse(e):{list:[]}).list.forEach((function(e){var t=e.obj,n=JSON.parse(t);r[n.key]=n.value?n.value:""}))}catch(e){}t.ok(r)}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){var a;r=r||"",i=i||"",a=(n=n||"")&&"uploads"!==n?t||"":Vr(e,t);var s=this.getNaviInfoFromCache(),u={uploadDomain:Hr(s,this.logger),env:this._environment};o=o?Math.ceil(o):0;var c=uo.create(this.logger,"getUploadToken");return c.asyncInvoke(e,a,r,n,i,JSON.stringify(u),o,s.ipType||0,(function(e,t,r,n,i,o,s,u,l,d,f,_,p,E,h,g,b,R,v,I,O,T,N,m){c.ok({token:e,deadline:0,bosToken:t,bosDate:r,path:n,osskeyId:i,ossPolicy:o,ossSign:s,ossBucketName:u,fileName:a,s3Credential:l,s3Algorithm:d,s3Date:f,s3Policy:_,s3Signature:p,s3BucketName:E,stcAuthorization:h,stcContentSha256:g,stcDate:b,stcBucketName:R,minioAuthorization:v,minioContentSha256:I,minioDate:O,minioBucketName:T,downloadAuthInfo:N?JSON.parse(N):null})}),(function(e){return c.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this.getNaviInfoFromCache(),o=Hr(i,this.logger),a=this.logger.createTraceId(),s=uo.create(this.logger,"getDownloadUrl",a);return s.asyncInvoke(e,r,n,t-1,JSON.stringify({url:o}),-1,i.ipType||0,(function(e){return s.ok({downloadUrl:e})}),(function(e){return s.fail(e)})).result()}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e;return tt(this,(function(t){return e=no(this.logger,!0,"clearData"),[2,Kr(e)]}))}))}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._deviceId}}),Object.defineProperty(e.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(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"bindRTCRoomForChatroom",this.logger.createTraceId());return t.asyncInvoke(e.chatRoomId,e.rtcRoomId,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=uo.create(this.logger,"rtcSignaling");return i.asyncInvoke(e,t,r,n,(function(e){var t=Array.prototype.slice.call(e);i.ok(t)}),(function(e){return i.fail(e)}),30).result()}}),Object.defineProperty(e.prototype,"_setRTCHeartbeatListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;_i.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(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=zr(),i=n.promise,o={resolve:n.resolve,seqId:""},a=this.rtcHeartbeatResolves[e];return a?a.push(o):this.rtcHeartbeatResolves[e]=[o],no(this.logger,!1,"sendRTCHeartbeat",[e],30),i}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"addTag");return t.asyncInvoke(e.tagId,e.tagName,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"deleteTag");return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"renameTag");return t.asyncInvoke(e.tagId,e.tagName,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e,t;return tt(this,(function(r){return e=no(this.logger,!1,"getTags"),t=this._convertResultList(e,(function(e){return{tagId:e.tagId,tagName:e.tagName,conversationCount:e.conversationCount,createdTime:e.tagTime}})),[2,Kr(t)]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"addConversationsForTag"),n=t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId}}));return r.asyncInvoke(e,JSON.stringify(n),(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"removeConversationsForTag"),n=t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId}}));return r.asyncInvoke(e,JSON.stringify(n),(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"removeTagsForConversation");return r.asyncInvoke(e.conversationType,e.targetId,e.channelId||"",t,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o=this;return tt(this,(function(a){return n=no(this.logger,!1,"getConversationsForTagByPage",e,t,r,""),i=this._convertResultList(n,(function(e){return $e($e({},o._buildConversation(JSON.stringify(e))),{isTopInTag:e.topForTag})})),[2,Kr(i)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return r=no(this.logger,!0,"getConversationUnreadCountForTag",e,t),[2,Kr(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"setConversationToTopForTag");return n.asyncInvoke(e,t.conversationType,t.targetId,t.channelId||"",!!r.isTop,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r;return tt(this,(function(n){return t=no(this.logger,!1,"getTagsForConversation",e.conversationType,e.targetId,e.channelId||""),r=this._convertResultList(t,(function(e){return{tagId:e.tagId,tagName:e.tagName,isTop:e.isTop,createdTime:e.tagTime}})),[2,Kr(r)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e,t;return tt(this,(function(r){return e=[ze.GROUP].map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(t=no(this.logger,!0,"getUnreadAndMentionCountV2",e)).code?[2,Xr(t.code)]:[2,Kr(t.mention)]}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e;return tt(this,(function(t){return e={arch:o(),platform:i(),type:c(),version:l(),release:u(),uptime:d(),cpus:s(),freemem:f(),totalmem:_(),networkInterfaces:a()},[2,{code:ce.SUCCESS,data:e}]}))}))}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){return tt(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(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"callInfoSignaling");return n.asyncInvoke(e,t,r,(function(e,t){return n.ok({key:e,value:t})}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){return tt(this,(function(t){return this.tcpMgr.getConnectionStatus()!==Mt.DISCONNECTED?[2,Xr(ce.RC_CONN_PROXY_UNAVAILABLE)]:[2,Li(e,this.logger)]}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve(Mi())}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l;return tt(this,(function(d){switch(d.label){case 0:return n=zr(),i=n.resolve,o=n.promise,a=/^https/.test(t),s=a?Si:mi,u=r.createTraceId(),r.info(Ue,JSON.stringify({proxy:e,testHost:t}),u),c=s(t,e,(function(e){var t=200===e.statusCode;e.setEncoding("utf8");var r="";e.on("data",(function(e){r+=e})),e.once("end",(function(){var n=t?Kr(r):Xr(ce.RC_HTTP_REQ_FAIL,"fail: ".concat(e.statusCode),r);i(n)}))})),c.once("timeout",(function(){return i(Xr(ce.TIMEOUT))})),c.once("error",(function(e){return i(Xr(ce.RC_HTTP_REQ_FAIL,e.stack))})),c.end(),[4,o];case 1:return l=d.sent(),r.summary(De,l,u),[2,l.wipe()]}}))}))}(e,t,this.logger)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return t=no(this.logger,!0,"checkDuplicateMessage",e),[2,Kr(t)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"updateSubscribeStatus");return n.asyncInvoke(t,At.SUBSCRIBE,e,(function(){return n.ok()}),(function(e,t){return n.fail(e,t)}),r).result()}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"updateSubscribeStatus");return r.asyncInvoke(t,At.UNSUBSCRIBE,e,(function(){return r.ok()}),(function(e){return r.fail(e)}),0).result()}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o;return tt(this,(function(a){return n=no(this.logger,!1,"getSubscribeUserList",e,t,r),i=this._buildSubscribeEventData(n),o=i.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===Pt.ONLINE_STATUS&&(a.details=Mr(o)),a})),[2,Kr(o)]}))}))}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return[2,(t=no(this.logger,!1,"setDuplicateMessageConfig",[ze.CHATROOM],Zo.cuid,e))===ce.SUCCESS?Kr():Xr(t)]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r=this;return tt(this,(function(n){switch(n.label){case 0:return[4,ot(this,lo,"m",Qo).call(this,[e],t)];case 1:return[2,n.sent().trans((function(e){var t=r._buildSubscribeEventData(e).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===Pt.ONLINE_STATUS&&(a.details=Mr(o)),a}));return t}))]}}))}))}}),Object.defineProperty(e.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=uo.create(this.logger,"updateUserProfile");return n.invoke(t,r,(function(e,t){if(e===ce.SUCCESS)n.ok();else{var r=si(t);n.fail(e,{errorKey:r[0],errorKeys:r})}})).result()}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=uo.create(this.logger,"getUserProfiles");return r.invoke(e,(function(e,n){e===ce.SUCCESS?r.ok(t._string2UserProfileInfoList(n)):r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=uo.create(this.logger,"getOwnUserProfile");return t.asyncInvoke((function(r,n){t.flush(Yr.from(r).trans((function(){return e._string2userProfileInfo(n)})))})).result()}}),Object.defineProperty(e.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(Zn.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return{}}}),Object.defineProperty(e.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(Zn.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return[]}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"updateUserProfilePermission");return t.invoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=uo.create(this.logger,"getUserProfilePermission");return e.asyncInvoke((function(t,r){e.flush(Yr.from(t).trans((function(){return r})))})).result()}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=uo.create(this.logger,"getUserProfileByUniqueId");return r.asyncInvoke(e,(function(e,n){r.flush(Yr.from(e).trans((function(){return t._string2userProfileInfo(n)})))})).result()}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a,s,u,c=this;return tt(this,(function(l){return i=e.conversationType,o=e.targetId,a=e.channelId,s=no(this.logger,!1,"getMatchedMessage",i,o,t,r,n,a||""),u=JSON.parse(s).list.map((function(e){var t=e.obj;return c._buildMessage(t)})),[2,Kr(u)]}))}))}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return t=ot(this,lo,"m",Wo).call(this,e),[2,Kr(t)]}))}))}}),Object.defineProperty(e.prototype,"handleErrorCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e!==ce.SUCCESS&&setTimeout((function(){return t(Xr(e))}),0)}}),Object.defineProperty(e.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,d=jr(r),f=jr(o);return{groupId:t,groupName:d.name||"",portraitUri:d.portraitUrl||"",introduction:d.introduction||"",notice:d.announcement||"",joinPermission:~~d.joinPerm,removeMemberPermission:~~d.removePerm,invitePermission:~~d.memInvitePerm,inviteHandlePermission:~~d.invitePerm,groupInfoEditPermission:~~d.profilePerm,memberInfoEditPermission:~~d.memProfilePerm,extProfile:f,creatorId:i||"",ownerId:s||"",createTime:n||0,membersCount:a||0,remark:u||"",joinedTime:c||0,role:l||K.UNDEF}})):[]}}),Object.defineProperty(e.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,d=jr(r),f=jr(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:wr(e.joinPerm),removeMemberPermission:wr(e.removePerm),invitePermission:wr(e.memInvitePerm),inviteHandlePermission:wr(e.invitePerm),groupInfoEditPermission:wr(e.profilePerm),memberInfoEditPermission:wr(e.memProfilePerm)}))}(d)),o.length>0&&{extProfile:f}),i&&{creatorId:i}),s&&{ownerId:s}),n&&{createTime:n}),a&&{membersCount:a}),u&&{remark:u}),c&&{joinedTime:c}),l&&{role:l})))})):[]}}),Object.defineProperty(e.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(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a;return tt(this,(function(s){return i=ii(t),o=ii(r||{}),[2,(a=uo.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:si(n),processCode:t})})).result()]}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i,o;return tt(this,(function(a){return n=ii(t),i=ii(r||{}),[2,(o=uo.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:si(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r=this;return tt(this,(function(n){return[2,(t=uo.create(this.logger,"getGroupInfoByIds")).invoke(e,(function(e,n,i,o){var a=Yr.from(e).trans((function(){var e=JSON.parse(o);return r._convertGroupInfoList(e)}));t.flush(a)})).result()]}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n;return tt(this,(function(i){return[2,(n=uo.create(this.logger,"kickOutGroupMember")).invoke(e,t,JSON.stringify(oi(r)),(function(e,t){return n.flush(Yr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return[2,(r=uo.create(this.logger,"quitGroup")).invoke(e,JSON.stringify(oi(t)),(function(e,t){return r.flush(Yr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return[2,(t=uo.create(this.logger,"disbandGroup")).invoke(e,(function(e,r){return t.flush(Yr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i;return tt(this,(function(o){return[2,(i=uo.create(this.logger,"transferGroup")).invoke(e,t,r,JSON.stringify(oi(n)),(function(e,t){return i.flush(Yr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n;return tt(this,(function(i){return[2,(n=uo.create(this.logger,"updateGroupAdmins")).invoke(t,r,e,(function(e,t){return n.flush(Yr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i=this;return tt(this,(function(o){return[2,(n=uo.create(this.logger,"getGroupMembers")).invoke(e,t===K.UNDEF?[1,2,3]:[t],r.pageToken,r.count,r.order?1:0,(function(e,t,r,o){if(e===ce.SUCCESS){var a=i._convertGroupMemberInfoList(JSON.parse(o));n.ok({totalCount:r||0,data:a,pageToken:t||""})}else n.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n=this;return tt(this,(function(i){return[2,(r=uo.create(this.logger,"getGroupMembersByIds")).invoke(e,t,(function(e,t,i,o){var a=Yr.from(e).trans((function(){var e=JSON.parse(o);return n._convertGroupMemberInfoList(e)}));r.flush(a)})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i;return tt(this,(function(o){return[2,(i=uo.create(this.logger,"updateGroupMemberInfo")).invoke(e,t,r,n||"",(function(e,t,r,n){e===ce.SUCCESS?i.ok():i.fail(e,{errorKeys:si(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i=this;return tt(this,(function(o){return[2,(n=uo.create(this.logger,"getGroupMembersByNickname")).invoke(e,t,r.pageToken,r.count,r.order?1:0,(function(e,t,r,o){if(e===ce.SUCCESS){var a=i._convertGroupMemberInfoList(JSON.parse(o));n.ok({totalCount:r||0,data:a,pageToken:t||""})}else n.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return[2,(t=uo.create(this.logger,"joinGroup")).invoke(e,(function(e,r,n){e===ce.SUCCESS?t.ok({processCode:r}):t.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return[2,(r=uo.create(this.logger,"inviteUsersToGroup")).invoke(e,t,(function(e,t,n){e===ce.SUCCESS?r.ok({processCode:t}):r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c;return tt(this,(function(l){return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,a=e.reason,u=(s=1===n?1:0)&&o?o:"",[2,(c=uo.create(this.logger,"handleGroupInvite")).invoke(t,u,r,i,s,a||"",(function(e,t,r){var n=Yr.from(e).trans((function(){return{processCode:t}}));c.flush(n)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i;return tt(this,(function(o){return n=e.order?1:0,[2,(i=uo.create(this.logger,"getGroupRequests")).invoke(t,r,"",e.pageToken||"",e.count,n,(function(e,t,r,n){if(e===ce.SUCCESS){var o=JSON.parse(n).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}}));i.ok({totalCount:r,data:o,pageToken:t})}else i.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o=this;return tt(this,(function(a){return r=uo.create(this.logger,"getGroups"),n=t.order?1:0,i=e===K.UNDEF?[1,2,3]:[e],[2,r.invoke(i,t.pageToken,t.count,n,(function(e,t,n,i){if(e===ce.SUCCESS){var a=JSON.parse(i),s=o._convertGroupInfoList(a);r.ok({totalCount:n,data:s,pageToken:t})}else r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n=this;return tt(this,(function(i){return[2,(r=uo.create(this.logger,"getGroupsByGroupName")).invoke(e,t.pageToken,t.count,t.order?1:0,(function(e,t,i,o){if(e===ce.SUCCESS){var a=JSON.parse(o),s=n._convertGroupInfoList(a);r.ok({totalCount:i,data:s,pageToken:t})}else r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r=this;return tt(this,(function(n){return[2,(t=uo.create(this.logger,"getGroupsByIds")).invoke(e,(function(e,n,i,o){if(e===ce.SUCCESS){var a=JSON.parse(o),s=r._convertGroupInfoList(a);t.ok(s)}else t.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return[2,(r=uo.create(this.logger,"updateGroupRemark")).invoke(e,t,t?Z.ADD:Z.REMOVE,(function(e,t){return r.flush(Yr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n;return tt(this,(function(i){return[2,(n=uo.create(this.logger,"updateFavoriteMembers",this.logger.createTraceId())).invoke(t,r,e,(function(e,t){return n.flush(Yr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return[2,(t=uo.create(this.logger,"getGroupFavoriteMembers")).invoke(e,"",1e3,0,(function(e,r,n,i){var o=Yr.from(e).trans((function(){return JSON.parse(i).map((function(e){return{userId:e.userId,time:e.followTime}}))}));t.flush(o)})).result()]}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"addFriend");return n.invoke(e,t,r,(function(e,t,r){e===ce.SUCCESS?n.ok({processCode:t}):n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"removeFriends",this.logger.createTraceId());return r.invoke(e,t,(function(e,t){return r.flush(Yr.from(e))})).result()}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"acceptFriendRequest",this.logger.createTraceId());return t.invoke(e,"",(function(e,r){return t.flush(Yr.from(e))})).result()}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"rejectFriendRequest",this.logger.createTraceId());return r.invoke(e,t||"",(function(e,t){return r.flush(Yr.from(e))})).result()}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"setFriendInfo"),i=ii(r);return n.invoke(e,t,JSON.stringify(i),(function(e,t,r,i){e===ce.SUCCESS?n.ok():n.fail(e,{errorKeys:si(i)})})).result()}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){switch(n.label){case 0:return[4,(r=uo.create(this.logger,"checkFriendRelationship")).invoke(e,t,(function(e,t){e===ce.SUCCESS?r.ok(t):r.fail(e)})).result()];case 1:return[2,n.sent().trans((function(e){return JSON.parse(e).map((function(e){return{userId:e.userId,relationType:e.status}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var t,r=this;return tt(this,(function(n){switch(n.label){case 0:return[4,(t=uo.create(this.logger,"getFriends",this.logger.createTraceId())).invoke(e,0,(function(e,r){e===ce.SUCCESS?t.ok(r):t.fail(e)})).result()];case 1:return[2,n.sent().trans((function(e){var t=JSON.parse(e);return{data:r._convertFriendInfo(t),pageToken:""}}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"getFriendRequestListByPage",this.logger.createTraceId());return n.invoke([1,2].every((function(e){return t.includes(e)}))?3:t[0],r,e.count,e.pageToken,e.order?1:0,(function(e,t,r){if(e===ce.SUCCESS){var i=JSON.parse(r).map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.friendRequestType,applicationStatus:e.friendRequestStatus,operationTime:e.operateTime,extra:e.extra}}));n.ok({pageToken:t,data:i})}else n.fail(e)})).result()}}),Object.defineProperty(e.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(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=uo.create(this.logger,"getFriendByIds");return r.invoke(e,(function(e,n){if(e===ce.SUCCESS){var i=JSON.parse(n),o=t._convertFriendInfo(i);r.ok(o)}else r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=uo.create(this.logger,"getFriendByNickname");return r.invoke(e,(function(e,n){if(e===ce.SUCCESS){var i=JSON.parse(n),o=t._convertFriendInfo(i);r.ok(o)}else r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"setFriendAuthPermission");return t.invoke(e,(function(e){e!==ce.SUCCESS?t.fail(e):t.ok()})).result()}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=uo.create(this.logger,"getFriendAuthPermission");return e.invoke((function(t,r){t!==ce.SUCCESS?e.fail(t):e.ok(r)})).result()}}),Object.defineProperty(e.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=uo.create(this.logger,"addPushSetting");return o.invoke(t,r,n,i||"",(function(){return o.ok()}),(function(e){return o.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=uo.create(this.logger,"removePushSetting");return e.invoke((function(){return e.ok()}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=uo.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(e.prototype,"setDataBaseLogConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._callCppProxy("setDataBaseLogConfig",e)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){return tt(this,(function(e){return[2,Kr(Tn.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"sendReadReceiptByReadReceiptType");return r.invoke(e.conversationType,e.targetId,e.channelId||"",$n,t,(function(e,t,n){e!==ce.SUCCESS?r.fail(e):r.ok()})).result()}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r;return tt(this,(function(n){switch(n.label){case 0:return t=e.map((function(e){var t=e.identifier,r=e.messageUId;return{conIdentifier:{type:t.conversationType,targetId:t.targetId,channelId:t.channelId||""},uid:r}})),[4,(r=uo.create(this.logger,"getReadReceiptCount")).invoke(JSON.stringify(t),(function(e,t){e!==ce.SUCCESS?r.fail(e):r.ok(t)})).result()];case 1:return[2,n.sent().trans((function(e){return JSON.parse(e).map((function(e){return{identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.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(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.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()}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n=this;return tt(this,(function(i){return t=function(t,r){var i=JSON.parse(r),o={status:i.status,text:i.text,isVisible:i.visible};setImmediate((function(){n._dispatchEvent("speechToTextResponse",{code:t,messageUId:e,sttInfo:o})}))},[2,(r=no(this.logger,!0,"speechToText",e,t))===ce.SUCCESS?Kr():Xr(r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return[2,(r=no(this.logger,!0,"updateSpeechToTextVisible",e,t))===ce.SUCCESS?Kr():Xr(r)]}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"setPushSetting");return t.invoke(ei,e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e;return tt(this,(function(t){return e=no(this.logger,!0,"getPushSetting",ei),[2,Kr(e)]}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"setPushSetting");return t.invoke(ti,e?"1":"0",(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e;return tt(this,(function(t){return e=no(this.logger,!0,"getPushSetting",ti),[2,Kr("1"===e)]}))}))}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return et(this,void 0,void 0,(function(){var i,o,a;return tt(this,(function(s){return i=no(this.logger,!0,"getPushSetting",ei)||"zh",o=uo.create(this.logger,"translateMessages"),a=e.map((function(e){return{messageRecognitionIdentifier:{messageUid:e.identifier,customText:0===n?"":e.content,inputSource:n},sourceLanguage:e.sourceLanguage,targetLanguage:e.targetLanguage||i}})),[2,o.invoke(a,{forceRetranslate:r,translationServiceType:t},(function(e){e!==ce.SUCCESS?o.fail(e):o.ok()})).result()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.stringify(e.messageContent),r=uo.create(this.logger,"editMessage",this.logger.createTraceId());return r.asyncInvoke((function(){return r.ok()}),(function(e){return r.fail(e)}),e.messageUId,t).result()}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this,o=uo.create(this.logger,"getQuotingMessageByUId");return o.asyncInvoke(t.conversationType,t.targetId,t.channelId||"",e,(function(e){o.fail(e)}),(function(e){o.ok(),setTimeout((function(){return ot(i,lo,"m",Ko).call(i,e,n)}),0)}),(function(e){o.ok(),setTimeout((function(){return ot(i,lo,"m",Ko).call(i,e,r)}),0)})).result()}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){var e;return tt(this,(function(t){return[2,(e=no(this.logger,!0,"getRemoteConversations"))===ce.SUCCESS?Kr():Xr(e)]}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=uo.create(this.logger,"sendUGOperateStatus",this.logger.createTraceId());return t.asyncInvoke(e.targetId,0,e.channelId,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i,o=this;return tt(this,(function(a){return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=no(this.logger,!1,"getUGConversationListForAllChannel"),i=JSON.parse(n).list.map((function(e){var t=e.obj,r=JSON.parse(t);return ot(o,lo,"m",Io).call(o,r)})).filter((function(e){return!("string"==typeof t&&t!==e.targetId||"number"==typeof r&&r!==e.channelType)})).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})),[2,Kr(i)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o,a=this;return tt(this,(function(s){switch(s.label){case 0:return r=uo.create(this.logger,"getRemoteMessageByUids",this.logger.createTraceId()),n=e.targetId,i=e.conversationType,o=e.channelId,[4,r.asyncInvoke(n,i,t.map((function(e){return{messageUId:e,channelId:o||"",sentTime:0}})),(function(e){return r.ok(e)}),(function(e){return r.fail(e)})).result()];case 1:return[2,s.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return ot(a,lo,"m",vo).call(a,r)}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i,o;return tt(this,(function(a){switch(a.label){case 0:return t=uo.create(this.logger,"getUltraGroupUnreadMentionedDigest",this.logger.createTraceId()),r=e.targetId,n=e.channelId,i=e.sentTime,o=e.count,[4,t.asyncInvoke(r,n||"",i,o,(function(e){return t.ok(e)}),(function(e){return t.fail(e)})).result()];case 1:return[2,a.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return{messageUId:r.msgUId,messageType:r.objectName,sentTime:r.sentTime,mentionedType:r.isMentionedAll?ct.ALL:ct.SINGAL}}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){return tt(this,(function(r){return no(this.logger,!1,"clearUGMessageByTimestamp",e,t,!1),[2,Kr()]}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"updateUGMessageExpansion",this.logger.createTraceId());return n.asyncInvoke(e.targetId,t.mid,r,JSON.stringify(t),e.channelId,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=uo.create(this.logger,"setDefaultBlockPushLevel",this.logger.createTraceId());return n.asyncInvoke(e,r||"",ze.ULTRA_GROUP,t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=uo.create(this.logger,"getDefaultBlockPushLevel",this.logger.createTraceId());return r.asyncInvoke(e,t||"",ze.ULTRA_GROUP,(function(e){return r.ok(e)}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return et(this,void 0,void 0,(function(){var n,i;return tt(this,(function(o){return t.length>0?(n=no(this.logger,!0,r?"getUltraGroupUnreadMentionedCount":"getUltraGroupUnreadCount",e,t),[2,Kr(n)]):(i=no(this.logger,!0,r?"getUGMentionCount":"getUGUnreadCount",e),[2,Kr(i)])}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r;return tt(this,(function(n){return t=no(this.logger,!1,"getInfoForConversations",e),r=JSON.parse(t).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.targetId,i=r.conversationType,o=r.channelId,a=r.unreadCount;return{targetId:n,conversationType:i,channelId:o,unreadCount:a,mentionedCount:r.mentionCount,mentionedMeCount:r.mentionMeCount,notificationLevel:r.blockStatus,type:ze.ULTRA_GROUP,unreadMessageCount:a}})),[2,Kr(r)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return(t=ot(this,lo,"m",jo).call(this,e))?[2,Kr({sentTime:t.sentTime,messageType:t.messageType,messageUId:t.messageUId})]:[2,Xr(ce.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return et(this,void 0,void 0,(function(){return tt(this,(function(e){return[2,ot(this,lo,"m",Xo).call(this,[{conversationType:ze.ULTRA_GROUP,channelIdValid:!1}])]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n=this;return tt(this,(function(i){return t=bt(e?ft:lt),r=t.map((function(e){return{conversationType:e,channelId:e===ze.ULTRA_GROUP?ot(n,lo,"m",Mo).call(n,""):"",channelIdValid:e===ze.ULTRA_GROUP}})),[2,ot(this,lo,"m",Xo).call(this,r).trans((function(e){return e.reverse()}))]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){return tt(this,(function(t){switch(t.label){case 0:return[4,ot(this,lo,"m",Qo).call(this,[Pt.ONLINE_STATUS,Pt.FRIEND_ONLINE_STATUS],e)];case 1:return[2,t.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t,r=e.obj,n=JSON.parse(r),i=n.userId,o=n.details,a=(void 0===o?[]:o).map((function(e){var t=JSON.parse(e),r=t.changeTime,n=t.changeValue;return{platform:t.platform,isOnline:!!n,updateTime:r}})),s=a.some((function(e){return e.isOnline}));return t={userId:i,isOnline:s,details:a},[St.iOS,St.Android,St.Web,St.PC,St.Mini,St.HarmonyOS].forEach((function(e){t.details.some((function(t){return t.platform===e}))||t.details.push({platform:e,isOnline:!1,updateTime:0})})),t}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return[2,(r=no(this.logger,!1,"saveEditedMessageDraft",na(t),e.messageUId,e.content))===ce.SUCCESS?Kr():Xr(r)]}))}))}}),Object.defineProperty(e.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t,r,n,i,o;return tt(this,(function(a){return t=no(this.logger,!1,"getConversationMetadata",na(e)),(r=t.find((function(e){return"edited_message_draft"===e.key})))?(n=JSON.parse(r.value),i=n.msg_uid,o=n.content,[2,Kr({messageUId:i,content:o})]):[2,Kr(null)]}))}))}}),Object.defineProperty(e.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return et(this,void 0,void 0,(function(){var t;return tt(this,(function(r){return[2,(t=no(this.logger,!1,"removeConversationMetadata",na(e),["edited_message_draft"]))===ce.SUCCESS?Kr():Xr(t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return et(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l=this;return tt(this,(function(d){return t=e.timestamp,r=e.count,n=e.conversationTypes,i=n.map((function(e){return{conversationType:e,channelId:e===ze.ULTRA_GROUP?"RCDefault":"",channelIdValid:e===ze.ULTRA_GROUP}})),o=no(this.logger,!1,"getUnreadMentionMeConversationsByPageWithTopPriority",i,t,r,!!e.topPriority),a=JSON.parse(o),s=a.code,u=a.list,s!==ce.SUCCESS?[2,Xr(s)]:(c=u.map((function(e){return l._buildConversation(e.obj)})),[2,Kr(c)])}))}))}}),e}();lo=new WeakSet,fo=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})),r=[],n=[],i=[];t.forEach((function(e){var t=e.changeTime,o=e.changeType,a=e.channelId,s=e.channelType,u=e.targetId,c=e.userId;switch(o){case Ot.CHANNEL_DELETE:n.push({targetId:u,channelId:a,channelType:s,deleteTime:t});break;case Ot.PUBLIC_TO_PRIVATE:r.push({targetId:u,channelId:a,changeType:vt.PUBLIC_TO_PRIVATE,channelType:Rt.PRIVATE});break;case Ot.PRIVATE_TO_PUBLIC:r.push({targetId:u,channelId:a,changeType:vt.PRIVATE_TO_PUBLIC,channelType:Rt.PUBLIC});break;case Ot.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:break;case Ot.CHANNEL_USER_KICKED:i.push({targetId:u,channelId:a,userId:c,channelType:s});break;case Ot.PUBLIC_TO_PRIVATE_USER_NOT_IN:r.push({targetId:u,channelId:a,changeType:vt.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:s})}})),r.length>0&&this._dispatchEvent("ultraGroupChannelChangeType",r),n.length>0&&this._dispatchEvent("ultraGroupChannelDelete",n),i.length>0&&this._dispatchEvent("ultraGroupChannelUserKicked",i)},_o=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})),r=[],n=[],i=[],o=[],a=[],s=ze.ULTRA_GROUP;t.forEach((function(e){var t=e.targetId,u=e.userGroupId,c=e.eventType,l=e.channelId,d=e.channelType;switch(c){case Tt.REMOVE_USER_GROUP:r.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case Tt.JOIN_USER_GROUP:n.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case Tt.EXIT_USER_GROUP:i.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case Tt.CHANNEL_BIND_USER_GROUP:o.push({conversation:{conversationType:s,targetId:t,channelId:l},channelType:d,userGroupIds:u});break;case Tt.CHANNEL_UNBIND_USER_GROUP:a.push({conversation:{conversationType:s,targetId:t,channelId:l},channelType:d,userGroupIds:u})}}));var u={};r.length>0&&(u.userGroupDisband=r),n.length>0&&(u.userAdded=n),i.length>0&&(u.userRemoved=i),o.length>0&&(u.userGroupBindChannel=o),a.length>0&&(u.userGroupUnBindChannel=a),this._dispatchEvent("userGroupStatus",u)},po=function(e,t,r){return et(this,void 0,void 0,(function(){var n,i;return tt(this,(function(o){switch(o.label){case 0:return[4,this.getConversation({conversationType:ze.ULTRA_GROUP,targetId:e,channelId:t})];case 1:return n=o.sent(),i=n.data,this._dispatchEvent("conversation",[{conversation:i,updatedItems:{unreadMessageCount:{val:i.unreadMessageCount,time:r}}}]),[2]}}))}))},Eo=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.channelId,i=r.operateTime;return{channelId:n,operationType:r.operateType,operationTime:i,targetId:r.targetId,userId:r.userId}}));this._dispatchEvent("operateStatus",{conversationType:ze.ULTRA_GROUP,info:t,hasInfo:!0,hasSummary:!1,summary:[]})},ho=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return{targetId:r.targetId,channelId:r.channelId,count:r.userNum,operationType:r.operateType}}));this._dispatchEvent("operateStatus",{conversationType:ze.ULTRA_GROUP,info:[],hasInfo:!1,hasSummary:!0,summary:t})},go=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var r=e.obj;return t._buildMessage(r)}));this._dispatchEvent("ultraGroupMessageExpansionUpdated",r)},bo=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var r=e.obj;return t._buildMessage(r)}));this._dispatchEvent("messagesModified",r)},Ro=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.channelId,i=r.conversationType,o=r.isAdmin,a=r.isDel;r.mentionType;var s=r.msgUId,u=r.operatorId,c=r.sentTime,l=r.targetId;return{targetId:l,conversationType:i,sentTime:c,messageUId:s,senderUserId:u,channelId:n,content:{conversationType:i,targetId:l,channelId:n,isAdmin:o,isDelete:a,sentTime:c,messageUId:s},messageDirection:1,messageType:Yt,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:sr.UNREAD,receivedStatusInfo:Lr(sr.UNREAD)}}));r.length>0&&(r.slice().forEach((function(e){return ot(t,lo,"m",yo).call(t,e)})),this._dispatchEvent("ultraGroupMessageRecalled",r))},vo=function(e,t){var r=e.channelId,n=e.senderUserId,i=e.content,o=e.objectName,a=e.direction,s=e.status,u=e.messageId,c=e.sentTime,l=e.readReceiptRequest,d=e.supportExt,f=e.pushContent,_=e.pushTitle,p=e.pushId,E=e.pushConfig,h=e.templateId,g=e.disableTitle,b=e.forcePushDetail,R=e.hasMore,v=e.directedUsers,I=e.noNotification,O=e.disableUpdateLastMessage,T=e.needReceipt,N=e.sendReceipt,m=e.contentRecognition,C=e.convertExt,y=e.editTime,S=e.editContent,P=e.editStatus,A=e.quotedMsgStatus,L=e.hasChanged,M=e.conversationType,U=e.targetId,D=e.messageUid,w=this._parseMessageJsonContent(i,u),j=!!w.mentionedInfo;if(o===Yt&&n===this.tcpMgr.getCurrentUserId()&&(M=w.conversationType,U=w.targetId,D=w.messageUId),C){var V=JSON.parse(C);if(V.trans){var G=V.trans,k={targetLanguage:G.targetLanguage,translatedText:G.translatedText,status:G.translateStatus};w.translateInfo=k}}if(o===Ht||o===Bt){var F=m?JSON.parse(m):{status:Rr,text:"",visible:!1},H={status:F.status,text:F.text,isVisible:F.visible};w.sttInfo=H}var B,J=Kn(o),x=this._buildSupportExt(d,e),W=void 0===(B=t)||"[object Undefined]"===Object.prototype.toString.call(B)?c<this.tcpMgr.getConnectedTime():t,Y={};E&&(Y=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,d,f,_,p,E,h=Object.keys(e);if(0!==h.length){var g=h[0];switch(g){case"HW":return n.channelIdHW=null===(t=e[g])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[g])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(a=e[g])||void 0===a?void 0:a.image,void(n.categoryHW=null===(s=e[g])||void 0===s?void 0:s.category);case"MI":return void(n.channelIdMi=null===(u=e[g])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(c=e[g])||void 0===c?void 0:c.channelId);case"VIVO":return n.typeVivo=null===(l=e[g])||void 0===l?void 0:l.classification,void(n.categoryVivo=null===(d=e[g])||void 0===d?void 0:d.category);case"APNS":return r.threadId=e[g]["thread-id"],r.apnsCollapseId=e[g]["apns-collapse-id"],r.category=e[g].category,r.richMediaUri=e[g].richMediaUri,void(r.interruptionLevel=e[g]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[g].collapse_key||"",imageUrl:e[g].imageUrl||"",priority:e[g].priority||""});case"HONOR":return n.importanceHonor=null===(f=e[g])||void 0===f?void 0:f.importance,void(n.imageUrlHonor=null===(_=e[g])||void 0===_?void 0:_.image);case"OHOS":i.category=null===(p=e[g])||void 0===p?void 0:p.category,i.image=null===(E=e[g])||void 0===E?void 0:E.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}}(E,p));var K=$e($e({},Y),{pushTitle:_,pushContent:f,pushData:f,disablePushTitle:g,forceShowDetailContent:b,templateId:h}),X={channelId:r,conversationType:M,targetId:U,senderUserId:n,content:w||{},messageType:o,messageUId:D||"",messageDirection:a,isOffLineMessage:W,sentTime:c,receivedTime:0,isPersited:J.isPersited,isCounted:J.isCounted,isMentioned:j,disableNotification:I,isStatusMessage:Kn(o).isStatusMessage||!1,canIncludeExpansion:d,expansion:d?x:null,receivedStatus:0,receivedStatusInfo:void 0,sentStatus:void 0,messageId:u,pushConfig:K,hasMore:R,directedUserIds:v||[],disableUpdateLastMessage:O,needReceipt:T,sendReceipt:N};if(a===wt.RECEIVE?(X.receivedStatus=s,X.receivedStatusInfo=Lr(s)):X.sentStatus=s,l){var Q=this._handleReadReceiptRequest(l);X.readReceiptInfo=Q}return M===ze.ULTRA_GROUP?X.isModifyMessage=!!L:(X.isModifyMessage=!(!y&&!P),X.isModifyMessage&&(X.modifyInfo={timestamp:y,content:S?JSON.parse(S):{},status:P})),o===Wt&&(X.content.referMsgStatus=A),X},Io=function(e){var t=e.channelId,r=e.conversationType,n=e.targetId,i=e.lastestMsg,o=e.isTop,a=e.blockStatus,s=e.matchCount,u=e.hasUnreadMention,c=e.unreadCount,l=e.mentionCount,d=e.mentionMeCount,f=e.conversationTime,_=e.draft,p=e.translateStrategy,E=e.channelType,h=e.metadata,g=-1===JSON.parse(i).messageId?null:this._buildMessage(i),b=h?JSON.parse(h):{},R=b.edited_message_draft?JSON.parse(b.edited_message_draft):void 0;return{channelId:t,conversationType:r,targetId:n,channelType:E,unreadMessageCount:c,unreadMentionedCount:l,unreadMentionedMeCount:d,hasMentioned:u,latestMessage:g,notificationStatus:hr(a),isTop:o,lastUnreadTime:0,matchCount:s,operationTime:f,notificationLevel:a,draft:_,translateStrategy:p,editedMessageDraft:R?{messageUId:R.msg_uid,content:R.content}:void 0}},Oo=function(e){var t=this;try{var r=JSON.parse(e).list.map((function(e){return t._buildConversation(e.obj)}));return Kr(r)}catch(e){return Xr(ce.MAIN_PROCESS_ERROR,"parse conversation list result error")}},To=function(e){var t,r=e.messageType,n=e.targetId;if(r===rr){var i=function(e){var t={},r=[],n=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:n,userList:r}}(e);return this._sendChatroomEvents({userChange:i}),!1}if(r===nr){var o=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return this._sendChatroomEvents({chatroomNotifyMultiLoginSync:o}),!1}if(r===ir){var a=function(e){var t=e.content;return{chatroomId:t.chatroomId,operateType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return a.operateType===ue.Blocked&&(null===(t=null==a?void 0:a.userIdList)||void 0===t?void 0:t.includes(this.tcpMgr.getCurrentUserId()))&&this._chatroomCache.delete(n),this._sendChatroomEvents({chatroomNotifyBlock:a}),!1}if(r===or){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return this._sendChatroomEvents({chatroomNotifyBan:s}),!1}return!0},No=function(e){var t=JSON.parse(e),r=ot(this,lo,"m",vo).call(this,t,!1),n=r.messageType,i=r.conversationType;if(n!==Yt||i!==ze.ULTRA_GROUP){if(this._lowPriorityMessageHandler.isLowPriorityMessage(n)){var o=this.tcpMgr.getCurrentUserId();return this._lowPriorityMessageHandler.push(r,o),void this._handleLowPriorityMessages(o,this.tcpMgr.getConnectedTime())}this._handleHighPriorityMessages([r],!1)}},mo=function(e,t){var r=this,n=this.tcpMgr.getConnectedTime(),i=this.tcpMgr.getCurrentUserId(),o=[],a=[];JSON.parse(e).list.forEach((function(e){var t=JSON.parse(e.obj),s=t.sentTime<n,u=ot(r,lo,"m",vo).call(r,t,s),c=u.messageType;r._lowPriorityMessageHandler.isLowPriorityMessage(c)?r._lowPriorityMessageHandler.push(u,i):s?o.push(u):a.push(u)})),o.length>0&&this._handleHighPriorityMessages(o,!!t);var s=!1;(!t||a.length>0)&&!this._pullOfflineMessageFinished&&(s=this._pullOfflineMessageFinished=!0),a.length>0&&this._handleHighPriorityMessages(a,!!t),(this._pullOfflineMessageFinished||this._lowPriorityMessageHandler.count>=1e4)&&this._handleLowPriorityMessages(i,n),s&&this._sendPullOfflineFinished()},Co=function(e){0!==e.length&&no(this.logger,!1,"setExtraMessageInBatches",e)},yo=function(e){var t,r=e.content,n=r.messageUId,i=r.sentTime,o=r.isAdmin,a=r.isDelete;if("number"!=typeof i||"string"!=typeof n||!n.length)return this.logger.warn(Zn.L_DISCARD_MSG_O,JSON.stringify({messageUId:e.messageUId,messageType:e.messageType})),!1;var s=ot(this,lo,"m",Bo).call(this,n);if(!s.isOk)return!1;var u=s.data;if(a)return ot(this,lo,"m",ko).call(this,[u.messageId]),!0;if(u.messageType===Kt)return!1;(null===(t=u.receivedStatusInfo)||void 0===t?void 0:t.isRead)||this.setMessageReceivedStatus(u.messageId,1);var c={operatorId:e.senderUserId,recallTime:u.sentTime,originalObjectName:u.messageType,originalMessageContent:u.content,recallActionTime:e.sentTime,admin:!!o,delete:!!a,isDelete:!!a};return e.content.user&&(c.user=e.content.user),e.content.extra&&(c.extra=e.content.extra),u.messageType===Ft&&(c.recallContent=u.content.content),ot(this,lo,"m",Jo).call(this,u.messageId,JSON.stringify(c),Kt),!0},So=function(e,t){var r=this,n=t.timestamp,i=t.count,o=t.order,a=t.messageType,s=e.conversationType,u=e.targetId,c=e.channelId,l=no(this.logger,!1,"getHistoryMessages",s,u,n,i+1,a,0===o,c||""),d=JSON.parse(l).list.map((function(e){var t=e.obj;return r._buildMessage(t)})).reverse();return{list:i===d.length-1?d.slice(1):d,hasMore:i<d.length}},Po=function(e,t){return et(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return tt(this,(function(l){switch(l.label){case 0:return r=t.timestamp,n=t.count,i=t.order,o=e.conversationType,a=e.targetId,s=e.channelId,[4,(u=uo.create(this.logger,"getRemoteHistoryMessages",this.logger.createTraceId())).asyncInvoke(o,a,r,n,(function(e,t){return u.ok({listJson:e,hasMore:t})}),(function(e){return u.fail(e)}),i,!0,s||"",!0).result()];case 1:return[2,l.sent().trans((function(e){var t=e.listJson,r=e.hasMore,n=JSON.parse(t).list.map((function(e){var t=e.obj;return c._buildMessage(t)}));return{list:n,hasMore:!!r}}))]}}))}))},Ao=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;no(this.logger,!1,"clearMessages",t,r,n||"")},Lo=function(e,t,r){no(this.logger,!1,"deleteChatroomMessageAndKV",e,t,r)},Mo=function(e){var t;return!!(2&((null===(t=this.getNaviInfoFromCache())||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e||""},Uo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=no(this.logger,!0,"getConversation",t,r,n||"");return i?this._buildConversation(i):null},Do=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return no(this.logger,!0,"getUnreadCount",t,r,n||"")},wo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return no(this.logger,!1,"clearUnreadCount",t,r,n||"")},jo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=no(this.logger,!0,"getTheFirstUnreadMessage",t,r,n||""),o=this._buildMessage(i);return-1!==o.messageId?o:null},Vo=function(e,t,r,n,i,o){var a=this.logger.createTraceId(),s=uo.create(this.logger,"updateConversationStatus",a),u=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,translate_strategy_op:n,top_op:r,create_conversation:!!o,update_time:!!i}})));return s.invoke(u,(function(){return s.ok()}),(function(e){return s.fail(e)})).result()},Go=function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId,o=t.content,a=t.senderUserId,s=t.messageType,u=t.messageDirection,c=t.readStatus,l=t.sentStatus,d=t.sentTime,f=t.searchContent,_=t.isUnread,p=t.messageUId,E=t.disableNotification,h=t.canIncludeExpansion,g=t.expansion,b=t.directedUserIds,R=t.disableUpdateLastMessage,v=d||0,I={};if(g)for(var O in g)I[O]={v:g[O],ts:v};var T=function(){},N=no(this.logger,!0,"insertMessage",r,n,a,s,JSON.stringify(o),T,T,u,c||1,l||30,v,f||"",_?0:1,p||"",!!E,!!h,JSON.stringify(I),i||"",b||[],!!R),m=this._buildMessage(N,!1);return m.messageUId=p,m.sentTime=d,m},ko=function(e){no(this.logger,!1,"deleteMessages",e)},Fo=function(e,t,r){no(this.logger,!1,"deleteMessagesByTimestamp",e.conversationType,e.targetId,t,r,e.channelId||"")},Ho=function(e){var t=no(this.logger,!0,"getMessage",e),r=JSON.parse(t);return r.messageId<=0?Xr(ce.RC_DB_DATA_NOT_FOUND,"msg not found: ".concat(e)):Kr(r)},Bo=function(e){var t=this;return ot(this,lo,"m",Ho).call(this,e).trans((function(e){return ot(t,lo,"m",vo).call(t,e,!1)}))},Jo=function(e,t,r){return no(this.logger,!1,"setMessageContent",e,t,r)},xo=function(e,t){no(this.logger,!1,"setMessageReceivedStatus",e,t)},Wo=function(e){var t=this,r=e.map((function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return{targetId:r,channelId:void 0===n?"":n,type:t}})),n=no(this.logger,!0,"getConversations",JSON.stringify(r));return JSON.parse(n).list.map((function(e){return t._buildConversation(e.obj)}))},Yo=function(e){var t=this,r=[];return e&&e.length>0&&(r=e.map((function(e){var r=JSON.parse(e.obj);return{messageUId:r.msg_uid,message:r.msg?t._buildMessage(r.msg):void 0,code:r.code}}))),r},Ko=function(e,t){try{var r=JSON.parse(e).list;t(ot(this,lo,"m",Yo).call(this,r))}catch(t){this.logger.error(Zn.P_PARSE_JSON_MSGS_E,e)}},Xo=function(e){var t=no(this.logger,!1,"getBlockedConversations",e);return ot(this,lo,"m",Oo).call(this,t)},Qo=function(e,t){return et(this,void 0,void 0,(function(){var r;return tt(this,(function(n){return[2,(r=uo.create(this.logger,"getSubscribeStatusByUserIds",this.logger.createTraceId())).invoke(e,t,(function(e,t){e!==ce.SUCCESS?r.fail(e):r.ok(t)})).result()]}))}))};var oa,aa=function(){function e(e,t,r,n,i,o,a,s){Object.defineProperty(this,"sendCallback",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_cppService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._cppService=new ia(e,t,i,n,r,a,s)}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 et(this,void 0,void 0,(function(){var r,n,i,o,a=this;return tt(this,(function(s){switch(s.label){case 0:return"sendMessage"===e&&(r=t[4],t[4]=function(e){a.sendCallback({reqId:r,data:e})}),"refreshReferenceMessageWithParams"===e&&(n=t[2],i=t[3],t[2]=function(e){a.sendCallback({reqId:n,data:e})},t[3]=function(e){a.sendCallback({reqId:i,data:e})}),[4,(o=this._cppService).callProxy.apply(o,it([e],nt(t),!1))];case 1:return[2,{success:!0,data:s.sent()}]}}))}))}}),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];(t=this._cppService).sendProxy.apply(t,it([e],nt(r),!1))}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._cppService.destroy()}}),e}(),sa=function(){function r(r,n,i,o,a,s){var u=this;void 0===a&&(a=!1),void 0===s&&(s=!1),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_dbpath",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logOutputLevel",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_enableSyncEmptyTopConversation",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_eventLoopBlockingCheck",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_cppServiceProcessProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_catch",{enumerable:!0,configurable:!0,writable:!0,value:{crtUserId:"",connectedTime:0,naviInfo:null,connectionStatus:2,deviceId:"",deltaTime:0}}),Object.defineProperty(this,"_rendererInitOptions",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_senders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_callbackCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._createServiceProxy(),e.on("__RC_CHANNEL_CALL_MAIN_SYNC__",(function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return et(u,void 0,void 0,(function(){var n,i;return tt(this,(function(o){switch(o.label){case 0:return[4,(i=this._cppServiceProcessProxy).call.apply(i,it([t],nt(r),!1))];case 1:return n=o.sent(),e.returnValue=n.data,[2]}}))}))})),e.on("__RC_CHANNEL_CALL_MAIN__",(function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return et(u,void 0,void 0,(function(){var i,o,a,s,u;return tt(this,(function(c){switch(c.label){case 0:return"sendMessage"===r&&(i=n[4],this._callbackCache[i]=e.sender),"refreshReferenceMessageWithParams"===r&&(o=n[2],a=n[3],this._callbackCache[a]=e.sender,this._callbackCache[o]=e.sender),[4,(u=this._cppServiceProcessProxy).call.apply(u,it([r],nt(n),!1))];case 1:if(!(s=c.sent()).success)throw new Error(s.data.msg);return this._send2Renderer(e.sender,"__RC_CHANNEL_RESULT_FROM_MAIN__",t,s.data),[2]}}))}))})),e.on("__RC_CHANNEL_SEND_2_MAIN__",(function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];"registerMessageType"===t&&Yn(n[0],n[1]),(r=u._cppServiceProcessProxy).send.apply(r,it([t],nt(n),!1))})),e.on("__RC_INNER_COMMAND_INIT__",this._registerRenderers.bind(this)),t.on("before-quit",(function(){return u.destroy()})),t.on("window-all-closed",(function(){return u.destroy()}))}return Object.defineProperty(r.prototype,"_send2Renderer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];e.isDestroyed()?delete this._senders[e.id]:e.send.apply(e,it([t],nt(r),!1))}}),Object.defineProperty(r.prototype,"_send2AllRenderer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];Object.keys(this._senders).forEach((function(n){var i=t._senders[n];t._send2Renderer.apply(t,it([i,"__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",e],nt(r),!1))}))}}),Object.defineProperty(r.prototype,"_registerRenderers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.sender,i=n.id;this._rendererInitOptions||(this._rendererInitOptions=t),this._cppServiceProcessProxy.send("registerRenderers",t),this._senders[i]||(this._senders[i]=n,n.once("destroyed",(function(){delete r._senders[i]})))}}),Object.defineProperty(r.prototype,"getMainCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._catch}}),Object.defineProperty(r.prototype,"_callbackHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.reqId,r=e.data;this._callbackCache[t]&&this._send2Renderer(this._callbackCache[t],"__RC_CHANNEL_RESULT_FROM_MAIN__",t,r)}}),Object.defineProperty(r.prototype,"_createServiceProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._dbpath||n(t.getPath("userData"));this._cppServiceProcessProxy=new aa(this._appkey,e,this._logOutputLevel,this._enableSyncEmptyTopConversation,this._send2AllRenderer.bind(this),this._callbackHandler.bind(this),this._disableLogReport,this._eventLoopBlockingCheck)}}),Object.defineProperty(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._cppServiceProcessProxy.destroy()}}),Object.defineProperty(r.prototype,"setDataBaseLogConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._cppServiceProcessProxy.call("setDataBaseLogConfig",e)}}),r}(),ua=function(){function e(e,t,r,n,i,o){Object.defineProperty(this,"_rcMain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rcMain=new sa(e,t,r,n,i,o)}return Object.defineProperty(e.prototype,"getCppProto",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return{destroy:function(){console.warn("`.getCppProto().destroy()` has being deprecated, use `.destroy()` instead."),e.destroy()}}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._rcMain.destroy()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._rcMain.getMainCache().deviceId}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._rcMain.getMainCache().connectedTime}}),Object.defineProperty(e.prototype,"setDatabaseOperationTimeThreshold",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._rcMain.setDataBaseLogConfig(e)}}),e}(),ca=function(e){return function(e){if(oa)return oa;if(!e.appkey)throw new Error("Initializ failed, `appkey` is required!");return oa=new ua(e.appkey,(null==e?void 0:e.dbpath)||"",(null==e?void 0:e.logOutputLevel)||In.WARN,!!(null==e?void 0:e.enableSyncEmptyTopConversation),(null==e?void 0:e.disableLogReport)||!1,(null==e?void 0:e.eventLoopBlockingCheck)||!1)}(e)};export{ca as default};