@rongcloud/electron 5.42.1 → 5.44.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("path"),t=require("electron"),r=require("os"),n=require("child_process"),i=(require("module"),require("crypto")),o=require("fs"),a=require("url"),s=require("http"),u=require("https"),c=require("zlib"),l=require("net"),d=require("events"),f=require("tls");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=_(c),E=function(e,t){return E=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])},E(e,t)};
1
+ "use strict";var e=require("path"),t=require("electron"),s=require("os"),r=require("child_process"),i=(require("module"),require("crypto")),n=require("fs"),o=require("url"),a=require("http"),c=require("https"),_=require("zlib"),l=require("net"),d=require("events"),E=require("tls");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R,h=u(_);
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function h(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}E(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var g,b=function(){return b=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},b.apply(this,arguments)};function R(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 v(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 I(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 O(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 T(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 N(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 m(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(g||(g={}));var C,S,y,A,P,L,M,U,D,w,j,V,G,k,F,H,B,J,x,W,Y,K,X,Q,Z,q,z,$,ee,te,re="L-connect-T",ne="L-connect-R",ie="L-connect-S",oe="L-TEST-O",ae="L-get_navi-T",se="L-get_navi-R",ue="L-request-T",ce="L-request-R",le="L-parse_navi-E",de="L-rejoin_chatroom-T",fe="L-rejoin_chatroom-R",_e="L-check_alive_im-T",pe="L-check_alive_im-R",Ee="L-check_alive_im-S",he="L-report_full_log-O",ge="L-report_full_log-T",be="L-report_full_log-R",Re="L-parse_navi_logpolicy-E",ve="A-remove_proxy-O",Ie="L-set_proxy-O",Oe="L-test_proxy-T",Te="L-test_proxy-R",Ne="L-get_static_conf-T",me="L-get_static_conf-R",Ce="L-get_static_conf-E",Se="L-cloud_disabled",ye="L-cloud_overclock",Ae="L-cloud_appkey_region_error",Pe="L-cloud_config_data_error",Le="L-cloud_set_area_code-O",Me="L-cloud_set_mrtr-O",Ue="L-parse_json-E",De="L-event_loop_blocking-S",we="P-get_sys_version-E",je="L-pull_offline_message_finished-S";!function(e){e[e.BOTH=2]="BOTH"}(C||(C={})),function(e){e[e.BOTH=2]="BOTH"}(S||(S={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(y||(y={})),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"}(A||(A={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(P||(P={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(L||(L={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(M||(M={})),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"}(U||(U={})),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"}(D||(D={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(w||(w={})),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"}(j||(j={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(V||(V={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(G||(G={})),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"}(k||(k={})),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"}(F||(F={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(H||(H={})),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"}(B||(B={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(J||(J={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(x||(x={})),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"}(W||(W={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(Y||(Y={})),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"}(K||(K={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(X||(X={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Q||(Q={})),function(e){e[e.LeaveOnMyOwn=1]="LeaveOnMyOwn",e[e.OtherDeviceLogin=2]="OtherDeviceLogin"}(Z||(Z={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(q||(q={})),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"}(z||(z={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}($||($={})),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.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",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_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",e[e.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",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.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",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.MSG_REACTION_LIMIT_REACHED=26323]="MSG_REACTION_LIMIT_REACHED",e[e.MSG_REACTION_USER_LIMIT_REACHED=26324]="MSG_REACTION_USER_LIMIT_REACHED",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_DECODE_ERROR=32546]="PROTOCOL_DECODE_ERROR",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.METHOD_BUSY=33103]="METHOD_BUSY",e[e.SDK_PULL_CONVERSATION=33302]="SDK_PULL_CONVERSATION",e[e.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",e[e.QUOTE_MSG_NOT_FOUND=33403]="QUOTE_MSG_NOT_FOUND",e[e.INVALID_PARAMETER_QUOTE_INFO=33404]="INVALID_PARAMETER_QUOTE_INFO",e[e.REACTION_ID_INVALID=33405]="REACTION_ID_INVALID",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_REQUEST_URL=34208]="INVALID_PARAMETER_REQUEST_URL",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_NOTMEDIAMESSAGE=34223]="INVALID_PARAMETER_NOTMEDIAMESSAGE",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.INVALID_PARAMETER_PAGE_TOKEN=34346]="INVALID_PARAMETER_PAGE_TOKEN",e[e.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN=34435]="SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN",e[e.SERVER_RECORD_UNREAD_COUNT_DISABLED=34436]="SERVER_RECORD_UNREAD_COUNT_DISABLED",e[e.DATABASEDISKFULL=34439]="DATABASEDISKFULL",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_ERROR=35053]="DNS_PROXY_DATA_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.MSG_BLOCK_SEND=35066]="MSG_BLOCK_SEND",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"}(ee||(ee={})),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"}(te||(te={}));var Ve,Ge,ke,Fe=0,He=1,Be=2,Je=3,xe=4,We=5,Ye=6,Ke=7,Xe=function(e){var t=[te.PRIVATE,te.GROUP,te.SYSTEM,te.PUBLIC_SERVICE,te.APP_PUBLIC_SERVICE];switch(e){case Fe:return t;case He:return[te.PRIVATE,te.GROUP];case Be:return T(T([],O(t),!1),[te.ULTRA_GROUP],!1);case Je:return T(T([],O(t),!1),[te.ULTRA_GROUP,te.CHATROOM],!1);case xe:return T(T([],O(t),!1),[te.ULTRA_GROUP,te.CHATROOM,te.RTC_ROOM,te.CUSTOMER_SERVICE,te.DISCUSSION],!1);case We:return[te.PRIVATE,te.GROUP,te.ULTRA_GROUP];case Ye:return[te.GROUP];case Ke:return[te.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"}(Ve||(Ve={})),function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(Ge||(Ge={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(ke||(ke={}));var Qe,Ze,qe,ze,$e,et,tt,rt,nt,it,ot,at,st,ut,ct,lt,dt,ft,_t,pt,Et,ht="RC:TxtMsg",gt="RC:VcMsg",bt="RC:HQVCMsg",Rt="RC:LogCmdMsg",vt="RC:MsgExMsg",It="RC:ReferenceMsg",Ot="RC:RcCmd",Tt="RC:RcNtf",Nt="RC:ReadNtf",mt="RC:RRReqMsg",Ct="RC:RRRspMsg",St="RC:SRSMsg",yt="RC:RRMsg",At="RC:RSMsg",Pt="RC:Delivered",Lt="RC:DRMsg",Mt="RC:ChrmMemChange",Ut="RC:ChrmSyncMsg",Dt="RC:ChrmBlockMsg",wt="RC:ChrmBanMsg",jt="RC:CCConfigChangeRequestMsg";!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(Qe||(Qe={})),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"}(Ze||(Ze={})),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"}(qe||(qe={})),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"}(ze||(ze={})),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"}($e||($e={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(et||(et={})),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"}(tt||(tt={})),function(e){e[e.typing=0]="typing"}(rt||(rt={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(nt||(nt={})),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"}(it||(it={})),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"}(ot||(ot={})),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"}(st||(st={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(ut||(ut={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(ct||(ct={})),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"}(dt||(dt={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(ft||(ft={})),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"}(_t||(_t={})),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"}(pt||(pt={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(Et||(Et={}));var Vt,Gt,kt,Ft,Ht,Bt,Jt,xt,Wt,Yt=function(e){return e<=pt.NOT_SET?Et.CLOSE:Et.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"}(Vt||(Vt={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Gt||(Gt={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(kt||(kt={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Ft||(Ft={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ht||(Ht={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Bt||(Bt={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Jt||(Jt={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(xt||(xt={})),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"}(Wt||(Wt={}));var Kt,Xt,Qt=0,Zt=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"}(Kt||(Kt={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(Xt||(Xt={}));var qt=72e5,zt="5.42.1".replace(/-.+$/,""),$t="rongcloudsystem",er="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{},tr="engine";er[tr]="5.42.1";var rr=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)&&(er[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 er[tr].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 er}}),e}();var nr=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)}))},ir=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),or=Date.now(),ar=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},sr=function(e){return function(e){return"string"==typeof e}(e)&&/https?:\/\//.test(e)},ur=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},cr=function(e){return{isRead:(e&Vt.READ)===Vt.READ,isListened:(e&Vt.LISTENED)===Vt.LISTENED,isDownload:(e&Vt.DOWNLOADED)===Vt.DOWNLOADED,isRetrieved:(e&Vt.RETRIEVED)===Vt.RETRIEVED}},lr=function(e){return[it.iOS,it.Android,it.Web,it.PC,it.Mini,it.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]}))},dr=function(e,t,r){return t?1===r?Ve.TLS:Ve.RMTP:"http"===e?Ve.WS:Ve.WSS},fr=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 T([],O(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:dr(a,t,s),weight:r.length-n,race:!1})})),T([],O(u),!1)},_r=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},pr=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Er=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=nr(),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)},hr=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||ft.NORMAL,image:f||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(p)},gr=function(){var e=rr.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t};function br(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!==Ve.HTTP||n?"https://".concat(e):"http://".concat(e)}var Rr=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(Ue,JSON.stringify({ossConfig:n,error:e}))}return i};var vr,Ir=function(e){function t(t){var r=e.call(this,t)||this;return r.name="RCError",r}return h(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),Or=function(){function e(){vr.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){m(this,vr,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return N(this,vr,"f")},enumerable:!1,configurable:!0}),e}();vr=new WeakMap;var Tr=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 Map})}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=I(this._map),i=n.next();!i.done;i=n.next()){var o=O(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 Or,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,T([i],O(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}T([],O(this._piped.entries()),!1).forEach((function(r){var n=O(r,2),i=n[0],o=n[1];(0===o.length||o.includes(e))&&i.emit.apply(i,T([e],O(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,t){this._piped.set(e,t||[])}}),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}h(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){void 0===t&&(t=!1),-1===this._dataVersion&&(this._dataVersion=e,t&&this._execPulling())}}),Object.defineProperty(t.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling()}}),Object.defineProperty(t.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e,t,r,n,i,o;return v(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=T([],O(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}})}(Tr);var Nr=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,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return new e(0,r||"success",t)}}),Object.defineProperty(e,"fail",{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 R(this,void 0,void 0,(function(){return v(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 R(this,void 0,void 0,(function(){return v(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?mr(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?mr(void 0,this.msg):Cr(this.code,this.msg)}}),e}(),mr=Nr.ok,Cr=Nr.fail;!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?Cr(this._code,this._errmsg):mr()}}),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 Ir.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,Number.MAX_SAFE_INTEGER,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,"isStringEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"isNumberEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isNumber(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),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 Sr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function yr(e){var t,r,n,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=Sr.indexOf(e.charAt(u++))<<2|(i=Sr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=Sr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(a=Sr.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(r)),64!==a&&(s+=String.fromCharCode(n));return s}var Ar,Pr=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Lr=1732584193,Mr=4023233417,Ur=2562383102,Dr=271733878,wr=[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],jr=[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 Vr(e,t){return e<<t|e>>>32-t}function Gr(e,t,r){return e&r|t&~r}function kr(e,t,r){return e^t^r}function Fr(e,t,r){return t^(e|~r)}function Hr(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 Br(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 Jr(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(Br(a),0),o.set(Br(s),4),n.set(o,e.length+r);var u,c=Lr,l=Mr,d=Ur,f=Dr;for(i=0;i<n.length;i+=64){for(var _=Hr(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=Gr(l,d,f),v=(5*b+1)%16):b<48?(R=kr(l,d,f),v=(3*b+5)%16):(R=Fr(l,d,f),v=7*b%16);var I=f;f=d,d=l,l+=Vr(c+R+jr[b]+_[v]&4294967295,wr[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(Br(c),0),O.set(Br(l),4),O.set(Br(d),8),O.set(Br(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(O)}function xr(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 Jr(t)}function Wr(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"}(Ar||(Ar={}));var Yr,Kr,Xr=0,Qr=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",e[e.OM=6]="OM"}(Kr||(Kr={}));var Zr=((Yr={})[Kr.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:Ve.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Yr[Kr.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:Ve.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Yr[Kr.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:Ve.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Yr[Kr.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:Ve.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Yr[Kr.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:Ve.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Yr[Kr.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:Ve.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Yr);function qr(e){return Kr[e]?e:Kr.BJ}var zr,$r=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=Kr.BJ),Zr[qr(r)].naviUrlBase64).map((function(e){return yr(e)})),s=[],u=O(e.split("@"),2)[1];t&&(s=u?u.split(";"):[]);var c=o&&o.length>0?T(T([],O(s),!1),O(o),!1):T(T([],O(s),!1),O(a),!1);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return br(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=Kr.BJ),Zr[qr(r)].logUrlBase64).map((function(e){return b(b({},e),{addr:yr(e.addr)})})),l=[],d={level:1,itv:6,times:5};if(i)l.push.apply(l,T([],O(i.addrs),!1)),Object.assign(d,i.policy);else if(o)try{var f=JSON.parse(o);l.push({addr:f.url,protocol:Ve.HTTPS,weight:1}),d.level=f.level,d.itv=f.itv,d.times=f.times}catch(r){t.warn(Re,JSON.stringify({policy:e.logPolicy}))}var _=u?T([{addr:u,protocol:Ve.HTTPS,weight:101}],O(l),!1):T(T([],O(l),!1),O(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 b(b({},e),{addr:br(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=Kr.BJ),Zr[qr(t)].miniCmpBase64).map((function(e){return yr(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=Kr.BJ),Zr[qr(t)].staticConfigUrlBase64).map((function(e){return yr(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=Kr.BJ),Zr[qr(r)].cloudControllerUrlBase64).map((function(e){return yr(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:Kr.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Kr[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=Kr.BJ),Zr[qr(r)].statsUrlBase64).map((function(e){return yr(e)})),u=[];return 0!==a.length?u.push.apply(u,T([],O(a.sort((function(e,t){return t.weight-e.weight})).map((function(e){return br(e.addr,e.protocol)}))),!1)):o&&u.push(br(o,Ve.HTTPS)),s.forEach((function(e){u.includes(e)||u.push(e)})),u}}),e}(),en=new $r,tn=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 R(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return v(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 br(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=c.sent(),this.logger.error(Ce,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)!==en.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 br(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l;return v(this,(function(d){switch(d.label){case 0:e=(e=T(T([],O(this.staticUrls),!1),O(en.getStaticConfigUrl()),!1).map((function(e){return br(e)}))).filter((function(t,r){return e.indexOf(t)===r})),d.label=1;case 1:d.trys.push([1,6,7,8]),t=I(e),r=t.next(),d.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(Ne,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(me,JSON.stringify({url:n,code:a,duration:Date.now()-i})),[2,s];this.logger.warn(me,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"}(zr||(zr={}));var rn,nn,on=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,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:zr.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,zr.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,zr.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,zr.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,zr.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,zr.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!==zr.DEBUG&&this.proxy.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 ir}}),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<=zr.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[zr.DEBUG,zr.INFO,zr.WARN,zr.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(b(b({isOk:!0},n),a)),r)}else{a=null==o?void 0:o(t.data);this.warn(e,JSON.stringify(b(b({code:t.code,msg:t.msg},n),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),an=function(){function e(e,t,r,n,i){void 0===i&&(i=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:i}),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 R(this,void 0,void 0,(function(){var i,a;return v(this,(function(s){switch(s.label){case 0:i=[],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,o)];case 2:return a=s.sent(),ar(a.logs)&&(i=a.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return s.sent(),[3,4];case 4:return[2,{logs:i}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i;return v(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=en.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 R(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_;return v(this,(function(p){switch(p.label){case 0:return[4,this.compressLogs(e)];case 1:return i=p.sent(),o=i.success,a=i.data,o?(s=sr(r)?r:"https://".concat(r),s+="?version=".concat("5.42.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:s,body:a,method:"POST"})]):[2,{isOk:!1,itv:n}];case 2:if(u=p.sent(),c=u.status,l=u.data,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(Ue,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 R(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p=this;return v(this,(function(E){switch(E.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||or,a=Math.max(i-3e4,o+1),s=this.logger.createTraceId(),[4,this._getLogs(o,a,t,!0,s,n)];case 1:return 0!==(u=E.sent().logs).length?[3,2]:[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,T([],O(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),R(this,void 0,void 0,(function(){var s,u,c,l,d,f,_,p;return v(this,(function(E){switch(E.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(s=this.logger.createTraceId(),this.logger.info(ge,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:a}),s),[4,this._getLogs(e,t,zr.DEBUG,!1,s)]);case 1:return u=E.sent().logs,this.logger.info(he,JSON.stringify({count:u.length}),s),c=sr(n)?n:"https://".concat(n),c+="?version=".concat("5.42.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&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(he,"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(be,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 sn(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 un(){return R(this,void 0,void 0,(function(){return v(this,(function(e){return[2,{logs:[]}]}))}))}function cn(){}var ln=function(){function e(e,t){rn.set(this,void 0),nn.set(this,void 0),m(this,rn,e,"f"),m(this,nn,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return R(this,void 0,void 0,(function(){var o,a;return v(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,N(this,rn,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(sn)}]:[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{N(this,nn,"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&&m(this,rn,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&m(this,nn,e,"f"),this}}),e}();rn=new WeakMap,nn=new WeakMap;var 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){N(this,t,"f",r)||(m(this,t,e,"f",r),e.info(De,"start"),N(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){N(this,t,"f",r)&&(N(this,t,"f",r).info(De,"stop"),m(this,t,null,"f",r),N(this,t,"f",n)&&(clearTimeout(N(this,t,"f",n)),m(this,t,null,"f",n)))}}),t=e,a=function e(){var a=this,s=Date.now();m(this,t,setTimeout((function(){var n=Date.now()-s;n>=N(a,t,"f",o)&&N(a,t,"f",r).warn(De,"delta time: ".concat(n,"ms")),N(a,t,"m",e).call(a)}),N(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}(),fn=1,_n=2,pn=3,En=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 hn,gn,bn,Rn,vn=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 En(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===Rt&&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,ur(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 R(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return v(this,(function(_){switch(_.label){case 0:return!this.isEable&&t===fn&&this.isExire()?(this.logger.info(Se,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===_n&&this.isOverclock()?(this.logger.info(ye,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=br(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.42.1",timestamp:this.timestamp},this.logger.record(_t.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,Xt.POST,o,a)]);case 1:return s=_.sent(),u=s.code,c=s.data,this.logger.record(_t.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),u===ee.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(l=c.targetRegion,this.changeAreaCode===l?[2,this.timestamp]:(d=en.setAreaCode(l),this.logger.info(Le,JSON.stringify({isChangeSuccess:d,originAreaCode:en.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(f=en.getCloudControllerUrl(l))[0]?[2,this.request(f[0],pn)]:(this.logger.info(Ae,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}(),In=function(e){return e===ee.RC_CONN_REDIRECTED},On=function(e){function t(t,r,n){var i=e.call(this)||this;return hn.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:""}),Rn.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:Kt.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:ut.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 h(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===ut.DISCONNECTED&&e===ut.CONNECTING&&(this._doConnectReason=Jt.CONNECT,N(this,hn,"m",bn).call(this)),this._crtConnectionStatus===ut.CONNECTED&&e===ut.SUSPENDED&&(t===ee.RC_PING_EXCEED_LIMIT?this._doConnectReason=Jt.TIMEOUT:t===ee.RC_CONN_REDIRECTED?this._doConnectReason=Jt.REDIRECTED:this._doConnectReason=Jt.RECONNECT),this._crtConnectionStatus===ut.CONNECTED){var r={bid:gr(),cod:t,net:this.getNetwork().type,dur:Date.now()-N(this,Rn,"f"),cid:this.cid};this.logger.record(_t.IM_CONNECTION_DURATION,JSON.stringify(r)),e===ut.SUSPENDED&&N(this,hn,"m",bn).call(this)}switch(this._crtConnectionStatus=e,e){case ut.CONNECTED:this.logger.info(ie,"status: ".concat(e)),this.checkAlive(),N(this,hn,"m",gn).call(this).emit("onConnected",this._fromSuspend);break;case ut.CONNECTING:this.logger.warn(ie,"status: ".concat(e)),N(this,hn,"m",gn).call(this).emit("onConnecting");break;case ut.SUSPENDED:this._fromSuspend=!0,this.logger.warn(ie,"status: ".concat(e,", code: ").concat(t)),In(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),N(this,hn,"m",gn).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(ie,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),N(this,hn,"m",gn).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===ut.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(_t.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 R(this,void 0,void 0,(function(){var i,o,a;return v(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===ut.CONNECTED?[2,mr(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(ut.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==ee.SUCCESS?(this.setConnectionStatus(ut.DISCONNECTED,o),[2,Cr(o)]):(this.setConnectionStatus(ut.CONNECTED),[2,mr(a)])}}))}))}}),Object.defineProperty(t.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return R(this,void 0,void 0,(function(){var o;return v(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 R(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,_,p;return v(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(_t.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!==ee.SUCCESS?[2,Cr(u)]:1===(l=c).type?[2,Cr(ee.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(re,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===ee.SUCCESS||(this.retryCount+=1),In(f)?(this.logger.warn(ne,"redirect code: ".concat(f),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[ee.RC_TCP_RESET,ee.RC_CONN_ACK_TIMEOUT,ee.RC_TCP_DISCONNECTED_NO_RMTP,ee.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(ne,"cpp code:".concat(f,",reture code:").concat(ee.SERVER_UNAVAILABLE),n),[2,Cr(ee.SERVER_UNAVAILABLE)]):(this.logger.warn(ne,"cmp ack timeout, code: ".concat(f),n),this.setConnectionStatus(ut.SUSPENDED,f),this.setConnectionStatus(ut.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):f!==ee.SUCCESS?(this.logger.warn(ne,"code: ".concat(f),n),[2,Cr(f)]):(this.logger.info(ne,"userId: ".concat(_),n),m(this,Rn,Date.now(),"f"),this._crtUserId=_,[2,mr(_)])}}))}))}}),Object.defineProperty(t.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i=this;return v(this,(function(o){return r=this.logger.createTraceId(),this.logger.debug(oe,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return R(i,void 0,void 0,(function(){var i,o,a;return v(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==ut.SUSPENDED?[2]:(this.setConnectionStatus(ut.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(ut.CONNECTED),[2]):[ee.SERVER_UNAVAILABLE,ee.TIMEOUT,ee.RC_SOCKET_DISCONNECTED,ee.RC_SOCKET_NOT_CREATED,ee.RC_CONN_ACK_TIMEOUT,ee.RC_TCP_RESET,ee.RC_NAVI_REQ_FAILED,ee.RC_NETWORK_DOWN,ee.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==ut.CONNECTING||(this.setConnectionStatus(ut.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(ut.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(t.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return In(e)?(this.setConnectionStatus(ut.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===ee.RC_UDP_DISCONNECTED?(this.setConnectionStatus(ut.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(ut.DISCONNECTED,e)}}),Object.defineProperty(t.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(ut.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(t.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e,t,r=this;return v(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==ut.CONNECTED?(this._failedCount=0,this.logger.debug(Ee,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(_e,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===ee.SUCCESS?(this.logger.debug(pe,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==ut.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(pe,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(Ee,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(ut.SUSPENDED,ee.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,ee.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(t.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){return v(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(ut.DISCONNECTED,ee.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 T([],O(this.cmpWeightCache),!1);var r=fr(e,t);return this.cmpWeightCache=T([],O(r),!1),T([],O(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===Ve.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,T([],O(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,T([],O(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}(Tr);Rn=new WeakMap,hn=new WeakSet,gn=function(){return this},bn=function(){this.uuid=nr(),this.retryCount=0};var Tn=function(e){return e.replace(/@.+$/,"@")},Nn=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 R(this,void 0,void 0,(function(){var o;return v(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 R(this,void 0,void 0,(function(){var a,s,u,c,l,d,f,_,p,E,h,g,b,R,I,O,T;return v(this,(function(v){switch(v.label){case 0:return a=Tn(e),s=this.getNaviCache(a),!t&&s&&(u=s.timestamp,c=s.naviInfo,r||Date.now()-u<qt)?(this.logger.info(ue,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(l=i.uuid,d=i.retryCount,f=i.reason,_={bid:gr(),ptc:kt.NAVI,cod:ee.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(o=c.type)&&void 0!==o?o:0,hos:"",cache:Ft.LOCAL,v:Ht.CURRENT,rsn:f,cid:"".concat(l,"_").concat(d),count:d},this.logger.record(_t.IM_NAVI,JSON.stringify(_),n)),[2,mr(c)]):(p=en.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(ae,JSON.stringify({token:e,uris:p}),n),[4,this.requestHandler(p,e,n,i)]);case 1:return E=v.sent(),h=E.code,g=E.data,h===ee.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(b=v.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:I=v.sent(),h=I.code,g=I.data,v.label=4;case 4:return h!==ee.SUCCESS?(this.logger.warn(se,h,n),[2,Cr(h)]):(O=g).code&&200!==O.code?(this.logger.warn(se,O.code,n),[2,Cr(this.transHttpCode(O.code))]):fr(O).length>0?(this.logger.info(se,JSON.stringify({naviInfo:O}),n),this.setNaviCache(a,O),[2,mr(O)]):(T={server:O.server,backupServer:O.backupServer,serverAddr:O.serverAddr,bs:O.bs},this.logger.warn(se,"navi server address invalid: ".concat(JSON.stringify(T)),n),[2,Cr(ee.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return v(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:gr(),ptc:kt.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:Ft.REQUEST,v:Ht.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(_t.IM_NAVI,JSON.stringify(f),r),[ee.SUCCESS,ee.RC_CONN_TOKEN_INCORRECT,ee.RC_LICENSE_EXPIRED].includes(l))return[2,l===ee.SUCCESS?mr(d):Cr(l)];_.label=3;case 3:return i+=1,[3,1];case 4:return[2,Cr(ee.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 ee.RC_CONN_TOKEN_INCORRECT;case 416:return ee.RC_LICENSE_EXPIRED;default:return ee.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(Tn(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(Tn(e),b(b({},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(zt,"&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}(),mn=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 Cn(){return Array.from(mn.keys()).map((function(e){return b({objectName:e},mn.get(e))})).filter((function(e){return!e.isCustom}))}var Sn=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}h(t,e)}(Sn),function(e){function t(t,r,n){return e.call(this,xr(t),r,n,t)||this}h(t,e)}(Sn);var yn,An=0,Pn=0,Ln=4,Mn=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_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_FUNC_EXEC_O="L-js_func_execute-O",e.L_JS_FUNC_EXEC_E="L-js_func_execute-E",e.L_HADNLE_RECALL_CMD_T="L-handle_recall_cmd-T",e.L_HADNLE_RECALL_CMD_R="L-handle_recall_cmd-R"}(yn||(yn={}));var Un=function(e,t,r){return R(void 0,void 0,void 0,(function(){var n,o;return v(this,(function(a){return n=i.createDecipheriv("aes-256-cbc",t,r),o=n.update(e,"base64","utf-8"),[2,o+=n.final("utf8")]}))}))},Dn=function(t){if(!o.existsSync(t)){var r=e.resolve(t,"..");o.existsSync(r)||Dn(r),o.mkdirSync(t)}},wn=function(e){return Object.entries(e).map((function(e){var t=O(e,2),r=t[0],n=t[1];return{key:r,value:String(n)}}))},jn=function(e){return{removeMute:!!(null==e?void 0:e.removeMuteStatus),removeWhiteList:!!(null==e?void 0:e.removeWhiteList),removeFavoriteMembers:!!(null==e?void 0:e.removeFollow)}},Vn=function(){return"undefined"==typeof __dirname?e.dirname(a.fileURLToPath("undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.cjs.js",document.baseURI).href)):__dirname};function Gn(e){return JSON.parse(e).list.map((function(e){return e.value}))}var kn=e.resolve(Vn(),"binding","electron-".concat(r.platform(),"-").concat(r.arch(),".node")),Fn={addon:null};try{var Hn=require;Fn.addon=Hn(kn)}catch(e){console.error("error ->",kn,"\n",e)}Fn.addon||console.error("error -> cannot find module: ",kn);var Bn,Jn=Fn.addon,xn=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])},Wn=function(e){return"string"==typeof e},Yn=function(e){return Wn(e)?e.toUpperCase():""},Kn=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},Xn=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},Qn=function(e){var t=Yn(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},Zn=function(e){return new Promise((function(t){var r,n;e.socket.once("data",(function(n){var i,o=Kn(n,r);if(!o)return 2===n[1]?(e.socket.once("data",(function(r){var n=Xn(r);n?e.emit("error",new Error("SOCKS authentication failed. ".concat(n))):t()})),i=[1],xn(e.socksUsername,i),xn(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)}))},qn=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),l.isIP(t)){case 0:i.push(3),xn(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)}))},zn=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.Socket,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 h(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 R(r,void 0,void 0,(function(){var r;return v(this,(function(n){switch(n.label){case 0:return[4,Zn(this)];case 1:return n.sent(),[4,qn(this,t,e)];case 2:return n.sent(),this.onProxied(),r=Qn(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}(d.EventEmitter),$n=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=O(t,1)[0]),new zn(e).connect(n,r)},ei=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=$n,r}return h(t,e),t}(s.Agent),ti=function(e,t,r){return(t=b(b({},t),a.parse(e))).port||(t.port=80),t.agent=new ei(t),s.request(t,r)},ri=function(e){var t,r;return t=$n(e),r=t.onProxied,t.onProxied=function(){var n;e.socket=t.socket,e.hostname?e.servername=e.hostname:e.host&&(n=O(e.host.split(":"),1),e.servername=n[0]),t.socket=f.connect(e,(function(){t.authorized=t.socket.authorized,r.call(t)})),t.socket.on("error",(function(e){t.emit("error",e)}))},t},ni=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=ri,n}return h(t,e),t}(u.Agent),ii=function(e,t,r,n){var i,o;return t.protocol="https:",!t.port&&t.host&&(i=O(t.host.split(":"),2),t.port=i[0],t.port=i[1]),t.port||(t.port=443),o=new ni(e,t),t.agent=o,u.request(e,t,r)},oi=null;function ai(e,t,r){void 0===r&&(r=!1);var n=t.url,i=t.headers,o=t.body,a=t.method,c=t.query,l=t.timeout,d=void 0===l?6e4:l;return new Promise((function(t){var l=/^https/.test(n),f={headers:b(b({},i),{"Accept-Encoding":"gzip, br"}),method:a};l&&(f.rejectUnauthorized=r);var _=null;oi?((f=b(b({},f),oi)).body=o,_=l?ii:ti):(_=s.request,l&&(f.agent=new u.Agent(f),_=u.request));var E=_(function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e}(n,c),f,(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.default.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.default.createBrotliDecompress();e.pipe(s),s.on("data",(function(e){o+=e})),s.on("end",(function(){t({status:i,data:o})}))}else e.setEncoding("utf8"),e.on("data",(function(e){o+=e})),e.once("end",(function(){t({status:i||0,data:o})}))}));E.once("timeout",(function(){e.warn(yn.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:n,method:a,query:c,timeout:d})),t({status:0})})),E.setTimeout(d),E.once("error",(function(r){e.warn(yn.P_HTTP_REQ_E,JSON.stringify({msg:r.stack,url:n,method:a,query:c,timeout:d})),t({status:0})})),E.write(o),E.end()}))}function si(e,t){return e?(oi=b(b({},oi),e),t.info(Ie,JSON.stringify({socks5Proxy:oi})),mr()):(oi=null,t.info(ve),mr())}function ui(){return mr(oi||void 0)}!function(e){e[e.ERROR=-1]="ERROR",e[e.RESPONSE=0]="RESPONSE",e[e.CALLBACK=1]="CALLBACK"}(Bn||(Bn={}));var ci,li=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 t=e.type,o=e.data;switch(t){case Bn.RESPONSE:var a=o,s=a.reqId,u=a.success,c=a.data,l=i.maps[s];if(!l)return;l({success:u,data:c}),delete i.maps[s];break;case Bn.CALLBACK:null==r||r(o);break;case Bn.ERROR:var d=o.msg;null==n||n(d)}})),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:ee.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 R(this,void 0,void 0,(function(){var r=this;return v(this,(function(n){return this.p.killed||this.p.exitCode?[2,Promise.resolve({success:!1,data:{code:ee.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 R(this,void 0,void 0,(function(){var n;return v(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}(),di=function(e,t,r,n,i){return R(void 0,void 0,void 0,(function(){var o,a,s,u,c,l;return v(this,(function(d){switch(d.label){case 0:return o=Pr(),a=o.resolve,s=o.promise,Jn.getLog(e,t,r,n,(function(e){a(mr(e))}),(function(e){a(Cr(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,mr({logs:l,size:c})]):[2,u.wipe()]}}))}))},fi=function(e,t,r){return R(void 0,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return v(this,(function(_){switch(_.label){case 0:return n=e.startTime,i=e.endTime,o=e.level,a=e.isRealtimeReport,[4,di(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,T([],O(l),!1)),[2]):(f=l[l.length-1].time,n===f&&(f+=1),e.startTime=f,r.push.apply(r,T([],O(l.filter((function(e){return e.time<f}))),!1)),[2,fi(e,t,r)])):[2]}}))}))},_i=[],pi=!1,Ei=function(){return R(void 0,void 0,void 0,(function(){var e,t,r,n;return v(this,(function(i){switch(i.label){case 0:return pi||0===_i.length?[2]:(pi=!0,e=_i.shift(),t=e.resolve,r=e.args,[4,fi(r,0,n=[])]);case 1:return i.sent(),t({logs:n,dbReady:!0}),pi=!1,Ei(),[2]}}))}))},hi=function(t){function r(e,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=t.call(this,e,u,o,n,i)||this,Object.defineProperty(a,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_subProcess",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return h(r,t),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.deviceId}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return ai(this.logger,e)}}),Object.defineProperty(r.prototype,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subProcess&&this._subProcess.destroy(),t.prototype.stop.call(this)}}),Object.defineProperty(r.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return R(this,void 0,void 0,(function(){var r,i,o,a;return v(this,(function(s){switch(s.label){case 0:return this._subProcess||(r=n.fork(e.resolve(Vn(),"sub-process.cjs.js"),{stdio:["inherit","inherit","inherit","ipc"]}),this._subProcess=new li(r)),[4,this._subProcess.call("compressLogs",t)];case 1:return i=s.sent(),o=i.success,a=i.data,o?[2,{success:o,data:a.data}]:[2,{success:o,data:""}]}}))}))}}),r}(an),gi="rc-realtime-log-timestamp",bi=!1,Ri=function(){var e=new ln(un,cn);return e.setLogReader((function(e,t,r,n){return R(void 0,void 0,void 0,(function(){return v(this,(function(i){switch(i.label){case 0:return[4,(o={startTime:e,endTime:t,level:r,isRealtimeReport:n},R(void 0,void 0,void 0,(function(){return v(this,(function(e){return[2,new Promise((function(e){_i.push({resolve:e,args:o}),Ei()}))]}))})))];case 1:return[2,{logs:i.sent().logs}]}var o}))}))})),e.setLogWriter((function(e){Ii(e)})),e},vi=[],Ii=function(e){bi&&(vi.push(e),ci||(ci=setImmediate((function(){return function(){if(ci&&(clearImmediate(ci),ci=null),vi.length){var e=vi.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(ir,":").concat(ir===t?"main":t),content:JSON.stringify({loggerId:a,content:s,traceId:u})}})),t=JSON.stringify(e);Jn.writeLog(t)}}()}))))},Oi=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return bi||(bi=!0),o}return h(t,e),Object.defineProperty(t.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Jn.getStoreValue(gi);return parseInt(e,10)||0}}),Object.defineProperty(t.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){Jn.setStoreValue(gi,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}(on),Ti=function(){var e,t=Date.now(),n=[r.arch(),r.platform(),process.pid,t,Math.floor(Math.random()*t)].join("__");return e=n,i.createHash("md5").update(e).digest("hex")},Ni=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}(),mi=[Ve.RMTP,Ve.TLS];"darwin"===process.platform&&mi.push(Ve.QUIC);var Ci=function(e){return"RongCloud/navis/".concat(e,"/navi-cache.json")},Si=function(e){return"RongCloud/caches/".concat(e,"/staticConfig.json")},yi=function(e){return"RongCloud/cloudControl/".concat(e,"/cloudControl.json")};function Ai(e){var t,n;void 0===e&&(e="IPv4");var i=r.networkInterfaces(),o=[];try{for(var a=I(Object.values(i)),s=a.next();!s.done;s=a.next()){var u=s.value;if(u&&-1!==Object.prototype.toString.call(u).indexOf("Array")){var c=u.filter((function(t){return!(t.internal||(r=t.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(r))||t.family&&t.family!==e);var r})).map((function(e){return e.mac}));o.push.apply(o,T([],O(c),!1))}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o.length?T([],O(o),!1).sort()[0]:""}var Pi,Li,Mi=function(t){function r(r,n,i,a){var s=t.call(this,r,n,a)||this;Object.defineProperty(s,"naviPath",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(s,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),s.naviPath="".concat(i,"/").concat(Ci(r));var u=e.dirname(s.naviPath);return o.existsSync(u)||Dn(u),s}return h(r,t),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i,o,a,s,u;return v(this,(function(c){switch(c.label){case 0:return i="token=".concat(encodeURIComponent(r),"&v=").concat(zt,"&p=PC&ev=").concat("5.42.1","&m=").concat(Ai()),o="".concat(e,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(ue,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(ce,JSON.stringify({url:o,code:a.status}),n),[2,Cr(this.transHttpCode(a.status))];this.logger.info(ce,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,Cr(this.transHttpCode(s.code))]:[2,mr(s)]}catch(e){return this.logger.error(le,a.data,n),[2,Cr(ee.RC_NAVI_REQ_FAILED)]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i,o,a,s;return v(this,(function(u){switch(u.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:"electron",protocol:mi.join(","),mac:Ai()}),this.logger.info(ue,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(ce,JSON.stringify({url:i.url,code:o.status}),n),[2,Cr(this.transHttpCode(o.status))];this.logger.info(ce,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,mr(a)]}catch(e){return this.logger.error(le,o.data,n),[2,Cr(ee.RC_NAVI_REQ_FAILED)]}return[2]}}))}))}}),Object.defineProperty(r.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(!o.existsSync(this.naviPath))return null;var n=o.readFileSync(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(n),this._caches[t]}catch(e){this.logger.error(le,n)}return null}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Date.now(),n=this.getCatchKey(e);if(ur(this._caches))for(var i in this._caches){(r-this._caches[i].timestamp>qt||n===i)&&delete this._caches[i]}this._caches[n]={token:e,naviInfo:t,timestamp:Date.now(),environment:this._environment},o.writeFileSync(this.naviPath,JSON.stringify(this._caches))}}),Object.defineProperty(r.prototype,"setEnvironment",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._environment=e}}),Object.defineProperty(r.prototype,"setUseNaviV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.useNaviV2=e}}),r}(Nn);function Ui(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];var o,a=e.createTraceId();if(e.info(yn.P_CALL_ADDON_T,JSON.stringify({method:r,params:n}),a),!Jn[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=Jn[r].apply(Jn,T([],O(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.info(yn.P_CALL_ADDON_R,JSON.stringify({method:r,result:t?o:void 0}),a),o}var Di,wi,ji,Vi,Gi=function(){function e(e,t,r){var n=this;Pi.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=N(this,Pi,"m",Li)).call.apply(e,T([this,!0],O(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=N(this,Pi,"m",Li)).call.apply(e,T([this,!1],O(t),!1))}}),Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._flush(mr(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._flush(Cr(e,"",t))}}),Object.defineProperty(e.prototype,"_flush",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._logger.summary(yn.P_CALL_ADDON_R,e,this._traceId),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}();Pi=new WeakSet,Li=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.info(yn.P_CALL_ADDON_T,JSON.stringify({method:o,params:r}),a);try{t=Jn[o].apply(Jn,T([],O(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!==ee.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"}(Vi||(Vi={}));var ki=function(e){function t(t,r,n,i){var o=e.call(this,t,n,i)||this;return Di.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",N(o,Di,"m",wi).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(ee.SUCCESS)}),N(o,Di,"m",ji).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 h(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 R(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p,E,h,g,R=this;return v(this,(function(v){switch(v.label){case 0:return i=this._connectingTask=Gi.create(this.logger,"connectWithToken",n),this._naviInfo=t,o={},(a=ui().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(b(b({},o),{call_plus:this._openCallPlus,cid:this.cid})),u=this.getCmpList(t,!0).filter((function(e){return mi.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!==Ve.QUIC&&e.protocol!==Ve.QUIC||(t.race=!0,t.protocol=Ve.QUIC):(e.race=!1,c.push(e))})),this.logger.info(yn.P_CONNECT_T,JSON.stringify({}),n),l=Date.now(),[4,i.asyncInvoke(e,zt,JSON.stringify(b(b({},t),{serverAddr:c,tagBlacklist:this._excludeLogTag.join(",")})),r,s).result()];case 1:return d=v.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),g={bid:gr(),cod:d.code,net:this.getNetwork().type,dur:h,spr:0,cid:_,v:Ht.CURRENT,count:this.retryCount,sts:Date.now(),ssid:E},this.logger.record(_t.IM_CMP_RMTP,JSON.stringify(g)),this._connectingTask=null,[2,d.trans((function(e){return R._connectedTime=Date.now()-R.callCppProxy("getDeltaTime"),p}))]}}))}))}}),Object.defineProperty(t.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n;return v(this,(function(i){switch(i.label){case 0:return e?[3,2]:[4,(n=Gi.create(this.logger,"disconnect")).asyncInvoke("boolean"!=typeof t||t,!!r,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()];case 1:i.sent(),i.label=2;case 2:return[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(ee.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===ee.RC_SOCKET_DISCONNECTED&&this.getConnectionStatus()!==ut.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:gr(),ptc:kt.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?Bt.RECONNECT:Bt.CONNECT,cid:this.cid,v:Ht.CURRENT,rsn:this._doConnectReason,ddu:i,count:this.retryCount,weight:u>=0?this.cmpWeightCache[u].weight:-1};if(this.logger.record(_t.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===Vi.SUCCESS)this.curCmpUrl="".concat(t,":").concat(r),this.updateCmpWeight("".concat(t,":").concat(r),!0,a);else if(e!==Vi.NOT_INIT){var l=r&&0!==r?"".concat(t,":").concat(r):"".concat(t);this.updateCmpWeight(l,!1)}}}),t}(On);Di=new WeakSet,wi=function(e,t){10!==e&&(this._connectingTask?e===ee.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"})))},ji=function(e,t){switch(this.logger.info(yn.P_CONNECT_S,JSON.stringify({status:e,delay:t})),e){case ee.RC_CONN_REDIRECTED:this.recvConnectRes(e,!0);break;case 11:case 10:case 12:break;case ee.CONNECTION_REFUSED:case ee.RC_SOCKET_DISCONNECTED:case ee.RC_SOCKET_NOT_CREATED:case ee.RC_CONN_ACK_TIMEOUT:case ee.RC_TCP_RESET:this.recvConnectRes(e,!1);break;case ee.RC_UDP_DISCONNECTED:this.recvConnectRes(e,!0,t);break;default:this.recvConnectRes(e,!0)}};var Fi,Hi,Bi,Ji,xi,Wi,Yi,Ki,Xi,Qi,Zi,qi,zi,$i,eo,to,ro,no,io,oo,ao,so,uo,co,lo,fo,_o,po,Eo,ho,go,bo,Ro,vo,Io,Oo,To,No,mo,Co,So,yo=function(t){function r(r,n,i){var a=t.call(this,r,n)||this;Object.defineProperty(a,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"dbpath",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"_cachePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),a._cachePath="".concat(i,"/").concat(Si(r));var s=e.dirname(a._cachePath);return o.existsSync(s)||Dn(s),a}return h(r,t),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o.existsSync(this._cachePath)&&o.readFileSync(this._cachePath,{encoding:"utf8"})||null}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){o.writeFileSync(this._cachePath,e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){o.writeFileSync(this._cachePath,"")}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n;return v(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(r.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r;return v(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Un(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(Ce,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(tn),Ao=function(t){function r(r,n,i,a,s){var u=t.call(this,n,r,i)||this;Object.defineProperty(u,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(u,"model",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(u,"catchFilePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),u.model="Electron|".concat(process.platform,"|").concat(process.arch),u.catchFilePath="".concat(s,"/").concat(yi(r));var c=e.dirname(u.catchFilePath);return o.existsSync(c)||Dn(c),u.init(),u}return h(r,t),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return v(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(ue,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(ce,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(Pe,JSON.stringify({status:u,data:l,error:e})),[2,{code:u,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){o.writeFileSync(this.catchFilePath,JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o.existsSync(this.catchFilePath)?o.readFileSync(this.catchFilePath,{encoding:"utf8"}):null}}),Object.defineProperty(r.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(Me,JSON.stringify(t)),Jn.setCloudConfig(JSON.stringify(t))}}),r}(vn),Po=[Rt,jt,vt,St,At,mt,Ct,Nt,yt,Pt,Lt],Lo=function(){return{logCmdQueue:[],cloudControllerVers:[],srsmsgs:[],readNtfs:[],expansionMsgQueue:new Map,v1ReceiptMsgs:[],privateRSMsgs:[],groupRSMsgs:new Map,rrmsgs:new Map,messageUIds:new Set}},Mo=function(){function e(){Object.defineProperty(this,"_report",{enumerable:!0,configurable:!0,writable:!0,value:Lo()}),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 Po.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!==Rt)if(n!==jt)if(n!==St)if(n!==vt)if(n!==Nt){if(n===mt){var a=o.messageUId;if(!a)return;return this._report.messageUIds.add(a),void this._report.v1ReceiptMsgs.push(e)}if(n===Ct){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!==yt?n===At&&this._handleRSMsg(e):this._handleRRMsg(e)}else this._handleReadNtf(e);else this._handleExpansionNotify(e);else this._handleSRSMsg(e,t);else i===$t&&this._report.cloudControllerVers.push(e.sentTime);else if(i===$t){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!==te.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===te.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=Lo(),this._count=0,e}}),e}(),Uo=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"gen",{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];r.logger.info(yn.L_JS_FUNC_EXEC_O,e);try{t.apply(void 0,T([],O(n),!1))}catch(t){r.logger.error(yn.L_JS_FUNC_EXEC_E,"name: ".concat(e,"\n").concat(t.stack)),console.warn.apply(console,T(["L-js_callback_exception-E: args -> "],O(n),!1))}}}}),e}();function Do(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"}(So||(So={}));var wo,jo,Vo=function(){function e(e,t){var r=this;Fi.add(this),Object.defineProperty(this,"_dispatchEvent",{enumerable:!0,configurable:!0,writable:!0,value:t}),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,"_opts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_buildSubscribeEventData",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=[];try{JSON.parse(e).list.forEach((function(e){var n=JSON.parse(e.obj),i=n.userId,o=n.subscribeType,a=n.subscribeTime,s=n.duration,u=n.operationType,c=n.details,l=void 0===c?[]:c,d=n.userProfile,f={userId:i,subscribeType:o,subscribeTime:a,expiry:s,operationType:u};[ot.ONLINE_STATUS,ot.FRIEND_ONLINE_STATUS].includes(o)&&(f.details=l.map((function(e){var t=JSON.parse(e);return{changeTime:t.changeTime,eventValue:t.changeValue,platform:t.platform}}))),[ot.USER_PROFILE,ot.FRIEND_USER_PROFILE].includes(o)&&(f.userProfile=r._string2userProfileInfo(d)),t.push(f)}))}catch(t){r.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:{}}),this._opts=e;var n=e.dbpath,i=e.appkey,o=e.logOutputLevel,a=e.disableLogReport,s=e.eventLoopBlockingCheck,u=e.enableSyncEmptyTopConversation,c=this._deviceId=Ti(),l=Ri();this.logger=new Oi(i,"RC-M","IM",l),this._catcher=new Uo(this.logger),Jn.initWithAppkey(i,n,zt,this.logger.getSessionId()),Jn.setConsoleLogLevel(o+1),this.logger.setOutputLevel(o),this.reporter=new hi(i,c,this.logger,a,l),this.logger.info(yn.P_INIT_O,JSON.stringify({appkey:i,dbpath:n,proto_commit:Jn.getNodeVersion(),deviceId:c,commit:"7f954602d659cfb16f91987f74aee812abaa6188",processName:process.title,processPId:process.pid,disableLogReport:a,eventLoopBlockingCheck:s})),s&&dn.start(this.logger),Ui(this.logger,!1,"setDeviceId",c),this._staticConfigManager=new yo(i,this.logger,n),this._lowPriorityMessageHandler=new Mo,this.navi=new Mi(i,this.logger,n,this._staticConfigManager),this.tcpMgr=new ki(i,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(u),this._initCloudController(i,c,n),this._registerBuildinMessageTypes(),Jn.setOnReceiveMessageListener(this._catcher.gen("setOnReceiveMessageListener[0]",N(this,Fi,"m",$i).bind(this)),this._catcher.gen("setOnReceiveMessageListener[1]",N(this,Fi,"m",eo).bind(this)),this._catcher.gen("setOnReceiveMessageListener[2]",this._handleMessageModified.bind(this))),Jn.setRTConversationListener(this._catcher.gen("setRTConversationListener",(function(e){return r._dispatchEvent("sgRelationsSynced",e)}))),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),Jn.setReadReceiptListener(this._catcher.gen("setReadReceiptListener",(function(e,t){var n=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}}))}}));r._dispatchEvent("readReceiptResponseV5",n)}))),Jn.setTranslateEventListener(this._catcher.gen("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}}));r._dispatchEvent("translateResponse",t)}))),this._msgExpansionHandler=new Ni(this._callCppProxy.bind(this)),Jn.setUltraGroupListener(this._catcher.gen("setUltraGroupListener[0]",(function(e){return r._dispatchEvent("ultraGroupEnable")})),this._catcher.gen("setUltraGroupListener[1]",(function(e,t,n){return N(r,Fi,"m",Ji).call(r,e,t,n)})),this._catcher.gen("setUltraGroupListener[2]",(function(e){return N(r,Fi,"m",xi).call(r,e)})),this._catcher.gen("setUltraGroupListener[3]",(function(e){return N(r,Fi,"m",Wi).call(r,e)})),this._catcher.gen("setUltraGroupListener[4]",(function(e){return N(r,Fi,"m",Yi).call(r,e)})),this._catcher.gen("setUltraGroupListener[5]",(function(e){return N(r,Fi,"m",Ki).call(r,e)})),this._catcher.gen("setUltraGroupListener[6]",(function(e){return N(r,Fi,"m",Xi).call(r,e)})),this._catcher.gen("setUltraGroupListener[7]",(function(e){return N(r,Fi,"m",Hi).call(r,e)})),this._catcher.gen("setUltraGroupListener[8]",(function(e){return N(r,Fi,"m",Bi).call(r,e)}))),Jn.setRobotEventListener(this._catcher.gen("setRobotEventListener",(function(e,t){r._dispatchEvent("robotsSynced",e,N(r,Fi,"m",Co).call(r,t))}))),Jn.setMessageReactionListener(this._catcher.gen("setMessageReactionListener",(function(e){var t=JSON.parse(e).map((function(e){var t,r=e.conversationIdentifier,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["conversationIdentifier"]);return b({conversationIdentifier:(t=r,{conversationType:t.type,targetId:t.targetId,channelId:t.channelId})},n)}));r._dispatchEvent("messageReaction",{reactions:t})})))}return Object.defineProperty(e.prototype,"_setDeviceInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=r.cpus()[0].model,t=r.release();try{"darwin"===process.platform?t=n.execSync("sw_vers -ProductVersion",{encoding:"utf-8"}):"win32"===process.platform&&(t=n.execSync("ver",{encoding:"utf-8"}))}catch(e){this.logger.error(we,JSON.stringify({error:e}))}Jn.setDeviceInfo("",e,"PC",t,"","")}}),Object.defineProperty(e.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;n=O(en.getCloudControllerUrl(),1),this.cloudControllerUri=n[0],this.cloudController=new Ao(e,this.logger,this.reporter,t,r),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,fn)}}),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 R(this,void 0,void 0,(function(){var r,n,i;return v(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,Cr(ee.NOT_SUPPORT)];n="",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.call.apply(r,T([this],O(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,Cr(ee.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 R(this,void 0,void 0,(function(){var r;return v(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,T([this],O(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,"setRenderInitOption",{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(this._environment),this._enableReadReceiptStorage=a,this.navi.setUseNaviV2(o),en.init({areaCode:r,navigators:t,logServerUrl:n})}}),Object.defineProperty(e.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._isConnected=!0;var r=this.getNaviInfoFromCache();this.reporter.checkStart(r,""),this._try2RejoinChatroom();var n=this.getMainProcessCache();this._dispatchEvent("onConnected",t,n),this._offlineFinishedPending&&(this._offlineFinishedPending=!1,this.logger.info(je),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),Jn[e].apply(Jn,T([],O(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 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,_n,r)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){dn.stop(),this.reporter.stop(),this.logger.destroy(),Jn.destroy()}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l,d,f=this;return v(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=Ui(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,mr({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 Ui(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 R(this,void 0,void 0,(function(){var i;return v(this,(function(o){return i=this._updateMessageReceiptStatus(e,t,r,n),[2,mr(i)]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectionStatus()!==ut.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()-Jn.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._deviceId,crtUserId:n,naviInfo:r,connectionStatus:t,deltaTime:Jn.getDeltaTime(),commitId:"7f954602d659cfb16f91987f74aee812abaa6188"}}}),Object.defineProperty(e.prototype,"_enableCreateEmptyTopConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){Ui(this.logger,!1,"enableCreateEmptyTopConversation",e)}}),Object.defineProperty(e.prototype,"_registerBuildinMessageTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Cn().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 N(this,Fi,"m",Qi).call(this,r,t)}}),Object.defineProperty(e.prototype,"_updateReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=N(this,Fi,"m",go).call(this,e);if(r.isOk){var n=r.data,i=n.readReceiptRequest?JSON.parse(n.readReceiptRequest):{},o=b(b({},i),t);Ui(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 N(this,Fi,"m",Zi).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=Ui(this.logger,!1,"getMessageByUids",e);return JSON.parse(r).list.map((function(e){return N(t,Fi,"m",Qi).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,g=s.messageUIds,b=new Map;this._getMessagesByUIds(T([],O(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,T([],O(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:JSON.stringify(e.readReceiptInfo)})}));Ui(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=O(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=b(b({},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=O(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||{};_=b(b({},_),{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===mt){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=b(b({},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=b(b({},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=O(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=b(b({},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)}})),N(this,Fi,"m",to).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!==Tt&&(t===Ot?N(r,Fi,"m",ro).call(r,e,"highPriorityMessages"):n!==te.CHATROOM||N(r,Fi,"m",zi).call(r,e))}));this._sendMessageNotification(n,t)}}),Object.defineProperty(e.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return R(this,void 0,void 0,(function(){var t,r;return v(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,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(je),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)}));if(1===r)i.length&&this._dispatchEvent("messagesModified",i);else if(2===r){var o=i.filter((function(e){return N(n,Fi,"m",ro).call(n,e,"messageModified")}));this._sendMessageNotification(o,!1)}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?X.DELETE:X.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=O(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:X.UPDATE})):s.push({chatroomId:i,key:r,value:o,timestamp:u,type:X.DELETE})})),Array.from(a.entries()).forEach((function(t){var r=O(t,2),n=r[0],i=r[1];s.push({chatroomId:e,key:n,value:i.value,timestamp:i.version,type:X.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;Jn.setConversationStatusListener(this._catcher.gen("setConversationStatusListener[0]",(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)||pt.NOT_SET;r.updatedItems.notificationLevel={val:o,time:0},r.updatedItems.notificationStatus={val:Yt(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)})),this._catcher.gen("setConversationStatusListener[1]",(function(t){e._dispatchEvent("conversationTag")})),this._catcher.gen("setConversationStatusListener[2]",(function(t,r,n,i){e._clearUnreadCountByTimestamp({conversationType:t,targetId:r,channelId:n},i),e._sendsyncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i})})),this._catcher.gen("setConversationStatusListener[3]",(function(t){return e._dispatchEvent("conversationStatusSynced",t)})),this._catcher.gen("setConversationStatusListener[4]",(function(){e._dispatchEvent("syncServerSaveUnreadCompleted")})),this._catcher.gen("setConversationStatusListener[5]",(function(t){var r=N(e,Fi,"m",qi).call(e,t,"OnConversationUnreadChanged");if(r.isOk){var n=r.data.map((function(e){return{conversation:e,updatedItems:{unreadMessageCount:{val:e.unreadMessageCount,time:0},hasMentioned:{val:!!e.hasMentioned,time:0}}}}));e._dispatchEvent("conversation",n)}})))}}),Object.defineProperty(e.prototype,"_setPushNotificationListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Jn.setPushNotificationListener(this._catcher.gen("setPushNotificationListener[0]",(function(t){return e._getRTCProfile()})),this._catcher.gen("setPushNotificationListener[1]",(function(){return e._dispatchEvent("tag")})),this._catcher.gen("setPushNotificationListener[2]",(function(t){return e._dispatchEvent("userSettingsSynced",t)})),this._catcher.gen("setPushNotificationListener[3]",(function(t){return e._dispatchEvent("userSettingsChanged",{key:Qr,value:t})})),this._catcher.gen("setPushNotificationListener[4]",(function(t){return e._dispatchEvent("userSettingsChanged",{key:Xr,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;Jn.setRTCRoomEventListener(this._catcher.gen("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;Jn.setChatroomEventListener(this._catcher.gen("setChatroomEventListener[0]",(function(t,r){return e._sendChatroomEvents({chatroomDestroyed:t,chatroomDestroyedType:r})}))),Jn.setChatroomStatusListener(this._catcher.gen("setChatroomEventListener[1]",(function(t,r,n){return e._handleChatroomFullKVSync(t,r,n)})),this._catcher.gen("setChatroomEventListener[2]",(function(t){return e._handleChatroomKVUpdate(t)})))}}),Object.defineProperty(e.prototype,"_setCallInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Jn.setCallInfoListener(this._catcher.gen("setCallInfoListener[0]",(function(t){var r=[];try{JSON.parse(t).list.forEach((function(e){Object.entries(e).forEach((function(e){var t=O(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;Jn.setSubscribeEventListener(this._catcher.gen("setSubscribeEventListener[0]",(function(){})),this._catcher.gen("setSubscribeEventListener[1]",(function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)})),this._catcher.gen("setSubscribeEventListener[2]",(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)})),this._catcher.gen("setSubscribeEventListener[3]",(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[ot.ONLINE_STATUS,ot.FRIEND_ONLINE_STATUS].includes(r)?s.details=o:[ot.USER_PROFILE,ot.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;Jn.setUserProfileListener(this._catcher.gen("setUserProfileListener[0]",(function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)})),this._catcher.gen("setUserProfileListener[1]",(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=O(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 F.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 F.GROUP_REMARK_DELETE:case F.GROUP_REMARK_SET:var u=e===F.GROUP_REMARK_SET?H.ADD:H.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,_=b(b(b(b({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&&ar(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(){Jn.setEntrustGroupListener(this._catcher.gen("setEntrustGroupListener[0]",this._onGroupOperationChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[1]",this._onGroupInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[2]",this._onGroupMemberInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[3]",this._onGroupRequestChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[4]",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(){Jn.setFriendEventListener(this._catcher.gen("setFriendEventListener[0]",this._onFriendApplicationStatusChanged.bind(this)),this._catcher.gen("setFriendEventListener[1]",this._onFriendAdd.bind(this)),this._catcher.gen("setFriendEventListener[2]",this._onFriendDelete.bind(this)),this._catcher.gen("setFriendEventListener[3]",this._onFriendsClearedFromServer.bind(this)),this._catcher.gen("setFriendEventListener[4]",this._onFriendInfoChangedSync.bind(this)))}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t.isPersited=e!==Ot&&t.isPersited;var r,n,i,o=0,a=t.isCounted,s=t.isCustom,u=t.isStatusMessage,c=t.searchProps;t.isPersited&&(o|=1),a&&(o|=2),u&&(o=16),s&&(r=e,n=t,(i=mn.get(r))&&!i.isCustom&&console.warn("Builtin message type '".concat(r,"' cannot be registered")),n.isStatusMessage&&(n.isCounted=n.isPersited=!1),mn.set(r,b(b({},n),{isCustom:!0}))),Ui(this.logger,!1,"registerMessageType",e,o,c||[])}}),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=ee.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(b(b({},e),{"electron-main":"5.42.1"}));this.logger.info(yn.P_REPORT_VER_O,t),Ui(this.logger,!1,"uploadSDKVersion",t,"")}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){return v(this,(function(r){switch(r.label){case 0:return e=e||!0,this._chatroomCache.clear(),this.reporter.stop(),si(null,this.logger),[4,this.tcpMgr.disconnect(e,t)];case 1:return r.sent(),[2,mr()]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"setUserStatus");return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.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===te.GROUP;if(r===Ct&&n.receiptMessageDic&&a)for(var s in n.receiptMessageDic)o.push(s);return r===St&&(o=function(e,t){return t&&0!==t.length?[te.GROUP,te.ULTRA_GROUP,te.APP_PUBLIC_SERVICE,te.PUBLIC_SERVICE].includes(e)?t:[]:t||[]}(t,[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 vt:this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e);break;case mt:this._enableReadReceiptStorage&&this._updateReadReceiptInfo(t.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});break;case Ct: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 R(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p,E,h,g,b,R,I,O,T,N,m,C,S,y,A,P,L,M,U,D,w,j,V,G,k,F,H,B,J,x,W,Y,K,X,Q,Z,q,z,$,te,re=this;return v(this,(function(v){for(X in i=e.conversationType,o=e.targetId,a=e.channelId,s=t.messageType,u=t.content,c=t.expansion,l=t.pushConfig,d=t.pushContent,f=void 0===d?"":d,_=t.pushData,p=void 0===_?"":_,E=t.directionalUserIdList,void 0===E?[]:E,g=t.disableNotification,b=void 0!==g&&g,R=t.canIncludeExpansion,I=void 0!==R&&R,O=t.isVoipPush,T=void 0!==O&&O,N=t.messageId,m=void 0===N?0:N,C=t.disableUpdateLastMessage,S=t.needReceipt,y=t.quoteInfo,P=(A=l||{}).iOSConfig,L=A.androidConfig,M=A.harmonyOSConfig,U=A.templateId,D=void 0===U?"":U,w=A.pushTitle,j=void 0===w?"":w,V=A.pushContent,G=void 0===V?f:V,k=A.pushData,F=void 0===k?p:k,H=A.disablePushTitle,B=void 0!==H&&H,J=A.forceShowDetailContent,x=void 0!==J&&J,W=hr(P,L,M),f=G,p=F,Y=(null==L?void 0:L.notificationId)||"",h=this._handleDirectionalUserIdList(t,i),K={},c)K[X]={v:c[X]};return Q=D,this.logger.info(yn.P_SEND_MSG_T,JSON.stringify({messageType:s,conversationType:i,targetId:o,channelId:a}),r),Z=Gi.create(this.logger,"sendMessage"),q=function(e,n){var i=re._buildMessage(e,!1);re.logger.info(yn.P_SEND_MSG_R,JSON.stringify({code:n,messageUId:i.messageUId}),r),n!==ee.SENSITIVE_REPLACE?(re._handleMessage2Callback(i,t),Z.ok(i)):Z.fail(n)},z=function(e,t){var n=re._buildMessage(e,!1);re.logger.warn(yn.P_SEND_MSG_R,JSON.stringify({code:t,messageId:n.messageId}),r),n.sentTime=Date.now()-Jn.getDeltaTime(),Z.fail(t,n)},$=Ui(this.logger,!1,"sendMessage",q,z,i,o,s,JSON.stringify(u),h,b,B,x,f,p,Y,j,W,Q,I,JSON.stringify(K),T,a||"",m,!!C,!!S,(null==y?void 0:y.messageUId)||"",(null==y?void 0:y.senderId)||"",(null==y?void 0:y.objectName)||""),te=JSON.parse($),null==n||n(te.messageId),[2,Z.result()]}))}))}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return R(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f,_,p,E,h,g,b,I,O,T=this;return v(this,(function(m){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:Ot,messageUid:E,direction:dt.SEND,status:Vt.UNREAD,sentTime:h,channelId:n},I=this._buildMessage(JSON.stringify(b),!1),[2,(O=Gi.create(this.logger,"recallMessage")).asyncInvoke((function(e){return R(T,void 0,void 0,(function(){return v(this,(function(e){return N(this,Fi,"m",ro).call(this,I,"recall"),o===te.ULTRA_GROUP&&this._dispatchEvent("ultraGroupMessageRecalled",[I]),I.pushConfig=c,O.ok(I),[2]}))}))}),(function(e){return O.fail(e)}),Ot,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)||"",hr(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 R(this,void 0,void 0,(function(){return v(this,(function(n){return r?[2,mr(N(this,Fi,"m",no).call(this,e,t))]:[2,N(this,Fi,"m",io).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return v(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=Gi.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=Gi.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=Gi.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 R(this,void 0,void 0,(function(){return v(this,(function(t){return N(this,Fi,"m",oo).call(this,e),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l=this;return v(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:Xe(t?Be:Fe),u=s.map((function(e){return{conversationType:e,channelId:e===te.ULTRA_GROUP?N(l,Fi,"m",so).call(l,""):r,channelIdValid:e===te.ULTRA_GROUP||"string"==typeof r}})),c=Ui(this.logger,!1,"getConversationListByPageWithTopPriorityV2",u,i,n,!!a),[2,N(this,Fi,"m",qi).call(this,c,"getConversationListByPageWithTopPriorityV2")]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i,o,a=this;return v(this,(function(s){return n=((null==t?void 0:t.length)||0)>0?t:Xe(e?Be:Fe),i=n.map((function(e){return{conversationType:e,channelId:e===te.ULTRA_GROUP?N(a,Fi,"m",so).call(a,""):r,channelIdValid:e===te.ULTRA_GROUP||"string"==typeof r}})),o=Ui(this.logger,!1,"getTopConversationsV2",i),[2,N(this,Fi,"m",qi).call(this,o,"getTopConversationsV2")]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i,o=this;return v(this,(function(a){return r=((null==t?void 0:t.length)||0)>0?t:Xe(e?Be:Fe),n=r.map((function(e){return{conversationType:e,channelId:e===te.ULTRA_GROUP?N(o,Fi,"m",so).call(o,""):"",channelIdValid:e===te.ULTRA_GROUP}})),i=Ui(this.logger,!1,"getUnreadConversationListV2",n),[2,N(this,Fi,"m",qi).call(this,i,"getUnreadConversationListV2")]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i,o=this;return v(this,(function(a){return r=Xe(e?Be:Fe),n=r.map((function(e){return{conversationType:e,channelId:e===te.ULTRA_GROUP?N(o,Fi,"m",so).call(o,""):t,channelIdValid:e===te.ULTRA_GROUP||"string"==typeof t}})),i=Ui(this.logger,!1,"getConversationsV2",n),[2,N(this,Fi,"m",qi).call(this,i,"getConversationsV2")]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n;return v(this,(function(i){return r=Xe(Fe).map((function(e){return{conversationType:e,channelIdValid:!1}})),n=Ui(this.logger,!1,"getConversationListByPageWithTopPriorityV2",r,e,t,!0),[2,N(this,Fi,"m",qi).call(this,n,"getConversationListByPageWithTopPriorityV2")]}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n;return v(this,(function(i){return n=Ui(this.logger,!1,"getConversationsByPageWithoutTag",e,t,r),[2,N(this,Fi,"m",qi).call(this,n,"getConversationsByPageWithoutTag")]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l,d,f;return v(this,(function(_){switch(_.label){case 0:return t=e.conversationType,r=e.targetId,n=e.channelId,(i=N(this,Fi,"m",uo).call(this,e))?[2,mr(i)]:(o=N(this,Fi,"m",no).call(this,e,{timestamp:0,count:1,order:0,messageType:""}),a=(null==o?void 0:o.list[0])||null,s=JSON.parse(Ui(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)||An,[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:Yt(d),translateStrategy:c,unreadMessageCount:N(this,Fi,"m",co).call(this,e)},[2,mr(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=Gi.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 R(this,void 0,void 0,(function(){var t,r,n;return v(this,(function(i){return t=e instanceof Array?e:Xe(Be),r=t.map((function(e){return{conversationType:e,channelIdValid:!1}})),[2,(n=Ui(this.logger,!0,"clearConversationsV2",r))===ee.SUCCESS?mr():Cr(n)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i,o=this;return v(this,(function(a){return n=e.map((function(e){return{conversationType:e,channelId:e===te.ULTRA_GROUP?N(o,Fi,"m",so).call(o,""):r,channelIdValid:e===te.ULTRA_GROUP||"string"==typeof r}})),i=Ui(this.logger,!0,"getTotalUnreadCount2",n,t),[2,mr(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return t=N(this,Fi,"m",co).call(this,e),[2,mr(t)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o;return v(this,(function(a){return t=e.conversationType,r=e.targetId,n=e.channelId,t===te.ULTRA_GROUP?(i=this._getServerTime(),[2,(o=Gi.create(this.logger,"setReadTimestamp",this.logger.createTraceId())).asyncInvoke(t,r,i,(function(){return o.ok()}),(function(e){return o.fail(e)}),n||"").result()]):(N(this,Fi,"m",lo).call(this,e),[2,mr()])}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e,t=this;return v(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!==te.ULTRA_GROUP&&N(t,Fi,"m",lo).call(t,e)})),[2,mr()]):[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;Ui(this.logger,!1,"clearUnreadCountByTimestamp",r,n,t,i||"")}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){return v(this,(function(r){return this._clearUnreadCountByTimestamp(e,t),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return t=N(this,Fi,"m",fo).call(this,e),[2,mr(t)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return t=N(this,Fi,"m",fo).call(this,e),[2,mr(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 N(this,Fi,"m",_o).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=Gi.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 N(this,Fi,"m",_o).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=Gi.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 R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return t=Ui(this.logger,!0,"getBlockPushLevelForType",e),[2,mr(t)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i,o,a,s,u=this;return v(this,(function(c){switch(c.label){case 0:return i=this.logger.createTraceId(),o=Gi.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===ee.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 N(u,Fi,"m",Zi).call(u,e)}))}))]:[2,mr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i,o,a,s=this;return v(this,(function(u){switch(u.label){case 0:return r=r||Xe(Fe),n=this.logger.createTraceId(),i=Gi.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===ee.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 N(s,Fi,"m",Zi).call(s,e)}))}))]:[2,mr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o;return R(this,void 0,void 0,(function(){var a,s,u,c,l=this;return v(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,T([],O(t.map((function(t){return b(b({},t),e)}))),!1))})),t=r}else t.push.apply(t,T([],O(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=Wr(i).map((function(e){return{conversationType:e}})),l=Wr(a).map((function(e){return{targetId:e}})),d=Wr(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:Wr((null===(i=e.messageFilter)||void 0===i?void 0:i.objectNames)||[]),senderIds:Wr((null===(o=e.messageFilter)||void 0===o?void 0:o.senderIds)||[])},[4,(c=Gi.create(this.logger,"searchMessage",a)).invoke(s,u,(function(e,t,r,n){e===ee.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 N(l,Fi,"m",Qi).call(l,e)})),totalMatched:r,conditionsMatched:n}}))]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o,a=this;return v(this,(function(s){return t=e.conversationType,r=e.targetId,n=e.channelId,i=Ui(this.logger,!1,"getUnreadMentionedMessages",t,r,n||""),o=JSON.parse(i).list.map((function(e){var t=e.obj;return N(a,Fi,"m",Qi).call(a,JSON.parse(t))})),[2,mr(o)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return r=N(this,Fi,"m",uo).call(this,e),[2,mr(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=Gi.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=Gi.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=Gi.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=Gi.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 R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return[2,-1===(r=N(this,Fi,"m",po).call(this,e,t)).messageId?Cr(ee.MSG_INSERT_ERROR,"insert message failed",r):mr(r)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),R(this,void 0,void 0,(function(){var r;return v(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=Vt.UNREAD;return(null==e?void 0:e.isRead)&&(t|=Vt.READ),(null==e?void 0:e.isListened)&&(t|=Vt.LISTENED),(null==e?void 0:e.isDownload)&&(t|=Vt.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=Vt.RETRIEVED),t}(v):a,N=u||0,m={};if(p)for(var C in p)m[C]={v:p[C],ts:N};var S=e.quoteInfo?{messageUId:e.quoteInfo.messageUId,senderId:e.quoteInfo.senderId,objectName:e.quoteInfo.objectName,quoteMessageStatus:e.quoteInfo.quoteMessageStatus||Zt}:void 0;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,quoteInfo:S}})),[2,Ui(this.logger,!0,"insertMessages",JSON.stringify(r),t)?mr(!0):Cr(ee.MSG_INSERT_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i;return v(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=Ui(this.logger,!0,"getMessageCount",t,r,n||""),[2,mr(i)]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){return v(this,(function(t){return N(this,Fi,"m",Eo).call(this,e),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){return v(this,(function(n){return N(this,Fi,"m",ho).call(this,e,t,r),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(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}})),Ui(this.logger,!1,"deleteMessageBySendTimeInBatches",JSON.stringify(t)),[2,mr()]}))}))}}),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=Gi.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 R(this,void 0,void 0,(function(){return v(this,(function(t){return[2,N(this,Fi,"m",bo).call(this,e)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){return v(this,(function(n){return N(this,Fi,"m",Ro).call(this,e,t,r),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){return v(this,(function(n){return Ui(this.logger,!1,"setMessageSearchField",e,t,r),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){return v(this,(function(r){return Ui(this.logger,!1,"setMessageSentStatus",e,t),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){return v(this,(function(r){return N(this,Fi,"m",vo).call(this,e,t),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i;return v(this,(function(o){return r=e.conversationType,n=e.targetId,i=e.channelId,[2,Ui(this.logger,!1,"saveTextMessageDraft",r,n,t,i||"")?mr():Cr(ee.DRAFT_SAVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i;return v(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=Ui(this.logger,!0,"getTextMessageDraft",t,r,n||""),[2,mr(i)]}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n;return v(this,(function(i){return t=e.conversationType,r=e.targetId,n=e.channelId,[2,Ui(this.logger,!1,"clearTextMessageDraft",t,r,n||"")?mr():Cr(ee.DRAFT_REMOVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i;return v(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=Ui(this.logger,!0,"getBlockPushLevelForConversation",r,n||"",t),[2,mr(i)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i;return v(this,(function(o){return n=e.map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(i=Ui(this.logger,!0,"getUnreadAndMentionCountByLevel",n,t)).code?[2,Cr(i.code)]:[2,mr(r?i.mention:i.unread)]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i,o=this;return v(this,(function(a){switch(a.label){case 0:return[4,(n=Gi.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=N(o,Fi,"m",go).call(o,e);t.isOk&&N(o,Fi,"m",vo).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=Gi.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=Gi.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=Gi.create(this.logger,"getMessageReadReceipt",this.logger.createTraceId());return o.asyncInvoke(n,i||"",t,(function(e,n,i){return R(r,void 0,void 0,(function(){var r,a,s,u,c,l,d,f,_;return v(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(yn.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=Gi.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 R(e,void 0,void 0,(function(){var e,n,i,o,a,s,u;return v(this,(function(c){switch(c.label){case 0:return e=r.chatroomId,n=r.count,i=r.extra,this.logger.info(de,e,t),[4,this._joinChrm(e,n,!1,!0,i)];case 1:return o=c.sent(),this.logger.summary(fe,o,t),a=o.code,s=o.isOk,u=o.data,s?(this._sendChatroomEvents({rejoinedRoom:b({chatroomId:e,count:n},u)}),[2]):(a!==ee.RC_CHATROOM_USER_KICKED&&a!==ee.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||N(this,Fi,"m",ao).call(this,e,!0,!0);var s=Gi.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 R(this,void 0,void 0,(function(){return v(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,t){this._chatroomCache.delete(e);var r=Gi.create(this.logger,"quitChatRoom",this.logger.createTraceId());return r.asyncInvoke(e,(function(){return r.ok()}),(function(e){return r.fail(e)}),t||"").result()}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Gi.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 R(this,void 0,void 0,(function(){var i,o,a=this;return v(this,(function(s){return i=this.logger.createTraceId(),[2,(o=Gi.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=Gi.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=Gi.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=Gi.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=Gi.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 R(this,void 0,void 0,(function(){return v(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?Cr(ee.CHATROOM_KEY_NOT_EXIST):mr(r)}))]}}))}))}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.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||"":Er(e,t);var s=this.getNaviInfoFromCache(),u={uploadDomain:Rr(s,this.logger),env:this._environment};o=o?Math.ceil(o):0;var c=Gi.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=Rr(i,this.logger),a=this.logger.createTraceId(),s=Gi.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 R(this,void 0,void 0,(function(){var e;return v(this,(function(t){return e=Ui(this.logger,!0,"clearData"),[2,mr(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:ee.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=Gi.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=Gi.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;Jn.setRTCHeartbeatListener(this._catcher.gen("setRTCHeartbeatListener[0]",(function(t,r){var n=e.rtcHeartbeatResolves[t];if(n){var i=n.find((function(e){return""===e.seqId}));i&&(i.seqId=r)}})),this._catcher.gen("setRTCHeartbeatListener[1]",(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=Pr(),i=n.promise,o={resolve:n.resolve,seqId:""},a=this.rtcHeartbeatResolves[e];return a?a.push(o):this.rtcHeartbeatResolves[e]=[o],Ui(this.logger,!1,"sendRTCHeartbeat",[e],30),i}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.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=Gi.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=Gi.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 R(this,void 0,void 0,(function(){var e,t;return v(this,(function(r){return e=Ui(this.logger,!1,"getTags"),t=this._convertResultList(e,(function(e){return{tagId:e.tagId,tagName:e.tagName,conversationCount:e.conversationCount,createdTime:e.tagTime}})),[2,mr(t)]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Gi.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=Gi.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=Gi.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 R(this,void 0,void 0,(function(){var n,i,o=this;return v(this,(function(a){return n=Ui(this.logger,!1,"getConversationsForTagByPage",e,t,r,""),i=this._convertResultList(n,(function(e){return b(b({},o._buildConversation(JSON.stringify(e))),{isTopInTag:e.topForTag})})),[2,mr(i)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return r=Ui(this.logger,!0,"getConversationUnreadCountForTag",e,t),[2,mr(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Gi.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 R(this,void 0,void 0,(function(){var t,r;return v(this,(function(n){return t=Ui(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,mr(r)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e,t;return v(this,(function(r){return e=[te.GROUP].map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(t=Ui(this.logger,!0,"getUnreadAndMentionCountV2",e)).code?[2,Cr(t.code)]:[2,mr(t.mention)]}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e;return v(this,(function(t){return e={arch:r.arch(),platform:r.platform(),type:r.type(),version:r.version(),release:r.release(),uptime:r.uptime(),cpus:r.cpus(),freemem:r.freemem(),totalmem:r.totalmem(),networkInterfaces:r.networkInterfaces()},[2,mr(e)]}))}))}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){return v(this,(function(e){return[2,mr({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=Gi.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 R(this,void 0,void 0,(function(){return v(this,(function(t){return this.tcpMgr.getConnectionStatus()!==ut.DISCONNECTED?[2,Cr(ee.RC_CONN_PROXY_UNAVAILABLE)]:[2,si(e,this.logger)]}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve(ui())}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return function(e,t,r){return R(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l;return v(this,(function(d){switch(d.label){case 0:return n=Pr(),i=n.resolve,o=n.promise,a=/^https/.test(t),s=a?ii:ti,u=r.createTraceId(),r.info(Oe,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?mr(r):Cr(ee.RC_HTTP_REQ_FAIL,"fail: ".concat(e.statusCode),r);i(n)}))})),c.once("timeout",(function(){return i(Cr(ee.TIMEOUT))})),c.once("error",(function(e){return i(Cr(ee.RC_HTTP_REQ_FAIL,e.stack))})),c.end(),[4,o];case 1:return l=d.sent(),r.summary(Te,l,u),[2,l.wipe()]}}))}))}(e,t,this.logger)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return t=Ui(this.logger,!0,"checkDuplicateMessage",e),[2,mr(t)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Gi.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=Gi.create(this.logger,"updateSubscribeStatus");return r.asyncInvoke(t,at.UNSUBSCRIBE,e,(function(){return r.ok()}),(function(e,t){return r.fail(e,t)}),0).result()}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i,o;return v(this,(function(a){return n=Ui(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===ot.ONLINE_STATUS&&(a.details=lr(o)),a})),[2,mr(o)]}))}))}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return[2,(t=Ui(this.logger,!1,"setDuplicateMessageConfig",[te.CHATROOM],So.cuid,e))===ee.SUCCESS?mr():Cr(t)]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r=this;return v(this,(function(n){switch(n.label){case 0:return[4,N(this,Fi,"m",mo).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===ot.ONLINE_STATUS&&(a.details=lr(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=Gi.create(this.logger,"updateUserProfile");return n.invoke(t,r,(function(e,t){if(e===ee.SUCCESS)n.ok();else{var r=Gn(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=Gi.create(this.logger,"getUserProfiles");return r.invoke(e,(function(e,n){e===ee.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=Gi.create(this.logger,"getOwnUserProfile");return t.asyncInvoke((function(r,n){t.flush(Nr.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(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=Gi.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=Gi.create(this.logger,"getUserProfilePermission");return e.asyncInvoke((function(t,r){e.flush(Nr.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=Gi.create(this.logger,"getUserProfileByUniqueId");return r.asyncInvoke(e,(function(e,n){r.flush(Nr.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 R(this,void 0,void 0,(function(){var i,o,a,s,u,c=this;return v(this,(function(l){return i=e.conversationType,o=e.targetId,a=e.channelId,s=Ui(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,mr(u)]}))}))}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return t=N(this,Fi,"m",Io).call(this,e),[2,mr(t)]}))}))}}),Object.defineProperty(e.prototype,"handleErrorCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e!==ee.SUCCESS&&setTimeout((function(){return t(Cr(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=pr(r),f=pr(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||G.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=pr(r),f=pr(o);return JSON.parse(JSON.stringify(b(b(b(b(b(b(b(b(b({groupId:t},function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:_r(e.joinPerm),removeMemberPermission:_r(e.removePerm),invitePermission:_r(e.memInvitePerm),inviteHandlePermission:_r(e.invitePerm),groupInfoEditPermission:_r(e.profilePerm),memberInfoEditPermission:_r(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||"",isRobot:!!e.isRobot}})):[]}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i,o,a;return v(this,(function(s){return i=wn(t),o=wn(r||{}),[2,(a=Gi.create(this.logger,"createGroup")).invoke(e,n||[],JSON.stringify(i),JSON.stringify(o),(function(e,t,r,n){e===ee.SUCCESS?a.ok():a.fail(e,{errorKeys:Gn(n),processCode:t})})).result()]}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i,o;return v(this,(function(a){return n=wn(t),i=wn(r||{}),[2,(o=Gi.create(this.logger,"updateGroupInfo")).invoke(e,JSON.stringify(n),JSON.stringify(i),(function(e,t,r,n){e===ee.SUCCESS?o.ok():o.fail(e,{errorKeys:Gn(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r=this;return v(this,(function(n){return[2,(t=Gi.create(this.logger,"getGroupInfoByIds")).invoke(e,(function(e,n,i,o){var a=Nr.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 R(this,void 0,void 0,(function(){var n;return v(this,(function(i){return[2,(n=Gi.create(this.logger,"kickOutGroupMember")).invoke(e,t,JSON.stringify(jn(r)),(function(e,t){return n.flush(Nr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return[2,(r=Gi.create(this.logger,"quitGroup")).invoke(e,JSON.stringify(jn(t)),(function(e,t){return r.flush(Nr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return[2,(t=Gi.create(this.logger,"disbandGroup")).invoke(e,(function(e,r){return t.flush(Nr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i;return v(this,(function(o){return[2,(i=Gi.create(this.logger,"transferGroup")).invoke(e,t,r,JSON.stringify(jn(n)),(function(e,t){return i.flush(Nr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n;return v(this,(function(i){return[2,(n=Gi.create(this.logger,"updateGroupAdmins")).invoke(t,r,e,(function(e,t){return n.flush(Nr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i=this;return v(this,(function(o){return[2,(n=Gi.create(this.logger,"getGroupMembers")).invoke(e,t===G.UNDEF?[1,2,3]:[t],r.pageToken,r.count,r.order?1:0,r.filterRobotType,(function(e,t,r,o){if(e===ee.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 R(this,void 0,void 0,(function(){var r,n=this;return v(this,(function(i){return[2,(r=Gi.create(this.logger,"getGroupMembersByIds")).invoke(e,t,(function(e,t,i,o){var a=Nr.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 R(this,void 0,void 0,(function(){var i;return v(this,(function(o){return[2,(i=Gi.create(this.logger,"updateGroupMemberInfo")).invoke(e,t,r,n||"",(function(e,t,r,n){e===ee.SUCCESS?i.ok():i.fail(e,{errorKeys:Gn(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i=this;return v(this,(function(o){return[2,(n=Gi.create(this.logger,"getGroupMembersByNickname")).invoke(e,t,r.pageToken,r.count,r.order?1:0,(function(e,t,r,o){if(e===ee.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 R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return[2,(t=Gi.create(this.logger,"joinGroup")).invoke(e,(function(e,r,n){e===ee.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 R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return[2,(r=Gi.create(this.logger,"inviteUsersToGroup")).invoke(e,t,(function(e,t,n){e===ee.SUCCESS?r.ok({processCode:t}):r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c;return v(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=Gi.create(this.logger,"handleGroupInvite")).invoke(t,u,r,i,s,a||"",(function(e,t,r){var n=Nr.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 R(this,void 0,void 0,(function(){var n,i;return v(this,(function(o){return n=e.order?1:0,[2,(i=Gi.create(this.logger,"getGroupRequests")).invoke(t,r,"",e.pageToken||"",e.count,n,(function(e,t,r,n){if(e===ee.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 R(this,void 0,void 0,(function(){var r,n,i,o=this;return v(this,(function(a){return r=Gi.create(this.logger,"getGroups"),n=t.order?1:0,i=e===G.UNDEF?[1,2,3]:[e],[2,r.invoke(i,t.pageToken,t.count,n,(function(e,t,n,i){if(e===ee.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 R(this,void 0,void 0,(function(){var r,n=this;return v(this,(function(i){return[2,(r=Gi.create(this.logger,"getGroupsByGroupName")).invoke(e,t.pageToken,t.count,t.order?1:0,(function(e,t,i,o){if(e===ee.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 R(this,void 0,void 0,(function(){var t,r=this;return v(this,(function(n){return[2,(t=Gi.create(this.logger,"getGroupsByIds")).invoke(e,(function(e,n,i,o){if(e===ee.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 R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return[2,(r=Gi.create(this.logger,"updateGroupRemark")).invoke(e,t,t?H.ADD:H.REMOVE,(function(e,t){return r.flush(Nr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n;return v(this,(function(i){return[2,(n=Gi.create(this.logger,"updateFavoriteMembers",this.logger.createTraceId())).invoke(t,r,e,(function(e,t){return n.flush(Nr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return[2,(t=Gi.create(this.logger,"getGroupFavoriteMembers")).invoke(e,"",1e3,0,(function(e,r,n,i){var o=Nr.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=Gi.create(this.logger,"addFriend");return n.invoke(e,t,r,(function(e,t,r){e===ee.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=Gi.create(this.logger,"removeFriends",this.logger.createTraceId());return r.invoke(e,t,(function(e,t){return r.flush(Nr.from(e))})).result()}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"acceptFriendRequest",this.logger.createTraceId());return t.invoke(e,"",(function(e,r){return t.flush(Nr.from(e))})).result()}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Gi.create(this.logger,"rejectFriendRequest",this.logger.createTraceId());return r.invoke(e,t||"",(function(e,t){return r.flush(Nr.from(e))})).result()}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Gi.create(this.logger,"setFriendInfo"),i=wn(r);return n.invoke(e,t,JSON.stringify(i),(function(e,t,r,i){e===ee.SUCCESS?n.ok():n.fail(e,{errorKeys:Gn(i)})})).result()}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r;return v(this,(function(n){switch(n.label){case 0:return[4,(r=Gi.create(this.logger,"checkFriendRelationship")).invoke(e,t,(function(e,t){e===ee.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 R(this,void 0,void 0,(function(){var t,r=this;return v(this,(function(n){switch(n.label){case 0:return[4,(t=Gi.create(this.logger,"getFriends",this.logger.createTraceId())).invoke(e,0,(function(e,r){e===ee.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=Gi.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===ee.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=Gi.create(this.logger,"getFriendByIds");return r.invoke(e,(function(e,n){if(e===ee.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=Gi.create(this.logger,"getFriendByNickname");return r.invoke(e,(function(e,n){if(e===ee.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=Gi.create(this.logger,"setFriendAuthPermission");return t.invoke(e,(function(e){e!==ee.SUCCESS?t.fail(e):t.ok()})).result()}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Gi.create(this.logger,"getFriendAuthPermission");return e.invoke((function(t,r){t!==ee.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=Gi.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=Gi.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=Gi.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 R(this,void 0,void 0,(function(){return v(this,(function(e){return[2,mr(en.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Gi.create(this.logger,"sendReadReceiptByReadReceiptType");return r.invoke(e.conversationType,e.targetId,e.channelId||"",Pn,t,(function(e,t,n){e!==ee.SUCCESS?r.fail(e):r.ok()})).result()}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r;return v(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=Gi.create(this.logger,"getReadReceiptCount")).invoke(JSON.stringify(t),(function(e,t){e!==ee.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=Gi.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===ee.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=Gi.create(this.logger,"getReadReceiptStatusForUsersInMessage");return n.invoke(e.conversationType,e.targetId,e.channelId||"",t,r,(function(e,t,r,i){if(e===ee.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 R(this,void 0,void 0,(function(){var t,r,n=this;return v(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=Ui(this.logger,!0,"speechToText",e,t))===ee.SUCCESS?mr():Cr(r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return[2,(r=Ui(this.logger,!0,"updateSpeechToTextVisible",e,t))===ee.SUCCESS?mr():Cr(r)]}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"setPushSetting");return t.invoke(Ln,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 R(this,void 0,void 0,(function(){var e;return v(this,(function(t){return e=Ui(this.logger,!0,"getPushSetting",Ln),[2,mr(e)]}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"setPushSetting");return t.invoke(Mn,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 R(this,void 0,void 0,(function(){var e;return v(this,(function(t){return e=Ui(this.logger,!0,"getPushSetting",Mn),[2,mr("1"===e)]}))}))}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return R(this,void 0,void 0,(function(){var i,o,a;return v(this,(function(s){return i=Ui(this.logger,!0,"getPushSetting",Ln)||"zh",o=Gi.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!==ee.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=Gi.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=Gi.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 N(i,Fi,"m",To).call(i,e,n)}),0)}),(function(e){o.ok(),setTimeout((function(){return N(i,Fi,"m",To).call(i,e,r)}),0)})).result()}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e;return v(this,(function(t){return[2,(e=Ui(this.logger,!0,"getRemoteConversations"))===ee.SUCCESS?mr():Cr(e)]}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.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 R(this,void 0,void 0,(function(){var t,r,n,i,o=this;return v(this,(function(a){return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=Ui(this.logger,!1,"getUGConversationListForAllChannel"),i=JSON.parse(n).list.map((function(e){var t=e.obj,r=JSON.parse(t);return N(o,Fi,"m",Zi).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,mr(i)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n,i,o,a=this;return v(this,(function(s){switch(s.label){case 0:return r=Gi.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 N(a,Fi,"m",Qi).call(a,r)}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o;return v(this,(function(a){switch(a.label){case 0:return t=Gi.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?ke.ALL:ke.SINGAL}}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){return v(this,(function(r){return Ui(this.logger,!1,"clearUGMessageByTimestamp",e,t,!1),[2,mr()]}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Gi.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=Gi.create(this.logger,"setDefaultBlockPushLevel",this.logger.createTraceId());return n.asyncInvoke(e,r||"",te.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=Gi.create(this.logger,"getDefaultBlockPushLevel",this.logger.createTraceId());return r.asyncInvoke(e,t||"",te.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 R(this,void 0,void 0,(function(){var n,i;return v(this,(function(o){return t.length>0?(n=Ui(this.logger,!0,r?"getUltraGroupUnreadMentionedCount":"getUltraGroupUnreadCount",e,t),[2,mr(n)]):(i=Ui(this.logger,!0,r?"getUGMentionCount":"getUGUnreadCount",e),[2,mr(i)])}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r;return v(this,(function(n){return t=Ui(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:te.ULTRA_GROUP,unreadMessageCount:a}})),[2,mr(r)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return(t=N(this,Fi,"m",fo).call(this,e))?[2,mr({sentTime:t.sentTime,messageType:t.messageType,messageUId:t.messageUId})]:[2,Cr(ee.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){return v(this,(function(e){return[2,N(this,Fi,"m",No).call(this,[{conversationType:te.ULTRA_GROUP,channelIdValid:!1}])]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n=this;return v(this,(function(i){return t=Xe(e?Be:Fe),r=t.map((function(e){return{conversationType:e,channelId:e===te.ULTRA_GROUP?N(n,Fi,"m",so).call(n,""):"",channelIdValid:e===te.ULTRA_GROUP}})),[2,N(this,Fi,"m",No).call(this,r).trans((function(e){return e.reverse()}))]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,N(this,Fi,"m",mo).call(this,[ot.ONLINE_STATUS,ot.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},[it.iOS,it.Android,it.Web,it.PC,it.Mini,it.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 R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return[2,(r=Ui(this.logger,!1,"saveEditedMessageDraft",Do(t),e.messageUId,e.content))===ee.SUCCESS?mr():Cr(r)]}))}))}}),Object.defineProperty(e.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o;return v(this,(function(a){return t=Ui(this.logger,!1,"getConversationMetadata",Do(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,mr({messageUId:i,content:o})]):[2,mr(null)]}))}))}}),Object.defineProperty(e.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t;return v(this,(function(r){return[2,(t=Ui(this.logger,!1,"removeConversationMetadata",Do(e),["edited_message_draft"]))===ee.SUCCESS?mr():Cr(t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l=this;return v(this,(function(d){return t=e.timestamp,r=e.count,n=e.conversationTypes,i=n.map((function(e){return{conversationType:e,channelId:e===te.ULTRA_GROUP?"RCDefault":"",channelIdValid:e===te.ULTRA_GROUP}})),o=Ui(this.logger,!1,"getUnreadMentionMeConversationsByPageWithTopPriority",i,t,r,!!e.topPriority),a=JSON.parse(o),s=a.code,u=a.list,s!==ee.SUCCESS?[2,Cr(s)]:(c=u.map((function(e){return l._buildConversation(e.obj)})),[2,mr(c)])}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this,void 0,void 0,(function(){var e,t=this;return v(this,(function(r){return[2,(e=Gi.create(this.logger,"getAllRobots")).asyncInvoke((function(r,n){var i=N(t,Fi,"m",Co).call(t,n);r!==ee.SUCCESS?e.fail(r,i):e.ok(i)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o,a=this;return v(this,(function(s){return t=e.conversationTypes,r=e.count,n=e.timestamp,i=e.topPriority,[2,(o=Gi.create(this.logger,"getConversationsIncludingRobots")).invoke(t.map((function(e){return{conversationType:e,channelId:"",targetId:"",channelIdValid:!1}})),n,r,i,(function(e,t){e!==ee.SUCCESS?o.fail(e):o.flush(N(a,Fi,"m",qi).call(a,t,"getConversationsIncludingRobots"))})).result()]}))}))}}),Object.defineProperty(e.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return R(this,void 0,void 0,(function(){var n,i;return v(this,(function(o){switch(o.label){case 0:return[4,this.sendMessage(e,t,r)];case 1:return(n=o.sent()).isOk&&(i=n.data.sentTime,this._clearUnreadCountByTimestamp(e,i)),[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return R(this,void 0,void 0,(function(){var r,n=this;return v(this,(function(i){return[2,(r=Gi.create(this.logger,"getMessagesByUIds")).invoke({conversationQueryParam:b(b({},Do(e)),{channelIdValid:"string"==typeof e.channelId}),messageUIds:t,enableRemoteQuery:!0},(function(e){var t=JSON.parse(e).list.map((function(e){var t=e.message,r=e.messageUId,i=e.code;return{messageUId:r,message:t?N(n,Fi,"m",Qi).call(n,t):void 0,code:i}}));r.ok(t)}),(function(e){r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"_trans2ICppUpdateMessageReactionParam",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.messageUId,n=e.reactionId,i=e.pushConfig;return{messageUId:r,reactionId:n,pushConfig:{forceShowDetail:(null==i?void 0:i.forceShowDetailContent)||!1,templateId:(null==i?void 0:i.templateId)||"",content:(null==i?void 0:i.pushContent)||"",disableTitle:(null==i?void 0:i.disablePushTitle)||!1,id:(null===(t=null==i?void 0:i.androidConfig)||void 0===t?void 0:t.notificationId)||"",data:(null==i?void 0:i.pushData)||"",config:hr(null==i?void 0:i.iOSConfig,null==i?void 0:i.androidConfig,null==i?void 0:i.harmonyOSConfig),title:(null==i?void 0:i.pushTitle)||""}}}}),Object.defineProperty(e.prototype,"addMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"addMessageReaction"),r=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(r,(function(e){return t.flush(Nr.from(e))})).result()}}),Object.defineProperty(e.prototype,"removeMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"removeMessageReaction"),r=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(r,(function(e){return t.flush(Nr.from(e))})).result()}}),Object.defineProperty(e.prototype,"_trans2CppConversationQueryParam",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return{conversationType:t,targetId:r,channelId:t===te.ULTRA_GROUP?N(this,Fi,"m",so).call(this,n):n,channelIdValid:"string"==typeof n}}}),Object.defineProperty(e.prototype,"batchGetMessageReactionSummaries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return R(this,void 0,void 0,(function(){var t,r,n,i,o,a;return v(this,(function(s){switch(s.label){case 0:return t=Gi.create(this.logger,"batchGetMessageReactionSummaries"),r=e.conversationIdentifier,n=e.messageUIds,i={messageUIds:n,conversationQueryParam:this._trans2CppConversationQueryParam(r)},[4,t.invoke(i,(function(e,r){return t.flush(Nr.from(e,"",r))})).result()];case 1:return(o=s.sent()).isOk?(a=JSON.parse(o.data),[2,mr(a)]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReactions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"getMessageReactions"),r=e.pageToken,n={messageUId:e.messageUId,count:e.count,pageToken:r||""};return t.invoke(n,(function(e,r,n){if(e===ee.SUCCESS){var i={pageToken:n,reactions:JSON.parse(r)};t.ok(i)}else t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMessageReactionUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Gi.create(this.logger,"getReactionUsers"),r=e.pageToken,n=e.reactionId,i=e.count,o={messageUId:e.messageUId,reactionId:n,count:i,pageToken:r||""};return t.invoke(o,(function(e,r,n,i){if(e===ee.SUCCESS){var o={totalCount:n,pageToken:i,users:JSON.parse(r)};t.ok(o)}else t.fail(e)})).result()}}),e}();Fi=new WeakSet,Hi=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 ze.CHANNEL_DELETE:n.push({targetId:u,channelId:a,channelType:s,deleteTime:t});break;case ze.PUBLIC_TO_PRIVATE:r.push({targetId:u,channelId:a,changeType:Ze.PUBLIC_TO_PRIVATE,channelType:Qe.PRIVATE});break;case ze.PRIVATE_TO_PUBLIC:r.push({targetId:u,channelId:a,changeType:Ze.PRIVATE_TO_PUBLIC,channelType:Qe.PUBLIC});break;case ze.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:break;case ze.CHANNEL_USER_KICKED:i.push({targetId:u,channelId:a,userId:c,channelType:s});break;case ze.PUBLIC_TO_PRIVATE_USER_NOT_IN:r.push({targetId:u,channelId:a,changeType:Ze.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)},Bi=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=te.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 $e.REMOVE_USER_GROUP:r.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case $e.JOIN_USER_GROUP:n.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case $e.EXIT_USER_GROUP:i.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case $e.CHANNEL_BIND_USER_GROUP:o.push({conversation:{conversationType:s,targetId:t,channelId:l},channelType:d,userGroupIds:u});break;case $e.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)},Ji=function(e,t,r){return R(this,void 0,void 0,(function(){var n,i;return v(this,(function(o){switch(o.label){case 0:return[4,this.getConversation({conversationType:te.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]}}))}))},xi=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:te.ULTRA_GROUP,info:t,hasInfo:!0,hasSummary:!1,summary:[]})},Wi=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:te.ULTRA_GROUP,info:[],hasInfo:!1,hasSummary:!0,summary:t})},Yi=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)},Ki=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)},Xi=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:Ot,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:Vt.UNREAD,receivedStatusInfo:cr(Vt.UNREAD)}}));r.length>0&&(r.slice().forEach((function(e){return N(t,Fi,"m",ro).call(t,e,"ugRecall")})),this._dispatchEvent("ultraGroupMessageRecalled",r))},Qi=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,R=e.forcePushDetail,v=e.hasMore,I=e.directedUsers,O=e.noNotification,T=e.disableUpdateLastMessage,N=e.needReceipt,m=e.sendReceipt,C=e.contentRecognition,S=e.convertExt,y=e.editTime,A=e.editContent,P=e.editStatus,L=e.quotedMsgStatus,M=e.hasChanged,U=e.quoteInfo,D=e.hasReactions,w=e.conversationType,j=e.targetId,V=e.messageUid,G=this._parseMessageJsonContent(i,u),k=!!G.mentionedInfo;if(o===Ot&&n===this.tcpMgr.getCurrentUserId()&&(w=G.conversationType,j=G.targetId,V=G.messageUId),S){var F=JSON.parse(S);if(F.trans){var H=F.trans,B={targetLanguage:H.targetLanguage,translatedText:H.translatedText,status:H.translateStatus};G.translateInfo=B}}if(o===gt||o===bt){var J=C?JSON.parse(C):{status:Qt,text:"",visible:!1},x={status:J.status,text:J.text,isVisible:J.visible};G.sttInfo=x}var W,Y,K=(W=o,mn.get(W)||{isPersited:!1,isCounted:!1,isStatusMessage:!1}),X=this._buildSupportExt(d,e),Q=void 0===(Y=t)||"[object Undefined]"===Object.prototype.toString.call(Y)?c<this.tcpMgr.getConnectedTime():t,Z={};E&&(Z=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 q=b(b({},Z),{pushTitle:_,pushContent:f,pushData:f,disablePushTitle:g,forceShowDetailContent:R,templateId:h}),z={channelId:r,conversationType:w,targetId:j,senderUserId:n,content:G||{},messageType:o,messageUId:V||"",messageDirection:a,isOffLineMessage:Q,sentTime:c,receivedTime:0,isPersited:K.isPersited,isCounted:K.isCounted,isMentioned:k,disableNotification:O,isStatusMessage:K.isStatusMessage||!1,canIncludeExpansion:d,expansion:d?X:null,receivedStatus:0,receivedStatusInfo:void 0,sentStatus:void 0,messageId:u,pushConfig:q,hasMore:v,directedUserIds:I||[],disableUpdateLastMessage:T,needReceipt:N,sendReceipt:m,hasReactions:D};if(U&&(z.quoteInfo=U),a===dt.RECEIVE?(z.receivedStatus=s,z.receivedStatusInfo=cr(s)):z.sentStatus=s,l){var $=this._handleReadReceiptRequest(l);z.readReceiptInfo=$}return w===te.ULTRA_GROUP?z.isModifyMessage=!!M:(z.isModifyMessage=!(!y&&!P),z.isModifyMessage&&(z.modifyInfo={timestamp:y,content:A?JSON.parse(A):{},status:P})),o===It&&(z.content.referMsgStatus=L),z},Zi=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=e.includeRobot,b=e.entrustInfo,R=-1===JSON.parse(i).messageId?null:this._buildMessage(i),v=h?JSON.parse(h):{},I=v.edited_message_draft?JSON.parse(v.edited_message_draft):void 0,O=JSON.parse(b),T={name:O.name,portraitUri:O.portraitUrl};return{channelId:t,conversationType:r,targetId:n,channelType:E,unreadMessageCount:c,unreadMentionedCount:l,unreadMentionedMeCount:d,hasMentioned:u,latestMessage:R,notificationStatus:Yt(a),isTop:o,lastUnreadTime:0,matchCount:s,operationTime:f,notificationLevel:a,draft:_,translateStrategy:p,editedMessageDraft:I?{messageUId:I.msg_uid,content:I.content}:void 0,includeRobot:!!g,dataMgmtInfo:T}},qi=function(e,t){var r=this;try{var n=JSON.parse(e).list.map((function(e){return r._buildConversation(e.obj)}));return mr(n)}catch(e){var i="parse conversation list result error, method: ".concat(t);return Cr(ee.MAIN_PROCESS_ERROR,i)}},zi=function(e){var t,r=e.messageType,n=e.targetId;if(r===Mt){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===Ut){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===Dt){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===$.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===wt){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},$i=function(e){var t=JSON.parse(e),r=N(this,Fi,"m",Qi).call(this,t,!1),n=r.messageType,i=r.conversationType;if(n!==Ot||i!==te.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)}},eo=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=N(r,Fi,"m",Qi).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()},to=function(e){0!==e.length&&Ui(this.logger,!1,"setExtraMessageInBatches",e)},ro=function(e,t){var r,n=e.content,i=n.messageUId,o=n.sentTime,a=n.isAdmin,s=n.isDelete,u=n.extra,c=this.logger.createTraceId();if(this.logger.info(yn.L_HADNLE_RECALL_CMD_T,JSON.stringify({recalledMessageUId:i,isDelete:s,source:t}),c),"number"!=typeof o||"string"!=typeof i||!i.length)return this.logger.warn(yn.L_HADNLE_RECALL_CMD_R,"Invalid message",c),!1;var l=N(this,Fi,"m",bo).call(this,i);if(!l.isOk)return this.logger.info(yn.L_HADNLE_RECALL_CMD_R,"Msg Not Found",c),!1;var d=l.data;if(s)return N(this,Fi,"m",Eo).call(this,[d.messageId],o),this.logger.info(yn.L_HADNLE_RECALL_CMD_R,"Delete Msg, messageId: ".concat(d.messageId),c),!0;if(d.messageType===Tt)return this.logger.info(yn.L_HADNLE_RECALL_CMD_R,"Msg has been processed",c),!1;(null===(r=d.receivedStatusInfo)||void 0===r?void 0:r.isRead)||N(this,Fi,"m",vo).call(this,d.messageId,1,o);var f={operatorId:e.senderUserId,recallTime:d.sentTime,originalObjectName:d.messageType,originalMessageContent:d.content,recallActionTime:e.sentTime,admin:!!a,delete:!!s,isDelete:!!s,extra:u};return e.content.user&&(f.user=e.content.user),e.content.extra&&(f.extra=e.content.extra),d.messageType===ht&&(f.recallContent=d.content.content),N(this,Fi,"m",Ro).call(this,d.messageId,JSON.stringify(f),Tt),this.logger.info(yn.L_HADNLE_RECALL_CMD_R,"Replace Msg with RC:RcNtf, messageId: ".concat(d.messageId),c),!0},no=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=Ui(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}},io=function(e,t){return R(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return v(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=Gi.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 0===i&&n.reverse(),{list:n,hasMore:!!r}}))]}}))}))},oo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;Ui(this.logger,!1,"clearMessages",t,r,n||"")},ao=function(e,t,r){Ui(this.logger,!1,"deleteChatroomMessageAndKV",e,t,r)},so=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=Ui(this.logger,!1,"getConversation",t,r,n||"");return i?this._buildConversation(i):null},co=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return Ui(this.logger,!0,"getUnreadCount",t,r,n||"")},lo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return Ui(this.logger,!1,"clearUnreadCount",t,r,n||"")},fo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=Ui(this.logger,!0,"getTheFirstUnreadMessage",t,r,n||""),o=this._buildMessage(i);return-1!==o.messageId?o:null},_o=function(e,t,r,n,i,o){var a=this.logger.createTraceId(),s=Gi.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()},po=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=t.quoteInfo,I=d||0,O={};if(g)for(var T in g)O[T]={v:g[T],ts:I};var N=function(){},m=Ui(this.logger,!0,"insertMessage",r,n,a,s,JSON.stringify(o),N,N,u,c||1,l||30,I,f||"",_?0:1,p||"",!!E,!!h,JSON.stringify(O),i||"",b||[],!!R,(null==v?void 0:v.messageUId)||"",(null==v?void 0:v.senderId)||"",(null==v?void 0:v.objectName)||"",(null==v?void 0:v.quoteMessageStatus)||0),C=this._buildMessage(m,!1);return C.messageUId=p,C.sentTime=d,C},Eo=function(e,t){void 0===t&&(t=0),Ui(this.logger,!1,"deleteMessages",e,t)},ho=function(e,t,r){Ui(this.logger,!1,"deleteMessagesByTimestamp",e.conversationType,e.targetId,t,r,e.channelId||"")},go=function(e){var t=Ui(this.logger,!0,"getMessage",e),r=JSON.parse(t);return r.messageId<=0?Cr(ee.RC_DB_DATA_NOT_FOUND,"msg not found: ".concat(e)):mr(r)},bo=function(e){var t=this;return N(this,Fi,"m",go).call(this,e).trans((function(e){return N(t,Fi,"m",Qi).call(t,e,!1)}))},Ro=function(e,t,r){return Ui(this.logger,!1,"setMessageContent",e,t,r)},vo=function(e,t,r){void 0===r&&(r=0),Ui(this.logger,!1,"setMessageReceivedStatus",e,t,r)},Io=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=Ui(this.logger,!0,"getConversations",JSON.stringify(r));return JSON.parse(n).list.map((function(e){return t._buildConversation(e.obj)}))},Oo=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},To=function(e,t){try{var r=JSON.parse(e).list;t(N(this,Fi,"m",Oo).call(this,r))}catch(t){this.logger.error(yn.P_PARSE_JSON_MSGS_E,e)}},No=function(e){var t=Ui(this.logger,!1,"getBlockedConversations",e);return N(this,Fi,"m",qi).call(this,t,"getBlockedConversations")},mo=function(e,t){return R(this,void 0,void 0,(function(){var r;return v(this,(function(n){return[2,(r=Gi.create(this.logger,"getSubscribeStatusByUserIds",this.logger.createTraceId())).invoke(e,t,(function(e,t){e!==ee.SUCCESS?r.fail(e):r.ok(t)})).result()]}))}))},Co=function(e){return JSON.parse(e).list.map((function(e){var t=JSON.parse(e);return{robotId:t.robotId,name:t.robotName,portraitUri:t.robotPortrait,robotType:t.robotType,metadata:t.metadata?JSON.parse(t.metadata):{},createTime:t.createTime,updateTime:t.updateTime}}))};var Go=function(){function r(e){var r=this;Object.defineProperty(this,"_rendererInitOptions",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_senders",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this._svr=new Vo(e,this._send2AllRenderer.bind(this)),this._initIpcEventListeners(),t.app.on("before-quit",(function(){return r.destroy()})),t.app.on("window-all-closed",(function(){return r.destroy()}))}return Object.defineProperty(r,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(N(this,wo,"f",jo))return N(this,wo,"f",jo);if(!n.appkey)throw new Error("Initializ failed, `appkey` is required!");var i={appkey:n.appkey,dbpath:n.dbpath||e.resolve(t.app.getPath("userData")),logOutputLevel:n.logOutputLevel||zr.WARN,enableSyncEmptyTopConversation:!!n.enableSyncEmptyTopConversation,disableLogReport:!!n.disableLogReport,eventLoopBlockingCheck:!!n.eventLoopBlockingCheck,environment:n.environment||"default",reconnectKickEnable:!!n.reconnectKickEnable,runInMainProcess:!!n.runInMainProcess};return m(this,wo,new r(i),"f",jo),N(this,wo,"f",jo)}}),Object.defineProperty(r.prototype,"_initIpcEventListeners",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;t.ipcMain.on("__RC_CHANNEL_CALL_MAIN_SYNC__",(function(t,r){for(var n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];t.returnValue=(n=e._svr[r]).call.apply(n,T([e._svr],O(i),!1))})),t.ipcMain.on("__RC_CHANNEL_CALL_MAIN__",(function(t,r,n){for(var i=t.sender,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return R(e,void 0,void 0,(function(){var e,t,a,s,u,c,l,d,f,_,p=this;return v(this,(function(E){switch(E.label){case 0:return this._senders.has(i)?("sendMessage"===n?(t=O(o,4),d=t[0],a=t[1],s=t[2],u=t[3],e=this._svr.sendMessage(d,a,s,(function(e){p._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",u,e)}))):"refreshReferenceMessageWithParams"===n?(c=O(o,4),l=c[0],d=c[1],f=c[2],_=c[3],e=this._svr.refreshReferenceMessageWithParams(l,d,(function(e){p._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",f,e)}),(function(e){p._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",_,e)}))):e=this._svr[n].apply(this._svr,o),e instanceof Promise?[4,e]:[3,2]):(this._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",r,Cr(ee.BIZ_ERROR_CLIENT_NOT_INIT)),[2]);case 1:e=E.sent(),E.label=2;case 2:return this._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",r,e),[2]}}))}))})),t.ipcMain.on("__RC_CHANNEL_SEND_2_MAIN__",(function(t,r){for(var n=t.sender,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];e._senders.has(n)&&e._svr[r].apply(e._svr,i)})),t.ipcMain.on("__RC_INNER_COMMAND_INIT__",this._registerRenderers.bind(this))}}),Object.defineProperty(r.prototype,"_registerRenderers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if("7f954602d659cfb16f91987f74aee812abaa6188"===t.commitId){var n=e.sender;this._rendererInitOptions||(this._rendererInitOptions=t,this._svr.setRenderInitOption(t)),this._senders.has(n)||(this._senders.add(n),n.once("destroyed",(function(){r._senders.delete(n)})))}}}),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()?this._senders.delete(e):e.send.apply(e,T([t],O(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];this._senders.forEach((function(n){t._send2Renderer.apply(t,T([n,"__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",e],O(r),!1))}))}}),Object.defineProperty(r.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(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._svr.destroy()}}),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._svr.getDeviceId()}}),Object.defineProperty(r.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._svr.getConnectedTime()}}),Object.defineProperty(r.prototype,"setDatabaseOperationTimeThreshold",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._svr.setDataBaseLogConfig(e)}}),r}();wo=Go,jo={value:void 0};module.exports=function(e){return Go.init(e)};
15
+ ***************************************************************************** */function I(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))}function g(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}function T(e,t,s,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!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"===r?i.call(e,s):i?i.value=s:t.set(e,s),s}!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"}(R||(R={}));const N="L-connect-T",C="L-connect-R",O="L-connect-S",p="L-TEST-O",S="L-get_navi-T",A="L-get_navi-R",f="L-request-T",m="L-request-R",v="L-parse_navi-E",P="L-rejoin_chatroom-T",L="L-rejoin_chatroom-R",M="L-check_alive_im-T",U="L-check_alive_im-R",D="L-check_alive_im-S",b="L-report_full_log-O",y="L-report_full_log-T",V="L-report_full_log-R",G="L-parse_navi_logpolicy-E",k="A-remove_proxy-O",F="L-set_proxy-O",w="L-test_proxy-T",H="L-test_proxy-R",B="L-get_static_conf-T",J="L-get_static_conf-R",j="L-get_static_conf-E",x="L-cloud_disabled",W="L-cloud_overclock",Y="L-cloud_appkey_region_error",K="L-cloud_config_data_error",X="L-cloud_set_area_code-O",Q="L-cloud_set_mrtr-O",$="L-parse_json-E",Z="L-event_loop_blocking-S",q="P-get_sys_version-E",z="L-pull_offline_message_finished-S";var ee,te,se,re,ie,ne,oe,ae,ce,_e,le,de,Ee,ue,Re,he,Ie,ge,Te,Ne,Ce,Oe,pe,Se,Ae,fe,me,ve,Pe,Le;!function(e){e[e.BOTH=2]="BOTH"}(ee||(ee={})),function(e){e[e.BOTH=2]="BOTH"}(te||(te={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(se||(se={})),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"}(re||(re={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(ie||(ie={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(ne||(ne={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(oe||(oe={})),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"}(ae||(ae={})),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"}(ce||(ce={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(_e||(_e={})),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"}(le||(le={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(de||(de={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(Ee||(Ee={})),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"}(ue||(ue={})),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"}(Re||(Re={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(he||(he={})),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"}(Ie||(Ie={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(ge||(ge={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(Te||(Te={})),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"}(Ne||(Ne={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(Ce||(Ce={})),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"}(Oe||(Oe={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(pe||(pe={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Se||(Se={})),function(e){e[e.LeaveOnMyOwn=1]="LeaveOnMyOwn",e[e.OtherDeviceLogin=2]="OtherDeviceLogin"}(Ae||(Ae={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(fe||(fe={})),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"}(me||(me={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(ve||(ve={})),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.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",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_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",e[e.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",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.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",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.MSG_REACTION_LIMIT_REACHED=26323]="MSG_REACTION_LIMIT_REACHED",e[e.MSG_REACTION_USER_LIMIT_REACHED=26324]="MSG_REACTION_USER_LIMIT_REACHED",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_DECODE_ERROR=32546]="PROTOCOL_DECODE_ERROR",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.METHOD_BUSY=33103]="METHOD_BUSY",e[e.NOT_ALLOW_PULL_CONVERSATION=33301]="NOT_ALLOW_PULL_CONVERSATION",e[e.SDK_PULL_CONVERSATION=33302]="SDK_PULL_CONVERSATION",e[e.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",e[e.QUOTE_MSG_NOT_FOUND=33403]="QUOTE_MSG_NOT_FOUND",e[e.INVALID_PARAMETER_QUOTE_INFO=33404]="INVALID_PARAMETER_QUOTE_INFO",e[e.REACTION_ID_INVALID=33405]="REACTION_ID_INVALID",e[e.INVALID_PARAMETER_UNREAD_COUNT_FILTER=33406]="INVALID_PARAMETER_UNREAD_COUNT_FILTER",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_REQUEST_URL=34208]="INVALID_PARAMETER_REQUEST_URL",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_NOTMEDIAMESSAGE=34223]="INVALID_PARAMETER_NOTMEDIAMESSAGE",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.INVALID_PARAMETER_PAGE_TOKEN=34346]="INVALID_PARAMETER_PAGE_TOKEN",e[e.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN=34435]="SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN",e[e.SERVER_RECORD_UNREAD_COUNT_DISABLED=34436]="SERVER_RECORD_UNREAD_COUNT_DISABLED",e[e.DATABASEDISKFULL=34439]="DATABASEDISKFULL",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_ERROR=35053]="DNS_PROXY_DATA_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.MSG_BLOCK_SEND=35066]="MSG_BLOCK_SEND",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"}(Pe||(Pe={})),function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(Le||(Le={}));const Me=0,Ue=1,De=2,be=3,ye=4,Ve=5,Ge=6,ke=7,Fe=e=>{const t=[Le.PRIVATE,Le.GROUP,Le.SYSTEM,Le.PUBLIC_SERVICE,Le.APP_PUBLIC_SERVICE];switch(e){case Me:return t;case Ue:return[Le.PRIVATE,Le.GROUP];case De:return[...t,Le.ULTRA_GROUP];case be:return[...t,Le.ULTRA_GROUP,Le.CHATROOM];case ye:return[...t,Le.ULTRA_GROUP,Le.CHATROOM,Le.RTC_ROOM,Le.CUSTOMER_SERVICE,Le.DISCUSSION];case Ve:return[Le.PRIVATE,Le.GROUP,Le.ULTRA_GROUP];case Ge:return[Le.GROUP];case ke:return[Le.PRIVATE]}};var we,He,Be;!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"}(we||(we={})),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"}(He||(He={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(Be||(Be={}));const Je="RC:TxtMsg",je="RC:VcMsg",xe="RC:HQVCMsg",We="RC:LogCmdMsg",Ye="RC:MsgExMsg",Ke="RC:ReferenceMsg",Xe="RC:RcCmd",Qe="RC:RcNtf",$e="RC:ReadNtf",Ze="RC:RRReqMsg",qe="RC:RRRspMsg",ze="RC:SRSMsg",et="RC:RRMsg",tt="RC:RSMsg",st="RC:Delivered",rt="RC:DRMsg",it="RC:ChrmMemChange",nt="RC:ChrmSyncMsg",ot="RC:ChrmBlockMsg",at="RC:ChrmBanMsg",ct="RC:CCConfigChangeRequestMsg",_t="RC:CmdMsg",lt="RC:CmdNtf",dt="RC:InfoNtf",Et="RC:GrpNtf";var ut,Rt,ht,It,gt,Tt,Nt,Ct,Ot,pt,St,At,ft,mt,vt,Pt,Lt,Mt,Ut,Dt,bt;!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(ut||(ut={})),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"}(Rt||(Rt={})),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"}(ht||(ht={})),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"}(It||(It={})),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"}(gt||(gt={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(Tt||(Tt={})),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"}(Nt||(Nt={})),function(e){e[e.typing=0]="typing"}(Ct||(Ct={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(Ot||(Ot={})),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"}(pt||(pt={})),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"}(St||(St={})),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"}(ft||(ft={})),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"}(vt||(vt={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(Pt||(Pt={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(Lt||(Lt={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Mt||(Mt={})),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"}(Ut||(Ut={})),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"}(Dt||(Dt={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(bt||(bt={}));const yt=e=>e<=Dt.NOT_SET?bt.CLOSE:bt.OPEN;var Vt,Gt,kt,Ft,wt,Ht,Bt,Jt,jt;!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"}(Vt||(Vt={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Gt||(Gt={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(kt||(kt={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Ft||(Ft={})),function(e){e[e.CURRENT=2]="CURRENT"}(wt||(wt={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ht||(Ht={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Bt||(Bt={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Jt||(Jt={})),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"}(jt||(jt={}));const xt=0,Wt=0,Yt=0;var Kt,Xt;!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"}(Kt||(Kt={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(Xt||(Xt={}));const Qt=72e5,$t=6e4,Zt="5.44.0".replace(/-.+$/,""),qt="rongcloudsystem",zt="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{},es="engine";zt[es]="5.44.0-alpha.1";class ts{static add(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)&&(zt[e]=t)}static validEngine(e){const t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;const s=t[0].split(".").map((e=>e.padStart(3,"0"))).join("");return zt[es].match(/\d+\.\d+\.\d+/)[0].split(".").map((e=>e.padStart(3,"0"))).join("")>=s}static getInfo(){return zt}}const ss={gen:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)})),genWithLen(e=22){const t=Date.now(),s=t.toString(36),r=Math.floor(Math.random()*t).toString(36),i=e-s.length-r.length;var n;return[r,s,i>0?(n=i,Array.from({length:n}).map((()=>Math.floor(36*Math.random()).toString(36))).join("")):""].join("").slice(0,e)}},rs=ss.genWithLen(22),is=Date.now(),ns=e=>-1!==Object.prototype.toString.call(e).indexOf("Array"),os=e=>(e=>"string"==typeof e)(e)&&/https?:\/\//.test(e),as=e=>{for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},cs=e=>({isRead:(e&Vt.READ)===Vt.READ,isListened:(e&Vt.LISTENED)===Vt.LISTENED,isDownload:(e&Vt.DOWNLOADED)===Vt.DOWNLOADED,isRetrieved:(e&Vt.RETRIEVED)===Vt.RETRIEVED}),_s=e=>[pt.iOS,pt.Android,pt.Web,pt.PC,pt.Mini,pt.HarmonyOS].map((t=>{const s=e.findIndex((e=>e.platform===t));return-1===s?{platform:t,changeTime:0,eventValue:0}:e[s]})),ls=(e,t,s)=>t?1===s?we.TLS:we.RMTP:"http"===e?we.WS:we.WSS,ds=(e,t)=>{const{server:s,backupServer:r,bs:i,serverAddr:n,protocol:o,openTLS:a}=e;if(n){return[...n.filter((e=>e.addr))]}const c=[],_=[];return s&&_.push(s),(r||i||"").split(",").forEach((e=>{_.indexOf(e)<0&&_.push(e)})),_.forEach(((e,r)=>{e&&c.push({addr:e,protocol:ls(o,t,a),weight:s.length-r,race:!1})})),[...c]},Es=e=>{if(void 0===e)return;const t=Number(e);return Number.isNaN(t)?void 0:t},us=e=>e.reduce(((e,t)=>(e[t.key]=t.value,e)),{}),Rs=(e,t)=>{const s=Math.floor(1e3*Math.random()%1e4),r=ss.gen(),i=(e=>{e=e||"-";const t=new Date;return`${t.getFullYear()}${e}${t.getMonth()+1}${e}${t.getDate()}`})(),n=(new Date).getTime();let o="";if(t){const e=t.split(".");o=`.${e[e.length-1]}`}return`${e}__RC-${i}_${s}_${n}${r}${o}`},hs=(e={},t={},s={})=>{const{channelIdMi:r,channelIdHW:i,channelIdOPPO:n,typeVivo:o,importanceHW:a,categoryHW:c,imageUrlHW:_,categoryVivo:l,importanceHonor:d,imageUrlHonor:E}=t,{APNS:u,FCM:R}=((e={},t={})=>{const{threadId:s,apnsCollapseId:r,category:i,richMediaUri:n,interruptionLevel:o}=e,{googleConfig:a}=t,c={};c["thread-id"]=s||"",c["apns-collapse-id"]=r||"",c.category=i||"",c.richMediaUri=n||"",c["interruption-level"]=o||"active";const _={};_.collapse_key=null==a?void 0:a.collapseKey,_.imageUrl=null==a?void 0:a.imageUrl;let l=null==a?void 0:a.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),_.priority=l,{APNS:c,FCM:_}})(e,t),h=[{HW:{channelId:i||"",importance:a||"NORMAL",image:_||"",category:c||""}},{MI:{channelId:r||""}},{OPPO:{channelId:n||""}},{VIVO:{classification:o||"",category:l||""}},{APNS:u},{FCM:R},{HONOR:{importance:d||Mt.NORMAL,image:E||""}},{OHOS:{category:s.category||null,image:s.image||""}}];return JSON.stringify(h)},Is=()=>{const e=ts.getInfo();let t="electron";for(let s in e)"engine"!==s&&(t=["imlib-v2-adapter","imlib-next"].includes(s)?s:"electron");return t};function gs(e,t){var s;if(!e)return"";const r="undefined"!=typeof window&&"https:"===(null===(s=null===window||void 0===window?void 0:window.location)||void 0===s?void 0:s.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==we.HTTP||r?`https://${e}`:`http://${e}`}const Ts=(e,t)=>{if(!e)return"";const{ossConfig:s=""}=e;let r="";try{const e=JSON.parse(s);if(e.length>0){const t=e.find((e=>e.minio));t&&(r=t.minio)}}catch(e){t.warn($,JSON.stringify({ossConfig:s,error:e}))}return r};var Ns;class Cs{constructor(){Ns.set(this,!1)}stopPropagation(){T(this,Ns,!0,"f")}get isStopPropagation(){return g(this,Ns,"f")}}Ns=new WeakMap;class Os{constructor(){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 Map})}_addItem(e,t,s,r,i=0){const n=Symbol(),o=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:n,priority:Math.min(i,100),listener:t.bind(r),once:s},c=o.findIndex((e=>e.priority>i));return-1===c?o.push(a):o.splice(c,0,a),n}on(e,t,s,r=0){return this._addItem(e,t,!1,s,r)}once(e,t,s,r=0){return this._addItem(e,t,!0,s,r)}off(e){for(let[t,s]of this._map){const t=s.findIndex((t=>t.symbol===e));if(-1!==t)return void s.splice(t,1)}}emit(e,...t){const s=this._map.get(e);if(s&&s.length>0){const e=new Cs;for(let r=0;r<s.length;r+=1){const{once:i,listener:n}=s[r];i&&s.splice(r,1);try{n(e,...t)}catch(e){null===console||void 0===console||console.error(e)}if(e.isStopPropagation)return}}[...this._piped.entries()].forEach((([s,r])=>{(0===r.length||r.includes(e))&&s.emit(e,...t)}))}removeAll(e){this._map.delete(e)}clear(){this._piped.clear(),this._map.clear()}pipe(e,t){this._piped.set(e,t||[])}}class ps{constructor(e,t,s){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=s}static from(e,t,s){return new ps(e,t||`fail: ${e}`,s)}static ok(e,t){return new ps(0,t||"success",e)}static fail(e,t,s){return new ps(e,t||`fail: ${e}`,s)}next(e){return I(this,void 0,void 0,(function*(){return this.isOk?e(this.data):this.wipe()}))}or(e){return I(this,void 0,void 0,(function*(){return this.isOk?this:e(this.code)}))}orSync(e){return this.isOk?this:e(this.code)}trans(e){return this.isOk?Ss(e(this.data)):this.wipe()}tryTrans(e){return this.isOk?e(this.data):this.wipe()}errmsg(){return JSON.stringify({code:this.code,msg:this.msg})}wipe(){return this.isOk?Ss(void 0,this.msg):As(this.code,this.msg)}}const{ok:Ss}=ps,{fail:As}=ps,fs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function ms(e){let t,s,r,i,n,o,a,c="",_=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");_<e.length;)i=fs.indexOf(e.charAt(_++)),n=fs.indexOf(e.charAt(_++)),o=fs.indexOf(e.charAt(_++)),a=fs.indexOf(e.charAt(_++)),t=i<<2|n>>4,s=(15&n)<<4|o>>2,r=(3&o)<<6|a,c+=String.fromCharCode(t),64!==o&&(c+=String.fromCharCode(s)),64!==a&&(c+=String.fromCharCode(r));return c}const vs=()=>{let e,t=new Promise((t=>{e=t}));return{resolve:e,promise:t}};function Ps(e){if(!e||0===e.length)return[];const t=new Set;return e.forEach((e=>{t.add(e)})),Array.from(t)}var Ls;!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Ls||(Ls={}));const Ms=0,Us=1;var Ds;!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",e[e.OM=6]="OM"}(Ds||(Ds={}));const bs={[Ds.BJ]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:we.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},[Ds.SG]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:we.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},[Ds.NA]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:we.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},[Ds.SG_B]:{naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:we.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},[Ds.SA]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:we.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},[Ds.OM]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:we.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]}};function ys(e){return Ds[e]?e:Ds.BJ}const Vs=new class{constructor(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}init(e){this.initOption=e}getNaviUrlList(e,t){const{areaCode:s,navigators:r}=this.initOption||{},i=function(e=Ds.BJ){return bs[ys(e)].naviUrlBase64}(s).map((e=>ms(e)));let n=[];const[,o]=e.split("@");t&&(n=o?o.split(";"):[]);const a=r&&r.length>0?[...n,...r]:[...n,...i];return a.filter(((e,t)=>a.indexOf(e)===t)).map((e=>gs(e)))}getLogUrlPolicyList(e,t){const{log:s,logPolicy:r}=e||{},{areaCode:i,logServerUrl:n}=this.initOption||{},o=function(e=Ds.BJ){return bs[ys(e)].logUrlBase64}(i).map((e=>Object.assign(Object.assign({},e),{addr:ms(e.addr)}))),a=[],c={level:1,itv:6,times:5};if(s)a.push(...s.addrs),Object.assign(c,s.policy);else if(r)try{const e=JSON.parse(r);a.push({addr:e.url,protocol:we.HTTPS,weight:1}),c.level=e.level,c.itv=e.itv,c.times=e.times}catch(s){t.warn(G,JSON.stringify({policy:e.logPolicy}))}const _=n?[{addr:n,protocol:we.HTTPS,weight:101},...a]:[...a,...o];return{policy:c,addrs:_.filter(((e,t)=>_.findIndex((t=>t.addr===e.addr&&t.protocol===e.protocol))===t)).map((e=>Object.assign(Object.assign({},e),{addr:gs(e.addr,e.protocol)}))).sort(((e,t)=>t.weight-e.weight))}}getMiniCmpUrlList(){var e;const t=function(e=Ds.BJ){return bs[ys(e)].miniCmpBase64}(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((e=>ms(e))),{miniCMPProxy:s}=this.initOption||{};return s&&s.length>0?s:t}getStaticConfigUrl(){var e;return function(e=Ds.BJ){return bs[ys(e)].staticConfigUrlBase64}(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((e=>ms(e)))}getCloudControllerUrl(e){var t;return function(e=Ds.BJ){return bs[ys(e)].cloudControllerUrlBase64}(null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((e=>ms(e)))}getAreaCode(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:Ds.BJ}setAreaCode(e){return!(!e||!Ds[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}getStatsUrlList(e){var t;const{active:s,activeServer:r}=e||{};let i=(null==s?void 0:s.addrs)||[];const n=function(e=Ds.BJ){return bs[ys(e)].statsUrlBase64}(null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((e=>ms(e))),o=[];return 0!==i.length?o.push(...i.sort(((e,t)=>t.weight-e.weight)).map((e=>gs(e.addr,e.protocol)))):r&&o.push(gs(r,we.HTTPS)),n.forEach((e=>{o.includes(e)||o.push(e)})),o}};class Gs{constructor(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:[]})}getStaticConfig(){var e;return I(this,void 0,void 0,(function*(){const t=this.getCache();if(t){try{const e=JSON.parse(t);if(Date.now()-(null==e?void 0:e.time)<18e5){const t=(yield this.decryptData(e.val)).resources.navi.slice();return t.sort(((e,t)=>t.weight-e.weight)),{navi:t.map((e=>gs(e.addr,e.protocol)))||[]}}}catch(e){this.logger.error(j,JSON.stringify({error:null==e?void 0:e.stack}))}this.clearCache()}const s=yield this._requestHandle();if(!s)return;const r=yield this.decryptData(s);if((null==r?void 0:r.areaCode)!==Vs.getAreaCode())return;this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==r?void 0:r.bootstrap)||[];const i=null===(e=null==r?void 0:r.resources)||void 0===e?void 0:e.navi.slice();return i.sort(((e,t)=>t.weight-e.weight)),{navi:i.map((e=>gs(e.addr,e.protocol)))||[]}}))}_requestHandle(){return I(this,void 0,void 0,(function*(){let e=[...this.staticUrls,...Vs.getStaticConfigUrl()].map((e=>gs(e)));e=e.filter(((t,s)=>e.indexOf(t)===s));for(let t of e){this.logger.info(B,JSON.stringify({url:t}));const e=Date.now(),{code:s,data:r}=yield this.sendRequest(`${t}/${this.appkey}`);if(200===s)return this.logger.info(J,JSON.stringify({url:t,code:s,duration:Date.now()-e})),r;this.logger.warn(J,JSON.stringify({url:t,code:s,duration:Date.now()-e}))}}))}}var ks;!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"}(ks||(ks={}));class Fs{constructor(e,t,s,r){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:ks.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,ks.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,ks.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,ks.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,ks.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,ks.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}_write(e){const{tag:t,level:s,content:r,traceId:i}=e;/^[\w-]+$/.test(t)?s!==ks.DEBUG&&this.proxy.write(e):console.error(`${(new Date).toISOString()}[${this._id}]['ERROR']: ${t} | ${r} | ${i}`)}createTraceId(){return""+ ++Fs._traceIdCount}getSessionId(){return rs}_stdout(e){const{time:t,tag:s,content:r,traceId:i,level:n,loggerId:o}=e;if(!console)return;if(n<=ks.FATAL)return;if(n>this.outputLevel)return;const a=["error","warn","info","debug"][n-1],c=`${new Date(t).toISOString()}[${null!=o?o:this._id}][${(a||"stat").toUpperCase()}]: ${s} | ${r} | ${i}`;console[a||"warn"](c)}setOutputLevel(e){(e=>[ks.DEBUG,ks.INFO,ks.WARN,ks.ERROR].some((t=>t===e)))(e)&&(this.outputLevel=e)}_log(e,t,s,r){const i={time:Date.now(),level:e,tag:t,content:s,traceId:r,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}summary(e,t,s,r={},i,n){if(t.isOk){const n=null==i?void 0:i(t.data);this.info(e,JSON.stringify(Object.assign(Object.assign({isOk:!0},r),n)),s)}else{const i=null==n?void 0:n(t.data);this.warn(e,JSON.stringify(Object.assign(Object.assign({code:t.code,msg:t.msg},r),i)),s)}}}Object.defineProperty(Fs,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0});class ws{constructor(e,t,s,r,i=!1){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:i}),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})}_getLogs(e,t,s,r,i,n){return I(this,void 0,void 0,(function*(){let i=[];try{const o=yield this.logDB.read(e,t,s,r,n);ns(o.logs)&&(i=o.logs.filter((e=>!(!e||"object"!=typeof e))))}catch(e){}return{logs:i}}))}checkStart(e,t){return I(this,void 0,void 0,(function*(){if(this.started)return;if(this.userId=e.userId,!e.logSwitch||this.disableLogReport)return;const{policy:s,addrs:r}=Vs.getLogUrlPolicyList(e,this.logger);this.started=!0,this.itvByNavi=s.itv,this.timesByNavi=s.times,r.length>0&&this.realtimeReport(r[0].addr,s.level,s.itv,t)}))}_sendLogs2Realtime(e,t,s,r){return I(this,void 0,void 0,(function*(){const{success:i,data:n}=yield this.compressLogs(e);if(!i)return{isOk:!1,itv:r};let o=os(s)?s:`https://${s}`;o+=`?version=5.44.0-alpha.1&appkey=${this.appkey}&userId=${encodeURIComponent(this.userId)}&deviceId=${this.getDeviceId()}&deviceInfo=${this.deviceInfo}&platform=Web`;const{status:a,data:c}=yield this.send({url:o,body:n,method:"POST"});if(200!==a)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,{isOk:!1,itv:r};let _,l;if(this.reportFailedNumber=0,c)try{const e=JSON.parse(c);e.nextTime&&(r=e.nextTime),_=e.level,l=e.logSwitch}catch(e){this.logger.warn($,JSON.stringify({error:null==e?void 0:e.stack}),t)}return{isOk:!0,itv:r,level:_,logSwitch:l}}))}realtimeReport(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=Date.now(),n=this.logger.getTimestamp4RealtimeLog()||is,o=Math.max(i-3e4,n+1),a=this.logger.createTraceId(),{logs:c}=yield this._getLogs(n,o,t,!0,a,r);if(0===c.length);else if(c.length>0){const{itv:r,level:i,logSwitch:n,isOk:o}=yield this._sendLogs2Realtime(c,a,e,s);if(o){const e=Math.max(...c.map((e=>e.time)));this.logger.setTimestamp4RealtimeLog(e+1),0===n&&(this.started=!1),void 0!==i&&(t=i)}s=r}this.started&&(s>=60&&this.itvByNavi<60&&(s=60),this.timer=setTimeout((()=>this.realtimeReport(e,t,s,r)),1e3*s))}))}report(e,t,s,r,i,n,o=!1){return I(this,void 0,void 0,(function*(){if("web"!==s.toLowerCase()||this.disableLogReport)return;const a=this.logger.createTraceId();this.logger.info(y,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:n,isCloudControl:o}),a);const{logs:c}=yield this._getLogs(e,t,ks.DEBUG,!1,a);this.logger.info(b,JSON.stringify({count:c.length}),a);let _,l=os(r)?r:`https://${r}`;if(l+=`?version=5.44.0-alpha.1&appkey=${this.appkey}&userId=${encodeURIComponent(this.userId)}&deviceId=${this.getDeviceId()}&deviceInfo=${this.deviceInfo}&platform=Web&logId=${i}`,c.length>0){const{success:e,data:t}=yield this.compressLogs(c);_=e?t:"compress failed"}else _="no data or no database";this.logger.debug(b,"compress done",a),o&&(l+="&source=cloud");const{status:d}=yield this.send({url:l,body:_,method:"POST"});this.logger.info(V,JSON.stringify({status:d}),a)}))}stop(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1}}function Hs(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}}var Bs,Js,js,xs,Ws,Ys,Ks,Xs;function Qs(){return I(this,void 0,void 0,(function*(){return{logs:[]}}))}function $s(){}class Zs{constructor(e,t){Bs.set(this,void 0),Js.set(this,void 0),T(this,Bs,e,"f"),T(this,Js,t,"f")}read(e,t,s,r,i){return I(this,void 0,void 0,(function*(){try{const n=yield g(this,Bs,"f").call(this,e,t,s,r,i);if(!n||!Array.isArray(n.logs))return{logs:[]};return{logs:n.logs.filter(Hs)}}catch(e){return console.error("[LogDBProxy] read error",e),{logs:[]}}}))}write(e){try{g(this,Js,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}setLogReader(e){return"function"==typeof e&&T(this,Bs,e,"f"),this}setLogWriter(e){return"function"==typeof e&&T(this,Js,e,"f"),this}}Bs=new WeakMap,Js=new WeakMap;class qs{static start(e){g(this,js,"f",xs)||(T(this,js,e,"f",xs),e.info(Z,"start"),g(this,js,"m",Xs).call(this))}static stop(){g(this,js,"f",xs)&&(g(this,js,"f",xs).info(Z,"stop"),T(this,js,null,"f",xs),g(this,js,"f",Ws)&&(clearTimeout(g(this,js,"f",Ws)),T(this,js,null,"f",Ws)))}}js=qs,Xs=function e(){const t=Date.now();T(this,js,setTimeout((()=>{const s=Date.now()-t;s>=g(this,js,"f",Ks)&&g(this,js,"f",xs).warn(Z,`delta time: ${s}ms`),g(this,js,"m",e).call(this)}),g(this,js,"f",Ys)),"f",Ws)},xs={value:null},Ws={value:null},Ys={value:30},Ks={value:1500};const zs=1,er=2,tr=3;class sr{constructor(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})}uploadLogCmdTask(e){this.uploadTask.push(e),this.enqueueTask()}reportLogCmdTask(e){var t,s,r,i;this.taskLock=!1;const n=null!==(t=e.startTime)&&void 0!==t?t:0,o=null!==(s=e.endTime)&&void 0!==s?s:0,a=null!==(r=e.platform)&&void 0!==r?r:"",c=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(n,o,a,c,e.logId,"",!0).finally((()=>{this.taskLock=!0,this.uploadTask.length>0&&this.enqueueTask()})))}enqueueTask(){if(!this.taskLock)return;const e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}class rr{constructor(e,t,s){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:s}),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 sr(s)}init(){try{const 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)))}isExire(){return(new Date).getTime()-this.timestamp<this.expire}isOverclock(){return(new Date).getTime()-this.lastRequestTime<this.interval}logCmdMsgTasks(e){if(e.uploadLog){const{tasks:t}=e.uploadLog;t.forEach((e=>{e.objectName===We&&this.uploadTaskManage.uploadLogCmdTask(e)}))}}dataHandle(e){const t=this._cache;t.lastRequestTime=this.lastRequestTime,as(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)}request(e,t,s){return I(this,void 0,void 0,(function*(){if(!this.isEable&&t===zs&&this.isExire())return this.logger.info(x,JSON.stringify({msg:"cloud controller is disabled"})),this.timestamp;if(!this.isEable&&t===er&&this.isOverclock())return this.logger.info(W,JSON.stringify({msg:"cloud controller is overclock"})),this.timestamp;const r=gs(e);this.lastRequestTime=(new Date).getTime();const i=`${r}/v1/config`,n={"Content-Type":"application/json","RC-App-Key":this.appkey};s&&(n["RC-Token"]=s);const o={platform:"web",version:"5.44.0-alpha.1",timestamp:this.timestamp};this.logger.record(Ut.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!s,uri:i}));const{code:a,data:c}=yield this.httpRequest(i,Xt.POST,n,o);if(this.logger.record(Ut.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),a===Pe.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion){const e=c.targetRegion;if(this.changeAreaCode===e)return this.timestamp;const t=Vs.setAreaCode(e);this.logger.info(X,JSON.stringify({isChangeSuccess:t,originAreaCode:Vs.getAreaCode(),newAreaCode:e})),this.changeAreaCode=e;const s=Vs.getCloudControllerUrl(e);return s[0]?this.request(s[0],tr):(this.logger.info(Y,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),this.timestamp)}return c&&this.dataHandle(c),this.timestamp||this.lastRequestTime}))}_handleMrtrData(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)}}}var ir,nr,or,ar;const cr=e=>e===Pe.RC_CONN_REDIRECTED;class _r extends Os{constructor(e,t,s){super(),ir.add(this),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"navi",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),ar.set(this,0),Object.defineProperty(this,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:Kt.UNKONWN}}),Object.defineProperty(this,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:mt.DISCONNECTED}),Object.defineProperty(this,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2})}getToken(){return this.token}get cid(){return`${this.uuid}_${this.retryCount}`}getCurrentUserId(){return this._crtUserId}setConnectionStatus(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===mt.DISCONNECTED&&e===mt.CONNECTING&&(this._doConnectReason=Bt.CONNECT,g(this,ir,"m",or).call(this)),this._crtConnectionStatus===mt.CONNECTED&&e===mt.SUSPENDED&&(t===Pe.RC_PING_EXCEED_LIMIT?this._doConnectReason=Bt.TIMEOUT:t===Pe.RC_CONN_REDIRECTED?this._doConnectReason=Bt.REDIRECTED:this._doConnectReason=Bt.RECONNECT),this._crtConnectionStatus===mt.CONNECTED){const s={bid:Is(),cod:t,net:this.getNetwork().type,dur:Date.now()-g(this,ar,"f"),cid:this.cid};this.logger.record(Ut.IM_CONNECTION_DURATION,JSON.stringify(s)),e===mt.SUSPENDED&&g(this,ir,"m",or).call(this)}switch(this._crtConnectionStatus=e,e){case mt.CONNECTED:this.logger.info(O,`status: ${e}`),this.checkAlive(),g(this,ir,"m",nr).call(this).emit("onConnected",this._fromSuspend);break;case mt.CONNECTING:this.logger.warn(O,`status: ${e}`),g(this,ir,"m",nr).call(this).emit("onConnecting");break;case mt.SUSPENDED:this._fromSuspend=!0,this.logger.warn(O,`status: ${e}, code: ${t}`),cr(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),g(this,ir,"m",nr).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(O,`status: ${e}, code: ${t}`),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),g(this,ir,"m",nr).call(this).emit("onDisconnected",t)}}}getConnectionStatus(){return this._crtConnectionStatus}get isConnected(){return this._crtConnectionStatus===mt.CONNECTED}setNetwork(e,t){if(!t){const t={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(Ut.IM_NETWORK_CHANGE,JSON.stringify(t))}this._network=e}getNetwork(){return this._network}connect(e,t,s,r){return I(this,void 0,void 0,(function*(){if(this._crtConnectionStatus===mt.CONNECTED)return Ss(this._crtUserId);if(this._crtConnectionTask)return this._crtConnectionTask;this._openCallPlus=s,this.token=e,this.setConnectionStatus(mt.CONNECTING);const{code:i,data:n}=yield this.try2Connect(e,t,!1,r,!0);return i!==Pe.SUCCESS?(this.setConnectionStatus(mt.DISCONNECTED,i),As(i)):(this.setConnectionStatus(mt.CONNECTED),Ss(n))}))}try2Connect(e,t,s,r,i){return I(this,void 0,void 0,(function*(){if(this._crtConnectionTask)return this._crtConnectionTask;this._crtConnectionTask=this.createConnectionTask(e,t,s,r,i);const n=yield this._crtConnectionTask;return this._crtConnectionTask=null,n}))}createConnectionTask(e,t,s,r,i){return I(this,void 0,void 0,(function*(){const n={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0};this.logger.record(Ut.IM_STATS_CS,JSON.stringify(n));const o={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},{code:a,data:c}=yield this.navi.request(e,s,!1,r,o);if(a!==Pe.SUCCESS)return As(a);const _=c;if(1===_.type)return As(Pe.PACKAGE_ENVIRONMENT_ERROR);this.logger.info(N,JSON.stringify({token:e,reconnectKickEnable:t}),r);const{code:l,data:d}=yield this._connectWithToken(e.replace(/@.+$/,"@"),_,t,r);if(i||l===Pe.SUCCESS||(this.retryCount+=1),cr(l))return this.logger.warn(C,`redirect code: ${l}`,r),this.clearCmpWeightCache(),this.createConnectionTask(e,t,!0,r,i);if([Pe.RC_TCP_RESET,Pe.RC_CONN_ACK_TIMEOUT,Pe.RC_TCP_DISCONNECTED_NO_RMTP,Pe.CONNECTION_REFUSED].includes(l)&&this.cmpWeightCache&&this.cmpWeightCache.length>1){this.updateCmpWeight(this.curCmpUrl,!1);const s=this.cmpWeightCache.every((e=>e.failed));return i&&s?(this.logger.warn(C,`cpp code:${l},reture code:${Pe.SERVER_UNAVAILABLE}`,r),As(Pe.SERVER_UNAVAILABLE)):(this.logger.warn(C,`cmp ack timeout, code: ${l}`,r),this.setConnectionStatus(mt.SUSPENDED,l),this.setConnectionStatus(mt.CONNECTING),this.createConnectionTask(e,t,!1,r,i))}return l!==Pe.SUCCESS?(this.logger.warn(C,`code: ${l}`,r),As(l)):(this.logger.info(C,`userId: ${d}`,r),T(this,ar,Date.now(),"f"),this._crtUserId=d,Ss(d))}))}try2Reconnect(e,t){return I(this,void 0,void 0,(function*(){const s=this.logger.createTraceId();this.logger.debug(p,`try2Reconnect -> ignoreNaviCache: ${e}, reason: ${t}`,s),this.stopReconnectTimer();const r=()=>I(this,void 0,void 0,(function*(){if(this._crtConnectionStatus!==mt.SUSPENDED)return;this.setConnectionStatus(mt.CONNECTING,t);const{code:i,isOk:n}=yield this.try2Connect(this.token,!0,e,s,!1);this.reconnectTimer=null,n?this.setConnectionStatus(mt.CONNECTED):[Pe.SERVER_UNAVAILABLE,Pe.TIMEOUT,Pe.RC_SOCKET_DISCONNECTED,Pe.RC_SOCKET_NOT_CREATED,Pe.RC_CONN_ACK_TIMEOUT,Pe.RC_TCP_RESET,Pe.RC_NAVI_REQ_FAILED,Pe.RC_NETWORK_DOWN,Pe.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?this._crtConnectionStatus===mt.CONNECTING&&(this.setConnectionStatus(mt.SUSPENDED,i),this.reconnectTimer=setTimeout(r,5e3)):this.setConnectionStatus(mt.DISCONNECTED,i)}));r()}))}onDisconnectByServer(e,t){return cr(e)?(this.setConnectionStatus(mt.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===Pe.RC_UDP_DISCONNECTED?(this.setConnectionStatus(mt.SUSPENDED,e),void setTimeout((()=>{this.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(mt.DISCONNECTED,e)}onDisconenctUnusual(e){this.setConnectionStatus(mt.SUSPENDED,e),this.try2Reconnect(!1,e)}checkAlive(){return I(this,void 0,void 0,(function*(){if(this._crtConnectionStatus!==mt.CONNECTED)return this._failedCount=0,void this.logger.debug(D,"stop ping because of no connection");const e=this.logger.createTraceId();this.logger.debug(M,null,e);const t=yield this.sendPing(15e3);if(t===Pe.SUCCESS)return this.logger.debug(U,t,e),this._failedCount=0,void(this._checkAliveTimer=setTimeout((()=>this.checkAlive()),15e3));if(this._crtConnectionStatus===mt.CONNECTED){if(this._failedCount+=1,this.logger.debug(U,`code: ${t}, count: ${this._failedCount}`,e),this._failedCount<this.ALLOW_FAILED_TIMES)return this.checkAlive();this._failedCount=0,this.logger.warn(D,"ping timeout, close connection to reconnect!"),yield this.close(!0),this.setConnectionStatus(mt.SUSPENDED,Pe.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,Pe.RC_PING_EXCEED_LIMIT)}}))}disconnect(e,t){return I(this,void 0,void 0,(function*(){return this.stopReconnectTimer(),this._crtConnectionTask&&(yield this._crtConnectionTask),this.setConnectionStatus(mt.DISCONNECTED,Pe.ACTIVE_DISCONNECT),this.close(!1,e,t)}))}stopReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}getCmpList(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return[...this.cmpWeightCache];const s=ds(e,t);return this.cmpWeightCache=[...s],[...s]}updateCmpWeight(e,t,s){if(!this.cmpWeightCache)return;const r=this.cmpWeightCache.find((t=>s?t.addr===e&&t.protocol===we.QUIC:t.addr===e));if(r)if(t){const e=Math.max(...this.cmpWeightCache.map((e=>e.weight)));r.weight!==e&&(r.weight=e+1)}else{const e=Math.min(...this.cmpWeightCache.map((e=>e.weight)));r.weight!==e&&(r.weight=e-1),r.failed=!0}}clearCmpWeightCache(){this.cmpWeightCache=void 0}reconnect(e,t,s,r){this.token=e,this._openCallPlus=s,this.onDisconenctUnusual(r)}}ar=new WeakMap,ir=new WeakSet,nr=function(){return this},or=function(){this.uuid=ss.gen(),this.retryCount=0};const lr=e=>e.replace(/@.+$/,"@");class dr{constructor(e,t,s,r=!0,i=!0,n=!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:s}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}getCatchKey(e){return e+(this._environment?`-${this._environment}`:"")}request(e,t,s,r,i){return I(this,void 0,void 0,(function*(){if(this.crtRequest)return this.crtRequest;this.crtRequest=this.sendRequest(e,t,s,r,i);const n=yield this.crtRequest;return this.crtRequest=null,n}))}sendRequest(e,t,s,r,i){var n;return I(this,void 0,void 0,(function*(){const o=lr(e),a=this.getNaviCache(o);if(!t&&a){const{timestamp:e,naviInfo:t}=a;if(s||Date.now()-e<Qt){if(this.logger.info(f,JSON.stringify({fromCache:!0,naviInfo:t}),r),i){const{uuid:e,retryCount:s,reason:o}=i,a={bid:Is(),ptc:kt.NAVI,cod:Pe.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(n=t.type)&&void 0!==n?n:0,hos:"",cache:Ft.LOCAL,v:wt.CURRENT,rsn:o,cid:`${e}_${s}`,count:s};this.logger.record(Ut.IM_NAVI,JSON.stringify(a),r)}return Ss(t)}}const c=Vs.getNaviUrlList(e,this.isUseDynamicNaviUrl);this.logger.info(S,JSON.stringify({token:e,uris:c}),r);let{code:_,data:l}=yield this.requestHandler(c,e,r,i);if(_===Pe.RC_NAVI_REQ_FAILED&&this.isRequestProfile){const t=yield this.staticConfigManager.getStaticConfig();if((null==t?void 0:t.navi)&&(null==t?void 0:t.navi.length)>0){const{navi:s}=t,n=yield this.requestHandler(s,e,r,i);_=n.code,l=n.data}}if(_!==Pe.SUCCESS)return this.logger.warn(A,_,r),As(_);const d=l;if(d.code&&200!==d.code)return this.logger.warn(A,d.code,r),As(this.transHttpCode(d.code));if(!(ds(d).length>0)){const e={server:d.server,backupServer:d.backupServer,serverAddr:d.serverAddr,bs:d.bs};return this.logger.warn(A,`navi server address invalid: ${JSON.stringify(e)}`,r),As(Pe.SERVER_UNAVAILABLE)}return this.logger.info(A,JSON.stringify({naviInfo:d}),r),this.setNaviCache(o,d),Ss(d)}))}requestHandler(e,t,s,r){return I(this,void 0,void 0,(function*(){for(let i=0,n=e.length;i<n;i+=1){const n=i===e.length-1,o=this.useV2Navi()?this.httpRequestV2:this.httpRequest,a=Date.now(),{code:c,data:_}=yield o.call(this,e[i],this.appkey,t,s,n),l={bid:Is(),ptc:kt.NAVI,cod:c,net:null==r?void 0:r.type,dur:Date.now()-a,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:Ft.REQUEST,v:wt.CURRENT,rsn:null==r?void 0:r.reason,cid:`${null==r?void 0:r.uuid}_${null==r?void 0:r.retryCount}`,count:null==r?void 0:r.retryCount};if(this.logger.record(Ut.IM_NAVI,JSON.stringify(l),s),[Pe.SUCCESS,Pe.RC_CONN_TOKEN_INCORRECT,Pe.RC_LICENSE_EXPIRED].includes(c))return c===Pe.SUCCESS?Ss(_):As(c)}return As(Pe.RC_NAVI_REQ_FAILED)}))}transHttpCode(e){switch(e){case 401:case 403:return Pe.RC_CONN_TOKEN_INCORRECT;case 416:return Pe.RC_LICENSE_EXPIRED;default:return Pe.RC_NAVI_REQ_FAILED}}getNaviInfoFromCache(e){const t=this.getNaviCache(lr(e));return t?t.naviInfo:null}updateVoipCallInfo(e,t){const s=this.getNaviInfoFromCache(e);s&&this.setNaviCache(lr(e),Object.assign(Object.assign({},s),{voipCallInfo:t}))}getNaviV2RequestOption(e){const{uri:t,token:s,platform:r,protocol:i,mac:n}=e;let o="";o=`${t}/v2/navi.json?cloud=0`;let a=`token=${encodeURIComponent(s)}&v=${Zt}&platfrom=${r}`;return n&&(a+=`&m=${n}`),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":`conn=${i};rtc=4;log=2;iptype=v4,v6`},body:a,url:o,timeout:1e4}}useV2Navi(){return!0}}const Er=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}],[dt,{isCounted:!1,isPersited:!0}],["RC:ContactNtf",{isCounted:!1,isPersited:!0}],["RC:ProfileNtf",{isCounted:!1,isPersited:!0}],[lt,{isCounted:!1,isPersited:!0}],[Et,{isCounted:!1,isPersited:!0}],["RC:RcNtf",{isCounted:!1,isPersited:!0}],[_t,{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 ur(){return Array.from(Er.keys()).map((e=>Object.assign({objectName:e},Er.get(e)))).filter((e=>!e.isCustom))}const Rr=0,hr=0,Ir=4,gr=5;var Tr;!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_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_FUNC_EXEC_O="L-js_func_execute-O",e.L_JS_FUNC_EXEC_E="L-js_func_execute-E",e.L_HADNLE_RECALL_CMD_T="L-handle_recall_cmd-T",e.L_HADNLE_RECALL_CMD_R="L-handle_recall_cmd-R"}(Tr||(Tr={}));const Nr=t=>{if(n.existsSync(t))return;const s=e.resolve(t,"..");n.existsSync(s)||Nr(s),n.mkdirSync(t)},Cr=e=>Object.entries(e).map((([e,t])=>({key:e,value:String(t)}))),Or=e=>({removeMute:!!(null==e?void 0:e.removeMuteStatus),removeWhiteList:!!(null==e?void 0:e.removeWhiteList),removeFavoriteMembers:!!(null==e?void 0:e.removeFollow)}),pr=()=>"undefined"==typeof __dirname?e.dirname(o.fileURLToPath("undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.cjs.js",document.baseURI).href)):__dirname;function Sr(e){return JSON.parse(e).list.map((e=>e.value))}const Ar=e.resolve(pr(),"binding",`electron-${s.platform()}-${s.arch()}.node`),fr={addon:null};try{let e=require;fr.addon=e(Ar)}catch(e){console.error("error ->",Ar,"\n",e)}fr.addon||console.error("error -> cannot find module: ",Ar);const mr=fr.addon,vr=(e,t)=>{let s,r=Buffer.from(e),i=r.length;for(t.push(i),s=0;s<i;s++)t.push(r[s])},Pr=e=>"string"==typeof e,Lr=e=>Pr(e)?e.toUpperCase():"",Mr=(e,t)=>{let s="";return 2!==e.length?s="Unexpected number of bytes received.":5!==e[0]?s=`Unexpected SOCKS version number: ${e[0]}.`:255===e[1]?s="No acceptable authentication methods were offered.":-1===t.indexOf(e[1])&&(s=`Unexpected SOCKS authentication method: ${e[1]}.`),s},Ur=e=>{let t="";return 2!==e.length?t="Unexpected number of bytes received.":1!==e[0]?t=`Unexpected authentication method code: ${e[0]}.`:0!==e[1]&&(t=`Username and password authentication failure: ${e[1]}.`),t};var Dr=e=>{let t=Lr(e.method)||"GET";const s=e.pathname||"/",r=e.headers||{},i=e.search||"";r.Host=e.host||"loclahost";let n="";n=`${t} ${s+i} HTTP/1.1\n`;for(const e in r)if(Object.hasOwnProperty.call(r,e)){n+=`${e}: ${r[e]}\n`}return e.body&&(n+=`Content-Length: ${e.body.length}\n`),n+="\n","POST"===t&&e.body&&(n+=`${e.body}`),n},br=e=>new Promise((t=>{let s,r;e.socket.once("data",(r=>{let i,n=Mr(r,s);if(!n)return 2===r[1]?(e.socket.once("data",(s=>{let r=Ur(s);r?e.emit("error",new Error(`SOCKS authentication failed. ${r}`)):t()})),i=[1],vr(e.socksUsername,i),vr(e.socksPassword,i),void e.write(Buffer.from(i))):void t();e.emit("error",new Error(`SOCKS authentication failed. ${n}`))})),s=[0],e.socksUsername&&s.push(2),r=Buffer.alloc(2+s.length),r[0]=5,r[1]=s.length,s.forEach(((e,t)=>{r[2+t]=e})),e.write(r)})),yr=(e,t,s)=>new Promise((r=>{let i,n;switch(e.socket.once("data",(t=>{let s;5!==t[0]?s=`Unexpected SOCKS version number: ${t[0]}.`:0!==t[1]?s=`${(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 ${e}`}})(t[1])}.`:0!==t[2]&&(s="The reserved byte must be 0x00."),s?e.emit("error",new Error(`SOCKS connection failed. ${s}`)):r()})),i=[],i.push(5),i.push(1),i.push(0),l.isIP(t)){case 0:i.push(3),vr(t,i);break;case 4:i.push(1),((e,t)=>{let s,r,i=e.split(".");for(s=0;s<4;s++)r=parseInt(i[s],10),t.push(r)})(t,i);break;case 6:e.emit("error",new Error("Does not support IPV6"))}i.length+=2,n=Buffer.from(i),n.writeUInt16BE(s,n.length-2),e.write(n)}));class Vr extends d.EventEmitter{constructor(e){super(),Object.defineProperty(this,"socket",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksUsername",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksPassword",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.socket=new l.Socket,this.options=e,this.socksHost=e.socksHost||"localhost",this.socksPort=e.socksPort||1080,this.socksUsername=e.socksUsername||"",this.socksPassword=e.socksPassword||"",this.socket.on("error",(e=>{this.emit("error",e)})),this.on("error",(()=>{this.socket.destroyed||this.socket.destroy()})),this.on("end",this.end)}ref(){return this.socket.ref()}unref(){return this.socket.unref()}setTimeout(e,t){return this.socket.setTimeout(e,t)}setNoDelay(e){return this.socket.setNoDelay(e)}setKeepAlive(e,t){return this.socket.setKeepAlive(e,t)}address(){return this.socket.address()}cork(){return this.socket.cork()}uncork(){return this.socket.uncork()}pause(){return this.socket.pause()}resume(){return this.socket.resume()}pipe(e){return this.socket.pipe(e)}end(e,t){let s=this.socket.end(e,t);return this.writable=this.socket.writable,s}destroy(e){return this.socket.destroy(e)}setEncoding(e){return this.socket.setEncoding(e)}write(e,t,s){return this.socket.write(e,t,s)}read(e){return this.socket.read(e)}connect(e,t){if("string"==typeof e&&/^\d+$/.test(e)&&(e=parseInt(e,10)),!Number.isInteger(e)||e<1||e>65535)throw new TypeError(`Invalid port: ${e}`);if(!t||"string"!=typeof t)throw new TypeError(`Invalid host: ${t}`);return this.socket.connect({port:this.socksPort,host:this.socksHost},(()=>I(this,void 0,void 0,(function*(){yield br(this),yield yr(this,t,e),this.onProxied();const s=Dr(this.options);this.socket.write(Buffer.from(s))})))),this}onProxied(){this.socket.on("close",(e=>{this.emit("close",e)})),this.socket.on("end",(()=>{this.emit("end")})),this.socket.on("data",(e=>{this.emit("data",e)})),this.writable=!0,this.readable=!0,this.emit("connect")}}const Gr=e=>{let t,{hostname:s,port:r}=e;return!e.host||s&&r||(t=e.host.split(":")),!r&&t&&(r=parseInt(t[1],10)||0),!s&&t&&([s]=t),new Vr(e).connect(r,s)};class kr extends a.Agent{constructor(e){super(),Object.defineProperty(this,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.createConnection=Gr}}const Fr=(e,t,s)=>((t=Object.assign(Object.assign({},t),o.parse(e))).port||(t.port=80),t.agent=new kr(t),a.request(t,s)),wr=e=>{let t,s;return t=Gr(e),s=t.onProxied,t.onProxied=()=>{e.socket=t.socket,e.hostname?e.servername=e.hostname:e.host&&([e.servername]=e.host.split(":")),t.socket=E.connect(e,(()=>{t.authorized=t.socket.authorized,s.call(t)})),t.socket.on("error",(e=>{t.emit("error",e)}))},t};class Hr extends c.Agent{constructor(e,t){super(t),Object.defineProperty(this,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e,this.socksHost=t.socksHost||"localhost",this.socksPort=t.socksPort||1080,this.createConnection=wr}}const Br=(e,t,s,r)=>{let i;return t.protocol="https:",!t.port&&t.host&&([t.port,t.port]=t.host.split(":")),t.port||(t.port=443),i=new Hr(e,t),t.agent=i,c.request(e,t,s)};let Jr=null;function jr(e,t,s=!1){const{url:r,headers:i,body:n,method:o,query:_,timeout:l=$t}=t;return new Promise((t=>{const d=/^https/.test(r);let E={headers:Object.assign(Object.assign({},i),{"Accept-Encoding":"gzip, br"}),method:o};d&&(E.rejectUnauthorized=s);let u=null;Jr?(E=Object.assign(Object.assign({},E),Jr),E.body=n,u=d?Br:Fr):(u=a.request,d&&(E.agent=new c.Agent(E),u=c.request));const R=u(((e,t)=>{if(e=e.replace(/\?$/,""),!t)return e;const s=Object.keys(t).map((e=>`${e}=${t[e]}`)).filter((e=>!!e));return s.length?[e,s.join("&")].join("?"):e})(r,_),E,(e=>{var s,r;const i=e.statusCode;let n="";if("gzip"===(null===(s=e.headers)||void 0===s?void 0:s["content-encoding"])){const s=h.default.createGunzip();e.pipe(s),s.on("data",(e=>{n+=e})),s.on("end",(()=>{t({status:i,data:n})}))}else if("br"===(null===(r=e.headers)||void 0===r?void 0:r["content-encoding"])){const s=h.default.createBrotliDecompress();e.pipe(s),s.on("data",(e=>{n+=e})),s.on("end",(()=>{t({status:i,data:n})}))}else e.setEncoding("utf8"),e.on("data",(e=>{n+=e})),e.once("end",(()=>{t({status:i||0,data:n})}))}));R.once("timeout",(()=>{e.warn(Tr.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:r,method:o,query:_,timeout:l})),t({status:0})})),R.setTimeout(l),R.once("error",(s=>{e.warn(Tr.P_HTTP_REQ_E,JSON.stringify({msg:s.stack,url:r,method:o,query:_,timeout:l})),t({status:0})})),R.write(n),R.end()}))}function xr(e,t){return e?(Jr=Object.assign(Object.assign({},Jr),e),t.info(F,JSON.stringify({socks5Proxy:Jr})),Ss()):(Jr=null,t.info(k),Ss())}function Wr(){return Ss(Jr||void 0)}var Yr;!function(e){e[e.ERROR=-1]="ERROR",e[e.RESPONSE=0]="RESPONSE",e[e.CALLBACK=1]="CALLBACK"}(Yr||(Yr={}));class Kr{constructor(e,t,s,r){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:s}),Object.defineProperty(this,"errorHandle",{enumerable:!0,configurable:!0,writable:!0,value:r}),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",(e=>{const{type:t,data:i}=e;switch(t){case Yr.RESPONSE:{const{reqId:e,success:t,data:s}=i,r=this.maps[e];if(!r)return;r({success:t,data:s}),delete this.maps[e];break}case Yr.CALLBACK:null==s||s(i);break;case Yr.ERROR:{const{msg:e}=i;null==r||r(e)}}})),this.p.on("error",(e=>{null==r||r(`SubProcessProxy error ${e}`)})),this.p.on("exit",((e,t)=>{if(0!==e){for(const e in this.maps)if(Object.prototype.hasOwnProperty.call(this.maps,e)){(0,this.maps[e])({success:!0,data:{code:Pe.SUB_PROCESS_EXIT,msg:"sub process exit"}})}null==r||r(`SubProcessProxy exit ${e} ${t}`,!0)}})),this.p.on("close",((e,t)=>{console.log("SubProcessProxy close",e,t)}))}call(e,...t){return I(this,void 0,void 0,(function*(){return this.p.killed||this.p.exitCode?Promise.resolve({success:!1,data:{code:Pe.SUB_PROCESS_EXIT,msg:"sub process exit"}}):new Promise((s=>{const r=++this.count;this.maps[r]=s;const i={reqId:r,method:e,args:t,hasResponse:!0};this.p.send(i)}))}))}send(e,...t){var s;return I(this,void 0,void 0,(function*(){(this.p.killed||this.p.exitCode)&&(null===(s=this.errorHandle)||void 0===s||s.call(this,"sub process exit"));const r={reqId:-1,method:e,args:t};this.p.send(r)}))}destroy(){this.send("destroy")}}const Xr=(e,t,s)=>I(void 0,void 0,void 0,(function*(){const{startTime:r,endTime:i,level:n,isRealtimeReport:o}=e,a=yield((e,t,s,r,i)=>I(void 0,void 0,void 0,(function*(){const{resolve:n,promise:o}=vs();mr.getLog(e,t,s,r,(e=>{n(Ss(e))}),(e=>{n(As(e))}));const a=yield o;if(!a.isOk)return a.wipe();let c=0;const _=JSON.parse(a.data).filter((e=>(c+=(e=>e.content.length+e.tag.length+e.sessionId.length+e.type.length+2+13+6)(e),!!i||e.level>0)));return Ss({logs:_,size:c})})))(n,r,i,300,o);if(!a.isOk)return;let{logs:c,size:_}=a.data;if(0===c.length)return;if((t+=_)>=20971520)return;if(c.length<300)return void s.push(...c);let{time:l}=c[c.length-1];return r===l&&(l+=1),e.startTime=l,s.push(...c.filter((e=>e.time<l))),Xr(e,t,s)})),Qr=[];let $r=!1;const Zr=()=>I(void 0,void 0,void 0,(function*(){if($r||0===Qr.length)return;$r=!0;const e=Qr.shift(),{resolve:t,args:s}=e,r=[];yield Xr(s,0,r),t({logs:r,dbReady:!0}),$r=!1,Zr()}));class qr extends ws{constructor(e,t,s,r=!1,i){super(e,`Electron|${process.versions.electron}|${process.arch}|${process.platform}`,i,s,r),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_subProcess",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}getDeviceId(){return this.deviceId}send(e){return jr(this.logger,e)}stop(){this._subProcess&&this._subProcess.destroy(),super.stop()}compressLogs(t){return I(this,void 0,void 0,(function*(){if(!this._subProcess){const t="sub-process.cjs.js",s=r.fork(e.resolve(pr(),t),{stdio:["inherit","inherit","inherit","ipc"]});this._subProcess=new Kr(s)}const{success:s,data:i}=yield this._subProcess.call("compressLogs",t);return s?{success:s,data:i.data}:{success:s,data:""}}))}}const zr="rc-realtime-log-timestamp";let ei=!1;const ti=()=>{const e=new Zs(Qs,$s);return e.setLogReader(((e,t,s,r)=>I(void 0,void 0,void 0,(function*(){const{logs:i}=yield(n={startTime:e,endTime:t,level:s,isRealtimeReport:r},I(void 0,void 0,void 0,(function*(){return new Promise((e=>{Qr.push({resolve:e,args:n}),Zr()}))})));var n;return{logs:i}})))),e.setLogWriter((e=>{ii(e)})),e};let si,ri=[];const ii=e=>{ei&&(ri.push(e),si||(si=setImmediate((()=>(()=>{if(si&&(clearImmediate(si),si=null),!ri.length)return;const e=ri.splice(0).map((e=>{const{sessionId:t,level:s,time:r,type:i,tag:n,loggerId:o,content:a,traceId:c}=e;return{level:s,time:r,type:i,tag:n,sessionId:`${rs}:${rs===t?"main":t}`,content:JSON.stringify({loggerId:o,content:a,traceId:c})}})),t=JSON.stringify(e);mr.writeLog(t)})()))))};class ni extends Fs{constructor(e,t,s,r){super(e,t,s,r),ei||(ei=!0)}getTimestamp4RealtimeLog(){const e=mr.getStoreValue(zr);return parseInt(e,10)||0}setTimestamp4RealtimeLog(e){mr.setStoreValue(zr,e.toString())}recvRendererLog(e){this._stdout(e),this._write(e)}destroy(){ei=!1}}const oi=()=>{const e=Date.now(),t=[s.arch(),s.platform(),process.pid,e,Math.floor(Math.random()*e)].join("__");return r=t,i.createHash("md5").update(r).digest("hex");var r};class ai{constructor(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})}_setToProtocol(e,t,s){const r=JSON.stringify(s);"{}"!==r&&e.info(Tr.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:t,ext:s})),this._callCppProxy("setMessageExtension",1,"1",t,r,"")}setLocalFromExtMsg(e,t){const{channelId:s,conversationType:r,targetId:i,content:n,sentTime:o}=t,a=n,c=a.put,_=this._callCppProxy("getMessage",a.mid),l=JSON.parse(_).extMsg,d=JSON.parse(l||"{}");if(c)for(const e in c){const t=d[e];t&&t.ts<o-this._setTime?(t.v=c[e],t.ts=o-this._setTime):(d[e]={v:"",ts:0},d[e].v=c[e],d[e].ts=o-this._setTime)}a.del&&a.del.forEach((e=>{delete d[e]})),this._setToProtocol(e,a.mid,d)}parseReceiveExpansion(e){const t=JSON.parse(e.extMsg||"{}"),s={};for(const e in t)s[e]=t[e].v;return s}}const ci=[we.RMTP,we.TLS];"darwin"===process.platform&&ci.push(we.QUIC);const _i=e=>`RongCloud/navis/${e}/navi-cache.json`,li=e=>`RongCloud/caches/${e}/staticConfig.json`,di=e=>`RongCloud/cloudControl/${e}/cloudControl.json`;function Ei(e="IPv4"){const t=s.networkInterfaces(),r=[];for(const s of Object.values(t))if(s&&-1!==Object.prototype.toString.call(s).indexOf("Array")){const t=s.filter((t=>{return!(t.internal||(s=t.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(s))||t.family&&t.family!==e);var s})).map((e=>e.mac));r.push(...t)}return r.length?[...r].sort()[0]:""}class ui extends dr{constructor(t,s,r,i){super(t,s,i),Object.defineProperty(this,"naviPath",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.naviPath=`${r}/${_i(t)}`;const o=e.dirname(this.naviPath);n.existsSync(o)||Nr(o)}httpRequest(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=`token=${encodeURIComponent(s)}&v=${Zt}&p=PC&ev=5.44.0-alpha.1&m=${Ei()}`,n=`${e}/navi.json?r=${Date.now()}&env=${this._environment}`;this.logger.info(f,JSON.stringify({url:n,body:i}),r);const o=yield jr(this.logger,{method:"POST",headers:{appId:t},body:i,url:n,timeout:1e4});if(200!==o.status)return this.logger.warn(m,JSON.stringify({url:n,code:o.status}),r),As(this.transHttpCode(o.status));this.logger.info(m,JSON.stringify({url:n,data:o.data}),r);try{const e=JSON.parse(o.data),t=/^https/.test(n)?"https":"http";return e.protocol=t,e.code&&200!==e.code?As(this.transHttpCode(e.code)):Ss(e)}catch(e){return this.logger.error(v,o.data,r),As(Pe.RC_NAVI_REQ_FAILED)}}))}httpRequestV2(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=this.getNaviV2RequestOption({appkey:t,token:s,uri:e,platform:"electron",protocol:ci.join(","),mac:Ei()});this.logger.info(f,JSON.stringify({url:i.url,body:i.body,headers:i.headers}),r);const n=yield jr(this.logger,i);if(200!==n.status)return this.logger.warn(m,JSON.stringify({url:i.url,code:n.status}),r),As(this.transHttpCode(n.status));this.logger.info(m,JSON.stringify({url:i.url,data:n.data}),r);try{const e=JSON.parse(n.data),t=/^https/.test(i.url)?"https":"http";return e.protocol=t,Ss(e)}catch(e){return this.logger.error(v,n.data,r),As(Pe.RC_NAVI_REQ_FAILED)}}))}getNaviCache(e){const t=this.getCatchKey(e),s=this._caches[t];if(s)return s;if(!n.existsSync(this.naviPath))return null;const r=n.readFileSync(this.naviPath,{encoding:"utf8"});try{this._caches=JSON.parse(r);return this._caches[t]}catch(e){this.logger.error(v,r)}return null}setNaviCache(e,t){const s=Date.now(),r=this.getCatchKey(e);if(as(this._caches))for(const e in this._caches){(s-this._caches[e].timestamp>Qt||r===e)&&delete this._caches[e]}this._caches[r]={token:e,naviInfo:t,timestamp:Date.now(),environment:this._environment},n.writeFileSync(this.naviPath,JSON.stringify(this._caches))}setEnvironment(e){this._environment=e}setUseNaviV2(e){this.useNaviV2=e}}var Ri,hi,Ii,gi,Ti,Ni;function Ci(e,t,s,...r){const i=e.createTraceId();let n;if(e.info(Tr.P_CALL_ADDON_T,JSON.stringify({method:s,params:r}),i),!mr[s])throw e.error(Tr.P_CALL_ADDON_E,`Method ${s} not found in addon`,i),new Error(`Method ${s} not found in addon`);try{n=mr[s](...r)}catch(t){throw e.error(Tr.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:s}),i),t}return e.info(Tr.P_CALL_ADDON_R,JSON.stringify({method:s,result:t?n:void 0}),i),n}class Oi{constructor(e,t,s){Ri.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!=s?s:this._logger.createTraceId(),this._promise=new Promise((e=>{this._resolve=e}))}static create(e,t,s){return new Oi(e,t,null!=s?s:e.createTraceId())}invoke(...e){return g(this,Ri,"m",hi).call(this,!0,...e)}asyncInvoke(...e){return g(this,Ri,"m",hi).call(this,!1,...e)}ok(e){this._flush(Ss(e))}fail(e,t){this._flush(As(e,"",t))}_flush(e){this._logger.summary(Tr.P_CALL_ADDON_R,e,this._traceId),setImmediate((()=>this._resolve(e)))}flush(e){this._flush(e)}result(){return this._promise}}Ri=new WeakSet,hi=function(e,...t){let s;const{_method:r,_traceId:i,_logger:n}=this;n.info(Tr.P_CALL_ADDON_T,JSON.stringify({method:r,params:t}),i);try{s=mr[r](...t)}catch(e){throw n.error(Tr.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:r}),i),e}return e&&s!==Pe.SUCCESS&&this.fail(s),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"}(Ni||(Ni={}));class pi extends _r{constructor(e,t,s,r){super(e,s,r),Ii.add(this),Object.defineProperty(this,"callCppProxy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_naviInfo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_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(this,"_connectingTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tcpDuration",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.callCppProxy("setConnectionStatusListener",g(this,Ii,"m",gi).bind(this),((e,t,s)=>{this.logger.info(Tr.P_DB_OPEN_O,JSON.stringify({code:e,recreate:t,recreateReason:s})),this.emit("onDBOpen",e,t,s)}),(()=>this.recvPong(Pe.SUCCESS)),g(this,Ii,"m",Ti).bind(this),this._onTcpConnectResponse.bind(this),(()=>{this.logger.info(Tr.P_DB_UPGRATE_START_S),this.emit("onDBUpgrateStart")}),(e=>{this.logger.info(Tr.P_DB_UPGRATING_S,e),this.emit("onDBUpgrading",e)}),(e=>{this.logger.info(Tr.P_DB_UPGRATE_COMPLETE_S,e),this.emit("onDBUpgradeComplete",e)}))}getConnectedTime(){return this._connectedTime}_connectWithToken(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=this._connectingTask=Oi.create(this.logger,"connectWithToken",r);this._naviInfo=t;let n={};const{data:o}=Wr();o&&(n={proxy_passwd:o.socksPassword||"",proxy_name:o.socksUsername||"",proxy_port:o.socksPort||1082,proxy_host:o.socksHost||"localhost",proxy_type:0});const a=JSON.stringify(Object.assign(Object.assign({},n),{call_plus:this._openCallPlus,cid:this.cid})),c=this.getCmpList(t,!0).filter((e=>ci.includes(e.protocol))).sort(((e,t)=>t.weight-e.weight)),_=[];c.forEach((e=>{const t=_.find((t=>t.addr===e.addr));t?t.protocol!==we.QUIC&&e.protocol!==we.QUIC||(t.race=!0,t.protocol=we.QUIC):(e.race=!1,_.push(e))})),this.logger.info(Tr.P_CONNECT_T,JSON.stringify({}),r);const l=Date.now(),d=yield i.asyncInvoke(e,Zt,JSON.stringify(Object.assign(Object.assign({},t),{serverAddr:_,tagBlacklist:this._excludeLogTag.join(",")})),s,a).result();this.logger.summary(Tr.P_CONNECT_R,d,r,{data:d.data});const{cid:E,userId:u,sessionId:R}=JSON.parse(d.data),h=Date.now()-(l+this._tcpDuration),I={bid:Is(),cod:d.code,net:this.getNetwork().type,dur:h,spr:0,cid:E,v:wt.CURRENT,count:this.retryCount,sts:Date.now(),ssid:R};return this.logger.record(Ut.IM_CMP_RMTP,JSON.stringify(I)),this._connectingTask=null,d.trans((e=>(this._connectedTime=Date.now()-this.callCppProxy("getDeltaTime"),u)))}))}close(e,t,s){return I(this,void 0,void 0,(function*(){if(!e){const e=Oi.create(this.logger,"disconnect");yield e.asyncInvoke("boolean"!=typeof t||t,!!s,(()=>e.ok()),(t=>e.fail(t))).result()}}))}sendPing(e){return new Promise((t=>{this.pingResolve=t,this.callCppProxy("sendHeartbeat"),setTimeout((()=>this.recvPong(Pe.TIMEOUT)),e)}))}recvPong(e){this.pingResolve&&(this.pingResolve(e),this.pingResolve=null)}recvConnectRes(e,t,s){t?this.onDisconnectByServer(e,s):e===Pe.RC_SOCKET_DISCONNECTED&&this.getConnectionStatus()!==mt.CONNECTED||this.onDisconenctUnusual(e)}_onTcpConnectResponse(e,t,s,r,i,n,o){var a;const c=this.cmpWeightCache.findIndex((e=>e.addr===`${t}:${s}`)),_={bid:Is(),ptc:kt.TCP,cod:e,net:this.getNetwork().type,dur:r,spr:0,pr:(null===(a=this._naviInfo)||void 0===a?void 0:a.type)||0,hos:`${t}:${s}`,idx:c,rct:this.retryCount?Ht.RECONNECT:Ht.CONNECT,cid:this.cid,v:wt.CURRENT,rsn:this._doConnectReason,ddu:i,count:this.retryCount,weight:c>=0?this.cmpWeightCache[c].weight:-1};if(this.logger.record(Ut.IM_CMP,JSON.stringify(_)),this.logger.info(Tr.P_CONNECT_ENTRY_S,JSON.stringify({code:e,host:t,port:s,duration:r,dnsDuration:i,index:n,isQuic:o})),e===Ni.SUCCESS)this.curCmpUrl=`${t}:${s}`,this.updateCmpWeight(`${t}:${s}`,!0,o);else if(e!==Ni.NOT_INIT){const e=s&&0!==s?`${t}:${s}`:`${t}`;this.updateCmpWeight(e,!1)}}}Ii=new WeakSet,gi=function(e,t){10!==e&&(this._connectingTask?e===Pe.SUCCESS?this._connectingTask.ok(t):this._connectingTask.fail(e,t):this.logger.warn(Tr.P_CONNECT_E,JSON.stringify({msg:"connect complete but no connecting task"})))},Ti=function(e,t){switch(this.logger.info(Tr.P_CONNECT_S,JSON.stringify({status:e,delay:t})),e){case Pe.RC_CONN_REDIRECTED:this.recvConnectRes(e,!0);break;case 11:case 10:case 12:break;case Pe.CONNECTION_REFUSED:case Pe.RC_SOCKET_DISCONNECTED:case Pe.RC_SOCKET_NOT_CREATED:case Pe.RC_CONN_ACK_TIMEOUT:case Pe.RC_TCP_RESET:this.recvConnectRes(e,!1);break;case Pe.RC_UDP_DISCONNECTED:this.recvConnectRes(e,!0,t);break;default:this.recvConnectRes(e,!0)}};class Si extends Gs{constructor(t,s,r){super(t,s),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"dbpath",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_cachePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),this._cachePath=`${r}/${li(t)}`;const i=e.dirname(this._cachePath);n.existsSync(i)||Nr(i)}getCache(){if(!n.existsSync(this._cachePath))return null;return n.readFileSync(this._cachePath,{encoding:"utf8"})||null}setCache(e){n.writeFileSync(this._cachePath,e)}clearCache(){n.writeFileSync(this._cachePath,"")}sendRequest(e){return I(this,void 0,void 0,(function*(){const{status:t,data:s}=yield jr(this.logger,{url:e,body:""});return{code:t,data:s}}))}decryptData(e){return I(this,void 0,void 0,(function*(){try{const t=yield((e,t,s)=>I(void 0,void 0,void 0,(function*(){const r=i.createDecipheriv("aes-256-cbc",t,s);let n=r.update(e,"base64","utf-8");return n+=r.final("utf8"),n})))(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91");return JSON.parse(t)}catch(e){this.logger.error(j,JSON.stringify({error:null==e?void 0:e.stack}))}}))}}class Ai extends rr{constructor(t,s,r,i,o){super(s,t,r),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"catchFilePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.model=`Electron|${process.platform}|${process.arch}`,this.catchFilePath=`${o}/${di(t)}`;const a=e.dirname(this.catchFilePath);n.existsSync(a)||Nr(a),this.init()}httpRequest(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=r;i.deviceId=this.deviceId,i.model=this.model;const n={url:e,method:t,headers:s,body:JSON.stringify(i)},o=this.logger.createTraceId();this.logger.info(f,JSON.stringify(n),o);const{status:a,data:c=""}=yield jr(this.logger,n);this.logger.info(m,JSON.stringify({status:a,data:c}),o);try{const e=JSON.parse(c);return{code:a,data:e.data}}catch(e){return this.logger.warn(K,JSON.stringify({status:a,data:c,error:e})),{code:a,msg:e}}}))}setCloudControllerCache(e){n.writeFileSync(this.catchFilePath,JSON.stringify(e))}getLocalCloudControllerCache(){if(!n.existsSync(this.catchFilePath))return null;return n.readFileSync(this.catchFilePath,{encoding:"utf8"})}setMRTRConfig(e){const t={mrtrChatroom:e.chatroom,mrtrGroup:e.group,mrtrPrivate:e.private,mrtrUltraGroup:e.ultraGroup};this.logger.info(Q,JSON.stringify(t)),mr.setCloudConfig(JSON.stringify(t))}}const fi=[We,ct,Ye,ze,tt,Ze,qe,$e,et,st,rt],mi=()=>({logCmdQueue:[],cloudControllerVers:[],srsmsgs:[],readNtfs:[],expansionMsgQueue:new Map,v1ReceiptMsgs:[],privateRSMsgs:[],groupRSMsgs:new Map,rrmsgs:new Map,messageUIds:new Set});class vi{constructor(){Object.defineProperty(this,"_report",{enumerable:!0,configurable:!0,writable:!0,value:mi()}),Object.defineProperty(this,"_count",{enumerable:!0,configurable:!0,writable:!0,value:0})}isLowPriorityMessage(e){return fi.includes(e)}isEmpty(){return 0===this._count}get count(){return this._count}push(e,t){this._count++;const{messageType:s,senderUserId:r,content:i}=e;if(s!==We)if(s!==ct)if(s!==ze)if(s!==Ye)if(s!==$e){if(s===Ze){const{messageUId:t}=i;if(!t)return;return this._report.messageUIds.add(t),void this._report.v1ReceiptMsgs.push(e)}if(s===qe){const s=i.receiptMessageDic;if(r!==t){const r=s[t];if(!r||0===r.length)return;return r.forEach((e=>this._report.messageUIds.add(e))),void this._report.v1ReceiptMsgs.push(e)}return Object.values(s).forEach((e=>{e.forEach((e=>this._report.messageUIds.add(e)))})),void this._report.v1ReceiptMsgs.push(e)}s!==et?s===tt&&this._handleRSMsg(e):this._handleRRMsg(e)}else this._handleReadNtf(e);else this._handleExpansionNotify(e);else this._handleSRSMsg(e,t);else r===qt&&this._report.cloudControllerVers.push(e.sentTime);else if(r===qt){const{startTime:t,endTime:s,platform:r,logId:n,uri:o}=i;this._report.logCmdQueue.push({startTime:parseInt(t,10),endTime:parseInt(s,10),platform:r,logId:n,uri:o,messageUId:e.messageUId})}}_handleRSMsg(e){const{senderUserId:t,content:s,conversationType:r,targetId:i,channelId:n}=e;if(r===Le.PRIVATE){const e=this._report.privateRSMsgs.find((e=>e.conversationType===r&&e.targetId===i&&e.channelId===n));return void(e?e.timestamp=Math.max(e.timestamp,s.endMsgTime):this._report.privateRSMsgs.push({conversationType:r,targetId:i,channelId:n,timestamp:s.endMsgTime}))}const{msgId:o,rrn:a,tmn:c}=s,_=this._report.groupRSMsgs.get(o);_?(_.totalCount=c,_.readedCount=a):this._report.groupRSMsgs.set(o,{totalCount:c,readedCount:a}),this._report.messageUIds.add(o)}_handleRRMsg(e){const{msgId:t}=e.content;this._report.rrmsgs.set(t,e),this._report.messageUIds.add(t)}_handleExpansionNotify(e){const{put:t,mid:s,del:r,clear:i}=e.content;this._report.messageUIds.add(s),this._report.expansionMsgQueue.has(s)&&!i?this._report.expansionMsgQueue.get(s).push({put:t,del:r,clear:i}):this._report.expansionMsgQueue.set(s,[{put:t,del:r,clear:i}])}_handleSRSMsg(e,t){const{conversationType:s,targetId:r,channelId:i,senderUserId:n}=e;n===t&&(this._report.srsmsgs=this._report.srsmsgs.filter((e=>e.conversationType!==s||e.targetId!==r||e.channelId!==i)),this._report.srsmsgs.push(e))}_handleReadNtf(e){const{conversationType:t,targetId:s,channelId:r}=e;t===Le.PRIVATE&&(this._report.readNtfs=this._report.readNtfs.filter((i=>i.conversationType!==t||i.targetId!==s||i.channelId!==r||i.senderUserId!==e.senderUserId)),this._report.readNtfs.push(e))}build(){const e=this._report;return this._report=mi(),this._count=0,e}}class Pi{constructor(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}gen(e,t){return(...s)=>{this.logger.info(Tr.L_JS_FUNC_EXEC_O,e);try{t(...s)}catch(t){this.logger.error(Tr.L_JS_FUNC_EXEC_E,`name: ${e}\n${t.stack}`),console.warn("L-js_callback_exception-E: args -> ",...s)}}}}function Li(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}}var Mi,Ui,Di,bi,yi,Vi,Gi,ki,Fi,wi,Hi,Bi,Ji,ji,xi,Wi,Yi,Ki,Xi,Qi,$i,Zi,qi,zi,en,tn,sn,rn,nn,on,an,cn,_n,ln,dn,En,un,Rn,hn,In,gn,Tn,Nn;!function(e){e[e.cuid=1]="cuid",e[e.uid=2]="uid",e[e.all=4]="all"}(gn||(gn={}));class Cn{constructor(e,t){Mi.add(this),Object.defineProperty(this,"_dispatchEvent",{enumerable:!0,configurable:!0,writable:!0,value:t}),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,"_opts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_buildSubscribeEventData",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=[];try{const{list:s}=JSON.parse(e);s.forEach((e=>{const{userId:s,subscribeType:r,subscribeTime:i,duration:n,operationType:o,details:a=[],userProfile:c}=JSON.parse(e.obj),_={userId:s,subscribeType:r,subscribeTime:i,expiry:n,operationType:o};[St.ONLINE_STATUS,St.FRIEND_ONLINE_STATUS].includes(r)&&(_.details=a.map((e=>{const{changeTime:t,changeValue:s,platform:r}=JSON.parse(e);return{changeTime:t,eventValue:s,platform:r}}))),[St.USER_PROFILE,St.FRIEND_USER_PROFILE].includes(r)&&(_.userProfile=this._string2userProfileInfo(c)),t.push(_)}))}catch(t){this.logger.error(Tr.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:{}}),this._opts=e;const{dbpath:s,appkey:r,logOutputLevel:i,disableLogReport:n,eventLoopBlockingCheck:o,enableSyncEmptyTopConversation:a}=e,c=this._deviceId=oi(),_=ti();this.logger=new ni(r,"RC-M","IM",_),this._catcher=new Pi(this.logger),mr.initWithAppkey(r,s,Zt,this.logger.getSessionId()),mr.setConsoleLogLevel(i+1),this.logger.setOutputLevel(i),this.reporter=new qr(r,c,this.logger,n,_),this.logger.info(Tr.P_INIT_O,JSON.stringify({appkey:r,dbpath:s,proto_commit:mr.getNodeVersion(),deviceId:c,commit:"07c327459d99ef27cc3fa8e218a316fa67bab020",processName:process.title,processPId:process.pid,disableLogReport:n,eventLoopBlockingCheck:o})),o&&qs.start(this.logger),Ci(this.logger,!1,"setDeviceId",c),this._staticConfigManager=new Si(r,this.logger,s),this._lowPriorityMessageHandler=new vi,this.navi=new ui(r,this.logger,s,this._staticConfigManager),this.tcpMgr=new pi(r,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(a),this._initCloudController(r,c,s),this._registerBuildinMessageTypes(),mr.setOnReceiveMessageListener(this._catcher.gen("setOnReceiveMessageListener[0]",g(this,Mi,"m",ji).bind(this)),this._catcher.gen("setOnReceiveMessageListener[1]",g(this,Mi,"m",xi).bind(this)),this._catcher.gen("setOnReceiveMessageListener[2]",this._handleMessageModified.bind(this))),mr.setRTConversationListener(this._catcher.gen("setRTConversationListener",(e=>this._dispatchEvent("sgRelationsSynced",e)))),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),mr.setReadReceiptListener(this._catcher.gen("setReadReceiptListener",((e,t)=>{const s=JSON.parse(t).map((e=>({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((e=>({userId:e.userId,timestamp:e.receiptTime,isMentioned:e.mentioned})))})));this._dispatchEvent("readReceiptResponseV5",s)}))),mr.setTranslateEventListener(this._catcher.gen("setTranslateEventListener",(e=>{const t=JSON.parse(e).map((e=>({translateInfo:{targetLanguage:e.translateResult.targetLanguage,translatedText:e.translateResult.translatedText,status:e.translateResult.translateStatus},code:e.code,identifier:e.messageRecognitionIdentifier.messageUid,from:e.messageRecognitionIdentifier.inputSource})));this._dispatchEvent("translateResponse",t)}))),this._msgExpansionHandler=new ai(this._callCppProxy.bind(this)),mr.setUltraGroupListener(this._catcher.gen("setUltraGroupListener[0]",(e=>this._dispatchEvent("ultraGroupEnable"))),this._catcher.gen("setUltraGroupListener[1]",((e,t,s)=>g(this,Mi,"m",bi).call(this,e,t,s))),this._catcher.gen("setUltraGroupListener[2]",(e=>g(this,Mi,"m",yi).call(this,e))),this._catcher.gen("setUltraGroupListener[3]",(e=>g(this,Mi,"m",Vi).call(this,e))),this._catcher.gen("setUltraGroupListener[4]",(e=>g(this,Mi,"m",Gi).call(this,e))),this._catcher.gen("setUltraGroupListener[5]",(e=>g(this,Mi,"m",ki).call(this,e))),this._catcher.gen("setUltraGroupListener[6]",(e=>g(this,Mi,"m",Fi).call(this,e))),this._catcher.gen("setUltraGroupListener[7]",(e=>g(this,Mi,"m",Ui).call(this,e))),this._catcher.gen("setUltraGroupListener[8]",(e=>g(this,Mi,"m",Di).call(this,e)))),mr.setRobotEventListener(this._catcher.gen("setRobotEventListener",((e,t)=>{this._dispatchEvent("robotsSynced",e,g(this,Mi,"m",In).call(this,t))}))),mr.setMessageReactionListener(this._catcher.gen("setMessageReactionListener",(e=>{const t=JSON.parse(e).map((e=>{var t,{conversationIdentifier:s}=e,r=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(s[r[i]]=e[r[i]])}return s}(e,["conversationIdentifier"]);return Object.assign({conversationIdentifier:(t=s,{conversationType:t.type,targetId:t.targetId,channelId:t.channelId})},r)}));this._dispatchEvent("messageReaction",{reactions:t})})))}_setDeviceInfo(){const{model:e}=s.cpus()[0];let t=s.release();try{"darwin"===process.platform?t=r.execSync("sw_vers -ProductVersion",{encoding:"utf-8"}):"win32"===process.platform&&(t=r.execSync("ver",{encoding:"utf-8"}))}catch(e){this.logger.error(q,JSON.stringify({error:e}))}mr.setDeviceInfo("",e,"PC",t,"","")}_initCloudController(e,t,s){const r=Vs.getCloudControllerUrl();[this.cloudControllerUri]=r,this.cloudController=new Ai(e,this.logger,this.reporter,t,s),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,zs)}callProxy(e,...t){return I(this,void 0,void 0,(function*(){const s=this[e];if(!s)return this.logger.warn(Tr.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),As(Pe.NOT_SUPPORT);let r="";try{return yield s.call(this,...t)}catch(t){r=JSON.stringify({error:null==t?void 0:t.stack,method:e}),this.logger.error(Tr.P_CALL_MAIN_E,r)}return As(Pe.MAIN_PROCESS_ERROR,r)}))}sendProxy(e,...t){return I(this,void 0,void 0,(function*(){const s=this[e];if(s)try{s.call(this,...t)}catch(t){this.logger.error(Tr.P_CALL_MAIN_E,JSON.stringify({error:null==t?void 0:t.stack,method:e}))}else this.logger.warn(Tr.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"}))}))}setRenderInitOption(e){const{navigators:t,areaCode:s,logServerUrl:r,environment:i,useNaviV2:n,enableReadReceiptStorage:o}=e;this._environment=i||"default",this.navi.setEnvironment(this._environment),this._enableReadReceiptStorage=o,this.navi.setUseNaviV2(n),Vs.init({areaCode:s,navigators:t,logServerUrl:r})}onConnected(e,t){this._isConnected=!0;const s=this.getNaviInfoFromCache();this.reporter.checkStart(s,""),this._try2RejoinChatroom();const r=this.getMainProcessCache();this._dispatchEvent("onConnected",t,r),this._offlineFinishedPending&&(this._offlineFinishedPending=!1,this.logger.info(z),this._dispatchEvent("pullFinished")),this._needDispatchMessageModifiedSyncCompleted&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}onConnecting(){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._needDispatchMessageModifiedSyncCompleted=!0,this._dispatchEvent("onConnecting")}onSuspend(e,t){this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onSuspend",t)}onDisconnected(e,t){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onDisconnected",t)}dbOpened(e,t,s,r){this._dispatchEvent("databaseOpened",t,s)}dbUpgradeStart(){this._dispatchEvent("databaseUpgradeWillStart")}dbUpgrading(e,t){this._dispatchEvent("databaseUpgrading",t)}dbUpgradeComplete(e,t){this._dispatchEvent("databaseUpgradeDidComplete",t)}_callCppProxy(e,...t){const s=this.logger.createTraceId();try{this.logger.debug(Tr.P_CALL_ADDON_O,JSON.stringify({method:e,content:t}),s);return mr[e](...t)}catch(t){throw this.logger.error(Tr.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:e}),s),t}}refetchNaviInfo(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())}sendHTTPRequest(e){return jr(this.logger,e)}onReceiveRendererLog(e){this.logger.recvRendererLog(e)}setNetwork(e,t){if(this.tcpMgr.setNetwork(e,t),e.status&&this.cloudController){const e=this.tcpMgr.getToken();this.cloudController.request(this.cloudControllerUri,er,e)}}destroy(){qs.stop(),this.reporter.stop(),this.logger.destroy(),mr.destroy()}getHistoryMessagesByObjectNames(e,t){return I(this,void 0,void 0,(function*(){const{conversationType:s,targetId:r,channelId:i}=e,{timestamp:n,count:o,order:a,messageTypes:c}=t,_=o+1,l=Ci(this.logger,!1,"getHistoryMessagesByObjectNames",s,r,n,_,c,0===a,i||""),d=JSON.parse(l).list.reverse().map((({obj:e})=>this._buildMessage(e)));return Ss({list:_===d.length?d.slice(1,_):d,hasMore:o<d.length})}))}_updateMessageReceiptStatus(e,t,s,r){return Ci(this.logger,!0,"updateMessageReceiptStatus",e,t,s,r||"")}updateMessageReceiptStatus(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=this._updateMessageReceiptStatus(e,t,s,r);return Ss(i)}))}getNaviInfoFromCache(){return this.tcpMgr.getConnectionStatus()!==mt.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())}getConnectedTime(){return this.tcpMgr.getConnectedTime()}_getServerTime(){return Date.now()-mr.getDeltaTime()}_getCurrentUserId(){return this.tcpMgr.getCurrentUserId()}getMainProcessCache(){const e=this.tcpMgr.getConnectedTime(),t=this.tcpMgr.getConnectionStatus(),s=this.getNaviInfoFromCache(),r=this.tcpMgr.getCurrentUserId();return{connectedTime:e,deviceId:this._deviceId,crtUserId:r,naviInfo:s,connectionStatus:t,deltaTime:mr.getDeltaTime(),commitId:"07c327459d99ef27cc3fa8e218a316fa67bab020"}}_enableCreateEmptyTopConversation(e){Ci(this.logger,!1,"enableCreateEmptyTopConversation",e)}_registerBuildinMessageTypes(){ur().forEach((e=>{this.registerMessageType(e.objectName,e)}))}_parseMessageJsonContent(e,t){let s;try{s=e?JSON.parse(e):{}}catch(r){s=e,this.logger.error(Tr.P_PARSE_JSON_MSGS_E,JSON.stringify({content:e,messageId:t}))}return s}_buildSupportExt(e,t){let s=null;return e&&(s=this._msgExpansionHandler.parseReceiveExpansion(t)),s}_handleReadReceiptRequest(e){const t=JSON.parse(e),s=this.getNaviInfoFromCache();if(!(null==s?void 0:s.grpRRVer))return t;const{hasRespond:r,readerInfo:i={},readCount:n,totalCount:o,readerList:a=[]}=t,c={readCount:n,totalCount:o};if(1===(null==s?void 0:s.grpRRVer)){const e=[];for(const t in i)e.push({userId:t,readTime:i[t]});c.readerList=e,c.hasRespond=r}return 3===(null==s?void 0:s.grpRRVer)&&(c.readerList=a),c}_buildMessage(e,t){const s=JSON.parse(e);return g(this,Mi,"m",wi).call(this,s,t)}_updateReadReceiptInfo(e,t){const s=g(this,Mi,"m",an).call(this,e);if(!s.isOk)return;const r=s.data,i=r.readReceiptRequest?JSON.parse(r.readReceiptRequest):{},n=Object.assign(Object.assign({},i),t);Ci(this.logger,!1,"updateReadReceiptRequestInfo",e,JSON.stringify(n))}_buildConversation(e){const t=JSON.parse(e);return g(this,Mi,"m",Hi).call(this,t)}_convertResultList(e,t){let{list:s}=JSON.parse(e);return s=s.map((e=>{const s=JSON.parse(e.obj);return t?t(s):s})),s}_getMessagesByUIds(e){if(0===e.length)return[];const t=Ci(this.logger,!1,"getMessageByUids",e);return JSON.parse(t).list.map((e=>g(this,Mi,"m",wi).call(this,JSON.parse(e.obj))))}_handleLowPriorityMessages(e,t){if(this._lowPriorityMessageHandler.isEmpty())return;const s=Date.now(),{count:r}=this._lowPriorityMessageHandler,i=this.logger.createTraceId();this.logger.info(Tr.L_HANDLE_LOW_PRIORITY_MESSAGES_T,JSON.stringify({startTime:s,count:r}),i);const n=this._lowPriorityMessageHandler.build(),{srsmsgs:o,readNtfs:a,expansionMsgQueue:c,v1ReceiptMsgs:_,privateRSMsgs:l,groupRSMsgs:d,rrmsgs:E,logCmdQueue:u,cloudControllerVers:R,messageUIds:h}=n,I=new Map;this._getMessagesByUIds([...h.values()]).forEach((e=>{I.set(e.messageUId,e)})),this._handleExpansionMsgQueue(c,I),this._sendMessageNotification(a,!1),this._handlerReadReceiptMsgV1(_,I,e),this._handleSRSMsgs(o,t),this._handlerPrivateRSMsgs(l),this._handlerGroupRSMsgs(d,I),this._handlerRRMsgs(E,I),R.length>0&&(this.cloudControllerMsgs.push(...R),this._ccMsgHandler()),u.forEach((e=>{const{startTime:t,endTime:s,platform:r,logId:i,uri:n,messageUId:o}=e;this.reporter.report(t,s,r,n,i,o)})),this.logger.info(Tr.L_HANDLE_LOW_PRIORITY_MESSAGES_R,JSON.stringify({startTime:s,cost:Date.now()-s}),i)}_updateReadReceiptRequestInfoList(e){if(0===e.length)return;const t=e.map((e=>JSON.stringify({message_uid:e.messageUId,request_info:JSON.stringify(e.readReceiptInfo)})));Ci(this.logger,!1,"updateReadReceiptRequestInfoList",t)}_handlerRRMsgs(e,t){const s=[],r=[];Array.from(e.entries()).forEach((([e,i])=>{const n=t.get(e);if(!n)return;const{rrn:o,tmn:a}=i.content;let c=n.readReceiptInfo||{};c=Object.assign(Object.assign({},c),{readCount:o,totalCount:a}),n.readReceiptInfo=c,s.push({messageUId:e,readReceiptInfo:c}),r.push(i)})),this._updateReadReceiptRequestInfoList(s),this._sendMessageNotification(r,!1)}_handlerGroupRSMsgs(e,t){const s=[],r=[];Array.from(e.entries()).forEach((([e,{totalCount:i,readedCount:n}])=>{const o=t.get(e);if(!o)return;const{conversationType:a,targetId:c,channelId:_}=o;let l=o.readReceiptInfo||{};l=Object.assign(Object.assign({},l),{readCount:n,totalCount:i}),o.readReceiptInfo=l,s.push({messageUId:e,readReceiptInfo:l}),r.push({conversationType:a,targetId:c,channelId:_,readedCount:n,totalCount:i,messageUId:e})})),this._updateReadReceiptRequestInfoList(s),r.forEach((e=>this._sendMessageReadReceipt({groupReadReceipt:e})))}_handlerPrivateRSMsgs(e){e.forEach((e=>{const{conversationType:t,targetId:s,channelId:r,timestamp:i}=e;this._updateMessageReceiptStatus(t,s,i,r||""),this._sendMessageReadReceipt({privateReadReceipt:{conversationType:t,targetId:s,channelId:r||"",endMsgTime:i}})}))}_handleSRSMsgs(e,t){1!==this.getNaviInfoFromCache().sesDriven?this._sendMessageNotification(e,!1):e.forEach((e=>{const{conversationType:s,targetId:r,channelId:i,sentTime:n,content:o}=e;n>t||this._sendsyncReadStatus({conversationType:s,targetId:r,channelId:i,timestamp:o.lastMessageSendTime})}))}_handlerReadReceiptMsgV1(e,t,s){if(0===e.length)return;const r=new Set,i=[];e.forEach((e=>{const{messageType:n,senderUserId:o,content:a}=e;if(n===Ze){const{messageUId:n}=a,c=t.get(n);if(!c||c.senderUserId!==o)return;return c.readReceiptInfo=o===s?{isReceiptRequestMessage:!0,readerList:[]}:{isReceiptRequestMessage:!0,hasRespond:!1},r.add(c),void i.push(e)}const c=a.receiptMessageDic;if(o===s)return Object.values(c).forEach((e=>{e.forEach((e=>{const s=t.get(e);s&&(s.readReceiptInfo=Object.assign(Object.assign({},s.readReceiptInfo),{hasRespond:!0}),r.add(s))}))})),void i.push(e);const _=c[s];_&&0!==_.length&&(_.forEach((e=>{const s=t.get(e);if(!s)return;const i=s.readReceiptInfo,n=((null==i?void 0:i.readerList)||[]).concat(o);s.readReceiptInfo=Object.assign(Object.assign({},s.readReceiptInfo),{readerList:n}),r.add(s)})),i.push(e))})),this._enableReadReceiptStorage&&this._updateReadReceiptRequestInfoList(Array.from(r.values()).map((e=>({messageUId:e.messageUId,readReceiptInfo:e.readReceiptInfo})))),this._sendMessageNotification(i,!1)}_handleExpansionMsgQueue(e,t){if(0===e.size)return;const s=[],r=[];Array.from(e.entries()).forEach((([e,i])=>{const n=t.get(e);if(!n||!i.length)return;const o=new Set,a=new Set;let c=n.expansion||{};i.forEach((({put:e,del:t,clear:s})=>{if(s)return Object.keys(c).forEach((e=>{o.add(e),a.clear()})),void(c={});e&&(Object.keys(e).forEach((e=>{o.delete(e),a.add(e)})),c=Object.assign(Object.assign({},c),e)),t&&t.forEach((e=>{o.add(e),a.delete(e),delete c[e]}))})),n.expansion=c;const _={};Object.keys(c).forEach((e=>{_[e]={v:c[e]}})),s.push({messageUId:e,expansion:JSON.stringify(_)});const l={},{conversationType:d,targetId:E,channelId:u}=n;let R=!1;o.size>0&&(R=!0,l.deletedExpansion={conversationType:d,targetId:E,channelId:u||"",messageUId:e,deletedKeys:Array.from(o)}),a.size>0&&(R=!0,l.updatedExpansion={conversationType:d,targetId:E,channelId:u||"",messageUId:e,expansion:c}),R&&r.push(l)})),g(this,Mi,"m",Wi).call(this,s),r.forEach((e=>this._dispatchEvent("expansion",e)))}_handleHighPriorityMessages(e,t){const s=e.filter((e=>{const{messageType:t,conversationType:s}=e;return t!==Qe&&(t===Xe?g(this,Mi,"m",Yi).call(this,e,"highPriorityMessages"):s!==Le.CHATROOM||g(this,Mi,"m",Ji).call(this,e))}));this._sendMessageNotification(s,t)}_ccMsgHandler(){var e;return I(this,void 0,void 0,(function*(){if(!this.cloudControllerLock)return;this.cloudControllerLock=!1;if(this.cloudControllerMsgs.shift()){const t=this.tcpMgr.getToken(),s=(yield null===(e=this.cloudController)||void 0===e?void 0:e.request(this.cloudControllerUri,tr,t))||0;this.cloudControllerMsgs=this.cloudControllerMsgs.filter((e=>e>s)),this.cloudControllerLock=!0,this._ccMsgHandler()}}))}_sendMessageNotification(e,t){e.length>0&&this._dispatchEvent("batchMessage",e,void 0,t)}_sendPullOfflineFinished(){this._isConnected?(this.logger.info(z),this._dispatchEvent("pullFinished")):this._offlineFinishedPending=!0}_handleMessageModified(e,t,s){const r=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));if(1===s)r.length&&this._dispatchEvent("messagesModified",r);else if(2===s){const e=r.filter((e=>g(this,Mi,"m",Yi).call(this,e,"messageModified")));this._sendMessageNotification(e,!1)}this._needDispatchMessageModifiedSyncCompleted&&!t&&this._isConnected&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}_handleChatroomKVUpdate(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{roomId:t,key:s,value:r,operator:i,version:n,isDeleted:o}=JSON.parse(e);return{chatroomId:t,key:s,value:r,timestamp:n,type:o?pe.DELETE:pe.UPDATE}}));t.length&&this._sendChatroomEvents({updatedEntries:t})}_handleChatroomFullKVSync(e,t,s){const r=this._chatroomCache.get(e);if(!r)return;r.isKVSynced||(r.isKVSynced=!0,this._sendChatroomEvents({entriesSynced:e}));const i=e=>JSON.parse(e).list.map((({obj:e})=>JSON.parse(e))).reduce(((e,t)=>e.set(t.key,t)),new Map),n=i(t),o=i(s),a=[];Array.from(n.entries()).forEach((([e,t])=>{const{roomId:s,value:r,operator:i,version:n,isDeleted:c}=t,_=o.get(e);_?(o.delete(e),a.push({chatroomId:s,key:e,value:_.value,timestamp:_.version,type:pe.UPDATE})):a.push({chatroomId:s,key:e,value:r,timestamp:n,type:pe.DELETE})})),Array.from(o.entries()).forEach((([t,s])=>{a.push({chatroomId:e,key:t,value:s.value,timestamp:s.version,type:pe.UPDATE})})),a.length&&this._sendChatroomEvents({updatedEntries:a})}_sendChatroomEvents(e){this._dispatchEvent("chatroom",e)}_sendMessageReadReceipt(e){this._dispatchEvent("messageReadReceipt",e)}_sendsyncReadStatus(e){this._dispatchEvent("syncReadStatus",e)}_setConversationStatusListener(){mr.setConversationStatusListener(this._catcher.gen("setConversationStatusListener[0]",(e=>{const t=JSON.parse(e).list.map((e=>{const t=JSON.parse(e.obj),s={conversation:{channelId:t.channelId,conversationType:t.conversationType,targetId:t.targetId},updatedItems:{}};return t.status.forEach((e=>{const{type:t,value:r}=JSON.parse(e.item);if(1===t){const e=Number(r)||Dt.NOT_SET;s.updatedItems.notificationLevel={val:e,time:0},s.updatedItems.notificationStatus={val:yt(e),time:0}}else 2===t?s.updatedItems.isTop={val:"1"===r,time:0}:4===t&&(s.updatedItems.translateStrategy={val:Number(r),time:0})})),s}));t.length>0&&this._dispatchEvent("conversation",t)})),this._catcher.gen("setConversationStatusListener[1]",(e=>{this._dispatchEvent("conversationTag")})),this._catcher.gen("setConversationStatusListener[2]",((e,t,s,r)=>{this._clearUnreadCountByTimestamp({conversationType:e,targetId:t,channelId:s},r),this._sendsyncReadStatus({conversationType:e,targetId:t,channelId:s,timestamp:r})})),this._catcher.gen("setConversationStatusListener[3]",(e=>this._dispatchEvent("conversationStatusSynced",e))),this._catcher.gen("setConversationStatusListener[4]",(()=>{this._dispatchEvent("syncServerSaveUnreadCompleted")})),this._catcher.gen("setConversationStatusListener[5]",(e=>{const t=g(this,Mi,"m",Bi).call(this,e,"OnConversationUnreadChanged");if(!t.isOk)return;const s=t.data.map((e=>({conversation:e,updatedItems:{unreadMessageCount:{val:e.unreadMessageCount,time:0},hasMentioned:{val:!!e.hasMentioned,time:0}}})));this._dispatchEvent("conversation",s)})))}_setPushNotificationListener(){mr.setPushNotificationListener(this._catcher.gen("setPushNotificationListener[0]",(e=>this._getRTCProfile())),this._catcher.gen("setPushNotificationListener[1]",(()=>this._dispatchEvent("tag"))),this._catcher.gen("setPushNotificationListener[2]",(e=>this._dispatchEvent("userSettingsSynced",e))),this._catcher.gen("setPushNotificationListener[3]",(e=>this._dispatchEvent("userSettingsChanged",{key:Us,value:e}))),this._catcher.gen("setPushNotificationListener[4]",(e=>this._dispatchEvent("userSettingsChanged",{key:Ms,value:e}))))}_getRTCProfile(){const e=this._callCppProxy("getRTCProfile");if(!e)return;const t=this.tcpMgr.getToken();this.navi.updateVoipCallInfo(t,e);const s=this.navi.getNaviInfoFromCache(t);this._dispatchEvent("onNaviDataChange",s)}_setRTCLivingRoomEventListener(){mr.setRTCRoomEventListener(this._catcher.gen("setRTCRoomEventListener",(e=>{this._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(e))})))}_setChatroomEventListener(){mr.setChatroomEventListener(this._catcher.gen("setChatroomEventListener[0]",((e,t)=>this._sendChatroomEvents({chatroomDestroyed:e,chatroomDestroyedType:t})))),mr.setChatroomStatusListener(this._catcher.gen("setChatroomEventListener[1]",((e,t,s)=>this._handleChatroomFullKVSync(e,t,s))),this._catcher.gen("setChatroomEventListener[2]",(e=>this._handleChatroomKVUpdate(e))))}_setCallInfoListener(){mr.setCallInfoListener(this._catcher.gen("setCallInfoListener[0]",(e=>{const t=[];try{JSON.parse(e).list.forEach((e=>{Object.entries(e).forEach((([e,s])=>{t.push({key:e,value:s})}))}))}catch(e){this.logger.error(Tr.P_PARSE_JSON_E,JSON.stringify({error:e}))}this._dispatchEvent("callInfo",JSON.stringify({list:t}))})))}_setSubscribeEventListener(){mr.setSubscribeEventListener(this._catcher.gen("setSubscribeEventListener[0]",(()=>{})),this._catcher.gen("setSubscribeEventListener[1]",(e=>{this._dispatchEvent("syncSubscribedUserStatusFinished",e)})),this._catcher.gen("setSubscribeEventListener[2]",(e=>{const t=this._buildSubscribeEventData(e).map((e=>({userId:e.userId,subscribeType:e.subscribeType,subscribeTime:e.subscribeTime,expiry:e.expiry,operationType:e.operationType})));this._dispatchEvent("subscribedRelationChange",t)})),this._catcher.gen("setSubscribeEventListener[3]",(e=>{const t=this._buildSubscribeEventData(e).map((e=>{const{userId:t,subscribeType:s,subscribeTime:r,expiry:i,details:n,userProfile:o}=e,a={userId:t,subscribeType:s,subscribeTime:r,expiry:i};return[St.ONLINE_STATUS,St.FRIEND_ONLINE_STATUS].includes(s)?a.details=n:[St.USER_PROFILE,St.FRIEND_USER_PROFILE].includes(s)&&(a.userProfile=o),a}));this._dispatchEvent("subscribedUserStatusChange",t)})))}_setUserProfileListener(){mr.setUserProfileListener(this._catcher.gen("setUserProfileListener[0]",(e=>{this._dispatchEvent("syncSubscribedUserStatusFinished",e)})),this._catcher.gen("setUserProfileListener[1]",(e=>{this._dispatchEvent("ownUserProfileChanged",this._string2userProfileInfo(e))})))}_onGroupOperationChanged(e,t,s,r,i){let n,o,a=[];try{n=JSON.parse(r),a=JSON.parse(i),o=JSON.parse(e);let c={groupId:n[0]?n[0].groupId:"",operatorInfo:this._convertGroupMemberInfoList([o])[0],operation:t,operationTime:s};0===t?[c.groupInfo]=this._convertGroupInfoList(n):c.memberInfos=this._convertGroupMemberInfoList(a),this._dispatchEvent("groupOperation",c)}catch(t){this.logger.error(Tr.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:r,membersJson:i,operatorInfo:e}))}}_onGroupInfoChanged(e,t,s,r,i,n){try{const o=this._convertUpdateGroupInfoList(JSON.parse(i))[0];switch(e){case Re.GROUP_INFO_CHANGE:const i=JSON.parse(s),a={operatorInfo:i.userId?this._convertGroupMemberInfoList([i])[0]:void 0,operationTime:n,groupInfo:o,changedGroupInfo:o,fullGroupInfo:r?this._convertUpdateGroupInfoList(JSON.parse(r))[0]:o};this._dispatchEvent("groupInfoChanged",a);break;case Re.GROUP_REMARK_DELETE:case Re.GROUP_REMARK_SET:{const s=e===Re.GROUP_REMARK_SET?he.ADD:he.REMOVE;this._dispatchEvent("groupRemarkChangedSync",{groupId:t,operationType:s,operationTime:n,groupRemark:(null==o?void 0:o.remark)||""});break}}}catch(e){this.logger.error(Tr.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:i,operatorInfoJson:s}))}}_onGroupMemberInfoChanged(e,t,s,r){try{const i=JSON.parse(t),n=JSON.parse(s),o={groupId:e,operatorInfo:i.userId?this._convertGroupMemberInfoList([i])[0]:void 0,memberInfo:this._convertGroupMemberInfoList([n])[0],operationTime:r};this._dispatchEvent("groupMemberInfoChanged",o)}catch(e){this.logger.error(Tr.P_PARSE_JSON_E,JSON.stringify({error:e,operatorInfoJson:t,updateMemberInfoJson:s}))}}_onGroupRequestChanged(e,t,s,r){try{const e=JSON.parse(s),{groupId:t,joinUser:i,approverUser:n,inviterUser:o,type:a,status:c,direction:_,remark:l}=e,d=Object.assign(Object.assign(Object.assign(Object.assign({groupId:t},i&&{joinMemberInfo:this._convertGroupMemberInfoList([i])[0]}),o&&o.userId&&{inviterInfo:this._convertGroupMemberInfoList([o])[0]}),n&&n.userId&&{operatorInfo:this._convertGroupMemberInfoList([n])[0]}),{status:c,direction:_,type:a,operationTime:r,reason:l});this._dispatchEvent("groupApplicationEvent",d)}catch(e){this.logger.error(Tr.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfo:t,requestInfoJson:s}))}}_onFavoriteMembersChanged(e,t,s,r){try{const i=JSON.parse(s);let n=[];i&&ns(i.list)&&(n=i.list.map((e=>e.value))),this._dispatchEvent("groupFollowsChangedSync",{groupId:e,operationType:t,operationTime:r,userIds:n})}catch(e){this.logger.error(Tr.P_PARSE_JSON_E,JSON.stringify({error:e,memberIds:s}))}}_setEntrustGroupListener(){mr.setEntrustGroupListener(this._catcher.gen("setEntrustGroupListener[0]",this._onGroupOperationChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[1]",this._onGroupInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[2]",this._onGroupMemberInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[3]",this._onGroupRequestChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[4]",this._onFavoriteMembersChanged.bind(this)))}_onFriendApplicationStatusChanged(e,t,s,r,i,n){this._dispatchEvent("friendApplicationStatusChanged",{userId:e,applicationType:t,applicationStatus:s,directionType:r,operationTime:i,extra:null!=n?n:""})}_onFriendAdd(e,t,s,r,i){this._dispatchEvent("friendAdd",{userId:t,name:s,portraitUri:r,directionType:e,operationTime:i})}_onFriendDelete(e,t,s){const r={directionType:e,operationTime:s,userIds:JSON.parse(t).list.map((e=>e.value))};this._dispatchEvent("friendDelete",r)}_onFriendsClearedFromServer(e){this._dispatchEvent("friendCleared",e)}_onFriendInfoChangedSync(e,t,s){try{const r=JSON.parse(s);this._dispatchEvent("friendInfoChangedSync",{userId:e,remark:t,extProfile:r.list,operationTime:0})}catch(e){this.logger.error(Tr.P_PARSE_JSON_E,JSON.stringify({error:e,profiles:s}))}}_setFriendEventListener(){mr.setFriendEventListener(this._catcher.gen("setFriendEventListener[0]",this._onFriendApplicationStatusChanged.bind(this)),this._catcher.gen("setFriendEventListener[1]",this._onFriendAdd.bind(this)),this._catcher.gen("setFriendEventListener[2]",this._onFriendDelete.bind(this)),this._catcher.gen("setFriendEventListener[3]",this._onFriendsClearedFromServer.bind(this)),this._catcher.gen("setFriendEventListener[4]",this._onFriendInfoChangedSync.bind(this)))}registerMessageType(e,t){t.isPersited=e!==Xe&&t.isPersited;let s=0;const{isCounted:r,isCustom:i,isStatusMessage:n,searchProps:o,isPersited:a}=t;a&&(s|=1),r&&(s|=2),n&&(s=16),i&&function(e,t){const s=Er.get(e);s&&!s.isCustom&&console.warn(`Builtin message type '${e}' cannot be registered`),t.isStatusMessage&&(t.isCounted=t.isPersited=!1),Er.set(e,Object.assign(Object.assign({},t),{isCustom:!0}))}(e,t),Ci(this.logger,!1,"registerMessageType",e,s,o||[])}connect(e,t,s,r){return this.tcpMgr.connect(e,t,s,r)}reconnect(e,t,s){const r=Pe.RC_SOCKET_DISCONNECTED;return this.tcpMgr.reconnect(e,t,s,r)}reportSDKInfo(e){const t=JSON.stringify(Object.assign(Object.assign({},e),{"electron-main":"5.44.0-alpha.1"}));this.logger.info(Tr.P_REPORT_VER_O,t),Ci(this.logger,!1,"uploadSDKVersion",t,"")}disconnect(e,t){return I(this,void 0,void 0,(function*(){return e=e||!0,this._chatroomCache.clear(),this.reporter.stop(),xr(null,this.logger),yield this.tcpMgr.disconnect(e,t),Ss()}))}setUserStatus(e){const t=Oi.create(this.logger,"setUserStatus");return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}getUserStatus(e){const t=Oi.create(this.logger,"getUserStatus");return t.asyncInvoke(e,(e=>t.ok({status:e})),(e=>t.fail(e))).result()}_handleDirectionalUserIdList(e,t){let{messageType:s,content:r,directionalUserIdList:i=[]}=e;const n=t===Le.GROUP;if(s===qe&&r.receiptMessageDic&&n)for(const e in r.receiptMessageDic)i.push(e);return s===ze&&(i=((e,t)=>t&&0!==t.length?[Le.GROUP,Le.ULTRA_GROUP,Le.APP_PUBLIC_SERVICE,Le.PUBLIC_SERVICE].includes(e)?t:[]:t||[])(t,[this._getCurrentUserId()])),i}_handleMessage2Callback(e,t){switch(e.messageType){case Ye:this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e);break;case Ze:this._enableReadReceiptStorage&&this._updateReadReceiptInfo(t.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});break;case qe:if(this._enableReadReceiptStorage){const{receiptMessageDic:e}=t.content;if(!e)return;for(const t in e)e[t].forEach((e=>{this._updateReadReceiptInfo(e,{isReceiptRequestMessage:!0,hasRespond:!0})}))}}}sendMessage(e,t,s,r){return I(this,void 0,void 0,(function*(){const{conversationType:i,targetId:n,channelId:o}=e;let{messageType:a,content:c,expansion:_,pushConfig:l,pushContent:d="",pushData:E="",directionalUserIdList:u=[],disableNotification:R=!1,canIncludeExpansion:h=!1,isVoipPush:I=!1,messageId:g=0,disableUpdateLastMessage:T,needReceipt:N,quoteInfo:C}=t,{iOSConfig:O,androidConfig:p,harmonyOSConfig:S,templateId:A="",pushTitle:f="",pushContent:m=d,pushData:v=E,disablePushTitle:P=!1,forceShowDetailContent:L=!1}=l||{};const M=hs(O,p,S);d=m,E=v;const U=(null==p?void 0:p.notificationId)||"";u=this._handleDirectionalUserIdList(t,i);const D={};for(const e in _)D[e]={v:_[e]};const b=A;this.logger.info(Tr.P_SEND_MSG_T,JSON.stringify({messageType:a,conversationType:i,targetId:n,channelId:o}),s);const y=Oi.create(this.logger,"sendMessage"),V=Ci(this.logger,!1,"sendMessage",((e,r)=>{const i=this._buildMessage(e,!1);this.logger.info(Tr.P_SEND_MSG_R,JSON.stringify({code:r,messageUId:i.messageUId}),s),r!==Pe.SENSITIVE_REPLACE?(this._handleMessage2Callback(i,t),y.ok(i)):y.fail(r)}),((e,t)=>{const r=this._buildMessage(e,!1);this.logger.warn(Tr.P_SEND_MSG_R,JSON.stringify({code:t,messageId:r.messageId}),s),r.sentTime=Date.now()-mr.getDeltaTime(),y.fail(t,r)}),i,n,a,JSON.stringify(c),u,R,P,L,d,E,U,f,M,b,h,JSON.stringify(D),I,o||"",g,!!T,!!N,(null==C?void 0:C.messageUId)||"",(null==C?void 0:C.senderId)||"",(null==C?void 0:C.objectName)||""),G=JSON.parse(V);return null==r||r(G.messageId),y.result()}))}recallMsg(e,t){var s;return I(this,void 0,void 0,(function*(){const r=e.channelId||"",{targetId:i,conversationType:n}=e,{user:o,pushContent:a,extra:c,pushConfig:_,disableNotification:l,isDelete:d,directionalUserIdList:E,disableUpdateLastMessage:u,isAdmin:R,messageUId:h,sentTime:T}=t,N={conversationType:n,targetId:i,messageUId:h,sentTime:T,user:o,extra:c,channelId:r,isDelete:d||!1,isAdmin:R};o&&(N.user=o),c&&(N.extra=c);const C={conversationType:n,targetId:i,senderUserId:this.tcpMgr.getCurrentUserId(),content:N,objectName:Xe,messageUid:h,direction:Lt.SEND,status:Vt.UNREAD,sentTime:T,channelId:r},O=this._buildMessage(JSON.stringify(C),!1),p=Oi.create(this.logger,"recallMessage");return p.asyncInvoke((e=>I(this,void 0,void 0,(function*(){g(this,Mi,"m",Yi).call(this,O,"recall"),n===Le.ULTRA_GROUP&&this._dispatchEvent("ultraGroupMessageRecalled",[O]),O.pushConfig=_,p.ok(O)}))),(e=>p.fail(e)),Xe,JSON.stringify(N),l||!1,(null==_?void 0:_.disablePushTitle)||!1,(null==_?void 0:_.forceShowDetailContent)||!1,a||"",(null==_?void 0:_.pushData)||"",(null===(s=null==_?void 0:_.androidConfig)||void 0===s?void 0:s.notificationId)||"",(null==_?void 0:_.pushTitle)||"",hs(null==_?void 0:_.iOSConfig,null==_?void 0:_.androidConfig,null==_?void 0:_.harmonyOSConfig),(null==_?void 0:_.templateId)||"",r,E||[],h,null!=u&&u).result()}))}getHistoryMessage(e,t,s){return I(this,void 0,void 0,(function*(){return s?Ss(g(this,Mi,"m",Ki).call(this,e,t)):g(this,Mi,"m",Xi).call(this,e,t)}))}getContinuousMessages(e,t){return I(this,void 0,void 0,(function*(){const{timestamp:s,count:r,order:i}=t,{conversationType:n,targetId:o,channelId:a}=e,c=Oi.create(this.logger,"getContinuousMessages",this.logger.createTraceId());return(yield c.asyncInvoke(n,o,s,r,((e,t,s)=>c.ok({listJson:e,hasMore:s,nextTime:t})),(e=>c.fail(e)),0===i,a||"").result()).trans((({listJson:e,hasMore:t,nextTime:s})=>({list:JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e))).reverse(),hasMore:!!t,timestamp:s})))}))}deleteRemoteMessage(e,t){const{conversationType:s,targetId:r,channelId:i}=e,n=JSON.stringify(t),o=this.logger.createTraceId(),a=Oi.create(this.logger,"deleteRemoteHistoryMessages",o);return a.asyncInvoke(s,r,n,!1,i||"",(()=>a.ok()),(e=>a.fail(e))).result()}deleteRemoteMessageByTimestamp(e,t){const s=this.logger.createTraceId(),r=Oi.create(this.logger,"clearRemoteHistoryMessages",s);return r.asyncInvoke(e.conversationType,e.targetId,t,(()=>r.ok()),(e=>r.fail(e)),e.channelId||"").result()}clearLocalMessages(e){return I(this,void 0,void 0,(function*(){return g(this,Mi,"m",Qi).call(this,e),Ss()}))}getConversationListByTimestamp(e,t){return I(this,void 0,void 0,(function*(){const{channelId:s,count:r,startTime:i,order:n,conversationTypes:o,topPriority:a,unreadCountFilter:c}=e,_=(o&&o.length>0?o:Fe(t?De:Me)).map((e=>({conversationType:e,channelId:e===Le.ULTRA_GROUP?g(this,Mi,"m",Zi).call(this,""):s,channelIdValid:e===Le.ULTRA_GROUP||"string"==typeof s}))),l={sendTime:i,limit:r,sort:a?1:0,unreadFilter:c||Yt},d=Oi.create(this.logger,"getConversationListByPageWithTopPriorityV2"),E=yield d.invoke(_,l,((e,t)=>d.flush(ps.from(e,void 0,t)))).result();return E.isOk?g(this,Mi,"m",Bi).call(this,E.data,"getConversationListByPageWithTopPriorityV2"):E.wipe()}))}getTopConversationList(e,t,s){return I(this,void 0,void 0,(function*(){const r=(((null==t?void 0:t.length)||0)>0?t:Fe(e?De:Me)).map((e=>({conversationType:e,channelId:e===Le.ULTRA_GROUP?g(this,Mi,"m",Zi).call(this,""):s,channelIdValid:e===Le.ULTRA_GROUP||"string"==typeof s}))),i=Ci(this.logger,!1,"getTopConversationsV2",r);return g(this,Mi,"m",Bi).call(this,i,"getTopConversationsV2")}))}getUnreadConversationList(e,t){return I(this,void 0,void 0,(function*(){const s=(((null==t?void 0:t.length)||0)>0?t:Fe(e?De:Me)).map((e=>({conversationType:e,channelId:e===Le.ULTRA_GROUP?g(this,Mi,"m",Zi).call(this,""):"",channelIdValid:e===Le.ULTRA_GROUP}))),r=Ci(this.logger,!1,"getUnreadConversationListV2",s);return g(this,Mi,"m",Bi).call(this,r,"getUnreadConversationListV2")}))}getAllConversationList(e,t){return I(this,void 0,void 0,(function*(){const s=Fe(e?De:Me).map((e=>({conversationType:e,channelId:e===Le.ULTRA_GROUP?g(this,Mi,"m",Zi).call(this,""):t,channelIdValid:e===Le.ULTRA_GROUP||"string"==typeof t}))),r=Ci(this.logger,!1,"getConversationsV2",s);return g(this,Mi,"m",Bi).call(this,r,"getConversationsV2")}))}getUntaggedConversationListByPage(e,t,s){return I(this,void 0,void 0,(function*(){const r=Ci(this.logger,!1,"getConversationsByPageWithoutTag",e,t,s);return g(this,Mi,"m",Bi).call(this,r,"getConversationsByPageWithoutTag")}))}getConversation(e){return I(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=g(this,Mi,"m",qi).call(this,e);if(i)return Ss(i);const n=g(this,Mi,"m",Ki).call(this,e,{timestamp:0,count:1,order:0,messageType:""}),o=(null==n?void 0:n.list[0])||null,a=JSON.parse(Ci(this.logger,!1,"getConversationStatus",JSON.stringify([{conversation_type:t,target_id:s,channel_id:r,channel_id_valid:"string"==typeof r&&r.length>0}])))[0],c=!!(null==a?void 0:a.is_top),_=(null==a?void 0:a.translate_strategy)||Rr,l=(yield this.getConversationNotificationLevel(e)).data,d={conversationType:t,targetId:s,channelId:r,latestMessage:o,lastUnreadTime:0,isTop:c,notificationLevel:l,notificationStatus:yt(l),translateStrategy:_,unreadMessageCount:g(this,Mi,"m",zi).call(this,e)};return Ss(d)}))}batchDeleteConversations(e){const{identifiers:t,deleteRemotely:s,deleteMessages:r}=e,i=Oi.create(this.logger,"batchDeleteConversations",this.logger.createTraceId());return i.invoke({conversationIdentifiers:t.map((e=>({type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}))),deleteMessages:r,deleteRemotely:s},(()=>i.ok()),(e=>i.fail(e))).result()}clearConversations(e,t){return I(this,void 0,void 0,(function*(){const t=(e instanceof Array?e:Fe(De)).map((e=>({conversationType:e,channelIdValid:!1}))),s=Ci(this.logger,!0,"clearConversationsV2",t);return s===Pe.SUCCESS?Ss():As(s)}))}getTotalUnreadCount(e,t,s){return I(this,void 0,void 0,(function*(){const r=e.map((e=>({conversationType:e,channelId:e===Le.ULTRA_GROUP?g(this,Mi,"m",Zi).call(this,""):s,channelIdValid:e===Le.ULTRA_GROUP||"string"==typeof s})));let i=Ci(this.logger,!0,"getTotalUnreadCount2",r,t);return Ss(i)}))}getConversationUnreadCount(e){return I(this,void 0,void 0,(function*(){const t=g(this,Mi,"m",zi).call(this,e);return Ss(t)}))}clearConversationUnreadCount(e){return I(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e;if(t===Le.ULTRA_GROUP){const e=this._getServerTime(),i=Oi.create(this.logger,"setReadTimestamp",this.logger.createTraceId());return i.asyncInvoke(t,s,e,(()=>i.ok()),(e=>i.fail(e)),r||"").result()}return g(this,Mi,"m",en).call(this,e),Ss()}))}clearAllSGUnreadCount(){return I(this,void 0,void 0,(function*(){const e=yield this.getUnreadConversationList(!1);return e.isOk?(e.data.forEach((e=>{e.conversationType!==Le.ULTRA_GROUP&&g(this,Mi,"m",en).call(this,e)})),Ss()):e.wipe()}))}_clearUnreadCountByTimestamp(e,t){const{conversationType:s,targetId:r,channelId:i}=e;Ci(this.logger,!1,"clearUnreadCountByTimestamp",s,r,t,i||"")}clearUnreadCountByTimestamp(e,t){return I(this,void 0,void 0,(function*(){return this._clearUnreadCountByTimestamp(e,t),Ss()}))}getFirstUnreadMessage(e){return I(this,void 0,void 0,(function*(){const t=g(this,Mi,"m",tn).call(this,e);return Ss(t)}))}getFirstUnreadMessageDigest(e){return I(this,void 0,void 0,(function*(){const t=g(this,Mi,"m",tn).call(this,e);return Ss(t?{messageUId:t.messageUId,sentTime:t.sentTime}:null)}))}batchSetConversationToTop(e,t,s,r){return g(this,Mi,"m",sn).call(this,e,-1,t?1:0,-1,s,r)}batchSetConversationNotificationLevel(e,t){const s=this.logger.createTraceId(),r=Oi.create(this.logger,"setBlockPushLevelInBatches",s),i=e.map((e=>({conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId,level:t})));return r.asyncInvoke(JSON.stringify(i),(()=>r.ok()),(e=>r.fail(e))).result()}batchSetConversationTranslateStrategy(e,t){return g(this,Mi,"m",sn).call(this,e,-1,-1,t,!1,!1)}setConversationTypeNotificationLevel(e,t){const s=Oi.create(this.logger,"setBlockPushLevelForType",this.logger.createTraceId());return s.asyncInvoke(e,t,(()=>s.ok()),(e=>s.fail(e))).result()}getConversationTypeNotificationLevel(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!0,"getBlockPushLevelForType",e);return Ss(t)}))}searchConversationByContent(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=this.logger.createTraceId(),n=Oi.create(this.logger,"searchConversationByContentV2",i),o=r.map((e=>({conversationType:e,channelId:s,channelIdValid:!0}))),a=yield n.asyncInvoke(o,e,t,((e,t,s)=>{e===Pe.SUCCESS?n.ok({result:t,matchedNumber:s}):n.fail(e)})).result();return a.isOk?a.trans((e=>JSON.parse(e.result).map((e=>g(this,Mi,"m",Hi).call(this,e))))):Ss([])}))}searchConversationByContentWithAllChannel(e,t,s){return I(this,void 0,void 0,(function*(){s=s||Fe(Me);const r=this.logger.createTraceId(),i=Oi.create(this.logger,"searchConversationByContentV2",r),n=s.map((e=>({conversationType:e,channelIdValid:!1}))),o=yield i.asyncInvoke(n,e,t,((e,t,s)=>{e===Pe.SUCCESS?i.ok({result:t,matchedNumber:s}):i.fail(e)})).result();return o.isOk?o.trans((e=>JSON.parse(e.result).map((e=>g(this,Mi,"m",Hi).call(this,e))))):Ss([])}))}searchMessagesWithParams(e){var t,s,r,i,n;return I(this,void 0,void 0,(function*(){const o=this.logger.createTraceId(),a=function(e){if(!e)return[];let t=[];const s=e=>{if(0===t.length)return void t.push(...e);const s=[];e.forEach((e=>{s.push(...t.map((t=>Object.assign(Object.assign({},t),e))))})),t=s},{conversationTypes:r=[],targetIds:i=[],channelIds:n=[]}=e,o=Ps(r).map((e=>({conversationType:e}))),a=Ps(i).map((e=>({targetId:e}))),c=Ps(n).length?n.map((e=>({channelId:e}))):[{channelIdValid:!1}];return s(o),s(a),s(c),t}(e.conversationFilter),c={keyword:e.keyword,limit:e.limit,desc:!e.order,offset:null!==(t=e.offset)&&void 0!==t?t:0,needMatchCount:!0,startTime:null===(s=e.timeRange)||void 0===s?void 0:s.startTime,endTime:null===(r=e.timeRange)||void 0===r?void 0:r.endTime,objectNames:Ps((null===(i=e.messageFilter)||void 0===i?void 0:i.objectNames)||[]),senderIds:Ps((null===(n=e.messageFilter)||void 0===n?void 0:n.senderIds)||[])},_=Oi.create(this.logger,"searchMessage",o);return(yield _.invoke(a,c,((e,t,s,r)=>{e===Pe.SUCCESS?_.ok({result:t,totalMatched:s,conditionsMatched:r}):_.fail(e)})).result()).trans((({result:e,totalMatched:t,conditionsMatched:s})=>({messages:JSON.parse(e).list.map((e=>JSON.parse(e.obj))).map((e=>g(this,Mi,"m",wi).call(this,e))),totalMatched:t,conditionsMatched:s})))}))}getUnreadMentionedMessages(e){return I(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=Ci(this.logger,!1,"getUnreadMentionedMessages",t,s,r||""),n=JSON.parse(i).list.map((({obj:e})=>g(this,Mi,"m",wi).call(this,JSON.parse(e))));return Ss(n)}))}getUnreadMentionedCount(e){var t;return I(this,void 0,void 0,(function*(){const s=g(this,Mi,"m",qi).call(this,e);return Ss(null!==(t=null==s?void 0:s.unreadMentionedCount)&&void 0!==t?t:0)}))}addToBlacklist(e){const t=Oi.create(this.logger,"addToBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}removeFromBlacklist(e){const t=Oi.create(this.logger,"removeFromBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}getBlacklist(){const e=Oi.create(this.logger,"getBlacklist",this.logger.createTraceId());return e.asyncInvoke((t=>e.ok(t)),(t=>e.fail(t))).result()}getBlacklistStatus(e){const t=Oi.create(this.logger,"getBlacklistStatus",this.logger.createTraceId());return t.asyncInvoke(e,(e=>t.ok(e)),(e=>t.fail(e))).result()}insertMessage(e,t){return I(this,void 0,void 0,(function*(){const s=g(this,Mi,"m",rn).call(this,e,t);return-1===s.messageId?As(Pe.MSG_INSERT_ERROR,"insert message failed",s):Ss(s)}))}batchInsertMessage(e,t=!1){return I(this,void 0,void 0,(function*(){const s=e.map((e=>{const{content:t,senderUserId:s,messageType:r,messageDirection:i,receivedStatus:n=0,sentStatus:o,sentTime:a,searchContent:c,isUnread:_,messageUId:l,disableNotification:d,canIncludeExpansion:E,expansion:u,channelId:R,conversationType:h,targetId:I,source:g,isMentioned:T,receivedStatusInfo:N,directedUserIds:C,disableUpdateLastMessage:O}=e,p=N?(e=>{let t=Vt.UNREAD;return(null==e?void 0:e.isRead)&&(t|=Vt.READ),(null==e?void 0:e.isListened)&&(t|=Vt.LISTENED),(null==e?void 0:e.isDownload)&&(t|=Vt.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=Vt.RETRIEVED),t})(N):n,S=a||0,A={};if(u)for(const e in u)A[e]={v:u[e],ts:S};const f=e.quoteInfo?{messageUId:e.quoteInfo.messageUId,senderId:e.quoteInfo.senderId,objectName:e.quoteInfo.objectName,quoteMessageStatus:e.quoteInfo.quoteMessageStatus||Wt}:void 0;return{conversationType:h,targetId:I,channelId:R||"",direction:i,senderUserId:s,status:o||10,sentTime:S,objectName:r,content:JSON.stringify(t),messageUid:l||"",noNotification:!!d,supportExt:!!E,extMsg:JSON.stringify(A),readStatus:p,searchContent:c||"",isUnread:!!_,source:g||"",isMention:T,directedUsers:C,disableUpdateLastMessage:!!O,quoteInfo:f}}));return Ci(this.logger,!0,"insertMessages",JSON.stringify(s),t)?Ss(!0):As(Pe.MSG_INSERT_ERROR)}))}getLocalMessageCount(e){return I(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=Ci(this.logger,!0,"getMessageCount",t,s,r||"");return Ss(i)}))}deleteLocalMessages(e){return I(this,void 0,void 0,(function*(){return g(this,Mi,"m",nn).call(this,e),Ss()}))}deleteLocalMessagesByTimestamp(e,t,s){return I(this,void 0,void 0,(function*(){return g(this,Mi,"m",on).call(this,e,t,s),Ss()}))}batchClearLocalMessagesByTimestamp(e){return I(this,void 0,void 0,(function*(){const t=e.map((e=>({conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp})));return Ci(this.logger,!1,"deleteMessageBySendTimeInBatches",JSON.stringify(t)),Ss()}))}batchClearRemoteHistoryMessages(e,t){const s=e.map((e=>({conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}))),r=Oi.create(this.logger,"deleteRemoteMessageBySendTimeInBatches",this.logger.createTraceId());return r.asyncInvoke(JSON.stringify(s),!!t,(()=>r.ok()),(e=>r.fail(e))).result()}getMessage(e){return I(this,void 0,void 0,(function*(){return g(this,Mi,"m",cn).call(this,e)}))}setMessageContent(e,t,s){return I(this,void 0,void 0,(function*(){return g(this,Mi,"m",_n).call(this,e,t,s),Ss()}))}setMessageSearchField(e,t,s){return I(this,void 0,void 0,(function*(){return Ci(this.logger,!1,"setMessageSearchField",e,t,s),Ss()}))}setMessageSentStatus(e,t){return I(this,void 0,void 0,(function*(){return Ci(this.logger,!1,"setMessageSentStatus",e,t),Ss()}))}setMessageReceivedStatus(e,t){return I(this,void 0,void 0,(function*(){return g(this,Mi,"m",ln).call(this,e,t),Ss()}))}saveTextMessageDraft(e,t){return I(this,void 0,void 0,(function*(){const{conversationType:s,targetId:r,channelId:i}=e;return Ci(this.logger,!1,"saveTextMessageDraft",s,r,t,i||"")?Ss():As(Pe.DRAFT_SAVE_ERROR)}))}getTextMessageDraft(e){return I(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=Ci(this.logger,!0,"getTextMessageDraft",t,s,r||"");return Ss(i)}))}clearTextMessageDraft(e){return I(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e;return Ci(this.logger,!1,"clearTextMessageDraft",t,s,r||"")?Ss():As(Pe.DRAFT_REMOVE_ERROR)}))}getConversationNotificationLevel(e){return I(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=Ci(this.logger,!0,"getBlockPushLevelForConversation",s,r||"",t);return Ss(i)}))}getTotalUnreadCountByLevels(e,t,s){return I(this,void 0,void 0,(function*(){const r=e.map((e=>({conversationType:e,channelIdValid:!1}))),i=Ci(this.logger,!0,"getUnreadAndMentionCountByLevel",r,t);return 0!==i.code?As(i.code):Ss(s?i.mention:i.unread)}))}sendReadReceiptV2(e,t,s){return I(this,void 0,void 0,(function*(){const r=Oi.create(this.logger,"sendReadReceipt",this.logger.createTraceId()),i=yield r.asyncInvoke(e,s||"",t,(()=>r.ok()),(e=>r.fail(e))).result();return i.isOk&&t.forEach((e=>{this._updateReadReceiptInfo(e,{hasRespond:!0});const t=g(this,Mi,"m",an).call(this,e);t.isOk&&g(this,Mi,"m",ln).call(this,t.data.messageId,1)})),i}))}getMessageReader(e,t,s){const r=Oi.create(this.logger,"getMessageReader",this.logger.createTraceId());return r.asyncInvoke(e,s,t,((e,s)=>{const i=[],n={};JSON.parse(e).list.forEach((e=>{const{id:t,time:s}=JSON.parse(e.obj);i.push({userId:t,readTime:s}),n[t]=s}));const o={readerInfo:n,readCount:i.length,totalCount:s};this._updateReadReceiptInfo(t,o),r.ok({list:i,totalMemberCount:s})}),(e=>r.fail(e))).result()}sendReadReceiptMessageV4(e,t,s){const r=Oi.create(this.logger,"sendMessageReadReceipt",this.logger.createTraceId()),{conversationType:i,targetId:n,channelId:o}=e;return r.asyncInvoke(i,n,o||"",t,s,(()=>r.ok()),(e=>r.fail(e))).result()}getMessageReadReceiptV4(e,t){const{targetId:s,channelId:r}=e,i=Oi.create(this.logger,"getMessageReadReceipt",this.logger.createTraceId());return i.asyncInvoke(s,r||"",t,((e,s,r)=>I(this,void 0,void 0,(function*(){const n=[],o=this._callCppProxy("getMessage",t),a=JSON.parse(o);try{JSON.parse(r).list.forEach((e=>{const{id:t,time:s}=JSON.parse(e.obj);n.push({userId:t,readTime:s})}))}catch(e){this.logger.error(Tr.P_PARSE_JSON_E,`method: getMessageReadReceipt, info: ${r}, error: ${e}`)}let{readerList:c=[],readCount:_=0}=JSON.parse(a.readReceiptRequest||"{}"),l=!1;c.length<n.length&&(c=n,l=!0),_<s&&(_=s,l=!0),l&&this._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify({readerList:c,readCount:_,totalCount:e})),i.ok({list:n,totalCount:e,readCount:_})}))),(e=>i.fail(e))).result()}updateConversationReadTime(e,t){const s=Oi.create(this.logger,"updateConversationReadTime",this.logger.createTraceId()),{conversationType:r,targetId:i,channelId:n}=e;return s.asyncInvoke(r,i,n||"",t,(()=>s.ok()),(e=>s.fail(e))).result()}_try2RejoinChatroom(){if(0===this._chatroomCache.size)return;const e=this.logger.createTraceId();this._chatroomCache.forEach((t=>I(this,void 0,void 0,(function*(){const{chatroomId:s,count:r,extra:i}=t;this.logger.info(P,s,e);const n=yield this._joinChrm(s,r,!1,!0,i);this.logger.summary(L,n,e);const{code:o,isOk:a,data:c}=n;a?this._sendChatroomEvents({rejoinedRoom:Object.assign({chatroomId:s,count:r},c)}):(o!==Pe.RC_CHATROOM_USER_KICKED&&o!==Pe.RC_CHATROOM_NOT_EXIST||this._chatroomCache.delete(s),this._sendChatroomEvents({rejoinedRoom:{chatroomId:s,errorCode:o}}))}))))}_joinChrm(e,t,s,r,i){const n=s?"joinChatRoom":"joinExistChatRoom";r||g(this,Mi,"m",$i).call(this,e,!0,!0);const o=Oi.create(this.logger,n,this.logger.createTraceId());return o.asyncInvoke(e,t,((s,n,a,c,_,l,d)=>{this._chatroomCache.set(e,{chatroomId:e,count:t,extra:i||"",isKVSynced:r}),o.ok({createTime:Number(s),memberCount:n,isAllChatroomBanned:a,isCurrentUserBanned:c,isCurrentChatroomBanned:_,isCurrentChatroomInWhitelist:l,joinTime:d})}),(e=>o.fail(e)),i||"").result()}joinChatroom(e,t,s,r){return I(this,void 0,void 0,(function*(){return this._joinChrm(e,t,s,!1,r)}))}quitChatroom(e,t){this._chatroomCache.delete(e);const s=Oi.create(this.logger,"quitChatRoom",this.logger.createTraceId());return s.asyncInvoke(e,(()=>s.ok()),(e=>s.fail(e)),t||"").result()}getChatroomInfo(e,t,s){const r=Oi.create(this.logger,"getChatroomInfo",this.logger.createTraceId());return r.asyncInvoke(e,t,s,((e,t)=>{const s=(e?JSON.parse(e).list:[]).map((e=>JSON.parse(e.obj)));r.ok({userInfos:s,userCount:t})}),(e=>r.fail(e))).result()}getChatroomHistoryMessages(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=this.logger.createTraceId(),n=Oi.create(this.logger,"getChatroomHistoryMessage",i);return n.asyncInvoke(e,t,s,r,(e=>{let t;try{t=JSON.parse(e)}catch(e){t={list:[],hasMore:!1}}const{list:s}=t;if(s&&s.length)try{t.list=s.map((e=>this._buildMessage(e.obj)))}catch(e){t.list=[]}n.ok(t)}),(e=>n.fail(e)),"").result()}))}setChatroomEntry(e,t,s){const r=Oi.create(this.logger,"setChatroomStatus",this.logger.createTraceId());return r.asyncInvoke(e,t.key,t.value,!!t.isAutoDelete,s,!!t.isSendNotification,t.notificationExtra||"",(()=>r.ok()),(e=>r.fail(e))).result()}setChatroomEntries(e,t){const s=Oi.create(this.logger,"setChatroomKV");return s.asyncInvoke(e,JSON.stringify(t.entries),!!t.isAutoDelete,!!t.isForce,(()=>s.ok()),(e=>s.fail(e))).result()}removeChatroomEntry(e,t,s){const r=Oi.create(this.logger,"deleteChatroomStatus",this.logger.createTraceId());return r.asyncInvoke(e,t.key,s,!!t.isSendNotification,t.notificationExtra||"",(()=>r.ok()),(e=>r.fail(e))).result()}removeChatroomEntries(e,t){const s=Oi.create(this.logger,"deleteChatroomKV",this.logger.createTraceId());return s.asyncInvoke(e,t.keys,!1,(()=>s.ok()),(e=>s.fail(e))).result()}getChatroomEntry(e,t){return I(this,void 0,void 0,(function*(){return(yield this.getAllChatroomEntries(e)).tryTrans((e=>{const s=e[t];return"string"!=typeof s?As(Pe.CHATROOM_KEY_NOT_EXIST):Ss(s)}))}))}getAllChatroomEntries(e){const t=Oi.create(this.logger,"getChatroomKV",this.logger.createTraceId());return t.asyncInvoke(e,(e=>{const s={};try{(e?JSON.parse(e):{list:[]}).list.forEach((({obj:e})=>{const t=JSON.parse(e);s[t.key]=t.value?t.value:""}))}catch(e){}t.ok(s)}),(e=>t.fail(e))).result()}getFileToken(e,t,s,r,i,n){let o;s=s||"",i=i||"",o=(r=r||"")&&"uploads"!==r?t||"":Rs(e,t);const a=this.getNaviInfoFromCache(),c={uploadDomain:Ts(a,this.logger),env:this._environment};n=n?Math.ceil(n):0;const _=Oi.create(this.logger,"getUploadToken");return _.asyncInvoke(e,o,s,r,i,JSON.stringify(c),n,a.ipType||0,((e,t,s,r,i,n,a,c,l,d,E,u,R,h,I,g,T,N,C,O,p,S,A,f)=>{_.ok({token:e,deadline:0,bosToken:t,bosDate:s,path:r,osskeyId:i,ossPolicy:n,ossSign:a,ossBucketName:c,fileName:o,s3Credential:l,s3Algorithm:d,s3Date:E,s3Policy:u,s3Signature:R,s3BucketName:h,stcAuthorization:I,stcContentSha256:g,stcDate:T,stcBucketName:N,minioAuthorization:C,minioContentSha256:O,minioDate:p,minioBucketName:S,downloadAuthInfo:A?JSON.parse(A):null})}),(e=>_.fail(e))).result()}getFileUrl(e,t,s,r){const i=this.getNaviInfoFromCache(),n=Ts(i,this.logger),o=this.logger.createTraceId(),a=Oi.create(this.logger,"getDownloadUrl",o);return a.asyncInvoke(e,s,r,t-1,JSON.stringify({url:n}),-1,i.ipType||0,(e=>a.ok({downloadUrl:e})),(e=>a.fail(e))).result()}clearLocalData(){return I(this,void 0,void 0,(function*(){const e=Ci(this.logger,!0,"clearData");return Ss(e)}))}getDeviceId(){return this._deviceId}getVoIPKey(e,t){return new Promise((s=>{this._callCppProxy("getVoIPKey",e,t,"",(e=>{setTimeout((()=>{s({code:Pe.SUCCESS,data:e})}),0)}),(e=>{setTimeout((()=>{s({code:e})}),0)}))}))}bindRTCRoomForChatroom(e){const t=Oi.create(this.logger,"bindRTCRoomForChatroom",this.logger.createTraceId());return t.asyncInvoke(e.chatRoomId,e.rtcRoomId,(()=>t.ok()),(e=>t.fail(e))).result()}rtcSignaling(e,t,s,r){const i=Oi.create(this.logger,"rtcSignaling");return i.asyncInvoke(e,t,s,r,(e=>{const t=Array.prototype.slice.call(e);i.ok(t)}),(e=>i.fail(e)),30).result()}_setRTCHeartbeatListener(){mr.setRTCHeartbeatListener(this._catcher.gen("setRTCHeartbeatListener[0]",((e,t)=>{const s=this.rtcHeartbeatResolves[e];if(!s)return;const r=s.find((e=>""===e.seqId));r&&(r.seqId=t)})),this._catcher.gen("setRTCHeartbeatListener[1]",((e,t,s,r)=>{const i=this.rtcHeartbeatResolves[e];if(!i)return;const n=i.findIndex((e=>e.seqId===s));-1!==n&&i.splice(n,1)[0].resolve({code:t,data:{version:Number(r)}})})))}rtcPing(e,t,s){const{promise:r,resolve:i}=vs(),n={resolve:i,seqId:""},o=this.rtcHeartbeatResolves[e];return o?o.push(n):this.rtcHeartbeatResolves[e]=[n],Ci(this.logger,!1,"sendRTCHeartbeat",[e],30),r}createTag(e){const t=Oi.create(this.logger,"addTag");return t.asyncInvoke(e.tagId,e.tagName,(()=>t.ok()),(e=>t.fail(e))).result()}removeTag(e){const t=Oi.create(this.logger,"deleteTag");return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}updateTag(e){const t=Oi.create(this.logger,"renameTag");return t.asyncInvoke(e.tagId,e.tagName,(()=>t.ok()),(e=>t.fail(e))).result()}getTagList(){return I(this,void 0,void 0,(function*(){const e=Ci(this.logger,!1,"getTags"),t=this._convertResultList(e,(e=>({tagId:e.tagId,tagName:e.tagName,conversationCount:e.conversationCount,createdTime:e.tagTime})));return Ss(t)}))}addTagForConversations(e,t){const s=Oi.create(this.logger,"addConversationsForTag"),r=t.map((({conversationType:e,targetId:t,channelId:s})=>({type:e,targetId:t,channelId:s})));return s.asyncInvoke(e,JSON.stringify(r),(()=>s.ok()),(e=>s.fail(e))).result()}removeTagForConversations(e,t){const s=Oi.create(this.logger,"removeConversationsForTag"),r=t.map((({conversationType:e,targetId:t,channelId:s})=>({type:e,targetId:t,channelId:s})));return s.asyncInvoke(e,JSON.stringify(r),(()=>s.ok()),(e=>s.fail(e))).result()}removeTagsForConversation(e,t){const s=Oi.create(this.logger,"removeTagsForConversation");return s.asyncInvoke(e.conversationType,e.targetId,e.channelId||"",t,(()=>s.ok()),(e=>s.fail(e))).result()}getConversationListByTag(e,t,s){return I(this,void 0,void 0,(function*(){const r=Ci(this.logger,!1,"getConversationsForTagByPage",e,t,s,""),i=this._convertResultList(r,(e=>Object.assign(Object.assign({},this._buildConversation(JSON.stringify(e))),{isTopInTag:e.topForTag})));return Ss(i)}))}getUnreadCountByTag(e,t){return I(this,void 0,void 0,(function*(){const s=Ci(this.logger,!0,"getConversationUnreadCountForTag",e,t);return Ss(s)}))}setConversationStatusInTag(e,t,s){const r=Oi.create(this.logger,"setConversationToTopForTag");return r.asyncInvoke(e,t.conversationType,t.targetId,t.channelId||"",!!s.isTop,(()=>r.ok()),(e=>r.fail(e))).result()}getTagsForConversation(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!1,"getTagsForConversation",e.conversationType,e.targetId,e.channelId||""),s=this._convertResultList(t,(e=>({tagId:e.tagId,tagName:e.tagName,isTop:e.isTop,createdTime:e.tagTime})));return Ss(s)}))}getAllUnreadMentionedCount(){return I(this,void 0,void 0,(function*(){const e=[Le.GROUP].map((e=>({conversationType:e,channelIdValid:!1}))),t=Ci(this.logger,!0,"getUnreadAndMentionCountV2",e);return 0!==t.code?As(t.code):Ss(t.mention)}))}getOSInfo(){return I(this,void 0,void 0,(function*(){const e={arch:s.arch(),platform:s.platform(),type:s.type(),version:s.version(),release:s.release(),uptime:s.uptime(),cpus:s.cpus(),freemem:s.freemem(),totalmem:s.totalmem(),networkInterfaces:s.networkInterfaces()};return Ss(e)}))}getMainProcessInfo(){return I(this,void 0,void 0,(function*(){return Ss({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()})}))}setCallInfo(e,t,s){const r=Oi.create(this.logger,"callInfoSignaling");return r.asyncInvoke(e,t,s,((e,t)=>r.ok({key:e,value:t})),(e=>r.fail(e))).result()}setProxy(e){return I(this,void 0,void 0,(function*(){return this.tcpMgr.getConnectionStatus()!==mt.DISCONNECTED?As(Pe.RC_CONN_PROXY_UNAVAILABLE):xr(e,this.logger)}))}getProxy(){return Promise.resolve(Wr())}testProxy(e,t){return function(e,t,s){return I(this,void 0,void 0,(function*(){const{resolve:r,promise:i}=vs(),n=/^https/.test(t)?Br:Fr,o=s.createTraceId();s.info(w,JSON.stringify({proxy:e,testHost:t}),o);const a=n(t,e,(e=>{const t=200===e.statusCode;e.setEncoding("utf8");let s="";e.on("data",(e=>{s+=e})),e.once("end",(()=>{const i=t?Ss(s):As(Pe.RC_HTTP_REQ_FAIL,`fail: ${e.statusCode}`,s);r(i)}))}));a.once("timeout",(()=>r(As(Pe.TIMEOUT)))),a.once("error",(e=>r(As(Pe.RC_HTTP_REQ_FAIL,e.stack)))),a.end();const c=yield i;return s.summary(H,c,o),c.wipe()}))}(e,t,this.logger)}setCheckDuplicateMessage(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!0,"checkDuplicateMessage",e);return Ss(t)}))}subscribeUser(e,t,s){const r=Oi.create(this.logger,"updateSubscribeStatus");return r.asyncInvoke(t,At.SUBSCRIBE,e,(()=>r.ok()),((e,t)=>r.fail(e,t)),s).result()}unSubscribeUser(e,t){const s=Oi.create(this.logger,"updateSubscribeStatus");return s.asyncInvoke(t,At.UNSUBSCRIBE,e,(()=>s.ok()),((e,t)=>s.fail(e,t)),0).result()}getSubscribeUserList(e,t,s){return I(this,void 0,void 0,(function*(){const r=Ci(this.logger,!1,"getSubscribeUserList",e,t,s),i=this._buildSubscribeEventData(r).map((e=>{const{userId:t,subscribeType:s,subscribeTime:r,expiry:i,details:n}=e,o={userId:t,subscribeType:s,subscribeTime:r,expiry:i};return s===St.ONLINE_STATUS&&(o.details=_s(n)),o}));return Ss(i)}))}setCheckChatRoomDuplicateMessage(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!1,"setDuplicateMessageConfig",[Le.CHATROOM],gn.cuid,e);return t===Pe.SUCCESS?Ss():As(t)}))}getSubscribeUserStatus(e,t){return I(this,void 0,void 0,(function*(){return(yield g(this,Mi,"m",hn).call(this,[e],t)).trans((e=>{const t=this._buildSubscribeEventData(e).map((e=>{const{userId:t,subscribeType:s,subscribeTime:r,expiry:i,details:n}=e,o={userId:t,subscribeType:s,subscribeTime:r,expiry:i};return s===St.ONLINE_STATUS&&(o.details=_s(n)),o}));return t}))}))}updateMyUserProfile(e){const t=[],s=[];Object.keys(e).forEach((r=>{var i;if("extraProfile"===r&&e.extraProfile){if(e.extraProfile){const{extraProfile:t}=e;Object.keys(t).forEach((e=>{s.push(JSON.stringify({key:e,value:t[e]||""}))}))}}else t.push(JSON.stringify({key:r,value:(null===(i=e[r])||void 0===i?void 0:i.toString())||""}))}));const r=Oi.create(this.logger,"updateUserProfile");return r.invoke(t,s,((e,t)=>{if(e===Pe.SUCCESS)r.ok();else{const s=Sr(t);r.fail(e,{errorKey:s[0],errorKeys:s})}})).result()}getUserProfiles(e){const t=Oi.create(this.logger,"getUserProfiles");return t.invoke(e,((e,s)=>{e===Pe.SUCCESS?t.ok(this._string2UserProfileInfoList(s)):t.fail(e)})).result()}getMyUserProfile(){const e=Oi.create(this.logger,"getOwnUserProfile");return e.asyncInvoke(((t,s)=>{e.flush(ps.from(t).trans((()=>this._string2userProfileInfo(s))))})).result()}_string2userProfileInfo(e){var t;try{const s=JSON.parse(e),r=s.userProfile.reduce(((e,t)=>{const s=JSON.parse(t);return["gender","role","level"].includes(s.key)?e[s.key]=Number(s.value):e[s.key]=s.value,e}),{});return r.userId=s.userId,r.extraProfile=(null===(t=s.userExtProfile)||void 0===t?void 0:t.reduce(((e,t)=>{const s=JSON.parse(t);return e[s.key]=s.value,e}),{}))||{},r}catch(t){this.logger.error(Tr.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return{}}_string2UserProfileInfoList(e){try{return JSON.parse(e).list.map((e=>this._string2userProfileInfo(e.obj)))}catch(t){this.logger.error(Tr.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return[]}updateMyUserProfileVisibility(e){const t=Oi.create(this.logger,"updateUserProfilePermission");return t.invoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}getMyUserProfileVisibility(){const e=Oi.create(this.logger,"getUserProfilePermission");return e.asyncInvoke(((t,s)=>{e.flush(ps.from(t).trans((()=>s)))})).result()}searchUserProfileByUniqueId(e){const t=Oi.create(this.logger,"getUserProfileByUniqueId");return t.asyncInvoke(e,((e,s)=>{t.flush(ps.from(e).trans((()=>this._string2userProfileInfo(s))))})).result()}getMessagesAroundTimestamp(e,t,s,r){return I(this,void 0,void 0,(function*(){const{conversationType:i,targetId:n,channelId:o}=e,a=Ci(this.logger,!1,"getMatchedMessage",i,n,t,s,r,o||""),c=JSON.parse(a).list.map((({obj:e})=>this._buildMessage(e)));return Ss(c)}))}getConversations(e){return I(this,void 0,void 0,(function*(){const t=g(this,Mi,"m",dn).call(this,e);return Ss(t)}))}handleErrorCode(e,t){e!==Pe.SUCCESS&&setTimeout((()=>t(As(e))),0)}_convertGroupInfoList(e,t=!1){return e&&0!==e.length?e.map((e=>{const{groupId:t,baseInfo:s,createTime:r,createUserId:i,extraInfo:n,memberCount:o,ownerId:a,remark:c,joinTime:_,role:l}=e,d=us(s),E=us(n);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:E,creatorId:i||"",ownerId:a||"",createTime:r||0,membersCount:o||0,remark:c||"",joinedTime:_||0,role:l||Ee.UNDEF}})):[]}_convertUpdateGroupInfoList(e){return e&&0!==e.length?e.map((e=>{const{groupId:t,baseInfo:s,createTime:r,createUserId:i,extraInfo:n,memberCount:o,ownerId:a,remark:c,joinTime:_,role:l}=e,d=us(s),E=us(n);return JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({groupId:t},(e=>JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Es(e.joinPerm),removeMemberPermission:Es(e.removePerm),invitePermission:Es(e.memInvitePerm),inviteHandlePermission:Es(e.invitePerm),groupInfoEditPermission:Es(e.profilePerm),memberInfoEditPermission:Es(e.memProfilePerm)})))(d)),n.length>0&&{extProfile:E}),i&&{creatorId:i}),a&&{ownerId:a}),r&&{createTime:r}),o&&{membersCount:o}),c&&{remark:c}),_&&{joinedTime:_}),l&&{role:l})))})):[]}_convertGroupMemberInfoList(e){return e&&0!==e.length?e.map((e=>{const{userId:t,nickname:s,groupNickname:r,portraitUrl:i,joinTime:n,role:o,extra:a,isRobot:c}=e;return{userId:t,name:s||"",portraitUri:i||"",nickname:r||"",role:o||0,joinedTime:n||0,extra:a||"",isRobot:!!c}})):[]}createGroup(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=Cr(t),n=Cr(s||{}),o=Oi.create(this.logger,"createGroup");return o.invoke(e,r||[],JSON.stringify(i),JSON.stringify(n),((e,t,s,r)=>{e===Pe.SUCCESS?o.ok():o.fail(e,{errorKeys:Sr(r),processCode:t})})).result()}))}updateGroupInfo(e,t,s){return I(this,void 0,void 0,(function*(){const r=Cr(t),i=Cr(s||{}),n=Oi.create(this.logger,"updateGroupInfo");return n.invoke(e,JSON.stringify(r),JSON.stringify(i),((e,t,s,r)=>{e===Pe.SUCCESS?n.ok():n.fail(e,{errorKeys:Sr(r)})})).result()}))}getGroupsInfo(e){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"getGroupInfoByIds");return t.invoke(e,((e,s,r,i)=>{const n=ps.from(e).trans((()=>{const e=JSON.parse(i);return this._convertGroupInfoList(e)}));t.flush(n)})).result()}))}kickGroupMembers(e,t,s){return I(this,void 0,void 0,(function*(){const r=Oi.create(this.logger,"kickOutGroupMember");return r.invoke(e,t,JSON.stringify(Or(s)),((e,t)=>r.flush(ps.from(e)))).result()}))}quitGroup(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"quitGroup");return s.invoke(e,JSON.stringify(Or(t)),((e,t)=>s.flush(ps.from(e)))).result()}))}dismissGroup(e){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"disbandGroup");return t.invoke(e,((e,s)=>t.flush(ps.from(e)))).result()}))}transferGroupOwner(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=Oi.create(this.logger,"transferGroup");return i.invoke(e,t,s,JSON.stringify(Or(r)),((e,t)=>i.flush(ps.from(e)))).result()}))}setGroupManagers(e,t,s){return I(this,void 0,void 0,(function*(){const r=Oi.create(this.logger,"updateGroupAdmins");return r.invoke(t,s,e,((e,t)=>r.flush(ps.from(e)))).result()}))}getGroupMembersByRole(e,t,s){return I(this,void 0,void 0,(function*(){const r=Oi.create(this.logger,"getGroupMembers");return r.invoke(e,t===Ee.UNDEF?[1,2,3]:[t],s.pageToken,s.count,s.order?1:0,s.filterRobotType,((e,t,s,i)=>{if(e!==Pe.SUCCESS)return void r.fail(e);const n=this._convertGroupMemberInfoList(JSON.parse(i));r.ok({totalCount:s||0,data:n,pageToken:t||""})})).result()}))}getGroupMembers(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"getGroupMembersByIds");return s.invoke(e,t,((e,t,r,i)=>{const n=ps.from(e).trans((()=>{const e=JSON.parse(i);return this._convertGroupMemberInfoList(e)}));s.flush(n)})).result()}))}setGroupMemberInfo(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=Oi.create(this.logger,"updateGroupMemberInfo");return i.invoke(e,t,s,r||"",((e,t,s,r)=>{e===Pe.SUCCESS?i.ok():i.fail(e,{errorKeys:Sr(r)})})).result()}))}searchGroupMembers(e,t,s){return I(this,void 0,void 0,(function*(){const r=Oi.create(this.logger,"getGroupMembersByNickname");return r.invoke(e,t,s.pageToken,s.count,s.order?1:0,((e,t,s,i)=>{if(e!==Pe.SUCCESS)return void r.fail(e);const n=this._convertGroupMemberInfoList(JSON.parse(i));r.ok({totalCount:s||0,data:n,pageToken:t||""})})).result()}))}joinGroup(e){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"joinGroup");return t.invoke(e,((e,s,r)=>{e===Pe.SUCCESS?t.ok({processCode:s}):t.fail(e)})).result()}))}inviteUsersToGroup(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"inviteUsersToGroup");return s.invoke(e,t,((e,t,r)=>{e===Pe.SUCCESS?s.ok({processCode:t}):s.fail(e)})).result()}))}memberInviteResponse(e){return I(this,void 0,void 0,(function*(){const{groupId:t,inviterId:s,optType:r,optResult:i,joinUserId:n,reason:o}=e,a=1===r?1:0,c=a&&n?n:"",_=Oi.create(this.logger,"handleGroupInvite");return _.invoke(t,c,s,i,a,o||"",((e,t,s)=>{const r=ps.from(e).trans((()=>({processCode:t})));_.flush(r)})).result()}))}getGroupApplications(e,t,s){return I(this,void 0,void 0,(function*(){const r=e.order?1:0,i=Oi.create(this.logger,"getGroupRequests");return i.invoke(t,s,"",e.pageToken||"",e.count,r,((e,t,s,r)=>{if(e!==Pe.SUCCESS)return void i.fail(e);const n=JSON.parse(r).map((e=>{const{groupId:t,joinUser:s,approverUser:r,inviterUser:i,type:n,status:o,direction:a,operateTime:c,remark:_}=e;return{groupId:t,joinMemberInfo:s,inviterInfo:i,operatorInfo:r,status:o,direction:a,type:n,operationTime:c,reason:_}}));i.ok({totalCount:s,data:n,pageToken:t})})).result()}))}getJoinedGroupsByRole(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"getGroups"),r=t.order?1:0,i=e===Ee.UNDEF?[1,2,3]:[e];return s.invoke(i,t.pageToken,t.count,r,((e,t,r,i)=>{if(e!==Pe.SUCCESS)return void s.fail(e);const n=JSON.parse(i),o=this._convertGroupInfoList(n);s.ok({totalCount:r,data:o,pageToken:t})})).result()}))}searchJoinedGroups(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"getGroupsByGroupName");return s.invoke(e,t.pageToken,t.count,t.order?1:0,((e,t,r,i)=>{if(e!==Pe.SUCCESS)return void s.fail(e);const n=JSON.parse(i),o=this._convertGroupInfoList(n);s.ok({totalCount:r,data:o,pageToken:t})})).result()}))}getJoinedGroups(e){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"getGroupsByIds");return t.invoke(e,((e,s,r,i)=>{if(e!==Pe.SUCCESS)return void t.fail(e);const n=JSON.parse(i),o=this._convertGroupInfoList(n);t.ok(o)})).result()}))}setGroupRemark(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"updateGroupRemark");return s.invoke(e,t,t?he.ADD:he.REMOVE,((e,t)=>s.flush(ps.from(e)))).result()}))}setGroupFollows(e,t,s){return I(this,void 0,void 0,(function*(){const r=Oi.create(this.logger,"updateFavoriteMembers",this.logger.createTraceId());return r.invoke(t,s,e,((e,t)=>r.flush(ps.from(e)))).result()}))}getGroupFollows(e){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"getGroupFavoriteMembers");return t.invoke(e,"",1e3,0,((e,s,r,i)=>{const n=ps.from(e).trans((()=>JSON.parse(i).map((e=>({userId:e.userId,time:e.followTime})))));t.flush(n)})).result()}))}addFriend(e,t,s){const r=Oi.create(this.logger,"addFriend");return r.invoke(e,t,s,((e,t,s)=>{e===Pe.SUCCESS?r.ok({processCode:t}):r.fail(e)})).result()}deleteFriends(e,t){const s=Oi.create(this.logger,"removeFriends",this.logger.createTraceId());return s.invoke(e,t,((e,t)=>s.flush(ps.from(e)))).result()}acceptFriendRequest(e){const t=Oi.create(this.logger,"acceptFriendRequest",this.logger.createTraceId());return t.invoke(e,"",((e,s)=>t.flush(ps.from(e)))).result()}refuseFriendRequest(e,t){const s=Oi.create(this.logger,"rejectFriendRequest",this.logger.createTraceId());return s.invoke(e,t||"",((e,t)=>s.flush(ps.from(e)))).result()}setFriendInfo(e,t,s){const r=Oi.create(this.logger,"setFriendInfo"),i=Cr(s);return r.invoke(e,t,JSON.stringify(i),((e,t,s,i)=>{e===Pe.SUCCESS?r.ok():r.fail(e,{errorKeys:Sr(i)})})).result()}checkFriends(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"checkFriendRelationship");return(yield s.invoke(e,t,((e,t)=>{e===Pe.SUCCESS?s.ok(t):s.fail(e)})).result()).trans((e=>JSON.parse(e).map((e=>{const{userId:t,status:s}=e;return{userId:t,relationType:s}}))))}))}getFriends(e,t){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"getFriends",this.logger.createTraceId());return(yield t.invoke(e,0,((e,s)=>{e===Pe.SUCCESS?t.ok(s):t.fail(e)})).result()).trans((e=>{const t=JSON.parse(e);return{data:this._convertFriendInfo(t),pageToken:""}}))}))}getFriendApplications(e,t,s){const r=Oi.create(this.logger,"getFriendRequestListByPage",this.logger.createTraceId());return r.invoke([1,2].every((e=>t.includes(e)))?3:t[0],s,e.count,e.pageToken,e.order?1:0,((e,t,s)=>{if(e!==Pe.SUCCESS)return void r.fail(e);const i=JSON.parse(s).map((e=>({userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.friendRequestType,applicationStatus:e.friendRequestStatus,operationTime:e.operateTime,extra:e.extra})));r.ok({pageToken:t,data:i})})).result()}_convertFriendInfo(e){return e.map((e=>{const{userId:t,userName:s,remark:r,portraitUrl:i,friendType:n,extProfiles:o,addTime:a,friendAttribute:c}=e;return{userId:t,name:s,portraitUri:i,remark:r,directionType:n,extProfile:o,addTime:a,inBlackList:!!c}}))}getFriendsInfo(e){const t=Oi.create(this.logger,"getFriendByIds");return t.invoke(e,((e,s)=>{if(e!==Pe.SUCCESS)return void t.fail(e);const r=JSON.parse(s),i=this._convertFriendInfo(r);t.ok(i)})).result()}searchFriendsInfo(e){const t=Oi.create(this.logger,"getFriendByNickname");return t.invoke(e,((e,s)=>{if(e!==Pe.SUCCESS)return void t.fail(e);const r=JSON.parse(s),i=this._convertFriendInfo(r);t.ok(i)})).result()}setFriendAddPermission(e){const t=Oi.create(this.logger,"setFriendAuthPermission");return t.invoke(e,(e=>{e!==Pe.SUCCESS?t.fail(e):t.ok()})).result()}getFriendAddPermission(){const e=Oi.create(this.logger,"getFriendAuthPermission");return e.invoke(((t,s)=>{t!==Pe.SUCCESS?e.fail(t):e.ok(s)})).result()}setNotificationQuietHoursWithSetting(e){const{startTime:t,spanMinutes:s,level:r,timezone:i}=e,n=Oi.create(this.logger,"addPushSetting");return n.invoke(t,s,r,i||"",(()=>n.ok()),(e=>n.fail(e))).result()}removeNotificationQuietHoursSetting(){const e=Oi.create(this.logger,"removePushSetting");return e.invoke((()=>e.ok()),(t=>e.fail(t))).result()}getNotificationQuietHoursSetting(){const e=Oi.create(this.logger,"queryPushSetting");return e.invoke(((t,s,r,i)=>{const n={startTime:t,spanMinutes:s,level:r,timezone:i};e.ok(n)}),(t=>e.fail(t))).result()}setDataBaseLogConfig(e){this._callCppProxy("setDataBaseLogConfig",e)}getStatsUrlList(){return I(this,void 0,void 0,(function*(){return Ss(Vs.getStatsUrlList(this.getNaviInfoFromCache()))}))}sendReadReceiptResponseV5(e,t){const s=Oi.create(this.logger,"sendReadReceiptByReadReceiptType");return s.invoke(e.conversationType,e.targetId,e.channelId||"",hr,t,((e,t,r)=>{e!==Pe.SUCCESS?s.fail(e):s.ok()})).result()}getMessageReadReceiptInfoV5ByIdentifiers(e){return I(this,void 0,void 0,(function*(){const t=e.map((({identifier:e,messageUId:t})=>({conIdentifier:{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""},uid:t}))),s=Oi.create(this.logger,"getReadReceiptCount");return(yield s.invoke(JSON.stringify(t),((e,t)=>{e!==Pe.SUCCESS?s.fail(e):s.ok(t)})).result()).trans((e=>JSON.parse(e).map((e=>({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})))))}))}getMessagesReadReceiptUsersByPageV5(e,t,s){const r=Oi.create(this.logger,"getReadReceiptUsersByUid");return r.invoke(e.conversationType,e.targetId,e.channelId||"",t,s.pageToken||"",!s.readStatus,s.pageCount,0===s.order,((e,t,s,i)=>{if(e!==Pe.SUCCESS)return void r.fail(e);const n={pageToken:t,totalCount:i,users:JSON.parse(s).map((e=>JSON.parse(e))).map((e=>({userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned})))};r.ok(n)})).result()}getMessagesReadReceiptByUsersV5(e,t,s){const r=Oi.create(this.logger,"getReadReceiptStatusForUsersInMessage");return r.invoke(e.conversationType,e.targetId,e.channelId||"",t,s,((e,t,s,i)=>{if(e!==Pe.SUCCESS)return void r.fail(e);const n=JSON.parse(s).map((e=>JSON.parse(e))).map((e=>({userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned})));r.ok({pageToken:"",totalCount:0,users:n})})).result()}requestSpeechToTextForMessage(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!0,"speechToText",e,((t,s)=>{const r=JSON.parse(s),i={status:r.status,text:r.text,isVisible:r.visible};setImmediate((()=>{this._dispatchEvent("speechToTextResponse",{code:t,messageUId:e,sttInfo:i})}))}));return t===Pe.SUCCESS?Ss():As(t)}))}setMessageSpeechToTextVisible(e,t){return I(this,void 0,void 0,(function*(){const s=Ci(this.logger,!0,"updateSpeechToTextVisible",e,t);return s===Pe.SUCCESS?Ss():As(s)}))}setTranslationLanguage(e){const t=Oi.create(this.logger,"setPushSetting");return t.invoke(Ir,e,(()=>t.ok()),(e=>t.fail(e))).result()}getTranslationLanguage(){return I(this,void 0,void 0,(function*(){const e=Ci(this.logger,!0,"getPushSetting",Ir);return Ss(e)}))}setAutoTranslateEnabled(e){const t=Oi.create(this.logger,"setPushSetting");return t.invoke(gr,e?"1":"0",(()=>t.ok()),(e=>t.fail(e))).result()}getAutoTranslateEnabled(){return I(this,void 0,void 0,(function*(){const e=Ci(this.logger,!0,"getPushSetting",gr);return Ss("1"===e)}))}translateWithParams(e,t,s,r){return I(this,void 0,void 0,(function*(){const i=Ci(this.logger,!0,"getPushSetting",Ir)||"zh",n=Oi.create(this.logger,"translateMessages"),o=e.map((e=>({messageRecognitionIdentifier:{messageUid:e.identifier,customText:0===r?"":e.content,inputSource:r},sourceLanguage:e.sourceLanguage,targetLanguage:e.targetLanguage||i})));return n.invoke(o,{forceRetranslate:s,translationServiceType:t},(e=>{e!==Pe.SUCCESS?n.fail(e):n.ok()})).result()}))}modifyMessageWithParams(e){const t=JSON.stringify(e.messageContent),s=Oi.create(this.logger,"editMessage",this.logger.createTraceId());return s.asyncInvoke((()=>s.ok()),(e=>s.fail(e)),e.messageUId,t).result()}refreshReferenceMessageWithParams(e,t,s,r){const i=Oi.create(this.logger,"getQuotingMessageByUId");return i.asyncInvoke(t.conversationType,t.targetId,t.channelId||"",e,(e=>{i.fail(e)}),(e=>{i.ok(),setTimeout((()=>g(this,Mi,"m",un).call(this,e,r)),0)}),(e=>{i.ok(),setTimeout((()=>g(this,Mi,"m",un).call(this,e,s)),0)})).result()}syncRemoteConversations(){return I(this,void 0,void 0,(function*(){const e=Ci(this.logger,!0,"getRemoteConversations");return e===Pe.SUCCESS?Ss():As(e)}))}sendUltraGroupTypingStatus(e){const t=Oi.create(this.logger,"sendUGOperateStatus",this.logger.createTraceId());return t.asyncInvoke(e.targetId,0,e.channelId,(()=>t.ok()),(e=>t.fail(e))).result()}getUltraGroupList(e){return I(this,void 0,void 0,(function*(){const t=null==e?void 0:e.targetId,s=null==e?void 0:e.channelType,r=Ci(this.logger,!1,"getUGConversationListForAllChannel"),i=JSON.parse(r).list.map((({obj:e})=>{const t=JSON.parse(e);return g(this,Mi,"m",Hi).call(this,t)})).filter((e=>!("string"==typeof t&&t!==e.targetId||"number"==typeof s&&s!==e.channelType))).sort(((e,t)=>{var s,r;const i=(null===(s=e.latestMessage)||void 0===s?void 0:s.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i}));return Ss(i)}))}getRemoteMessagesByUIds(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"getRemoteMessageByUids",this.logger.createTraceId()),{targetId:r,conversationType:i,channelId:n}=e;return(yield s.asyncInvoke(r,i,t.map((e=>({messageUId:e,channelId:n||"",sentTime:0}))),(e=>s.ok(e)),(e=>s.fail(e))).result()).trans((e=>JSON.parse(e).list.map((({obj:e})=>{const t=JSON.parse(e);return g(this,Mi,"m",wi).call(this,t)}))))}))}getUGUnreadMentionedDigest(e){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"getUltraGroupUnreadMentionedDigest",this.logger.createTraceId()),{targetId:s,channelId:r,sentTime:i,count:n}=e;return(yield t.asyncInvoke(s,r||"",i,n,(e=>t.ok(e)),(e=>t.fail(e))).result()).trans((e=>{const t=JSON.parse(e).list.map((({obj:e})=>{const{msgUId:t,objectName:s,sentTime:r,isMentionedAll:i}=JSON.parse(e);return{messageUId:t,messageType:s,sentTime:r,mentionedType:i?Be.ALL:Be.SINGAL}}));return t}))}))}deleteLocalUGMessagesForAllChannel(e,t){return I(this,void 0,void 0,(function*(){return Ci(this.logger,!1,"clearUGMessageByTimestamp",e,t,!1),Ss()}))}updateUGMessageExpansion(e,t,s){const r=Oi.create(this.logger,"updateUGMessageExpansion",this.logger.createTraceId());return r.asyncInvoke(e.targetId,t.mid,s,JSON.stringify(t),e.channelId,(()=>r.ok()),(e=>r.fail(e))).result()}setUGDefaultNotificationLevel(e,t,s){const r=Oi.create(this.logger,"setDefaultBlockPushLevel",this.logger.createTraceId());return r.asyncInvoke(e,s||"",Le.ULTRA_GROUP,t,(()=>r.ok()),(e=>r.fail(e))).result()}getUGDefaultNotificationLevel(e,t){const s=Oi.create(this.logger,"getDefaultBlockPushLevel",this.logger.createTraceId());return s.asyncInvoke(e,t||"",Le.ULTRA_GROUP,(e=>s.ok(e)),(e=>s.fail(e))).result()}getUGUnreadCountForAllChannels(e,t,s){return I(this,void 0,void 0,(function*(){if(t.length>0){const r=Ci(this.logger,!0,s?"getUltraGroupUnreadMentionedCount":"getUltraGroupUnreadCount",e,t);return Ss(r)}const r=Ci(this.logger,!0,s?"getUGMentionCount":"getUGUnreadCount",e);return Ss(r)}))}getUGUnreadInfoList(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!1,"getInfoForConversations",e),s=JSON.parse(t).list.map((({obj:e})=>{const{targetId:t,conversationType:s,channelId:r,unreadCount:i,mentionCount:n,mentionMeCount:o,blockStatus:a}=JSON.parse(e);return{targetId:t,conversationType:s,channelId:r,unreadCount:i,mentionedCount:n,mentionedMeCount:o,notificationLevel:a,type:Le.ULTRA_GROUP,unreadMessageCount:i}}));return Ss(s)}))}getUGFirstUnreadMessageDigest(e){return I(this,void 0,void 0,(function*(){const t=g(this,Mi,"m",tn).call(this,e);return t?Ss({sentTime:t.sentTime,messageType:t.messageType,messageUId:t.messageUId}):As(Pe.RC_DB_DATA_NOT_FOUND)}))}getBlockedUGList(){return I(this,void 0,void 0,(function*(){return g(this,Mi,"m",Rn).call(this,[{conversationType:Le.ULTRA_GROUP,channelIdValid:!1}])}))}getBlockedConversationList(e){return I(this,void 0,void 0,(function*(){const t=Fe(e?De:Me).map((e=>({conversationType:e,channelId:e===Le.ULTRA_GROUP?g(this,Mi,"m",Zi).call(this,""):"",channelIdValid:e===Le.ULTRA_GROUP})));return g(this,Mi,"m",Rn).call(this,t).trans((e=>e.reverse()))}))}getSubscribeUsersOnlineStatus(e){return I(this,void 0,void 0,(function*(){return(yield g(this,Mi,"m",hn).call(this,[St.ONLINE_STATUS,St.FRIEND_ONLINE_STATUS],e)).trans((e=>JSON.parse(e).list.map((({obj:e})=>{const{userId:t,details:s=[]}=JSON.parse(e),r=s.map((e=>{const{changeTime:t,changeValue:s,platform:r}=JSON.parse(e);return{platform:r,isOnline:!!s,updateTime:t}})),i=r.some((e=>e.isOnline));return n={userId:t,isOnline:i,details:r},[pt.iOS,pt.Android,pt.Web,pt.PC,pt.Mini,pt.HarmonyOS].forEach((e=>{n.details.some((t=>t.platform===e))||n.details.push({platform:e,isOnline:!1,updateTime:0})})),n;var n}))))}))}saveEditedMessageDraft(e,t){return I(this,void 0,void 0,(function*(){const s=Ci(this.logger,!1,"saveEditedMessageDraft",Li(t),e.messageUId,e.content);return s===Pe.SUCCESS?Ss():As(s)}))}getEditedMessageDraft(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!1,"getConversationMetadata",Li(e)).find((e=>"edited_message_draft"===e.key));if(!t)return Ss(null);const{msg_uid:s,content:r}=JSON.parse(t.value);return Ss({messageUId:s,content:r})}))}clearEditedMessageDraft(e){return I(this,void 0,void 0,(function*(){const t=Ci(this.logger,!1,"removeConversationMetadata",Li(e),["edited_message_draft"]);return t===Pe.SUCCESS?Ss():As(t)}))}getUnreadMentionMeConversationList(e,t){return I(this,void 0,void 0,(function*(){const{timestamp:t,count:s,conversationTypes:r}=e,i=r.map((e=>({conversationType:e,channelId:e===Le.ULTRA_GROUP?"RCDefault":"",channelIdValid:e===Le.ULTRA_GROUP}))),n=Ci(this.logger,!1,"getUnreadMentionMeConversationsByPageWithTopPriority",i,t,s,!!e.topPriority),{code:o,list:a}=JSON.parse(n);if(o!==Pe.SUCCESS)return As(o);const c=a.map((e=>this._buildConversation(e.obj)));return Ss(c)}))}getAllRobots(){return I(this,void 0,void 0,(function*(){const e=Oi.create(this.logger,"getAllRobots");return e.asyncInvoke(((t,s)=>{const r=g(this,Mi,"m",In).call(this,s);t!==Pe.SUCCESS?e.fail(t,r):e.ok(r)})).result()}))}getConversationsIncludingRobots(e){return I(this,void 0,void 0,(function*(){const{conversationTypes:t,count:s,timestamp:r,topPriority:i}=e,n=Oi.create(this.logger,"getConversationsIncludingRobots");return n.invoke(t.map((e=>({conversationType:e,channelId:"",targetId:"",channelIdValid:!1}))),r,s,i,((e,t)=>{e!==Pe.SUCCESS?n.fail(e):n.flush(g(this,Mi,"m",Bi).call(this,t,"getConversationsIncludingRobots"))})).result()}))}markRemoteConversationAsRead(e,t,s){return I(this,void 0,void 0,(function*(){const r=yield this.sendMessage(e,t,s);if(r.isOk){const{sentTime:t}=r.data;this._clearUnreadCountByTimestamp(e,t)}return r.wipe()}))}getMessagesByUIds(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"getMessagesByUIds");return s.invoke({conversationQueryParam:Object.assign(Object.assign({},Li(e)),{channelIdValid:"string"==typeof e.channelId}),messageUIds:t,enableRemoteQuery:!0},(e=>{const t=JSON.parse(e).list.map((e=>{const{message:t,messageUId:s,code:r}=e;return{messageUId:s,message:t?g(this,Mi,"m",wi).call(this,t):void 0,code:r}}));s.ok(t)}),(e=>{s.fail(e)})).result()}))}_trans2ICppUpdateMessageReactionParam(e){var t;const{messageUId:s,reactionId:r,pushConfig:i}=e;return{messageUId:s,reactionId:r,pushConfig:{forceShowDetail:(null==i?void 0:i.forceShowDetailContent)||!1,templateId:(null==i?void 0:i.templateId)||"",content:(null==i?void 0:i.pushContent)||"",disableTitle:(null==i?void 0:i.disablePushTitle)||!1,id:(null===(t=null==i?void 0:i.androidConfig)||void 0===t?void 0:t.notificationId)||"",data:(null==i?void 0:i.pushData)||"",config:hs(null==i?void 0:i.iOSConfig,null==i?void 0:i.androidConfig,null==i?void 0:i.harmonyOSConfig),title:(null==i?void 0:i.pushTitle)||""}}}addMessageReaction(e){const t=Oi.create(this.logger,"addMessageReaction"),s=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(s,(e=>t.flush(ps.from(e)))).result()}removeMessageReaction(e){const t=Oi.create(this.logger,"removeMessageReaction"),s=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(s,(e=>t.flush(ps.from(e)))).result()}_trans2CppConversationQueryParam(e){const{conversationType:t,targetId:s,channelId:r}=e;return{conversationType:t,targetId:s,channelId:t===Le.ULTRA_GROUP?g(this,Mi,"m",Zi).call(this,r):r,channelIdValid:"string"==typeof r}}batchGetMessageReactionSummaries(e){return I(this,void 0,void 0,(function*(){const t=Oi.create(this.logger,"batchGetMessageReactionSummaries"),{conversationIdentifier:s,messageUIds:r}=e,i={messageUIds:r,conversationQueryParam:this._trans2CppConversationQueryParam(s)},n=yield t.invoke(i,((e,s)=>t.flush(ps.from(e,"",s)))).result();if(!n.isOk)return n.wipe();const o=JSON.parse(n.data);return Ss(o)}))}getMessageReactions(e){const t=Oi.create(this.logger,"getMessageReactions"),{pageToken:s,messageUId:r,count:i}=e,n={messageUId:r,count:i,pageToken:s||""};return t.invoke(n,((e,s,r)=>{if(e!==Pe.SUCCESS)return void t.fail(e);const i={pageToken:r,reactions:JSON.parse(s)};t.ok(i)})).result()}getMessageReactionUsers(e){const t=Oi.create(this.logger,"getReactionUsers"),{pageToken:s,reactionId:r,count:i,messageUId:n}=e,o={messageUId:n,reactionId:r,count:i,pageToken:s||""};return t.invoke(o,((e,s,r,i)=>{if(e!==Pe.SUCCESS)return void t.fail(e);const n={totalCount:r,pageToken:i,users:JSON.parse(s)};t.ok(n)})).result()}}Mi=new WeakSet,Ui=function(e){const t=JSON.parse(e).list.map((({obj:e})=>JSON.parse(e))),s=[],r=[],i=[];t.forEach((e=>{const{changeTime:t,changeType:n,channelId:o,channelType:a,targetId:c,userId:_}=e;switch(n){case It.CHANNEL_DELETE:r.push({targetId:c,channelId:o,channelType:a,deleteTime:t});break;case It.PUBLIC_TO_PRIVATE:s.push({targetId:c,channelId:o,changeType:Rt.PUBLIC_TO_PRIVATE,channelType:ut.PRIVATE});break;case It.PRIVATE_TO_PUBLIC:s.push({targetId:c,channelId:o,changeType:Rt.PRIVATE_TO_PUBLIC,channelType:ut.PUBLIC});break;case It.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:break;case It.CHANNEL_USER_KICKED:i.push({targetId:c,channelId:o,userId:_,channelType:a});break;case It.PUBLIC_TO_PRIVATE_USER_NOT_IN:s.push({targetId:c,channelId:o,changeType:Rt.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:a})}})),s.length>0&&this._dispatchEvent("ultraGroupChannelChangeType",s),r.length>0&&this._dispatchEvent("ultraGroupChannelDelete",r),i.length>0&&this._dispatchEvent("ultraGroupChannelUserKicked",i)},Di=function(e){const t=JSON.parse(e).list.map((({obj:e})=>JSON.parse(e))),s=[],r=[],i=[],n=[],o=[],a=Le.ULTRA_GROUP;t.forEach((e=>{const{targetId:t,userGroupId:c,eventType:_,channelId:l,channelType:d}=e;switch(_){case gt.REMOVE_USER_GROUP:s.push({conversation:{conversationType:a,targetId:t},userGroupIds:c});break;case gt.JOIN_USER_GROUP:r.push({conversation:{conversationType:a,targetId:t},userGroupIds:c});break;case gt.EXIT_USER_GROUP:i.push({conversation:{conversationType:a,targetId:t},userGroupIds:c});break;case gt.CHANNEL_BIND_USER_GROUP:n.push({conversation:{conversationType:a,targetId:t,channelId:l},channelType:d,userGroupIds:c});break;case gt.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:t,channelId:l},channelType:d,userGroupIds:c})}}));const c={};s.length>0&&(c.userGroupDisband=s),r.length>0&&(c.userAdded=r),i.length>0&&(c.userRemoved=i),n.length>0&&(c.userGroupBindChannel=n),o.length>0&&(c.userGroupUnBindChannel=o),this._dispatchEvent("userGroupStatus",c)},bi=function(e,t,s){return I(this,void 0,void 0,(function*(){const r=(yield this.getConversation({conversationType:Le.ULTRA_GROUP,targetId:e,channelId:t})).data;this._dispatchEvent("conversation",[{conversation:r,updatedItems:{unreadMessageCount:{val:r.unreadMessageCount,time:s}}}])}))},yi=function(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{channelId:t,operateTime:s,operateType:r,targetId:i,userId:n}=JSON.parse(e);return{channelId:t,operationType:r,operationTime:s,targetId:i,userId:n}}));this._dispatchEvent("operateStatus",{conversationType:Le.ULTRA_GROUP,info:t,hasInfo:!0,hasSummary:!1,summary:[]})},Vi=function(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{targetId:t,channelId:s,userNum:r,operateType:i}=JSON.parse(e);return{targetId:t,channelId:s,count:r,operationType:i}}));this._dispatchEvent("operateStatus",{conversationType:Le.ULTRA_GROUP,info:[],hasInfo:!1,hasSummary:!0,summary:t})},Gi=function(e){const t=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));this._dispatchEvent("ultraGroupMessageExpansionUpdated",t)},ki=function(e){const t=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));this._dispatchEvent("messagesModified",t)},Fi=function(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{channelId:t,conversationType:s,isAdmin:r,isDel:i,mentionType:n,msgUId:o,operatorId:a,sentTime:c,targetId:_}=JSON.parse(e);return{targetId:_,conversationType:s,sentTime:c,messageUId:o,senderUserId:a,channelId:t,content:{conversationType:s,targetId:_,channelId:t,isAdmin:r,isDelete:i,sentTime:c,messageUId:o},messageDirection:1,messageType:Xe,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:Vt.UNREAD,receivedStatusInfo:cs(Vt.UNREAD)}}));t.length>0&&(t.slice().forEach((e=>g(this,Mi,"m",Yi).call(this,e,"ugRecall"))),this._dispatchEvent("ultraGroupMessageRecalled",t))},wi=function(e,t){const{channelId:s,senderUserId:r,content:i,objectName:n,direction:o,status:a,messageId:c,sentTime:_,readReceiptRequest:l,supportExt:d,pushContent:E,pushTitle:u,pushId:R,pushConfig:h,templateId:I,disableTitle:g,forcePushDetail:T,hasMore:N,directedUsers:C,noNotification:O,disableUpdateLastMessage:p,needReceipt:S,sendReceipt:A,contentRecognition:f,convertExt:m,editTime:v,editContent:P,editStatus:L,quotedMsgStatus:M,hasChanged:U,quoteInfo:D,hasReactions:b}=e;let{conversationType:y,targetId:V,messageUid:G}=e,k=this._parseMessageJsonContent(i,c);const F=!!k.mentionedInfo;if(n===Xe&&r===this.tcpMgr.getCurrentUserId()&&(y=k.conversationType,V=k.targetId,G=k.messageUId),m){const e=JSON.parse(m);if(e.trans){const{targetLanguage:t,translatedText:s,translateStatus:r}=e.trans,i={targetLanguage:t,translatedText:s,status:r};k.translateInfo=i}}if(n===je||n===xe){const e=f?JSON.parse(f):{status:xt,text:"",visible:!1},t={status:e.status,text:e.text,isVisible:e.visible};k.sttInfo=t}const w=(H=n,Er.get(H)||{isPersited:!1,isCounted:!1,isStatusMessage:!1});var H;let B=this._buildSupportExt(d,e);const J=void 0===(j=t)||"[object Undefined]"===Object.prototype.toString.call(j)?_<this.tcpMgr.getConnectedTime():t;var j;let x={};h&&(x=((e,t)=>{const s={},r={notificationId:t||""},i={};if(!e)return{iOSConfig:s,androidConfig:r,harmonyOSConfig:i};try{const t=JSON.parse(e);null==t||t.forEach((e=>{var t,n,o,a,c,_,l,d,E,u,R,h;const I=Object.keys(e);if(0===I.length)return;const g=I[0];switch(g){case"HW":return r.channelIdHW=null===(t=e[g])||void 0===t?void 0:t.channelId,r.importanceHW=null===(n=e[g])||void 0===n?void 0:n.importance,r.imageUrlHW=null===(o=e[g])||void 0===o?void 0:o.image,void(r.categoryHW=null===(a=e[g])||void 0===a?void 0:a.category);case"MI":return void(r.channelIdMi=null===(c=e[g])||void 0===c?void 0:c.channelId);case"OPPO":return void(r.channelIdOPPO=null===(_=e[g])||void 0===_?void 0:_.channelId);case"VIVO":return r.typeVivo=null===(l=e[g])||void 0===l?void 0:l.classification,void(r.categoryVivo=null===(d=e[g])||void 0===d?void 0:d.category);case"APNS":return s.threadId=e[g]["thread-id"],s.apnsCollapseId=e[g]["apns-collapse-id"],s.category=e[g].category,s.richMediaUri=e[g].richMediaUri,void(s.interruptionLevel=e[g]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:e[g].collapse_key||"",imageUrl:e[g].imageUrl||"",priority:e[g].priority||""});case"HONOR":return r.importanceHonor=null===(E=e[g])||void 0===E?void 0:E.importance,void(r.imageUrlHonor=null===(u=e[g])||void 0===u?void 0:u.image);case"OHOS":i.category=null===(R=e[g])||void 0===R?void 0:R.category,i.image=null===(h=e[g])||void 0===h?void 0:h.image}}))}catch(e){}return{iOSConfig:s,androidConfig:r,harmonyOSConfig:i}})(h,R));const W=Object.assign(Object.assign({},x),{pushTitle:u,pushContent:E,pushData:E,disablePushTitle:g,forceShowDetailContent:T,templateId:I}),Y={channelId:s,conversationType:y,targetId:V,senderUserId:r,content:k||{},messageType:n,messageUId:G||"",messageDirection:o,isOffLineMessage:J,sentTime:_,receivedTime:0,isPersited:w.isPersited,isCounted:w.isCounted,isMentioned:F,disableNotification:O,isStatusMessage:w.isStatusMessage||!1,canIncludeExpansion:d,expansion:d?B:null,receivedStatus:0,receivedStatusInfo:void 0,sentStatus:void 0,messageId:c,pushConfig:W,hasMore:N,directedUserIds:C||[],disableUpdateLastMessage:p,needReceipt:S,sendReceipt:A,hasReactions:b};if(D&&(Y.quoteInfo=D),o===Lt.RECEIVE?(Y.receivedStatus=a,Y.receivedStatusInfo=cs(a)):Y.sentStatus=a,l){const e=this._handleReadReceiptRequest(l);Y.readReceiptInfo=e}return y===Le.ULTRA_GROUP?Y.isModifyMessage=!!U:(Y.isModifyMessage=!(!v&&!L),Y.isModifyMessage&&(Y.modifyInfo={timestamp:v,content:P?JSON.parse(P):{},status:L})),n===Ke&&(Y.content.referMsgStatus=M),Y},Hi=function(e){const{channelId:t,conversationType:s,targetId:r,lastestMsg:i,isTop:n,blockStatus:o,matchCount:a,hasUnreadMention:c,unreadCount:_,mentionCount:l,mentionMeCount:d,conversationTime:E,draft:u,translateStrategy:R,channelType:h,metadata:I,includeRobot:g,entrustInfo:T}=e,N=-1===JSON.parse(i).messageId?null:this._buildMessage(i),C=I?JSON.parse(I):{},O=C.edited_message_draft?JSON.parse(C.edited_message_draft):void 0,p=JSON.parse(T),S={name:p.name,portraitUri:p.portraitUrl};return{channelId:t,conversationType:s,targetId:r,channelType:h,unreadMessageCount:_,unreadMentionedCount:l,unreadMentionedMeCount:d,hasMentioned:c,latestMessage:N,notificationStatus:yt(o),isTop:n,lastUnreadTime:0,matchCount:a,operationTime:E,notificationLevel:o,draft:u,translateStrategy:R,editedMessageDraft:O?{messageUId:O.msg_uid,content:O.content}:void 0,includeRobot:!!g,dataMgmtInfo:S}},Bi=function(e,t){try{const{list:t}=JSON.parse(e),s=t.map((e=>this._buildConversation(e.obj)));return Ss(s)}catch(e){const s=`parse conversation list result error, method: ${t}`;return As(Pe.MAIN_PROCESS_ERROR,s)}},Ji=function(e){var t;const{messageType:s,targetId:r}=e;if(s===it){const t=function(e){const t={},s=[],r=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((e=>{t[e.userId]=e.status,s.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:r,userList:s}}(e);return this._sendChatroomEvents({userChange:t}),!1}if(s===nt){const t=function(e){const{chatroomId:t,status:s,reason:r,time:i,extra:n}=e.content;return{chatroomId:t,status:s,reason:r,time:i,extra:n||""}}(e);return this._sendChatroomEvents({chatroomNotifyMultiLoginSync:t}),!1}if(s===ot){const s=function(e){const{chatroomId:t,operateType:s,durationTime:r,operateTime:i,userList:n,extra:o}=e.content;return{chatroomId:t,operateType:s,durationTime:r,operateTime:i,userIdList:n,extra:o||""}}(e);return s.operateType===ve.Blocked&&(null===(t=null==s?void 0:s.userIdList)||void 0===t?void 0:t.includes(this.tcpMgr.getCurrentUserId()))&&this._chatroomCache.delete(r),this._sendChatroomEvents({chatroomNotifyBlock:s}),!1}if(s===at){const t=function(e){const{chatroomId:t,operateType:s,durationTime:r,operateTime:i,userList:n,extra:o}=e.content;return{chatroomId:t,banType:s,durationTime:r,operateTime:i,userIdList:n,extra:o||""}}(e);return this._sendChatroomEvents({chatroomNotifyBan:t}),!1}return!0},ji=function(e){const t=JSON.parse(e),s=g(this,Mi,"m",wi).call(this,t,!1),{messageType:r,conversationType:i}=s;if(r!==Xe||i!==Le.ULTRA_GROUP){if(this._lowPriorityMessageHandler.isLowPriorityMessage(r)){const e=this.tcpMgr.getCurrentUserId();return this._lowPriorityMessageHandler.push(s,e),void this._handleLowPriorityMessages(e,this.tcpMgr.getConnectedTime())}this._handleHighPriorityMessages([s],!1)}},xi=function(e,t){const s=this.tcpMgr.getConnectedTime(),r=this.tcpMgr.getCurrentUserId(),i=[],n=[];JSON.parse(e).list.forEach((e=>{const t=JSON.parse(e.obj),o=t.sentTime<s,a=g(this,Mi,"m",wi).call(this,t,o),{messageType:c}=a;this._lowPriorityMessageHandler.isLowPriorityMessage(c)?this._lowPriorityMessageHandler.push(a,r):o?i.push(a):n.push(a)})),i.length>0&&this._handleHighPriorityMessages(i,!!t);let o=!1;(!t||n.length>0)&&!this._pullOfflineMessageFinished&&(o=this._pullOfflineMessageFinished=!0),n.length>0&&this._handleHighPriorityMessages(n,!!t),(this._pullOfflineMessageFinished||this._lowPriorityMessageHandler.count>=1e4)&&this._handleLowPriorityMessages(r,s),o&&this._sendPullOfflineFinished()},Wi=function(e){0!==e.length&&Ci(this.logger,!1,"setExtraMessageInBatches",e)},Yi=function(e,t){var s;const{messageUId:r,sentTime:i,isAdmin:n,isDelete:o,extra:a}=e.content,c=this.logger.createTraceId();if(this.logger.info(Tr.L_HADNLE_RECALL_CMD_T,JSON.stringify({recalledMessageUId:r,isDelete:o,source:t}),c),"number"!=typeof i||"string"!=typeof r||!r.length)return this.logger.warn(Tr.L_HADNLE_RECALL_CMD_R,"Invalid message",c),!1;const _=g(this,Mi,"m",cn).call(this,r);if(!_.isOk)return this.logger.info(Tr.L_HADNLE_RECALL_CMD_R,"Msg Not Found",c),!1;const l=_.data;if(o)return g(this,Mi,"m",nn).call(this,[l.messageId],i),this.logger.info(Tr.L_HADNLE_RECALL_CMD_R,`Delete Msg, messageId: ${l.messageId}`,c),!0;if(l.messageType===Qe)return this.logger.info(Tr.L_HADNLE_RECALL_CMD_R,"Msg has been processed",c),!1;(null===(s=l.receivedStatusInfo)||void 0===s?void 0:s.isRead)||g(this,Mi,"m",ln).call(this,l.messageId,1,i);const d={operatorId:e.senderUserId,recallTime:l.sentTime,originalObjectName:l.messageType,originalMessageContent:l.content,recallActionTime:e.sentTime,admin:!!n,delete:!!o,isDelete:!!o,extra:a};return e.content.user&&(d.user=e.content.user),e.content.extra&&(d.extra=e.content.extra),l.messageType===Je&&(d.recallContent=l.content.content),g(this,Mi,"m",_n).call(this,l.messageId,JSON.stringify(d),Qe),this.logger.info(Tr.L_HADNLE_RECALL_CMD_R,`Replace Msg with RC:RcNtf, messageId: ${l.messageId}`,c),!0},Ki=function(e,t){const{timestamp:s,count:r,order:i,messageType:n}=t,{conversationType:o,targetId:a,channelId:c}=e,_=Ci(this.logger,!1,"getHistoryMessages",o,a,s,r+1,n,0===i,c||""),l=JSON.parse(_).list.map((({obj:e})=>this._buildMessage(e))).reverse();return{list:r===l.length-1?l.slice(1):l,hasMore:r<l.length}},Xi=function(e,t){return I(this,void 0,void 0,(function*(){const{timestamp:s,count:r,order:i}=t,{conversationType:n,targetId:o,channelId:a}=e,c=Oi.create(this.logger,"getRemoteHistoryMessages",this.logger.createTraceId());return(yield c.asyncInvoke(n,o,s,r,((e,t)=>c.ok({listJson:e,hasMore:t})),(e=>c.fail(e)),i,!0,a||"",!0).result()).trans((({listJson:e,hasMore:t})=>{const s=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));return 0===i&&s.reverse(),{list:s,hasMore:!!t}}))}))},Qi=function(e){const{conversationType:t,targetId:s,channelId:r}=e;Ci(this.logger,!1,"clearMessages",t,s,r||"")},$i=function(e,t,s){Ci(this.logger,!1,"deleteChatroomMessageAndKV",e,t,s)},Zi=function(e){var t;return!!(2&((null===(t=this.getNaviInfoFromCache())||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e||""},qi=function(e){const{conversationType:t,targetId:s,channelId:r}=e,i=Ci(this.logger,!1,"getConversation",t,s,r||"");return i?this._buildConversation(i):null},zi=function(e){const{conversationType:t,targetId:s,channelId:r}=e;return Ci(this.logger,!0,"getUnreadCount",t,s,r||"")},en=function(e){const{conversationType:t,targetId:s,channelId:r}=e;return Ci(this.logger,!1,"clearUnreadCount",t,s,r||"")},tn=function(e){const{conversationType:t,targetId:s,channelId:r}=e,i=Ci(this.logger,!0,"getTheFirstUnreadMessage",t,s,r||""),n=this._buildMessage(i);return-1!==n.messageId?n:null},sn=function(e,t,s,r,i,n){const o=this.logger.createTraceId(),a=Oi.create(this.logger,"updateConversationStatus",o),c=JSON.stringify(e.map((e=>({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:r,top_op:s,create_conversation:!!n,update_time:!!i}))));return a.invoke(c,(()=>a.ok()),(e=>a.fail(e))).result()},rn=function(e,t){const{conversationType:s,targetId:r,channelId:i}=e,{content:n,senderUserId:o,messageType:a,messageDirection:c,readStatus:_,sentStatus:l,sentTime:d,searchContent:E,isUnread:u,messageUId:R,disableNotification:h,canIncludeExpansion:I,expansion:g,directedUserIds:T,disableUpdateLastMessage:N,quoteInfo:C}=t,O=d||0,p={};if(g)for(const e in g)p[e]={v:g[e],ts:O};const S=()=>{},A=Ci(this.logger,!0,"insertMessage",s,r,o,a,JSON.stringify(n),S,S,c,_||1,l||30,O,E||"",u?0:1,R||"",!!h,!!I,JSON.stringify(p),i||"",T||[],!!N,(null==C?void 0:C.messageUId)||"",(null==C?void 0:C.senderId)||"",(null==C?void 0:C.objectName)||"",(null==C?void 0:C.quoteMessageStatus)||0),f=this._buildMessage(A,!1);return f.messageUId=R,f.sentTime=d,f},nn=function(e,t=0){Ci(this.logger,!1,"deleteMessages",e,t)},on=function(e,t,s){Ci(this.logger,!1,"deleteMessagesByTimestamp",e.conversationType,e.targetId,t,s,e.channelId||"")},an=function(e){const t=Ci(this.logger,!0,"getMessage",e),s=JSON.parse(t);return s.messageId<=0?As(Pe.RC_DB_DATA_NOT_FOUND,`msg not found: ${e}`):Ss(s)},cn=function(e){return g(this,Mi,"m",an).call(this,e).trans((e=>g(this,Mi,"m",wi).call(this,e,!1)))},_n=function(e,t,s){return Ci(this.logger,!1,"setMessageContent",e,t,s)},ln=function(e,t,s=0){Ci(this.logger,!1,"setMessageReceivedStatus",e,t,s)},dn=function(e){const t=e.map((e=>{const{conversationType:t,targetId:s,channelId:r=""}=e;return{targetId:s,channelId:r,type:t}})),s=Ci(this.logger,!0,"getConversations",JSON.stringify(t));return JSON.parse(s).list.map((e=>this._buildConversation(e.obj)))},En=function(e){let t=[];return e&&e.length>0&&(t=e.map((e=>{const t=JSON.parse(e.obj);return{messageUId:t.msg_uid,message:t.msg?this._buildMessage(t.msg):void 0,code:t.code}}))),t},un=function(e,t){try{const{list:s}=JSON.parse(e);t(g(this,Mi,"m",En).call(this,s))}catch(t){this.logger.error(Tr.P_PARSE_JSON_MSGS_E,e)}},Rn=function(e){const t=Ci(this.logger,!1,"getBlockedConversations",e);return g(this,Mi,"m",Bi).call(this,t,"getBlockedConversations")},hn=function(e,t){return I(this,void 0,void 0,(function*(){const s=Oi.create(this.logger,"getSubscribeStatusByUserIds",this.logger.createTraceId());return s.invoke(e,t,((e,t)=>{e!==Pe.SUCCESS?s.fail(e):s.ok(t)})).result()}))},In=function(e){return JSON.parse(e).list.map((e=>{const t=JSON.parse(e);return{robotId:t.robotId,name:t.robotName,portraitUri:t.robotPortrait,robotType:t.robotType,metadata:t.metadata?JSON.parse(t.metadata):{},createTime:t.createTime,updateTime:t.updateTime}}))};class On{constructor(e){Object.defineProperty(this,"_rendererInitOptions",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_senders",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this._svr=new Cn(e,this._send2AllRenderer.bind(this)),this._initIpcEventListeners(),t.app.on("before-quit",(()=>this.destroy())),t.app.on("window-all-closed",(()=>this.destroy()))}static init(s){if(g(this,Tn,"f",Nn))return g(this,Tn,"f",Nn);if(!s.appkey)throw new Error("Initializ failed, `appkey` is required!");const r={appkey:s.appkey,dbpath:s.dbpath||e.resolve(t.app.getPath("userData")),logOutputLevel:s.logOutputLevel||ks.WARN,enableSyncEmptyTopConversation:!!s.enableSyncEmptyTopConversation,disableLogReport:!!s.disableLogReport,eventLoopBlockingCheck:!!s.eventLoopBlockingCheck,environment:s.environment||"default",reconnectKickEnable:!!s.reconnectKickEnable,runInMainProcess:!!s.runInMainProcess};return T(this,Tn,new On(r),"f",Nn),g(this,Tn,"f",Nn)}_initIpcEventListeners(){t.ipcMain.on("__RC_CHANNEL_CALL_MAIN_SYNC__",((e,t,...s)=>{e.returnValue=this._svr[t].call(this._svr,...s)})),t.ipcMain.on("__RC_CHANNEL_CALL_MAIN__",(({sender:e},t,s,...r)=>I(this,void 0,void 0,(function*(){if(!this._senders.has(e))return void this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",t,As(Pe.BIZ_ERROR_CLIENT_NOT_INIT));let i;if("sendMessage"===s){const[t,s,n,o]=r;i=this._svr.sendMessage(t,s,n,(t=>{this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",o,t)}))}else if("refreshReferenceMessageWithParams"===s){const[t,s,n,o]=r;i=this._svr.refreshReferenceMessageWithParams(t,s,(t=>{this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",n,t)}),(t=>{this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",o,t)}))}else i=this._svr[s].apply(this._svr,r);i instanceof Promise&&(i=yield i),this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",t,i)})))),t.ipcMain.on("__RC_CHANNEL_SEND_2_MAIN__",(({sender:e},t,...s)=>{this._senders.has(e)&&this._svr[t].apply(this._svr,s)})),t.ipcMain.on("__RC_INNER_COMMAND_INIT__",this._registerRenderers.bind(this))}_registerRenderers(e,t){if("07c327459d99ef27cc3fa8e218a316fa67bab020"!==t.commitId)return;const{sender:s}=e;this._rendererInitOptions||(this._rendererInitOptions=t,this._svr.setRenderInitOption(t)),this._senders.has(s)||(this._senders.add(s),s.once("destroyed",(()=>{this._senders.delete(s)})))}_send2Renderer(e,t,...s){e.isDestroyed()?this._senders.delete(e):e.send(t,...s)}_send2AllRenderer(e,...t){this._senders.forEach((s=>{this._send2Renderer(s,"__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",e,...t)}))}getCppProto(){return{destroy:()=>{console.warn("`.getCppProto().destroy()` has being deprecated, use `.destroy()` instead."),this.destroy()}}}destroy(){this._svr.destroy()}getDeviceId(){return this._svr.getDeviceId()}getServerTime(){return this._svr.getConnectedTime()}setDatabaseOperationTimeThreshold(e){return this._svr.setDataBaseLogConfig(e)}}Tn=On,Nn={value:void 0};module.exports=e=>On.init(e);