@rongcloud/engine 5.24.0 → 5.24.1-c-dq.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.mjs CHANGED
@@ -12,4 +12,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function o(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,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(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=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++,r=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],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function c(e,t,n,r){if("a"===n&&!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"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function d(e,t,n,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,n):i?i.value=n:t.set(e,n),n}!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"}(n||(n={}));var f,p,h,_,b,E,v,m,y,I,T,R,O,S,C,A,P,N,w,L,M,U,D,V,j,G,k,F,x,B,H={L_IMSDK_VER_O:"L-imsdk_ver-O",A_INIT_REPEAT_O:"A_INIT_REPEAT_O",L_INIT_O:"L-init-O",A_DESTROY_O:"A_DESTROY_O",A_CONNECT_T:"A-connect-T",A_CONNECT_R:"A-connect-R",A_CONNECT_S:"A-connect-S",L_QUERY_CMP_T:"L-query_cmp-T",L_QUERY_CMP_R:"L-query_cmp-R",A_DISCONNECT_O:"A-disconnect-O",A_RECONNECT_T:"A-reconnect-T",A_RECONNECT_R:"A_RECONNECT_R",L_CONNECT_T:"L-connect-T",L_CONNECT_O:"L-connect-O",L_CONNECT_R:"L-connect-R",L_CONNECT_S:"L-connect-S",L_DB_UPGRATE_START_S:"L-db_upgrate_start-S",L_DB_UPGRATING_S:"L-db_upgrating-S",L_DB_UPGRATE_COMPLETE_S:"L-db_upgrate_complete-S",L_NOTIFY_ULTRA_ONLINE_S:"L-notify-ultra-online-S",L_ULTRA_SYNC_DONE_S:"L-ultra-sync-done-S",L_BATCH_MESSAGE_O:"L-BATCH_MESSAGE-O",A_MSG_LISTENER_E:"A-MSG_LISTENER-E",O:"L-original-O",T:"L-TEST-O",L_INSTALL_PLUGIN_T:"L-INSTALL_PLUGIN-T",L_INSTALL_PLUGIN_R:"L-INSTALL_PLUGIN-R",L_NAVI_CONF_E:"L-NAVI_CONF_ERROR-E",L_NAVI_CMP_R:"L-NAVI_CPM-R",A_SEND_MSG_T:"A-send_msg-T",A_SEND_MSG_R:"A-send_msg-R",L_SEND_MSG_T:"L-send_msg-T",L_SEND_MSG_R:"L-send_msg-R",L_PULL_MSG_T:"L-pull_msg-T",L_PULL_MSG_R:"L-pull_msg-R",L_PULL_MSG_E:"L-pull_msg-E",L_PULL_MSG_O:"L-pull_msg-O",L_PULL_ULTRA_MSG_T:"L-pull_ultra_msg-T",L_PULL_ULTRA_MSG_R:"L-pull_ultra_msg-R",L_PULL_UG_RELATIONS_T:"L-pull_ug_relations-T",L_PULL_UG_RELATIONS_R:"L-pull_ug_relations-R",L_PULL_CHATROOM_KV_T:"L-pull_chatroom_kv-T",L_PULL_CHATROOM_KV_R:"L-pull_chatroom_kv-R",L_PULL_CHATROOM_MSG_T:"L-pull_chatroom_msg-T",L_PULL_CHATROOM_MSG_R:"L-pull_chatroom_msg-R",L_RECV_MULTI_SYNC_MSG_O:"L-recv_multi_sync_msg-O",L_RECV_S_MSG_O:"L-recv_s_msg-O",A_DELETE_MESSAGES_S:"A-delete_messages-S",P_DELETE_MSG_S:"P-delete_msg-S",A_RECALL_MESSAGE_T:"A-recall_msg-T",A_RECALL_MESSAGE_R:"A-recall_msg-R",A_RECALL_MESSAGE_E:"A-recall_msg-E",A_REGTYP_O:"A-regtyp-O",P_REGTYP_E:"P-regtype-E",L_GET_NAVI_T:"L-get_navi-T",L_GET_NAVI_R:"L-get_navi-R",L_REQUEST_T:"L-request-T",L_REQUEST_R:"L-request-R",L_PARSE_NAVI_E:"L-parse_navi-E",L_ENV_S:"L-Env-S",L_GET_INDEX_NAVI_S:"L-get_index_navi-S",A_JOIN_CHATROOM_T:"A-join_chatroom-T",A_JOIN_CHATROOM_R:"A-join_chatroom-R",L_JOIN_CHATROOM_T:"L-join_chatroom-T",L_JOIN_CHATROOM_R:"L-join_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",L_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",L_REJOIN_CHATROOM_S:"L-rejoin_chatroom-S",L_MEDIA_S:"L-media-S",L_MEDIA_UPLOAD_T:"L-media_upload-T",L_MEDIA_UPLOAD_R:"L-media_upload-R",G_UPLOAD_LOG_S:"G-upload_log-S",G_REPORT_LOG_S:"G-report_log-S",G_UPLOAD_LOG_E:"G-upload_log-E",G_GET_REAL_TIMELOG_COMMAND_S:"G-get_real_timelog_command-S",L_CHECK_ALIVE_IM_T:"L-check_alive_im-T",L_CHECK_ALIVE_IM_R:"L-check_alive_im-R",L_CHECK_ALIVE_IM_S:"L-check_alive_im-S",A_GET_LOCAL_MESSAGE_T:"A-get_local_message-T",A_GET_LOCAL_MESSAGE_R:"A-get_local_message-R",A_GET_HISTORY_MSG_T:"A-get_history_msg-T",A_GET_HISTORY_MSG_R:"A-get_history_msg-R",L_GET_HISTORY_MSG_T:"L-get_history_msg-T",L_GET_HISTORY_MSG_R:"L-get_history_msg-R",A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E:"A-get_privage_message_deliver_time-E",A_GET_GROUP_MESSAGE_DELIVER_LIST_E:"A-get_group_message_deliver_list-E",L_CALLBACK_E:"L-callback-E",A_SEND_MESSAGE_READ_RECEIPT_V4_T:"A-send_message_read_receipt_V4-T",A_SEND_MESSAGE_READ_RECEIPT_V4_R:"A-send_message_read_receipt_V4-R",A_GET_MESSAGE_READ_RECEIPT_V4_T:"A-get_message_read_receipt_V4-T",A_GET_MESSAGE_READ_RECEIPT_V4_R:"A-get_message_read_receipt_V4-R",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T:"A-batch_get_message_read_receipt_info_V4-T",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R:"A-batch_get_message_read_receipt_info_V4-R",A_SYNC_READ_STATUS_T:"A-sync_read_status-T",A_SYNC_READ_STATUS_R:"A-sync_read_status-R",L_PB_ENCODE_E:"L-pb-encode-E",L_PB_DECODE_E:"L-pb-decode-E",L_NOTIFY_NAVI_CHANGE_E:"L-notify_navi_change-E",L_REPORT_FULL_LOG_O:"L-report_full_log-O",L_REPORT_FULL_LOG_T:"L-report_full_log-T",L_REPORT_FULL_LOG_R:"L-report_full_log-R",L_REPORT_LOG_POLICY_E:"L-parse_navi_logpolicy-E",L_UNSUPPORT_INDEXDB_O:"L-unsupport_IndexDB-O",L_LOGDB_OPEN_FAILED_E:"L-logDB_open_failed-E",L_LOGDB_CLOSED_S:"L-logDB_closed-S",L_LOGDB_ERROR_E:"L-logDB_error-S",L_LOGDB_ABORT_S:"L-logDB_abort-S",L_REALTIME_LOG_T:"L_REALTIME_LOG_T",L_REALTIME_LOG_R:"L_REALTIME_LOG_R",L_REALTIME_LOG_O:"L_REALTIME_LOG_O",L_SEND_RMTP_E:"L-send-rmpt-E",L_RECV_RMTP_O:"L-recv-rmpt-O",L_RECV_RMTP_E:"L-recv-rmpt-E",L_RECV_S_NTF_O:"L-recv_s_ntf_O",L_RECV_S_CMD_O:"L-recv_s_cmd_O",L_VER_REPORT_T:"L-VER_REPORT-T",L_VER_REPORT_R:"L-VER_REPORT-R",L_CALL_MAIN_SYNC_O:"L_CALL_MAIN_SYNC_O",L_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_SET_MSG_CONTENT_O:"A_SET_MSG_CONTENT_O",A_REMOVE_PROXY_O:"A-remove_proxy-O",A_SET_PROXY_O:"A-set_proxy-O",A_TEST_PROXY_O:"A-test_proxy-O",L_WS_DISACCORD_E:"L-ws_disaccord-E",L_GET_STATIC_CONF_T:"L-get_static_conf-T",L_GET_STATIC_CONF_R:"L-get_static_conf-R",L_GET_STATIC_CONF_E:"L-get_static_conf-E",L_CLOUD_DISABLED:"L-cloud_disabled",L_CLOUD_OVERCLOCK:"L-cloud_overclock",L_CLOUD_APPKEY_REGION_E:"L-cloud_appkey_region_error",L_CLOUD_CONFIG_DATA_E:"L-cloud_config_data_error",L_CLOUD_SET_CACHE_O:"L-cloud_set_cache-O",L_CLOUD_GET_CACHE_O:"L-cloud_get_cache-O",L_CLOUD_SET_AREA_CODE_O:"L-cloud_set_area_code-O",L_CLOUD_SET_MRTR_O:"L-cloud_set_mrtr-O",L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S:"L-sync_subscribed_user_status_finished-S",L_PULL_SUBSCRIBED_USER_RELATION_T:"L-pull_subscribed_user_relation-T",L_PULL_SUBSCRIBED_USER_RELATION_R:"L-pull_subscribed_user_relation-R",L_PULL_SUBSCRIBED_USER_STATUS_T:"L-pull_subscribed_user_status-T",L_PULL_SUBSCRIBED_USER_STATUS_R:"L-pull_subscribed_user_status-R",L_OWN_USER_PROFILE_CHANGED_S:"L-own_user_profile_changed-S",L_QUERY_SUBSCRIBE_DATA_T:"L-query_subscribe_data-T",L_QUERY_SUBSCRIBE_DATA_R:"L-query_subscribe_data-R",L_PULL_USER_PROFILE_T:"L-pull_user_profile-T",L_PULL_USER_PROFILE_R:"L-pull_user_profile-R",L_PULL_OWN_PROFILE_T:"L-pull_own_profile-T",L_PULL_OWN_PROFILE_R:"L-pull_own_profile-R",L_QUERY_FRIEND_LIST_T:"L-query_friend_list-T",L_QUERY_FRIEND_LIST_R:"L-query_friend_list-R",L_PULL_USER_PROFILE_REQ_T:"L-pull_user_profile_req-T",L_PULL_USER_PROFILE_REQ_R:"L-pull_user_profile_req-R",L_SERVER_EVENT_NOTIFY_ONLINE_T:"L-server_event_notify_online-T",L_SERVER_EVENT_NOTIFY_ONLINE_R:"L-server_event_notify_online-R",L_PULL_EVENT_CHANGE_T:"L-pull_event_change-T",L_PULL_EVENT_CHANGE_R:"L-pull_event_change-R",L_PARSE_JSON_E:"L-parse_json-E",L_REQ_STREAM_MSG_CONTENT_T:"L-req_stream_msg_content-T",L_REQ_STREAM_MSG_CONTENT_R:"L-req_stream_msg_content-R",L_REQ_STREAM_MSG_CONTENT_O:"L-req_stream_msg_content-O",L_REQ_STREAM_MSG_CONTENT_E:"L-req_stream_msg_content-E",L_PULL_CONVERSATION_SETTINGS_T:"L-pull_conversation_settings-T",L_PULL_CONVERSATION_SETTINGS_R:"L-pull_conversation_settings-R",L_PULL_SG_RELATIONS_T:"L-pull_sg_relations-T",L_PULL_SG_RELATIONS_R:"L-pull_sg_relations-R",A_REMOVE_CONVERSATION_T:"A-remove_conversation-T",A_REMOVE_CONVERSATION_R:"A-remove_conversation-R",A_GET_CONVERSATION_LIST_BY_FILTER_T:"A-get_conversation_list_by_filter-T",A_GET_CONVERSATION_LIST_BY_FILTER_R:"A-get_conversation_list_by_filter-R",A_GET_CONVERSATION_T:"A-get_conversation-T",A_GET_CONVERSATION_R:"A-get_conversation-R",A_BATCH_SET_CONVERSATION_TO_TOP_T:"A-batch_set_conversation_to_top-T",A_BATCH_SET_CONVERSATION_TO_TOP_R:"A-batch_set_conversation_to_top-R",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T:"A-batch_set_convers_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_convers_notification_level-R",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T:"A-batch_set_convers_translate_strategy-T",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R:"A-batch_set_convers_translate_strategy-R",A_CLEAR_ALL_UNREAD_COUNT_O:"A-clear_all_unread_count-O",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T:"A-delete_remote_message_by_timestamp-T",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R:"A-delete_remote_message_by_timestamp-R",A_DELETE_REMOTE_MESSAGE_T:"A-delete_remote_message-T",A_DELETE_REMOTE_MESSAGE_R:"A-delete_remote_message-R",A_BATCH_CLEAR_REMOTE_MSG_T:"A-batch_clear_remote_msg-T",A_BATCH_CLEAR_REMOTE_MSG_R:"A-batch_clear_remote_msg-R",L_EVENT_LOOP_BLOCKING_S:"L-event_loop_blocking-S",A_E_SEARCH_CONVERSATION_BY_CONTENT_T:"A-e_search_conversation_by_content-T",A_E_SEARCH_CONVERSATION_BY_CONTENT_R:"A-e_search_conversation_by_content-R",P_GET_SYS_VERSION_E:"P-get_sys_version-E",A_CLEAR_LOCAL_CACHE_O:"A-clear_local_cache-O",A_E_SET_MESSAGE_STATUS_TO_READ_T:"A-e_set_message_status_to_read-T",A_E_SET_MESSAGE_STATUS_TO_READ_R:"A-e_set_message_status_to_read-R",A_SEARCH_MSGS_BY_PARAMS_T:"A-search_msgs_by_params-T",A_SEARCH_MSGS_BY_PARAMS_R:"A-search_msgs_by_params-R",A_GET_CHATROOM_HISTORY_MESSAGES_T:"A-get_chatroom_history_messages-T",A_GET_CHATROOM_HISTORY_MESSAGES_R:"A-get_chatroom_history_messages-R",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T:"A-request_speech_to_text_for_message-T",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R:"A-request_speech_to_text_for_message-R",L_SYNC_USER_SETTINGS_T:"L-sync_user_settings-T",L_SYNC_USER_SETTINGS_R:"L-sync_user_settings-R",A_ADD_TAG_T:"A-add_tag-T",A_ADD_TAG_R:"A-add_tag-R",A_REMOVE_TAG_T:"A-remove_tag-T",A_REMOVE_TAG_R:"A-remove_tag-R",A_UPDATE_TAG_T:"A-update_tag-T",A_UPDATE_TAG_R:"A-update_tag-R",A_GET_TAGS_T:"A-get_tags-T",A_GET_TAGS_R:"A-get_tags-R",A_ADD_TAG_FOR_CONVERSATIONS_T:"A-add_tag_for_conversations-T",A_ADD_TAG_FOR_CONVERSATIONS_R:"A-add_tag_for_conversations-R",A_GET_TAGS_OF_CONVERSATION_T:"A-get_tags_of_conversation-T",A_GET_TAGS_OF_CONVERSATION_R:"A-get_tags_of_conversation-R",A_SET_CONVER_TO_TOP_IN_TAG_T:"A-set_conver_to_top_in_tag-T",A_SET_CONVER_TO_TOP_IN_TAG_R:"A-set_conver_to_top_in_tag-R",A_REMOVE_TAG_FOR_CONVERS_T:"A-remove_tag_for_conversations-T",A_REMOVE_TAG_FOR_CONVERS_R:"A-remove_tag_for_conversations-R",A_REMOVE_TAGS_FOR_CONVER_T:"A-remove_tags_for_conversation-T",A_REMOVE_TAGS_FOR_CONVER_R:"A-remove_tags_for_conversation-R",A_GET_UNREAD_COUNT_BY_TAG_T:"A-get_unread_count_by_tag-T",A_GET_UNREAD_COUNT_BY_TAG_R:"A-get_unread_count_by_tag-R",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T:"A-get_untagged_conversation_list_by_page-T",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R:"A-get_untagged_conversation_list_by_page-R",A_SET_TRANSLATION_LANGUAGE_T:"A-set_translation_language-T",A_SET_TRANSLATION_LANGUAGE_R:"A-set_translation_language-R",A_GET_TRANSLATION_LANGUAGE_T:"A-get_translation_language-T",A_GET_TRANSLATION_LANGUAGE_R:"A-get_translation_language-R",A_SET_AUTO_TRANSLATE_ENABLED_T:"A-set_auto_translate_enabled-T",A_SET_AUTO_TRANSLATE_ENABLED_R:"A-set_auto_translate_enabled-R",A_GET_AUTO_TRANSLATE_ENABLED_T:"A-get_auto_translate_enabled-T",A_GET_AUTO_TRANSLATE_ENABLED_R:"A-get_auto_translate_enabled-R"};!function(e){e[e.BOTH=2]="BOTH"}(f||(f={})),function(e){e[e.BOTH=2]="BOTH"}(p||(p={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(h||(h={})),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"}(_||(_={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(b||(b={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(E||(E={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(v||(v={})),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"}(m||(m={})),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"}(y||(y={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(I||(I={})),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"}(T||(T={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(R||(R={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(O||(O={})),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"}(S||(S={})),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"}(C||(C={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(A||(A={})),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"}(P||(P={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(N||(N={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(w||(w={})),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"}(L||(L={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(M||(M={})),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"}(U||(U={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(D||(D={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(V||(V={})),function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(j||(j={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(G||(G={})),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"}(k||(k={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(F||(F={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",e[e.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",e[e.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",e[e.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",e[e.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",e[e.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",e[e.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",e[e.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",e[e.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",e[e.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(x||(x={})),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"}(B||(B={}));var q,Y,K,Q=0,W=1,J=2,z=3,X=4,Z=function(e){var t=[B.PRIVATE,B.GROUP,B.SYSTEM,B.PUBLIC_SERVICE,B.APP_PUBLIC_SERVICE];switch(e){case Q:return t;case W:return[B.PRIVATE,B.GROUP];case J:return l(l([],u(t),!1),[B.ULTRA_GROUP],!1);case z:return l(l([],u(t),!1),[B.ULTRA_GROUP,B.CHATROOM],!1);case X:return l(l([],u(t),!1),[B.ULTRA_GROUP,B.CHATROOM,B.RTC_ROOM,B.CUSTOMER_SERVICE,B.DISCUSSION],!1)}},$=function(e,t){return Z(t).includes(e)};!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"}(q||(q={})),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"}(Y||(Y={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(K||(K={}));var ee,te,ne,re,ie,oe,ae,se,ue,le,ce,de,fe,pe,he,ge,_e,be,Ee,ve,me,ye={TextMessage:"RC:TxtMsg",TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL:"RC:RcCmd",RECALL_MESSAGE_TYPE:"RC:RcCmd",RECALL_NOTIFICATION_MESSAGE:"RC:RcNtf",READ_RECEIPT:"RC:ReadNtf",READ_RECEIPT_REQUEST:"RC:RRReqMsg",READ_RECEIPT_RESPONSE:"RC:RRRspMsg",SYNC_READ_STATUS:"RC:SRSMsg",GROUP_READ_RECEIPT_REQUEST:"RC:RRMsg",READ_STATE:"RC:RSMsg",DELIVERED:"RC:Delivered",DELIVERED_MSG:"RC:DRMsg",CHATROOM_MERGE_CHANGE:"RC:ChrmMemChange",CHATROOM_SYNC_MSG:"RC:ChrmSyncMsg",CHATROOM_MERGE_BLOCK:"RC:ChrmBlockMsg",CHATROOM_MERGE_BAN:"RC:ChrmBanMsg",TYPING_STATUS:"RC:TypSts",INTERCEPT:"RC:InterceptMsg",CLOUD_CONTROL:"RC:CCConfigChangeRequestMsg",STREAM_MESSAGE:"RC:StreamMsg"};!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(ee||(ee={})),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"}(te||(te={})),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"}(ne||(ne={})),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"}(re||(re={})),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"}(ie||(ie={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(oe||(oe={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(ae||(ae={})),function(e){e[e.typing=0]="typing"}(se||(se={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(ue||(ue={})),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"}(le||(le={})),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"}(ce||(ce={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(de||(de={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(fe||(fe={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(pe||(pe={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(he||(he={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(ge||(ge={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(_e||(_e={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(be||(be={})),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"}(Ee||(Ee={})),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"}(ve||(ve={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(me||(me={}));var Ie,Te,Re,Oe,Se,Ce,Ae,Pe,Ne,we=function(e){return e===me.OPEN?ve.AT_MESSAGE_NOTIFICATION:ve.NOT_SET},Le=function(e){return e<=ve.NOT_SET?me.CLOSE:me.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"}(Ie||(Ie={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Te||(Te={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Re||(Re={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Oe||(Oe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Se||(Se={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ce||(Ce={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Ae||(Ae={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Pe||(Pe={})),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"}(Ne||(Ne={}));var Me,Ue,De={DISALLOW:0,ALLOW:1},Ve={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},je={NORMAL:0,ROBOT:1};!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"}(Me||(Me={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(Ue||(Ue={}));var Ge=72e5,ke=6e4,Fe=131072,xe="5.24.0".replace(/-.+$/,""),Be=5368709120,He=10485760,qe="rongcloudsystem",Ye=864e5,Ke=function(e){return"navi_".concat(e)},Qe=function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},We=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},Je=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},ze=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},Xe=function(e,t){return"outbox_".concat(e,"_").concat(t)},Ze=function(e,t){return"inbox_".concat(e,"_").concat(t)},$e=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},et=function(e,t){return"send_msg_".concat(e,"_").concat(t)},nt=function(e,t){return"RC-us-".concat(e,"-").concat(t)},rt=function(e){return"rc-static-config-".concat(e)},it=function(e){return"RC-cc-".concat(e)},ot=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},at=function(e){return"RC-LI-".concat(e)},st=Math.pow(2,31)-1,ut="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};ut.engine="5.24.0";var lt=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)&&(ut[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 n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return ut.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return ut}}),e}();var ct={gen: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)}))},genWithLen:function(e){void 0===e&&(e=22);var t,n=Date.now(),r=n.toString(36),i=Math.floor(Math.random()*n).toString(36),o=e-r.length-i.length;return[i,r,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},dt=ct.genWithLen(22),ft=Date.now(),pt=function(e){return"string"==typeof e},ht=function(e){return"boolean"==typeof e},gt=function(e){return"number"==typeof e&&!Number.isNaN(e)},_t=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},bt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Et=function(e){return function(t){return pt(t)&&(void 0===e.isTrim||0===t.length||t.trim().length>0)&&(void 0===e.minLength||t.length>=e.minLength)&&(void 0===e.maxLength||t.length<=e.maxLength)&&(void 0===e.validator||e.validator(t))}},vt=function(e){return pt(e)&&e.length>0},mt=function(e){return bt(e)&&e.length>0},yt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},It=function(e){return"function"==typeof e},Tt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Rt=function(e){return pt(e)&&/https?:\/\//.test(e)},Ot=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},St=function(e){return gt(e)&&Object.prototype.hasOwnProperty.call(B,e)},Ct=function(e){return gt(e)&&Object.prototype.hasOwnProperty.call(ve,e)},At=function(e){var t=!1;return pt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Pt=function(e){return Object.values(e.type).includes(e.value)},Nt=function(e){return Et({minLength:1,maxLength:64})(e)},wt=function(e){return Et({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Lt=function(e){return gt(e)&&Object.prototype.hasOwnProperty.call(Y,e)},Mt=function(e){var t=!1,n=!1,r=!1;if(yt(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(n||(n=pt(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!r){var a=e[o];r=o.length>32||a.length>4096}}return{isExceedLimit:t,isIllgalEx:n,isExKeyOrValLengthExceedLimit:r}},Ut=function(e){if(!yt(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},Dt=function(){return"undefined"!=typeof RCCppEngine},Vt=function(e){return{isRead:(e&Ie.READ)===Ie.READ,isListened:(e&Ie.LISTENED)===Ie.LISTENED,isDownload:(e&Ie.DOWNLOADED)===Ie.DOWNLOADED,isRetrieved:(e&Ie.RETRIEVED)===Ie.RETRIEVED}},jt=function(e){var t=Ie.UNREAD;return(null==e?void 0:e.isRead)&&(t|=Ie.READ),(null==e?void 0:e.isListened)&&(t|=Ie.LISTENED),(null==e?void 0:e.isDownload)&&(t|=Ie.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=Ie.RETRIEVED),t},Gt=function(e){return[le.Android,le.iOS,le.Web,le.PC,le.Mini,le.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},kt=function(e,t,n){var r=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},Ft=function(e,t,n){return t?1===n?q.TLS:q.RMTP:"http"===e?q.WS:q.WSS},xt=function(e,t){var n=e.server,r=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return n&&d.push(n),(r||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,r){e&&c.push({addr:e,protocol:Ft(a,t,s),weight:n.length-r,race:!1})})),l([],u(c),!1)},Bt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,i,o,a,s,u,l,c=Qt(e.settingProfile)||{},d=e.extProfile||[],f=e.targetId,p=e.baseInfo,h=e.userInfo;return{groupId:f,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(n=c.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=c.introduction)&&void 0!==r?r:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Qt(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==p?void 0:p.creatorId)&&void 0!==o?o:"",ownerId:null!==(a=null==p?void 0:p.ownerId)&&void 0!==a?a:"",createTime:(null==p?void 0:p.createTime)?Ut(p.createTime):0,membersCount:null!==(s=null==p?void 0:p.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)?Ut(h.joinTime):0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:O.UNDEF}}))},Ht=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Qt(e.settingProfile),n=e.extProfile||[],i=e.targetId,o=e.baseInfo,a=e.userInfo;return JSON.parse(JSON.stringify(r(r({groupId:i},Yt(t)),{extProfile:n.length>0?Qt(n):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:(null==o?void 0:o.createTime)?Ut(o.createTime):void 0,membersCount:null==o?void 0:o.memberCount,remark:null==a?void 0:a.remarkName})))}))},qt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Yt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:qt(e.joinPerm),removeMemberPermission:qt(e.removePerm),invitePermission:qt(e.memInvitePerm),inviteHandlePermission:qt(e.invitePerm),groupInfoEditPermission:qt(e.profilePerm),memberInfoEditPermission:qt(e.memProfilePerm)}))},Kt=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},n=t.ext,r=t.userId,i=t.name,o=t.portraitUrl,a=n||{},s=a.role,u=a.joinTime,l=a.channelNickName,c=a.additional;return{userId:r,name:i||"",portraitUri:o||"",nickname:l||"",role:s||O.UNDEF,joinedTime:Ut(u)||0,extra:c||""}}));return t},Qt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Wt=function(e){var t,n,r,i;return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",nickname:null===(t=e.ext)||void 0===t?void 0:t.channelNickName,extra:null===(n=e.ext)||void 0===n?void 0:n.additional,role:null===(r=e.ext)||void 0===r?void 0:r.role,joinedTime:null===(i=e.ext)||void 0===i?void 0:i.joinTime}},Jt=function(e){var t=e.joinUserInfo,n=e.inviterInfo,r=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Wt(t),inviterInfo:n&&n.userId?Wt(n):void 0,operatorInfo:r&&r.userId?Wt(r):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},zt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e};function Xt(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var Zt,$t=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=ct.gen(),i=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate();return"".concat(n).concat(e).concat(r).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(n,"_").concat(o).concat(r).concat(a)},en=function(e,t,n){void 0===e&&(e=0);var i=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}}(e),o=i.disablePushTitle,a=i.forceShowDetailContent,s=tn(null==n?void 0:n.pushConfigs,null==n?void 0:n.pushId);return r({pushTitle:(null==n?void 0:n.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:a,templateId:null==n?void 0:n.templateId},s)},tn=function(e,t){var n={},r={notificationId:t||""},i={};if(!e)return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,l,c,d,f,p,h,g,_=Object.keys(e);if(0!==_.length){var b=_[0];switch(b){case"HW":return r.channelIdHW=null===(t=e[b])||void 0===t?void 0:t.channelId,r.importanceHW=null===(o=e[b])||void 0===o?void 0:o.importance,r.imageUrlHW=null===(a=e[b])||void 0===a?void 0:a.image,void(r.categoryHW=null===(s=e[b])||void 0===s?void 0:s.category);case"MI":return void(r.channelIdMi=null===(u=e[b])||void 0===u?void 0:u.channelId);case"OPPO":return void(r.channelIdOPPO=null===(l=e[b])||void 0===l?void 0:l.channelId);case"VIVO":return r.typeVivo=null===(c=e[b])||void 0===c?void 0:c.classification,void(r.categoryVivo=null===(d=e[b])||void 0===d?void 0:d.category);case"APNS":return n.threadId=e[b]["thread-id"],n.apnsCollapseId=e[b]["apns-collapse-id"],n.category=e[b].category,n.richMediaUri=e[b].richMediaUri,void(n.interruptionLevel=e[b]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:e[b].collapse_key||"",imageUrl:e[b].imageUrl||"",priority:e[b].priority||""});case"HONOR":return r.importanceHonor=null===(f=e[b])||void 0===f?void 0:f.importance,void(r.imageUrlHonor=null===(p=e[b])||void 0===p?void 0:p.image);case"OHOS":i.category=null===(h=e[b])||void 0===h?void 0:h.category,i.image=null===(g=e[b])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i}},nn=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},rn=function(e){var t=e.length;return t<=4096&&t>=1},on=(Zt=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),n=e+Zt.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return Zt=2047&++Zt,parseInt(n,2)}),an=function(){var e=lt.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-next"].includes(n)?n:"electron");return t},sn=function(e,t,n){return o(void 0,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return r=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,Xt(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function un(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==q.HTTP||r?"https://".concat(e):"http://".concat(e)}var ln=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,i="";try{var o=JSON.parse(r);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(H.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return i};var cn,dn=function(e){function n(t){var n=e.call(this,t)||this;return n.name="CMSYError",n}return t(n,e),Object.defineProperty(n,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new n("Invalid parameter -> ".concat(e)):new n("Invalid parameters.")}}),Object.defineProperty(n,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new n("Wrong parameter type")}}),n}(Error),fn=function(){function e(){cn.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,cn,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,cn,"f")},enumerable:!1,configurable:!0}),e}();cn=new WeakMap;var pn=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,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(r),once:n},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,n,r){return void 0===r&&(r=0),this._addItem(e,t,!1,n,r)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!0,n,r)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;try{for(var r=s(this._map),i=r.next();!i.done;i=r.next()){var o=u(i.value,2),a=(o[0],o[1]),l=a.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void a.splice(l,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map.get(e);if(r&&r.length>0)for(var i=new fn,o=0;o<r.length;o+=1){var a=r[o],s=a.once,c=a.listener;s&&r.splice(o,1);try{c.apply(void 0,l([i],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}l([],u(this._piped.values()),!1).forEach((function(n){return n.emit.apply(n,l([e],u(t),!1))}))}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._map.delete(e)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._piped.clear(),this._map.clear()}}),Object.defineProperty(e.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._piped.add(e)}}),e}(),hn=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t}return t(n,e),Object.defineProperty(n.prototype,"waitingQueueLength",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return-1!==this._dataVersion||(this._dataVersion=e),[2]}))}))}}),Object.defineProperty(n.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(n.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(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,n=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==n?void 0:n.version)||n.version<this._dataVersion)throw new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(null==n?void 0:n.version));return r=n.version,i=n.hasNext,o=this._versionQueue.filter((function(e){return e>r})),this._versionQueue=l([],u(o),!1),this._dataVersion=r,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(n.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return n._execPulling()}),e))}}),Object.defineProperty(n.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(n.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),n}(pn),gn=function(){function e(e,t){var n=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){n._resolve=t,e(n._onResolve.bind(n))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}();!function(){function e(e,t){var n=this;Object.defineProperty(this,"handler",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"validate",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_handlerPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._handlerPromise=new Promise((function(e){n._resolve=e}))}Object.defineProperty(e.prototype,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){return a(this,(function(n){if(!this._resolve)throw new Error("BatchSync is closed");return(null===(t=this.validate)||void 0===t?void 0:t.call(this,e))?(this._data.add(e),[2,this._handlerPromise]):[2]}))}))}}),Object.defineProperty(e.prototype,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:if(!this._resolve)throw new Error("BatchSync is closed");return e=this._resolve,this._resolve=null,t=l([],u(this._data.values()),!1),this._data.clear(),t.length>0?[4,this.handler(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return e(),[2,Promise.resolve()]}}))}))}})}();var _n,bn,En=function(){function e(e,t,n){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=n}return Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(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 o(this,void 0,void 0,(function(){return a(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?vn(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?vn(void 0,this.msg):mn(this.code,this.msg)}}),e}(),vn=function(e,t){return new En(0,t||"success",e)},mn=function(e,t,n){return new En(e,t||"fail: ".concat(e),n)},yn=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})}return 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){return this.isFailed&&0===this._code&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?mn(this._code,this._errmsg):vn()}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;var i=r?n(t):null==t||n(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,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;if(this.validate(e,t,n,r),this.isFailed)throw dn.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assertString(e,t,n),this.assert(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.isArray(e,t,r).validate(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isArray(e,t,r).validate(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,n,i,o).validate(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,n,i,o),this.assert(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"isValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return Object.values(n).includes(t)}),r)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return Object.values(n).includes(t)}),r)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"function"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"function"==typeof e}),n)}}),e}(),In="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Tn(e){var t,n,r,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=In.indexOf(e.charAt(u++))<<2|(i=In.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(o=In.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(a=In.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(n)),64!==a&&(s+=String.fromCharCode(r));return s}!function(){function e(e){var t=this;_n.add(this),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(e){t._resolve=e})),e&&c(this,_n,"m",bn).call(this,e)}Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(vn(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resolve(mn(e,"",t))}}),Object.defineProperty(e.prototype,"end",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}})}(),_n=new WeakSet,bn=function(e){var t=this;e().then((function(e){return t._resolve(e)}))};var Rn,On=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Sn=1732584193,Cn=4023233417,An=2562383102,Pn=271733878,Nn=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],wn=[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 Ln(e,t){return e<<t|e>>>32-t}function Mn(e,t,n){return e&n|t&~n}function Un(e,t,n){return e^t^n}function Dn(e,t,n){return t^(e|~n)}function Vn(e){for(var t=[],n=0;n<e.length;n+=4)t.push((e[n]||0)|(e[n+1]||0)<<8|(e[n+2]||0)<<16|(e[n+3]||0)<<24);return t}function jn(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 Gn(e){var t=8*e.length,n=e.length%64<56?56-e.length%64:120-e.length%64,r=new Uint8Array(e.length+n+8);r.set(e),r[e.length]=128;for(var i=1;i<n;i++)r[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(jn(a),0),o.set(jn(s),4),r.set(o,e.length+n);var u,l=Sn,c=Cn,d=An,f=Pn;for(i=0;i<r.length;i+=64){for(var p=Vn(r.slice(i,i+64)),h=l,g=c,_=d,b=f,E=0;E<64;E++){var v=void 0,m=void 0;E<16?(v=(u=c)&d|~u&f,m=E):E<32?(v=Mn(c,d,f),m=(5*E+1)%16):E<48?(v=Un(c,d,f),m=(3*E+5)%16):(v=Dn(c,d,f),m=7*E%16);var y=f;f=d,d=c,c+=Ln(l+v+wn[E]+p[m]&4294967295,Nn[E]),l=y}l=l+h&4294967295,c=c+g&4294967295,d=d+_&4294967295,f=f+b&4294967295}var I=new Uint8Array(16);return I.set(jn(l),0),I.set(jn(c),4),I.set(jn(d),8),I.set(jn(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(I)}function kn(e){var t=function(e){return(new TextEncoder).encode(e)}(e);return Gn(t)}function Fn(e){var t=e.method||Ue.GET,n=e.timeout||ke,r=e.headers,i=e.query,o=e.body,a=e.onProgress,s=zt(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),r&&u.setRequestHeader)for(var l in r)u.setRequestHeader(l,r[l]);return function(e,t,n,r){return new gn((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(u,n,o,a)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Rn||(Rn={}));var xn,Bn,Hn={TranslationLanguage:0,AutoTranslateEnable: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"}(Bn||(Bn={}));var qn=((xn={})[Bn.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},xn[Bn.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},xn[Bn.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},xn[Bn.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},xn[Bn.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},xn);function Yn(e){return Bn[e]?e:Bn.BJ}var Kn,Qn=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 n,r=this.initOption||{},i=r.areaCode,o=r.navigators,a=(n=i,void 0===n&&(n=Bn.BJ),qn[Yn(n)].naviUrlBase64).map((function(e){return Tn(e)})),s=[],c=u(e.split("@"),2)[1];t&&(s=c?c.split(";"):[]);var d=o&&o.length>0?l(l([],u(s),!1),u(o),!1):l(l([],u(s),!1),u(a),!1);return d.filter((function(e,t){return d.indexOf(e)===t})).map((function(e){return un(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,i=e||{},o=i.log,a=i.logPolicy,s=this.initOption||{},c=s.areaCode,d=s.logServerUrl,f=(n=c,void 0===n&&(n=Bn.BJ),qn[Yn(n)].logUrlBase64).map((function(e){return r(r({},e),{addr:Tn(e.addr)})})),p=[],h={level:1,itv:6,times:5};if(o)p.push.apply(p,l([],u(o.addrs),!1)),Object.assign(h,o.policy);else if(a)try{var g=JSON.parse(a);p.push({addr:g.url,protocol:q.HTTPS,weight:1}),h.level=g.level,h.itv=g.itv,h.times=g.times}catch(n){t.warn(H.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var _=d?l([{addr:d,protocol:q.HTTPS,weight:101}],u(p),!1):l(l([],u(p),!1),u(f),!1);return{policy:h,addrs:_.filter((function(e,t){return _.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return r(r({},e),{addr:un(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,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Bn.BJ),qn[Yn(t)].miniCmpBase64).map((function(e){return Tn(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n}}),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=Bn.BJ),qn[Yn(t)].staticConfigUrlBase64).map((function(e){return Tn(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=Bn.BJ),qn[Yn(n)].cloudControllerUrlBase64).map((function(e){return Tn(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:Bn.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Bn[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,n,r=(e||{}).active,i=(null==r?void 0:r.addrs)||[],o=(n=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===n&&(n=Bn.BJ),qn[Yn(n)].statsUrlBase64).map((function(e){return Tn(e)}));return 0===i.length?o:l(l([],u(i.sort((function(e,t){return t.weight-e.weight})).map((function(e){return un(e.addr,e.protocol)}))),!1),u(o),!1)}}),e}(),Wn=new Qn,Jn=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 o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:if(!(t=this.getCache()))return[3,6];a.label=1;case 1:return a.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return r=a.sent(),(i=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return un(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=a.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),a.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=a.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(u=a.sent())?void 0:u.areaCode)!==Wn.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==u?void 0:u.bootstrap)||[],(l=null===(e=null==u?void 0:u.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:l.map((function(e){return un(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(Wn.getStaticConfigUrl()),!1).map((function(e){return un(e)}))).filter((function(t,n){return e.indexOf(t)===n})),a.label=1;case 1:a.trys.push([1,6,7,8]),t=s(e),n=t.next(),a.label=2;case 2:return n.done?[3,5]:(r=n.value,this.logger.info(H.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),i=Date.now(),[4,this.sendRequest("".concat(r,"/").concat(this.appkey))]);case 3:if(o=a.sent(),c=o.code,d=o.data,200===c)return this.logger.info(H.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(H.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),a.label=4;case 4:return n=t.next(),[3,2];case 5:return[3,8];case 6:return f=a.sent(),p={error:f},[3,8];case 7:try{n&&!n.done&&(h=t.return)&&h.call(t)}finally{if(p)throw p.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"}(Kn||(Kn={}));var zn,Xn,Zn=function(){function e(e,t,n,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:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:Kn.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kn.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kn.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kn.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kn.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kn.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,n=e.level,r=e.content,i=e.traceId;/^[\w-]+$/.test(t)?n!==Kn.DEBUG&&this.logDB.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(r," | ").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 dt}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,n=e.tag,r=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=Kn.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(n," | ").concat(r," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[Kn.DEBUG,Kn.INFO,Kn.WARN,Kn.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,n,r){var i={time:Date.now(),level:e,tag:t,content:n,traceId:r,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,n,i,o,a){if(void 0===i&&(i={}),t.isOk){var s=null==o?void 0:o(t.data);this.info(e,JSON.stringify(r(r({isOk:!0},i),s)),n)}else{s=null==a?void 0:a(t.data);this.warn(e,JSON.stringify(r(r({code:t.code,msg:t.msg},i),s)),n)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),$n=function(){function e(e,t,n,r,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c=this;return a(this,(function(a){switch(a.label){case 0:o=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.logDB.read(e,t,n,r,s)];case 2:return u=a.sent(),bt(u.logs)?o=u.logs.filter((function(e){return!(!e||"object"!=typeof e)||(c.logger.warn(H.L_REALTIME_LOG_R,"Invalid log entry: not an object",i),!1)})):this.logger.warn(H.L_REALTIME_LOG_R,"Invalid logs result: not an array",i),[3,4];case 3:return l=a.sent(),this.logger.warn(H.L_REALTIME_LOG_R,"Error getting logs: ".concat(l instanceof Error?l.message:String(l)),i),[3,4];case 4:return[2,{logs:o}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(n=Wn.getLogUrlPolicyList(e,this.logger),r=n.policy,i=n.addrs,this.started=!0,this.itvByNavi=r.itv,this.timesByNavi=r.times,i.length>0&&this.realtimeReport(i[0].addr,r.level,r.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:return this.logger.debug(H.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=a.sent(),o=i.success,s=i.data,o?(this.logger.debug(H.L_REALTIME_LOG_O,"compress done",t),u=Rt(n)?n:"https://".concat(n),u+="?version=".concat("5.24.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:s,method:"POST"})]):(this.logger.warn(H.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:r}]);case 2:if(l=a.sent(),c=l.status,d=l.data,this.logger.debug(H.L_REALTIME_LOG_R,JSON.stringify({status:c,data:d}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,[2,{isOk:!1,itv:r}];if(this.reportFailedNumber=0,d)try{(h=JSON.parse(d)).nextTime&&(r=h.nextTime),f=h.level,p=h.logSwitch}catch(e){this.logger.warn(H.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:r,level:f,logSwitch:p}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,c,d,f,p,h,g,_,b=this;return a(this,(function(a){switch(a.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||ft,s=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),this.logger.debug(H.L_REALTIME_LOG_T,JSON.stringify({startTime:o,endTime:s,level:t,itv:n}),c),[4,this._getLogs(o,s,t,!0,c,r)];case 1:return 0!==(d=a.sent().logs).length?[3,2]:(this.logger.debug(H.L_REALTIME_LOG_R,"no logs",c),[3,4]);case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,n)]:[3,4];case 3:f=a.sent(),p=f.itv,h=f.level,g=f.logSwitch,f.isOk&&(_=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(_+1),0===g&&(this.started=!1),void 0!==h&&(t=h)),n=p,a.label=4;case 4:return this.started&&(n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return b.realtimeReport(e,t,n,r)}),1e3*n)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,f,p,h,g;return a(this,(function(a){switch(a.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(H.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:s,isCloudControl:u}),o),[4,this._getLogs(e,t,Kn.DEBUG,!1,o)]);case 1:return l=a.sent().logs,this.logger.info(H.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=Rt(r)?r:"https://".concat(r),c+="?version=".concat("5.24.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return f=a.sent(),p=f.success,h=f.data,d=p?h:"compress failed",[3,4];case 3:d="no data or no database",a.label=4;case 4:return this.logger.debug(H.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return g=a.sent().status,this.logger.info(H.L_REPORT_FULL_LOG_R,JSON.stringify({status:g}),o),[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}(),er=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,a=e.tag,s=e.type,u=e.content;pt(u)||(u=JSON.stringify(u));var l=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(s,",").concat(n,",").concat(a,",").concat(l,"\n")};function tr(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 nr(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))}function rr(){}var ir=function(){function e(){zn.set(this,nr),Xn.set(this,rr)}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,c(this,zn,"f").call(this,e,t,n,r,i)];case 1:return(o=a.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(tr)}]:[2,{logs:[]}];case 2:return s=a.sent(),console.warn("[LogDBProxy] read error",s),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(tr(e))try{c(this,Xn,"f").call(this,e)}catch(e){console.warn("[LogDBProxy] write error",e)}else console.warn("[LogDBProxy] invalid log data")}}),Object.defineProperty(e.prototype,"setLogReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,zn,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,Xn,e,"f"),this}}),e}();function or(){return new ir}zn=new WeakMap,Xn=new WeakMap;var ar,sr=function(){function e(){}var t,n,r,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",n)||(d(this,t,e,"f",n),e.info(H.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",n)&&(c(this,t,"f",n).info(H.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",n),c(this,t,"f",r)&&(clearTimeout(c(this,t,"f",r)),d(this,t,null,"f",r)))}}),t=e,a=function e(){var a=this,s=Date.now();d(this,t,setTimeout((function(){var r=Date.now()-s;r>=c(a,t,"f",o)&&c(a,t,"f",n).warn(H.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(r,"ms")),c(a,t,"m",e).call(a)}),c(this,t,"f",i)),"f",r)},n={value:null},r={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(ar||(ar={}));var ur=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,n,r,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(a,s,u,l,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 lr,cr,dr,fr,pr=function(){function e(e,t,n){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:n}),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 ur(n)}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===ye.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))}}),Object.defineProperty(e.prototype,"dataHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,Ot(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,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return!this.isEable&&t===ar.init&&this.isExire()?(this.logger.info(H.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===ar.newWorkChange&&this.isOverclock()?(this.logger.info(H.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=un(e),this.lastRequestTime=(new Date).getTime(),i="".concat(r,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(o["RC-Token"]=n),s={platform:"web",version:"5.24.0",timestamp:this.timestamp},this.logger.record(Ee.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:i})),[4,this.httpRequest(i,Ue.POST,o,s)]);case 1:return u=a.sent(),l=u.code,c=u.data,this.logger.record(Ee.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===x.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(f=Wn.setAreaCode(d),this.logger.info(H.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:f,originAreaCode:Wn.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(p=Wn.getCloudControllerUrl(d))[0]?[2,this.request(p[0],ar.other)]:(this.logger.info(H.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))}}),Object.defineProperty(e.prototype,"_handleMrtrData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}),e}(),hr=function(e){return e===x.RC_CONN_REDIRECTED},gr=function(e){function n(t,n,r){var i=e.call(this)||this;return lr.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:n}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),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:""}),fr.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:Me.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:pe.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 t(n,e),Object.defineProperty(n.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(n.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(n.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===pe.DISCONNECTED&&e===pe.CONNECTING&&(this._doConnectReason=Ae.CONNECT,c(this,lr,"m",dr).call(this)),this._crtConnectionStatus===pe.CONNECTED&&e===pe.SUSPENDED&&(t===x.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ae.TIMEOUT:t===x.RC_CONN_REDIRECTED?this._doConnectReason=Ae.REDIRECTED:this._doConnectReason=Ae.RECONNECT),this._crtConnectionStatus===pe.CONNECTED){var n={bid:an(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,fr,"f"),cid:this.cid};this.logger.record(Ee.IM_CONNECTION_DURATION,JSON.stringify(n)),e===pe.SUSPENDED&&c(this,lr,"m",dr).call(this)}switch(this._crtConnectionStatus=e,e){case pe.CONNECTED:this.logger.info(H.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,lr,"m",cr).call(this).emit("onConnected",this._fromSuspend);break;case pe.CONNECTING:this.logger.warn(H.L_CONNECT_S,"status: ".concat(e)),c(this,lr,"m",cr).call(this).emit("onConnecting");break;case pe.SUSPENDED:this._fromSuspend=!0,this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),hr(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,lr,"m",cr).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,lr,"m",cr).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(n.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===pe.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var n={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(Ee.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e}}),Object.defineProperty(n.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(n.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===pe.CONNECTED?[2,vn(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.token=e,this.setConnectionStatus(pe.CONNECTING),[4,this.try2Connect(e,t,!1,r,!0)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?(this.setConnectionStatus(pe.DISCONNECTED,o),[2,mn(o)]):(this.setConnectionStatus(pe.CONNECTED),[2,vn(s)])}}))}))}}),Object.defineProperty(n.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(n.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,f,p,h,g,_;return a(this,(function(a){switch(a.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(Ee.IM_STATS_CS,JSON.stringify(o)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,n,!1,r,s)];case 1:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,mn(l)]:1===(f=c).type?[2,mn(x.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(H.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this._connectWithToken(e.replace(/@.+$/,"@"),f,t,r)]);case 2:return p=a.sent(),h=p.code,g=p.data,i||h===x.SUCCESS||(this.retryCount+=1),hr(h)?(this.logger.warn(H.L_CONNECT_R,"redirect code: ".concat(h),r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r,i)]):[x.RC_TCP_RESET,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_DISCONNECTED_NO_RMTP,x.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),_=this.cmpWeightCache.every((function(e){return e.failed})),i&&_?(this.logger.warn(H.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(x.SERVER_UNAVAILABLE),r),[2,mn(x.SERVER_UNAVAILABLE)]):(this.logger.warn(H.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),r),this.setConnectionStatus(pe.SUSPENDED,h),this.setConnectionStatus(pe.CONNECTING),[2,this.createConnectionTask(e,t,!1,r,i)])):h!==x.SUCCESS?(this.logger.warn(H.L_CONNECT_R,"code: ".concat(h),r),[2,mn(h)]):(this.logger.info(H.L_CONNECT_R,"userId: ".concat(g),r),d(this,fr,Date.now(),"f"),this._crtUserId=g,[2,vn(g)])}}))}))}}),Object.defineProperty(n.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){return n=this.logger.createTraceId(),this.logger.debug(H.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),n),this.stopReconnectTimer(),r=function(){return o(i,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==pe.SUSPENDED?[2]:(this.setConnectionStatus(pe.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,n,!1)]);case 1:return i=o.sent().code,this.reconnectTimer=null,i===x.SUCCESS?(this.setConnectionStatus(pe.CONNECTED),[2]):[x.SERVER_UNAVAILABLE,x.TIMEOUT,x.RC_SOCKET_DISCONNECTED,x.RC_SOCKET_NOT_CREATED,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_RESET,x.RC_NAVI_REQ_FAILED,x.RC_NETWORK_DOWN,x.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?(this._crtConnectionStatus!==pe.CONNECTING||(this.setConnectionStatus(pe.SUSPENDED,i),this.reconnectTimer=setTimeout(r,5e3)),[2]):(this.setConnectionStatus(pe.DISCONNECTED,i),[2])}}))}))},r(),[2]}))}))}}),Object.defineProperty(n.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return hr(e)?(this.setConnectionStatus(pe.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===x.RC_UDP_DISCONNECTED?(this.setConnectionStatus(pe.SUSPENDED,e),void setTimeout((function(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(pe.DISCONNECTED,e)}}),Object.defineProperty(n.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(pe.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(n.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==pe.CONNECTED?(this._failedCount=0,this.logger.debug(H.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(H.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===x.SUCCESS?(this.logger.debug(H.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==pe.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(H.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(H.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return r.sent(),this.setConnectionStatus(pe.SUSPENDED,x.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,x.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(n.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.setConnectionStatus(pe.DISCONNECTED,x.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(n.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(n.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return l([],u(this.cmpWeightCache),!1);var n=xt(e,t);return this.cmpWeightCache=l([],u(n),!1),l([],u(n),!1)}}),Object.defineProperty(n.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===q.QUIC:t.addr===e}));if(r)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==i&&(r.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==o&&(r.weight=o-1),r.failed=!0}}}}),Object.defineProperty(n.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(n.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){this.token=e,this._openCallPlus=n,this.onDisconenctUnusual(r)}}),n}(pn);fr=new WeakMap,lr=new WeakSet,cr=function(){return this},dr=function(){this.uuid=ct.gen(),this.retryCount=0};var _r=function(e){return e.replace(/@.+$/,"@")},br=function(){function e(e,t,n,r,i,o){void 0===r&&(r=!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:n}),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: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,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,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,n,r,i){var s;return o(this,void 0,void 0,(function(){var o,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I,T;return a(this,(function(a){switch(a.label){case 0:return o=_r(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,n||Date.now()-l<Ge)?(this.logger.info(H.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),r),i&&(d=i.uuid,f=i.retryCount,p=i.reason,h={bid:an(),ptc:Re.NAVI,cod:x.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(s=c.type)&&void 0!==s?s:0,hos:"",cache:Oe.LOCAL,v:Se.CURRENT,rsn:p,cid:"".concat(d,"_").concat(f),count:f},this.logger.record(Ee.IM_NAVI,JSON.stringify(h),r)),[2,vn(c)]):(g=Wn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(H.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),r),[4,this.requestHandler(g,e,r,i)]);case 1:return _=a.sent(),b=_.code,E=_.data,b===x.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(v=a.sent())?void 0:v.navi)&&(null==v?void 0:v.navi.length)>0?(m=v.navi,[4,this.requestHandler(m,e,r,i)]):[3,4];case 3:y=a.sent(),b=y.code,E=y.data,a.label=4;case 4:return b!==x.SUCCESS?(this.logger.warn(H.L_GET_NAVI_R,b,r),[2,mn(b)]):(I=E).code&&200!==I.code?(this.logger.warn(H.L_GET_NAVI_R,I.code,r),[2,mn(this.transHttpCode(I.code))]):xt(I).length>0?(this.logger.info(H.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),r),this.setNaviCache(o,I),[2,vn(I)]):(T={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(H.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(T)),r),[2,mn(x.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:i=0,o=e.length,a.label=1;case 1:return i<o?(s=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,n,s)]):[3,4];case 2:if(c=a.sent(),d=c.code,f=c.data,p={bid:an(),ptc:Re.NAVI,cod:d,net:null==r?void 0:r.type,dur:Date.now()-l,spr:0,pr:(null==f?void 0:f.type)||0,hos:e[i],cache:Oe.REQUEST,v:Se.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(Ee.IM_NAVI,JSON.stringify(p),n),[x.SUCCESS,x.RC_CONN_TOKEN_INCORRECT,x.RC_LICENSE_EXPIRED].includes(d))return[2,d===x.SUCCESS?vn(f):mn(d)];a.label=3;case 3:return i+=1,[3,1];case 4:return[2,mn(x.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 x.RC_CONN_TOKEN_INCORRECT;case 416:return x.RC_LICENSE_EXPIRED;default:return x.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(_r(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(_r(e),r(r({},n),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.uri,r=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(n,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(r),"&v=").concat(xe,"&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}(),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}],["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 vr(e){return Er.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function mr(e){return Er.has(e)}var yr,Ir,Tr,Rr={TIMESTAMP:0,TOP:1,BLOCKED:2,UNREAD:3,ALL:4,PAGE_INDEX:5},Or=function(e,t){var n=yn.create(e).isObject("filter",t,!0).fail(x.CONVER_GET_ERROR,"filter must be an object").isValueOf("type",t.type,Rr,!0).fail(x.CONVER_GET_ERROR,"filter type invalid"),r=t.type,i=t.params;switch(r){case Rr.TIMESTAMP:!function(e,t){e.isObject("params",t,!0).fail(x.CONVER_GET_ERROR,"filter's params must be an object").isInteger("startTime",null==t?void 0:t.startTime,!0).fail(x.INVALID_PARAMETER_START_TIME).isInteger("count",null==t?void 0:t.count,!0).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(x.INVALID_PARAMETER_ORDER).validate("channelId",null==t?void 0:t.channelId,At).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return $(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(n,i);break;case Rr.BLOCKED:break;case Rr.TOP:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return $(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",null==t?void 0:t.channelId,At).fail(x.INVALID_PARAMETER_CHANNEL_ID)}(n,i);break;case Rr.UNREAD:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return $(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(n,i);break;case Rr.ALL:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").validate("channelId",null==t?void 0:t.channelId,At).fail(x.INVALID_PARAMETER_CHANNEL_ID)}(n,i);break;case Rr.PAGE_INDEX:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").isInteger("index",null==t?void 0:t.index,!0).fail(x.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",null==t?void 0:t.limit,!0).fail(x.INVALID_PARAMETER_LIMIT).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return $(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(n,i)}return n.result()},Sr={MECHANICAL:0,INTELLIGENT:1},Cr=function(){function e(e,t,n,r){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=n,this.text=r}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}(),Ar=function(e){function n(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(n,e),n}(Cr),Pr=function(e){function n(t,n,r){return e.call(this,kn(t),n,r,t)||this}return t(n,e),n}(Cr),Nr={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},wr={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Lr=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},Mr=function(){function e(e){yr.add(this),Ir.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,Ir,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,yr,"m",Tr).call(this,e,c(this,Ir,"f"))]}))}))}}),e}();Ir=new WeakMap,yr=new WeakSet,Tr=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,mn(x.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(r=t.shift(),i=un(r.addr,r.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.24.0","&platform=Websocket&messageUID=").concat(n.msgUId),this._logger.info(H.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,n)]);case 1:return[2,(s=l.sent()).or((function(r){return o(u,void 0,void 0,(function(){return a(this,(function(i){return-1===r?[2,c(this,yr,"m",e).call(this,t,n)]:[2,s]}))}))}))]}}))}))};var Ur=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){return n=On(),r=n.resolve,i=n.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){s._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),r(mn(-1,"timeout"))},o.onreadystatechange=function(n){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),a=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&a){r(vn());var u=0;o.onprogress=function(e){var n=o.response.slice(u);u=o.response.length,t.onRawContent(n)},o.onerror=function(n){s._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(x.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);r(mn(e.code,e.message))}}},o.onerror=function(t){s._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),r(mn(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send(),[2,i]}))}))}}),n}(Mr),Dr=Lr();var Vr=null,jr=function(e){return o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,kr.getNetworkType()];case 1:return t=n.sent(),Vr({status:"online"===e.type,type:t}),[2]}}))}))};var Gr,kr={tag:"browser",httpReq:function(e){return Fn(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Dr,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:Me.UNKONWN},t=e.type,n=e.effectiveType,r=t||n||Me.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Vr=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",jr),window.addEventListener("online",jr))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",jr),window.removeEventListener("online",jr)),Vr=null},createSSEClient:function(e){return vn(new Ur(e))},getApiVer:function(){var e=kr.runtimeInfo,t=e.type,n=e.version;return"|".concat(t,"|").concat(n)},get runtimeInfo(){var e,t,n=navigator.userAgent,r={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in r)if(r.hasOwnProperty(i)){var o=n.match(r[i]);if(o){t=i,e=o[1]||o[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgS=2]="ppMsgS",e[e.pgMsgS=3]="pgMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.prMsgS=7]="prMsgS",e[e.pbMsgP=8]="pbMsgP",e[e.qryPMsg=9]="qryPMsg",e[e.qryGMsg=10]="qryGMsg",e[e.qryCHMsg=11]="qryCHMsg",e[e.qryCMsg=12]="qryCMsg",e[e.qrySMsg=13]="qrySMsg",e[e.qryMCMsg=14]="qryMCMsg",e[e.qryMPMsg=15]="qryMPMsg",e[e.recallMsg=16]="recallMsg",e[e.rrMsg=17]="rrMsg",e[e.rrList=18]="rrList",e[e.s_ntf=19]="s_ntf",e[e.s_msg=20]="s_msg",e[e.s_stat=21]="s_stat",e[e.s_cmd=22]="s_cmd",e[e.s_us=23]="s_us",e[e.transLan=24]="transLan",e[e.autoTrans=25]="autoTrans",e[e.pullUS=26]="pullUS",e[e.sendMsgRead=27]="sendMsgRead",e[e.qryMsgRead=28]="qryMsgRead",e[e.qryMsgReadCntBatch=29]="qryMsgReadCntBatch",e[e.updRTime=30]="updRTime",e[e.chatMsgS=31]="chatMsgS",e[e.qrySessionsAtt=32]="qrySessionsAtt",e[e.pullMsg=33]="pullMsg",e[e.qrySessions=34]="qrySessions",e[e.delSessions=35]="delSessions",e[e.delMsg=36]="delMsg",e[e.delUgMsg=37]="delUgMsg",e[e.delUgSe=38]="delUgSe",e[e.updRRTime=39]="updRRTime",e[e.qrySessionsUnread=40]="qrySessionsUnread",e[e.setTypeUnpush=41]="setTypeUnpush",e[e.chrmPull=42]="chrmPull",e[e.joinChrm=43]="joinChrm",e[e.joinChrmR=44]="joinChrmR",e[e.exitChrm=45]="exitChrm",e[e.queryChrmI=46]="queryChrmI",e[e.setKV=47]="setKV",e[e.delKV=48]="delKV",e[e.setKVS=49]="setKVS",e[e.delKVS=50]="delKVS",e[e.pullKV=51]="pullKV",e[e.qryRelation=52]="qryRelation",e[e.qryRelationR=53]="qryRelationR",e[e.delRelation=54]="delRelation",e[e.delRelationBatch=55]="delRelationBatch",e[e.pullSeAtts=56]="pullSeAtts",e[e.setSeAtt=57]="setSeAtt",e[e.qnTkn=58]="qnTkn",e[e.qnUrl=59]="qnUrl",e[e.aliUrl=60]="aliUrl",e[e.s3Url=61]="s3Url",e[e.stcUrl=62]="stcUrl",e[e.minioUrl=63]="minioUrl",e[e.cleanPMsg=64]="cleanPMsg",e[e.cleanGMsg=65]="cleanGMsg",e[e.cleanCMsg=66]="cleanCMsg",e[e.cleanSMsg=67]="cleanSMsg",e[e.cleanMCMsg=68]="cleanMCMsg",e[e.cleanMPMsg=69]="cleanMPMsg",e[e.cleanMsgBatch=70]="cleanMsgBatch",e[e.rtcPing=71]="rtcPing",e[e.rtc_ntf=72]="rtc_ntf",e[e.rtcSetOutData=73]="rtcSetOutData",e[e.rtcQryUserOutData=74]="rtcQryUserOutData",e[e.addSeTag=75]="addSeTag",e[e.delSeTag=76]="delSeTag",e[e.addTag=77]="addTag",e[e.delTag=78]="delTag",e[e.reportsdk=79]="reportsdk",e[e.pullUgSes=80]="pullUgSes",e[e.pullUgMsg=81]="pullUgMsg",e[e.ugMsg=82]="ugMsg",e[e.qryUgMsg=83]="qryUgMsg",e[e.updUgRTime=84]="updUgRTime",e[e.upMsgEx=85]="upMsgEx",e[e.modifyMsg=86]="modifyMsg",e[e.qryMsgChange=87]="qryMsgChange",e[e.qryMsg=88]="qryMsg",e[e.operate=89]="operate",e[e.s_opNtf=90]="s_opNtf",e[e.ugUnpushQuery=91]="ugUnpushQuery",e[e.ugUnpushSet=92]="ugUnpushSet",e[e.setRtcRoomId=93]="setRtcRoomId",e[e.qryUgUal=94]="qryUgUal",e[e.updUserSub=95]="updUserSub",e[e.pullUserSub=96]="pullUserSub",e[e.pullSubData=97]="pullSubData",e[e.qrySubData=98]="qrySubData",e[e.pullUserProfile=99]="pullUserProfile",e[e.pullOwnProfile=100]="pullOwnProfile",e[e.updProfilePermiss=101]="updProfilePermiss",e[e.qProfilePermiss=102]="qProfilePermiss",e[e.searchUserProfile=103]="searchUserProfile",e[e.updUserProfile=104]="updUserProfile",e[e.pullEventChange=105]="pullEventChange",e[e.channelCreate=106]="channelCreate",e[e.upChannelInfo=107]="upChannelInfo",e[e.qChannelInfo=108]="qChannelInfo",e[e.channelMemKick=109]="channelMemKick",e[e.channelMemQuit=110]="channelMemQuit",e[e.channelDismiss=111]="channelDismiss",e[e.channelTransfer=112]="channelTransfer",e[e.upChannelManager=113]="upChannelManager",e[e.qChannelMem=114]="qChannelMem",e[e.qChannelSpeMem=115]="qChannelSpeMem",e[e.upChannelMem=116]="upChannelMem",e[e.channelMemJoin=117]="channelMemJoin",e[e.channelMemInvite=118]="channelMemInvite",e[e.channelApplyResp=119]="channelApplyResp",e[e.qChannelApplyList=120]="qChannelApplyList",e[e.qChannelMemJoin=121]="qChannelMemJoin",e[e.qChannelMemSpeJoin=122]="qChannelMemSpeJoin",e[e.upChannelRemark=123]="upChannelRemark",e[e.qChannelRemark=124]="qChannelRemark",e[e.upChannelFollow=125]="upChannelFollow",e[e.qChannelFollow=126]="qChannelFollow",e[e.qSimpleUserProfile=127]="qSimpleUserProfile",e[e.friendAdd=128]="friendAdd",e[e.friendDel=129]="friendDel",e[e.friendHandle=130]="friendHandle",e[e.friendSetPf=131]="friendSetPf",e[e.friendCheck=132]="friendCheck",e[e.friendsQuery=133]="friendsQuery",e[e.friendApplyDel=134]="friendApplyDel",e[e.friendsInfoQry=135]="friendsInfoQry",e[e.friendAuthSet=136]="friendAuthSet",e[e.friendAuthGet=137]="friendAuthGet",e[e.addUnpush=138]="addUnpush",e[e.qryUnpush=139]="qryUnpush",e[e.delUnpush=140]="delUnpush",e[e.s_pubCall=141]="s_pubCall",e[e.reqCall=142]="reqCall",e[e.pullKvMsg=143]="pullKvMsg",e[e.readReceipt=144]="readReceipt",e[e.qryReceipt=145]="qryReceipt",e[e.qryReceiptBatch=146]="qryReceiptBatch",e[e.upConvertMsg=147]="upConvertMsg"}(Gr||(Gr={}));var Fr,xr,Br,Hr=function(e){var t=Gr[e];return t},qr=function(e){return Gr[e]};!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(Fr||(Fr={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.PING=12]="PING",e[e.PONG=13]="PONG",e[e.DISCONNECT=14]="DISCONNECT",e[e.PCONNECT=8]="PCONNECT",e[e.PCONNECT_ACK=9]="PCONNECT_ACK",e[e.RESERVED=10]="RESERVED",e[e.RESERVED_2=11]="RESERVED_2",e[e.RESERVED_3=15]="RESERVED_3"}(xr||(xr={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(Br||(Br={}));var Yr="rtcRJoin_data",Kr="rtcRExit",Qr="rtcRInfo",Wr="rtcUData",Jr="rtcUPut",zr="rtcUDel",Xr="rtcSetData",Zr="userSetData",$r="rtcQryData",ei="rtcDelData",ti="rtcToken",ni="rtcUserState",ri="rtcUList",ii="viewerJoinR",oi="viewerExitR",ai="rtcPullKv",si="rtcIdentityChange",ui="rtcInvite",li="rtcCancelInvite",ci="rtcInviteAnswer",di="rtcEndInvite",fi="rtcQueryJoined",pi=0,hi=1,gi=2,_i=3,bi=4,Ei=5,vi=6,mi=7,yi=8,Ii=9,Ti=10,Ri=11,Oi=12,Si=13,Ci=14,Ai=15,Pi=16,Ni=17,wi=18,Li=19,Mi=20,Ui=1,Di=2,Vi=4,ji=5,Gi=6,ki=7,Fi=8,xi=9,Bi=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var n=this._getBackAndByteSize(e),r=n.back,i=n.byteSize,o=0,a=r.length;o<a;o++)r[o]>255&&(r[o]&=255);return t?r:i<=255?[0,i].concat(r):[i>>8,255&i].concat(r)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],n=0;if("string"==typeof e)for(var r=0,i=e.length;r<i;r++){var o=e.charCodeAt(r);o>=0&&o<=127?(n+=1,t.push(o)):o>=128&&o<=2047?(n+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(n+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:n,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,n,r=[],i=-1,o=e,a="";++i<o.length;){var s=Number(o[i]);if(s===(127&s)||(240&~s?224&~s?192&~s||(s=(s^=192)<<6|128^o[++i]):s=(s=(s^=224)<<6|128^o[++i])<<6|128^o[++i]:s=(s=(s=(s^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(s)||s<0||s>1114111||Math.floor(s)!==s)throw RangeError("Invalid code point: ".concat(s));s<=65535?r.push(s):(t=(s-=65536)>>10|55296,n=s%1024|56320,r.push(t,n)),(i+1===o.length||r.length>16384)&&(a+=String.fromCharCode.apply(null,r),r.length=0)}return a}}),e}(),Hi=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var n=this._pool.subarray(t,this._position);return Bi.readUTF(n)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),qi=function(){function e(){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"writeByte",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))}}),Object.defineProperty(e.prototype,"writeBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(l([],u(new Int8Array(e)),!1))}}),Object.defineProperty(e.prototype,"writeArr",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(e)}}),Object.defineProperty(e.prototype,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Bi.writeUTF(e);this._pool=this._pool.concat(t)}}),Object.defineProperty(e.prototype,"getBytesArray",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool}}),e}(),Yi=function(){function e(e,t,n,r,i){void 0===t&&(t=Fr.AT_LEAST_ONCE),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_dup",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:i})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4&15,(6&t)>>1,(1&t)>0,(8&t)>0,!(8&~t))}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0}}),e}(),Ki=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.readMessage(e,t,n)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return{stream:e,length:t}}}),e}(),Qi=function(){function e(e){Object.defineProperty(this,"_header",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._header=new Yi(e,Fr.AT_MOST_ONCE)}return Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}}),Object.defineProperty(e.prototype,"setHeaderQos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._header.qos=e}}),Object.defineProperty(e.prototype,"getHeaderFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._header.encode()}}),Object.defineProperty(e.prototype,"getArrayBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new qi;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),Wi=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(e.readByte(),this.status=e.readByte(),t<=n.MESSAGE_LENGTH)return{stream:e,length:t};if(r===Br.V4){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}),Object.defineProperty(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(Ki),Ji=function(e){function n(t){var n=e.call(this,xr.DISCONNECT)||this;return Object.defineProperty(n,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),n}(Qi),zi=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}),Object.defineProperty(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(Ki),Xi=function(e){function n(){return e.call(this,xr.PING)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),n}(Qi),Zi=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n}(Ki),$i=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=256*e.readByte()+e.readByte();return this.messageId=parseInt(n.toString(),10),{stream:e,length:t}}}),n}(Ki),eo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.writeByte(r),e.writeByte(n)}}),n}(Qi),to=function(e){function n(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(n,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n.syncMsg=t.syncMsg,n}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,n),this.pbData=t.readAll(),{stream:t,length:n}}}),n}($i),no=function(e){function n(t,n,r,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof n?n:qr(n),o}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)}}),n}(eo),ro=function(e){function n(t,n,r){return e.call(this,xr.QUERY,t,r,n)||this}return t(n,e),n}(no),io=function(e){function n(t,n,r){return e.call(this,xr.PUBLISH,t,r,n)||this}return t(n,e),n}(no),oo=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:n}}}),n}($i),ao=function(e){function n(t){var n=e.call(this,xr.PUB_ACK)||this;return n.messageId=t,n}return t(n,e),n}(eo),so=function(e){function n(t){var n=e.call(this,xr.QUERY_CONFIRM)||this;return n.messageId=t,n}return t(n,e),n}(eo),uo=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:n}}}),n}($i),lo=function(e,t){var n=new Uint8Array(e),r=new Hi(n),i=r.readByte(),o=function(e){var t,n=e.command;switch(n){case xr.CONN_ACK:t=new Wi(e);break;case xr.PUBLISH:t=new to(e);break;case xr.PUB_ACK:t=new oo(e);break;case xr.QUERY_ACK:t=new uo(e);break;case xr.PONG:t=new Zi(e);break;case xr.DISCONNECT:t=new zi(e);break;default:console.error("No support for deserializing ".concat(n," messages"))}return t}(Yi.parse(i));return o&&o.read(r,n.length-1,t),o},co=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=On(),r=n.resolve,i=n.promise,o=this._logger,a=wx.request({url:e,enableChunked:!0,method:"GET",timeout:t.timeout,header:{"Content-Type":"application/json;charset=UTF-8","App-Key":t.appkey,Authorization:"Bearer ".concat(t.token)},success:function(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))r(vn());else{var n=JSON.parse(e.data),i=n.code,o=n.message;r(mn(i,o))}},fail:function(t){var n=t.errMsg,i=t.errno;o.warn(H.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:n,errno:i})),r(mn(-1,t.errMsg))},complete:function(){o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return a.onChunkReceived((function(e){var n=Bi.readUTF(new Uint8Array(e.data));o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(n)),t.onRawContent(n)})),i}}),n}(Mr),fo=Lr(),po=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},ho={setItem:po("setStorageSync"),getItem:po("getStorageSync"),removeItem:po("removeStorageSync"),clear:po("clearStorageSync")},go=null,_o=function(e){var t=e.isConnected,n=e.networkType;go({status:t,type:n})};var bo={tag:"wechat",httpReq:function(e){var t=e.method||Ue.GET,n=e.timeout||ke,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){wx.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:ho,sessionStorage:ho,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:fo,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Me.UNKONWN)}})}))},setNetworkStatusListener:function(e){go=e,wx.onNetworkStatusChange(_o)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(_o),go=null},createSSEClient:function(e){return vn(new co(e))},get runtimeInfo(){return{type:bo.tag,version:"Unknown"}}},Eo=Lr(),vo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},mo={setItem:vo("setStorageSync"),getItem:vo("getStorageSync"),removeItem:vo("removeStorageSync"),clear:vo("clearStorageSync")},yo=null,Io=function(e){var t=e.isConnected,n=e.networkType;yo({status:t,type:n})};var To={tag:"alipay",httpReq:function(e){var t=e.method||Ue.GET,n=e.timeout||ke,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:a,method:t,headers:r,timeout:n,data:o,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:mo,sessionStorage:mo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Eo,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Me.UNKONWN)}})}))},setNetworkStatusListener:function(e){yo=e,my.onNetworkStatusChange(Io)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Io),yo=null},createSSEClient:function(e){return mn(x.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:To.tag,version:"Unknown"}}},Ro=Lr(),Oo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},So={setItem:Oo("setStorageSync"),getItem:Oo("getStorageSync"),removeItem:Oo("removeStorageSync"),clear:Oo("clearStorageSync")},Co=null,Ao=function(e){var t=e.isConnected,n=e.networkType;Co({status:t,type:n})};var Po={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ro,localStorage:So,sessionStorage:So,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Me.UNKONWN)}})}))},setNetworkStatusListener:function(e){Co=e,tt.onNetworkStatusChange(Ao)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Ao),Co=null},createSSEClient:function(e){return mn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Po.tag,version:"Unknown"}}},No=Lr(),wo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},Lo={setItem:wo("setStorageSync"),getItem:wo("getStorageSync"),removeItem:wo("removeStorageSync"),clear:wo("clearStorageSync")},Mo=null,Uo=function(e){var t=e.isConnected,n=e.networkType;Mo({status:t,type:n})};var Do={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:No,localStorage:Lo,sessionStorage:Lo,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Me.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Mo=e,swan.onNetworkStatusChange(Uo)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Uo),Mo=null},createSSEClient:function(e){return mn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Do.tag,version:"Unknown"}}},Vo=Lr(),jo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Go={setItem:jo("setStorageSync"),getItem:jo("getStorageSync"),removeItem:jo("removeStorageSync"),clear:jo("clearStorageSync")},ko=null,Fo=function(e){var t=e.isConnected,n=e.networkType;ko({status:t,type:n})};var xo={tag:"jingdong",httpReq:function(e){var t=e.method||Ue.GET,n=e.timeout||ke,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){jd.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:Go,sessionStorage:Go,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Vo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Me.UNKONWN)}})}))},setNetworkStatusListener:function(e){ko=e,jd.onNetworkStatusChange(Fo)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Fo),ko=null},createSSEClient:function(e){return mn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:xo.tag,version:"Unknown"}}},Bo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Ho={setItem:Bo("setStorageSync"),getItem:Bo("getStorageSync"),removeItem:Bo("removeStorageSync"),clear:Bo("clearStorageSync")},qo=null,Yo=function(e){var t=e.isConnected,n=e.networkType;qo({status:t,type:n})};var Ko,Qo,Wo={tag:"uniapp",httpReq:function(e){var t=e.method||Ue.GET,n=e.timeout||ke,r=e.headers,i=e.query,o=e.body,a=zt(e.url,i);return new Promise((function(e){uni.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ho,sessionStorage:Ho,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,n=e.osName;return["app","app-plus"].includes(t)&&n||""},isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Me.UNKONWN)}})}))},setNetworkStatusListener:function(e){qo=e,uni.onNetworkStatusChange(Yo)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Yo),qo=null},createSSEClient:function(e){return mn(x.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,n=e.deviceModel,r=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(r||"","|").concat(n||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:Wo.tag,version:"Unknown"}}},Jo=function(e){return e&&e.request&&e.getSystemInfo},zo="undefined"!=typeof uni&&Jo(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return Wo;case"mp-jd":return xo;case"mp-baidu":return Do;case"mp-toutiao":return Po;case"mp-alipay":return To;case"mp-weixin":return bo;default:return kr}}():"undefined"!=typeof jd&&Jo(jd)?xo:"undefined"!=typeof my&&Jo(my)?To:"undefined"!=typeof tt&&Jo(tt)?Po:"undefined"!=typeof swan&&Jo(swan)?Do:"undefined"!=typeof wx&&Jo(wx)?bo:kr;function Xo(e){var t=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,o;return t?(o=(e>>>=0)>=0&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=n),n):(o=(e|=0)>=-128&&e<128)&&(r=s[e])?r:(n=i(e,e<0?-1:0,!1),o&&(s[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=d)return m}else{if(-f>=e)return y;if(e+1>=f)return v}return e<0?r(-e,t).neg():i(0|e%c,0|e/c,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){var i,a,s,u,c,d,f;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(a=r(l(n,8)),s=h,u=0;u<e.length;u+=8)c=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+c),n),c<8?(f=r(l(n,c)),s=s.mul(f).add(r(d))):s=(s=s.mul(a)).add(r(d));return s.unsigned=t,s}function a(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,s={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=i,l=Math.pow,e.fromString=o,e.fromValue=a,f=(d=(c=4294967296)*c)/2,p=n(16777216),h=n(0),e.ZERO=h,g=n(0,!0),e.UZERO=g,_=n(1),e.ONE=_,b=n(1,!0),e.UONE=b,E=n(-1),e.NEG_ONE=E,v=i(-1,2147483647,!1),e.MAX_VALUE=v,m=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=m,y=i(0,-2147483648,!1),e.MIN_VALUE=y,(I=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},I.toString=function(e){var t,n,i,o,a,s,u,c;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(y)?(t=r(e),i=(n=this.div(t)).mul(t).sub(this),n.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=r(l(e,6),this.unsigned),a=this,s="";;){if(u=a.div(o),c=(a.sub(u.mul(o)).toInt()>>>0).toString(e),(a=u).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return!(1&~this.low)},I.isEven=function(){return!(1&this.low)},I.equals=function(e){return t(e)||(e=a(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.compare=function(e){if(t(e)||(e=a(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(_)},I.neg=I.negate,I.add=function(e){var n,r,o,s,u,l,c,d,f,p,h;return t(e)||(e=a(e)),n=this.high>>>16,r=65535&this.high,o=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,c=e.low>>>16,d=0,f=0,p=0,h=0,p+=(h+=s+(65535&e.low))>>>16,f+=(p+=o+c)>>>16,d+=(f+=r+l)>>>16,d+=n+u,i((p&=65535)<<16|(h&=65535),(d&=65535)<<16|(f&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=a(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){var n,o,s,u,l,c,d,f,g,_,b,E;return this.isZero()?h:(t(e)||(e=a(e)),e.isZero()?h:this.eq(y)?e.isOdd()?y:h:e.eq(y)?this.isOdd()?y:h:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(p)&&e.lt(p)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,o=65535&this.high,s=this.low>>>16,u=65535&this.low,l=e.high>>>16,c=65535&e.high,d=e.low>>>16,g=0,_=0,b=0,E=0,b+=(E+=u*(f=65535&e.low))>>>16,_+=(b+=s*f)>>>16,b&=65535,_+=(b+=u*d)>>>16,g+=(_+=o*f)>>>16,_&=65535,g+=(_+=s*d)>>>16,_&=65535,g+=(_+=u*c)>>>16,g+=n*f+o*d+s*c+u*l,i((b&=65535)<<16|(E&=65535),(g&=65535)<<16|(_&=65535),this.unsigned)))},I.mul=I.multiply,I.divide=function(e){var n,i,o,s,u,c,d;if(t(e)||(e=a(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;o=g}else{if(this.eq(y))return e.eq(_)||e.eq(E)?y:e.eq(y)?_:(n=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?_:E:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(y))return this.unsigned?g:h;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=h}for(i=this;i.gte(e);){for(n=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(s=Math.ceil(Math.log(n)/Math.LN2))<=48?1:l(2,s-48),d=(c=r(n)).mul(e);d.isNegative()||d.gt(i);)d=(c=r(n-=u,this.unsigned)).mul(e);c.isZero()&&(c=_),o=o.add(c),i=i.sub(d)}return o},I.div=I.divide,I.modulo=function(e){return t(e)||(e=a(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return i(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=a(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=a(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=a(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(n=this.high,e<32?i(this.low>>>e|n<<32-e,n>>>e,this.unsigned):i(32===e?n:n>>>e-32,0,this.unsigned))},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},I.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),n=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+s.apply(String,e):(e.length+arguments.length>1024&&(t.push(s.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+p]=255&a,p+=h,a/=256,l-=8);e[n+p-h]|=128*g}var o,a,s,u,l,c=function(e,t,n){if(void 0===e&&(e=c.DEFAULT_CAPACITY),void 0===t&&(t=c.DEFAULT_ENDIAN),void 0===n&&(n=c.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?a:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};return c.VERSION="5.0.1",c.LITTLE_ENDIAN=!0,c.BIG_ENDIAN=!1,c.DEFAULT_CAPACITY=16,c.DEFAULT_ENDIAN=c.BIG_ENDIAN,c.DEFAULT_NOASSERT=!1,c.Long=e||null,(o=c.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),a=new ArrayBuffer(0),s=String.fromCharCode,c.accessor=function(){return Uint8Array},c.allocate=function(e,t,n){return new c(e,t,n)},c.concat=function(e,t,n,r){var i,o,a,s,u,l;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),i=0,a=0,s=e.length;s>a;++a)c.isByteBuffer(e[a])||(e[a]=c.wrap(e[a],t)),(o=e[a].limit-e[a].offset)>0&&(i+=o);if(0===i)return new c(0,n,r);for(l=new c(i,n,r),a=0;s>a;)(o=(u=e[a++]).limit-u.offset)<=0||(l.view.set(u.view.subarray(u.offset,u.limit),l.offset),l.offset+=o);return l.limit=l.offset,l.offset=0,l},c.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},c.type=function(){return ArrayBuffer},c.wrap=function(e,t,n,r){var i,a;if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return c.fromBase64(e,n);case"hex":return c.fromHex(e,n);case"binary":return c.fromBinary(e,n);case"utf8":return c.fromUTF8(e,n);case"debug":return c.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(c.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new c(0,n,r),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new c(0,n,r),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((i=new c(e.length,n,r)).limit=e.length,a=0;a<e.length;++a)i.view[a]=e[a]}return i},o.writeBitSet=function(e,t){var n,r,i,o,a,s,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(r=t,o=(i=e.length)>>3,a=0,t+=this.writeVarint32(i,t);o--;)n=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(n,t++);if(i>a){for(s=0,n=0;i>a;)n|=(1&!!e[a++])<<s++;this.writeByte(n,t++)}return u?(this.offset=t,this):t-r},o.readBitSet=function(e){var t,n,r,i,o,a,s,u=void 0===e;for(u&&(e=this.offset),i=(r=(n=this.readVarint32(e)).value)>>3,o=0,a=[],e+=n.length;i--;)t=this.readByte(e++),a[o++]=!!(1&t),a[o++]=!!(2&t),a[o++]=!!(4&t),a[o++]=!!(8&t),a[o++]=!!(16&t),a[o++]=!!(32&t),a[o++]=!!(64&t),a[o++]=!!(128&t);if(r>o)for(s=0,t=this.readByte(e++);r>o;)a[o++]=!!(1&t>>s++);return u&&(this.offset=e),a},o.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},o.writeBytes=o.append,o.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),!(32768&~t)&&(t=-(65535-t+1)),n&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),n&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,n&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),n&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),a&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),a&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},o.readDouble=o.readFloat64,c.MAX_VARINT32_BYTES=5,c.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},c.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},c.zigZagDecode32=function(e){return e>>>1^-(1&e)},o.writeVarint32=function(e,t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=r=c.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):r},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(c.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,n,r,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(128&t);return r|=0,o?(this.offset=e,r):{value:r,length:n}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=c.zigZagDecode32(t.value):t=c.zigZagDecode32(t),t},e&&(c.MAX_VARINT64_BYTES=10,c.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:i<128?9:10},c.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},c.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(t,n){var r,i,o,a,s,u=void 0===n;if(u&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=c.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,a=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(s=this.buffer.byteLength)&&this.resize((s*=2)>n?s:n),n-=r,r){case 10:this.view[n+9]=1&a>>>7;case 9:this.view[n+8]=9!==r?128|a:127&a;case 8:this.view[n+7]=8!==r?128|o>>>21:127&o>>>21;case 7:this.view[n+6]=7!==r?128|o>>>14:127&o>>>14;case 6:this.view[n+5]=6!==r?128|o>>>7:127&o>>>7;case 5:this.view[n+4]=5!==r?128|o:127&o;case 4:this.view[n+3]=4!==r?128|i>>>21:127&i>>>21;case 3:this.view[n+2]=3!==r?128|i>>>14:127&i>>>14;case 2:this.view[n+1]=2!==r?128|i>>>7:127&i>>>7;case 1:this.view[n]=1!==r?128|i:127&i}return u?(this.offset+=r,this):r},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(c.zigZagEncode64(e),t)},o.readVarint64=function(t){var n,r,i,o,a,s,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(n=t,r=0,i=0,o=0,a=0,r=127&(a=this.view[t++]),128&a&&(r|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(r|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(r|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(i=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");return s=e.fromBits(r|i<<28,i>>>4|o<<24,!1),u?(this.offset=t,s):{value:s,length:t-n}},o.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=c.zigZagDecode64(n.value):n=c.zigZagDecode64(n),n}),o.writeCString=function(e,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;i>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=l.calculateUTF16asUTF8(t(e))[1],n+=i+1,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=i+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,a?(this.offset=n,this):i},o.readCString=function(e){var t,r,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,i=-1,l.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=n(),!0),o?(this.offset=e,r()):{string:r(),length:e-t}},o.writeIString=function(e,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return a?(this.offset=n,this):n-i},o.readIString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,n=this.readUint32(e),r=this.readUTF8String(n,c.METRICS_BYTES,e+=4),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},c.METRICS_CHARS="c",c.METRICS_BYTES="b",o.writeUTF8String=function(e,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=n,r=l.calculateUTF16asUTF8(t(e))[1],n+=r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=r,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),a?(this.offset=n,this):n-i},o.writeString=o.writeUTF8String,c.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},c.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},c.calculateString=c.calculateUTF8Bytes,o.readUTF8String=function(e,t,r){var i,o,a,s,u;if("number"==typeof t&&(r=t,t=void 0),(i=void 0===r)&&(r=this.offset),void 0===t&&(t=c.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(a=0,s=r,t===c.METRICS_CHARS){if(o=n(),l.decodeUTF8(function(){return e>a&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++a,l.UTF8toUTF16(e,o)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-s}}if(t===c.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(u=r+e,l.decodeUTF8toUTF16(function(){return u>r?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==u)throw RangeError("Illegal range: Truncated data, "+r+" == "+u);return i?(this.offset=r,o()):{string:o(),length:r-s}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,n){var r,i,o,a,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(o=n,r=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=c.calculateVarint32(r),n+=i+r,a=this.buffer.byteLength,n>a&&this.resize((a*=2)>n?a:n),n-=i+r,n+=this.writeVarint32(r,n),l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+r+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+i));return s?(this.offset=n,this):n-o},o.readVString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,n=this.readVarint32(e),r=this.readUTF8String(n.value,c.METRICS_BYTES,e+=n.length),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},o.append=function(e,t,n){var r,i,o;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((n+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>n?o:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i)),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new c(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},o.compact=function(e,t){var n,r,i;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(n=t-e)?(this.buffer=a,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(i=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this)},o.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new c(0,this.littleEndian,this.noAssert);var n=t-e,r=new c(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},o.copyTo=function(e,t,n,r){var i,o,a;if(!this.noAssert&&!c.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0===(a=r-n)?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=a),o&&(e.offset+=a),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},o.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(this.offset=t),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian=void 0===e||!!e,this},o.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},o.prepend=function(e,t,n){var r,i,o,a,s;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-n)>0?(a=new ArrayBuffer(this.buffer.byteLength+o),(s=new Uint8Array(a)).set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=a,this.view=s,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i)),this},o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(e){var t,n;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),this},o.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},o.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},o.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},o.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?a:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,n={},r=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[];for(e=0,t=r.length;t>e;++e)i[r[e]]=e;return n.encode=function(e,t){for(var n,i;null!==(n=e());)t(r[63&n>>2]),i=(3&n)<<4,null!==(n=e())?(t(r[63&((i|=15&n>>4)|15&n>>4)]),i=(15&n)<<2,null!==(n=e())?(t(r[63&(i|3&n>>6)]),t(r[63&n])):(t(r[63&i]),t(61))):(t(r[63&i]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,o,a;null!==(r=e());)if(void 0===(o=i[r])&&n(r),null!==(r=e())&&(void 0===(a=i[r])&&n(r),t(o<<2>>>0|(48&a)>>4),null!==(r=e()))){if(void 0===(o=i[r])){if(61===r)break;n(r)}if(t((15&a)<<4>>>0|(60&o)>>2),null!==(r=e())){if(void 0===(a=i[r])){if(61===r)break;n(r)}t((3&o)<<6>>>0|a)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),o.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},c.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new c(e.length/4*3,n),i=0;return u.decode(t(e),(function(e){r.view[i++]=e})),r.limit=i,r},c.btoa=function(e){return c.fromBinary(e).toBase64()},c.atob=function(e){return c.fromBase64(e).toBinary()},o.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},c.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new c(i,t);i>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},o.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",a="";r>n;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return e?a:i},c.fromDebug=function(e,t,n){for(var r,i,o=e.length,a=new c(0|(o+1)/3,t,n),s=0,u=0,l=!1,d=!1,f=!1,p=!1,h=!1;o>s;){switch(r=e.charAt(s++)){case"!":if(!n){if(d||f||p){h=!0;break}d=f=p=!0}a.offset=a.markedOffset=a.limit=u,l=!1;break;case"|":if(!n){if(d||p){h=!0;break}d=p=!0}a.offset=a.limit=u,l=!1;break;case"[":if(!n){if(d||f){h=!0;break}d=f=!0}a.offset=a.markedOffset=u,l=!1;break;case"<":if(!n){if(d){h=!0;break}d=!0}a.offset=u,l=!1;break;case"]":if(!n){if(p||f){h=!0;break}p=f=!0}a.limit=a.markedOffset=u,l=!1;break;case">":if(!n){if(p){h=!0;break}p=!0}a.limit=u,l=!1;break;case"'":if(!n){if(f){h=!0;break}f=!0}a.markedOffset=u,l=!1;break;case" ":l=!1;break;default:if(!n&&l){h=!0;break}if(i=parseInt(r+e.charAt(s++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[u++]=i,l=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+s)}if(!n){if(!d||!p)throw TypeError("Illegal str: Missing offset or limit");if(u<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+o)}return a},o.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},c.fromHex=function(e,t,n){var r,i,o,a,s;if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(i=e.length,o=new c(0|i/2,t),a=0,s=0;i>a;a+=2){if(r=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[s++]=r}return o.limit=s,o},l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,i,o,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&a([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&a([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&a([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),o.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},c.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new c(l.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return l.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},c}(t),r=function(t,n){var r,i,o={};return o.ByteBuffer=t,o.c=t,r=t,o.Long=n||null,o.VERSION="5.0.1",o.WIRE_TYPES={},o.WIRE_TYPES.VARINT=0,o.WIRE_TYPES.BITS64=1,o.WIRE_TYPES.LDELIM=2,o.WIRE_TYPES.STARTGROUP=3,o.WIRE_TYPES.ENDGROUP=4,o.WIRE_TYPES.BITS32=5,o.PACKABLE_WIRE_TYPES=[o.WIRE_TYPES.VARINT,o.WIRE_TYPES.BITS64,o.WIRE_TYPES.BITS32],o.TYPES={int32:{name:"int32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},uint64:{name:"uint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.UZERO:void 0},sint64:{name:"sint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},bool:{name:"bool",wireType:o.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:o.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:o.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.ZERO:void 0},float:{name:"float",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:o.WIRE_TYPES.STARTGROUP,defaultValue:null}},o.MAP_KEY_TYPES=[o.TYPES.int32,o.TYPES.sint32,o.TYPES.sfixed32,o.TYPES.uint32,o.TYPES.fixed32,o.TYPES.int64,o.TYPES.sint64,o.TYPES.sfixed64,o.TYPES.uint64,o.TYPES.fixed64,o.TYPES.bool,o.TYPES.string,o.TYPES.bytes],o.ID_MIN=1,o.ID_MAX=536870911,o.convertFieldsToCamelCase=!1,o.populateAccessors=!0,o.populateDefaults=!0,o.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),o.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},o.DotProto=function(e,t){function n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|i*r,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var o,a,s={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},l=u.prototype;return l._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},l.next=function(){var e,n,r,i,o;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(i=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;return('"'===(o=this.source.substring(this.index,this.index=i))||"'"===o)&&(this._stringOpen=o),o},l.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},l.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},l.omit=function(e){return this.peek()===e&&(this.next(),!0)},l.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},s.Tokenizer=u,o=function(e){this.tn=new u(e),this.proto3=!1},(a=o.prototype).parse=function(){var e,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},o.parse=function(e){return new o(e).parse()},a._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},a._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},a._parseOption=function(e,n){var r,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);r=i,o&&(this.tn.skip(")"),r="("+r+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(r+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},a._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},a._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},a._parseServiceRPC=function(e){var n,r,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(n=o,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(r.request=o,this.tn.skip(")"),"returns"!==(o=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+o);if(this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.response_stream=!0,o=this.tn.next()),r.response=o,this.tn.skip(")"),"{"===(o=this.tn.peek())){for(this.tn.next();"}"!==(o=this.tn.next());){if("option"!==o)throw Error("illegal rpc service token: "+o);this._parseOption(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][n]=r},a._parseMessage=function(e,r){var i=!!r,o=this.tn.next(),a={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(a.name=o,i&&(this.tn.skip("="),r.id=n(this.tn.next()),a.isGroup=!0),"["===(o=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(a,o);else if("oneof"===o)this._parseMessageOneOf(a);else if("enum"===o)this._parseEnum(a);else if("message"===o)this._parseMessage(a);else if("option"===o)this._parseOption(a);else if("service"===o)this._parseService(a);else if("extensions"===o)a.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(a);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(a,"optional",o)}return this.tn.omit(";"),e.messages.push(a),a},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,r,i){var o,a,s;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(o={rule:r,type:"",name:"",options:{},id:0},"map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field type: "+a);if(o.keytype=a,this.tn.skip(","),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field: "+a);if(o.type=a,this.tn.skip(">"),a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);o.name=a,this.tn.skip("="),o.id=n(this.tn.next()),"["===(a=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){if(s=this._parseMessage(e,o),!/^[A-Z]/.test(s.name))throw Error("illegal group name: "+s.name);o.type=s.name,o.name=s.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);o.name=a,this.tn.skip("="),o.id=n(this.tn.next()),"["===(a=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},a._parseMessageOneOf=function(e){var n,r,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(r=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(n=this._parseMessageField(e,"optional",o)).oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=i},a._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},a._parseEnum=function(e){var r,i={name:"",values:[],options:{}},o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal name: "+o);for(i.name=o,this.tn.skip("{");"}"!==(o=this.tn.next());)if("option"===o)this._parseOption(i);else{if(!t.NAME.test(o))throw Error("illegal name: "+o);this.tn.skip("="),r={name:o,id:n(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(r)}this.tn.omit(";"),e.enums.push(i)},a._parseExtensionRanges=function(){var t,n,i,o=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}o.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),o},a._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},a.toString=function(){return"Parser at line "+this.tn.line},s.Parser=o,s}(o,o.Lang),o.Reflect=function(e){function n(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,a=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(a,n);break;case e.WIRE_TYPES.ENDGROUP:if(a===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,a,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y={},I=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},T=I.prototype;return T.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},T.toString=function(e){return(e?this.className+" ":"")+this.fqn()},T.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},y.T=I,o=function(e,t,n,r,i){I.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},(a=o.prototype=Object.create(I.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},a.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof l.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof l.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},a.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},a.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,o=0;if(""===r[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof y.Namespace)){i=null;break}if(!((n=i.getChild(r[o]))&&n instanceof y.T&&(!t||n instanceof y.Namespace))){i=null;break}i=n,o++}while(o<r.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},a.qn=function(e){var t,n,r=[],i=e;do{r.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof y.Namespace))return n.join(".");return e.fqn()},a.build=function(){var e,t,n,r={},i=this.children;for(t=0,n=i.length;n>t;++t)(e=i[t])instanceof o&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},a.buildOpt=function(){var e,t,n,r,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)n=o[e],r=this.options[o[e]],i[n]=r;return i},a.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},y.Namespace=o,s=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=s.prototype,s.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new r(0):t.defaultValue},u.verifyValue=function(r){var i,o,a,s=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof r||r==r&&r%1!=0)&&s(typeof r,"not an integer"),r>4294967295?0|r:r;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof r||r==r&&r%1!=0)&&s(typeof r,"not an integer"),r<0?r>>>0:r;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return n(r,!1)}catch(e){s(typeof r,e.message)}else s(typeof r,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return n(r,!0)}catch(e){s(typeof r,e.message)}else s(typeof r,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof r&&s(typeof r,"not a boolean"),r;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof r&&s(typeof r,"not a number"),r;case e.TYPES.string:return"string"==typeof r||r&&r instanceof String||s(typeof r,"not a string"),""+r;case e.TYPES.bytes:return t.isByteBuffer(r)?r:t.wrap(r);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),a=0;a<i.length;a++){if(i[a].name==r)return i[a].id;if(i[a].id==r)return i[a].id}if("proto3"===this.syntax)return("number"!=typeof r||r==r&&r%1!=0)&&s(typeof r,"not an integer"),(r>4294967295||r<0)&&s(typeof r,"not in range for uint32"),r;s(r,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(r&&"object"==typeof r||s(typeof r,"object expected"),r instanceof this.resolvedType.clazz)return r;if(r instanceof e.Builder.Message){for(a in o={},r)r.hasOwnProperty(a)&&(o[a]=r[a]);r=o}return new this.resolvedType.clazz(r)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+r+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var i;switch(this.type){case e.TYPES.int32:return n<0?r.calculateVarint64(n):r.calculateVarint32(n);case e.TYPES.uint32:return r.calculateVarint32(n);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return r.calculateVarint64(n);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return i=r.calculateUTF8Bytes(n),r.calculateVarint32(i)+i;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return r.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(n),r.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(n))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},u.encodeValue=function(t,n,i){var o,a;if(null===n)return i;switch(this.type){case e.TYPES.int32:n<0?i.writeVarint64(n):i.writeVarint32(n);break;case e.TYPES.uint32:i.writeVarint32(n);break;case e.TYPES.sint32:i.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:i.writeUint32(n);break;case e.TYPES.sfixed32:i.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(n);break;case e.TYPES.sint64:i.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:i.writeUint64(n);break;case e.TYPES.sfixed64:i.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?i.writeVarint32("false"===n.toLowerCase()?0:!!n):i.writeVarint32(n?1:0);break;case e.TYPES.enum:i.writeVarint32(n);break;case e.TYPES.float:i.writeFloat32(n);break;case e.TYPES.double:i.writeFloat64(n);break;case e.TYPES.string:i.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");o=n.offset,i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:a=(new r).LE(),this.resolvedType.encode(n,a),i.writeVarint32(a.offset),i.append(a.flip());break;case e.TYPES.group:this.resolvedType.encode(n,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return i},u.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},y.Element=s,l=function(e,t,n,r,i,a){o.call(this,e,t,n,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(c=l.prototype=Object.create(o.prototype)).build=function(n){var i,o,a,s;if(this.clazz&&!n)return this.clazz;for(i=function(e,n){function i(t,n,o,a){var s,u,l,c,d,f,p;if(null===t||"object"!=typeof t)return a&&a instanceof e.Reflect.Enum&&null!==(s=e.Reflect.Enum.getName(a.object,t))?s:t;if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return o?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return u=[],t.forEach((function(e,t){u[t]=i(e,n,o,a)})),u;if(u={},t instanceof e.Map){for(c=(l=t.entries()).next();!c.done;c=l.next())u[t.keyElem.valueToString(c.value[0])]=i(c.value[1],n,o,t.valueElem.resolvedType);return u}for(p in d=t.$type,f=void 0,t)t.hasOwnProperty(p)&&(u[p]=d&&(f=d.getChild(p))?i(t[p],n,o,f.resolvedType):i(t[p],n,o));return u}var o,a,s=n.getChildren(e.Reflect.Message.Field),u=n.getChildren(e.Reflect.Message.OneOf),l=function(t){var i,o,a,c;for(e.Builder.Message.call(this),i=0,o=u.length;o>i;++i)this[u[i].name]=null;for(i=0,o=s.length;o>i;++i)this[(a=s[i]).name]=a.repeated?[]:a.map?new e.Map(a):null,!a.required&&"proto3"!==n.syntax||null===a.defaultValue||(this[a.name]=a.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===t||"object"!=typeof t||!("function"!=typeof t.encode||t instanceof l)||Array.isArray(t)||t instanceof e.Map||r.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(i=0,o=arguments.length;o>i;++i)void 0!==(c=arguments[i])&&this.$set(s[i].name,c);else this.$set(t)},c=l.prototype=Object.create(e.Builder.Message.prototype);for(c.add=function(t,r,i){var o=n._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},c.$add=c.add,c.set=function(t,r,i){var o,a,s;if(t&&"object"==typeof t){for(o in i=r,t)t.hasOwnProperty(o)&&void 0!==(r=t[o])&&this.$set(o,r,i);return this}if(a=n._fieldsByName[t],i)this[t]=r;else{if(!a)throw Error(this+"#"+t+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}return a&&a.oneof&&(s=this[a.oneof.name],null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===t&&(this[a.oneof.name]=null)),this},c.$set=c.set,c.get=function(t,r){if(r)return this[t];var i=n._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},c.$get=c.get,o=0;o<s.length;o++)(a=s[o])instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t,r,i,o=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));o=o.substring(0,1).toUpperCase()+o.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),r=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===n.getChild("set"+o)&&(c["set"+o]=r),null===n.getChild("set_"+t)&&(c["set_"+t]=r),null===n.getChild("get"+o)&&(c["get"+o]=i),null===n.getChild("get_"+t)&&(c["get_"+t]=i)}(a);return c.encode=function(e,r){var i,o;"boolean"==typeof e&&(r=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},l.encode=function(e,t,n){return new l(e).encode(t,n)},c.calculate=function(){return n.calculate(this)},c.encodeDelimited=function(e){var t,i=!1;return e||(e=new r,i=!0),t=(new r).LE(),n.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},c.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},c.toArrayBuffer=c.encodeAB,c.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},c.toBuffer=c.encodeNB,c.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},c.toBase64=c.encode64,c.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},c.toHex=c.encodeHex,c.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},c.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},l.decode=function(e,t){var i,o;"string"==typeof e&&(e=r.wrap(e,t||"base64")),i=(e=r.isByteBuffer(e)?e:r.wrap(e)).littleEndian;try{return o=n.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},l.decodeDelimited=function(e,t){var i,o,a;if("string"==typeof e&&(e=r.wrap(e,t||"base64")),(e=r.isByteBuffer(e)?e:r.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return a=n.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,a}catch(t){throw e.offset+=o,t}},l.decode64=function(e){return l.decode(e,"base64")},l.decodeHex=function(e){return l.decode(e,"hex")},l.decodeJSON=function(e){return new l(JSON.parse(e))},c.toString=function(){return n.toString()},Object.defineProperty&&(Object.defineProperty(l,"$options",{value:n.buildOpt()}),Object.defineProperty(c,"$options",{value:l.$options}),Object.defineProperty(l,"$type",{value:n}),Object.defineProperty(c,"$type",{value:n})),l}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},a=0,s=this.children.length;s>a;a++)if((o=this.children[a])instanceof g||o instanceof l||o instanceof E){if(i.hasOwnProperty(o.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+o.toString(!0)+" cannot override static property '"+o.name+"'");i[o.name]=o.build()}else if(o instanceof l.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof l.OneOf||o instanceof b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[a].toString(!0));return this.clazz=i},c.encode=function(e,t,n){var r,i,o,a,s,u=null;for(o=0,a=this._fields.length;a>o;++o)i=e[(r=this._fields[o]).name],r.required&&null===i?null===u&&(u=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==u)throw(s=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,s;return t},c.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;o>i;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},c.decode=function(t,n,r){var o,a,s,u,l,c,d,f,p,h,g,_;for(n="number"==typeof n?n:-1,l=t.offset,c=new this.clazz;t.offset<l+n||-1===n&&t.remaining()>0;){if(s=(o=t.readVarint32())>>>3,(a=7&o)===e.WIRE_TYPES.ENDGROUP){if(s!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[s])u.repeated&&!u.options.packed?c[u.name].push(u.decode(a,t)):u.map?(f=u.decode(a,t),c[u.name].set(f[0],f[1])):(c[u.name]=u.decode(a,t),u.oneof&&(null!==(p=c[u.oneof.name])&&p!==u.name&&(c[p]=null),c[u.oneof.name]=u.name));else switch(a){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:d=t.readVarint32(),t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;i(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+a)}}for(h=0,g=this._fields.length;g>h;++h)if(null===c[(u=this._fields[h]).name])if("proto3"===this.syntax)c[u.name]=u.defaultValue;else{if(u.required)throw(_=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=c,_;e.populateDefaults&&null!==u.defaultValue&&(c[u.name]=u.defaultValue)}return c},y.Message=l,d=function(t,n,r,i,o,a,s,u,c,d){I.call(this,t,n,a),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=s,this.options=u||{},this.defaultValue=null,this.oneof=c||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(f=d.prototype=Object.create(I.prototype)).build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=s.defaultFieldValue(this.type)},f.verifyValue=function(t,n){var r,i,o;if(n=n||!1,r=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){for(Array.isArray(t)||(t=[t]),o=[],i=0;i<t.length;i++)o.push(this.element.verifyValue(t[i]));return o}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},f.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},f.encode=function(t,n,i){var o,a,s,u,l;if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return n;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1),a=n.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);s=n.offset-a,(u=r.calculateVarint32(s))>1&&(l=n.slice(a,n.offset),a+=u-1,n.offset=a,n.append(l)),n.writeVarint32(s,a-u)}else for(o=0;o<t.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],n);else this.map?t.forEach((function(t,i){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(o),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,i)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return n},f.calculate=function(t,n){var i,o,a;if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;i=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),a=0,o=0;o<t.length;o++)a+=this.element.calculateLength(this.id,t[o]);i+=r.calculateVarint32(a),i+=a}else for(o=0;o<t.length;o++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,n){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=r.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,n)&&(i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},f.decode=function(t,n,r){var i,o,a,u,l,c,d;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(o=n.readVarint32(),o=n.offset+o,a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){if(u=s.defaultFieldValue(this.keyType),i=s.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());for((l=n.clone()).limit=l.offset+o,n.offset+=o;l.remaining()>0;)if(t=7&(c=l.readVarint32()),1===(d=c>>>3))u=this.keyElement.decode(l,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,d)}return[u,i]}return this.element.decode(n,t,this.id)},y.Message.Field=d,p=function(e,t,n,r,i,o,a){d.call(this,e,t,n,null,r,i,o,a),this.extension},p.prototype=Object.create(d.prototype),y.Message.ExtensionField=p,h=function(e,t,n){I.call(this,e,t,n),this.fields=[]},y.Message.OneOf=h,g=function(e,t,n,r,i){o.call(this,e,t,n,r,i),this.className="Enum",this.object=null},g.getName=function(e,t){var n,r,i=Object.keys(e);for(r=0;r<i.length;++r)if(e[n=i[r]]===t)return n;return null},(g.prototype=Object.create(o.prototype)).build=function(t){var n,r,i,o;if(this.object&&!t)return this.object;for(n=new e.Builder.Enum,i=0,o=(r=this.getChildren(g.Value)).length;o>i;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},y.Enum=g,_=function(e,t,n,r){I.call(this,e,t,n),this.className="Enum.Value",this.id=r},_.prototype=Object.create(I.prototype),y.Enum.Value=_,b=function(e,t,n,r){I.call(this,e,t,n),this.field=r},b.prototype=Object.create(I.prototype),y.Extension=b,E=function(e,t,n,r){o.call(this,e,t,n,r),this.className="Service",this.clazz=null},(E.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var n,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),a=t.getChildren(e.Reflect.Service.RPCMethod);for(n=0;n<a.length;n++)!function(e){o[e.name]=function(n,i){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(n)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,n,r){new i(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(a[n]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),i}(e,this)},y.Service=E,v=function(e,t,n,r){I.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},(v.prototype=Object.create(I.prototype)).buildOpt=a.buildOpt,y.Service.Method=v,m=function(e,t,n,r,i,o,a,s){v.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null},m.prototype=Object.create(v.prototype),y.Service.RPCMethod=m,y}(o),o.Builder=function(e,t,n){function r(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,r(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},o=i.prototype;return i.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},i.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},i.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},i.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},i.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var r,o,a,s,u;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(r=[t];r.length>0;){if(t=r.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(o=t.shift(),i.isMessage(o)){if(a=new n.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),s={},o.oneofs&&Object.keys(o.oneofs).forEach((function(e){a.addChild(s[e]=new n.Message.OneOf(this,a,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),a.addChild(e)}),this),u=[],o.enums&&o.enums.forEach((function(e){u.push(e)})),o.messages&&o.messages.forEach((function(e){u.push(e)})),o.services&&o.services.forEach((function(e){u.push(e)})),o.extensions&&(a.extensions="number"==typeof o.extensions[0]?[o.extensions]:o.extensions),this.ptr.addChild(a),u.length>0){r.push(t),t=u,u=null,this.ptr=a,a=null;continue}u=null}else if(i.isEnum(o))a=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){a.addChild(new n.Enum.Value(this,a,e.name,e.id))}),this),this.ptr.addChild(a);else if(i.isService(o))a=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(a);else{if(!i.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(a=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){var r,i,o,s;if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions&&(r=!1,a.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)");i=t.name,this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i)),o=new n.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new n.Extension(this,this.ptr,t.name,o),o.extension=s,this.ptr.addChild(s),a.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,a=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,n){var i,o,a,s,u,l,c,d,f="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){if(i=n.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(f="\\"),o=i+f+n.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(s=!1,"object"==typeof n?(this.importRoot=n.root,s=!0,a=this.importRoot,n=n.file,(a.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(f="\\")):"string"==typeof n?this.importRoot?a=this.importRoot:n.indexOf("/")>=0?""===(a=n.replace(/\/[^\/]*$/,""))&&(a="/"):n.indexOf("\\")>=0?(a=n.replace(/\\[^\\]*$/,""),f="\\"):a=".":a=null,u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!a)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(l=t.imports[u]))continue;if(l=a+f+l,!0===this.files[l])continue;if(/\.proto$/i.test(l)&&!e.DotProto&&(l=l.replace(/\.proto$/,".json")),null===(c=e.Util.fetch(l)))throw Error("failed to import '"+l+"' in '"+n+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(c+""),l):this.import(e.DotProto.Parser.parse(c),l)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[u],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+u+"."+n}))):this.import(t.imports[u],n+"_import"+u):this.import(t.imports[u]);s&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&r(t),d=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},o.resolveAll=function(){var r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){var t,n,r;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},i.Message=function(){},i.Enum=function(){},i.Service=function(){},i}(o,o.Lang,o.Reflect),o.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,i,o,a;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(r=Object.keys(n),i=0;i<r.length;i++)o=this.keyElem.valueFromString(r[i]),a=this.valueElem.verifyValue(n[r[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:a}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){var e,t,r=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)r.push([(e=this.map[i[t]]).key,e.value]);return n(r)},i.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},i.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},i.forEach=function(e,t){var n,r,i=Object.keys(this.map);for(r=0;r<i.length;r++)e.call(t,(n=this.map[i[r]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,o.Reflect),o.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,n)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadProto(r,n,e)},o.protoFromFile=o.loadProtoFile,o.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=o.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=o.populateAccessors),new o.Builder(e)},o.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},o.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadJson(JSON.parse(r),n,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(n,t);return r}var Zo=function(){function e(e,t){Ko.add(this),Object.defineProperty(this,"nestedMap",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=Xo(e)}return Object.defineProperty(e.prototype,"_encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=new this.pbModules[e],o="";if(t)try{Object.keys(t).forEach((function(n){var a=t[n];if(void 0!==a){var s=r.nestedMap.get("".concat(e,"_").concat(n));if(o="set".concat(function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(n,0,1)),s){var u=a instanceof Array?a.map((function(e){return r._encode(s,e,!0)})):r._encode(s,a,!0);i[o](u)}else i[o](a)}}))}catch(t){var a="name: ".concat(e,", method: ").concat(o,", stack: ").concat(t.stack);null===console||void 0===console||console.error("pb encode error!",a)}return n?i:i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.pbModules[e].decode(t);return c(this,Ko,"m",Qo).call(this,n)}}),Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),e}();Ko=new WeakSet,Qo=function e(t){var n,r=this;if(t instanceof Array)return t.map((function(t){return c(r,Ko,"m",e).call(r,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t.buffer instanceof ArrayBuffer&&"number"==typeof t.offset&&"number"==typeof t.limit){var i=t.buffer,o=t.offset,a=t.limit;return i.slice(o,a)}if(void 0!==t.low&&void 0!==t.high&&Object.prototype.hasOwnProperty.call(t,"unsigned")){var s=t.low;return s<0&&(s+=4294967296),s=s.toString(16),parseInt(t.high.toString(16)+"00000000".replace(new RegExp("0{".concat(s.length,"}$")),s),16)}var u=t;return Object.keys(t).forEach((function(n){u[n]=c(r,Ko,"m",e).call(r,t[n])})),u};var $o,ea,ta,na,ra="NotifyMsg",ia="SyncRequestMsg",oa="UpStreamMessage",aa="PushExtra",sa="DownStreamMessages",ua="ChrmDownStreamMessages",la="DownStreamMessage",ca="GetQNupTokenInput",da="GetDownloadUrlInput",fa="GetQNupTokenOutput",pa="GetDownloadUrlOutput",ha="ChrmInput",ga="ChrmOutput",_a="ChrmPullMsg",ba="RelationQryInput",Ea="RelationsInput",va="RelationsOutput",ma="QryRemindListReq",ya="QryRemindListResp",Ia="CleanHisMsgInput",Ta="CleanMsgBatchReq",Ra="QueryChatRoomInfoInput",Oa="QueryChatRoomInfoOutput",Sa="HistoryMsgInput",Ca="HistoryMsgOuput",Aa="SessionsAttQryInput",Pa="SessionsAttOutput",Na="SessionMsgReadInput",wa="DeleteSessionsInput",La="SessionInfo",Ma="QuerySessionsInput",Ua="QuerySessionsOutPut",Da="RelationDelBatchReq",Va="RelationOpInput",ja="DeleteMsgInput",Ga="SetChrmKV",ka="SetChrmKVS",Fa="ChrmKVOutput",xa="ChrmKVSOutput",Ba="QueryChrmKV",Ha="SetUserSettingInput",qa="SetUserSettingOutput",Ya="PullUserSettingInput",Ka="PullUserSettingOutput",Qa="SessionReq",Wa="SessionStates",Ja="SessionStateModifyReq",za="GroupUnpushQuery",Xa="GroupUnpushSet",Za="GroupUnpushResult",$a="SessionStateModifyResp",es="TypeUnpushInput",ts="TypeUnpushOutput",ns="GrpReadReceiptMsg",rs="ReadReceipt",is="QueryReceiptReq",os="QueryReceiptBatchReq",as="ReceiptResp",ss="QueryReceiptBatchResp",us="GrpReadReceiptQryResp",ls="SessionTagAddInput",cs="SessionTagItem",ds="SessionTagDelInput",fs="UserSettingNotification",ps="ReportSDKInput",hs="UltraGrpPullSes",gs="UltraGrpPullMsg",_s="MsgChangeReq",bs="QueryMsgChange",Es="EventChangeList",vs="MsgChangeList",ms="MsgQuery",ys="MsgQueryAck",Is="OperateStatus",Ts="OperateStatusNotify",Rs="SetRtcRoomIdInput",Os="CallInfoUpStream",Ss="CallInfoDownStream",Cs="KvInput",As="KvOutput",Ps="ReadReceiptMsg",Ns="ReceiptQryReq",ws="QueryReceiptResp",Ls="ReceiptCntQryReq",Ms="ReceiptCntQryResp",Us="UpdateUserSubReq",Ds="UserSubDetail",Vs="UpdateUserSubResp",js="PullUserSubReq",Gs="PUllUserSubResp",ks="PullSubDataReq",Fs="PullSubDataResp",xs="SubDataDetail",Bs="QrySubDataReq",Hs="UserProfile",qs="ProfileInfo",Ys="SetUserProfileResp",Ks="PullUserProfileReq",Qs="UserProfiles",Ws="UserProfileInput",Js="UserProfilePermission",zs="SearchUserProfile",Xs="ChannelsInput",Zs="ChannelsOutput",$s="MultiChannels",eu="ModifyChannelsInput",tu="QuitChannelsSetting",nu="ChannelsQueryInput",ru="ChannelsPageParam",iu="ChannelsListResult",ou="ChannelsInviteStatusInfos",au="ChannelsUserInfos",su="ChannelsJoinedInfos",uu="ChannelsMemberUpdateInput",lu="ChannelsMemberResponseInput",cu="ChannelsMembersInput",du="FriendInput",fu="FriendsInput",pu="FriendsCheckOutput",hu="FriendProfileInput",gu="FriendProfileOutput",_u="FriendQueryInput",bu="FriendsListInput",Eu="FriendLevelSet",vu="FriendUserInfos",mu="FriendInviteInfos",yu="ChannelApplyInfo",Iu="AddUnpushPeriodInput",Tu="DeleteUnpushPeriodInput",Ru="QueryUnpushPeriodInput",Ou="QueryUnpushPeriodOutput",Su="RelationDel",Cu="MsgReadEvent",Au="ConvertMsgInput",Pu="SpeechToTextInfo",Nu="ConvertMsgOutput",wu="SpeechToTextResult",Lu="TransReq",Mu="TransResp",Uu=new Map([["UpStreamMessage_pushExt","PushExtra"],["DownStreamMessages_list","DownStreamMessage"],["DownStreamMessage_pushExt","PushExtra"],["ChannelInfosOutput_channels","ChannelInfoOutput"],["GroupMembersOutput_members","MemberInfo"],["GroupInput_groupInfo","GroupInfo"],["RelationsInput_msg","DownStreamMessage"],["RelationsOutput_info","RelationInfo"],["RelationInfo_msg","DownStreamMessage"],["RelationInfo_msgInfo","UnreadMsgInfo"],["QryRemindListResp_msgInfo","UnreadMsgInfo"],["CleanMsgBatchReq_input","CleanHisMsgInput"],["HistoryMessagesOuput_list","DownStreamMessage"],["QueryChatRoomInfoOutput_userInfos","ChrmMember"],["MPFollowOutput_info","MpInfo"],["MCFollowOutput_info","MpInfo"],["SearchMpOutput_info","MpInfo"],["PullMpOutput_info","MpInfo"],["HistoryMsgOuput_list","DownStreamMessage"],["DeleteSessionsInput_sessions","SessionInfo"],["QuerySessionsInput_sessions","SessionInfo"],["QuerySessionsOutPut_sessions","SessionInfo"],["RelationDelBatchReq_relation","RelationOpInput"],["DeleteMsgInput_msgs","DeleteMsg"],["SetChrmKV_entry","ChrmKVEntity"],["SetChrmKV_notification","UpStreamMessage"],["SetChrmKVS_entry","ChrmKVEntity"],["SetChrmKVS_notification","UpStreamMessage"],["DeleteChrmKVS_entry","ChrmKVEntity"],["DeleteChrmKVS_notification","UpStreamMessage"],["ChrmKVOutput_entries","ChrmKVEntity"],["ChrmKVSOutput_errorKeys","ChrmKVSOutputEntity"],["ChrmKVSOutput_keysVersion","ChrmKVSVersionEntity"],["PullUserSettingOutput_items","UserSettingItem"],["UserSettingItem_tags","SessionTagItem"],["SessionStates_state","SessionState"],["SessionState_stateItem","SessionStateItem"],["SessionStateItem_tags","SessionTagItem"],["SessionStateModifyReq_state","SessionState"],["QueryReceiptBatchReq_items","QueryReceipt"],["ReceiptResp_resp","QueryReceiptRespItem"],["QueryReceiptBatchResp_item","QueryReceiptBatchRespItem"],["QueryReceiptBatchRespItem_msg","QueryReceiptRespItem"],["QueryReceiptRespItem_readUser","ReceiptUser"],["QueryReceiptRespItem_unreadUser","ReceiptUser"],["GrpReadReceiptQryResp_list","GrpMsgReadUser"],["SessionTagAddInput_tags","SessionTagItem"],["SessionTagDelInput_tags","SessionTagItem"],["EventChangeList_list","EventChange"],["MsgChangeList_list","MsgChange"],["MsgQuery_query","MessageQueryInfo"],["MsgQueryAck_list","DownStreamMessage"],["OperateStatusNotify_info","OperateInfo"],["OperateStatusNotify_summary","OperateSummary"],["KvOutput_info","KvInfo"],["QueryReceiptResp_list","ReceiptUser"],["ReceiptCntQryResp_result","MsgReadCnt"],["UpdateUserSubReq_subUsers","UserSubDetail"],["UpdateUserSubResp_subUsers","UserSubDetail"],["PUllUserSubResp_list","UserSubList"],["UserSubList_subUsers","UserSubDetail"],["PullSubDataResp_list","SubDataDetail"],["SubDataDetail_data","SubData"],["QrySubDataReq_subUsers","UserSubDetail"],["UserProfile_userProfile","ProfileInfo"],["UserProfile_userExtProfile","ProfileInfo"],["UserProfiles_UserProfile","UserProfile"],["ChannelsInput_settingProfile","ProfileInfo"],["ChannelsInput_extProfile","ProfileInfo"],["ChannelsInput_baseInfo","ChannelBaseInfo"],["ChannelsOutput_channelInfo","ChannelsJoinedInfo"],["ChannelsOutput_userInfos","ChannelsUserInfo"],["ChannelsOutput_friendInviteInfo","FriendInviteInfo"],["ChannelsOutput_friendUserInfo","FriendUserInfo"],["MultiChannels_list","ChannelsInput"],["ModifyChannelsInput_settingInfo","QuitChannelsSetting"],["ChannelsQueryInput_page","ChannelsPageParam"],["ChannelsListResult_page","ChannelsPageParam"],["ChannelsInviteStatusInfos_list","ChannelsInviteStatusInfo"],["ChannelsUserInfos_list","ChannelsUserInfo"],["ChannelsJoinedInfos_list","ChannelsJoinedInfo"],["ChannelsUserInfo_ext","ChannelsUserExtInfo"],["ChannelsJoinedInfo_settingProfile","ProfileInfo"],["ChannelsJoinedInfo_extProfile","ProfileInfo"],["ChannelsJoinedInfo_baseInfo","ChannelBaseInfo"],["ChannelsJoinedInfo_userInfo","ChannelsUserExtInfo"],["ChannelsInviteStatusInfo_joinUserInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_inviterInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_processInfo","ChannelsUserInfo"],["FriendsOutput_list","FriendOutput"],["FriendsCheckOutput_list","FriendCheckOutput"],["FriendProfileInput_extProfile","ProfileInfo"],["FriendQueryInput_page","ChannelsPageParam"],["FriendUserInfo_extProfile","ProfileInfo"],["FriendUserInfos_list","FriendUserInfo"],["FriendInviteInfos_list","FriendInviteInfo"],["UpdateChannnelInfo_channelInfo","ChannelsJoinedInfo"],["UpdateChannnelInfo_userInfo","ChannelsUserInfo"],["UpdateUserInfo_updatedUserInfo","ChannelsUserInfo"],["UpdateUserInfo_optUserInfo","ChannelsUserInfo"],["ChannelApplyInfo_statusInfo","ChannelsInviteStatusInfo"],["ChannelEventData_optUserInfo","ChannelsUserInfo"],["ChannelEventData_channelInfo","ChannelsJoinedInfo"],["ChannelEventData_userInfos","ChannelsUserInfo"],["ChannelEventData_channelFullInfo","ChannelsJoinedInfo"],["FriendUpdateEvent_extProfile","ProfileInfo"],["MsgReadEvent_readList","ReceiptUser"],["TransReq_transInfos","TransInfo"],["TransResp_results","TransResult"]]);!function(e){e[e.PERSON=1]="PERSON",e[e.PERSONS=2]="PERSONS",e[e.GROUP=3]="GROUP",e[e.TEMPGROUP=4]="TEMPGROUP",e[e.CUSTOMERSERVICE=5]="CUSTOMERSERVICE",e[e.NOTIFY=6]="NOTIFY",e[e.MC=7]="MC",e[e.MP=8]="MP",e[e.ULTRAGROUP=10]="ULTRAGROUP"}($o||($o={})),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"}(ea||(ea={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(ta||(ta={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(na||(na={}));var Du,Vu,ju,Gu,ku,Fu,xu,Bu,Hu,qu=new Zo("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message ChrmDownStreamMessages {\n repeated bytes list = 1;\n required int64 syncTime = 2;\n optional bool compressioEnabled = 3;\n optional bytes compressedData = 4;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsInput {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n optional bool ignoreVersion = 3;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n optional bool updateVersion = 3;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n optional int64 time = 4;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n AutoTrans = 4;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n optional bool ignoreVersion = 3;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n optional bool updateVersion = 2;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n optional bool ignoreVersion = 4;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n optional bool updateVersion = 2;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message ReadReceipt {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string channelId = 3;\n optional int32 readType =4 ;\n repeated string msgIds= 5 ;\n optional string fromId = 6;\n }\n message QueryReceiptReq {\n optional string targetId = 1;\n optional string busChannel =2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n optional int32 qryType = 5;\n optional int32 order =6;\n optional bool compress = 7;\n optional int32 readType = 8;\n optional int32 pageType = 9; \n optional int32 pageSize = 10;\n optional string pageToken = 11;\n repeated string users = 12;\n }\n message QueryReceiptBatchReq {\n repeated QueryReceipt items = 1;\n optional bool compress = 2;\n }\n message QueryReceipt {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n }\n message ReceiptResp {\n repeated QueryReceiptRespItem resp = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n optional string pageToken = 4;\n }\n message QueryReceiptBatchResp {\n repeated QueryReceiptBatchRespItem item = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n }\n\n message QueryReceiptBatchRespItem {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated QueryReceiptRespItem msg = 4;\n }\n message QueryReceiptRespItem {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int64 readCnt = 4;\n repeated ReceiptUser readUser = 5;\n repeated string unreadList = 6;\n optional int64 unreadCnt = 7;\n repeated ReceiptUser unreadUser = 8;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n optional int64 receiptTime = 1;\n optional string userId = 2;\n optional string name = 3;\n optional string portrait = 4;\n optional bool mentioned= 5;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n message RelationDel {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string busChannel = 3;\n optional bool cleanMsg = 4;\n }\n message MsgReadEvent {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int32 readCnt = 4;\n optional int32 unreadCnt = 5;\n repeated ReceiptUser readList =6;\n }\n message ConvertMsgInput {\n optional int32 businessType = 1;\n optional bytes businessInfo = 2;\n }\n message SpeechToTextInfo {\n optional string msgId = 1;\n optional string objectName = 2;\n optional string content = 3;\n optional int32 sampleRate = 4;\n optional int32 channelNumber = 5;\n optional string format = 6;\n optional string extra = 7;\n }\n message ConvertMsgOutput {\n optional int32 businessType = 1;\n optional bytes businessResult = 2;\n }\n message SpeechToTextResult {\n optional string result = 1;\n optional string message = 2;\n }\n message TransReq {\n repeated TransInfo transInfos = 1;\n optional int32 model = 2;\n optional bool forceTrans = 3;\n }\n message TransResp {\n repeated TransResult results = 1;\n optional int32 model = 2;\n }\n message TransInfo {\n optional string messageUID = 1;\n optional int32 transType = 2;\n optional string text = 3;\n optional string transFileUrl = 4;\n optional string sourceLan = 5;\n optional string targetLan = 6;\n optional int32 inputSource = 7;\n }\n message TransResult {\n optional string messageUID = 1;\n optional string transResult = 2;\n optional string sourceLan = 3;\n optional string targetLan = 4;\n optional int32 code = 5;\n optional int32 inputSource = 6;\n }\n}\n",Uu);!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(Du||(Du={})),function(e){e.IM="IM",e.RTC="RTC"}(Vu||(Vu={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(ju||(ju={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(Gu||(Gu={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(ku||(ku={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Fu||(Fu={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(xu||(xu={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Bu||(Bu={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Hu||(Hu={}));var Yu=null;function Ku(e,t,n,r){void 0===n&&(n={});var i=["error","warn","info","debug"][3-e];if(Yu&&e<Du.FATAL)try{var o=JSON.stringify(n);Yu[i](t,o)}catch(e){console.error(e)}}var Qu,Wu,Ju=Ku.bind(null,Du.DEBUG),zu={init:function(e){Yu=e},info:Ku.bind(null,Du.INFO),debug:Ju,warn:Ku.bind(null,Du.WARN),error:Ku.bind(null,Du.ERROR),fatal:Ku.bind(null,Du.FATAL)},Xu=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var i=r.length-1;i>=0;i-=1){var o=r[i],a=o.target,s=o.once,c=o.listener;s&&r.splice(i,1);try{c.call.apply(c,l([a],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._map[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}),e}(),Zu=function(e,t,n){var r=null==n?void 0:n.isReverse;yt(e)&&function(){for(var n in e)t(e[n],n,e)}(),(bt(e)||pt(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},$u=function(e,t){return Zu(e,(function(n,r){e[r]=t(n,r)})),e},el=function(e){return"[object Null]"===Object.prototype.toString.call(e)},tl=function(){function e(e,t,n){Object.defineProperty(this,"pbmaps",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=Xo(t)}return Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var n=t[e];void 0!==n&&r["set".concat(function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(e,0,1))](n)}))}catch(t){var i="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(H.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(H.L_PB_ENCODE_E,i)}return n?r:r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.pbModules[e].decode(t);return this.fixInt64Values(n)}}),Object.defineProperty(e.prototype,"fixInt64Values",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!yt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var n=e.low;return n<0&&(n+=4294967296),n=n.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(n.length,"}$")),n),16)}for(var r in e)e[r]=this.fixInt64Values(e[r]);return e}}),e}();!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(Wu||(Wu={}));var nl,rl,il,ol,al,sl,ul,ll,cl,dl,fl,pl=((Qu={})[Wu.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],Qu[Wu.RtcUserListOutput]=["users","token","sessionId","roomInfo"],Qu[Wu.SetUserStatusInput]=["status"],Qu[Wu.RtcSetDataInput]=["interior","target","key","value","objectName","content"],Qu[Wu.RtcUserSetDataInput]=["valueInfo","objectName","content"],Qu[Wu.RtcDataInput]=["interior","target","key","objectName","content"],Qu[Wu.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],Qu[Wu.MCFollowInput]=["state"],Qu[Wu.RtcTokenOutput]=["rtcToken"],Qu[Wu.RtcQryOutput]=["outInfo"],Qu[Wu.RtcQryUserOutDataInput]=["userId"],Qu[Wu.RtcUserOutDataOutput]=["user"],Qu[Wu.RtcQueryListInput]=["order"],Qu[Wu.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],Qu[Wu.RtcValueInfo]=["key","value"],Qu[Wu.RtcKeyDeleteInput]=["key"],Qu[Wu.RtcNotifyMsg]=["type","time","roomId"],Qu[Wu.RtcPullKV]=["timestamp","roomId"],Qu[Wu.RtcKVOutput]=["entries","bFullUpdate","syncTime"],Qu[Wu.RtcQueryUserJoinedInput]=["userId"],Qu[Wu.RtcQueryUserJoinedOutput]=["info"],Qu[Wu.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],Qu[Wu.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],Qu[Wu.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],Qu[Wu.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],Qu),hl="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(Wu.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(Wu.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(Wu.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(Wu.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(Wu.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(Wu.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(Wu.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间 key value\n repeated RtcKVEntity entries = 5;//直播 KV 属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取 KV 时用)。\n optional int32 offlineKickTime = 7;//server 超时踢人时间,默认 60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(Wu.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(Wu.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(Wu.RtcValueInfo," innerDatas = 7; //用户内部 inner 数据,角色或者连麦信息等\n repeated ").concat(Wu.RtcValueInfo," outerDatas = 8; //用户内部 outer 数据,自定义数据结构 RtcInput。\n }\n message ").concat(Wu.RtcQryOutput,"{\n repeated ").concat(Wu.RtcValueInfo," outInfo=1;\n }\n message ").concat(Wu.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(Wu.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(Wu.RtcUserSetDataInput," {\n repeated ").concat(Wu.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(Wu.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(Wu.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(Wu.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(Wu.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(Wu.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(Wu.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(Wu.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc 房间状态 KV 变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间 id\n }\n message ").concat(Wu.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(Wu.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1 为主播变观众\n ViewerToAnchor = 2; //2 为观众变主播\n }\n message ").concat(Wu.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备 ID\n required string roomId = 2; //加入的房间 ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(Wu.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(Wu.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV 属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取 KV 时用)。\n }\n message ").concat(Wu.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n optional int32 timeoutTime=2; //邀请超时时间 (秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId= 5; //客户端保证唯一性 (建议 roomid_userid_时间戳_随机数)\n }\n message ").concat(Wu.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId=4; //邀请的 sessionId,客户端发起邀请时产生\n }\n message ").concat(Wu.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的 uid\n required int32 answerCode=2; //是否接受连麦邀请.0 为拒绝,1 为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的 sessionId\n required string content=5; //需要转发的 content\n optional string key=6; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n }\n message ").concat(Wu.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的 sessionId\n required string inviteContent=3; //结束连麦的信息 (需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的 key\n }\n}\n"),gl=function(e,t,n,r,i,o){var a=i?Object.keys(i).map((function(t){return e.encode(Wu.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,s=o?Object.keys(o).map((function(t){return e.encode(Wu.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(Wu.RtcInput,{roomType:t,broadcastType:n,joinType:r,innerDatas:a,outerDatas:s})},_l=function(e,t){var n=e.decode(Wu.RtcUserListOutput,t),r=n.users,i=n.token,o=n.sessionId,a=n.roomInfo,s=n.entries,u=n.offlineKickTime,l={};return Zu(r,(function(e){var t=e.userId,n=e.userData,r={};Zu(n,(function(e){var t=e.key,n=e.value;r[t]=n})),l[t]=r})),{users:l,token:i,sessionId:o,roomInfo:a,kvEntries:s,offlineKickTime:u}},bl=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pullTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS?(this._isPulling=!1,this._pullTime=s||0,this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._pullTime=0,this._isPulling=!1}}),e}(),El=function(){function e(e,t,n,r){Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcKVManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcSignalingListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._appkey=this._options.appkey,this._rtcKVManager=new bl(this)}return Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcSignalingListener=e}}),Object.defineProperty(e.prototype,"getInnerLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger}}),Object.defineProperty(e.prototype,"pullRTCRoomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=this.rtcCodec.encode(Wu.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,ai,!0,t)];case 1:return n=a.sent(),i=n.code,o=n.buffer,i!==x.SUCCESS?[2,{code:i}]:(s=this.rtcCodec.decode(Wu.RtcKVOutput,o),u=s.entries,l=s.syncTime,u=(u||[]).map((function(e){return r(r({},e),{timestamp:Ut(e.timestamp)})})),this._watcher.onRTCDataChange(u,e),[2,{code:i,data:l}])}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(Wu.RtcNotifyMsg,e),n=t.time,r=t.type,i=t.roomId;1===r&&this._rtcKVManager.pullEntry(i,Ut(n))}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();!function(e){e.INIT="INIT",e.DATA="DATA",e.END="END"}(nl||(nl={}));var vl=function(e){function n(t,n){var r=e.call(this)||this;return rl.add(r),il.set(r,void 0),ol.set(r,new Map),al.set(r,void 0),d(r,il,t,"f"),d(r,al,n,"f"),r}return t(n,e),Object.defineProperty(n.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=c(this,rl,"a",sl).createTraceId(),c(this,rl,"a",sl).info(H.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,yn.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,il,"f").validateConnected).tryTrans((function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===n?void 0:n.length)?vn(e.streamServer.addrs):mn(x.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(r,rl,"m",fl).call(r,e,t)}))];case 1:return n=i.sent(),c(this,rl,"a",sl).summary(H.L_REQ_STREAM_MSG_CONTENT_R,n,t,{messageUId:e}),[2,n.wipe()]}}))}))}}),n}(pn);il=new WeakMap,ol=new WeakMap,al=new WeakMap,rl=new WeakSet,sl=function(){return c(this,il,"f").logger},ul=function(e,t,n){var r=c(this,ol,"f").get(e);r&&(c(this,ol,"f").delete(e),c(this,rl,"m",ll).call(this,e,nl.END,t,r.msg))},ll=function(e,t,n,r,i){this.emit("message",{code:n,messageUId:e,type:t,chunk:i,message:r})},cl=function(e,t){e.content=r(r({},e.content),t),c(this,il,"f").setMessageContent(e.messageId,e.content,e.messageType)},dl=function(e,t,n){var r,i,o=c(this,ol,"f").get(t);switch(e){case"init":o.msg&&c(this,rl,"m",cl).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,rl,"m",ll).call(this,t,nl.INIT,x.SUCCESS,o.msg);break;case"complete":i=(r=n.length?JSON.parse(n):{}).complete||!1,o.msg&&c(this,rl,"m",cl).call(this,o.msg,{stopReason:r.stopReason||0,completeReason:r.completeReason||0,complete:i,isSynced:i}),c(this,rl,"m",ul).call(this,t,r.stopReason||0,i);break;default:r=JSON.parse(n),o.cached+=r.content,o.msg&&c(this,rl,"m",cl).call(this,o.msg,{content:o.cached}),c(this,rl,"m",ll).call(this,t,nl.DATA,x.SUCCESS,o.msg,{content:r.content,fullContent:o.cached})}},fl=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return c(this,ol,"f").has(e)?[2,mn(x.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,ol,"f").size>=3?[2,mn(x.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(n=zo.createSSEClient({logger:c(this,rl,"a",sl),msgUId:e,appkey:c(this,il,"f").appkey,token:c(this,il,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var n=t.indexOf("\n"),r=t.slice(0,n).replace("event:",""),i=t.slice(n+1+5);c(d,rl,"m",dl).call(d,r,e,i.trim())}}))},onNetworkError:function(t){c(d,rl,"m",ul).call(d,e,t,!1)}}),n.isOk?(r=n.data,i={client:r,cached:"",msg:void 0},c(this,ol,"f").set(e,i),c(this,al,"f")?[4,c(this,il,"f").getLocalMessage(e)]:[3,2]):[2,n.wipe()]);case 1:if(o=a.sent(),s=o.code,!(u=o.data))return c(this,ol,"f").delete(e),[2,mn(s,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,ol,"f").delete(e),[2,mn(x.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,a.label=2;case 2:return[4,r.open(t.slice())];case 3:return(l=a.sent()).isOk||c(this,ol,"f").delete(e),[2,l.wipe()]}}))}))};var ml,yl,Il=function(){function e(e){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"__getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"createCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new tl(e,t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Zo(e,t)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"getCoreVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.24.0"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.24.0"}}),Object.defineProperty(e.prototype,"getAppkey",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.appkey}}),Object.defineProperty(e.prototype,"getCurrentId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getUserToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.token}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getConnectionStatus()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.setPushConfig(e)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.sendMessage(e,t,n)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.setCallInfo(e,t,n)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),Tl=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return o=gl(this._context.rtcCodec,t,n,r,i,s),[4,this.rtcSignaling(e,Yr,!0,o)];case 1:return u=a.sent(),l=u.code,c=u.buffer,l===x.SUCCESS&&c&&(d=_l(this._context.rtcCodec,c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(n.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(Wu.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Kr,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.rtcPing(e,t,n)}}),Object.defineProperty(n.prototype,"getRTCRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(Wu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Qr,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i&&(o=this._context.rtcCodec.decode(Wu.RtcRoomInfoOutput,i)),[2,{code:r,data:o}]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(Wu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Wr,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i&&(s=_l(this._context.rtcCodec,i),o={users:s.users}),[2,{code:r,data:o}]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(n.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(Wu.RtcValueInfo,{key:t,value:n}),[4,this.rtcSignaling(e,Jr,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(Wu.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,zr,!1,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=this._context.rtcCodec.encode(Wu.RtcSetDataInput,{interior:r,target:i,key:t,value:n,objectName:null==s?void 0:s.name,content:null==s?void 0:s.content}),[4,this.rtcSignaling(e,Xr,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return o={objectName:r,content:this._context.rtcCodec.encode(Wu.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(Wu.RtcValueInfo,{key:"uris",value:n},!0),this._context.rtcCodec.encode(Wu.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},s=this._context.rtcCodec.encode(Wu.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,Zr,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(Wu.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(Wu.RtcValueInfo,{key:"cdn_uris",value:n},!0)}),[4,this.rtcSignaling(e,Zr,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this._context.rtcCodec.encode(Wu.RtcDataInput,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,$r,!0,i)];case 1:return o=a.sent(),s=o.code,u=o.buffer,s===x.SUCCESS&&u?(l=this._context.rtcCodec.decode(Wu.RtcQryOutput,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=this._context.rtcCodec.encode(Wu.RtcDataInput,{interior:n,target:r,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,ei,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=gl(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,ti,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=this._context.rtcCodec.decode(Wu.RtcTokenOutput,s).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(Wu.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,ni,!0,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(Wu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,ri,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=_l(this._context.rtcCodec,i),[2,{code:r,data:o}]):[2,{code:r}]}}))}))}}),Object.defineProperty(n.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return r=gl(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,ii,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=this._context.rtcCodec.decode(Wu.RtcViewerJoinedOutput,s),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(Wu.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,oi,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=this._context.rtcCodec.encode(Wu.RtcInput,{roomType:Gu.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,si,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=_l(this._context.rtcCodec,s),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,u=this._context.rtcCodec.encode(Wu.RtcInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,ui,!0,u)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=this._context.rtcCodec.encode(Wu.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:i}),[4,this.rtcSignaling(o,li,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,o=e.key,s=e.value,u=e.agree,l=e.roomId,c=this._context.rtcCodec.encode(Wu.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:i,key:o,value:s,answerCode:u?1:0}),[4,this.rtcSignaling(l,ci,!0,c)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,o=e.roomId,s=this._context.rtcCodec.encode(Wu.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:i}),[4,this.rtcSignaling(o,di,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(n.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._context.rtcSignaling(e,t,n,r)}}),Object.defineProperty(n.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(Wu.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",fi,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=this._context.rtcCodec.decode(Wu.RtcQueryUserJoinedOutput,i).info||[],[2,{code:r,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:r}]}}))}))}}),n}(Il),Rl={"set.proxy":x.INVALID_PARAMETER_PROXY,"test.proxy":x.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":x.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":x.INVALID_PARAMETER_TESTHOST,channelId:x.INVALID_PARAMETER_CHANNEL_ID,count:x.INVALID_PARAMETER_COUNT,startTime:x.INVALID_PARAMETER_START_TIME,endTime:x.INVALID_PARAMETER_END_TIME,offset:x.INVALID_PARAMETER_OFFSET,limit:x.INVALID_PARAMETER_LIMIT,keyword:x.INVALID_PARAMETER_KEYWORD,messageTypes:x.INVALID_PARAMETER_MESSAGE_TYPE,messageType:x.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:x.INVALID_PARAMETER_MESSAGE_TYPE,conversation:x.INVALID_PARAMETER_CONVERSATION,conversationType:x.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:x.INVALID_PARAMETER_TARGET_ID,targetIds:x.INVALID_PARAMETER_TARGET_ID,userId:x.INVALID_PARAMETER_USER_ID,senderUserId:x.INVALID_PARAMETER_USER_ID,timestamp:x.INVALID_PARAMETER_TIMESTAMP,order:x.INVALID_PARAMETER_ORDER,messageId:x.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:x.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:x.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:x.INVALID_PARAMETER_SENT_STATUS,content:x.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:x.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:x.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:x.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:x.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:x.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:x.MSG_LIMIT_ERROR,checkDuplicate:x.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:x.INVALID_PARAMETER_MESSAGE_UID,key:x.INVALID_PARAMETER_KEY,keys:x.INVALID_PARAMETER_KEYS,value:x.INVALID_PARAMETER_VALUE,isAutoDelete:x.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:x.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:x.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:x.INVALID_PARAMETER_ENTRIES,isForce:x.INVALID_PARAMETER_IS_FORCE,rtcRoomId:x.INVALID_PARAMETER_RTCROOMID,token:x.RC_CONN_TOKEN_INCORRECT,conversations:x.INVALID_PARAMETER_CONVERSATIONS,draft:x.INVALID_PARAMETER_DRAFT,conversationTypes:x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:x.INVALID_PARAMETER_IS_TOP,isUpdateTime:x.INVALID_PARAMETER_IS_UPDATE_TIME,message:x.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:x.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:x.INVALID_PARAMETER_USERIDLIST,directedUserIds:x.INVALID_PARAMETER_USERIDLIST,isStatusMessage:x.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:x.INVALID_PARAMETER_PUSH_CONTENT,pushData:x.INVALID_PARAMETER_PUSH_DATA,isMentioned:x.INVALID_PARAMETER_IS_MENTIONED,mentionedType:x.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:x.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:x.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:x.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:x.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:x.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:x.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:x.SEARCH_PROPS_LIMIT_ERROR,tagId:x.INVALID_PARAMETER_TAG_ID,tagIds:x.INVALID_PARAMETER_TAG_ID,tagName:x.INVALID_PARAMETER_TAG_NAME,containMuted:x.INVALID_PARAMETER_CONTAIN_MUTED,channelType:x.INVALID_PARAMETER_CHANNEL_TYPE,file:x.MEDIA_EXCEPTION,fileType:x.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:x.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:x.INVALID_PARAMETER_MEDIA_URL,filename:x.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:x.INVALID_PARAMETER_SAVE_NAME,serverType:x.INVALID_PARAMETER_SERVER_TYPE,subscribeType:x.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:x.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:x.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:x.INVALID_PARAMETER_BEFORE,afterCount:x.INVALID_PARAMETER_AFTER,conversationList:x.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:x.CONVERSATION_TYPE_NOT_SUPPORT,profile:x.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:x.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:x.INVALID_PARAMETER_UNIQUE_ID,extra:x.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:x.INVALID_DISABLE_UPDATE_LAST_MESSAGE};!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID",e[e.CONVERSATION=8]="CONVERSATION",e[e.CONVERSATION_TYPE=9]="CONVERSATION_TYPE"}(yl||(yl={}));var Ol,Sl=((ml={})[yl.STRING]=vt,ml[yl.ONLY_STRING]=pt,ml[yl.NUMBER]=gt,ml[yl.BOOLEAN]=function(e){return"boolean"==typeof e},ml[yl.OBJECT]=yt,ml[yl.ARRAY]=bt,ml[yl.CALLBACK]=function(e){var t=!0;return yt(e)||(t=!1),(e=e||{}).onSuccess&&!It(e.onSuccess)&&(t=!1),e.onError&&!It(e.onError)&&(t=!1),t},ml[yl.CHANNEL_ID]=At,ml[yl.CONVERSATION]=function(e){var t=!0;return yt(e)||(t=!1),pt(e.targetId)||(t=!1),St(e.conversationType)||(t=!1),Tt(e.channelId)||At(e.channelId)||(t=!1),t},ml[yl.CONVERSATION_TYPE]=St,ml),Cl=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return t(n,e),n}(Error),Al=function(e,t,n,r){if(void 0===r&&(r=!1),!Pl(e,t,n,r))throw new Cl("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},Pl=function(e,t,n,r){void 0===r&&(r=!1),n=Sl[n]||n;var i=r?n(t):Tt(t)||null==t||n(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},Nl=function(){function e(e,t){var n,r;Object.defineProperty(this,"_logTagT",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logTagR",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"verificationFaileList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"context",{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,"option",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.context=__.getContext(),this.logger=null===(n=this.context)||void 0===n?void 0:n.logger,this.option=null===(r=this.context)||void 0===r?void 0:r.getOptions()}return Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){if(void 0===r&&(r=!1),this.verificationFaileList.length>0)return this;n=Sl[n]||n;var o=r?n(t):Tt(t)||null==t||n(t);if("object"==typeof o){var a=o.valid,s=o.errorKey;return!a&&s&&this.verificationFaileList.push({key:s,value:t,isValid:!1,message:i,code:Rl[s]}),this}return o||this.verificationFaileList.push({key:e,value:t,isValid:o,message:i,code:Rl[e]}),this}}),Object.defineProperty(e.prototype,"validateParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){if(void 0===i&&(i=!1),this.verificationFaileList.length>0)return this;n=Sl[n]||n;var a=i?n(t):Tt(t)||null==t||n(t);if("object"==typeof a){var s=a.valid,u=a.errorKey,l=a.errorCode;return!s&&u&&this.verificationFaileList.push({key:u,value:t,code:l||r,message:o,isValid:!1}),this}return a||this.verificationFaileList.push({key:e,value:t,code:r,message:o,isValid:!1}),this}}),Object.defineProperty(e.prototype,"_getValidationResult",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]}}),Object.defineProperty(e.prototype,"ifReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return Promise.resolve({code:x.BIZ_ERROR_CLIENT_NOT_INIT});var n=this._getValidationResult();if(n){var r=n.code,i=n.value,o=n.message,a=n.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:r})),Promise.resolve({code:r,msg:"'".concat(a,"' is invalid: ").concat(o||JSON.stringify(i))})}var s=this.logger.createTraceId();return e(this.context,this.logger,this.option,s)}}),Object.defineProperty(e.prototype,"try2do",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)}}),Object.defineProperty(e.prototype,"ifReadySync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return{code:x.BIZ_ERROR_CLIENT_NOT_INIT};var n=this._getValidationResult();if(!n)return e(this.context,this.logger,this.option);var r=n.code,i=n.value,o=n.message,a=n.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:r})),{code:r,msg:"'".concat(a,"' is invalid: ").concat(o||i)}}}),e}(),wl=function(e){return function(t){if(!bt(t)||void 0!==e.minLength&&t.length<e.minLength||void 0!==e.maxLength&&t.length>e.maxLength)return!1;if(!e.itemValidator)return!0;var n=!0;return t.every((function(t){var r=e.itemValidator&&e.itemValidator(t);return"object"==typeof r?r.errorKey?(n={errorKey:r.errorKey,valid:r.valid},!1):(n=r.valid,r.valid):(n=!!r,r)})),n}},Ll=function(e,t){var n;return yt(e)?(t&&!t.includes(e.conversationType)&&(n="conversationTypeNotSupport"),Nt(e.targetId)||(n="targetId"),St(e.conversationType)||(n="conversationType"),Tt(e.channelId)||At(e.channelId)||(n="channelId"),Tt(n)?{valid:!0}:{valid:Tt(n),errorKey:n}):{valid:!1,errorKey:"conversation"}},Ml=function(e,t){var n=vr(e).searchProps;return n&&0!==n.length?n.every((function(e){return void 0!==t[e]}))?vn():mn(x.SEARCH_PROPS_LIMIT_ERROR):vn()},Ul=function(e,t,n){return Dl(yn.create(e),t,n)},Dl=function(e,t,n){return e.result().isOk&&e.isObject("conversatino",t,!0).fail(x.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return $(t.conversationType,n)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,Nt,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,At).fail(x.INVALID_PARAMETER_CHANNEL_ID),e},Vl=function(){return Ol||(Ol={set:function(e,t){zo.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(zo.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return zo.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in zo.localStorage)e.push(t);return e}}),Ol},jl=function(){function e(e){Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),e&&(this._caches=e)}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._caches[e]=t}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get(e);return delete this._caches[e],t}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._caches[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=[];for(var t in this._caches)e.push(t);return e}}),e}(),Gl=function(){function e(e){var t;Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rootStorage=Vl();var n=this._rootStorage.get(e)||{};this._cache=new jl(((t={})[e]=n,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._get();n[e]=t,this._set(n)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),kl="",Fl=function(){var e="";if(kl)return kl;if("browser"===zo.tag)return dt;var t="RCDeviceId",n=Vl(),r=n.get(t);return r?e=r:(e=ct.genWithLen(22),n.set(t,e)),e},xl=function(){return ct.gen()},Bl=function(){return ct.genWithLen(22)},Hl="",ql=function(){return Hl},Yl=function(e,t,n,r,i){var o=0;return e&&(o|=16),t&&(o|=32),n&&(o|=64),r&&(o|=512),i&&(o|=1024),o},Kl=function(e){var t;try{t=JSON.parse(e)}catch(n){t=e}if(t.user){var n=t.user,r=n.portrait,i=n.portraitUri,o=r||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},Ql=function(e){var t={};try{var n=JSON.parse(e);Object.entries(n).forEach((function(e){var n=u(e,2),r=n[0],i=n[1];t[r]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Wl=function(e,t,n,r){var i,o,a=qu.decode(oa,e.pbData),s=Hr(e.topic);if(s===Gr.recallMsg){var u=JSON.parse(a.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[Gr.ppMsgP]=B.PRIVATE,t[Gr.pgMsgP]=B.GROUP,t[Gr.chatMsg]=B.CHATROOM,t[Gr.ugMsg]=B.ULTRA_GROUP,t[Gr.pcMsgP]=B.CUSTOMER_SERVICE,t[Gr.pbMsgP]=B.SYSTEM,t)[e]||B.PRIVATE}(s),o=e.targetId;var l=[B.GROUP,B.CHATROOM,B.RTC_ROOM,B.ULTRA_GROUP].includes(i)?o:void 0,c=zl(a.sessionId),d=c.isPersited,f=c.isCounted,p=c.isMentioned,h=c.disableNotification,g=c.canIncludeExpansion;return{fromUserId:t,type:i,groupId:l,classname:a.classname,content:a.content,dataTime:n,status:Yl(d,f,p,h,g),msgId:r,direction:_e.SEND,clientUniqueId:a.clientUniqueId,extraContent:a.extraContent,pushContent:a.pushText,configFlag:a.configFlag,pushExt:a.pushExt,busChannel:a.busChannel,toUserIds:a.toUserIds,optionBits:a.optionBits}},Jl=function(e,t,n,r){var i=e.type;r||(r=[B.GROUP,B.CHATROOM,B.RTC_ROOM,B.ULTRA_GROUP].includes(i)?e.groupId:e.fromUserId);var o,a,s,u={isPersited:!!(16&(o=e.status)),isCounted:!!(32&o),isMentioned:!!(64&o),disableNotification:!!(512&o),receivedStatus:2&o?Ie.RETRIEVED:Ie.READ,canIncludeExpansion:!!(1024&o)},l=u.isMentioned,c=u.disableNotification,d=u.receivedStatus,f=u.canIncludeExpansion,p=e.direction===_e.SEND?_e.SEND:_e.RECEIVE,h=en(e.configFlag||0,e.pushContent,e.pushExt),g=(a=e.extStatus,{isInterrupt:!!(2&(s=a||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s)}),_=g.isInterrupt,b=g.isModifyMessage,E=g.isPrivateChannel,v=vr(e.classname),m=v.isStatusMessage,y=v.isCounted,I=v.isPersited;return{conversationType:i,targetId:r,senderUserId:p===_e.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:I,isCounted:y,isMentioned:l,sentTime:e.dataTime,messageDirection:p,receivedTime:Date.now(),disableNotification:c,receivedStatus:d,receivedStatusInfo:Vt(d),canIncludeExpansion:f,content:Kl(e.content),expansion:e.extraContent?Ql(e.extraContent):null,pushConfig:h,channelId:e.busChannel||"",isInterrupt:_,isModifyMessage:b,messageId:e.clientUniqueId||0,sentStatus:ae.SENT,isOffLineMessage:e.dataTime<n,channelType:E?ee.PRIVATE:ee.PUBLIC,isStatusMessage:m||!1,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0}},zl=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}};function Xl(e){return 1&~((null==e?void 0:e.sessionMode)||0)?mn(x.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):vn()}var Zl=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),$l=48,ec=64,tc=80,nc=96,rc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ic=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var i=[],o=[],a=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=ac(e.length),n=String.fromCharCode(tc|t.length);i.push(n+t)}else{var r=String.fromCharCode(nc|e.length);i.push(r)}i.push(e)}},s=0;s<e.length;){var u=oc(t,e,s);if(u.length<2)o.push(e.charAt(s++));else if(u.length<4)o.push(e.substr(s,u.length)),s+=u.length;else{var l=ac(s-u.offset),c=ac(u.length);if(l.length+c.length>=u.length)o.push(e.substr(s,u.length)),s+=u.length;else{a();var d=String.fromCharCode(ec|l.length<<2|c.length);i.push(d+l+c),s+=u.length}}}a();var f=ac(e.length),p=String.fromCharCode($l|f.length);return i.push(p+f),i.join("")},oc=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var o=t.length-n,a=0,s=i.length;a<s;a++){var u=i[a],l=n-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,f=d;f<c&&t.charAt(u+f)===t.charAt(n+f);f++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},ac=function(e){var t=[],n=0;do{n=e%62,t.push(rc.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},sc={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},uc=function(){function e(e,t,n){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kvCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._chatroomId=t,this._currentUserId=n}return Object.defineProperty(e.prototype,"_add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e}}),Object.defineProperty(e.prototype,"_remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)}}),Object.defineProperty(e.prototype,"_setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.key,r=e.type,i=e.isOverwrite,o=e.userId,a=this._getSetUserId(n),s=r===D.DELETE,u=a===o,l=!this._isExisted(n),c=s?this._remove:this._add;(t||i||u||l)&&c.call(this,e)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version}}),Object.defineProperty(e.prototype,"getAllValue",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e}}),Object.defineProperty(e.prototype,"_getSetUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(this._kvCaches[e]||{}).userId}}),Object.defineProperty(e.prototype,"_isExisted",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r}}),Object.defineProperty(e.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)}))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._kvCaches={}}}),e}(),lc=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storeCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,n=e.timestamp,(r=sc.get(t))>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,this._isPulling=!1,o===x.SUCCESS?(sc.set(t,s.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){sc.clear(e);var t=this._storeCaches[e];null==t||t.clear()}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"setLocal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._storeCaches[e];Ot(r)||(r=new uc(this._engine.getInnerLogger(),e,n)),r.setEntries(t),this._storeCaches[e]=r}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null}}),Object.defineProperty(e.prototype,"getAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n}}),e}(),cc=function(){function e(e){Object.defineProperty(this,"_canJoinMulipleChrm",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_joinedChrmsInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){void 0===t&&(t=10),void 0===n&&(n=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:n}}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._joinedChrmsInfo[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._joinedChrmsInfo={}}}),e}(),dc={};function fc(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:1,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Wn.getMiniCmpUrlList().join(",")}}var pc=function(e){function n(t,n,r,i,o){void 0===i&&(i="default");var a=e.call(this,t,n,r,zo.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),zo.useNavi,o)||this;return a._environment=i,a}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(n),"&callBack=x&v=").concat(xe,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(zo.tag),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o),r),[4,zo.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!zo.useNavi&&i?[2,vn(fc())]:[2,mn(this.transHttpCode(s.status))];try{return 0===(u=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(o)?"https":"http",l.code&&200!==l.code?[2,mn(this.transHttpCode(l.code))]:(zo.useNavi||(l.server="",l.backupServer=Wn.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,vn(l)])}catch(e){this.logger.error(H.L_PARSE_NAVI_E,s.data,r)}return[2,mn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:zo.tag,protocol:(/^https/.test(e)?q.WSS:q.WS).toString()}),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o.url),r),[4,zo.httpReq(o)];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!zo.useNavi&&i?[2,vn(fc())]:[2,mn(this.transHttpCode(s.status))];try{return u=s.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",zo.useNavi||(l.logSwitch=0,c=Wn.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?q.WSS:q.WS,weight:c.length-t}}))),[2,vn(l)]}catch(e){this.logger.error(H.L_PARSE_NAVI_E,s.data,r)}return[2,mn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.getCatchKey(e);if(dc[n])return dc[n];var r,i=Ke(this.appkey),o=zo.localStorage;try{var a=o.getItem(i);r=a?JSON.parse(a):[]}catch(e){r=[]}if(0===r.length)return null;var s=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return dc[n]=s,s}}),Object.defineProperty(n.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=this,i=Ke(this.appkey),o=zo.localStorage;try{var a=o.getItem(i);n=a?JSON.parse(a):[]}catch(e){n=[]}var s=Date.now();n.length>0&&(n=n.filter((function(t){return s-t.timestamp<Ge&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:s,naviInfo:t,token:e,environment:this._environment};n.push(u),o.setItem(i,JSON.stringify(n)),dc[this.getCatchKey(e)]=u}}),n}(br),hc=function(){function e(e){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_sendMessageMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_userId",{enumerable:!0,configurable:!0,writable:!0,value:""})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._userId=e;var t=et(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=zo.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var n=et(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,zo.localStorage.setItem(n,JSON.stringify(r))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=et(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),zo.localStorage.setItem(t,JSON.stringify(n))}}),e}(),gc=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[ce.ONLINE_STATUS]={},t[ce.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[ce.ONLINE_STATUS]={},e[ce.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===ce.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===ce.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.subscribeData[e][t];return n?r({},n):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.subscribeData[e][t]=n}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._ownProfile=r(r({},e),{extraProfile:r({},e.extraProfile)})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?r(r({},this._ownProfile),{extraProfile:r({},this._ownProfile.extraProfile)}):null}}),e}(),_c=function(){function e(e){Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_relationshipStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subUserStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_ownProfileVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subStore=new gc(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;void 0===t&&(t=!1);var r=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,a,s=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===de.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(l,s),void o.push(e);var d=n._subStore.getSubscribeUserData(l,s);if(!(d&&d.subscribeTime>=u)){if(l===ce.ONLINE_STATUS){r.push(s);var f=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:f})}else{i.push(s);var p=null===(a=d)||void 0===a?void 0:a.profile;n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:p,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(ce.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(ce.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,a=t._subStore.getSubscribeUserData(ce.ONLINE_STATUS,i);if(a){var s=[],u=r({},a.statusMap);o.forEach((function(e){var t=u[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var n={eventValue:e.value,changeTime:e.versionTime};u[e.platformInfo]=n,s.push(r(r({},n),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(ce.ONLINE_STATUS,i,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:i,subscribeType:ce.ONLINE_STATUS,statusMap:u}),n.push({userId:i,subscribeType:ce.ONLINE_STATUS,subscribeTime:a.subscribeTime,expiry:a.expiry,details:s})}})),n}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.userId,o=e.version,a=e.userProfile,s=e.userExtProfile,u=t._subStore.getSubscribeUserData(ce.USER_PROFILE,i),l=kt(i,a,s);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(ce.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:ce.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&n.push({userId:i,subscribeType:ce.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:r({},l)})):t._subStore.updateSubscribeUserData(ce.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:ce.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),n}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,i=[];return t.forEach((function(t){var o=n._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+n._delayTime-o.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var a={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===ce.ONLINE_STATUS){var s=o.statusMap,u=Object.keys(s).map((function(e){return r({platform:~~e},s[~~e])}));a.details=Gt(u)}else if(e===ce.USER_PROFILE&&!o.isSubscribed)return;i.push(a)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(ce.USER_PROFILE,e);if(o&&o.profile){var a=o.profile,s=a.version,u=a.info;if(o.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void i.push(e):void n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}));t._delayTime+Date.now()-s>6e5?i.push(e):n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}))}else i.push(e)})),{list:n,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===ce.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return r({platform:~~e},t.statusMap[~~e])}));n.details=Gt(i)}return n}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),bc=function(){function e(e,t,n,r,i,o,a){Object.defineProperty(this,"_connectManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_isPullingRelationship",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullRelationshipQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullRelationshipFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isPullingSubUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullSubUserStatusQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullSubUserStatusFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subscribeService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subscribeService=new _c(r)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(ce.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(ce.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(ce.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(ce.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!0),o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingRelationship?[2]:(this._isPullingRelationship=!0,[4,this._pullSubscribeRelationship(e)]);case 1:return t.sent(),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0?(this._pullRelationshipQueue.length=0,[4,this._syncSubscribeRelationship(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h,g,_,b;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),i=this._connectManager.codec.encodePullUserSubReq({version:n,pageToken:t}),o=new ro(Gr.pullUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Gs)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?(this._pullRelationshipFailTime=0,c=l.list,d=l.version,f=l.hasNext,p=l.pageToken,d=Ut(d),c.forEach((function(e){e.subTime=Ut(e.subTime)})),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,data:l}),r),e?(h=this._subscribeService.updateSubscribeRelation(c),g=h.newSubscribeOnlineStatusList,_=h.newSubscribeUserProfileList,(b=h.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(b),g.length>0&&this._queryAndUpdateUserOnlineStatus(g),_.length>0&&this._queryAndUpdateUserProfile(_)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(d),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>d})),f?[4,this._pullSubscribeRelationship(e,p)]:[3,3]):(this._logger.error(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,failTime:this._pullRelationshipFailTime}),r),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:a.sent(),a.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingSubUserStatus?[2]:(this._isPullingSubUserStatus=!0,[4,this._pullSubscribeUserStatus(e)]);case 1:return t.sent(),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0?(this._pullSubUserStatusQueue.length=0,[4,this._syncSubscribeUserStatus(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h,g,_;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),i=this._connectManager.codec.encodePullSubDataReq({version:n,needAllData:e,pageToken:t}),o=new ro(Gr.pullSubData,i,this._currentUserId),[4,this._connectManager.send(o,Fs)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?(this._pullSubUserStatusFailTime=0,c=l.list,d=l.versionTime,f=l.hasNext,p=l.pageToken,h=l.isFull,d=Ut(d),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,data:l}),r),c.forEach((function(e){e.data.forEach((function(e){e.versionTime=Ut(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>d})),this._subscribeService.updateSubscribeUserStatusVersion(d),g=[],_=[],c.forEach((function(e){e.subType===ce.ONLINE_STATUS?g.push(e):e.subType===ce.USER_PROFILE&&_.push(e.subUserId)})),h&&""===t&&this._subscribeService.clearSubscribeStatus(),g.length>0&&this._updateUserOnlineStatus(g,!h),_.length>0?[4,this._queryAndUpdateUserProfile(_,!h)]:[3,3]):(this._logger.warn(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:a.sent(),a.label=3;case 3:return f?[4,this._pullSubscribeUserStatus(e,p)]:[3,5];case 4:a.sent(),a.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=this._connectManager.codec.encodeQrySubDataReq(ce.ONLINE_STATUS,e),r=new ro(Gr.qrySubData,n,this._currentUserId),[4,this._connectManager.send(r,Fs)];case 1:return i=a.sent(),o=i.code,s=i.data,this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:o,data:s}),t),o===x.SUCCESS&&s?(this._updateUserOnlineStatus(s.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=Ut(e.versionTime)}))}));var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._logger.createTraceId(),this._logger.info(H.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=this._connectManager.codec.encodePullUserProfileReq(e),i=new ro(Gr.pullUserProfile,r,this._currentUserId),[4,this._connectManager.send(i,Qs)];case 1:return o=a.sent(),s=o.code,u=o.data,this._logger.info(H.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:u}),n),s===x.SUCCESS&&u?(u.UserProfile.forEach((function(e){e.version=Ut(e.version)})),l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,{code:s,data:u.UserProfile}]):[2,{code:s}]}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.pbData,xs)).subType!==ce.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==ce.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==ce.FRIEND_ONLINE_STATUS?[3,3]:(n=t.data.map((function(e){return{changeTime:Ut(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==ce.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=o.sent(),(i=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:kt(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._subscribeService.getSubscribeUserList(e,t,n)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this._connectManager.codec.encodeUpdateUserSubReq(t,e,n,r),o=new ro(Gr.updUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Vs)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&l?[2,{code:u,data:l.subUsers.map((function(e){return e.subUserId}))}]:u===x.SUCCESS&&l?(c=l.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===de.SUBSCRIBE&&(t===ce.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===ce.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:u}]):[2,{code:u}]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,Promise.resolve({code:x.SUCCESS,data:r})]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS&&s?(c=s.map((function(e){return kt(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:o,data:l(l([],u(r),!1),u(c),!1)}]):[2,{code:o,data:l([],u(r),!1)}]}}))}))}}),Object.defineProperty(e.prototype,"syncOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(H.L_PULL_OWN_PROFILE_T,"",t),n=this._connectManager.codec.encodeUserProfileInput(),r=new ro(Gr.pullOwnProfile,n,this._currentUserId),[4,this._connectManager.send(r,Hs)]):[2,Promise.resolve({code:x.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return i=a.sent(),o=i.code,s=i.data,this._logger.info(H.L_PULL_OWN_PROFILE_R,JSON.stringify({code:o,data:s}),t),o===x.SUCCESS&&s?(u=s.userExtProfile,l=s.userProfile,c=s.version,d=s.userId,f=Ut(c),p=kt(d,l,u),this._subscribeService.updateOwnProfile(p,f),e&&this._event.ownUserProfileChanged(p),[2,{code:o,data:p}]):[2,{code:o}]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:x.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Ec=function(){function e(e,t,n){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new Gl(ot(e,t)),this._delayTime=n,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=s(r),a=o.next();!a.done;a=o.next()){var u=a.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){var a;if(!(i<Date.now()-this._delayTime-Ye)){var s=this._getConversationKey(e),u=this._storage.get(s)||{};if(!u[t]){var l={t:i,d:n};o&&(l.sId=o);var c=r(r({},u),((a={})[t]=l,a));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(s,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i,o=this._getConversationKey(e),a=this._storage.get(o)||{},s=a[t];if(s){if(s.us){if(s.us.includes(n))return}else s.us=[];s.us.push(n),this._storage.set(o,r(r({},a),((i={})[t]=s,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var i in n){var o=n[i];o.d===_e.RECEIVE&&(r[o.sId]||(r[o.sId]=[]),r[o.sId].push(i))}return r}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],i={};for(var o in r){var a=r[o];Date.now()-this._delayTime-a.t<Ye&&(i[o]=a)}Object.keys(i).length&&(t[n]=i)}this._storage.update(t)}}),e}(),vc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return Object.defineProperty(r,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),r._storageKey=rt(t),r}return t(n,e),Object.defineProperty(n.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return zo.localStorage.getItem(this._storageKey)}}),Object.defineProperty(n.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){zo.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(n.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){zo.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(n.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,zo.httpReq({url:e})];case 1:return t=i.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))}}),Object.defineProperty(n.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,sn(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))}}),n}(Jn);function mc(e){let t=e.length;for(;--t>=0;)e[t]=0}const yc=256,Ic=286,Tc=30,Rc=15,Oc=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Sc=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Cc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ac=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pc=new Array(576);mc(Pc);const Nc=new Array(60);mc(Nc);const wc=new Array(512);mc(wc);const Lc=new Array(256);mc(Lc);const Mc=new Array(29);mc(Mc);const Uc=new Array(Tc);function Dc(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let Vc,jc,Gc;function kc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}mc(Uc);const Fc=e=>e<256?wc[e]:wc[256+(e>>>7)],xc=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Bc=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,xc(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Hc=(e,t,n)=>{Bc(e,n[2*t],n[2*t+1])},qc=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Yc=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=Rc;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=qc(r[t]++,t))}},Kc=e=>{let t;for(t=0;t<Ic;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Tc;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Qc=e=>{e.bi_valid>8?xc(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Wc=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},Jc=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Wc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Wc(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},zc=(e,t,n)=>{let r,i,o,a,s=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+s++],r+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===r?Hc(e,i,t):(o=Lc[i],Hc(e,o+yc+1,t),a=Oc[o],0!==a&&(i-=Mc[o],Bc(e,i,a)),r--,o=Fc(r),Hc(e,o,n),a=Sc[o],0!==a&&(r-=Uc[o],Bc(e,r,a)))}while(s<e.sym_next);Hc(e,256,t)},Xc=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==n[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[2*u+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)Jc(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Jc(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,Jc(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,f,p,h,g=0;for(f=0;f<=Rc;f++)e.bl_count[f]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],f=n[2*n[2*c+1]+1]+1,f>u&&(f=u,g++),n[2*c+1]=f,c>r||(e.bl_count[f]++,p=0,c>=s&&(p=a[c-s]),h=n[2*c],e.opt_len+=h*(f+p),o&&(e.static_len+=h*(i[2*c+1]+p)));if(0!==g){do{for(f=u-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(f=u;0!==f;f--)for(c=e.bl_count[f];0!==c;)d=e.heap[--l],d>r||(n[2*d+1]!==f&&(e.opt_len+=(f-n[2*d+1])*n[2*d],n[2*d+1]=f),c--)}})(e,t),Yc(n,l,e.bl_count)},Zc=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4))},$c=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<l)do{Hc(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(Hc(e,i,e.bl_tree),s--),Hc(e,16,e.bl_tree),Bc(e,s-3,2)):s<=10?(Hc(e,17,e.bl_tree),Bc(e,s-3,3)):(Hc(e,18,e.bl_tree),Bc(e,s-11,7));s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4)}};let ed=!1;const td=(e,t,n,r)=>{Bc(e,0+(r?1:0),3),Qc(e),xc(e,n),xc(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var nd=(e,t,n,r)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<yc;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Xc(e,e.l_desc),Xc(e,e.d_desc),a=(e=>{let t;for(Zc(e,e.dyn_ltree,e.l_desc.max_code),Zc(e,e.dyn_dtree,e.d_desc.max_code),Xc(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Ac[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?td(e,t,n,r):4===e.strategy||o===i?(Bc(e,2+(r?1:0),3),zc(e,Pc,Nc)):(Bc(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(Bc(e,t-257,5),Bc(e,n-1,5),Bc(e,r-4,4),i=0;i<r;i++)Bc(e,e.bl_tree[2*Ac[i]+1],3);$c(e,e.dyn_ltree,t-1),$c(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),zc(e,e.dyn_ltree,e.dyn_dtree)),Kc(e),r&&Qc(e)},rd={_tr_init:e=>{ed||((()=>{let e,t,n,r,i;const o=new Array(16);for(n=0,r=0;r<28;r++)for(Mc[r]=n,e=0;e<1<<Oc[r];e++)Lc[n++]=r;for(Lc[n-1]=r,i=0,r=0;r<16;r++)for(Uc[r]=i,e=0;e<1<<Sc[r];e++)wc[i++]=r;for(i>>=7;r<Tc;r++)for(Uc[r]=i<<7,e=0;e<1<<Sc[r]-7;e++)wc[256+i++]=r;for(t=0;t<=Rc;t++)o[t]=0;for(e=0;e<=143;)Pc[2*e+1]=8,e++,o[8]++;for(;e<=255;)Pc[2*e+1]=9,e++,o[9]++;for(;e<=279;)Pc[2*e+1]=7,e++,o[7]++;for(;e<=287;)Pc[2*e+1]=8,e++,o[8]++;for(Yc(Pc,287,o),e=0;e<Tc;e++)Nc[2*e+1]=5,Nc[2*e]=qc(e,5);Vc=new Dc(Pc,Oc,257,Ic,Rc),jc=new Dc(Nc,Sc,0,Tc,Rc),Gc=new Dc(new Array(0),Cc,0,19,7)})(),ed=!0),e.l_desc=new kc(e.dyn_ltree,Vc),e.d_desc=new kc(e.dyn_dtree,jc),e.bl_desc=new kc(e.bl_tree,Gc),e.bi_buf=0,e.bi_valid=0,Kc(e)},_tr_stored_block:td,_tr_flush_block:nd,_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Lc[n]+yc+1)]++,e.dyn_dtree[2*Fc(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Bc(e,2,3),Hc(e,256,Pc),(e=>{16===e.bi_valid?(xc(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var id=(e,t,n,r)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};const od=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var ad=(e,t,n,r)=>{const i=od,o=r+n;e^=-1;for(let n=r;n<o;n++)e=e>>>8^i[255&(e^t[n])];return~e},sd={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ud={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:ld,_tr_stored_block:cd,_tr_flush_block:dd,_tr_tally:fd,_tr_align:pd}=rd,{Z_NO_FLUSH:hd,Z_PARTIAL_FLUSH:gd,Z_FULL_FLUSH:_d,Z_FINISH:bd,Z_BLOCK:Ed,Z_OK:vd,Z_STREAM_END:md,Z_STREAM_ERROR:yd,Z_DATA_ERROR:Id,Z_BUF_ERROR:Td,Z_DEFAULT_COMPRESSION:Rd,Z_FILTERED:Od,Z_HUFFMAN_ONLY:Sd,Z_RLE:Cd,Z_FIXED:Ad,Z_DEFAULT_STRATEGY:Pd,Z_UNKNOWN:Nd,Z_DEFLATED:wd}=ud,Ld=258,Md=262,Ud=42,Dd=113,Vd=666,Gd=(e,t)=>(e.msg=sd[t],t),kd=e=>2*e-(e>4?9:0),Fd=e=>{let t=e.length;for(;--t>=0;)e[t]=0},xd=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let Bd=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Hd=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},qd=(e,t)=>{dd(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Hd(e.strm)},Yd=(e,t)=>{e.pending_buf[e.pending++]=t},Kd=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Qd=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=id(e.adler,t,i,n):2===e.state.wrap&&(e.adler=ad(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Wd=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-Md?e.strstart-(e.w_size-Md):0,l=e.window,c=e.w_mask,d=e.prev,f=e.strstart+Ld;let p=l[o+a-1],h=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===h&&l[n+a-1]===p&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<f);if(r=Ld-(f-o),o=f-Ld,r>a){if(e.match_start=t,a=r,r>=s)break;p=l[o+a-1],h=l[o+a]}}}while((t=d[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},Jd=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Md)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),xd(e),r+=t),0===e.strm.avail_in)break;if(n=Qd(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Bd(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Bd(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Md&&0!==e.strm.avail_in)},zd=(e,t)=>{let n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>i&&(n=i),n<o&&(0===n&&t!==bd||t===hd||n!==r+e.strm.avail_in))break;a=t===bd&&n===r+e.strm.avail_in?1:0,cd(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Hd(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(Qd(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===a);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==hd&&t!==bd&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(Qd(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,r=e.strstart-e.block_start,(r>=o||(r||t===bd)&&t!==hd&&0===e.strm.avail_in&&r<=i)&&(n=r>i?i:r,a=t===bd&&0===e.strm.avail_in&&n===r?1:0,cd(e,e.block_start,n,a),e.block_start+=n,Hd(e.strm)),a?3:1)},Xd=(e,t)=>{let n,r;for(;;){if(e.lookahead<Md){if(Jd(e),e.lookahead<Md&&t===hd)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Bd(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-Md&&(e.match_length=Wd(e,n)),e.match_length>=3)if(r=fd(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Bd(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Bd(e,e.ins_h,e.window[e.strstart+1]);else r=fd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(qd(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===bd?(qd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qd(e,!1),0===e.strm.avail_out)?1:2},Zd=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Md){if(Jd(e),e.lookahead<Md&&t===hd)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Bd(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Md&&(e.match_length=Wd(e,n),e.match_length<=5&&(e.strategy===Od||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=fd(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=Bd(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(qd(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=fd(e,0,e.window[e.strstart-1]),r&&qd(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=fd(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===bd?(qd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qd(e,!1),0===e.strm.avail_out)?1:2};function $d(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const ef=[new $d(0,0,0,0,zd),new $d(4,4,8,4,Xd),new $d(4,5,16,8,Xd),new $d(4,6,32,32,Xd),new $d(4,4,16,16,Zd),new $d(8,16,32,32,Zd),new $d(8,16,128,128,Zd),new $d(8,32,128,256,Zd),new $d(32,128,258,1024,Zd),new $d(32,258,258,4096,Zd)];function tf(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=wd,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Fd(this.dyn_ltree),Fd(this.dyn_dtree),Fd(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Fd(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Fd(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const nf=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Ud&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Dd&&t.status!==Vd?1:0},rf=e=>{if(nf(e))return Gd(e,yd);e.total_in=e.total_out=0,e.data_type=Nd;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Ud:Dd,e.adler=2===t.wrap?0:1,t.last_flush=-2,ld(t),vd},of=e=>{const t=rf(e);var n;return t===vd&&((n=e.state).window_size=2*n.w_size,Fd(n.head),n.max_lazy_match=ef[n.level].max_lazy,n.good_match=ef[n.level].good_length,n.nice_match=ef[n.level].nice_length,n.max_chain_length=ef[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},af=(e,t,n,r,i,o)=>{if(!e)return yd;let a=1;if(t===Rd&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==wd||r<8||r>15||t<0||t>9||o<0||o>Ad||8===r&&1!==a)return Gd(e,yd);8===r&&(r=9);const s=new tf;return e.state=s,s.strm=e,s.status=Ud,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=o,s.method=n,of(e)};var sf={deflateInit:(e,t)=>af(e,t,wd,15,8,Pd),deflateInit2:af,deflateReset:of,deflateResetKeep:rf,deflateSetHeader:(e,t)=>nf(e)||2!==e.state.wrap?yd:(e.state.gzhead=t,vd),deflate:(e,t)=>{if(nf(e)||t>Ed||t<0)return e?Gd(e,yd):yd;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===Vd&&t!==bd)return Gd(e,0===e.avail_out?Td:yd);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Hd(e),0===e.avail_out)return n.last_flush=-1,vd}else if(0===e.avail_in&&kd(t)<=kd(r)&&t!==bd)return Gd(e,Td);if(n.status===Vd&&0!==e.avail_in)return Gd(e,Td);if(n.status===Ud&&0===n.wrap&&(n.status=Dd),n.status===Ud){let t=wd+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=Sd||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,Kd(n,t),0!==n.strstart&&(Kd(n,e.adler>>>16),Kd(n,65535&e.adler)),e.adler=1,n.status=Dd,Hd(e),0!==n.pending)return n.last_flush=-1,vd}if(57===n.status)if(e.adler=0,Yd(n,31),Yd(n,139),Yd(n,8),n.gzhead)Yd(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Yd(n,255&n.gzhead.time),Yd(n,n.gzhead.time>>8&255),Yd(n,n.gzhead.time>>16&255),Yd(n,n.gzhead.time>>24&255),Yd(n,9===n.level?2:n.strategy>=Sd||n.level<2?4:0),Yd(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Yd(n,255&n.gzhead.extra.length),Yd(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=ad(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Yd(n,0),Yd(n,0),Yd(n,0),Yd(n,0),Yd(n,0),Yd(n,9===n.level?2:n.strategy>=Sd||n.level<2?4:0),Yd(n,3),n.status=Dd,Hd(e),0!==n.pending)return n.last_flush=-1,vd;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=ad(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,Hd(e),0!==n.pending)return n.last_flush=-1,vd;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=ad(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=ad(e.adler,n.pending_buf,n.pending-r,r)),Hd(e),0!==n.pending)return n.last_flush=-1,vd;r=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Yd(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=ad(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=ad(e.adler,n.pending_buf,n.pending-r,r)),Hd(e),0!==n.pending)return n.last_flush=-1,vd;r=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Yd(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=ad(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Hd(e),0!==n.pending))return n.last_flush=-1,vd;Yd(n,255&e.adler),Yd(n,e.adler>>8&255),e.adler=0}if(n.status=Dd,Hd(e),0!==n.pending)return n.last_flush=-1,vd}if(0!==e.avail_in||0!==n.lookahead||t!==hd&&n.status!==Vd){let r=0===n.level?zd(n,t):n.strategy===Sd?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(Jd(e),0===e.lookahead)){if(t===hd)return 1;break}if(e.match_length=0,n=fd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(qd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===bd?(qd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qd(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===Cd?((e,t)=>{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=Ld){if(Jd(e),e.lookahead<=Ld&&t===hd)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+Ld;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=Ld-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=fd(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=fd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(qd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===bd?(qd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qd(e,!1),0===e.strm.avail_out)?1:2})(n,t):ef[n.level].func(n,t);if(3!==r&&4!==r||(n.status=Vd),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),vd;if(2===r&&(t===gd?pd(n):t!==Ed&&(cd(n,0,0,!1),t===_d&&(Fd(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Hd(e),0===e.avail_out))return n.last_flush=-1,vd}return t!==bd?vd:n.wrap<=0?md:(2===n.wrap?(Yd(n,255&e.adler),Yd(n,e.adler>>8&255),Yd(n,e.adler>>16&255),Yd(n,e.adler>>24&255),Yd(n,255&e.total_in),Yd(n,e.total_in>>8&255),Yd(n,e.total_in>>16&255),Yd(n,e.total_in>>24&255)):(Kd(n,e.adler>>>16),Kd(n,65535&e.adler)),Hd(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?vd:md)},deflateEnd:e=>{if(nf(e))return yd;const t=e.state.status;return e.state=null,t===Dd?Gd(e,Id):vd},deflateSetDictionary:(e,t)=>{let n=t.length;if(nf(e))return yd;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==Ud||r.lookahead)return yd;if(1===i&&(e.adler=id(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(Fd(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Jd(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Bd(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,Jd(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,vd},deflateInfo:"pako deflate (from Nodeca project)"};const uf=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var lf={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)uf(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}};let cf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){cf=!1}const df=new Uint8Array(256);for(let e=0;e<256;e++)df[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;df[254]=df[254]=1;var ff={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},buf2string:(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,i;const o=new Array(2*n);for(i=0,r=0;r<n;){let t=e[r++];if(t<128){o[i++]=t;continue}let a=df[t];if(a>4)o[i++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<n;)t=t<<6|63&e[r++],a--;a>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&cf)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+df[e[n]]>t?n:t}};var pf=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const hf=Object.prototype.toString,{Z_NO_FLUSH:gf,Z_SYNC_FLUSH:_f,Z_FULL_FLUSH:bf,Z_FINISH:Ef,Z_OK:vf,Z_STREAM_END:mf,Z_DEFAULT_COMPRESSION:yf,Z_DEFAULT_STRATEGY:If,Z_DEFLATED:Tf}=ud;function Rf(e){this.options=lf.assign({level:yf,method:Tf,chunkSize:16384,windowBits:15,memLevel:8,strategy:If},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pf,this.strm.avail_out=0;let n=sf.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==vf)throw new Error(sd[n]);if(t.header&&sf.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?ff.string2buf(t.dictionary):"[object ArrayBuffer]"===hf.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=sf.deflateSetDictionary(this.strm,e),n!==vf)throw new Error(sd[n]);this._dict_set=!0}}Rf.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Ef:gf,"string"==typeof e?n.input=ff.string2buf(e):"[object ArrayBuffer]"===hf.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===_f||o===bf)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=sf.deflate(n,o),i===mf)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=sf.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===vf;if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Rf.prototype.onData=function(e){this.chunks.push(e)},Rf.prototype.onEnd=function(e){e===vf&&(this.result=lf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Of=16209;var Sf=function(e,t){let n,r,i,o,a,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I,T,R,O;const S=e.state;n=e.next_in,R=e.input,r=n+(e.avail_in-5),i=e.next_out,O=e.output,o=i-(t-e.avail_out),a=i+(e.avail_out-257),s=S.dmax,u=S.wsize,l=S.whave,c=S.wnext,d=S.window,f=S.hold,p=S.bits,h=S.lencode,g=S.distcode,_=(1<<S.lenbits)-1,b=(1<<S.distbits)-1;e:do{p<15&&(f+=R[n++]<<p,p+=8,f+=R[n++]<<p,p+=8),E=h[f&_];t:for(;;){if(v=E>>>24,f>>>=v,p-=v,v=E>>>16&255,0===v)O[i++]=65535&E;else{if(!(16&v)){if(64&v){if(32&v){S.mode=16191;break e}e.msg="invalid literal/length code",S.mode=Of;break e}E=h[(65535&E)+(f&(1<<v)-1)];continue t}for(m=65535&E,v&=15,v&&(p<v&&(f+=R[n++]<<p,p+=8),m+=f&(1<<v)-1,f>>>=v,p-=v),p<15&&(f+=R[n++]<<p,p+=8,f+=R[n++]<<p,p+=8),E=g[f&b];;){if(v=E>>>24,f>>>=v,p-=v,v=E>>>16&255,16&v){if(y=65535&E,v&=15,p<v&&(f+=R[n++]<<p,p+=8,p<v&&(f+=R[n++]<<p,p+=8)),y+=f&(1<<v)-1,y>s){e.msg="invalid distance too far back",S.mode=Of;break e}if(f>>>=v,p-=v,v=i-o,y>v){if(v=y-v,v>l&&S.sane){e.msg="invalid distance too far back",S.mode=Of;break e}if(I=0,T=d,0===c){if(I+=u-v,v<m){m-=v;do{O[i++]=d[I++]}while(--v);I=i-y,T=O}}else if(c<v){if(I+=u+c-v,v-=c,v<m){m-=v;do{O[i++]=d[I++]}while(--v);if(I=0,c<m){v=c,m-=v;do{O[i++]=d[I++]}while(--v);I=i-y,T=O}}}else if(I+=c-v,v<m){m-=v;do{O[i++]=d[I++]}while(--v);I=i-y,T=O}for(;m>2;)O[i++]=T[I++],O[i++]=T[I++],O[i++]=T[I++],m-=3;m&&(O[i++]=T[I++],m>1&&(O[i++]=T[I++]))}else{I=i-y;do{O[i++]=O[I++],O[i++]=O[I++],O[i++]=O[I++],m-=3}while(m>2);m&&(O[i++]=O[I++],m>1&&(O[i++]=O[I++]))}break}if(64&v){e.msg="invalid distance code",S.mode=Of;break e}E=g[(65535&E)+(f&(1<<v)-1)]}}break}}while(n<r&&i<a);m=p>>3,n-=m,p-=m<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=i<a?a-i+257:257-(i-a),S.hold=f,S.bits=p};const Cf=15,Af=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Pf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Nf=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),wf=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Lf=(e,t,n,r,i,o,a,s)=>{const u=s.bits;let l,c,d,f,p,h,g=0,_=0,b=0,E=0,v=0,m=0,y=0,I=0,T=0,R=0,O=null;const S=new Uint16Array(16),C=new Uint16Array(16);let A,P,N,w=null;for(g=0;g<=Cf;g++)S[g]=0;for(_=0;_<r;_++)S[t[n+_]]++;for(v=u,E=Cf;E>=1&&0===S[E];E--);if(v>E&&(v=E),0===E)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(b=1;b<E&&0===S[b];b++);for(v<b&&(v=b),I=1,g=1;g<=Cf;g++)if(I<<=1,I-=S[g],I<0)return-1;if(I>0&&(0===e||1!==E))return-1;for(C[1]=0,g=1;g<Cf;g++)C[g+1]=C[g]+S[g];for(_=0;_<r;_++)0!==t[n+_]&&(a[C[t[n+_]]++]=_);if(0===e?(O=w=a,h=20):1===e?(O=Af,w=Pf,h=257):(O=Nf,w=wf,h=0),R=0,_=0,g=b,p=o,m=v,y=0,d=-1,T=1<<v,f=T-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){A=g-y,a[_]+1<h?(P=0,N=a[_]):a[_]>=h?(P=w[a[_]-h],N=O[a[_]-h]):(P=96,N=0),l=1<<g-y,c=1<<m,b=c;do{c-=l,i[p+(R>>y)+c]=A<<24|P<<16|N}while(0!==c);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,_++,0==--S[g]){if(g===E)break;g=t[n+a[_]]}if(g>v&&(R&f)!==d){for(0===y&&(y=v),p+=b,m=g-y,I=1<<m;m+y<E&&(I-=S[m+y],!(I<=0));)m++,I<<=1;if(T+=1<<m,1===e&&T>852||2===e&&T>592)return 1;d=R&f,i[d]=v<<24|m<<16|p-o}}return 0!==R&&(i[p+R]=g-y<<24|64<<16),s.bits=v,0};const{Z_FINISH:Mf,Z_BLOCK:Uf,Z_TREES:Df,Z_OK:Vf,Z_STREAM_END:jf,Z_NEED_DICT:Gf,Z_STREAM_ERROR:kf,Z_DATA_ERROR:Ff,Z_MEM_ERROR:xf,Z_BUF_ERROR:Bf,Z_DEFLATED:Hf}=ud,qf=16180,Yf=16190,Kf=16191,Qf=16192,Wf=16194,Jf=16199,zf=16200,Xf=16206,Zf=16209,$f=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function ep(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const tp=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<qf||t.mode>16211?1:0},np=e=>{if(tp(e))return kf;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=qf,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Vf},rp=e=>{if(tp(e))return kf;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,np(e)},ip=(e,t)=>{let n;if(tp(e))return kf;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?kf:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,rp(e))},op=(e,t)=>{if(!e)return kf;const n=new ep;e.state=n,n.strm=e,n.window=null,n.mode=qf;const r=ip(e,t);return r!==Vf&&(e.state=null),r};let ap,sp,up=!0;const lp=e=>{if(up){ap=new Int32Array(512),sp=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Lf(1,e.lens,0,288,ap,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Lf(2,e.lens,0,32,sp,0,e.work,{bits:5}),up=!1}e.lencode=ap,e.lenbits=9,e.distcode=sp,e.distbits=5},cp=(e,t,n,r)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var dp={inflateReset:rp,inflateReset2:ip,inflateResetKeep:np,inflateInit:e=>op(e,15),inflateInit2:op,inflate:(e,t)=>{let n,r,i,o,a,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I,T,R=0;const O=new Uint8Array(4);let S,C;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(tp(e)||!e.output||!e.input&&0!==e.avail_in)return kf;n=e.state,n.mode===Kf&&(n.mode=Qf),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,d=s,f=u,T=Vf;e:for(;;)switch(n.mode){case qf:if(0===n.wrap){n.mode=Qf;break}for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,O[0]=255&l,O[1]=l>>>8&255,n.check=ad(n.check,O,2,0),l=0,c=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Zf;break}if((15&l)!==Hf){e.msg="unknown compression method",n.mode=Zf;break}if(l>>>=4,c-=4,I=8+(15&l),0===n.wbits&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=Zf;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:Kf,l=0,c=0;break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.flags=l,(255&n.flags)!==Hf){e.msg="unknown compression method",n.mode=Zf;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Zf;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,n.check=ad(n.check,O,2,0)),l=0,c=0,n.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,O[2]=l>>>16&255,O[3]=l>>>24&255,n.check=ad(n.check,O,4,0)),l=0,c=0,n.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,n.check=ad(n.check,O,2,0)),l=0,c=0,n.mode=16184;case 16184:if(1024&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,n.check=ad(n.check,O,2,0)),l=0,c=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(p=n.length,p>s&&(p=s),p&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+p),I)),512&n.flags&&4&n.wrap&&(n.check=ad(n.check,r,p,o)),s-=p,o+=p,n.length-=p),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;p=0;do{I=r[o+p++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I))}while(I&&p<s);if(512&n.flags&&4&n.wrap&&(n.check=ad(n.check,r,p,o)),s-=p,o+=p,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;p=0;do{I=r[o+p++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I))}while(I&&p<s);if(512&n.flags&&4&n.wrap&&(n.check=ad(n.check,r,p,o)),s-=p,o+=p,I)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Zf;break}l=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Kf;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}e.adler=n.check=$f(l),l=0,c=0,n.mode=Yf;case Yf:if(0===n.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,Gf;e.adler=n.check=1,n.mode=Kf;case Kf:if(t===Uf||t===Df)break e;case Qf:if(n.last){l>>>=7&c,c-=7&c,n.mode=Xf;break}for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}switch(n.last=1&l,l>>>=1,c-=1,3&l){case 0:n.mode=16193;break;case 1:if(lp(n),n.mode=Jf,t===Df){l>>>=2,c-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Zf}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Zf;break}if(n.length=65535&l,l=0,c=0,n.mode=Wf,t===Df)break e;case Wf:n.mode=16195;case 16195:if(p=n.length,p){if(p>s&&(p=s),p>u&&(p=u),0===p)break e;i.set(r.subarray(o,o+p),a),s-=p,o+=p,u-=p,a+=p,n.length-=p;break}n.mode=Kf;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.nlen=257+(31&l),l>>>=5,c-=5,n.ndist=1+(31&l),l>>>=5,c-=5,n.ncode=4+(15&l),l>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Zf;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.lens[A[n.have++]]=7&l,l>>>=3,c-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},T=Lf(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid code lengths set",n.mode=Zf;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;R=n.lencode[l&(1<<n.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(E<16)l>>>=_,c-=_,n.lens[n.have++]=E;else{if(16===E){for(C=_+2;c<C;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(l>>>=_,c-=_,0===n.have){e.msg="invalid bit length repeat",n.mode=Zf;break}I=n.lens[n.have-1],p=3+(3&l),l>>>=2,c-=2}else if(17===E){for(C=_+3;c<C;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=_,c-=_,I=0,p=3+(7&l),l>>>=3,c-=3}else{for(C=_+7;c<C;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=_,c-=_,I=0,p=11+(127&l),l>>>=7,c-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Zf;break}for(;p--;)n.lens[n.have++]=I}}if(n.mode===Zf)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Zf;break}if(n.lenbits=9,S={bits:n.lenbits},T=Lf(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid literal/lengths set",n.mode=Zf;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},T=Lf(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,T){e.msg="invalid distances set",n.mode=Zf;break}if(n.mode=Jf,t===Df)break e;case Jf:n.mode=zf;case zf:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,Sf(e,f),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,n.mode===Kf&&(n.back=-1);break}for(n.back=0;R=n.lencode[l&(1<<n.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(b&&!(240&b)){for(v=_,m=b,y=E;R=n.lencode[y+((l&(1<<v+m)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=v,c-=v,n.back+=v}if(l>>>=_,c-=_,n.back+=_,n.length=E,0===b){n.mode=16205;break}if(32&b){n.back=-1,n.mode=Kf;break}if(64&b){e.msg="invalid literal/length code",n.mode=Zf;break}n.extra=15&b,n.mode=16201;case 16201:if(n.extra){for(C=n.extra;c<C;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;R=n.distcode[l&(1<<n.distbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(!(240&b)){for(v=_,m=b,y=E;R=n.distcode[y+((l&(1<<v+m)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=v,c-=v,n.back+=v}if(l>>>=_,c-=_,n.back+=_,64&b){e.msg="invalid distance code",n.mode=Zf;break}n.offset=E,n.extra=15&b,n.mode=16203;case 16203:if(n.extra){for(C=n.extra;c<C;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Zf;break}n.mode=16204;case 16204:if(0===u)break e;if(p=f-u,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Zf;break}p>n.wnext?(p-=n.wnext,h=n.wsize-p):h=n.wnext-p,p>n.length&&(p=n.length),g=n.window}else g=i,h=a-n.offset,p=n.length;p>u&&(p=u),u-=p,n.length-=p;do{i[a++]=g[h++]}while(--p);0===n.length&&(n.mode=zf);break;case 16205:if(0===u)break e;i[a++]=n.length,u--,n.mode=zf;break;case Xf:if(n.wrap){for(;c<32;){if(0===s)break e;s--,l|=r[o++]<<c,c+=8}if(f-=u,e.total_out+=f,n.total+=f,4&n.wrap&&f&&(e.adler=n.check=n.flags?ad(n.check,i,f,a-f):id(n.check,i,f,a-f)),f=u,4&n.wrap&&(n.flags?l:$f(l))!==n.check){e.msg="incorrect data check",n.mode=Zf;break}l=0,c=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Zf;break}l=0,c=0}n.mode=16208;case 16208:T=jf;break e;case Zf:T=Ff;break e;case 16210:return xf;default:return kf}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,(n.wsize||f!==e.avail_out&&n.mode<Zf&&(n.mode<Xf||t!==Mf))&&cp(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,4&n.wrap&&f&&(e.adler=n.check=n.flags?ad(n.check,i,f,e.next_out-f):id(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Kf?128:0)+(n.mode===Jf||n.mode===Wf?256:0),(0===d&&0===f||t===Mf)&&T===Vf&&(T=Bf),T},inflateEnd:e=>{if(tp(e))return kf;let t=e.state;return t.window&&(t.window=null),e.state=null,Vf},inflateGetHeader:(e,t)=>{if(tp(e))return kf;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Vf):kf},inflateSetDictionary:(e,t)=>{const n=t.length;let r,i,o;return tp(e)?kf:(r=e.state,0!==r.wrap&&r.mode!==Yf?kf:r.mode===Yf&&(i=1,i=id(i,t,n,0),i!==r.check)?Ff:(o=cp(e,t,n,n),o?(r.mode=16210,xf):(r.havedict=1,Vf)))},inflateInfo:"pako inflate (from Nodeca project)"};var fp=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const pp=Object.prototype.toString,{Z_NO_FLUSH:hp,Z_FINISH:gp,Z_OK:_p,Z_STREAM_END:bp,Z_NEED_DICT:Ep,Z_STREAM_ERROR:vp,Z_DATA_ERROR:mp,Z_MEM_ERROR:yp}=ud;function Ip(e){this.options=lf.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pf,this.strm.avail_out=0;let n=dp.inflateInit2(this.strm,t.windowBits);if(n!==_p)throw new Error(sd[n]);if(this.header=new fp,dp.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=ff.string2buf(t.dictionary):"[object ArrayBuffer]"===pp.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=dp.inflateSetDictionary(this.strm,t.dictionary),n!==_p)))throw new Error(sd[n])}function Tp(e,t){const n=new Ip(t);if(n.push(e),n.err)throw n.msg||sd[n.err];return n.result}Ip.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?gp:hp,"[object ArrayBuffer]"===pp.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=dp.inflate(n,a),o===Ep&&i&&(o=dp.inflateSetDictionary(n,i),o===_p?o=dp.inflate(n,a):o===mp&&(o=Ep));n.avail_in>0&&o===bp&&n.state.wrap>0&&0!==e[n.next_in];)dp.inflateReset(n),o=dp.inflate(n,a);switch(o){case vp:case mp:case Ep:case yp:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||o===bp))if("string"===this.options.to){let e=ff.utf8border(n.output,n.next_out),t=n.next_out-e,i=ff.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==_p||0!==s){if(o===bp)return o=dp.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Ip.prototype.onData=function(e){this.chunks.push(e)},Ip.prototype.onEnd=function(e){e===_p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=lf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Rp={Inflate:Ip,inflate:Tp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Tp(e,t)},ungzip:Tp,constants:ud};const{Inflate:Op,inflate:Sp,inflateRaw:Cp,ungzip:Ap}=Rp;var Pp,Np,wp,Lp,Mp,Up,Dp=Ap,Vp=((Pp={})[Ui]=x.RC_DISCONN_KICK,Pp[Di]=x.RC_DISCONN_EXCEPTION,Pp[ji]=x.RC_DISCONN_EXCEPTION,Pp[Gi]=x.RC_CONN_REDIRECTED,Pp[ki]=x.RC_CONN_TOKEN_EXPIRED,Pp[Fi]=x.RC_CONN_PROTO_VERSION_ERROR,Pp[xi]=x.RC_ACCOUNT_CANCELLATION,Pp),jp=((Np={})[pi]=x.SUCCESS,Np[hi]=x.RC_CONN_PROTO_VERSION_ERROR,Np[gi]=x.RC_CONN_IDENTIFIER_REJECTED,Np[_i]=x.RC_CONN_SERVER_UNAVAILABLE,Np[bi]=x.RC_CONN_TOKEN_INCORRECT,Np[Ei]=x.RC_CONN_NOT_AUTHRORIZED,Np[vi]=x.RC_CONN_REDIRECTED,Np[mi]=x.RC_CONN_PACKAGE_NAME_INVALID,Np[yi]=x.RC_CONN_APP_BLOCKED_OR_DELETED,Np[Ii]=x.RC_CONN_USER_BLOCKED,Np[Ti]=x.RC_CONN_TOKEN_EXPIRED,Np[Ri]=x.RC_CONN_DEVICE_ERROR,Np[Oi]=x.RC_CONN_HOSTNAME_ERROR,Np[Si]=x.RC_DISCONN_SAME_CLIENT_ON_LINE,Np[Ci]=x.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Np[Ai]=x.RC_CONN_WRONG_CLUSTER,Np[Pi]=x.RC_APP_AUTH_NOT_PASS,Np[Ni]=x.RC_OTP_USED,Np[wi]=x.RC_PLATFORM_ERROR,Np[Li]=x.RC_ACCOUNT_CANCELLATION,Np[Mi]=x.RC_LICENSE_EXPIRED,Np),Gp=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n},kp={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},Fp=((wp={})[L.GROUP_OPERATION]=function(e){return"ChannelEventData"},wp[L.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},wp[v.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},wp),xp=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i=this,o=e,a=((r={})[Ca]=i._formatHistoryMessages,r[va]=i._formatConversationList,r[Oa]=i._formatChatRoomInfos,r[Fa]=i._formatChatRoomKVList,r[us]=i._formatGrpReadReceiptQryResp,r[ws]=i._formatQueryReceiptResp,r[Ts]=i._formatUltraOperateStatusNotifyList,r[ys]=i._formatUltraMsgList,r[ya]=i._formatUltraGroupUnreadMentionedList,r[ga]=i._formatChrmKVVersion,r[iu]=i._formateChannelsListResult,r)[t];try{o=e.length>0&&qu.decode(t,e),It(a)&&(o=a.call(this,o,n))}catch(e){this.logger.error(H.L_PB_DECODE_E,t)}return o}}),Object.defineProperty(e.prototype,"_formatJSONContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return JSON.parse(e)}catch(t){return this.logger.error(H.L_PARSE_JSON_E,e),e}}}),Object.defineProperty(e.prototype,"_getUtfContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.user){var t=e.user,n=t.portrait,r=t.portraitUri,i=n||r;i&&(e.user.portrait=e.user.portraitUri=i)}return e}}),Object.defineProperty(e.prototype,"_setExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return e&&(t=function(e){var t={},n=JSON.parse(e);return Zu(n,(function(e,n){t[n]=e.v})),t}(e)),t}}),Object.defineProperty(e.prototype,"_formatReceivedMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!e)return e;var n=this,r=t||{},i=r.currentUserId,o=r.connectedTime,a=r.afterDecode,s=e.content,u=e.fromUserId,l=e.type,c=e.groupId,d=e.status,f=e.dataTime,p=e.extraContent,h=e.extStatus,g=e.clientUniqueId,_=e.busChannel,b=e.msgId,E=e.classname,v=e.toUserIds,m=e.optionBits,y=e.direction||_e.RECEIVE,I=function(e){var t=Ie.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?Ie.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(d),T=I.isPersited,R=I.isCounted,O=I.isMentioned,S=I.disableNotification,C=I.receivedStatus,A=I.canIncludeExpansion,P=!!(2&(h||0)),N=!!(4&(h||0)),w=!!(8&(h||0))?ee.PRIVATE:ee.PUBLIC,L=[B.GROUP,B.CHATROOM,B.RTC_ROOM,B.ULTRA_GROUP].indexOf(l)>-1?c:u,M=u,U=_e.RECEIVE;y===_e.SEND&&(M=i,U=_e.SEND);var D=Ut(f),V=D<o,j=l===B.CHATROOM,G=n._setExpansion(p),k=n._formatJSONContent(s);k=n._getUtfContent(k);var F=en(e.configFlag,e.pushContent,e.pushExt);j&&u===i&&(U=_e.SEND);var x={conversationType:l,targetId:L,senderUserId:M,messageType:E,messageUId:b,isPersited:T,isCounted:R,isMentioned:O,sentTime:D,messageDirection:U,receivedTime:Date.now(),disableNotification:S,receivedStatus:C,receivedStatusInfo:Vt(C),canIncludeExpansion:A,content:k,expansion:G,pushConfig:F,channelId:_||"",isInterrupt:P,isModifyMessage:N,messageId:Ut(g)||0,sentStatus:ae.SENT,isOffLineMessage:V,channelType:w,isStatusMessage:vr(E).isStatusMessage||!1,readReceiptInfo:void 0,directedUserIds:v,disableUpdateLastMessage:!!(1&(m||0)),needReceipt:!!(2&(m||0)),sendReceipt:!!(4&(m||0))||void 0};return(null==a?void 0:a(x))||x}}),Object.defineProperty(e.prototype,"_formatHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=e.list,i=e.hasMsg,o=e.compressedData;if(e.compressioEnabled){var a=Dp(o),s=qu.decode(Ca,a);return this._formatHistoryMessages(s,t)}var u=t.conversation||{},l=u.targetId,c=Ut(e.syncTime),d=[];return Zu(r,(function(e){var r=n._formatReceivedMessage(e,t);u.conversationType===B.ULTRA_GROUP?r.targetId=e.groupId||u.targetId:r.targetId=l,d.push(r)}),{isReverse:!0}),{syncTime:c,list:d,hasMore:!!i}}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var n,r=e.businessId,i=e.time,o=e.changeType,a=e.originalId,s=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,f=e.subChangeType,p=e.secondaryType,h=e.remindType,g=e.isRemindMe,_=e.extIds,b=e.eventData;return b&&(n=t._formatEventData(b,o,f)),{businessId:r,changeType:o,originalId:a,time:Ut(i),originalTime:Ut(s),secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:f,userGroupIds:_,secondaryType:p,remindType:h,isRemindMe:g,eventData:n}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r={};return e&&Fp[t]&&Fp[t](n)&&(r=qu.decode(Fp[t](n),e)||{}),r}}),Object.defineProperty(e.prototype,"_formatUltraOperateStatusNotifyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,n=e.notifyType,r=e.info,i=e.summary,o=[],a=[],s=!(2&~n),u=!(1&~n);return u&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,i=e.opType,a=e.optime,s=Ut(a);o.push({targetId:t,channelId:n,userId:r,operationType:i,operationTime:s})})),s&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,i=e.opType;a.push({targetId:t,channelId:n,count:r,operationType:i})})),{conversationType:t,info:o,summary:a,hasInfo:u,hasSummary:s}}}),Object.defineProperty(e.prototype,"_formatUltraMsgList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}}}),Object.defineProperty(e.prototype,"_formatUltraGroupUnreadMentionedList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:Ut(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))}}),Object.defineProperty(e.prototype,"_getUltraGroupConversationInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.versionTime,r=t.unreadCount,i=t.remindCount,o=t.busChannelType,a=t.msgInfo,s=t.remindMeCount;return e.versionTime=Ut(n)||0,e.unreadMessageCount=this._getUnreadCount(Ut(r)||0),e.unreadMentionedCount=this._getUnreadCount(Ut(i)||0),e.unreadMentionedMeCount=this._getUnreadCount(Ut(s)||0),e.channelType=o||ee.PUBLIC,e.lastReadTime=0,a&&(e.firstUnreadMessage={sentTime:Ut(a.msgTime)},e.lastReadTime=Ut(a.msgTime)-1),e}}),Object.defineProperty(e.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(e.prototype,"_formatConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=this,i=e.info,o=e.compressedData;if(e.compressioEnabled){var a=Dp(o),s=qu.decode(va,a);return this._formatConversationList(s,t)}var u=t.afterDecode,l={list:(i=$u(i,(function(e){var i=e.msg,o=e.userId,a=e.type,s=e.unreadCount,l=e.busChannel,c=e.versionTime,d=null;i&&((d=r._formatReceivedMessage(i,t)).targetId=o);var f={targetId:o,conversationType:a,unreadMessageCount:Ut(s)||0,latestMessage:d,channelId:l||"",operationTime:Ut(c)||0};return a===B.ULTRA_GROUP&&(f=n._getUltraGroupConversationInfo(f,e)),(null==u?void 0:u(f))||f})))||[]};return((null==t?void 0:t.conversationType)||B.NONE)===B.ULTRA_GROUP&&(l.isFinished=e.isFinished),l}}),Object.defineProperty(e.prototype,"_formatChatRoomInfos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.userTotalNums,n=e.userInfos;return{userCount:t,userInfos:$u(n,(function(e){var t=e.id,n=e.time;return{id:t,time:Ut(n)}}))}}}),Object.defineProperty(e.prototype,"_formatChatRoomKVList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime,i=e.compressedData;if(e.compressioEnabled){var o=Dp(i),a=qu.decode(Fa,o);return this._formatChatRoomKVList(a)}return t=$u(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,i=e.timestamp,o=e.uid,a=e.version,s=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?D.DELETE:D.UPDATE}}(r);return{key:t,value:n,isAutoDelete:s.isAutoDelete,isOverwrite:s.isOverwrite,type:s.type,userId:o,timestamp:Ut(i),version:Ut(a)}})),{kvEntries:t,isFullUpdate:n,syncTime:r}}}),Object.defineProperty(e.prototype,"_formatGrpReadReceiptQryResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=Ut(e.readTime)})),{totalMemberCount:t,list:n}}}),Object.defineProperty(e.prototype,"_formatQueryReceiptResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.list,n=void 0===t?[]:t,r=e.num,i=e.readCnt;return{list:n.map((function(e){return{readTime:Ut(e.receiptTime),userId:e.userId}})),totalCount:r,readCount:i}}}),Object.defineProperty(e.prototype,"_formatChrmKVVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,i=e.chatroomBanState;return{joinTime:t,createTime:n||0,memberCount:r||0,isAllChatroomBanned:!!(1&i),isCurrentUserBanned:!!(2&i),isCurrentChatroomBanned:!!(4&i),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}}}),Object.defineProperty(e.prototype,"_formateChannelsListResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)return{result:{list:[]}};var t=e.listType,n=e.result,r=e.page;return n?{listType:t,result:qu.decode(kp[t],n)||[],page:r}:{listType:t,result:{list:[]},page:r}}}),Object.defineProperty(e.prototype,"_calculateFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.isFilerWhiteBlacklist,n=e.isVoipPush,r=e.pushConfig||{},i=0;return i|=n?1:0,i|=t?2:0,i|=r.disablePushTitle?4:0,i|=r.forceShowDetailContent?8:0}}),Object.defineProperty(e.prototype,"_getPushExtraModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.pushTitle,n=e.iOSConfig,r=e.androidConfig,i=e.templateId,o=void 0===i?"":i,a=e.harmonyOSConfig,s=qu.getModule(aa);if(t&&s.setTitle(t),n||r||a){var u=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,f=t.imageUrlHonor,p=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=a||"active";var l={};l.collapse_key=null==s?void 0:s.collapseKey,l.imageUrl=null==s?void 0:s.imageUrl;var c=null==s?void 0:s.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:c||""}},{APNS:p.APNS},{FCM:p.FCM},{HONOR:{importance:d||be.NORMAL,image:f||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(h)}(n,r,a);s.setPushConfigs(u)}return(null==r?void 0:r.notificationId)&&s.setPushId(null==r?void 0:r.notificationId),s.setTemplateId(o),s}}),Object.defineProperty(e.prototype,"_getUpMsgModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.messageType,r=t.content,i=t.directionalUserIdList,o=t.canIncludeExpansion,a=t.expansion,s=t.pushConfig,u=t.channelId,l=t.pushData,c=void 0===l?"":l,d=t.pushContent,f=void 0===d?"":d,p=t.messageId,h=void 0===p?0:p,g=t.disableUpdateLastMessage,_=void 0!==g&&g,b=t.isPersited,E=t.needReceipt,v=e.conversationType,m=e.targetId,y=qu.getModule(oa),I=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var i=0;return n&&(i|=1),r&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),T=s||{},R=T.pushContent,O=void 0===R?f:R,S=T.pushData,C=void 0===S?c:S;y.setSessionId(I),O&&y.setPushText(O),C&&y.setAppData(C),i&&y.setToUserIds(i);var A=this._calculateFlag(t);if(y.setConfigFlag(A),y.setClassname(n),r.user&&r.user.portraitUri&&(r.user.portrait=r.user.portraitUri),y.setContent(JSON.stringify(r)),o&&a){var P={};Zu(a,(function(e,t){P[t]={v:e}})),y.setExtraContent(JSON.stringify(P))}if(s){var N=this._getPushExtraModule(s);y.setPushExt(N)}y.setClientUniqueId(h),Tt(u)||y.setBusChannel(u),v===B.SYSTEM&&y.setSystemId(m);var w=0;return b&&_&&(w|=1),E&&(w|=2),y.setOptionBits(w),y}}),Object.defineProperty(e.prototype,"encodeUpMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._getUpMsgModule(e,t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.count,r=t.order,i=t.timestamp,o=t.channelId,a=qu.getModule(Sa);return a.setTargetId(e),a.setTime(i),a.setCount(n),a.setOrder(r),a.setBusChannel(o||""),a.setCompressioEnabled(Zl.enable()),a.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeOldConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(e=e||{}).count,n=e.type,r=e.startTime,i=e.order;t=t||0,r=r||0,i=i||0;var o=qu.getModule(ba);return o.setType(n),o.setCount(t),o.setStartTime(r),o.setOrder(i),o.setCompressioEnabled(Zl.enable()),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeBatchDeleteConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(Da),n=[];return e.forEach((function(e){var t=e.conversationType,r=e.targetId,i=e.channelId,o=qu.getModule(Va);o.setConversationType(t),o.setConversationId(r),o.setBusChannel(i||""),n.push(o)})),t.setRelation(n),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"_encodeSessions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.map((function(e){var t=e.conversationType,n=e.targetId,r=qu.getModule(La);return r.setType(t),r.setChannelId(n),r}))}}),Object.defineProperty(e.prototype,"encodeRemoveConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(wa);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeExpandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,a=e.sendTime,s=e.keys,u={mid:o,put:e.expansion,del:s,clear:e.removeAll?1:0},l=qu.getModule(_s);return l.setFromUserId(t),l.setTargetId(n),l.setType(r),l.setBusChannel(i||""),l.setMsgUID(o),l.setMsgTime(a),l.setContent(JSON.stringify(u)),l.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodemodifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,a=e.sendTime,s=e.content,u=qu.getModule(_s);return u.setFromUserId(t),u.setTargetId(n),u.setType(r),u.setBusChannel(i||""),u.setMsgUID(o),u.setMsgTime(a),u.setContent(JSON.stringify(s)),u.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,n=e.conversationType,r=e.messages,i=qu.getModule(ms),o=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(n),i.setQuery(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUnreadMentionedMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,n=e.channelId,r=e.sentTime,i=e.count,o=qu.getModule(ma);return o.setGroupId(t),o.setBusChannel(n),o.setMsgTime(r),o.setSize(i),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(Xa);return n.setUnpushLevel(e),n.setBusChannel(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(za);return t.setBusChannel(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=qu.getModule(Ga),i=t.key,o=t.value,a=t.notificationExtra,s=t.isSendNotification,u=t.type,l=t.timestamp,c=u||D.UPDATE,d=Gp(t,c),f={key:i,value:o||"",uid:n,version:l};if(Tt(d)||(f.status=d),r.setEntry(f),s){var p={conversationType:B.CHATROOM,targetId:e},h={key:i,value:o,extra:a,type:c},g=this._getUpMsgModule(p,{messageType:ye.CHRM_KV_NOTIFY,content:h,isPersited:!1,isCounted:!1});r.setNotification(g),r.setBNotify(!0),r.setType(B.CHATROOM)}return r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=qu.getModule(ka),i=t.entries,o=t.type||D.UPDATE,a=Gp(t,o),s=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};Tt(a)||(t.status=a),s.push(t)})),r.setEntry(s),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return qu.encode(Ba,{timestamp:e,compressioEnabled:Zl.enable()})}}),Object.defineProperty(e.prototype,"encodeReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(ns);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeCreateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(ls),r=[];return e.forEach((function(e){var t=qu.getModule(cs);t.setTagId(e.tagId),t.setName(e.tagName),r.push(t)})),n.setTags(r),n.setVersion(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(ns);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReadReceiptMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=qu.getModule(Ps),i=e.conversationType,o=e.targetId,a=e.channelId,s=void 0===a?"":a;return r.setType(i),r.setTargetId(o),r.setBusChannel(s),r.setStartMsgId(t),r.setEndMsgId(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(Ns),r=e.targetId,i=e.channelId,o=void 0===i?"":i;return n.setTargetId(r),n.setBusChannel(o),n.setMsgId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptCntQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(Ls),r=e.targetId,i=e.conversationType,o=e.channelId,a=void 0===o?"":o;return n.setChannelId(r),n.setBusChannel(a),n.setType(i),n.setMsgId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUpdateUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=qu.getModule(Us);i.setSubType(e),i.setOpType(n),i.setExpiry(r);var o=[];return t.forEach((function(e){var t=qu.getModule(Ds);t.setSubUserId(e),o.push(t)})),i.setSubUsers(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,n=e.pageToken,r=qu.getModule(js);return r.setVersion(t),r.setPageToken(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullSubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,n=e.needAllData,r=e.pageToken,i=qu.getModule(ks);return i.setVersionTime(t),i.setNeedAllData(n),i.setPageToken(r),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQrySubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(Bs);n.setSubType(e);var r=[];return t.forEach((function(e){var t=qu.getModule(Ds);t.setSubUserId(e),r.push(t)})),n.setSubUsers(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserProfileReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(Ks);return t.setUserId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfileInput",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=qu.getModule(Ws);return e.setNothing(1),e.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfilePermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(Js);return t.setPermission(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSearchUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(zs);return t.setUniqueId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(Hs),n=[],r=[];return Object.keys(e).forEach((function(t){if("extraProfile"!==t){var i=e[t],o=qu.getModule(qs);o.setKey(t),o.setValue((null==i?void 0:i.toString())||""),n.push(o)}else if(e.extraProfile){var a=e.extraProfile;Object.keys(a).forEach((function(e){var t=a[e],n=qu.getModule(qs);n.setKey(e),n.setValue(t.toString()||""),r.push(n)}))}})),t.setUserProfile(n),t.setUserExtProfile(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMultiChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule($s),n=[];return e.forEach((function(e){var t=qu.getModule(Xs);t.setTargetId(e),n.push(t)})),t.setType(B.GROUP),t.setList(n),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){void 0===n&&(n=[]),void 0===r&&(r=!0);var o=qu.getModule(eu);if(o.setTargetId(t),o.setType(B.GROUP),"dismiss"!==e&&i){var a=this.encodeQuitChannelsSetting(i,r);o.setSettingInfo(a)}return"quit"!==e&&"dismiss"!==e&&o.setUsers(n),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitChannelsSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(tu);return n.setIsQuit(t),n.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),n.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),n.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),n}}),Object.defineProperty(e.prototype,"encodeModifyChannelsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=qu.getModule(eu);return r.setTargetId(t),r.setType(B.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeChannelsQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,n=e.groupId,r=e.option,i=e.ids,o=qu.getModule(nu);if(n&&o.setTargetId(n),o.setType(B.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&r){var a=this.encodePagingQuery(r);o.setPage(a)}return["getGroupMembers","getJoinedGroups"].includes(t)&&o.setIds(null!=i?i:[]),e.roleType&&o.setRoleType(e.roleType),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePagingQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(ru),n=e.count,r=e.order,i=e.pageToken;return t.setSize(n),t.setOrder(r?0:1),t.setPageToken(i),t}}),Object.defineProperty(e.prototype,"encodeJoinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){void 0===n&&(n=[]);var r=qu.getModule(cu);return r.setTargetId(t),r.setType(B.GROUP),"invite"===e&&r.setUserIds(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMemberResponseInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.groupId,n=e.inviterId,r=e.optType,i=e.optResult,o=e.joinUserId,a=e.reason,s=qu.getModule(lu);return s.setTargetId(t),s.setType(B.GROUP),s.setOptType(r),s.setOptResult(i),s.setInviterId(n),r===w.MANAGER&&s.setJoinUserId(o),i||s.setDetail(null!=a?a:""),s.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=qu.getModule(uu),r=A.ADD;return n.setTargetId(e),n.setType(B.GROUP),t||(r=A.REMOVE),n.setOperateType(r),n.setChannelNickName(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=qu.getModule(eu);return r.setTargetId(t),r.setType(B.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(du);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return qu.encode(fu,{targetId:e,type:t})}}),Object.defineProperty(e.prototype,"encodeFriendQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=null!=t?t:{},i=r.count,o=void 0===i?200:i,a=r.pageToken,s=void 0===a?"":a,u=r.order,l=void 0!==u&&u,c=qu.getModule(_u);c.setQueryType(e),11===e&&c.setFriendType(n);var d=qu.getModule(ru);return d.setSize(o),d.setOrder(l?0:1),d.setPageToken(s),c.setPage(d),c.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuerySessionsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.getModule(Ma);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),e}(),Bp=function(e){function n(t,n,r){var i=e.call(this,t,n,r)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new xp(i.logger),i}return t(n,e),Object.defineProperty(n.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(n.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(n.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(n.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(n.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,f,p;return a(this,(function(h){switch(h.label){case 0:if(n=t.openAnti,i=t.type,o=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(H.L_NAVI_CMP_R,JSON.stringify(s),r),0===(u=s.filter((function(e,t){return s.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(H.L_NAVI_CONF_E,"no service available",r),[2,mn(x.SERVER_UNAVAILABLE)];l=1===n?Br.V4:Br.V3,c=function(t){var n,s,c,f,p,h,g,_,b,E,v;return a(this,(function(a){switch(a.label){case 0:return n=u[t],s=n.protocol,c=n.addr,f=n.weight,p=function(e,t,n,r,i,o,a,s){var u,l=a?"&protocolVer=".concat(a):"",c=Fl(),d=ql();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(xe,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===s?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=zo.getApiVer)||void 0===u?void 0:u.call(zo))||"||")).concat(zo.connectPlatform?"&platform=".concat(zo.connectPlatform):"").concat(l).concat(zo.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(s===q.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),h=Date.now(),[4,d.connectWebSocket(p,l,r)];case 1:return g=a.sent(),_=g.code,b=g.data,E=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),v={bid:an(),ptc:Re.WS,cod:_,net:d.getNetwork().type,dur:Date.now()-h,spr:0,pr:i||0,hos:c,idx:E,rct:d.retryCount?Ce.RECONNECT:Ce.CONNECT,cid:d.cid,v:Se.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:f,ssid:d._serverSessionId},d.logger.record(Ee.IM_WEBSOCKET,JSON.stringify(v),r),_===x.RC_SOCKET_DISCONNECTED||_===x.TIMEOUT?[2,"continue"]:_!==x.SUCCESS?[2,{value:mn(_)}]:(d._localConnectedTime=Math.floor((Date.now()+h)/2),d._socket=b.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:vn(b.userId)}])}}))},d=this,f=0,h.label=1;case 1:return f<u.length?[5,c(f)]:[3,4];case 2:if("object"==typeof(p=h.sent()))return[2,p.value];h.label=3;case 3:return f+=1,[3,1];case 4:return[2,mn(x.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(n.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c=this;return a(this,(function(a){return this.logger.info(H.L_CONNECT_O,"connect start: ".concat(e),n),r=On(),i=r.resolve,o=r.promise,s=zo.createWebSocket(e),this._socketIndex=s.id,u=x.SUCCESS,l=setTimeout((function(){c.logger.warn(H.L_CONNECT_S,"timeout",n),u=x.TIMEOUT,s.close()}),5e3),s.onOpen((function(){c.logger.info(H.L_CONNECT_S,"socket opened",n),clearTimeout(l)})),s.onError((function(e){c.logger.info(H.L_CONNECT_S,"socket error",n),clearTimeout(l);var t=x.RC_SOCKET_DISCONNECTED;i(mn(t)),c.onSocketEnd(s,t)})),s.onClose((function(){c.logger.info(H.L_CONNECT_S,"socket close",n);var e=u===x.SUCCESS?x.RC_SOCKET_DISCONNECTED:u;i(mn(e)),c.onSocketEnd(s,e)})),s.onMessage((function(e){if(c._socketIndex===s.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var r=lo(e,t);if(r){if(r instanceof Wi){var o=r.status;if(o!==pi)return c.logger.warn(H.L_CONNECT_O,"connect failed: ".concat(o),n),u=jp[o],s.close(),void i(mn(u));c.logger.info(H.L_CONNECT_O,"connect success",n);var a=r.timestamp,l=r.userId,d=r.messageId,f=r.sessionId;return c._serverSessionId=f,c._connectedTime=a,c._idCount=d,void i(vn({userId:l,socket:s}))}if(r instanceof zi){var p=r.status;return c.logger.info(H.T,"recv disconnect signal -> status: ".concat(p)),void c.onRecvDisconnect(p,s)}c._onReceiveSignal(r)}}}else c.logger.warn(H.L_WS_DISACCORD_E,JSON.stringify({socketIndex:c._socketIndex,curSocketId:s.id}))})),[2,o]}))}))}}),Object.defineProperty(n.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Fr.AT_MOST_ONCE)return e instanceof to&&!e.syncMsg?(this.logger.debug(H.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new ao(e.messageId))):void(e instanceof uo&&this._messageIds[e.messageId]&&(this.logger.debug(H.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new so(e.messageId))))}}),Object.defineProperty(n.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,n=e.topic,r=e.messageId,this.logger.debug(H.O,"recv PublishReader -> messageId: ".concat(r," ").concat(n)),n===Zr?[2]:!t||function(e){return[Gr.ppMsgS,Gr.pgMsgS,Gr.chatMsgS].includes(Hr(e))}(n)?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[r]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[r],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(n.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return e instanceof Zi&&this._pingResolve?(this._pingResolve(x.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof oo||e instanceof uo)&&(t=e.messageId,this.logger.debug(H.O,"recv ack -> messageId: ".concat(t)),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof to?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(n.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return Vp[e]}(e)))}}),Object.defineProperty(n.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}}),Object.defineProperty(n.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(x.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(n.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(x.TIMEOUT)}),e),t.sendOnly(new Xi)}))}}),Object.defineProperty(n.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof io||e instanceof ro)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(n.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(x.TIMEOUT)}),3e4)}))]):[2,mn(x.RC_NET_CHANNEL_INVALID)];case 1:return n=o.sent(),(r="number"==typeof n?n:n.status)!==x.SUCCESS&&this.logger.warn(H.L_SEND_RMTP_E,JSON.stringify({messageId:t,code:r,topic:e.topic})),"number"==typeof n?[2,mn(n)]:[2,r===x.SUCCESS?vn(n):mn(r,"",n)]}}))}))}}),Object.defineProperty(n.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.logger.createTraceId(),s=qr(e),this.logger.debug(H.L_QUERY_CMP_T,JSON.stringify({topic:s,targetId:t}),o),u=new ro(e,n,t),i&&u.setHeaderQos(i),[4,this._sendHandler(u)];case 1:return l=a.sent(),this.logger.summary(H.L_QUERY_CMP_R,l,o,{topic:s,targetId:t}),c=l.data,l.isOk&&void 0!==r?[2,vn(qu.decode(r,c.pbData))]:[2,l]}}))}))}}),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=a.sent()).data?r.data instanceof oo?[2,r]:(i=r.data,o=t&&i.pbData&&[x.SUCCESS,x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,x.RC_USER_PROFILE_KEY_NOT_EXIST,x.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,x.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,x.RC_USER_PROFILE_VALUE_EXCEED_RANGE,x.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(i.status)>=0,s=o?this.codec.decodeByPBName(i.pbData,t,n):i,0!==i.status?(this.logger.warn(H.O,"send failed -> messageId: ".concat(i.messageId,", respPBName: ").concat(t,", status: ").concat(i.status)),[2,mn(i.status,void 0,t&&i.pbData?s:null)]):[2,vn(s)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return n?[4,this.sendOnly(new Ji(Vi))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),n}(gr),Hp=function(e){function n(t,n,r){var i=e.call(this,n,t,r)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=zo.runtimeInfo,a=o.type,s=o.version;return i.deviceId=Fl(),i.model="Web|".concat(a,"|").concat(s),i.init(),i}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return(i=r).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:n,body:JSON.stringify(i)},s=this.logger.createTraceId(),this.logger.info(H.L_REQUEST_T,JSON.stringify(o),s),[4,zo.httpReq(o)];case 1:u=a.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(H.L_REQUEST_R,JSON.stringify({status:l,data:d}),s);try{return f=JSON.parse(d),p=f.data,[2,{code:parseInt(f.code,10),data:p}]}catch(e){return this.logger.warn(H.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(n.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=it(this.appkey);zo.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(n.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=it(this.appkey),t=zo.localStorage.getItem(e);return this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(n.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(H.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(n.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),n}(pr),qp=function(e){function n(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return Object.defineProperty(o,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),Lp.set(o,void 0),Mp.set(o,ft),d(o,Lp,new Gl(at(t)),"f"),o}return t(n,e),Object.defineProperty(n.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,Mp,e,"f")}}),Object.defineProperty(n.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Mp,"f")}}),Object.defineProperty(n.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return c(this,Lp,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(n.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:c(this,Lp,"f").get(e)}}catch(e){return{success:!1}}}}),n}(Zn);Lp=new WeakMap,Mp=new WeakMap;var Yp=null,Kp="RC_LOGS",Qp="RC_STATISTICS",Wp=((Up={})[Kp]=["level","time"],Up[Qp]=["level","time"],Up),Jp=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-n),a=i.openCursor(o);a.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):r()},a.onerror=function(){r()}}))},zp=null,Xp=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,Yp];case 1:return(t=r.sent())?(n=t.db,[4,Jp(n,Kp,e)]):[2];case 2:return r.sent(),[4,Jp(n,Qp,e)];case 3:return r.sent(),zp=setTimeout((function(){return Xp(e)}),6e5),[2]}}))}))},Zp=function(e,t,n){void 0===n&&(n=168),Yp||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==zo.runtimeInfo.type?Yp=new Promise((function(r){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(n){n.forEach((function(n){n.name&&e.includes(n.name)&&t.deleteDatabase(n.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),a=i.open(o,2);a.onerror=function(e){t.error(H.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},a.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Yp=null,t.warn(H.L_LOGDB_CLOSED_S)},o.onerror=function(e){Yp=null,t.error(H.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(H.L_LOGDB_ABORT_S,e.target.error)},Xp(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:o})):r(null)},a.onupgradeneeded=function(e){var t=e.target.result;Object.keys(Wp).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var n=t.createObjectStore(e,{autoIncrement:!0});Wp[e].forEach((function(e){return n.createIndex(e,e,{unique:!1})}))}))}})):t.warn(H.L_UNSUPPORT_INDEXDB_O))},$p=[],eh=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite");i.oncomplete=r,i.onabort=r;var o=i.objectStore(t);n.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},th=[],nh=!1,rh=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return nh||0===th.length?[2]:(nh=!0,t=th.filter((function(e){return e.level<Kn.FATAL})),n=th.filter((function(e){return e.level>=Kn.FATAL})),th.length=0,[4,eh(e,Kp,n)]);case 1:return r.sent(),[4,eh(e,Qp,t)];case 2:return r.sent(),nh=!1,0===th.length&&$p.length>0&&($p.forEach((function(e){return e.close()})),$p.length=0),setTimeout((function(){return rh(e)})),[2]}}))}))},ih=function(){var e=or();return e.setLogReader((function(e,t,n,r,i){return void 0===i&&(i=Kp),o(void 0,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,Yp];case 1:return(o=a.sent())?[2,new Promise((function(a){var s=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=n&&(r?i.sessionId===dt:i.level>=0)&&u.push(i),t.continue()}else a({logs:u})},c.onerror=function(){a({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,Yp];case 1:if(!(t=n.sent()))return[2];if(e.content&&pt(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return th.push(e),rh(t.db),[2]}}))}))}(e)})),e},oh="REPORT_SESSION",ah=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){return n="".concat(oh,"_").concat(e),r=t.getSessionId(),i=t.getConf(n),o=i.success,s=i.value,o?(r===(null==s?void 0:s.sessionId)||t.setConf(n,{sessionId:r}),[2]):[2]}))}))},sh=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){return n=t.getSessionId(),r=t.getConf("".concat(oh,"_").concat(e)),i=r.success,o=r.value,[2,i&&(null==o?void 0:o.sessionId)===n]}))}))},uh=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-uh),void 0===n&&(n=Date.now()),o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>uh&&(t=n-uh),r=or(),(i=new qp(e,"RC-IM","IM",r)).debug(H.T,"get logs: startTime ".concat(t," endTime ").concat(n)),Zp(e,i),[4,r.read(t,n,Kn.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(H.T,"get logs ".concat(o.length)),function(e,t){var n=t.map((function(e){var t=e.sessionId,n=e.time,r=e.type,i=e.level,o=e.tag,a=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(n,",").concat(r,",").concat(i,",").concat(o,",").concat(a,",").concat(s,',"').concat(u,'"\n')})),r=new Blob(n,{type:"text/csv"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(n),o),[2]}}))}))}}}}var lh,ch,dh,fh,ph,hh=function(e){function n(t,n,r,i){var o,a=Fl(),s=zo.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(n.getSessionId(),"|").concat(zo.connectPlatform);return o=e.call(this,t,a,c,i,n)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return t(n,e),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return zo.httpReq(e)}}),Object.defineProperty(n.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,ah(t.userId,this.logger)];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(n.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,{success:!0,data:ic(e.map(er).join(""))}]}))}))}}),Object.defineProperty(n.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r,this.tableName)]}))}))}}),n}($n),gh=function(e){function n(t,n,r){return e.call(this,t,n,Kp,r)||this}return t(n,e),Object.defineProperty(n.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,sh(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(n.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r,i,s,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return o=a.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,n,r,i,s,u,l)]}}))}))}}),n}(hh),_h=function(e){function n(t,n,r){return e.call(this,t,n,Qp,r)||this}return t(n,e),n}(hh),bh=function(e){function n(t,n){var r=e.call(this)||this;return lh.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),ch.set(r,!1),r._ctx.on("sCmd",c(r,lh,"m",fh),r),r._ctx.on("onConnected",c(r,lh,"m",dh),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,c(this,lh,"m",ph).call(this,e)];case 1:return[2,t.sent().trans((function(e){return{version:e.version}}))]}}))}))}}),Object.defineProperty(n.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,lh,"m",ph).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),n}(hn);ch=new WeakMap,lh=new WeakSet,dh=function(){d(this,ch,!0,"f")},fh=function(e,t){var n=t.type,r=t.time;if(3===n)this.push(r),e.stopPropagation()},ph=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),t.info(H.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),n),r=qu.encode(Qa,{time:e}),[4,this._ctx.query(Gr.pullSeAtts,this._ctx.currentUserId,r,Wa)];case 1:return i=a.sent(),t.summary(H.L_PULL_CONVERSATION_SETTINGS_R,i,n,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),c(this,ch,"f")&&(d(this,ch,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var Eh,vh,mh,yh,Ih=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._memData[e],r=n.key,i=n.stringify;n.value=t;var o=i?JSON.stringify(t):t;zo.localStorage.setItem(r,o)}}),e}(),Th=function(e,t,n){return"".concat(null!=n?n:"","_").concat(e,"_").concat(t)},Rh=function(e){var t=u(e.split("_")),n=t[0],r=t[1],i=t.slice(2);return{channelId:n,conversationType:parseInt(r,10),targetId:i.join("_")}};function Oh(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=u(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var Sh=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:ve.NOT_SET,translateStrategy:wr.DEFAULT,tags:[],channelType:ee.PUBLIC,operationTime:0,draft:"",hidden:!1}},Ch=function(){function e(e){Eh.set(this,void 0),vh.set(this,void 0),mh.set(this,void 0),yh.set(this,Sh()),d(this,Eh,e.conversationType,"f"),d(this,vh,e.targetId,"f"),d(this,mh,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,Eh,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,vh,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,mh,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,yh,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,yh,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,yh,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,yh,"f").notificationLevel||ve.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,yh,"f").translateStrategy||wr.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,yh,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return c(this,yh,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,yh,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,yh,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,yh,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,yh,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,yh,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,yh,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,yh,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,yh,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,yh,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,yh,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,yh,"f").draft||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessage",{get:function(){return this.firstUnreadTime?{sentTime:this.firstUnreadTime,messageType:this.firstUnreadMessageType,messageUId:this.firstUnreadMessageUId}:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return{conversationType:c(this,Eh,"f"),targetId:c(this,vh,"f"),channelId:c(this,mh,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return Th(c(this,Eh,"f"),c(this,vh,"f"),c(this,mh,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return r(r({},this.id),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,notificationStatus:Le(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==ve.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==wr.DEFAULT&&(e.ts=this.translateStrategy),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(r(r({},Sh()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;void 0===t&&(t=0);var r={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,unreadMentionedCount:void 0,unreadMentionedMeCount:void 0,channelType:void 0,operationTime:void 0,draft:void 0,hidden:void 0};return Object.entries(i).forEach((function(i){var o=u(i,2),a=o[0],s=o[1],l=a;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(n,yh,"f")[l]!==d&&(c(n,yh,"f")[l]=d,s&&(r[s]={time:t,val:d}))}})),Object.keys(r).length>0?r:null}}),e}();Eh=new WeakMap,vh=new WeakMap,mh=new WeakMap,yh=new WeakMap;var Ah,Ph,Nh,wh,Lh=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toStoragItem.call(this);return this.unreadCount>0&&(t.c=this.unreadCount),this.unreadMentionedCount>0&&(t.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(t.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(t.hm=!0),this.mentionedInfo&&(t.m=this.mentionedInfo),this.firstUnreadMessageUId&&(t.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(t.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(t.fut=this.firstUnreadTime),this.lastReadTime&&(t.rt=this.lastReadTime),t}}),n}(Ch),Mh=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toIReceivedConversation.call(this);return t.channelType=this.channelType,t}}),Object.defineProperty(n.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),n}(Ch),Uh=function(e){function n(t){var n=e.call(this)||this;return Ah.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Ph.set(n,new Map),n}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=zo.localStorage,n=e.appkey,r=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=Ze(n,r),a=Xe(n,r),s=$e(n,r),u=We(n,r),l=Qe(n,r),d=Je(n,r),f=ze(n,r),p=t.getItem(o)||"0",h=t.getItem(a)||"0",g=t.getItem(s)||"1",_=t.getItem(l)||"0",b=JSON.parse(t.getItem(f)||"{}"),E=JSON.parse(t.getItem(u)||"{}"),v=JSON.parse(t.getItem(d)||"{}");return c(this,Ah,"m",Nh).call(this,E,v,b,i),{inboxTime:{value:parseInt(p,10)||0,key:o},outboxTime:{value:parseInt(h,10)||0,key:a},broadcastTime:{value:parseInt(g,10)||0,key:s},conversationStatus:{value:E,key:u,stringify:!0},ultraGroupStatus:{value:v,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(_,10)||0,key:l},conversationTypeGlobalSettings:{value:b,key:f,stringify:!0}}}}),Object.defineProperty(n.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),c(this,Ph,"f").clear(),c(this,Ah,"m",wh).call(this)}}),Object.defineProperty(n.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("conversationTypeGlobalSettings");t===ve.NOT_SET?delete n[e]:n[e]={nl:t},this.set("conversationTypeGlobalSettings",n)}}),Object.defineProperty(n.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return(null===(t=this.get("conversationTypeGlobalSettings")[e])||void 0===t?void 0:t.nl)||ve.NOT_SET}}),Object.defineProperty(n.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=Th(e.conversationType,e.targetId,e.channelId),r=c(this,Ph,"f").get(n);return r||(r=e.conversationType===B.ULTRA_GROUP?new Mh(e):new Lh(e),t&&c(this,Ph,"f").set(n,r)),r}}),Object.defineProperty(n.prototype,"getUGFistUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=Th(B.ULTRA_GROUP,e,t),r=c(this,Ph,"f").get(n);return(null==r?void 0:r.firstUnreadMessage)||null}}),Object.defineProperty(n.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),n=this.get("conversationStatus");e.forEach((function(e){var r=e.conversationType,i=e.key,o=e.toStoragItem(),a=Object.keys(o),s=0===a.length||1===a.length&&"h"===a[0],u=r===B.ULTRA_GROUP?t:n;s?delete u[i]:u[i]=o})),this.set("conversationStatus",n),this.set("ultraGroupStatus",t)}}),Object.defineProperty(n.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.version,i=e.state;if(this.set("conversationStatusVersion",n),!(null==i?void 0:i.length))return[];var o=new Map,a=new Set;return i.forEach((function(e){var r=e.channelId,i=e.busChannel,s=e.type,u=e.stateItem;e.time;var l={};if(null==u||u.forEach((function(e){var t=e.tags,n=e.sessionStateType,r=e.value;switch(n){case na.IsSilent:l.notificationLevel=parseInt(r,10);break;case na.IsTop:l.isTop="1"===r;break;case na.Tags:l.tags=t;break;case na.AutoTrans:l.translateStrategy=parseInt(r,10)}})),r){var d=Th(s,r,i),f=Rh(d),p=c(t,Ph,"f").get(d);p||(p=s===B.ULTRA_GROUP?new Mh(f):new Lh(f),c(t,Ph,"f").set(d,p)),a.add(p);var h=p.updateAttrs(l,n);if(h)if(o.has(p)){var g=o.get(p);Object.assign(g,h)}else o.set(p,h)}else void 0!==l.notificationLevel&&t.setConversationTypeNotificationLevel(s,l.notificationLevel)})),this.updateConversationStorage(Array.from(a)),Array.from(o.entries()).map((function(e){var t=u(e,2),n=t[0],i=t[1];return r(r({},n.toIReceivedConversation()),{updatedItems:i})}))}}),Object.defineProperty(n.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this;e.forEach((function(e){var i=e.userId,o=e.type,a=e.busChannel,s=Th(o,i,a),u=Rh(s),l=r.getOrCreateModel(u,!0),c=function(e,t,n){var r,i,o,a=e.msg;return{latestMessage:a?Jl(a,t,n):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(r=e.msgInfo)||void 0===r?void 0:r.className,firstUnreadMessageUId:null===(i=e.msgInfo)||void 0===i?void 0:i.msgId,firstUnreadTime:null===(o=e.msgInfo)||void 0===o?void 0:o.msgTime}}(e,t,n);o===B.ULTRA_GROUP?l.updateAttrs(c,e.versionTime||0):l.updateAttrs({latestMessage:c.latestMessage,operationTime:c.operationTime,hidden:!1},e.versionTime||0)}))}}),Object.defineProperty(n.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=Th(e.conversationType,e.targetId,e.channelId);return(null===(t=c(this,Ph,"f").get(n))||void 0===t?void 0:t.draft)||""}}),Object.defineProperty(n.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(n.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Th(e.conversationType,e.targetId,e.channelId),n=c(this,Ph,"f").get(t);n&&n.updateAttrs({draft:""})}}),Object.defineProperty(n.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=Th(B.ULTRA_GROUP,e,t),r=c(this,Ph,"f").get(n);return(null==r?void 0:r.toIReceivedConversation())||null}}),Object.defineProperty(n.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Ph,"f").values();return Array.from(e).filter((function(e){return e.conversationType===B.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Ph,"f").values();return Array.from(e).filter((function(e){return e.conversationType!==B.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(c(this,Ph,"f").values())}}),Object.defineProperty(n.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Th(e.conversationType,e.targetId,e.channelId);return c(this,Ph,"f").get(t)||null}}),Object.defineProperty(n.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=Th(t,n,r),o=c(this,Ph,"f").get(i);o&&(o.remove(),this.updateConversationStorage([o]))}}),Object.defineProperty(n.prototype,"updateConversationCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getOrCreateModel(e,!0);n.updateAttrs(t,0),this.updateConversationStorage([n])}}),Object.defineProperty(n.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=0;return this.getAllSGModels().forEach((function(r){var i,o=r.conversationType;e.includes(o)&&(r.notificationLevel>ve.NOT_SET&&!t||(n+=null!==(i=r.unreadCount)&&void 0!==i?i:0))})),n}}),Object.defineProperty(n.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=0;return this.getAllSGModels().forEach((function(t){var n;e+=null!==(n=t.unreadMentionedCount)&&void 0!==n?n:0})),e}}),Object.defineProperty(n.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var n=t.tags;n.length>0&&n.forEach((function(n){e.set(n.tagId,(e.get(n.tagId)||[]).concat(t.id))}))})),e}}),Object.defineProperty(n.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=0;return this.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,a=i.unreadCount,s=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(r+=n?s:a)}})),r}}),Object.defineProperty(n.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){var o=Th(e,t,n),a=c(this,Ph,"f").get(o);if(!a)return null;var s=a.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:i,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0});return this.updateConversationStorage([a]),s?r(r({},a.toIReceivedConversation()),{updatedItems:s}):null}}),n}(Ih);function Dh(e){return Object.keys(e).map((function(t){var n=e[t];return"string"!=typeof n&&(n="".concat(n)),{key:t,value:n}}))}function Vh(e,t,n,r){return qu.encode(Xs,{targetId:e,type:B.GROUP,users:r,extProfile:n?Dh(n):void 0,settingProfile:Dh(t)})}Ph=new WeakMap,Ah=new WeakSet,Nh=function(e,t,n,r){var i=!1;Object.keys(e).forEach((function(t){var r=Rh(t);if(!$(r.conversationType,Q))return delete e[t],void(i=!0);r.targetId||(n[r.conversationType]={nl:e[t].nl||ve.NOT_SET},delete e[t],i=!0)})),Object.keys(t).forEach((function(e){var o=Rh(e);return o.conversationType!==B.ULTRA_GROUP?(delete t[e],void(i=!0)):o.targetId?void(r&&!o.channelId&&(delete t[e],i=!0)):(n[o.conversationType]={nl:t[e].nl||ve.NOT_SET},delete t[e],void(i=!0))})),i&&(this.set("conversationStatus",e),this.set("ultraGroupStatus",t),this.set("conversationTypeGlobalSettings",n))},wh=function(){var e=this,t=Object.entries(this.get("conversationStatus")),n=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(n),!1).forEach((function(t){var n,r,i,o,a,s,l,c,d,f,p,h,g,_,b,E=u(t,2),v=E[0],m=E[1],y=Rh(v);$(y.conversationType,J)&&e.getOrCreateModel(y,!0).updateAttrs((r=(n=m).c,i=n.mc,o=n.mmc,a=n.hm,s=n.m,l=n.fut,c=n.fuid,d=n.fumt,f=n.nl,p=n.to,h=n.tg,g=n.rt,_=n.h,b=n.ts,{isTop:p,notificationLevel:f,tags:Oh(h),unreadCount:r,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:a,mentionedInfo:s,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:g,hidden:_,translateStrategy:b}),0)}))};var jh,Gh,kh,Fh,xh,Bh,Hh,qh,Yh,Kh,Qh=function(e,t){return qu.encode(Na,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},Wh=function(e){var t=qu.decode(va,e),n=t.compressioEnabled,r=t.compressedData,i=t.info,o=t.pullTime,a=t.isFinished;if(n){var s=Dp(r);return Wh(s)}return{info:i,pullTime:o,isFinished:a}},Jh=function(e){var t=qu.decode(sa,e);if(t.compressioEnabled){var n=Dp(t.compressedData);return Jh(n)}return t},zh=function(e){var t=qu.decode(ua,e);if(t.compressioEnabled){var n=Dp(t.compressedData);return zh(n)}return{syncTime:t.syncTime,list:t.list.map((function(e){return qu.decode(la,new Uint8Array(e))}))}},Xh=function(e){return qu.encode(is,r(r({},e),{compress:Zl.enable()}))},Zh=function(e){var t=qu.decode(as,e);if(t.compress){var n=Dp(t.compressData);return Zh(n)}return t},$h=function(e){var t=qu.decode(ss,e);if(t.compress){var n=Dp(t.compressData);return $h(n)}return t},eg=function(e){var t=qu.decode(Ca,e);if(t.compressioEnabled){var n=Dp(t.compressedData);return eg(n)}return t},tg=function(e,t){return qu.encode(Ja,{ignoreVersion:!0,version:e,state:t})},ng=function(e){function n(t,n){var r=e.call(this)||this;return jh.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),r._ctx.on("sNtf",c(r,jh,"m",xh),r),r._ctx.on("signal",c(r,jh,"m",kh),r),r._ctx.on("syncMsg",c(r,jh,"m",Gh),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,u,l,c,d,f,p,h,g,_,b,E;return a(this,(function(a){switch(a.label){case 0:return e=this._ctx,t=e.logger,n=e.currentUserId,r=e.connectedTime,i=this._storage.get("inboxTime"),o=this._storage.get("outboxTime"),s=this._storage.get("broadcastTime"),u=t.createTraceId(),t.info(H.L_PULL_MSG_T,JSON.stringify({inboxTime:i,outboxTime:o,broadcastTime:s}),u),l=qu.encode(ia,{ispolling:!1,isPullSend:!0,syncTime:i,sendBoxSyncTime:o,broadcastSyncTime:s,compressioEnabled:Zl.enable()}),[4,this._ctx.query(Gr.pullMsg,this._ctx.currentUserId,l)];case 1:return c=a.sent(),t.summary(H.L_PULL_MSG_R,c,u,{inboxTime:i,outboxTime:o,broadcastTime:s}),c.isOk?(d=Jh(c.data.pbData),p=(f=d).list,h=f.finished,g=f.syncTime,_=f.broadcastSyncTime,b=o,E=p.map((function(e){var t=Jl(e,n,r);return t.messageDirection===_e.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",g),this._storage.set("broadcastTime",_||1),this._storage.set("outboxTime",b),this._ctx.emit("messagesFromSG",E,!!h),[2,vn({version:g,hasNext:!h})]):[2,c.wipe()]}}))}))}}),n}(hn);jh=new WeakSet,Gh=function(e,t){var n=t.conversationType;n!==B.ULTRA_GROUP&&n!==B.CHATROOM&&this.waitingQueueLength>0&&(this.push(t.sentTime),e.stopPropagation())},kh=function(e,t){t.syncMsg,Hr(t.topic)===Gr.s_msg&&(c(this,jh,"m",Fh).call(this,t),e.stopPropagation())},Fh=function(e){var t=this._ctx,n=t.logger,r=t.currentUserId,i=t.connectedTime,o=qu.decode(la,e.pbData),a=Jl(o,r,i),s=a.conversationType,u=a.messageType,l=a.senderUserId,c=a.messageUId,d=a.sentTime,f=a.isStatusMessage;if(n.info(H.L_RECV_S_MSG_O,JSON.stringify({messageUId:c,messageId:a.messageId,sentTime:d})),s===B.RTC_ROOM||u===ye.INTERCEPT){if(this._isPulling)return;if(this.waitingQueueLength>0)return void this.push(a.sentTime)}f||l===r||this._storage.set("inboxTime",d),this._ctx.emit("smsgFromSignalGroup",a)},xh=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var rg,ig,og=function(e){function n(t){var n=e.call(this)||this;return Bh.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n._ctx.on("syncMsg",c(n,Bh,"m",qh),n),n._ctx.on("sCmd",c(n,Bh,"m",Hh),n),n}return t(n,e),Object.defineProperty(n.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,Bh,"m",Kh).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(H.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,Bh,"m",Yh).call(this,0,[])]):(this._ctx.logger.warn(H.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(n=a.sent()).isOk?(r=n.data,i=r.length>0?r[r.length-1].versionTime:0,o=Math.max(t,i),[2,vn({relations:r,msgVersion:o})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,c(this,Bh,"m",Kh).call(this,e)];case 1:return[2,n.sent().trans((function(e){var n=e,r=n.syncTime,i=n.finished,o=n.list;if(null==o?void 0:o.length){var a=t._ctx,s=a.currentUserId,u=a.connectedTime,l=o.map((function(e){return Jl(e,s,u)}));t._ctx.emit("messagesFromUG",l,r)}return{version:r,hasNext:!i}}))]}}))}))}}),n}(hn);Bh=new WeakSet,Hh=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},qh=function(e,t){t.conversationType===B.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},Yh=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,d,f,p,h,g;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx,i=r.logger,o=i.createTraceId(),i.info(H.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),s=qu.encode(hs,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(Gr.pullUgSes,this._ctx.currentUserId,s,va)];case 1:return d=a.sent(),i.summary(H.L_PULL_UG_RELATIONS_R,d,o,{ver:t},(function(e){return{isFinished:e.isFinished}})),d.isOk?(f=d.data,p=f.info,h=f.isFinished,n.push.apply(n,l([],u(p),!1)),h?[2,vn(n)]:(g=p[p.length-1].versionTime,[2,c(this,Bh,"m",e).call(this,g,n)])):[2,d.wipe()]}}))}))},Kh=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=r.createTraceId(),r.info(H.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=qu.encode(gs,{syncTime:l,compressioEnabled:Zl.enable()}),[4,this._ctx.query(Gr.pullUgMsg,n,o)];case 1:return s=a.sent(),r.summary(H.L_PULL_ULTRA_MSG_R,s,i,{version:e}),s.isOk?(u=s.data,[2,vn(Jh(u.pbData))]):[2,s.wipe()]}var l}))}))};var ag=13,sg=36,ug=41,lg=function(e){function n(t,n){var r=e.call(this)||this;return rg.add(r),Object.defineProperty(r,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l,d=this;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,rg,"m",ig).call(this,e)];case 1:return n=a.sent(),this._logger.summary(H.L_PULL_EVENT_CHANGE_R,n,t,{version:e}),n.isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.hasNext,i.length&&(l=new Map,i.forEach((function(e){var t=e.changeType;l.has(t)?l.get(t).push(e):l.set(t,[e])})),Array.from(l.entries()).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];d.emit("serverEvent",n,r)}))),[2,vn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(H.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,rg,"m",ig).call(this,0)];case 1:return t=n.sent(),this._logger.summary(H.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),n}(hn);rg=new WeakSet,ig=function(e){var t=qu.encode(bs,{syncTime:e});return this._con.query(Gr.pullEventChange,this._con.getCurrentUserId(),t,Es)};var cg,dg,fg,pg,hg,gg,_g,bg,Eg,vg,mg,yg,Ig,Tg,Rg,Og,Sg,Cg,Ag,Pg,Ng,wg,Lg,Mg=function(e){function n(t){var n=e.call(this)||this;return Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=qu.encode(bs,{syncTime:e}),[4,this._ctx.query(Gr.qryMsgChange,this._ctx.currentUserId,t,vs)];case 1:return(n=a.sent()).isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.hasNext,i&&i.length&&this._ctx.emit("ugChanged",i),[2,vn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),n}(hn),Ug=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,x.NOT_SUPPORT]}))}))},Dg=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,mn(x.NOT_SUPPORT,"Not support")]}))}))},Vg=18e4,jg=function(){function e(e,t){dg.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),fg.set(this,void 0),pg.set(this,void 0),hg.set(this,void 0),vg.set(this,1),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Ng.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),this.storage=new Uh(e),this.settings=new bh(this._ctx,this.storage),d(this,fg,new og(this._ctx),"f"),d(this,pg,new ng(this._ctx,this.storage),"f"),d(this,hg,new Mg(this._ctx),"f"),this._ctx.on("onConnected",c(this,dg,"m",Eg),this),this._ctx.on("onDisconnected",c(this,dg,"m",Ig),this),this._ctx.on("onSuspend",c(this,dg,"m",Ig),this),this._ctx.on("sCmd",c(this,dg,"m",Tg),this),this._ctx.on("signal",c(this,dg,"m",Rg),this),this._ctx.on("serverEvent",c(this,dg,"m",gg),this)}return Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(e.type){case Rr.TIMESTAMP:return[2,c(this,dg,"m",Og).call(this,e.params)];case Rr.BLOCKED:return[2,c(this,dg,"m",Cg).call(this)];case Rr.TOP:return[2,c(this,dg,"m",Sg).call(this,e.params)];case Rr.UNREAD:return[2,c(this,dg,"m",Ag).call(this,e.params)];default:return[2,mn(x.NOT_SUPPORT)]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){return r=this._ctx.includeUg,i=0,o=t&&t.length?t:Z(r?J:Q),this.storage.getAllModels().forEach((function(t){t.unreadCount>0&&o.includes(t.conversationType)&&(t.conversationType!==B.ULTRA_GROUP&&t.channelId===e||t.conversationType===B.ULTRA_GROUP&&(""===t.channelId||"RCDefault"===t.channelId))&&(n||t.notificationLevel<=ve.NOT_SET)&&(i+=t.unreadCount)})),[2,vn(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:n},!1),[2,vn(r.toIReceivedConversation())]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,dg,"m",Pg).call(this,e,n,t)];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.version,u=o.updateVersion,l=e.map((function(e){var n=d.storage.getOrCreateModel(e,!0);return n.updateAttrs({isTop:t,hidden:!r&&n.hidden,operationTime:n.hidden&&r?Date.now():n.operationTime}),n})),this.storage.updateConversationStorage(l),u&&this.storage.set("conversationStatusVersion",s),[2,vn()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,dg,"m",Pg).call(this,e,n,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({notificationLevel:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,vn()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,dg,"m",Pg).call(this,e,n,void 0,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({translateStrategy:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,vn()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.storage.getOrCreateModel(e,!1),[2,vn(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.storage.getConversationTypeNotificationLevel(e),[2,vn(t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=this._ctx.currentUserId,i=qu.encode(es,{type:e,unpushLevel:t,version:n,ignoreVersion:!0}),[4,this._ctx.query(Gr.setTypeUnpush,r,i,ts)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,vn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this._ctx.includeUg,t=this.storage.getAllSGModels(),e&&t.push.apply(t,l([],u(this.storage.getAllUGModels().filter((function(e){return e.isDefaultChannel()}))),!1)),t.forEach((function(e){e.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0})})),this.storage.updateConversationStorage(t),[2,vn()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),r=qu.encode(ja,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:n}),i=e.conversationType===B.ULTRA_GROUP?Gr.delUgMsg:Gr.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,r)];case 1:return(o=a.sent()).isOk?this._ctx.includeUg?((s=this.storage.getModel(e))&&(u=s.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&s.updateAttrs({latestMessage:null}),[2,vn()]):[2,vn()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=qu.encode(Ia,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),r=Hg[e.conversationType],[4,this._ctx.query(r,this._ctx.currentUserId,n)];case 1:return(i=a.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(s=o.latestMessage)&&(0===t||s.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,vn()]):[2,vn()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=qu.encode(Ta,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(Gr.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(n=i.sent()).isOk?(e.forEach((function(e){var t=r.storage.getModel(e);if(t){var n=t.latestMessage;n&&(!e.timestamp||n.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,vn()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=qu.encode(rs,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),r=t[0],[4,this._ctx.query(Gr.readReceipt,r,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return t=new Map,e.forEach((function(e){var n,r=(n=e.identifier,Th(n.conversationType,n.targetId,n.channelId)),i=t.get(r)||new Set;i.add(e.messageUId),t.set(r,i)})),n=Array.from(t.entries()).map((function(e){var t=u(e,2),n=t[0],r=t[1],i=Rh(n);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(r)}})),r=function(e){return qu.encode(os,{items:e,compress:Zl.enable()})}(n),[4,this._ctx.query(Gr.qryReceiptBatch,e[0].messageUId,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=$h(o.pbData).item,l=[],s.forEach((function(e){var t,n={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,r=e.unreadCnt,i=e.readCnt,o=e.totalCnt;l.push({identifier:n,messageUId:t,unreadCount:r,readCount:i,totalCount:o})}))})),[2,vn(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return r=0===n.readStatus?1:2,i=Xh({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:n.pageToken,pageSize:n.pageCount,readType:r,order:n.order?0:1}),[4,this._ctx.query(Gr.qryReceipt,t,i)];case 1:return(o=a.sent()).isOk?(s=o.data,u=Zh(s.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,vn({pageToken:c||"",totalCount:1===r?d.readCnt:d.unreadCnt,users:(1===r?d.readUser:d.unreadUser).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return r=Xh({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:n}),[4,this._ctx.query(Gr.qryReceipt,t,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=Zh(o.pbData).resp,c=s[0],[2,vn({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){if((n=yn.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===ye.HQ_VOICE||e===ye.VOICE}),!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE)).isFailed)return[2,n.result().wipe()];if(t.messageType===ye.HQ_VOICE){if(r=t.numberOfChannels,i=t.sampleRate,o=t.format,s=t.remoteUrl,n.validate("numberOfChannels",r,(function(e){return 1===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",i,(function(e){return 16e3===e||8e3===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",o).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").validate("remoteUrl",s,(function(e){return e.startsWith("http")}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid"),n.isFailed)return[2,n.result().wipe()]}else u=t.content,n.isNotEmptyString("content",u,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid");return n.isLimitedInteger("duration",t.duration,1,60,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid"),n.isFailed?[2,n.result().wipe()]:c(this,Ng,"f").has(e)?[2,mn(x.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,dg,"m",wg).call(this,e,t),[2,vn()])}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s,l,c,d,f,p,h,g,_,b=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?(n=this.storage.get("conversationStatusVersion"),i=Date.now(),o=this._ctx.currentUserId,s=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:i,stateItem:[{sessionStateType:na.Tags,value:"",tags:[{tagId:e}]}]}})),l=tg(n,s),[4,this._ctx.query(Gr.addTag,o,l,$a)]):[2,mn(x.TAG_NOT_EXIST)];case 1:return(c=a.sent()).isOk?(d=c.data,f=d.version,p=d.updateVersion,h=new Map,t.forEach((function(t){var n=b.storage.getOrCreateModel(t,!0),r={},i=n.tags;i.some((function(t){return t.tagId===e}))||(r.tags=i.concat({tagId:e}),h.set(n,r))})),g=[],_=[],Array.from(h.entries()).forEach((function(e){var t=u(e,2),n=t[0],i=t[1];_.push(n);var o=n.updateAttrs(i,f);o&&g.push(r(r({},n.toIReceivedConversation()),{updatedItems:o}))})),this.storage.updateConversationStorage(_),p&&this.storage.set("conversationStatusVersion",f),g.length>0&&this._ctx.emit("conversationStatusChanged",g),[2,vn()]):[2,c.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),n=this._userSettins.getTags(),r=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=n[e.tagId])||void 0===t?void 0:t.tagName}})),[2,vn(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),i=n.isTop,o=this.storage.getOrCreateModel(t,!1),s=o.tags,(u=s.find((function(t){return t.tagId===e})))?(l=tg(r,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:na.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(Gr.addTag,c,l,$a)]):[2,mn(x.NO_TAG_IN_CONVER)];case 1:return(d=a.sent()).isOk?(f=d.data,p=f.version,h=f.updateVersion,u.isTop=i,o.updateAttrs({tags:s},p),this.storage.updateConversationStorage([o]),h&&this.storage.set("conversationStatusVersion",p),[2,vn()]):[2,d.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=tg(n,[]),i=this._ctx.currentUserId,[4,this._ctx.query(Gr.delTag,i,r,$a)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=t.map((function(t){var n=d.storage.getOrCreateModel(t,!0),r={tags:n.tags.filter((function(t){return t.tagId!==e}))};return n.updateAttrs(r,u),n})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,vn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx.currentUserId,r=this.storage.get("conversationStatusVersion"),i=tg(r,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:na.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(Gr.delTag,n,i,$a)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.getOrCreateModel(e,!0),d=c.tags,f={tags:d.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(f,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,vn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d,f,p,h=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?[4,c(this,dg,"m",Lg).call(this,t,0,n)]:[2,vn([])];case 1:return(i=a.sent()).isOk?(o=this._ctx,s=o.currentUserId,u=o.connectedTime,l=i.data,d=l.info,f=[],p=0,d.forEach((function(t){var n=t.userId,i=t.type,o=t.busChannel,a=h.storage.getOrCreateModel({conversationType:i,targetId:n,channelId:o},!1),l=a.tags.find((function(t){return t.tagId===e}));if(l){var c=l.isTop,d=r(r({},a.toIReceivedConversation()),{isTopInTag:!!c,operationTime:t.versionTime,latestMessage:t.msg?Jl(t.msg,s,u):null});c?f.splice(p++,0,d):f.push(d)}})),[2,vn(f)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=0,this.storage.getAllSGModels().forEach((function(r){var i;if(r.tags.some((function(t){return t.tagId===e}))){if(r.notificationLevel>ve.NOT_SET&&!t)return;n+=null!==(i=r.unreadCount)&&void 0!==i?i:0}})),[2,vn(n)]}))}))}}),e}();fg=new WeakMap,pg=new WeakMap,hg=new WeakMap,vg=new WeakMap,Ng=new WeakMap,dg=new WeakSet,gg=function(e,t,n){if(t===sg){e.stopPropagation();var r=[];n.forEach((function(e){if(0===e.subChangeType){var t=qu.decode(Cu,new Uint8Array(e.eventData)),n=t.msgId,i=t.unreadCnt,o=t.readCnt,a=t.readList,s=t.totalCnt;r.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:n,users:a.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:s})}})),this._ctx.emit("readReceiptResponseV5",r)}},_g=function(e){e||(c(this,pg,"f").setInitVersion(0),this._ctx.includeUg&&c(this,dg,"m",mg).call(this)),c(this,pg,"f").startInterval(Vg,!0)},bg=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,this.settings.syncDataFromServer()];case 1:t=n.sent(),this.settings.setInitVersion(t),n.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(Vg,!0),[2]}}))}))},Eg=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,dg,"m",bg).call(this,t),c(this,dg,"m",_g).call(this,t),this._ctx.ugEnabel&&c(this,dg,"m",yg).call(this,t)},mg=function e(){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,f=this;return a(this,(function(a){switch(a.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,n=t.createTraceId(),r=c(this,vg,"f"),t.info(H.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:r}),n),[4,c(this,dg,"m",Lg).call(this,r,1,1e3)]):[2];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.info,u=o.isFinished,l=o.pullTime,d(this,vg,l,"f"),t.info(H.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:r,isFinished:u,pullTime:l}),n),this.storage.addRelations(s,this._ctx.currentUserId,this._ctx.connectedTime),u?(this._ctx.emit("sgRelationsSynced"),[2]):[2,c(this,dg,"m",e).call(this)]):(t.warn(H.L_PULL_SG_RELATIONS_R,i.errmsg(),n),setTimeout((function(){return c(f,dg,"m",e).call(f)}),1e3),[2])}}))}))},yg=function(e){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,c(this,fg,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,n=t.relations,r=t.msgVersion,this.storage.addRelations(n,this._ctx.currentUserId,this._ctx.connectedTime),this._ctx.emit("ultraGroupEnable"),c(this,fg,"f").setInitVersion(r),c(this,fg,"f").startInterval(Vg,!0),c(this,hg,"f").setInitVersion(r),c(this,hg,"f").startInterval(Vg,!0),[2]):[2]}}))}))},Ig=function(){this.settings.stopInterval(),c(this,fg,"f").reset(),c(this,pg,"f").reset(),c(this,hg,"f").reset()},Tg=function(e,t){if(3===t.type)return e.stopPropagation(),void this.settings.push(t.time);7===t.type&&(e.stopPropagation(),c(this,hg,"f").push(t.time))},Rg=function(e,t,n){var r=t.syncMsg,i=Hr(t.topic);if(r&&i===Gr.updUgRTime){e.stopPropagation();var o=qu.decode(Na,t.pbData),a=o.channelId,s=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount(B.ULTRA_GROUP,a,s||"",u);l&&this._ctx.emit("conversationStatusChanged",[l])}},Og=function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l,d,f,p,h,g,_,b,E,v,m=this;return a(this,(function(a){switch(a.label){case 0:return t=e.count,n=e.startTime,i=e.order,o=this._ctx,s=o.currentUserId,u=o.connectedTime,this._ctx.includeUg?[3,2]:[4,c(this,dg,"m",Lg).call(this,n,i||0,t)];case 1:return(l=a.sent()).isOk?(d=l.data,f=d.info,p=d.isFinished,h=f.map((function(e){var t=e.userId,n=e.type,i=e.busChannel,o=m.storage.getOrCreateModel({conversationType:n,targetId:t,channelId:i},!1);return r(r({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Jl(e.msg,s,u):null})})),[2,vn({list:h,hasNext:"boolean"==typeof p?!p:void 0})]):[2,l.wipe()];case 2:return g=0!==n||i?n:Number.MAX_SAFE_INTEGER,_=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==B.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>g:e.operationTime<g)})).sort((function(e,t){return e.operationTime-t.operationTime})),b=_.length>t,E=Math.min(_.length,t),v=i?_.slice(0,E):_.slice(_.length-E),i||v.reverse(),[2,vn({hasNext:b,list:v.map((function(e){return e.toIReceivedConversation()}))})]}}))}))},Sg=function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){return n=this._ctx.includeUg,r=null==e?void 0:e.channelId,i=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:Z(n?J:Q),o=this.storage.getAllModels().filter((function(e){return e.isTop&&!e.hidden&&(e.conversationType!==B.ULTRA_GROUP&&(!r||e.channelId===r)||n&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&i.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,vn({list:o,hasNext:!1})]}))}))},Cg=function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>ve.NOT_SET&&(t.conversationType!==B.ULTRA_GROUP||e&&(!t.channelId||""===t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,vn({list:t,hasNext:!1})]}))}))},Ag=function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return n=this._ctx.includeUg,r=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:Z(n?J:Q),i=this.storage.getAllModels().filter((function(e){return e.unreadCount>0&&(e.conversationType!==B.ULTRA_GROUP||n&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&r.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,vn({list:i,hasNext:!1})]}))}))},Pg=function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){return o=[],void 0!==n&&o.push({sessionStateType:na.IsTop,value:n?"1":"0"}),void 0!==r&&o.push({sessionStateType:na.IsSilent,value:r.toString()}),void 0!==i&&o.push({sessionStateType:na.AutoTrans,value:i.toString()}),s=tg(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(Gr.setSeAtt,this._ctx.currentUserId,s,$a)]}))}))},wg=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return c(this,Ng,"f").add(e),n=t.messageType===ye.HQ_VOICE?{msgId:e,objectName:t.messageType,content:t.remoteUrl,sampleRate:t.sampleRate,channelNumber:t.numberOfChannels,format:t.format}:{msgId:e,objectName:t.messageType,content:t.content},r=qu.encode(Au,{businessType:1,businessInfo:qu.encode(Pu,n)}),[4,this._ctx.query(Gr.upConvertMsg,e,r,Nu)];case 1:return i=a.sent(),c(this,Ng,"f").delete(e),o=i.code,i.isOk?(u=qu.decode(wu,new Uint8Array(i.data.businessResult)),s={status:Ve.SUCCESS,text:u.result}):s={status:Ve.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:s}),[2]}}))}))},Lg=function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this._ctx.currentUserId,i=function(e,t,n){return qu.encode(ba,{startTime:e,order:t,count:n,compressioEnabled:Zl.enable()})}(e,t,n),[4,this._ctx.query(Gr.qryRelationR,r,i)];case 1:return[2,o.sent().trans((function(e){return Wh(e.pbData)}))]}}))}))};var Gg,kg,Fg,xg,Bg,Hg=((cg={})[B.PRIVATE]=Gr.cleanPMsg,cg[B.GROUP]=Gr.cleanGMsg,cg[B.CUSTOMER_SERVICE]=Gr.cleanCMsg,cg[B.SYSTEM]=Gr.cleanSMsg,cg[B.APP_PUBLIC_SERVICE]=Gr.cleanMCMsg,cg[B.PUBLIC_SERVICE]=Gr.cleanMPMsg,cg[B.ULTRA_GROUP]=Gr.cleanGMsg,cg),qg=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function Yg(e){var t=!(1&~(e.ugMsg||0)),n=!(1&~(e.sessionCfg||0));return t&&n}var Kg=[Gr.chatMsg,Gr.ugMsg,Gr.recallMsg,Gr.ppMsgS,Gr.pgMsgS,Gr.ppMsgP,Gr.pgMsgP,Gr.pcMsgP,Gr.prMsgS,Gr.pbMsgP],Qg=function(e){function n(t,n,r,i){var o=e.call(this)||this;return Gg.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),kg.set(o,void 0),o.userStorage=new qg,d(o,kg,new lg(n,i),"f"),c(o,kg,"f").pipe(o),o.on("onConnected",c(o,Gg,"m",Fg),o,100),o.on("onDisconnected",c(o,Gg,"m",xg),o,100),o.on("onSuspend",c(o,Gg,"m",xg),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,Gg,"m",Bg),o),o}return t(n,e),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"includeUg",{get:function(){return Yg(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),n}(pn);kg=new WeakMap,Gg=new WeakSet,Fg=function(e,t){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return e=this.getNaviInfoFromCache(),t=e.eventDriven||0,n=e.grpRRVer||0,(3&t)>0||4===n?[4,c(this,kg,"f").noticeOnline()]:[3,2];case 1:if(!(r=a.sent()).isOk)return[2];i=r.data,o=i.syncTime,s=i.hasNext,c(this,kg,"f").setInitVersion(o),c(this,kg,"f").startInterval(18e4,!!s),a.label=2;case 2:return[2]}}))}))},xg=function(e){c(this,kg,"f").reset()},Bg=function(e,t,n){var r=t.topic,i=t.syncMsg,o=Hr(r);if(o||(this.logger.warn(H.L_RECV_RMTP_E,"unknown topic: ".concat(r)),e.stopPropagation()),this.logger.debug(H.L_RECV_RMTP_O,r),i&&Kg.includes(o)){e.stopPropagation();var a=Wl(t,this.currentUserId,n.timestamp,n.messageUId),s=Jl(a,this.currentUserId,this.connectedTime,t.targetId);this.emit("syncMsg",s)}else{if(o===Gr.s_ntf){e.stopPropagation();var u=(f=qu.decode(ra,t.pbData)).type,l=f.chrmId,d=f.time;return this.logger.info(H.L_RECV_S_NTF_O,"type: ".concat(u,", chrmId: ").concat(l,", time: ").concat(d)),void this.emit("sNtf",f)}if(o===Gr.s_cmd){e.stopPropagation();var f;u=(f=qu.decode(ra,t.pbData)).type,l=f.chrmId,d=f.time;if(this.logger.info(H.L_RECV_S_CMD_O,"type: ".concat(u,", chrmId: ").concat(l,", time: ").concat(d)),11===u)return void c(this,kg,"f").push(d);this.emit("sCmd",f)}}};var Wg,Jg,zg,Xg,Zg,$g=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return o=function(e){return qu.encode(Sa,r(r({},e),{compressioEnabled:Zl.enable()}))}({targetId:e,time:t,count:n,order:i}),s=this.ctx,u=s.currentUserId,l=s.connectedTime,[4,this.ctx.query(Gr.qryCHMsg,e,o)];case 1:return(c=a.sent()).isOk?(d=eg(c.data.pbData),[2,vn({hasMore:!!d.hasMsg,list:d.list.map((function(e){return Jl(e,u,l)}))})]):[2,c.wipe()]}}))}))}}),e}(),e_=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=zo.localStorage,n=e.appkey,r=e.currentUserId,i=nt(n,r),o=t.getItem(i)||"{}",a=JSON.parse(o);return{value:{value:{version:a.version||0,tags:a.tags||{},transLan:a.transLan||"zh",autoTrans:a.autoTrans||!1},key:i,stringify:!0}}}}),Object.defineProperty(n.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(n.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;r[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),Object.defineProperty(n.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;delete r[e],this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),n}(Ih),t_=function(e){function n(t){var n=e.call(this)||this;return Wg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Jg.set(n,!1),n.storage=new e_,n._ctx.on("onConnected",n._handleConnected,n),n._ctx.on("onDisconnected",n._handleDisconnected,n),n._ctx.on("onSuspend",n._handleDisconnected,n),n._ctx.on("signal",n._handleSignal,n),n}return t(n,e),Object.defineProperty(n.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),d(this,Jg,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(n.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(n.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(Hr(t.topic)===Gr.s_us){var n=qu.decode(fs,t.pbData).version;this.push(n),e.stopPropagation()}}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,d,f,p,h,g,_,b,E,v,m,y;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=this._ctx.getNaviInfoFromCache(),o=r.createTraceId(),r.info(H.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),s=qu.encode(Ya,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(Gr.pullUS,n,s,Ka)];case 1:return u=a.sent(),r.summary(H.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,f=l.items,p=!1,h=!1,g=!1,_="",b=this.storage.get("value"),E=b.transLan,v=b.autoTrans,m=b.tags,y={version:d,transLan:E,autoTrans:v,tags:m},null==f||f.forEach((function(e){var t=e.key,n=e.value;switch(t){case"Tag":y.tags={},e.tags.forEach((function(e){y.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),p=!0;break;case"transLan":g=!0,y.transLan=Bi.readUTF(new Uint8Array(n));break;case"autoTrans":h=!0,y.autoTrans="1"===Bi.readUTF(new Uint8Array(n));break;case"VoipInfo":_=Bi.readUTF(new Uint8Array(n))}})),this.storage.set("value",y),p&&this.emit("tagsChanged"),g&&this.emit("userSettingsChanged",{key:Hn.TranslationLanguage,value:y.transLan}),h&&this.emit("userSettingsChanged",{key:Hn.AutoTranslateEnable,value:y.autoTrans}),_&&this.emit("voipInfoChanged",_),c(this,Wg,"m",zg).call(this,u.code),[2,vn({version:d})]):(c(this,Wg,"m",zg).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(n.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(n.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(n.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=qu.encode(ls,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(Gr.addSeTag,n,r,qa)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.addTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=qu.encode(ds,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(Gr.delSeTag,n,r,qa)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,Wg,"m",Xg).call(this,Gr.transLan,e)]}))}))}}),Object.defineProperty(n.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,vn(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(n.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,Wg,"m",Xg).call(this,Gr.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(n.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,vn(this.storage.get("value").autoTrans)]}))}))}}),n}(hn);Jg=new WeakMap,Wg=new WeakSet,zg=function(e){c(this,Jg,"f")&&(d(this,Jg,!1,"f"),this.emit("userSettingsSynced",e))},Xg=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h,g;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.version,r=this._ctx.currentUserId,i=qu.encode(Ha,{version:n,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,r,i,qa)];case 1:if((o=a.sent()).isOk){switch(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.get("value"),d=c.transLan,f=c.autoTrans,p=c.tags,h=c.version,g={version:l?u:h,transLan:d,autoTrans:f,tags:p},e){case Gr.transLan:g.transLan=t;break;case Gr.autoTrans:g.autoTrans="1"===t}this.storage.set("value",g)}return[2,o.wipe()]}}))}))};var n_=((Zg={})[B.PRIVATE]=Gr.qryPMsg,Zg[B.GROUP]=Gr.qryGMsg,Zg[B.CHATROOM]=Gr.qryCHMsg,Zg[B.CUSTOMER_SERVICE]=Gr.qryCMsg,Zg[B.SYSTEM]=Gr.qrySMsg,Zg[B.APP_PUBLIC_SERVICE]=Gr.qryMCMsg,Zg[B.PUBLIC_SERVICE]=Gr.qryMPMsg,Zg),r_=function(e,t,n,r,i,o,a){return{conversationType:e,targetId:t,senderUserId:o,messageDirection:_e.SEND,isCounted:!!n.isCounted,isMentioned:!!n.isMentioned,content:n.content,messageType:n.messageType,isOffLineMessage:!1,isPersited:!!n.isPersited,messageUId:r,sentTime:i,receivedTime:0,disableNotification:!!n.disableNotification,isStatusMessage:!!n.isStatusMessage,canIncludeExpansion:!!n.canIncludeExpansion,expansion:n.canIncludeExpansion?n.expansion:null,receivedStatus:Ie.UNREAD,receivedStatusInfo:Vt(Ie.UNREAD),pushConfig:n.pushConfig,channelId:n.channelId,isInterrupt:n.isInterrupt,messageId:a||0,sentStatus:ae.SENT,directedUserIds:n.directionalUserIdList,disableUpdateLastMessage:n.disableUpdateLastMessage,needReceipt:n.needReceipt}},i_=[L.GROUP_OPERATION,L.GROUP_PROFILE_CHANGE,L.GROUP_APPLICATION_INVITATION,L.GROUP_FOLLOW_USER_CHANGE],o_=[v.FRIEND_APPLICATION];function a_(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve({code:x.RC_NET_UNAVAILABLE})]}))}))},n}}function s_(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve(mn(x.RC_NET_UNAVAILABLE))]}))}))},n}}function u_(e){return e?e.map((function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:e.extProfile,addTime:Ut(e.relationTime),inBlackList:!!e.flag}})):[]}function l_(e){return e&&e.list?e.list.map((function(e){return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",applicationType:e.type,applicationStatus:e.status,operationTime:Ut(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var c_,d_=function(e){function d(t,n,r){var i=this,o=r.loggerProxy?r.loggerProxy:ih();i=e.call(this,t,n,r,new qp(r.appkey,"IMLib","IM",o))||this,f.add(i),Object.defineProperty(i,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmEntryHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_joinedChrmManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_loggerProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmsQueue",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"_intervalTimerForChrmPull",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t,n){var r,o=n.messageType;if(o===ye.SYNC_READ_STATUS&&function(e){return[B.GROUP,B.DISCUSSION,B.ULTRA_GROUP,B.PUBLIC_SERVICE,B.APP_PUBLIC_SERVICE].includes(e)}(e)&&Object.assign(n,{directionalUserIdList:[i.currentUserId]}),o===ye.READ_RECEIPT_RESPONSE){if(!n.content.receiptMessageDic||0===Object.keys(n.content.receiptMessageDic).length){var a=null===(r=i._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic({conversationType:e,targetId:t,channelId:n.channelId});n.content.receiptMessageDic=a||{}}for(var s in n.directionalUserIdList=[],n.content.receiptMessageDic)n.directionalUserIdList.push(s)}return n}}),Object.defineProperty(i,"_isUltraGroupListExist",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"getMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"deleteMessages",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"deleteMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"batchClearMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"clearMessages",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"getMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Ug}),Object.defineProperty(i,"getGroupMessageDeliverList",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"getPrivateMessageDeliverTime",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),Object.defineProperty(i,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Dg}),i._loggerProxy=o;var a=r.appkey,s=r.logOutputLevel,u=r.logExpireTime,l=r.navigators,d=r.areaCode,_=r.logServerUrl,b=r.miniCMPProxy,E=r.environment,v=r.useNaviV2,m=void 0!==v&&v,y=r.enableReadReceiptStorage;i._environment=E||"default",i._enableReadReceiptStorage=y,i.logger.setOutputLevel(s),Wn.init({areaCode:d,navigators:l,logServerUrl:_,miniCMPProxy:b}),r.loggerProxy||Zp(a,i.logger,u),i.reporter=new gh(a,i.logger,i._loggerProxy),i.navi=new pc(a,i.logger,new vc(a,i.logger),i._environment,m),i.reporterStatistic=new _h(a,i.logger,i._loggerProxy),i._sendMessageStore=new hc(a),i._chrmEntryHandler=new lc(i);var I=i._connMgr=new Bp(a,i.navi,i.logger),T=i._ctx=new Qg(i._appkey,I,i.navi,i.logger);return i._connMgr.pipe(T),"browser"===zo.tag&&i._initCloudController(),i._userSettings=new t_(T),i._chat=new jg(T,i._userSettings),i._chatroom=new $g(T),T.on("conversationStatusChanged",i._conversationStatusChanged,i),T.on("sCmd",i._handleSCmdNotify,i),T.on("sNtf",i._handleMsgNotify,i),T.on("signal",i._handleSignal,i),T.on("onConnected",i.onConnected,i),T.on("onDisconnected",i.onDisconnected,i),T.on("onConnecting",i.onConnecting,i),T.on("onSuspend",i.onSuspend,i),T.on("ultraGroupEnable",i._handleUltraGroupEnable,i),T.on("messagesFromUG",i._handleMessagesFromUltraGroup,i),T.on("messagesFromSG",i._handleMessagesFromSignalGroup,i),T.on("smsgFromSignalGroup",i._handleSmsgFromSignalGroup,i),T.on("syncMsg",i._handleSyncMsg,i),T.on("sgRelationsSynced",i._handleSGRelationsSynced,i),T.on("serverEvent",c(i,f,"m",g),i),T.on("readReceiptResponseV5",c(i,f,"m",p),i),T.on("speechToTextResponse",c(i,f,"m",h),i),T.on("ugChanged",i._handleUGChangeList,i),T.on("conversationStatusSynced",(function(e,t){return i._watcher.conversationStatusSynced(t)}),i),i._userSettings.on("voipInfoChanged",i._naviChangeHandler,i),i._userSettings.on("tagsChanged",(function(){return i._watcher.tag()}),i),i._userSettings.on("userSettingsSynced",(function(e,t){return i._watcher.userSettingsSynced(t)}),i),i._userSettings.on("userSettingsChanged",(function(e,t){return i._watcher.userSettingsChanged(t)}),i),i}var f,p,h,g,_;return t(d,e),Object.defineProperty(d.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(Wn.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new Hp(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,ar.init)}}),Object.defineProperty(d.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._joinedChrmManager||(this._joinedChrmManager=new cc(n.joinMChrm)),this._readReceiptManager||(this._readReceiptManager=new Ec(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(n),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(n),this.reporterStatistic.checkStart(n)}}),Object.defineProperty(d.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(d.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(d.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(d.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var n=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));n&&this._watcher.conversationTag()}}),Object.defineProperty(d.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new bc(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(d.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new qp(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(d.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(d.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())}}),Object.defineProperty(d.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectedTime()}}),Object.defineProperty(d.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectionStatus()}}),Object.defineProperty(d.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))}}),Object.defineProperty(d.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable()}}),Object.defineProperty(d.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.sgRelationsSynced()}}),Object.defineProperty(d.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i=this,o=new Map,a=[];t.forEach((function(e){var t,n,r,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,f=e.isCounted,p=e.senderUserId,h=e.messageType,g=e.sentTime,_=e.channelType,b=e.isPersited;if(i._ultraMsgMap[l])delete i._ultraMsgMap[l];else{var E={conversationType:B.ULTRA_GROUP,targetId:s,channelId:c||""},v=i._chat.storage.getOrCreateModel(E,!0),m=o.get(v)||{channelType:_};o.set(v,m),b&&(m.hidden=!1,m.latestMessage=e,m.operationTime=g),f&&p!==i.currentUserId&&h!==ye.RECALL_NOTIFICATION_MESSAGE&&(m.unreadCount=v.unreadCount+1,d&&((null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===K.ALL||(null===(r=null===(n=null==u?void 0:u.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===r?void 0:r.includes(i.currentUserId)))&&(m.unreadMentionedCount=v.unreadMentionedCount+1,m.hasMentioned=!0,m.mentionedInfo=null==u?void 0:u.mentionedInfo),v.firstUnreadMessage||(m.firstUnreadMessageType=h,m.firstUnreadMessageUId=l,m.firstUnreadTime=g)),a.push(e)}}));var s=[],l=[];Array.from(o.entries()).forEach((function(e){var t=u(e,2),n=t[0],i=t[1];s.push(n);var o=n.updateAttrs(i);o&&l.push(r(r({},n.toIReceivedConversation()),{updatedItems:o}))})),this._chat.storage.updateConversationStorage(s),l.length>0&&this._watcher.conversation(l),this._batchMessage(a)}}),Object.defineProperty(d.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var a=i.messages,s=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(Ee.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(a),s.forEach((function(e){r._receiveMessageExpansion(e)})),u.forEach((function(e){r._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),n&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished())}}),Object.defineProperty(d.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,n);else switch(Hr(o)){case Gr.rtc_ntf:this._receiveRtcKv(t.pbData);break;case Gr.s_opNtf:this._pullOperateStatusNotify(t);break;case Gr.s_pubCall:this._pubCallInfo(t);break;case Gr.s_stat:null===(r=this._subscribeManager)||void 0===r||r.updateUserStatus(t)}}}),Object.defineProperty(d.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r,i,o=t.time,a=t.type,s=t.chrmId;switch(a){case 2:if(!this._chrmsQueue[s])return;this._chrmEntryHandler.pullEntry(s,o);break;case 4:this._chrmEntryHandler.reset(s),this._watcher.chatroom({chatroomDestroyed:s});break;case 8:null===(n=this._subscribeManager)||void 0===n||n.startsyncSubscribeUserStatus(o);break;case 9:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(d.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,i=e.conversationType,o=e.targetId,a=t.put,s=t.del,u=t.mid;a&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:a,channelId:r,conversationType:i,targetId:o}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:r,conversationType:i,targetId:o}})}}),Object.defineProperty(d.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var o=this._chat.storage.clearConversationUnreadCount(e,t,n,i);r&&o&&this._watcher.conversation([o])}}),Object.defineProperty(d.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.isPersited,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.disableUpdateLastMessage;e.messageDirection;var u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,f=e.content,p=e.isMentioned;if($(t,Q)){var h=this.getNaviInfoFromCache(),g=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),_={},b=u===this.currentUserId,E=l===ye.RECALL,v=g.lastReadTime>a;if(c&&!Xl(h).isOk&&!E&&!b&&!v&&(0===g.unreadCount&&(_.firstUnreadMessageUId=d,_.firstUnreadTime=a,_.firstUnreadMessageType=l),_.unreadCount=g.unreadCount+1,p&&yt(f)&&f.mentionedInfo)){_.hasMentioned=!0,_.mentionedInfo=f.mentionedInfo;var m=f.mentionedInfo,y=m.type,I=m.userIdList;(y===K.ALL||(I||[]).includes(this.currentUserId))&&(_.unreadMentionedCount=g.unreadMentionedCount+1)}if(E&&yt(f)){var T=f,R=T.sentTime,O=T.messageUId;!this._ctx.userStorage.recallMsgMap.has(O)&&g.unreadCount>0&&R>g.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(O),_.unreadCount=g.unreadCount-1,0===g.unreadCount&&(_.firstUnreadMessageUId="",_.firstUnreadTime=0,_.firstUnreadMessageType=""))}n&&(E&&!g.hidden||(_.operationTime=a),_.hidden=!1,s||g.latestMessage&&!(g.latestMessage.sentTime<a)||(_.latestMessage=e));var S=g.updateAttrs(_);this._chat.storage.updateConversationStorage([g]),S&&n&&!s&&this._watcher.conversation([r(r({},g.toIReceivedConversation()),{updatedItems:S})])}}}),Object.defineProperty(d.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;switch(Hr(e.topic)){case Gr.updRTime:this._receivesyncReadStatus(e);break;case Gr.updUserSub:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(d.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,n=[],r=[],i=[],o=e.length-1;o>=0;o-=1){var a=e[o];a.messageType===ye.LOG_COMMAND&&a.senderUserId===qe?r.unshift(a):a.messageType===ye.CLOUD_CONTROL&&a.senderUserId===qe?i.push(a):n.unshift(a)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,i=n.endTime,o=n.platform,a=n.logId,s=n.uri;t.reporter.report(parseInt(r,10),parseInt(i,10),o,s,a,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(d.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,ar.other,n)]):[3,2];case 1:r=o.sent()||0,(i=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(d.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.decode(Ss,e.pbData),n=t.key,r=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))}}),Object.defineProperty(d.prototype,"_handleMsgNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.type,r=t.chrmId,i=t.time;if(2===n){var o=this._chrmsQueue[r];o&&(o.queue.push(i),this._pullChrmMsg(r))}}}),Object.defineProperty(d.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=qu.decode(Na,e.pbData),n=t.type,r=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(n,r,o||"",!0,i),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:o,timestamp:i})}}),Object.defineProperty(d.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=qu.encode(Cs,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(Gr.pullKvMsg,this.currentUserId,e,As)]):[2];case 1:return t=i.sent(),n=t.isOk,r=t.data,n&&r?(this._latestPullKVMsgTimestamp=r.maxTime,this._watcher.callInfo(JSON.stringify({list:r.info})),[2]):[2]}}))}))}}),Object.defineProperty(d.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===pe.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===ye.DELIVERED||t===ye.DELIVERED_MSG||t===ye.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(d.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=0,r=[],i=[],o=[],a=[],s=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,f=e.messageUId,p=e.messageType,h=e.sentTime,g=e.senderUserId,_=e.content;if(r.push(f),d===_e.SEND){n=Math.max(h,n);var b=t._sendMessageStore.getSendMessageMap(),E=p===ye.RECALL?"Cmd:".concat(_.messageUId):f;if(b[E])return void t._sendMessageStore.removeByUID(E)}if(!t._filterMessage(e)){switch(h>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,f)&&s.push(f),p){case ye.EXPANSION_NOTIFY:return void o.push(e);case ye.READ_RECEIPT:g===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,h);break;case ye.READ_STATE:return void a.push(e);case ye.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case ye.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}var v=t._handleMsgProperties(e);t._setConversationCacheByMessage(v),i.push(v)}})),{newOutboxTime:n,messageUIds:r,messages:i,messageExpansionList:o,RSMsgList:a,msgUIds2Statistic:s}}}),Object.defineProperty(d.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,o=e.senderUserId,a=e.sentTime;if(o!==this.currentUserId)return!1;var s=this.getNaviInfoFromCache();return this._clearConversationUnreadCount(t,n,r,!0,a),1!==s.sesDriven||(a>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(d.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,i=e.channelId,o=e.content,a={conversationType:t,targetId:n,channelId:i};this._watcher.messageReadReceipt(t===B.PRIVATE?{privateReadReceipt:r(r({},a),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:r(r({},a),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(d.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.conversationType,r=e.channelId,i=e.targetId,o=e.content,a=e.sentTime,s=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:n,channelId:r,targetId:i},o.messageUId,s,a,u)}}),Object.defineProperty(d.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r,i=this,o=e.conversationType,a=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,f=void 0===d?{}:d;if(c===this.currentUserId)for(var p in f){var h=f[p];try{for(var g=(t=void 0,s(h)),_=g.next();!_.done;_=g.next()){var b=_.value;null===(r=this._readReceiptManager)||void 0===r||r.remove({conversationType:o,channelId:a,targetId:u},b)}}catch(e){t={error:e}}finally{try{_&&!_.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}}else(f[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:a,targetId:u},e,c)}))}}),Object.defineProperty(d.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._isConnected){var n=t.conversationType;t.messageType;var r=t.senderUserId,i=t.messageUId,o=t.sentTime;t.isStatusMessage,this._writeMessagesLog(n,i)&&this.logger.record(Ee.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),r===this.currentUserId&&this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}}),Object.defineProperty(d.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===ye.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===ye.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(d.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){(t.conversationType!==B.CHATROOM||this._chrmsQueue[t.targetId])&&(this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(H.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==ye.EXPANSION_NOTIFY?((t.messageType===ye.SYNC_READ_STATUS||t.messageType===ye.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===ye.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===ye.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t))}}),Object.defineProperty(d.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,n=e.senderUserId;return t===ye.DELIVERED||(t===ye.DELIVERED_MSG||(t===ye.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===ye.SYNC_READ_STATUS&&n!==this.currentUserId||t===ye.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(d.prototype,"_handleMsgProperties",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1);var n,r=e.messageType,i=e.isStatusMessage,o=e.isCounted,a=void 0!==o&&o,s=e.isPersited,u=void 0!==s&&s;if(n=mr(r)?vr(r):{isCounted:a,isPersited:u,isStatusMessage:!1},Object.assign(e,n),t&&!Tt(i)&&(e.isStatusMessage=i),!t){var l=e.content.user;if(l){var c=l.portrait,d=l.portraitUri,f=c||d;f&&(l.portrait=l.portraitUri=f)}}return e}}),Object.defineProperty(d.prototype,"_fixDownstreamData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return e&&2===t.list.length&&(t.hasMore=!0,0===n?t.list.shift():t.list.pop()),t}}),Object.defineProperty(d.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s,u,l){var c;return void 0===s&&(s=""),o(this,void 0,void 0,(function(){var o,u,d,f,p,h,g,_,b,E,v,m=this;return a(this,(function(a){switch(a.label){case 0:return u=(o=this).currentUserId,d=o._connMgr,f=n_[e]||Gr.qryPMsg,p=1===r&&0===n,d?(h=d.codec.encodeGetHistoryMsg(t,{timestamp:n,count:p?2:r,order:i,channelId:s}),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:s,timestamp:n,count:r,order:i}),l),[4,d.send(new ro(f,h,u),Ca,{currentUserId:u,connectedTime:d.getConnectedTime(),conversation:{targetId:t},afterDecode:function(n){var r,i=null===(r=m._readReceiptManager)||void 0===r?void 0:r.getReadReceiptInfo({conversationType:e,channelId:s,targetId:t},n.messageUId);if(i){var o=i.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return n}})]):[3,2];case 1:return g=a.sent(),_=g.code,b=g.data,_===x.SUCCESS&&b?(E=this._fixDownstreamData(p,b,i),v=[],null===(c=E.list)||void 0===c||c.forEach((function(e){e&&v.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:v.join(",")}),l),[2,{code:_,data:{list:E.list,hasMore:E.hasMore}}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:""}),l),[2,{code:_}]);case 2:return[2,{code:x.RC_NET_CHANNEL_INVALID}]}}))}))}}),Object.defineProperty(d.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a){return this.getHistoryMessage(e,t,n,r,i,o,a)}}),Object.defineProperty(d.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(H.L_VER_REPORT_T,o,i),s=qu.encode(ps,{sdkInfo:o}),u=new ro(Gr.reportsdk,s,n),[4,r.send(u)]):[2];case 1:return(l=a.sent().code)!==x.SUCCESS&&this.logger.warn(H.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(d.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.targetId,r=e.channelId,e.conversationType!==B.ULTRA_GROUP?[3,2]:(o=qu.encode(Su,{targetId:n,type:t,busChannel:[r],cleanMsg:!1}),[4,this._connMgr.query(Gr.delUgSe,this.currentUserId,o)]);case 1:return i=a.sent(),[3,4];case 2:return o=qu.encode(Ea,{type:t,busChannel:r?[r]:[]}),[4,this._connMgr.query(Gr.delRelation,n,o)];case 3:i=a.sent(),a.label=4;case 4:return i.isOk&&this._chat.storage.removeConversation(e),[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeBatchDeleteConversation(e),r=new ro(Gr.delRelationBatch,n,this.getCurrentUserId()),[4,t.send(r)]):[2,x.RC_NET_UNAVAILABLE];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(d.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=0,e.includes(B.ULTRA_GROUP)&&!this._isUltraGroupListExist?[2,mn(x.METHOD_NOT_AVAILABLE)]:(r+=this._chat.storage.getTotalUnreadCountByLevels(e,t,n),[2,vn(r)])}))}))}}),Object.defineProperty(d.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this._chat.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:n},!1),[2,vn(r.unreadCount)]}))}))}}),Object.defineProperty(d.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._clearConversationUnreadCount(e,t,n,!1,this.getServerTime()),Promise.resolve(x.SUCCESS)}}),Object.defineProperty(d.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return(r=this._chat.storage.getModel({conversationType:e,targetId:t,channelId:n}))?(i=r.firstUnreadMessage,[2,vn(i?{messageUId:i.messageUId||"",sentTime:i.sentTime}:null)]):[2,vn(null)]}))}))}}),Object.defineProperty(d.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._chat.storage.setDrafts({conversationType:e,targetId:t,channelId:r},n),Promise.resolve(x.SUCCESS)}}),Object.defineProperty(d.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._chat.storage.getDrafts({conversationType:e,targetId:t,channelId:n});return Promise.resolve({code:x.SUCCESS,data:r})}}),Object.defineProperty(d.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._chat.storage.deleteDrafts({conversationType:e,targetId:t,channelId:n}),Promise.resolve(x.SUCCESS)}}),Object.defineProperty(d.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(o=this._connMgr,s=qu.encode(ha,{nothing:1,extra:r}),u=n?Gr.joinChrmR:Gr.joinChrm,l=new ro(u,s,e),this.logger.info(H.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:Gr[u]}),i),[4,o.send(l,ga)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return c=a.sent(),d=c.code,f=c.data,p=d===x.SUCCESS?"info":"warn",this.logger[p](H.L_JOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),i),d===x.SUCCESS?(g=(h=f).joinTime,_=h.createTime,b=h.memberCount,E=h.isAllChatroomBanned,v=h.isCurrentUserBanned,m=h.isCurrentChatroomBanned,y=h.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,g),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,r),this._startSyncIntervalForChrmPull(),[2,{code:d,data:{joinTime:g,createTime:_,memberCount:b,isAllChatroomBanned:E,isCurrentUserBanned:v,isCurrentChatroomBanned:m,isCurrentChatroomInWhitelist:y}}]):[2,{code:d}]}}))}))}}),Object.defineProperty(d.prototype,"_rejoinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,i,o,s,u,l,c,d,f,p,h,g;return a(this,(function(a){switch(a.label){case 0:for(n in e=this._joinedChrmManager.get(),t=[],e)t.push(n);i=0,a.label=1;case 1:return i<t.length?(o=t[i],s=e[o],u=s.count,l=void 0===u?10:u,c=s.extra,this.logger.info(H.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:o,count:l,extra:c})),d=this.logger.createTraceId(),[4,this._joinChrm(o,l,!0,c,d)]):[3,4];case 2:if(f=a.sent(),p=f.code,h=f.data,g=p===x.SUCCESS?"info":"warn",this.logger[g](H.L_REJOIN_CHATROOM_R,JSON.stringify({code:p,timestamp:(new Date).getTime()}),d),p===x.SUCCESS)return this._watcher.chatroom({rejoinedRoom:r({chatroomId:o,count:l},h)}),[2];p===x.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(o),delete this._chrmsQueue[o]),this._watcher.chatroom({rejoinedRoom:{chatroomId:o,errorCode:p}}),a.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))}}),Object.defineProperty(d.prototype,"_pullChrmMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===t&&(t=10),void 0===n&&(n=0),o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=this._chrmsQueue[e],i=r.pulling,o=r.timestamp,i?[2]:(r.pulling=!0,s=n?0:o,u=qu.encode(_a,{count:t,syncTime:s,compressioEnabled:Zl.enable()}),l=this.logger.createTraceId(),this.logger.info(H.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,syncTime:s})),[4,this._connMgr.query(Gr.chrmPull,e,u)])):[2];case 1:return c=a.sent(),this.logger.summary(H.L_PULL_CHATROOM_MSG_R,c,l,{chatroomId:e,syncTime:s,count:t}),r.pulling=!1,c.isOk?(d=zh(c.data.pbData),f=d.list,p=d.syncTime,r.timestamp=n?Math.max(p,n):p,r.queue=r.queue.filter((function(e){return e>p})),h=[],g=[],b=(_=this).currentUserId,E=_._connMgr,v=f.map((function(e){return Jl(e,b,E.getConnectedTime())})),m=[],v.forEach((function(e){e.sentTime<o||(e.sentTime>=y._connMgr.getConnectedTime()&&y._writeMessagesLog(B.CHATROOM,e.messageUId)&&g.push(e.messageUId),h.push(e.messageUId),m.push(e))})),this._batchMessage(m),g.length>0&&this.logger.record(Ee.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:g.join(",")})),r.queue.length>0&&(r.queue.length=0,this._pullChrmMsg(e)),[2]):[2]}}))}))}}),Object.defineProperty(d.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return[4,this._joinChrm(e,t,!1,n,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(d.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._joinChrm(e,t,!0,n,r)]}))}))}}),Object.defineProperty(d.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr,delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e),n=qu.encode(ha,{nothing:1}),[4,t.query(Gr.exitChrm,e,n)]):[2,x.RC_NET_UNAVAILABLE];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(d.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=this._connMgr,i=qu.encode(Ra,{count:t,order:n}),o=new ro(Gr.queryChrmI,i,e),[4,r.send(o,Oa)]):[2,mn(x.RC_NET_UNAVAILABLE)];case 1:return[2,a.sent().trans((function(e){return e}))]}}))}))}}),Object.defineProperty(d.prototype,"_modifyChatroomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==o?this.getServerTime():o,s=r.codec.encodeModifyChatRoomKV(e,t,i),u=t.type===D.UPDATE?Gr.setKV:Gr.delKV,l=new ro(u,s,e),[4,r.send(l,ga)]):[2,x.RC_NET_UNAVAILABLE];case 1:return c=a.sent(),(d=c.code)===x.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},i),[2,d]):[2,d]}}))}))}}),Object.defineProperty(d.prototype,"_chatroomKVStoreNotAllSuccess",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.data,r=e;return n&&Array.isArray(n.errorKeys)&&n.errorKeys.forEach((function(e){var t=r.findIndex((function(t){return e.key===t.key}));-1!==t&&r.splice(t,1)})),r}}),Object.defineProperty(d.prototype,"_modifyChatroomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,f,p,h,g,_=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(i=(n=this)._connMgr,o=n.currentUserId,t.entries.forEach((function(t){var n=_._chrmEntryHandler.getVersion(e,t.key);t.version=null==n?_.getServerTime():n})),s=i.codec.encodeModifyChatRoomKVS(e,t,o),u=t.type===D.UPDATE?Gr.setKVS:Gr.delKVS,l=new ro(u,s,e),[4,i.send(l,xa)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return c=a.sent(),d=c.code,-1!==[x.SUCCESS,x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(d)&&(p=[],delete(h=r({},t)).entries,t.entries.forEach((function(e){p.push(r(r({},e),h))})),d===x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(g=c.data,f=g.errorKeys,p=this._chatroomKVStoreNotAllSuccess(p,c)),this._chrmEntryHandler.setLocal(e,{kvEntries:p,syncTime:(new Date).getTime()},o)),[2,{code:d,data:f}]}}))}))}}),Object.defineProperty(d.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(d.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(d.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return(n=this._chrmEntryHandler.getValue(e,t))?[2,{code:x.SUCCESS,data:n}]:this._isConnected?(r=this._connMgr,i=r.codec.encodePullChatRoomKV(0),o=new ro(Gr[Gr.pullKV],i,e),[4,r.send(o,Fa)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return s=a.sent(),(u=s.data)&&u.kvEntries&&u.kvEntries.length&&(l=u.kvEntries.find((function(e){return e.key===t})),void 0!==l)?[2,{code:x.SUCCESS,data:null==l?void 0:l.value}]:[2,{code:x.CHATROOM_KEY_NOT_EXIST}]}}))}))}}),Object.defineProperty(d.prototype,"getAllChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:x.SUCCESS,data:t}]:this._isConnected?(n=this._connMgr,t={},r=n.codec.encodePullChatRoomKV(0),i=new ro(Gr[Gr.pullKV],r,e),[4,n.send(i,Fa)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),(s=o.data)&&s.kvEntries&&s.kvEntries.length&&s.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:x.SUCCESS,data:t}]}}))}))}}),Object.defineProperty(d.prototype,"pullChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,this._chrmsQueue[e]?(o=r.codec.encodePullChatRoomKV(t),s=new ro(Gr[Gr.pullKV],o,e),this.logger.info(H.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,r.send(s,Fa)]):[2,{code:x.RC_CHATROOM_NOT_EXIST}]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return u=a.sent(),l=u.code,c=u.data,this._chrmsQueue[e]?(d=l===x.SUCCESS?"info":"warn",this.logger[d](H.L_PULL_CHATROOM_KV_R,JSON.stringify({code:l,timestamp:t})),l===x.SUCCESS&&c?(f=c.kvEntries,p=[],f.length>0&&(f.forEach((function(t){var n=t.key,r=t.value,i=t.type,o=t.timestamp,a=t.userId;h._chrmEntryHandler.getValue(e,n)===r&&a===h.getCurrentUserId()||p.push({key:n,value:r,type:i,timestamp:o,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,c,i),p.length>0&&this._watcher.chatroom({updatedEntries:p})),[2,{code:l,data:c}]):[2,{code:l}]):[2,{code:x.RC_CHATROOM_NOT_EXIST}]}}))}))}}),Object.defineProperty(d.prototype,"_startSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),18e4)}}),Object.defineProperty(d.prototype,"_stopSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)}}),Object.defineProperty(d.prototype,"removeChatroomFromCatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;null===(t=this._joinedChrmManager)||void 0===t||t.remove(e)}}),Object.defineProperty(d.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)return!1;var i=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(t),o=0;switch(e){case B.PRIVATE:o=r.private;break;case B.GROUP:o=r.group;break;case B.CHATROOM:o=r.chatroom;break;case B.ULTRA_GROUP:o=r.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(d.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d,f,p,h,g,_,b,E,v,m;return a(this,(function(a){switch(a.label){case 0:return n=this._handleInnerMsgOptions(e,t,n),n=this._handleMsgProperties(n,!0),o=!1,[B.PRIVATE,B.GROUP].includes(e)&&(n.isStatusMessage||vr(n.messageType).isStatusMessage)&&(o=!0),u=o?function(e){var t;return(t={},t[B.PRIVATE]=Gr.ppMsgS,t[B.GROUP]=Gr.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[B.PRIVATE]=Gr.ppMsgP,t[B.GROUP]=Gr.pgMsgP,t[B.CHATROOM]=Gr.chatMsg,t[B.CUSTOMER_SERVICE]=Gr.pcMsgP,t[B.RTC_ROOM]=Gr.prMsgS,t[B.SYSTEM]=Gr.pbMsgP,t)[e]}(e)||Gr.ppMsgP,o&&(n.isPersited=!1,n.isCounted=!1),l=n.messageId?n.messageId:on(),n.messageId=l,c=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},n),(d=new io(Gr[u],c,e===B.SYSTEM?this.currentUserId:t)).setHeaderQos(Fr.AT_LEAST_ONCE),o?(this._connMgr.sendOnly(d),[2,vn(r_(e,t,r({},n),"",0,this.currentUserId,l))]):(f=this._connMgr.getCrtServerTime(),p=r_(e,t,r(r({},n),{isStatusMessage:o}),"",f,this.currentUserId,l),null==i||i(l),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e,targetId:t,channelId:n.channelId}),s),h=Date.now(),[4,this._connMgr.send(d)]);case 1:return g=a.sent(),_=g.code,b=g.isOk,E=g.msg,v=g.data,b?(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:null==v?void 0:v.messageUId,messageId:null==v?void 0:v.messageId}),s),m=v,this._sendMessageSuccessHandle(p,m),this._writeMessagesLog(e,m.messageUId)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({msg_id:m.messageUId,channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),[2,vn(p)]):(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:p.messageUId,messageId:p.messageId}),s),this._writeMessagesLog(e)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),p.sentStatus=ae.FAILED,[2,mn(_,E,p)])}}))}))}}),Object.defineProperty(d.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,a=e.targetId,s=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===ye.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:o,targetId:a,channelId:s},d,c,u)}if(i===ye.READ_RECEIPT_RESPONSE){var f=l.receiptMessageDic;if(!f)return;for(var p in f)f[p].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:a,channelId:s},e)}))}}}}),Object.defineProperty(d.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I;return a(this,(function(a){switch(a.label){case 0:return i=e.targetId,o=e.conversationType,s=e.channelId||"",u=t.user,l=t.extra,c=t.isDelete,d=t.directionalUserIdList,f=t.disableUpdateLastMessage,p=t.messageUId,h=t.sentTime,g={conversationType:o,targetId:i,messageUId:p,sentTime:h,channelId:s,isDelete:c||!1,isAdmin:t.isAdmin},u&&(g.user=u),l&&(g.extra=l),_={content:g,messageType:"RC:RcCmd",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,pushContent:(null===(n=t.pushConfig)||void 0===n?void 0:n.pushContent)||t.pushContent||"",channelId:s,disableUpdateLastMessage:f},[B.GROUP,B.ULTRA_GROUP].includes(o)&&d&&(_.directionalUserIdList=d),b=this._connMgr.codec.encodeUpMsg({conversationType:o,targetId:i},_),(E=new io(Gr.recallMsg,b,this.currentUserId)).setHeaderQos(Fr.AT_LEAST_ONCE),[4,this._connMgr.send(E)];case 1:return(v=a.sent()).isOk?(m=v.data,o!==B.ULTRA_GROUP&&(y="Cmd:".concat(p),m.messageUId=y),I=r_(o,i,r(r({},_),{isPersited:!0}),m.messageUId,m.timestamp,this.currentUserId),o===B.ULTRA_GROUP?(this._ultraMsgMap[m.messageUId]=m.timestamp,this._updateUltraGroupWhenRecallMsg(i,s,p)):(this._sendMessageStore.setMessage(m.messageUId,m.timestamp),this._setConversationCacheByMessage(I)),[2,vn(I)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeReadReceipt(t,n),i=new ro(Gr[Gr.rrMsg],r,e),[2,this._connMgr.send(i)]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeMessageReader(t,n),i=new ro(Gr[Gr.rrList],r,e),[2,this._connMgr.send(i,us)]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return r=this._connMgr.codec.encodeReadReceiptMsg(e,t,n),i=new io(Gr[Gr.sendMsgRead],r,e.targetId),[2,this._connMgr.send(i)]}))}))}}),Object.defineProperty(d.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){return n=this._connMgr.codec.encodeReceiptQryReq(e,t),r=new ro(Gr[Gr.qryMsgRead],n,e.targetId),[2,this._connMgr.send(r,ws)]}))}))}}),Object.defineProperty(d.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeReceiptCntQryReq(e,t),i=new ro(Gr[Gr.qryMsgReadCntBatch],n,e.targetId),[4,this._connMgr.send(i,Ms)];case 1:return o=a.sent(),s=o.code,u=o.data,l=(u||{result:[]}).result,s===x.SUCCESS&&l?[2,{code:s,data:l.map((function(t){return r({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=Qh(e,t),r=new io(Gr.updRTime,n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._connMgr.getToken();this.navi.updateVoipCallInfo(n,t);var i=this.navi.getNaviInfoFromCache(n);this._watcher.onNaviDataChange(r({},i))}}),Object.defineProperty(d.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,s,u){return o(this,void 0,void 0,(function(){var o,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(o=i&&"uploads"!==i?t||"":$t(e,t),l=this.getNaviInfoFromCache(),c=ln(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),f=qu.encode(ca,{type:e,key:o,httpMethod:n||"",queryString:i||"",url:s||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(Gr.qnTkn,this.currentUserId,f,fa)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,a.sent().trans((function(e){return r(r({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(d.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(o=this.getNaviInfoFromCache(),u="",l="",t===n.QINIU?s=Gr.qnUrl:t===n.AWS?s=Gr.s3Url:t===n.STC?s=Gr.stcUrl:t===n.MINIO?(s=Gr.minioUrl,u=ln(o,this.logger),l=JSON.stringify({url:u})):s=Gr.aliUrl,c=qu.encode(da,{type:e,key:r,fileName:i,ext:l,size:-1,ipType:o.ipType||0}),[4,this._connMgr.query(s,this.currentUserId,c,pa)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,a.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(d.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return n.sent(),this._resetMemoryState(),[2]}}))}))}}),Object.defineProperty(d.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._isUltraGroupListExist=!1,this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}}}),Object.defineProperty(d.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(d.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCrtServerTime()}}),Object.defineProperty(d.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCurrentUserId()}}),Object.defineProperty(d.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,mn(x.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(d.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,mn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,mn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){for(i in t=this._userSettings.getTags(),n=this._chat.storage.getTagConversationCountMap(),r=[],t)r.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=n.get(i))||void 0===e?void 0:e.length)||0});return[2,vn(r)]}))}))}}),Object.defineProperty(d.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=this._chat.storage.getOrCreateModel(e,!1),n=this._getUnreadCount(t.unreadMentionedCount),[2,vn(n)]}))}))}}),Object.defineProperty(d.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this._chat.storage.getAllUnreadMentionedCount(),[2,vn(e)]}))}))}}),Object.defineProperty(d.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return this.getHistoryMessage(e,t,n,r,i,o)}}),Object.defineProperty(d.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){return t=e.targetId,n=e.channelType,this._isUltraGroupListExist?(r=this._chat.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==n&&n!==e.channelType)})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=i._getUnreadCount(t.unreadMentionedCount||0),t.unreadMessageCount=i._getUnreadCount(t.unreadMessageCount||0),t.unreadMentionedMeCount=i._getUnreadCount(t.unreadMentionedMeCount||0),t})),(a=r).sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i})),[2,vn(a)]):[2,mn(x.METHOD_NOT_AVAILABLE)];var a}))}))}}),Object.defineProperty(d.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(d.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return this._isUltraGroupListExist?(e=this._chat.storage.getAllUGModels().filter((function(e){return e.notificationLevel>ve.NOT_SET})).map((function(e){return{conversationType:B.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId}})),[2,vn(e)]):[2,mn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return this._isUltraGroupListExist?(n=this._chat.storage.getAllUGModels(),r=n.reduce((function(n,r){if(r.targetId!==e||!r.unreadMentionedCount)return n;var i=r.notificationLevel||ve.NOT_SET;return!t||t.includes(i)?n+r.unreadMentionedCount:n}),0),i=this._getUnreadCount(r),[2,vn(i)]):[2,mn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return n=this._chat.storage.getAllUGModels(),r=n.reduce((function(n,r){if(r.targetId!==e||!r.unreadCount)return n;var i=r.notificationLevel||ve.NOT_SET;return!t||t.includes(i)?n+r.unreadCount:n}),0),i=this._getUnreadCount(r),[2,vn(i)]}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n=this;return a(this,(function(r){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().filter((function(t){return e.includes(t.targetId)})).map((function(e){return{conversationType:e.conversationType,type:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",unreadMessageCount:n._getUnreadCount(e.unreadCount||0),mentionedCount:n._getUnreadCount(e.unreadMentionedCount||0),mentionedMeCount:n._getUnreadCount(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||ve.NOT_SET}})),[2,vn(t)]):[2,mn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().reduce((function(t,n){return e?t+(n.unreadMentionedCount||0):t+(n.unreadCount||0)}),0),n=this._getUnreadCount(t),[2,vn(n)]):[2,mn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"clearUltraUnreadcount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this.getServerTime(),r=Qh({conversationType:B.ULTRA_GROUP,targetId:e,channelId:t},n),(i=new io(Gr[Gr.updUgRTime],r,this.currentUserId)).setHeaderQos(Fr.AT_LEAST_ONCE),[4,this._connMgr.send(i)]):[2,x.RC_NET_UNAVAILABLE]:[2,Promise.resolve(x.METHOD_NOT_AVAILABLE)];case 1:return o=a.sent(),s=o.code,o.isOk&&this._clearConversationUnreadCount(B.ULTRA_GROUP,e,t,!1,n),[2,s]}}))}))}}),Object.defineProperty(d.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,d,f,p,h,g,_,b,E;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._handleMsgProperties(t,!0),o=t.messageId?t.messageId:on(),t.messageId=o,s=this._connMgr.codec.encodeUpMsg({conversationType:B.ULTRA_GROUP,targetId:e},t),(u=new io(Gr[Gr.ugMsg],s,e)).setHeaderQos(Fr.AT_LEAST_ONCE),l=this._connMgr.getCrtServerTime(),c=r_(B.ULTRA_GROUP,e,r({},t),"",l,this.currentUserId,o),n&&n(o),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:B.ULTRA_GROUP,targetId:e,channelId:t.channelId}),i),d=Date.now(),[4,this._connMgr.send(u)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return f=a.sent(),p=f.code,h=f.data,p!==x.SUCCESS?(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:c.messageUId,messageId:c.messageId}),i),this._writeMessagesLog(B.ULTRA_GROUP)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({channel:B.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),c.sentStatus=ae.FAILED,[2,{code:p,data:c}]):(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:null==h?void 0:h.messageUId,messageId:null==h?void 0:h.messageId}),i),g=h,this._writeMessagesLog(B.ULTRA_GROUP,g.messageUId)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:B.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),c.sentTime=g.timestamp,c.messageUId=g.messageUId,this._ultraMsgMap[g.messageUId]=g.timestamp,_=t.channelId||"",b=this._chat.storage.getOrCreateModel({conversationType:B.ULTRA_GROUP,targetId:e,channelId:_},!0),(E=b.updateAttrs({operationTime:g.timestamp,latestMessage:r({},c)}))&&this._watcher.conversation([r(r({},b.toIReceivedConversation()),{updatedItems:E})]),[2,{code:p,data:c}])}}))}))}}),Object.defineProperty(d.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=e.conversationType,r=e.channelId,i=e.targetId,o=qu.encode(Is,{targetId:i,type:n,busChannel:r||"",opType:t||0}),(s=new io(Gr.operate,o,i)).setHeaderQos(Fr.AT_LEAST_ONCE),[4,this._connMgr.send(s)]):[2,mn(x.RC_NET_UNAVAILABLE)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:x.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),n=this._connMgr.codec.encodeMsgQuery(e),(r=new ro(Gr[Gr.qryMsg],n,this.currentUserId)).setHeaderQos(Fr.AT_LEAST_ONCE),[4,this._connMgr.send(r,ys,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o,msg:x[o]}]:(u=(s||{}).list,Array.isArray(u)&&u.forEach((function(e){var n=e.messageUId;t[n]=e})),[2,{code:0,data:t}])}}))}))}}),Object.defineProperty(d.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,Ts),n=t.conversationType,r=t.info,i=t.summary;this.logger.debug(H.O,"s_opNtf -> type: ".concat(n,", info: ").concat(r,", summary: ").concat(i)),this._watcher.operateStatus(t)}}}),Object.defineProperty(d.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(n=new ro(Gr[Gr.upMsgEx],t,e.targetId)).setHeaderQos(Fr.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return(r=i.sent().code)!==x.SUCCESS?[2,{code:r,msg:x[r]}]:[2,{code:r}]}}))}))}}),Object.defineProperty(d.prototype,"modifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(n=new ro(Gr[Gr.modifyMsg],t,e.targetId)).setHeaderQos(Fr.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i!==x.SUCCESS?[2,{code:i,msg:x[i]}]:(s=o,this._ultraMsgMap[s.messageUId]=s.timestamp,[2,{code:i}])}}))}))}}),Object.defineProperty(d.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=qu.decode(Mu,new Uint8Array(e.eventData)).results;r.push.apply(r,l([],u(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===x.SUCCESS?Nr.SUCCESS:Nr.FAILED}}}))),!1))})),r.length&&(null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,r))}}),Object.defineProperty(d.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:i_},Friend:{map:{},types:o_}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var i in t)if(t[i].types.includes(r)){n(t[i].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&r[i](t[i].map)}}),Object.defineProperty(d.prototype,"_handleUGChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n={};t.forEach((function(e){var t=e.changeType;n[t]||(n[t]=[]),n[t].push(e)}));var r=ne.CHANNEL_CHANGE,i=ne.MSG_RECALL,o=ne.MSG_EXPANSION,a=ne.MSG_MODIFY,s=ne.USER_GROUP_CHANGE;n[r]&&this._handleUltraChannelChange(n[r]),n[i]&&this._handleMsgRecall(n[i]),n[o]&&this._handleMsgUpdate(n[o]),n[a]&&this._handleMsgUpdate(n[a]),n[s]&&this._handleUserGroupStatus(n[s])}}),Object.defineProperty(d.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=L.GROUP_OPERATION,n=L.GROUP_PROFILE_CHANGE,r=L.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleFollowUserChange(e[r])}}),Object.defineProperty(d.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[v.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,i,o,a,s,u,l,c,d,f=e.subChangeType,p=e.businessId,h=e.time,g=e.eventData,_=m.FRIEND_APPLY,b=m.FRIEND_REFUSE,v=m.FRIEND_USER_INFO,y=m.FRIENDS_INPUT,I=m.FRIEND_CLEAR,T=m.FRIEND_INFO_CHANGE,R=m.FRIEND_INFO_CHANGE_SYNC;switch(f){case _:case b:var O=f===_?E.UNHANDLED:E.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:p,applicationType:g.applyType,applicationStatus:O,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case v:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:p,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:h});break;case y:null===(s=(a=t._watcher).friendDelete)||void 0===s||s.call(a,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case I:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case T:break;case R:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:p,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(d.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a=e.subChangeType,s=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,f=c.channelInfo,p=c.userInfos,h={groupId:s,operation:a,operationTime:l};d&&(n=u(Kt([d]),1),h.operatorInfo=n[0]),a===S.CREATE&&(r=u(Bt([f]),1),h.groupInfo=r[0]),[S.CREATE,S.DISMISS].includes(a)||(h.memberInfos=Kt(p)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,h)}))}}),Object.defineProperty(d.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a,s,l=e.businessId,c=e.time,d=e.eventData,f=e.subChangeType,p=e.secondaryId;switch(f){case C.GROUP_INFO_CHANGE:var h=u(Kt([d.optUserInfo]),1)[0],g=u(Ht([d.channelInfo]),1)[0],_=u(d.channelFullInfo?Ht([d.channelFullInfo]):[void 0],1)[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:_});break;case C.MEMBER_PROFILE_CHANGE:h=u(Kt([d.optUserInfo]),1)[0];var b=Kt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:h,memberInfo:b,operationTime:c});break;case C.GROUP_REMARK_DELETE:case C.GROUP_REMARK_SET:var E=f===C.GROUP_REMARK_SET?A.ADD:A.REMOVE;null===(s=(a=t._watcher).groupRemarkChangedSync)||void 0===s||s.call(a,{groupId:l,operationType:E,operationTime:c,groupRemark:p})}}))}}),Object.defineProperty(d.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,a=e.time,s=e.userGroupIds,u=1===i?A.ADD:A.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:o,operationType:u,operationTime:a,userIds:s})}))}}),Object.defineProperty(d.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[],r=[],i=[];e.forEach((function(e){var o=e.subChangeType,a=e.targetId,s=e.msgTime,u=e.operatorId,l=e.busChannel||"",c=t._chat.storage.getCachedUGConversation(a,l);if(c){var d=re.PUBLIC_TO_PRIVATE,f=re.PRIVATE_TO_PUBLIC,p=re.PUBLIC_TO_PRIVATE_USER_NOT_IN,h=re.CHANNEL_DELETE,g=re.CHANNEL_USER_KICKED;switch(o){case f:t._chat.storage.updateConversationCache(c,{channelType:ee.PUBLIC}),n.push({targetId:a,channelId:l,changeType:te.PRIVATE_TO_PUBLIC,channelType:ee.PUBLIC});break;case d:t._chat.storage.updateConversationCache(c,{channelType:ee.PRIVATE}),n.push({targetId:a,channelId:l,changeType:te.PUBLIC_TO_PRIVATE,channelType:ee.PRIVATE});break;case p:t._chat.storage.removeConversation(c),n.push({targetId:a,channelId:l,changeType:te.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:c.channelType});break;case h:t._chat.storage.removeConversation(c),r.push({targetId:a,channelId:l,channelType:c.channelType,deleteTime:s});break;case g:i.push({targetId:a,channelId:l,userId:u,channelType:ee.PRIVATE}),u===t.currentUserId&&t._chat.storage.removeConversation(c)}}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),r.length>0&&this._watcher.ultraGroupChannelDelete(r),i.length>0&&this._watcher.ultraGroupChannelUserKicked(i)}}),Object.defineProperty(d.prototype,"_handleMsgRecall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];e.forEach((function(e){var r=e.targetId,i=e.busChannel,o=e.msgUID,a=e.msgTime,s=e.type,u=e.operatorId,l=e.remindType;t._updateUltraGroupWhenRecallMsg(r,i||"",o,a,l),n.push({targetId:r,conversationType:s,sentTime:a,messageUId:o,senderUserId:u,channelId:i||"",content:{conversationType:s,targetId:r,messageUId:o,channelId:i||""},messageDirection:1,messageType:ye.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:Ie.UNREAD,receivedStatusInfo:Vt(Ie.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(n)}}),Object.defineProperty(d.prototype,"_handleMsgUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};for(var n in e.forEach((function(e){var n=e.targetId,r=e.type,i=e.msgTime,o=e.msgUID,a=e.busChannel,s="".concat(r,"_").concat(n);t[s]||(t[s]=[]),t[s].push({messageUId:o,channelId:a||"",sendTime:i})})),t){var r=n.split("_"),i=r.shift(),o=r.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:o,conversationType:Number(i),messages:l([],u(t[n]),!1)})}}}),Object.defineProperty(d.prototype,"_pullUltraMessageList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeMsgQuery(t),(r=new ro(Gr.qryMsg,n,this.currentUserId)).setHeaderQos(Fr.AT_LEAST_ONCE),[4,this._connMgr.send(r,ys,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o,msg:x[o]}]:(u=(s||{}).list,l=[],Array.isArray(u)&&u.forEach((function(e){var t,n=e.targetId,r=e.channelId,i=e.messageUId,o=c._chat.storage.getCachedUGConversation(n,r||"");o&&(null===(t=o.latestMessage)||void 0===t?void 0:t.messageUId)===i&&c._chat.storage.updateConversationCache(o,{latestMessage:e}),l.push(e)})),e===ne.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(l),e===ne.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(l),[2])}}))}))}}),Object.defineProperty(d.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,f;return a(this,(function(a){return t=ie.REMOVE_USER_GROUP,n=ie.JOIN_USER_GROUP,r=ie.EXIT_USER_GROUP,i=ie.CHANNEL_BIND_USER_GROUP,o=ie.CHANNEL_UNBIND_USER_GROUP,s=[],u=[],l=[],c=[],d=[],e.forEach((function(e){var a=e.type,f=e.targetId,p=e.busChannelType,h=e.busChannel,g=e.userGroupIds;switch(e.subChangeType){case t:s.push({conversation:{conversationType:a,targetId:f},userGroupIds:g});break;case n:u.push({conversation:{conversationType:a,targetId:f},userGroupIds:g});break;case r:l.push({conversation:{conversationType:a,targetId:f},userGroupIds:g});break;case i:c.push({conversation:{conversationType:a,targetId:f,channelId:h},channelType:p,userGroupIds:g});break;case o:d.push({conversation:{conversationType:a,targetId:f,channelId:h},channelType:p,userGroupIds:g})}})),f={},s.length>0&&(f.userGroupDisband=s),u.length>0&&(f.userAdded=u),l.length>0&&(f.userRemoved=l),c.length>0&&(f.userGroupBindChannel=c),d.length>0&&(f.userGroupUnBindChannel=d),this._watcher.userGroupStatus(f),[2]}))}))}}),Object.defineProperty(d.prototype,"getUltraHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeGetHistoryMsg(e,t),o=new ro(Gr[Gr.qryUgMsg],i,this.currentUserId),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:B.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,this._connMgr.send(o,Ca,{currentUserId:this.currentUserId,conversation:{conversationType:B.ULTRA_GROUP,targetId:e}})]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?(c=[],null===(r=l.list)||void 0===r||r.forEach((function(e){e&&c.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:c.join(",")}),n),[2,{code:u,data:l}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:""}),n),[2,{code:u}])}}))}))}}),Object.defineProperty(d.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,n),i=new ro(Gr.ugUnpushSet,r,e),[4,this._connMgr.send(i)]):[2,{code:x.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:x.METHOD_NOT_AVAILABLE})];case 1:return o=a.sent(),s=o.code,x.SUCCESS,[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr,r=n.codec.encodeGetUltraGroupDefaultNotificationLevel(t),i=new ro(Gr[Gr.ugUnpushQuery],r,e),[4,n.send(i,Za)]):[2,{code:x.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:x.METHOD_NOT_AVAILABLE})];case 1:return o=a.sent(),s=o.code,u=o.data,s===x.SUCCESS&&u?(l=u.unpushLevel,[2,{code:s,data:l}]):[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){var a=this._chat.storage.getModel({conversationType:B.ULTRA_GROUP,targetId:e,channelId:t});if(a){var s={},u=a.latestMessage;u&&u.messageUId===n&&(s.latestMessage=null),i&&a.lastReadTime<i&&a.unreadCount&&(s.unreadCount=a.unreadCount-1,o!==oe.ALL&&o!==oe.ME||!a.unreadMentionedCount||(s.unreadMentionedCount=a.unreadMentionedCount-1),o===oe.ME&&a.unreadMentionedCount&&(s.unreadMentionedMeCount=a.unreadMentionedMeCount-1));var l=a.updateAttrs(s,i);this._chat.storage.updateConversationStorage([a]),l&&this._watcher.conversation([r(r({},a.toIReceivedConversation()),{updatedItems:l})])}}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),n=new ro(Gr[Gr.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(n,ya)]):[2,Promise.resolve({code:x.METHOD_NOT_AVAILABLE})]:[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?[2,{code:i,data:o}]:[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return this._isConnected?this._isUltraGroupListExist?(t=this._chat.storage.getUGFistUnreadMessageInfo(e.targetId,e.channelId||""))?[2,vn(t)]:[2,mn(x.RC_DB_DATA_NOT_FOUND)]:[2,mn(x.METHOD_NOT_AVAILABLE)]:[2,mn(x.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,de.SUBSCRIBE,n)]:[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,de.UNSUBSCRIBE)]:[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){return this._isConnected?(i=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,Promise.resolve({code:x.SUCCESS,data:i})]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return this._isConnected?(r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:x.SUCCESS,data:r})]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=qu.encode(Hs,c(this,f,"m",_).call(this,e)),[4,this._connMgr.query(Gr.updUserProfile,this.currentUserId,n,void 0)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return(r=a.sent()).isOk||!r.data?[2,r.wipe()]:(i=qu.decode(Ys,r.data.pbData),r.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,r.wipe()]):(s=i.censorFailedFields,[2,mn(r.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)]))}}))}))}}),Object.defineProperty(d.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:x.RC_NET_UNAVAILABLE})}}),Object.defineProperty(d.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),n=new ro(Gr[Gr.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(n)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new ro(Gr[Gr.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,Js)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return n=o.sent(),r=n.code,i=n.data,r!==x.SUCCESS?[2,{code:r}]:[2,{code:r,data:null==i?void 0:i.permission}]}}))}))}}),Object.defineProperty(d.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),n=new ro(Gr[Gr.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(n,Hs)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=kt(o.userId,o.userProfile,o.userExtProfile),[2,{code:i,data:s}]):[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=e.chatRoomId,n=qu.encode(Rs,{rtcRoomId:t}),r=new ro(Gr.setRtcRoomId,n,t),[4,this._connMgr.send(r)]):[2,x.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))}}),Object.defineProperty(d.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(i=n?new ro(t,r,e):new io(t,r,e),[4,this._connMgr.send(i)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),s=o.code,u=o.data,[2,{code:s,buffer:u instanceof oo||null==u?void 0:u.pbData}]}}))}))}}),Object.defineProperty(d.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=gl(this.rtcCodec,t,n),[4,this.rtcSignaling(e,Gr[Gr.rtcPing],!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o!==x.SUCCESS?[2,{code:o}]:((u=this.rtcCodec.decode(Wu.RtcOutput,s)).version=Ut(u.version),[2,{code:o,data:u}])}}))}))}}),Object.defineProperty(d.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Fl()}}),Object.defineProperty(d.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;(t=e.deviceId)&&(kl=t),n=e.packageName,Hl=n}}),Object.defineProperty(d.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return Yp?(zp&&(clearTimeout(zp),zp=null),[4,Yp]):[2];case 1:return(e=n.sent())&&(t=e.db,$p.push(t)),Yp=null,[2]}}))}))}}),Object.defineProperty(d.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({status:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,ar.newWorkChange,r)}}}),Object.defineProperty(d.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=Vh(e,t,n,r),[4,this._connMgr.query(Gr.channelCreate,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,vn()]:(s=qu.decode(Zs,o.data.pbData),u={errorKeys:s.censorFailedFields,processCode:s.processCode||0},[2,mn(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(d.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=Vh(e,t,n),[4,this._connMgr.query(Gr.upChannelInfo,e,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,vn()]:(o=qu.decode(Zs,i.data.pbData),[2,mn(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(d.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),n=new ro(Gr[Gr.qChannelInfo],t,e[0]),[4,this._connMgr.send(n,iu)];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=o.result.list,u=Bt(void 0===s?[]:s),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,n),o=new ro(Gr[Gr.channelMemKick],i,e),[4,this._connMgr.send(o,Zs)];case 1:return s=a.sent(),u=s.code,l=s.data,u!==x.SUCCESS?[2,{code:u,msg:null!==(r=null==l?void 0:l.msg)&&void 0!==r?r:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(d.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),i=new ro(Gr[Gr.channelMemQuit],r,e),[4,this._connMgr.send(i,Zs)];case 1:return o=a.sent(),s=o.code,u=o.data,s!==x.SUCCESS?[2,{code:s,msg:null!==(n=null==u?void 0:u.msg)&&void 0!==n?n:""}]:[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("dismiss",e),r=new ro(Gr[Gr.channelDismiss],n,e),[4,this._connMgr.send(r,Zs)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o,msg:null!==(t=null==s?void 0:s.msg)&&void 0!==t?t:""}]:[2,{code:o}]}}))}))}}),Object.defineProperty(d.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i;return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],n,r),s=new ro(Gr[Gr.channelTransfer],o,e),[4,this._connMgr.send(s,Zs)];case 1:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,{code:l,msg:null!==(i=null==c?void 0:c.msg)&&void 0!==i?i:""}]:[2,{code:l}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeModifyChannelsInput(e,t,n),o=new ro(Gr[Gr.upChannelManager],i,t),[4,this._connMgr.send(o,Zs)];case 1:return s=a.sent(),u=s.code,l=s.data,u!==x.SUCCESS?[2,{code:u,msg:null!==(r=null==l?void 0:l.msg)&&void 0!==r?r:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:n,roleType:t}),i=new ro(Gr[Gr.qChannelMem],r,e),[4,this._connMgr.send(i,iu)];case 1:return o=a.sent(),s=o.code,u=o.data,s===x.SUCCESS&&u?(l=u.result,c=u.page,f=(d=c||{}).pageToken,p=d.hasNext,[],h=Kt(l.list),[2,{code:s,data:{data:h,pageToken:p&&f?f:""}}]):[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),r=new ro(Gr[Gr.qChannelSpeMem],n,e),[4,this._connMgr.send(r,iu)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o}]:s?(u=s.result,[],l=Kt(u.list),[2,{code:o,data:l}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return i=qu.encode(uu,{targetId:e,type:B.GROUP,userId:t,channelNickName:n,additional:r}),[4,this._connMgr.query(Gr.upChannelMem,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,vn()]:(s=qu.decode(Zs,o.data.pbData),[2,mn(o.code,o.msg,{errorKeys:s.censorFailedFields})])}}))}))}}),Object.defineProperty(d.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeJoinGroup("join",e),r=new ro(Gr[Gr.channelMemJoin],n,e),[4,this._connMgr.send(r,Zs)];case 1:return i=a.sent(),o=i.code,s=i.data,[2,{code:o,data:{processCode:null!==(t=null==s?void 0:s.processCode)&&void 0!==t?t:0}}]}}))}))}}),Object.defineProperty(d.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeJoinGroup("invite",e,t),o=new ro(Gr[Gr.channelMemInvite],i,e),[4,this._connMgr.send(o,Zs)];case 1:return s=a.sent(),u=s.code,l=s.data,u!==x.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u,data:{processCode:null!==(r=null==l?void 0:l.processCode)&&void 0!==r?r:0}}]}}))}))}}),Object.defineProperty(d.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeMemberResponseInput(e),i=new ro(Gr[Gr.channelApplyResp],r,e.groupId),[4,this._connMgr.send(i,Zs)];case 1:return o=a.sent(),s=o.code,u=o.data,s!==x.SUCCESS?[2,{code:s,msg:null!==(t=null==u?void 0:u.msg)&&void 0!==t?t:""}]:[2,{code:s,data:{processCode:null!==(n=null==u?void 0:u.processCode)&&void 0!==n?n:0}}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=qu.encode(nu,{type:B.GROUP,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this._connMgr.query(Gr.qChannelApplyList,this.currentUserId,t,iu)];case 1:return(n=a.sent()).isOk?(i=function(e){var t=e.listType,n=e.result,i=e.page,o=new Uint8Array(n),a=[];switch(t){case 1:a=qu.decode(au,o).list;break;case 2:a=qu.decode(ou,o).list;break;case 3:a=qu.decode(su,o).list;break;case 11:a=qu.decode(vu,o).list;break;case 13:a=qu.decode(mu,o).list}return r(r({},i),{list:a})}(n.data),o=i.pageToken,s=i.hasNext,u=i.list,l=u.map(Jt),[2,vn({data:l,pageToken:s&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),r=new ro(Gr[Gr.qChannelMemJoin],n,this.currentUserId),[4,this._connMgr.send(r,iu)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS&&s?(u=s.result,l=s.page,d=(c=l||{}).pageToken,f=c.hasNext,p=Bt(u.list),[2,{code:o,data:{data:p,pageToken:f&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(d.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),n=new ro(Gr[Gr.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(n,iu)];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=o.result.list,u=Bt(s),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeSetGroupRemark(e,t),r=new ro(Gr[Gr.upChannelRemark],n,e),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this._connMgr.codec.encodeSetGroupFollows(e,t,n),i=new ro(Gr[Gr.upChannelFollow],r,t),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),n=new ro(Gr[Gr.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(n,iu)];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=o.result,l=s.list,u=l.map((function(e){var t=e.userId,n=e.opTime;return{userId:t,time:Ut(n)}})),[2,{code:i,data:u}]):[2,{code:i}]}var l}))}))}}),Object.defineProperty(d.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:n}),o=new ro(Gr[Gr.friendAdd],i,this.currentUserId),[4,this._connMgr.send(o,Zs)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?[2,{code:u,data:{processCode:null!==(r=null==l?void 0:l.processCode)&&void 0!==r?r:0}}]:[2,{code:u}]}}))}))}}),Object.defineProperty(d.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new ro(Gr[Gr.friendDel],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),n=new ro(Gr[Gr.friendHandle],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),r=new ro(Gr[Gr.friendHandle],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=qu.encode(hu,{targetId:e,remarkName:t,extProfile:Dh(n)}),[4,this._connMgr.query(Gr.friendSetPf,this.currentUserId,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=qu.decode(gu,i.data.pbData),[2,mn(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(d.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new ro(Gr[Gr.friendCheck],n,this.currentUserId),[4,this._connMgr.send(r,pu)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o}]:s?(u=s.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:o,data:u}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(d.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeFriendQueryInput(11,t,e),r=new ro(Gr[Gr.friendsQuery],n,this.currentUserId),[4,this._connMgr.send(r,iu)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS&&s?(u=s.result,l=s.page,d=(c=l||{}).pageToken,f=c.hasNext,u&&u.list?[2,{code:o,data:{data:u_(u.list),pageToken:f&&d?d:""}}]:[2,{code:o,data:{data:[],pageToken:f&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(d.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),n=new ro(Gr[Gr.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(n,iu)];case 1:return r=a.sent(),i=r.code,o=r.data,i!==x.SUCCESS?[2,{code:i}]:o?(s=o.result,u=o.page,c=(l=u||{}).pageToken,d=l.hasNext,[2,{code:i,data:{data:l_(s),pageToken:d&&c?c:""}}]):[2,{code:i,data:{data:[],pageToken:""}}]}}))}))}}),Object.defineProperty(d.prototype,"deleteFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=qu.encode(bu,{targetId:e}),n=new ro(Gr[Gr.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(n,vu)];case 1:return r=a.sent(),i=r.code,o=r.data,i!==x.SUCCESS?[2,{code:i}]:o?[2,{code:i,data:u_(o.list)}]:[2,{code:i,data:[]}]}}))}))}}),Object.defineProperty(d.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Promise.resolve({code:x.NOT_SUPPORT})]}))}))}}),Object.defineProperty(d.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=qu.encode(Eu,{level:e}),n=new ro(Gr.friendAuthSet,t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new ro(Gr.friendAuthGet,e,this.currentUserId),[4,this._connMgr.send(t,Eu)];case 1:return n=o.sent(),r=n.code,i=n.data,r===x.SUCCESS&&i?[2,{code:r,data:i}]:[2,{code:r}]}}))}))}}),Object.defineProperty(d.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){throw new Error("Method not implemented.")}}),Object.defineProperty(d.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(r=this._connMgr)?(i=qu.encode(Os,{key:t,dataContent:n}),[4,r.send(new ro(Gr.reqCall,i,e),Os)]):[3,2];case 1:return o=a.sent(),s=o.code,u=o.data,s===x.SUCCESS&&u?[2,Promise.resolve({code:s,data:{key:u.key,value:u.dataContent}})]:[2,Promise.resolve({code:s})];case 2:return[2,Promise.resolve({code:x.RC_NET_CHANNEL_INVALID})]}}))}))}}),Object.defineProperty(d.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p=this;return a(this,(function(a){switch(a.label){case 0:return i=(r=this).currentUserId,o=r._connMgr,s=B.PRIVATE,u=o.codec.encodeOldConversationList({count:e,type:s,startTime:t,order:n}),l=new ro(Gr.qrySessions,u,i),[4,o.send(l,va,{currentUserId:i,connectedTime:o.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.unreadMessageCount,o=p._chat.storage.getOrCreateModel({conversationType:t,targetId:n,channelId:r},!1).toIReceivedConversation();return Object.assign(e,o,{unreadMessageCount:i}),e}})];case 1:return c=a.sent(),d=c.code,f=c.data,d!==x.SUCCESS?[2,{code:d}]:[2,{code:d,data:null==f?void 0:f.list.sort((function(e,t){var r,i,o=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0,a=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===n?a-o:o-a}))}]}}))}))}}),Object.defineProperty(d.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=qu.encode(Aa,{nothing:1}),[4,this._connMgr.query(Gr.qrySessionsAtt,this.currentUserId,e,Pa)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(d.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.targetId,r=this.getServerTime(),this._clearConversationUnreadCount(t,n,"",!1,r),i=Qh(e,r),o=new io(Gr.updRRTime,i,this.currentUserId),[4,this._connMgr.send(o)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this._connMgr,n=new ro(Gr.delSessions,t.codec.encodeRemoveConversationList(e),this.getCurrentUserId()),[4,t.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeQuerySessionsInput(e),i=new ro(Gr[Gr.qrySessionsUnread],r,this.currentUserId),[4,this._connMgr.send(i,Ua)];case 1:return(o=a.sent()).code===x.SUCCESS&&o.data?[2,{code:o.code,data:null===(n=null===(t=o.data)||void 0===t?void 0:t.sessions)||void 0===n?void 0:n.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:Ut(e.unreadCount)}}))}]:[2,{code:o.code}]}}))}))}}),Object.defineProperty(d.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=qu.encode(Iu,e),[4,this._connMgr.query(Gr.addUnpush,this.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=qu.encode(Tu,{nothing:0}),[4,this._connMgr.query(Gr.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=qu.encode(Ru,{nothing:0}),[4,this._connMgr.query(Gr.qryUnpush,this.currentUserId,e,Ou)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,n=e.spanMinutes,r=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:n,startTime:r,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:Ne.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(d.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,vn(Wn.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),Object.defineProperty(d.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f=this;return a(this,(function(a){switch(a.label){case 0:return i=0===r?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,s=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,n=e.content,i=e.targetLanguage||o;t!==i?n?s.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:r,transType:1}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:Nr.NONE}}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:Nr.NONE}})})),0!==s.length?[3,1]:(l=vn(),[3,3]);case 1:return c=qu.encode(Au,{businessType:3,businessInfo:qu.encode(Lu,{forceTrans:n,transInfos:s,model:t})}),[4,this._connMgr.query(Gr.upConvertMsg,i,c,Nu)];case 2:d=a.sent(),l=d.wipe(),a.label=3;case 3:return u.length>0&&setTimeout((function(){return f._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),f=new WeakSet,p=function(e,t){var n,r;null===(r=(n=this._watcher).readReceiptResponseV5)||void 0===r||r.call(n,t)},h=function(e,t){var n,r;null===(r=(n=this._watcher).speechToTextResponse)||void 0===r||r.call(n,t)},g=function(e,t,n){var r=this;t!==ag?t!==ug?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(n)):this._handleConvertEvent(n):n.forEach((function(e){qu.decode(yu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,n,i=Jt(e);null===(n=(t=r._watcher).groupApplicationEvent)||void 0===n||n.call(t,i)}))}))},_=function(e){var t={},n=e.extraProfile;return n&&(delete e.extraProfile,t.userExtProfile=Dh(n)),t.userProfile=Dh(e),t},i([a_()],d.prototype,"createGroup",null),i([a_()],d.prototype,"updateGroupInfo",null),i([a_()],d.prototype,"getGroupsInfo",null),i([a_()],d.prototype,"kickGroupMembers",null),i([a_()],d.prototype,"quitGroup",null),i([a_()],d.prototype,"dismissGroup",null),i([a_()],d.prototype,"transferGroupOwner",null),i([a_()],d.prototype,"setGroupManagers",null),i([a_()],d.prototype,"getGroupMembersByRole",null),i([a_()],d.prototype,"getGroupMembers",null),i([a_()],d.prototype,"setGroupMemberInfo",null),i([a_()],d.prototype,"joinGroup",null),i([a_()],d.prototype,"inviteUsersToGroup",null),i([a_()],d.prototype,"memberInviteResponse",null),i([a_()],d.prototype,"getGroupApplications",null),i([a_()],d.prototype,"getJoinedGroupsByRole",null),i([a_()],d.prototype,"getJoinedGroups",null),i([a_()],d.prototype,"setGroupRemark",null),i([a_()],d.prototype,"setGroupFollows",null),i([a_()],d.prototype,"getGroupFollows",null),i([a_()],d.prototype,"addFriend",null),i([a_()],d.prototype,"deleteFriends",null),i([a_()],d.prototype,"acceptFriendApplication",null),i([a_()],d.prototype,"refuseFriendApplication",null),i([a_()],d.prototype,"setFriendInfo",null),i([a_()],d.prototype,"checkFriends",null),i([a_()],d.prototype,"getFriends",null),i([a_()],d.prototype,"getFriendApplications",null),i([a_()],d.prototype,"deleteFriendApplication",null),i([a_()],d.prototype,"getFriendsInfo",null),i([a_()],d.prototype,"searchFriendsInfo",null),i([a_()],d.prototype,"setFriendAddPermission",null),i([a_()],d.prototype,"getFriendAddPermission",null),i([a_()],d.prototype,"getRealtimeConversations",null),i([a_()],d.prototype,"getRealtimeConTotalUnreadCount",null),i([a_()],d.prototype,"clearRealtimeConUnreadCount",null),i([a_()],d.prototype,"removeRealtimeConversations",null),i([a_()],d.prototype,"getRealtimeConUnreadCounts",null),i([s_()],d.prototype,"setNotificationQuietHoursWithSetting",null),i([s_()],d.prototype,"removeNotificationQuietHoursSetting",null),i([s_()],d.prototype,"getNotificationQuietHoursSetting",null),d}(El),f_=function(){function e(e){c_.set(this,void 0),d(this,c_,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,c_,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return Yg(c(this,c_,"f"))},enumerable:!1,configurable:!0}),e}();function p_(e){return r({},e)}function h_(e,t,n){var r=n.value;n.value=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:x.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):r.call.apply(r,l([this],u(t),!1))}}function g_(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xl(this.getNaviInfoFromCache()).isOk?r.call.apply(r,l([this],u(e),!1)):Promise.resolve({code:x.RC_REAL_TIME_CONVERSATION_UNAVAILABLE})}}c_=new WeakMap;var __=function(){function e(e){var n,i;t.add(this),Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_pluginContextQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pluginInstanseMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appkey",{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,"sse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_versionInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_typingInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rtcCodec",{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,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(n={},n[ye.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),n[ye.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),n[ye.INTERCEPT]=this._processInterceptMessage.bind(this),n[ye.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),n[ye.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),n[ye.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),n)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(i={},i[ye.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),i[ye.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),i[ye.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),i)}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:{message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,userSettingsSynced:void 0,userSettingsChanged:void 0,conversationStatusSynced:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,sgRelationsSynced:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,messageDelivered:void 0,groupMessageDeliveredStatus:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0,speechToTextResponse:void 0,translateResponse:void 0}}),Object.defineProperty(this,"_typingInternalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_typingExpireTime",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),Object.defineProperty(this,"_typingChangedList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._options=r({},e),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")}));var o={onConnected:this._onConnectionStatusChange.bind(this,pe.CONNECTED),onConnecting:this._onConnectionStatusChange.bind(this,pe.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,pe.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,pe.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),sgRelationsSynced:this._sgRelationsSyncedListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),messageDelivered:this._messageDeliveredListerer.bind(this),groupMessageDeliveredStatus:this._groupMessageDeliveredStatusListerer.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this),speechToTextResponse:this._speechToTextResponse.bind(this),translateResponse:this._translateResponse.bind(this)};this.rtcCodec=new tl(pl,hl);var a=Dt();this._engine=a?new RCCppEngine(this.rtcCodec,o,this._options):new d_(this.rtcCodec,o,this._options),this.logger=this._engine.getInnerLogger(),this._options.eventLoopBlockingCheck&&sr.start(this.logger),this.sse=new vl(this,a)}var t,n,s,u;return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(H.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(H.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(H.L_IMSDK_VER_O,JSON.stringify({commitId:"a1edc1f3a52419bab1d8dbfee28931fe251d9e81",version:"5.24.0"}));var n=this._context._engine;return zo.setNetworkStatusListener(n.setNetwork.bind(n)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(H.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.logger.createTraceId();if(this.logger.info(H.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(H.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new Tl(this):new Il(this),i=null;try{if(!e.verify(zo))return null;i=e.setup(r,zo,t)}catch(e){this.logger.error(H.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new f_(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;this.logger.warn(H.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_processChrmMemChangeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("function"==typeof this._watcher.chatroomState){var t={},n=[],r=e.content.memberCount,i=void 0===r?0:r;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:i,userList:n}})}return!0}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._addTypingInfo(p_(e)),this._watcher.typingState)return!0}}),Object.defineProperty(e.prototype,"_processInterceptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",blockType:e.content.interceptType,blockedMessageUId:e.content.msgUId,extra:e.content.extra};if(e.conversationType===B.ULTRA_GROUP){var n=e.content.sourceType;if(t.sourceType=n,(n===ge.MSG_EXPANSION||n===ge.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(H.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}}),Object.defineProperty(e.prototype,"_processChrmSyncMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBlockMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.content;return n.operateType===F.Blocked&&(null===(t=n.userList)||void 0===t?void 0:t.includes(this.getCurrentUserId()))&&this._engine.removeChatroomFromCatch(n.chatroomId),"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:n.chatroomId,operateType:n.operateType,durationTime:n.durationTime,operateTime:n.operateTime,userIdList:n.userList,extra:n.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBanMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptRequestMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptResponseMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.getCurrentUserId();n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i,o,a,s=this;if(!(null===(i=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(p_(e))}catch(e){return s.logger.error(H.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(a=(o=this._watcher).message)||void 0===a||a.call(o,p_(e),t,n),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=[],o=[],a=[ye.READ_RECEIPT,ye.READ_RECEIPT_REQUEST,ye.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=r._messageReceiver(e,t,n);s&&a.includes(s.messageType)?o.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(H.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationStatusSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageDeliveredListerer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageDelivered)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMessageDeliveredStatusListerer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupMessageDeliveredStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"_ultraGroupEnableListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).ultraGroupEnable)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_sgRelationsSyncedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).sgRelationsSynced)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageModifiedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageModified)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(H.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).readReceiptResponseV5)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).speechToTextResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=It(r)||yt(r)?r:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,i=e.content,o=e.channelId,a=i.typingContentType,s=o||"",u="".concat(n,"#").concat(r,"#").concat(s);this._typingInfo[u]||(this._typingInfo[u]=[]);var l=this._typingInfo[u].findIndex((function(e){return e.userId===t}));l>=0&&this._typingInfo[u][l].messageType===a?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:a,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}}),Object.defineProperty(e.prototype,"_startCheckTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectedTime()}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getServerTime()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setPushConfig(e)}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectionStatus()}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e._engine.getConnectionStatus()===pe.CONNECTED?vn(e._engine.getNaviInfoFromCache()):mn(x.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e._engine.getCurrentUserId()?vn(e._engine.getNaviInfoFromCache()):mn(x.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i;return o(this,void 0,void 0,(function(){var o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return this._token=e,[4,zo.getNetworkType()];case 1:return o=a.sent(),this._engine.setNetwork({status:!0,type:o},!0),s=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,s,n)];case 2:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,{code:l}]:(1!==this._engine.getNaviInfoFromCache().type&&(d=lt.getInfo(),null===(i=(r=this._engine).reportSDKInfo)||void 0===i||i.call(r,d)),[2,{code:l,userId:c}])}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return r.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){n.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.connect(this.token,!!e,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==B.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var a,s,u,l={isPersited:t,isCounted:n,searchProps:i,isStatusMessage:o};a=e,s=l,(u=Er.get(a))&&!u.isCustom&&console.warn("Builtin message type '".concat(a,"' cannot be registered")),s.isStatusMessage&&(s.isCounted=s.isPersited=!1),Er.set(a,r(r({},s),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._engine.registerRTCSignalingListener(e)}}),Object.defineProperty(e.prototype,"_handleExpansioResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(t){var n=Mt(e),r=n.isIllgalEx,i=n.isExKeyOrValLengthExceedLimit;return n.isExceedLimit||i?x.EXPANSION_LIMIT_EXCEET:r?x.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var o;if(n.needReceipt){if(4!==(null===(o=this.getNaviInfoFromCache())||void 0===o?void 0:o.grpRRVer))return Promise.resolve({code:x.READ_RECEIPT_ERROR});(e!==B.GROUP&&e!==B.PRIVATE||n.isStatusMessage||!n.isPersited||e===B.GROUP&&n.directionalUserIdList&&n.directionalUserIdList.length>0)&&(n.needReceipt=!1)}var a=Ml(n.messageType,n.content),s=a.code,u=a.msg;if(s!==x.SUCCESS)return Promise.resolve({code:s,msg:u});if(e===B.SYSTEM&&n.messageType!==ye.SYNC_READ_STATUS)return Promise.resolve({code:x.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});if(n.messageType===ye.STREAM_MESSAGE)return Promise.resolve({code:x.MESSAGE_NOT_SUPPORT_SENDING});var l=n.canIncludeExpansion,c=void 0!==l&&l,d=n.expansion,f=this._handleExpansioResult(d,c);if(f)return Promise.resolve({code:f});var p=n.isMentioned,h=n.mentionedUserIdList,g=n.mentionedType;p?n.content.mentionedInfo=function(e,t,n){var r,i,o;return{userIdList:(null===(r=e.mentionedInfo)||void 0===r?void 0:r.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||n||K.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}}(n.content,h,g):delete n.content.mentionedInfo;var _=JSON.stringify(n.content);if(function(e){for(var t,n=0,r=0,i=e.length;r<i;r++)n+=(t=e.charCodeAt(r))<127?1:t<=2047?2:t<=65535?3:4;return n}(_)>Fe)return Promise.resolve({code:x.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===B.ULTRA_GROUP)return n.channelId=this._channelIdConvert(e,n.channelId),this._engine.sendUltraMessage(t,n,r,i);var b=this.getNaviInfoFromCache();return(null==b?void 0:b.grpRRVer)&&n.messageType===ye.READ_RECEIPT_RESPONSE?Promise.resolve({code:x.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,n,r,i)}}),Object.defineProperty(e.prototype,"sendExpansionMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return t=e.channelId,n=e.conversationType,r=e.targetId,i=e.messageUId,o=e.keys,s=e.expansion,u=e.removeAll,l=e.canIncludeExpansion,e.messageType===ye.STREAM_MESSAGE&&((null==o?void 0:o.includes("RC_Ext_StreamMsgSummary"))||(null==s?void 0:s.RC_Ext_StreamMsgSummary))?[2,{code:x.STREAM_MESSAGE_EXPANSION_KEY_ERROR}]:l?(c=Mt(s),d=c.isIllgalEx,f=c.isExKeyOrValLengthExceedLimit,c.isExceedLimit||f?[2,Promise.resolve({code:x.EXPANSION_LIMIT_EXCEET})]:d?[2,Promise.resolve({code:x.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(p={mid:i},s&&(p.put=s),o&&(p.del=o),u&&(p.removeAll=1),[4,this._engine.sendMessage(n,r,{content:p,messageType:ye.EXPANSION_NOTIFY,channelId:t})])):[2,{code:x.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:a.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:x.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:x.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,n||"")]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.sendReadReceiptMessageV4(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.updateConversationReadTime(e,t)]}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e=this;return a(this,(function(t){switch(t.label){case 0:return sr.stop(),this._resetWatcher(),this._engine.destroy(),zo.removeNetworkStatusListener(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(H.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a,s){var u={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===B.ULTRA_GROUP){var l=this._channelIdConvert(e,u.channelId);return u.channelId=l,this._engine.getUltraHistoryMsg(t,u,s)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,a||"",s)}}),Object.defineProperty(e.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a){var s={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===B.ULTRA_GROUP){var u=this._channelIdConvert(e,s.channelId);return s.channelId=u,this._engine.getUltraHistoryMsg(t,s,a)}return this._engine.getMessages(e,t,s.timestamp,s.count,s.order,s.channelId,a)}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===n&&(n=0),void 0===r&&(r=20),void 0===i&&(i=0),void 0===o&&(o=""),this._engine.getContinuousMessages(e,t,n,r,i,o)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a){return this._engine.getHistoryMessagesByObjectNames(e,t,n,r,i,o,a)}}),Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return(t=Or("getConversationListByFilter",e).tryTrans((function(){e.type;var t=i._engine.getNaviInfoFromCache();return Dt()||t&&Yg(t)?i.validateLogin():i.validateConnected()}))).isOk?(n=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_LIST_BY_FILTER_T,JSON.stringify(e),n),[4,this._engine.chat.getConversationListByFilter(e)]):[2,t.wipe()];case 1:return r=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_LIST_BY_FILTER_R,r,n),[2,r.trans((function(e){return e.list}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=Ul("getLocalConversation",e,z).result()).isOk?(n=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_T,JSON.stringify(e),n),r=this._channelIdConvert(e.conversationType,e.channelId)||"",[4,this._engine.chat.getConversation(e.conversationType,e.targetId,r)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_R,i,n,e),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return(t=Ul("removeConversation",e,J).result().tryTrans(this.validateConnected)).isOk?(e.channelId=this._channelIdConvert(e.conversationType,e.channelId)||"",n=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_CONVERSATION_T,JSON.stringify(e),n),[4,this._engine.removeConversation(e)]):[2,t.wipe()];case 1:return r=i.sent(),this.logger.summary(H.A_REMOVE_CONVERSATION_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.batchRemoveConversation(e)}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupList(e)}}),Object.defineProperty(e.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getBlockUltraGroupList()}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e===B.ULTRA_GROUP){var r=this._channelIdConvert(e,n);return this._engine.clearUltraUnreadcount(t,r||"")}return this._engine.clearConversationUnreadCount(e,t,n||"")}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_ALL_UNREAD_COUNT_O),this._engine.chat.clearAllUnreadCount()}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationUnreadCount(e,t,r||"")}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=yn.create("getTotalUnreadCount").validate("channelId",e,At,!0).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",t,St).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).tryTrans((function(e){var n=Yg(e);return!n&&t&&t.includes(B.ULTRA_GROUP)?mn(x.METHOD_NOT_SUPPORT):vn(n)}))).isOk?[2,this._engine.chat.getTotalUnreadCount(e,t||[],!!n)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getTotalUnreadCountByLevels(e,t,n)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getFirstUnreadMessage(e,t,n||"")}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getFirstUnreadMessageInfo(e,t,n)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return i=yn.create("batchSetConversationNotificationLevel"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Ul("batchSetConversationNotificationLevel",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("notificationLevel",r,ve,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:r}),s),u=e.map((function(e){return c(d,t,"m",n).call(d,e)})),[4,this._engine.chat.batchSetConversationNotificationLevel(u,r)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,d,f,p=this;return a(this,(function(a){switch(a.label){case 0:return o=yn.create("batchSetConversationToTop"),(u=o.isLimitedTypedArray("conversations",e,20,(function(e){return Ul("batchSetConversationToTop",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==B.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?vn():mn(x.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(l=this.logger.createTraceId(),d=e.map((function(e){return c(p,t,"m",n).call(p,e)})),this.logger.info(H.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:d,isTop:r,isUpdateTime:i,isCreateConversation:s}),l),[4,this._engine.chat.batchSetConversationToTop(d,r,i,s)]):[2,u.wipe()];case 1:return f=a.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TO_TOP_R,f,l),[2,f]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return i=yn.create("batchSetConversationTranslateStrategy"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Ul("",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("strategy",r,wr,!0).fail(x.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:r}),s),u=e.map((function(e){return c(d,t,"m",n).call(d,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(u,r)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=this._channelIdConvert(e,r);return this._engine.saveConversationMessageDraft(e,t,n,i||"")}}),Object.defineProperty(e.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationMessageDraft(e,t,r||"")}}),Object.defineProperty(e.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.clearConversationMessageDraft(e,t,r||"")}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(n=Ul("recallMessage",e,z).isString("messageUId",t.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!1).fail(x.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(x.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(x.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Nt,!1,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected)).isOk?(r=t.messageUId,i=this.logger.createTraceId(),this.logger.info(H.A_RECALL_MESSAGE_T,JSON.stringify({messageUId:r}),i),o=e.conversationType,s=e.channelId,e.channelId=this._channelIdConvert(o,s)||"",[4,this._engine.recallMsg(e,t)]):(this.logger.warn(H.A_RECALL_MESSAGE_E,n.errmsg()),[2,n.wipe()]);case 1:return u=a.sent(),this.logger.summary(H.A_RECALL_MESSAGE_R,u,i,{messageUId:r}),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d;return a(this,(function(a){switch(a.label){case 0:return i=Ul("deleteRemoteMessage",e,J),(o=i.isLimitedTypedArray("messages",r,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,n=e.sentTime,r=e.messageDirection;return vt(t)&&(r===_e.SEND||r===_e.RECEIVE)&&_t({min:0})(n)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).tryTrans((function(){return e.conversationType===B.ULTRA_GROUP&&Dt()?mn(x.METHOD_NOT_SUPPORT):vn()}))).isOk?(s=c(this,t,"m",n).call(this,e),u=r.map((function(e){return e.messageUId})).join(","),l=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_T,JSON.stringify({conversation:s,msgIds:u}),l),[4,this._engine.chat.deleteRemoteMessage(s,r)]):[2,o.wipe()];case 1:return d=a.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_R,d,l),[2,d]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return(o=Ul("deleteRemoteMessageByTimestamp",e,z).isInteger("timestamp",i,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected)).isOk?(s=c(this,t,"m",n).call(this,e),u=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T,JSON.stringify(r(r({},s),{timestamp:i})),u),[4,this._engine.chat.deleteRemoteMessageByTimestamp(s,i)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R,l,u),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,r,n)}}),Object.defineProperty(e.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,r,n)}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.quitChatroom(e)}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getChatroomInfo(e,t||0,n||0)}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key,r=t.value;return nn(n)?rn(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_VALUE):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var n=0;n<t.entries.length;n++){var i=t.entries[n],o=i.key,a=i.value;if(!nn(o))return Promise.resolve({code:x.INVALID_PARAMETER_KEY});if(!rn(a))return Promise.resolve({code:x.INVALID_PARAMETER_VALUE})}var s=r(r({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,s)}}),Object.defineProperty(e.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key,r=t.value;return nn(n)?rn(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_VALUE):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key;return nn(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!nn(r))return Promise.resolve({code:x.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)}}),Object.defineProperty(e.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key;return nn(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getChatroomEntry(e,t)}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getAllChatroomEntry(e)}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=yn.create("getChatroomHistoryMessages").validate("roomId",e,Nt,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",n,0,1).fail(x.INVALID_PARAMETER_ORDER).isInteger("timestamp",r).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected)).isOk?(o=this.logger.createTraceId(),this.logger.info(H.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:n,timestamp:r}),o),[4,this._engine.chatroom.getChatroomHistoryMessages(e,r||0,t||20,n||0)]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(H.A_GET_CHATROOM_HISTORY_MESSAGES_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return o=this.getNaviInfoFromCache(),u=(null==o?void 0:o.uploadServer)||"",l=(null==o?void 0:o.ossConfig)||"",[4,this._engine.getFileToken(e,t,n,r,i,s)];case 1:return c=a.sent(),d=c.code,f=c.data,d===x.SUCCESS&&f?[2,Promise.resolve(Object.assign(f,{qiniu:u,ossConfig:f.ossConfig||l}))]:[2,Promise.reject(d)]}}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return[4,this._engine.getFileUrl(e,n,t,r)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS?[2,Promise.resolve(s)]:[2,Promise.reject(o)]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,yn.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.createTag(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_ADD_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,yn.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.removeTag(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_REMOVE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,yn.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.updateTag(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_UPDATE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return n._engine.getTagList()}))];case 1:return t=r.sent(),this.logger.summary(H.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return(i=yn.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",r,(function(e){return Ul("",e,Q).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==r?void 0:r.length,1,1e3,!0).fail(x.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(o=r.map((function(e){return c(l,t,"m",n).call(l,e)})),s=this.logger.createTraceId(),this.logger.info(H.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:o}),s),[4,this._engine.chat.addTagForConversations(e,o)]):[2,i.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_ADD_TAG_FOR_CONVERSATIONS_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return(i=yn.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",r,1e3,(function(e){return Ul("",e,Q).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(o=r.map((function(e){return c(l,t,"m",n).call(l,e)})),s=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:o}),s),[4,this._engine.chat.removeTagForConversations(e,o)]):[2,i.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_REMOVE_TAG_FOR_CONVERS_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(i=Ul("removeTagsForConversation",e,Q).isTypedArray("tagIds",r,(function(e){return pt(e)}),!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(o=this.logger.createTraceId(),s=c(this,t,"m",n).call(this,e),this.logger.info(H.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:r,conversation:s}),o),[4,this._engine.chat.removeTagsForConversation(s,r)]):[2,i.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_REMOVE_TAGS_FOR_CONVER_R,u,o),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=yn.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isInteger("count",n,!0).fail(x.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_START_TIME).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationListByTag(e,t,n<=0?20:Math.min(n,100))]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),n),[4,yn.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(x.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return r=o.sent(),this.logger.summary(H.A_GET_UNREAD_COUNT_BY_TAG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return(o=Ul("setConversationStatusInTag",r,Q).isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==i?void 0:i.isTop,!0).fail(x.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),u=c(this,t,"m",n).call(this,r),this.logger.info(H.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:u,isTop:i.isTop}),s),[4,this._engine.chat.setConversationStatusInTag(e,u,i)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_SET_CONVER_TO_TOP_IN_TAG_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(r=Ul("getTagsForConversation",e,Q).result().tryTrans(this.validateLogin)).isOk?(i=this.logger.createTraceId(),o=c(this,t,"m",n).call(this,e),this.logger.info(H.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(o),i),[4,this._engine.chat.getTagsForConversation(o)]):[2,r.wipe()];case 1:return s=a.sent(),this.logger.summary(H.A_GET_TAGS_OF_CONVERSATION_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getAllUnreadMentionedCount()}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.conversationType!==B.ULTRA_GROUP){var t=x.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:x[t]})}var n=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=n,this._engine.sendUltraGroupTypingStatus(e)}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.messages.map((function(n){var r=n.sendTime,i=n.messageUId,o=n.channelId;return{sendTime:r,messageUId:i,channelId:t._channelIdConvert(e.conversationType,o)}}));return e.messages=n,this._engine.getUltraGroupMessageListByMessageUId(e)}}),Object.defineProperty(e.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.expansion,r=e.canIncludeExpansion,t!==B.ULTRA_GROUP?[2,{code:i=x.CONVERSATION_TYPE_NOT_SUPPORT,msg:x[i]}]:r?(o=Mt(n),s=o.isIllgalEx,u=o.isExKeyOrValLengthExceedLimit,o.isExceedLimit||u?[2,{code:x.EXPANSION_LIMIT_EXCEET}]:s?[2,{code:x.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:x.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:a.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return e.conversationType!==B.ULTRA_GROUP?[2,{code:t=x.CONVERSATION_TYPE_NOT_SUPPORT,msg:x[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(B.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)}}),Object.defineProperty(e.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(B.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupUnreadInfoList(e)}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.setCallInfo(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupMessageDeliverList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),this._engine.getGroupMessageDeliverList(e,t,n)}}),Object.defineProperty(e.prototype,"getPrivateMessageDeliverTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),this._engine.getPrivateMessageDeliverTime(e,t)}}),Object.defineProperty(e.prototype,"_isEnableSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,n=void 0===t?0:t;switch(e){case ce.ONLINE_STATUS:return 1&n;case ce.USER_PROFILE:return 2&n;default:return!1}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,n):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,n):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfile(e)}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUserProfiles(e)}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfile()}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfileVisibility(e)}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfileVisibility()}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchUserProfileByUniqueId(e)}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.getBlacklist()]}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){return r=Ml(n.messageType,n.content),i=r.code,o=r.msg,i!==x.SUCCESS?[2,Promise.resolve({code:i,msg:o})]:[2,this._engine.insertMessage(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.batchInsertMessage(e,t)}}),Object.defineProperty(e.prototype,"getMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.getMessageCount(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){return a(this,(function(o){return[2,this._engine.deleteMessagesByTimestamp(e,t,n,!!r,i)]}))}))}}),Object.defineProperty(e.prototype,"batchClearMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return(n=yn.create("batchClearRemoteHistoryMessages").isTypedArray("options",e,(function(e){return Ul("",e,J).result().isOk&&_t({min:0})(e.timestamp)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(r=this.logger.createTraceId(),this.logger.info(H.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,this._engine.chat.batchClearRemoteHistoryMessages(e,t)]):[2,n.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_BATCH_CLEAR_REMOTE_MSG_R,n,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"clearMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.clearMessages(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=yn.create("getLocalMessage").validate("messageId",e,(function(){return pt(e)||gt(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result(),n=this.logger.createTraceId(),this.logger.info(H.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),n),[4,t.next((function(){return i._engine.getMessage(e)}))];case 1:return r=o.sent(),this.logger.summary(H.A_GET_LOCAL_MESSAGE_R,r,n,{messageId:e}),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageSentStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(n=Ul("setMessageStatusToRead",e,Q).isNumber("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,s=e.channelId,this.logger.info(H.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),r),[4,this._engine.updateMessageReceiptStatus(i,o,t,s)]):[2,n.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,r),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=yn.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(x.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return vt(e)})).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",n,At).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",r,(function(e){return $(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:n,conversationTypes:r}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[ye.TextMessage,ye.FILE],n||"",r&&0!==r.length?r:Z(J))]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[ye.TextMessage,ye.FILE],n&&0!==n.length?n:Z(J))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var i,u;return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return(o=Ul("searchMessages",e,Q).isLimitedString("keyword",null==n?void 0:n.keyword,0,1e3,!0).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==n?void 0:n.limit,1,st,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==n?void 0:n.offset,0,st).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==n?void 0:n.order,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).isObject("timeRange",n.timeRange).validate("timeRange",n.timeRange,(function(e){var t=e.startTime,n=e.endTime;return!t&&!n||!(t&&!gt(t)||n&&!gt(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(i=null==n?void 0:n.messageFilter)||void 0===i?void 0:i.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(u=null==n?void 0:n.messageFilter)||void 0===u?void 0:u.senderIds,Nt).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateLogin)).isOk?[4,c(this,t,"m",s).call(this,r(r({},n),{conversationFilter:{conversationTypes:[e.conversationType],targetIds:[e.targetId],channelIds:"string"==typeof e.channelId?[e.channelId]:[]}}))]:[2,o.wipe()];case 1:return[2,a.sent().orSync((function(){return vn({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n,r,i,u,l,d;return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){return(o=yn.create("searchMessagesWithParams").isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,st,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,st).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,n=e.endTime;return!t&&!n||!(t&&!gt(t)||n&&!gt(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.conversationTypes,(function(e){return $(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.targetIds,20,Nt,!1,0).fail(x.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(i=null==e?void 0:e.conversationFilter)||void 0===i?void 0:i.channelIds,10,At,!1,0).fail(x.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(u=null==e?void 0:e.messageFilter)||void 0===u?void 0:u.senderIds,20,Nt,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(l=null==e?void 0:e.messageFilter)||void 0===l?void 0:l.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(d=e.messageFilter)||void 0===d?void 0:d.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,t,"m",s).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.getMessagesByTimestamp(e,t,n,r)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),this._engine.getUnreadMentionedMessages(e,t,n)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=""),this._engine.clearUnreadCountByTimestamp(e,t,n,r)}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._channelIdConvert(B.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,n||"")}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(B.ULTRA_GROUP,n);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,r||"")}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Ul("getConversationNotificationLevel",e,J).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,t,"m",n).call(this,e))]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=yn.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return $(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).isValueOf("level",t,ve,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return(t=yn.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return $(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return this._engine.getRemoteHistoryMessages(e,t,n,r,i,o)}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getConversations(e)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._engine.rtcSignaling(e,t,n,r)}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.rtcPing(e,t,n)}}),Object.defineProperty(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.bindRTCRoomForChatroom(e)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setProxy(e)}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProxy()}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.testProxy(e,t)}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=[]),this._engine.createGroup(e,t,n,r)}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.updateGroupInfo(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupsInfo(e)}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.kickGroupMembers(e,t,n)}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.quitGroup(e,t)}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.dismissGroup(e)}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this._engine.transferGroupOwner(e,t,r,n)}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.setGroupManagers(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getGroupMembersByRole(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getGroupMembers(e,t)}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._engine.setGroupMemberInfo(e,t,n,r)}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.searchGroupMembers(e,t,n)}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.joinGroup(e)}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.inviteUsersToGroup(e,t)}}),Object.defineProperty(e.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:N.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:N.REFUSE,reason:n})}}),Object.defineProperty(e.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:N.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:N.REFUSE,reason:r})}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getGroupApplications(e,t,n)}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getJoinedGroupsByRole(e,t)}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.searchJoinedGroups(e,t)}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getJoinedGroups(e)}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupRemark(e,t)}}),Object.defineProperty(e.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(A.ADD,e,t)}}),Object.defineProperty(e.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(A.REMOVE,e,t)}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupFollows(e)}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.addFriend(e,t,n)}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.deleteFriends(e,t)}}),Object.defineProperty(e.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.acceptFriendApplication(e)}}),Object.defineProperty(e.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.refuseFriendApplication(e,t)}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.setFriendInfo(e,t,n)}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.checkFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getFriendApplications(e,t,n)}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getFriendsInfo(e)}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchFriendsInfo(e)}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setFriendAddPermission(e)}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getFriendAddPermission()}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getRealtimeConversations(e,t,n)}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getRealtimeConTotalUnreadCount()}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.clearRealtimeConUnreadCount(e)}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.removeRealtimeConversations(e)}}),Object.defineProperty(e.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getRealtimeConUnreadCounts(e)}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return yn.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(x.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(x.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(x.INVALID_PARAMETER_SPAN_MINUTES).isValueOf("level",e.level,Ne,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Ul("sendReadReceiptResponseV5",e,W).isTypedArray("messageUIdArray",t,(function(e){return Nt(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():mn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){return(n=Ul("getMessageReadReceiptInfoV5",e,W).isTypedArray("messageUIdArray",t,(function(e){return Nt(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():mn(x.READ_RECEIPT_ERROR)}))).isOk?(r=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=yn.create(""),(n=yn.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return Dl(t,e.identifier,W).isNotEmptyString("messageUId",e.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():mn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Ul("getMessageReadReceiptInfoV5",e,W).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isObject("option",n,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",n.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",n.pageCount,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():mn(x.READ_RECEIPT_ERROR)}))).isOk?(n.order=1!==n.order?0:1,n.readStatus=1!==n.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,n)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Ul("getMessagesReadReceiptByUsersV5",e,W).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",n,(function(e){return Nt(e)}),!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",n.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?vn():mn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,n)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),n),[4,yn.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?vn():mn(x.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return r=o.sent(),this.logger.summary(H.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,yn.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return n._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:n}),r),[4,yn.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var r=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,r,!!n)}))];case 1:return i=a.sent(),this.logger.summary(H.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n;return o(this,void 0,void 0,(function(){var r,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return r=Dt(),[4,yn.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Ar&&e.isValid(!r)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(n=null==e?void 0:e.list)||void 0===n?void 0:n.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,Sr).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(i=a.sent()).isOk?(o=e.list,s=e.force,l=e.mode,[2,c(this,t,"m",u).call(this,o,0,l,s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n;return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,yn.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Pr&&e.isValid(!0)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(n=null==e?void 0:e.list)||void 0===n?void 0:n.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,Sr).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=a.sent()).isOk?(i=e.list,o=e.mode,[2,c(this,t,"m",u).call(this,i,1,o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,yn.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return r._engine.userSettings.setTranslationLanguage(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_SET_TRANSLATION_LANGUAGE_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getTranslationLanguage()}))];case 1:return t=r.sent(),this.logger.summary(H.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return r._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_SET_AUTO_TRANSLATE_ENABLED_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=r.sent(),this.logger.summary(H.A_GET_AUTO_TRANSLATE_ENABLED_R,t,e),[2,t]}}))}))}}),t=new WeakSet,n=function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:this._channelIdConvert(e.conversationType,e.channelId)}},s=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.timeRange||{},n=t.startTime,r=t.endTime,i={startTime:null!=n?n:0,endTime:null!=r?r:Date.now()},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(H.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return s=a.sent(),this.logger.summary(H.A_SEARCH_MSGS_BY_PARAMS_R,s,o),[2,s]}}))}))},u=function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),n||Sr.MECHANICAL,!!r,t)]}))}))},i([h_],e.prototype,"updateMyUserProfile",null),i([h_],e.prototype,"getUserProfiles",null),i([h_],e.prototype,"getMyUserProfile",null),i([h_],e.prototype,"updateMyUserProfileVisibility",null),i([h_],e.prototype,"getMyUserProfileVisibility",null),i([h_],e.prototype,"searchUserProfileByUniqueId",null),i([h_],e.prototype,"createGroup",null),i([h_],e.prototype,"updateGroupInfo",null),i([h_],e.prototype,"getGroupsInfo",null),i([h_],e.prototype,"kickGroupMembers",null),i([h_],e.prototype,"quitGroup",null),i([h_],e.prototype,"dismissGroup",null),i([h_],e.prototype,"transferGroupOwner",null),i([h_],e.prototype,"setGroupManagers",null),i([h_],e.prototype,"getGroupMembersByRole",null),i([h_],e.prototype,"getGroupMembers",null),i([h_],e.prototype,"setGroupMemberInfo",null),i([h_],e.prototype,"searchGroupMembers",null),i([h_],e.prototype,"joinGroup",null),i([h_],e.prototype,"inviteUsersToGroup",null),i([h_],e.prototype,"acceptGroupInvite",null),i([h_],e.prototype,"refuseGroupInvite",null),i([h_],e.prototype,"acceptGroupApplication",null),i([h_],e.prototype,"refuseGroupApplication",null),i([h_],e.prototype,"getGroupApplications",null),i([h_],e.prototype,"getJoinedGroupsByRole",null),i([h_],e.prototype,"searchJoinedGroups",null),i([h_],e.prototype,"getJoinedGroups",null),i([h_],e.prototype,"setGroupRemark",null),i([h_],e.prototype,"addGroupFollows",null),i([h_],e.prototype,"removeGroupFollows",null),i([h_],e.prototype,"getGroupFollows",null),i([h_],e.prototype,"addFriend",null),i([h_],e.prototype,"deleteFriends",null),i([h_],e.prototype,"acceptFriendApplication",null),i([h_],e.prototype,"refuseFriendApplication",null),i([h_],e.prototype,"setFriendInfo",null),i([h_],e.prototype,"checkFriends",null),i([h_],e.prototype,"getFriends",null),i([h_],e.prototype,"getFriendApplications",null),i([h_],e.prototype,"getFriendsInfo",null),i([h_],e.prototype,"searchFriendsInfo",null),i([h_],e.prototype,"setFriendAddPermission",null),i([h_],e.prototype,"getFriendAddPermission",null),i([g_],e.prototype,"getRealtimeConversations",null),i([g_],e.prototype,"getRealtimeConTotalUnreadCount",null),i([g_],e.prototype,"clearRealtimeConUnreadCount",null),i([g_],e.prototype,"removeRealtimeConversations",null),i([g_],e.prototype,"getRealtimeConUnreadCounts",null),e}();export{__ as APIContext,Gl as AppStorage,Bn as AreaCode,yl as AssertRules,El as BasicEngine,Zn as BasicLogger,D as ChatroomEntryType,j as ChatroomSyncStatusReason,G as ChatroomUserChangeType,k as ChrmMemBanType,F as ChrmMemOperateType,V as ChrmSyncStatus,tl as Codec,ju as ConnectionStatus,Rr as ConversationListFilterType,B as ConversationType,f as DirectionType,x as ErrorCode,Xu as EventEmitter,Y as FileType,h as FriendAddPermission,E as FriendApplicationStatus,b as FriendApplicationType,_ as FriendRelationType,U as GroupApplicationDirection,P as GroupApplicationStatus,M as GroupApplicationType,R as GroupInviteHandlePermission,y as GroupJoinPermission,T as GroupMemberInfoEditPermission,O as GroupMemberRole,S as GroupOperation,I as GroupOperationPermission,w as GroupOperationRole,N as GroupOperationStatus,A as GroupOperationType,Ue as HttpMethod,Pe as InterruptionLevel,ir as LogDBProxy,Kn as LogL,Du as LogLevel,Vu as LogSource,H as LogTagId,Fe as MAX_MESSAGE_CONTENT_BYTES,st as MAX_U32_INTEGER,Be as MAX_UPLOAD_FILE_SIZE,K as MentionedType,De as MessageAuditType,ge as MessageBlockSourceType,he as MessageBlockType,_e as MessageDirection,ye as MessageType,ve as NotificationLevel,me as NotificationStatus,ue as OnlineStatus,se as OperateStatus,Zo as PBCodec,le as PlatformInfo,Il as PluginContext,be as PushImportanceHonor,Ne as PushNotificationQuietHoursLevel,p as QueryFriendsDirectionType,pe as RCConnectionStatus,En as RCResult,xu as RTCApiType,Hu as RTCJoinType,Gu as RTCMode,Tl as RTCPluginContext,Ie as ReceivedStatus,ae as SentStatus,Ve as SpeechToTextStatus,nl as StreamMessageResponseEventType,de as SubscribeOperationType,ce as SubscribeType,gn as SuspendablePromise,Ar as TranslateMessageParam,Sr as TranslateMode,Nr as TranslateStatus,wr as TranslateStrategy,Pr as TranslateTextParam,He as UPLOAD_FILE_CHUNK_SIZE,ct as UUId,te as UltraGroupChannelChangeType,ee as UltraGroupChannelType,n as UploadMethod,fe as UserProfileVisibility,Hn as UserSettingsChangedKey,je as UserType,yn as Validator,Nl as ValidatorManage,lt as VersionManage,Al as assert,or as createLogDBProxy,mn as fail,un as fixUrlProtocol,Zu as forEach,vr as getMessageTypeDescription,xl as getUUID,Bl as getUUID22,mr as hasMessageTypeDescription,Fn as httpRequest,bt as isArray,ht as isBoolean,It as isFunction,Rt as isHttpUrl,_t as isInteger,wl as isLimitedArray,Et as isLimitedString,el as isNull,gt as isNumber,yt as isObject,pt as isString,Tt as isUndefined,Ll as isValidConversation,St as isValidConversationType,Pt as isValidEnum,Lt as isValidFileType,wt as isValidGroupId,Ct as isValidNotificationLevel,Nt as isValidTargetId,zu as logger,$u as map,mt as notEmptyArray,Ot as notEmptyObject,vt as notEmptyString,vn as ok,zo as runtime,Vt as trans2IReceivedStatusInfo,we as trans2NotificationLevel,Le as trans2NotificationStatus,jt as transformReceivedStatusFlag,Dt as usingCppEngine,Pl as validate};
15
+ var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function o(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,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(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=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++,r=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],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function c(e,t,n,r){if("a"===n&&!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"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function d(e,t,n,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,n):i?i.value=n:t.set(e,n),n}!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"}(n||(n={}));var f,p,h,_,b,E,v,m,y,I,T,R,O,S,A,C,N,P,w,M,L,U,D,V,j,G,k,F,x,B,H={L_IMSDK_VER_O:"L-imsdk_ver-O",A_INIT_REPEAT_O:"A_INIT_REPEAT_O",L_INIT_O:"L-init-O",A_DESTROY_O:"A_DESTROY_O",A_CONNECT_T:"A-connect-T",A_CONNECT_R:"A-connect-R",A_CONNECT_S:"A-connect-S",L_QUERY_CMP_T:"L-query_cmp-T",L_QUERY_CMP_R:"L-query_cmp-R",A_DISCONNECT_O:"A-disconnect-O",A_RECONNECT_T:"A-reconnect-T",A_RECONNECT_R:"A_RECONNECT_R",L_CONNECT_T:"L-connect-T",L_CONNECT_O:"L-connect-O",L_CONNECT_R:"L-connect-R",L_CONNECT_S:"L-connect-S",L_DB_UPGRATE_START_S:"L-db_upgrate_start-S",L_DB_UPGRATING_S:"L-db_upgrating-S",L_DB_UPGRATE_COMPLETE_S:"L-db_upgrate_complete-S",L_NOTIFY_ULTRA_ONLINE_S:"L-notify-ultra-online-S",L_ULTRA_SYNC_DONE_S:"L-ultra-sync-done-S",L_BATCH_MESSAGE_O:"L-BATCH_MESSAGE-O",A_MSG_LISTENER_E:"A-MSG_LISTENER-E",O:"L-original-O",T:"L-TEST-O",L_INSTALL_PLUGIN_T:"L-INSTALL_PLUGIN-T",L_INSTALL_PLUGIN_R:"L-INSTALL_PLUGIN-R",L_NAVI_CONF_E:"L-NAVI_CONF_ERROR-E",L_NAVI_CMP_R:"L-NAVI_CPM-R",A_SEND_MSG_T:"A-send_msg-T",A_SEND_MSG_R:"A-send_msg-R",L_SEND_MSG_T:"L-send_msg-T",L_SEND_MSG_R:"L-send_msg-R",L_PULL_MSG_T:"L-pull_msg-T",L_PULL_MSG_R:"L-pull_msg-R",L_PULL_MSG_E:"L-pull_msg-E",L_PULL_MSG_O:"L-pull_msg-O",L_PULL_ULTRA_MSG_T:"L-pull_ultra_msg-T",L_PULL_ULTRA_MSG_R:"L-pull_ultra_msg-R",L_PULL_UG_RELATIONS_T:"L-pull_ug_relations-T",L_PULL_UG_RELATIONS_R:"L-pull_ug_relations-R",L_PULL_CHATROOM_KV_T:"L-pull_chatroom_kv-T",L_PULL_CHATROOM_KV_R:"L-pull_chatroom_kv-R",L_PULL_CHATROOM_MSG_T:"L-pull_chatroom_msg-T",L_PULL_CHATROOM_MSG_R:"L-pull_chatroom_msg-R",L_RECV_MULTI_SYNC_MSG_O:"L-recv_multi_sync_msg-O",L_RECV_S_MSG_O:"L-recv_s_msg-O",A_DELETE_MESSAGES_S:"A-delete_messages-S",P_DELETE_MSG_S:"P-delete_msg-S",A_RECALL_MESSAGE_T:"A-recall_msg-T",A_RECALL_MESSAGE_R:"A-recall_msg-R",A_RECALL_MESSAGE_E:"A-recall_msg-E",A_REGTYP_O:"A-regtyp-O",P_REGTYP_E:"P-regtype-E",L_GET_NAVI_T:"L-get_navi-T",L_GET_NAVI_R:"L-get_navi-R",L_REQUEST_T:"L-request-T",L_REQUEST_R:"L-request-R",L_PARSE_NAVI_E:"L-parse_navi-E",L_ENV_S:"L-Env-S",L_GET_INDEX_NAVI_S:"L-get_index_navi-S",A_JOIN_CHATROOM_T:"A-join_chatroom-T",A_JOIN_CHATROOM_R:"A-join_chatroom-R",L_JOIN_CHATROOM_T:"L-join_chatroom-T",L_JOIN_CHATROOM_R:"L-join_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",L_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",L_REJOIN_CHATROOM_S:"L-rejoin_chatroom-S",L_MEDIA_S:"L-media-S",L_MEDIA_UPLOAD_T:"L-media_upload-T",L_MEDIA_UPLOAD_R:"L-media_upload-R",G_UPLOAD_LOG_S:"G-upload_log-S",G_REPORT_LOG_S:"G-report_log-S",G_UPLOAD_LOG_E:"G-upload_log-E",G_GET_REAL_TIMELOG_COMMAND_S:"G-get_real_timelog_command-S",L_CHECK_ALIVE_IM_T:"L-check_alive_im-T",L_CHECK_ALIVE_IM_R:"L-check_alive_im-R",L_CHECK_ALIVE_IM_S:"L-check_alive_im-S",A_GET_LOCAL_MESSAGE_T:"A-get_local_message-T",A_GET_LOCAL_MESSAGE_R:"A-get_local_message-R",A_GET_HISTORY_MSG_T:"A-get_history_msg-T",A_GET_HISTORY_MSG_R:"A-get_history_msg-R",L_GET_HISTORY_MSG_T:"L-get_history_msg-T",L_GET_HISTORY_MSG_R:"L-get_history_msg-R",A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E:"A-get_privage_message_deliver_time-E",A_GET_GROUP_MESSAGE_DELIVER_LIST_E:"A-get_group_message_deliver_list-E",L_CALLBACK_E:"L-callback-E",A_SEND_MESSAGE_READ_RECEIPT_V4_T:"A-send_message_read_receipt_V4-T",A_SEND_MESSAGE_READ_RECEIPT_V4_R:"A-send_message_read_receipt_V4-R",A_GET_MESSAGE_READ_RECEIPT_V4_T:"A-get_message_read_receipt_V4-T",A_GET_MESSAGE_READ_RECEIPT_V4_R:"A-get_message_read_receipt_V4-R",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T:"A-batch_get_message_read_receipt_info_V4-T",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R:"A-batch_get_message_read_receipt_info_V4-R",A_SYNC_READ_STATUS_T:"A-sync_read_status-T",A_SYNC_READ_STATUS_R:"A-sync_read_status-R",L_PB_ENCODE_E:"L-pb-encode-E",L_PB_DECODE_E:"L-pb-decode-E",L_NOTIFY_NAVI_CHANGE_E:"L-notify_navi_change-E",L_REPORT_FULL_LOG_O:"L-report_full_log-O",L_REPORT_FULL_LOG_T:"L-report_full_log-T",L_REPORT_FULL_LOG_R:"L-report_full_log-R",L_REPORT_LOG_POLICY_E:"L-parse_navi_logpolicy-E",L_UNSUPPORT_INDEXDB_O:"L-unsupport_IndexDB-O",L_LOGDB_OPEN_FAILED_E:"L-logDB_open_failed-E",L_LOGDB_CLOSED_S:"L-logDB_closed-S",L_LOGDB_ERROR_E:"L-logDB_error-S",L_LOGDB_ABORT_S:"L-logDB_abort-S",L_REALTIME_LOG_T:"L_REALTIME_LOG_T",L_REALTIME_LOG_R:"L_REALTIME_LOG_R",L_REALTIME_LOG_O:"L_REALTIME_LOG_O",L_SEND_RMTP_E:"L-send-rmtp-E",L_RECV_RMTP_O:"L-recv-rmtp-O",L_RECV_RMTP_E:"L-recv-rmtp-E",L_RECV_S_NTF_O:"L-recv_s_ntf_O",L_RECV_S_CMD_O:"L-recv_s_cmd_O",L_VER_REPORT_T:"L-VER_REPORT-T",L_VER_REPORT_R:"L-VER_REPORT-R",L_CALL_MAIN_SYNC_O:"L_CALL_MAIN_SYNC_O",L_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_SET_MSG_CONTENT_O:"A_SET_MSG_CONTENT_O",A_REMOVE_PROXY_O:"A-remove_proxy-O",A_SET_PROXY_O:"A-set_proxy-O",A_TEST_PROXY_O:"A-test_proxy-O",L_WS_DISACCORD_E:"L-ws_disaccord-E",L_GET_STATIC_CONF_T:"L-get_static_conf-T",L_GET_STATIC_CONF_R:"L-get_static_conf-R",L_GET_STATIC_CONF_E:"L-get_static_conf-E",L_CLOUD_DISABLED:"L-cloud_disabled",L_CLOUD_OVERCLOCK:"L-cloud_overclock",L_CLOUD_APPKEY_REGION_E:"L-cloud_appkey_region_error",L_CLOUD_CONFIG_DATA_E:"L-cloud_config_data_error",L_CLOUD_SET_CACHE_O:"L-cloud_set_cache-O",L_CLOUD_GET_CACHE_O:"L-cloud_get_cache-O",L_CLOUD_SET_AREA_CODE_O:"L-cloud_set_area_code-O",L_CLOUD_SET_MRTR_O:"L-cloud_set_mrtr-O",L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S:"L-sync_subscribed_user_status_finished-S",L_PULL_SUBSCRIBED_USER_RELATION_T:"L-pull_subscribed_user_relation-T",L_PULL_SUBSCRIBED_USER_RELATION_R:"L-pull_subscribed_user_relation-R",L_PULL_SUBSCRIBED_USER_STATUS_T:"L-pull_subscribed_user_status-T",L_PULL_SUBSCRIBED_USER_STATUS_R:"L-pull_subscribed_user_status-R",L_OWN_USER_PROFILE_CHANGED_S:"L-own_user_profile_changed-S",L_QUERY_SUBSCRIBE_DATA_T:"L-query_subscribe_data-T",L_QUERY_SUBSCRIBE_DATA_R:"L-query_subscribe_data-R",L_PULL_USER_PROFILE_T:"L-pull_user_profile-T",L_PULL_USER_PROFILE_R:"L-pull_user_profile-R",L_PULL_OWN_PROFILE_T:"L-pull_own_profile-T",L_PULL_OWN_PROFILE_R:"L-pull_own_profile-R",L_QUERY_FRIEND_LIST_T:"L-query_friend_list-T",L_QUERY_FRIEND_LIST_R:"L-query_friend_list-R",L_PULL_USER_PROFILE_REQ_T:"L-pull_user_profile_req-T",L_PULL_USER_PROFILE_REQ_R:"L-pull_user_profile_req-R",L_SERVER_EVENT_NOTIFY_ONLINE_T:"L-server_event_notify_online-T",L_SERVER_EVENT_NOTIFY_ONLINE_R:"L-server_event_notify_online-R",L_PULL_EVENT_CHANGE_T:"L-pull_event_change-T",L_PULL_EVENT_CHANGE_R:"L-pull_event_change-R",L_PARSE_JSON_E:"L-parse_json-E",L_REQ_STREAM_MSG_CONTENT_T:"L-req_stream_msg_content-T",L_REQ_STREAM_MSG_CONTENT_R:"L-req_stream_msg_content-R",L_REQ_STREAM_MSG_CONTENT_O:"L-req_stream_msg_content-O",L_REQ_STREAM_MSG_CONTENT_E:"L-req_stream_msg_content-E",L_PULL_CONVERSATION_SETTINGS_T:"L-pull_conversation_settings-T",L_PULL_CONVERSATION_SETTINGS_R:"L-pull_conversation_settings-R",L_PULL_SG_RELATIONS_T:"L-pull_sg_relations-T",L_PULL_SG_RELATIONS_R:"L-pull_sg_relations-R",A_REMOVE_CONVERSATION_T:"A-remove_conversation-T",A_REMOVE_CONVERSATION_R:"A-remove_conversation-R",A_GET_CONVERSATION_LIST_BY_FILTER_T:"A-get_conversation_list_by_filter-T",A_GET_CONVERSATION_LIST_BY_FILTER_R:"A-get_conversation_list_by_filter-R",A_GET_CONVERSATION_T:"A-get_conversation-T",A_GET_CONVERSATION_R:"A-get_conversation-R",A_BATCH_SET_CONVERSATION_TO_TOP_T:"A-batch_set_conversation_to_top-T",A_BATCH_SET_CONVERSATION_TO_TOP_R:"A-batch_set_conversation_to_top-R",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T:"A-batch_set_convers_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_convers_notification_level-R",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T:"A-batch_set_convers_translate_strategy-T",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R:"A-batch_set_convers_translate_strategy-R",A_CLEAR_ALL_UNREAD_COUNT_O:"A-clear_all_unread_count-O",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T:"A-delete_remote_message_by_timestamp-T",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R:"A-delete_remote_message_by_timestamp-R",A_DELETE_REMOTE_MESSAGE_T:"A-delete_remote_message-T",A_DELETE_REMOTE_MESSAGE_R:"A-delete_remote_message-R",A_BATCH_CLEAR_REMOTE_MSG_T:"A-batch_clear_remote_msg-T",A_BATCH_CLEAR_REMOTE_MSG_R:"A-batch_clear_remote_msg-R",L_EVENT_LOOP_BLOCKING_S:"L-event_loop_blocking-S",A_E_SEARCH_CONVERSATION_BY_CONTENT_T:"A-e_search_conversation_by_content-T",A_E_SEARCH_CONVERSATION_BY_CONTENT_R:"A-e_search_conversation_by_content-R",P_GET_SYS_VERSION_E:"P-get_sys_version-E",A_CLEAR_LOCAL_CACHE_O:"A-clear_local_cache-O",A_E_SET_MESSAGE_STATUS_TO_READ_T:"A-e_set_message_status_to_read-T",A_E_SET_MESSAGE_STATUS_TO_READ_R:"A-e_set_message_status_to_read-R",A_SEARCH_MSGS_BY_PARAMS_T:"A-search_msgs_by_params-T",A_SEARCH_MSGS_BY_PARAMS_R:"A-search_msgs_by_params-R",A_GET_CHATROOM_HISTORY_MESSAGES_T:"A-get_chatroom_history_messages-T",A_GET_CHATROOM_HISTORY_MESSAGES_R:"A-get_chatroom_history_messages-R",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T:"A-request_speech_to_text_for_message-T",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R:"A-request_speech_to_text_for_message-R",L_SYNC_USER_SETTINGS_T:"L-sync_user_settings-T",L_SYNC_USER_SETTINGS_R:"L-sync_user_settings-R",A_ADD_TAG_T:"A-add_tag-T",A_ADD_TAG_R:"A-add_tag-R",A_REMOVE_TAG_T:"A-remove_tag-T",A_REMOVE_TAG_R:"A-remove_tag-R",A_UPDATE_TAG_T:"A-update_tag-T",A_UPDATE_TAG_R:"A-update_tag-R",A_GET_TAGS_T:"A-get_tags-T",A_GET_TAGS_R:"A-get_tags-R",A_ADD_TAG_FOR_CONVERSATIONS_T:"A-add_tag_for_conversations-T",A_ADD_TAG_FOR_CONVERSATIONS_R:"A-add_tag_for_conversations-R",A_GET_TAGS_OF_CONVERSATION_T:"A-get_tags_of_conversation-T",A_GET_TAGS_OF_CONVERSATION_R:"A-get_tags_of_conversation-R",A_SET_CONVER_TO_TOP_IN_TAG_T:"A-set_conver_to_top_in_tag-T",A_SET_CONVER_TO_TOP_IN_TAG_R:"A-set_conver_to_top_in_tag-R",A_REMOVE_TAG_FOR_CONVERS_T:"A-remove_tag_for_conversations-T",A_REMOVE_TAG_FOR_CONVERS_R:"A-remove_tag_for_conversations-R",A_REMOVE_TAGS_FOR_CONVER_T:"A-remove_tags_for_conversation-T",A_REMOVE_TAGS_FOR_CONVER_R:"A-remove_tags_for_conversation-R",A_GET_UNREAD_COUNT_BY_TAG_T:"A-get_unread_count_by_tag-T",A_GET_UNREAD_COUNT_BY_TAG_R:"A-get_unread_count_by_tag-R",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T:"A-get_untagged_conversation_list_by_page-T",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R:"A-get_untagged_conversation_list_by_page-R",A_SET_TRANSLATION_LANGUAGE_T:"A-set_translation_language-T",A_SET_TRANSLATION_LANGUAGE_R:"A-set_translation_language-R",A_GET_TRANSLATION_LANGUAGE_T:"A-get_translation_language-T",A_GET_TRANSLATION_LANGUAGE_R:"A-get_translation_language-R",A_SET_AUTO_TRANSLATE_ENABLED_T:"A-set_auto_translate_enabled-T",A_SET_AUTO_TRANSLATE_ENABLED_R:"A-set_auto_translate_enabled-R",A_GET_AUTO_TRANSLATE_ENABLED_T:"A-get_auto_translate_enabled-T",A_GET_AUTO_TRANSLATE_ENABLED_R:"A-get_auto_translate_enabled-R",A_MODIFY_MESSAGE_WITH_PARAMS_T:"A-modify_msg_with_params-T",A_MODIFY_MESSAGE_WITH_PARAMS_R:"A-modify_msg_with_params-R",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T:"A-refresh_refer_msg_with_params-T",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R:"A-refresh_refer_msg_with_params-R",L_PULL_MODIFY_MSG_T:"L-pull_modify_msg-T",L_PULL_MODIFY_MSG_R:"L-pull_modify_msg-R"};!function(e){e[e.BOTH=2]="BOTH"}(f||(f={})),function(e){e[e.BOTH=2]="BOTH"}(p||(p={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(h||(h={})),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"}(_||(_={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(b||(b={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(E||(E={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(v||(v={})),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"}(m||(m={})),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"}(y||(y={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(I||(I={})),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"}(T||(T={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(R||(R={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(O||(O={})),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"}(S||(S={})),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"}(A||(A={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(C||(C={})),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"}(N||(N={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(P||(P={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(w||(w={})),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"}(M||(M={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(L||(L={})),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"}(U||(U={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(D||(D={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(V||(V={})),function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(j||(j={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(G||(G={})),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"}(k||(k={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(F||(F={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",e[e.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",e[e.TRANS_FAILED=28401]="TRANS_FAILED",e[e.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",e[e.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",e[e.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",e[e.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",e[e.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",e[e.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",e[e.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",e[e.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",e[e.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",e[e.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",e[e.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",e[e.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",e[e.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",e[e.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",e[e.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",e[e.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",e[e.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(x||(x={})),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"}(B||(B={}));var q,Y,K,W=0,Q=1,J=2,z=3,X=4,Z=5,$=function(e){var t=[B.PRIVATE,B.GROUP,B.SYSTEM,B.PUBLIC_SERVICE,B.APP_PUBLIC_SERVICE];switch(e){case W:return t;case Q:return[B.PRIVATE,B.GROUP];case J:return l(l([],u(t),!1),[B.ULTRA_GROUP],!1);case z:return l(l([],u(t),!1),[B.ULTRA_GROUP,B.CHATROOM],!1);case X:return l(l([],u(t),!1),[B.ULTRA_GROUP,B.CHATROOM,B.RTC_ROOM,B.CUSTOMER_SERVICE,B.DISCUSSION],!1);case Z:return[B.PRIVATE,B.GROUP,B.ULTRA_GROUP]}},ee=function(e,t){return $(t).includes(e)};!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"}(q||(q={})),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"}(Y||(Y={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(K||(K={}));var te,ne,re,ie,oe,ae,se,ue,le,ce,de,fe,pe,he,ge,_e,be,Ee,ve,me,ye,Ie={TextMessage:"RC:TxtMsg",TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL:"RC:RcCmd",RECALL_MESSAGE_TYPE:"RC:RcCmd",RECALL_NOTIFICATION_MESSAGE:"RC:RcNtf",READ_RECEIPT:"RC:ReadNtf",READ_RECEIPT_REQUEST:"RC:RRReqMsg",READ_RECEIPT_RESPONSE:"RC:RRRspMsg",SYNC_READ_STATUS:"RC:SRSMsg",GROUP_READ_RECEIPT_REQUEST:"RC:RRMsg",READ_STATE:"RC:RSMsg",DELIVERED:"RC:Delivered",DELIVERED_MSG:"RC:DRMsg",CHATROOM_MERGE_CHANGE:"RC:ChrmMemChange",CHATROOM_SYNC_MSG:"RC:ChrmSyncMsg",CHATROOM_MERGE_BLOCK:"RC:ChrmBlockMsg",CHATROOM_MERGE_BAN:"RC:ChrmBanMsg",TYPING_STATUS:"RC:TypSts",INTERCEPT:"RC:InterceptMsg",CLOUD_CONTROL:"RC:CCConfigChangeRequestMsg",STREAM_MESSAGE:"RC:StreamMsg"};!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(te||(te={})),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"}(ne||(ne={})),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"}(re||(re={})),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"}(ie||(ie={})),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"}(oe||(oe={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(ae||(ae={})),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"}(se||(se={})),function(e){e[e.typing=0]="typing"}(ue||(ue={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(le||(le={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(ce||(ce={})),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"}(de||(de={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(fe||(fe={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(pe||(pe={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(he||(he={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(ge||(ge={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(_e||(_e={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(be||(be={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Ee||(Ee={})),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"}(ve||(ve={})),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"}(me||(me={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(ye||(ye={}));var Te,Re,Oe,Se,Ae,Ce,Ne,Pe,we,Me=function(e){return e===ye.OPEN?me.AT_MESSAGE_NOTIFICATION:me.NOT_SET},Le=function(e){return e<=me.NOT_SET?ye.CLOSE:ye.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"}(Te||(Te={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Re||(Re={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Oe||(Oe={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Se||(Se={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ae||(Ae={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ce||(Ce={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Ne||(Ne={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Pe||(Pe={})),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"}(we||(we={}));var Ue,De,Ve={DISALLOW:0,ALLOW:1},je={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},Ge={NORMAL:0,ROBOT:1};!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"}(Ue||(Ue={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(De||(De={}));var ke=72e5,Fe=6e4,xe=131072,Be="5.24.1-c-dq.1".replace(/-.+$/,""),He=5368709120,qe=10485760,Ye="rongcloudsystem",Ke=864e5,We=function(e){return"navi_".concat(e)},Qe=function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},Je=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},ze=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},Xe=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},Ze=function(e,t){return"outbox_".concat(e,"_").concat(t)},$e=function(e,t){return"inbox_".concat(e,"_").concat(t)},et=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},nt=function(e,t){return"send_msg_".concat(e,"_").concat(t)},rt=function(e,t){return"RC-us-".concat(e,"-").concat(t)},it=function(e){return"rc-static-config-".concat(e)},ot=function(e){return"RC-cc-".concat(e)},at=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},st=function(e){return"RC-LI-".concat(e)},ut=Math.pow(2,31)-1,lt="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};lt.engine="5.24.1-c-dq.1";var ct=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)&&(lt[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 n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return lt.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return lt}}),e}();var dt={gen: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)}))},genWithLen:function(e){void 0===e&&(e=22);var t,n=Date.now(),r=n.toString(36),i=Math.floor(Math.random()*n).toString(36),o=e-r.length-i.length;return[i,r,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},ft=dt.genWithLen(22),pt=Date.now(),ht=function(e){return"string"==typeof e},gt=function(e){return"boolean"==typeof e},_t=function(e){return"number"==typeof e&&!Number.isNaN(e)},bt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},Et=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},vt=function(e){return function(t){return ht(t)&&(void 0===e.isTrim||0===t.length||t.trim().length>0)&&(void 0===e.minLength||t.length>=e.minLength)&&(void 0===e.maxLength||t.length<=e.maxLength)&&(void 0===e.validator||e.validator(t))}},mt=function(e){return ht(e)&&e.length>0},yt=function(e){return Et(e)&&e.length>0},It=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Tt=function(e){return"function"==typeof e},Rt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Ot=function(e){return ht(e)&&/https?:\/\//.test(e)},St=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},At=function(e){return _t(e)&&Object.prototype.hasOwnProperty.call(B,e)},Ct=function(e){return _t(e)&&Object.prototype.hasOwnProperty.call(me,e)},Nt=function(e){var t=!1;return ht(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Pt=function(e){return Object.values(e.type).includes(e.value)},wt=function(e){return vt({minLength:1,maxLength:64})(e)},Mt=function(e){return vt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Lt=function(e){return _t(e)&&Object.prototype.hasOwnProperty.call(Y,e)},Ut=function(e){var t=!1,n=!1,r=!1;if(It(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(n||(n=ht(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!r){var a=e[o];r=o.length>32||a.length>4096}}return{isExceedLimit:t,isIllgalEx:n,isExKeyOrValLengthExceedLimit:r}},Dt=function(e){if(!It(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},Vt=function(){return"undefined"!=typeof RCCppEngine},jt=function(e){return{isRead:(e&Te.READ)===Te.READ,isListened:(e&Te.LISTENED)===Te.LISTENED,isDownload:(e&Te.DOWNLOADED)===Te.DOWNLOADED,isRetrieved:(e&Te.RETRIEVED)===Te.RETRIEVED}},Gt=function(e){var t=Te.UNREAD;return(null==e?void 0:e.isRead)&&(t|=Te.READ),(null==e?void 0:e.isListened)&&(t|=Te.LISTENED),(null==e?void 0:e.isDownload)&&(t|=Te.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=Te.RETRIEVED),t},kt=function(e){return[ce.Android,ce.iOS,ce.Web,ce.PC,ce.Mini,ce.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},Ft=function(e,t,n){var r=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},xt=function(e,t,n){return t?1===n?q.TLS:q.RMTP:"http"===e?q.WS:q.WSS},Bt=function(e,t){var n=e.server,r=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return n&&d.push(n),(r||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,r){e&&c.push({addr:e,protocol:xt(a,t,s),weight:n.length-r,race:!1})})),l([],u(c),!1)},Ht=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,i,o,a,s,u,l,c=Qt(e.settingProfile)||{},d=e.extProfile||[],f=e.targetId,p=e.baseInfo,h=e.userInfo;return{groupId:f,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(n=c.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=c.introduction)&&void 0!==r?r:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Qt(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==p?void 0:p.creatorId)&&void 0!==o?o:"",ownerId:null!==(a=null==p?void 0:p.ownerId)&&void 0!==a?a:"",createTime:(null==p?void 0:p.createTime)?Dt(p.createTime):0,membersCount:null!==(s=null==p?void 0:p.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)?Dt(h.joinTime):0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:O.UNDEF}}))},qt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Qt(e.settingProfile),n=e.extProfile||[],i=e.targetId,o=e.baseInfo,a=e.userInfo;return JSON.parse(JSON.stringify(r(r({groupId:i},Kt(t)),{extProfile:n.length>0?Qt(n):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:(null==o?void 0:o.createTime)?Dt(o.createTime):void 0,membersCount:null==o?void 0:o.memberCount,remark:null==a?void 0:a.remarkName})))}))},Yt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Kt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Yt(e.joinPerm),removeMemberPermission:Yt(e.removePerm),invitePermission:Yt(e.memInvitePerm),inviteHandlePermission:Yt(e.invitePerm),groupInfoEditPermission:Yt(e.profilePerm),memberInfoEditPermission:Yt(e.memProfilePerm)}))},Wt=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},n=t.ext,r=t.userId,i=t.name,o=t.portraitUrl,a=n||{},s=a.role,u=a.joinTime,l=a.channelNickName,c=a.additional;return{userId:r,name:i||"",portraitUri:o||"",nickname:l||"",role:s||O.UNDEF,joinedTime:Dt(u)||0,extra:c||""}}));return t},Qt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Jt=function(e){var t,n,r,i;return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",nickname:null===(t=e.ext)||void 0===t?void 0:t.channelNickName,extra:null===(n=e.ext)||void 0===n?void 0:n.additional,role:null===(r=e.ext)||void 0===r?void 0:r.role,joinedTime:null===(i=e.ext)||void 0===i?void 0:i.joinTime}},zt=function(e){var t=e.joinUserInfo,n=e.inviterInfo,r=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Jt(t),inviterInfo:n&&n.userId?Jt(n):void 0,operatorInfo:r&&r.userId?Jt(r):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},Xt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e};function Zt(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var $t,en=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=dt.gen(),i=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate();return"".concat(n).concat(e).concat(r).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(n,"_").concat(o).concat(r).concat(a)},tn=function(e,t,n){void 0===e&&(e=0);var i=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}}(e),o=i.disablePushTitle,a=i.forceShowDetailContent,s=nn(null==n?void 0:n.pushConfigs,null==n?void 0:n.pushId);return r({pushTitle:(null==n?void 0:n.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:a,templateId:null==n?void 0:n.templateId},s)},nn=function(e,t){var n={},r={notificationId:t||""},i={};if(!e)return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,l,c,d,f,p,h,g,_=Object.keys(e);if(0!==_.length){var b=_[0];switch(b){case"HW":return r.channelIdHW=null===(t=e[b])||void 0===t?void 0:t.channelId,r.importanceHW=null===(o=e[b])||void 0===o?void 0:o.importance,r.imageUrlHW=null===(a=e[b])||void 0===a?void 0:a.image,void(r.categoryHW=null===(s=e[b])||void 0===s?void 0:s.category);case"MI":return void(r.channelIdMi=null===(u=e[b])||void 0===u?void 0:u.channelId);case"OPPO":return void(r.channelIdOPPO=null===(l=e[b])||void 0===l?void 0:l.channelId);case"VIVO":return r.typeVivo=null===(c=e[b])||void 0===c?void 0:c.classification,void(r.categoryVivo=null===(d=e[b])||void 0===d?void 0:d.category);case"APNS":return n.threadId=e[b]["thread-id"],n.apnsCollapseId=e[b]["apns-collapse-id"],n.category=e[b].category,n.richMediaUri=e[b].richMediaUri,void(n.interruptionLevel=e[b]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:e[b].collapse_key||"",imageUrl:e[b].imageUrl||"",priority:e[b].priority||""});case"HONOR":return r.importanceHonor=null===(f=e[b])||void 0===f?void 0:f.importance,void(r.imageUrlHonor=null===(p=e[b])||void 0===p?void 0:p.image);case"OHOS":i.category=null===(h=e[b])||void 0===h?void 0:h.category,i.image=null===(g=e[b])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:n,androidConfig:r,harmonyOSConfig:i}},rn=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},on=function(e){var t=e.length;return t<=4096&&t>=1},an=($t=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),n=e+$t.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return $t=2047&++$t,parseInt(n,2)}),sn=function(){var e=ct.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-next"].includes(n)?n:"electron");return t},un=function(e,t,n){return o(void 0,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return r=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,Zt(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function ln(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==q.HTTP||r?"https://".concat(e):"http://".concat(e)}var cn=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,i="";try{var o=JSON.parse(r);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(H.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return i};var dn,fn=function(e){function n(t){var n=e.call(this,t)||this;return n.name="CMSYError",n}return t(n,e),Object.defineProperty(n,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new n("Invalid parameter -> ".concat(e)):new n("Invalid parameters.")}}),Object.defineProperty(n,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new n("Wrong parameter type")}}),n}(Error),pn=function(){function e(){dn.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,dn,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,dn,"f")},enumerable:!1,configurable:!0}),e}();dn=new WeakMap;var hn=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,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(r),once:n},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,n,r){return void 0===r&&(r=0),this._addItem(e,t,!1,n,r)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!0,n,r)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;try{for(var r=s(this._map),i=r.next();!i.done;i=r.next()){var o=u(i.value,2),a=(o[0],o[1]),l=a.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void a.splice(l,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map.get(e);if(r&&r.length>0)for(var i=new pn,o=0;o<r.length;o+=1){var a=r[o],s=a.once,c=a.listener;s&&r.splice(o,1);try{c.apply(void 0,l([i],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}l([],u(this._piped.values()),!1).forEach((function(n){return n.emit.apply(n,l([e],u(t),!1))}))}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._map.delete(e)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._piped.clear(),this._map.clear()}}),Object.defineProperty(e.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._piped.add(e)}}),e}(),gn=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t}return t(n,e),Object.defineProperty(n.prototype,"waitingQueueLength",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return a(this,(function(n){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[2]}))}))}}),Object.defineProperty(n.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(n.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(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,n=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==n?void 0:n.version)||n.version<this._dataVersion)throw new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(null==n?void 0:n.version));return r=n.version,i=n.hasNext,o=this._versionQueue.filter((function(e){return e>r})),this._versionQueue=l([],u(o),!1),this._dataVersion=r,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(n.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return n._execPulling()}),e))}}),Object.defineProperty(n.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(n.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),n}(hn),_n=function(){function e(e,t){var n=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){n._resolve=t,e(n._onResolve.bind(n))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}();!function(){function e(e,t){var n=this;Object.defineProperty(this,"handler",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"validate",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_handlerPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._handlerPromise=new Promise((function(e){n._resolve=e}))}Object.defineProperty(e.prototype,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){return a(this,(function(n){if(!this._resolve)throw new Error("BatchSync is closed");return(null===(t=this.validate)||void 0===t?void 0:t.call(this,e))?(this._data.add(e),[2,this._handlerPromise]):[2]}))}))}}),Object.defineProperty(e.prototype,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:if(!this._resolve)throw new Error("BatchSync is closed");return e=this._resolve,this._resolve=null,t=l([],u(this._data.values()),!1),this._data.clear(),t.length>0?[4,this.handler(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return e(),[2,Promise.resolve()]}}))}))}})}();var bn,En,vn=function(){function e(e,t,n){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=n}return Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(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 o(this,void 0,void 0,(function(){return a(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?mn(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?mn(void 0,this.msg):yn(this.code,this.msg)}}),e}(),mn=function(e,t){return new vn(0,t||"success",e)},yn=function(e,t,n){return new vn(e,t||"fail: ".concat(e),n)},In=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})}return 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){return this.isFailed&&0===this._code&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?yn(this._code,this._errmsg):mn()}}),Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e(this),this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;var i=r?n(t):null==t||n(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,n,r){if(void 0===r&&(r=!1),this.isFailed)return this;if(this.validate(e,t,n,r),this.isFailed)throw fn.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return"string"==typeof t}),n)}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assertString(e,t,n),this.assert(e,t,(function(e){return e.trim().length>0}),n)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=n&&e.length<=r}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),n)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),n)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=n&&e<=r}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.isArray(e,t,r).validate(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.length>=i&&e.length<=n}),r)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.isArray(e,t,r).validate(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.every(n)}),r)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,n,i,o).validate(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,n,i,o),this.assert(e,t,(function(e){return e.every(r)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)}}),Object.defineProperty(e.prototype,"isValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return Object.values(n).includes(t)}),r)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return Object.values(n).includes(t)}),r)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"function"==typeof e}),n)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"function"==typeof e}),n)}}),e}(),Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Rn(e){var t,n,r,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=Tn.indexOf(e.charAt(u++))<<2|(i=Tn.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(o=Tn.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(a=Tn.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(n)),64!==a&&(s+=String.fromCharCode(r));return s}!function(){function e(e){var t=this;bn.add(this),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(e){t._resolve=e})),e&&c(this,bn,"m",En).call(this,e)}Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(mn(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resolve(yn(e,"",t))}}),Object.defineProperty(e.prototype,"end",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}})}(),bn=new WeakSet,En=function(e){var t=this;e().then((function(e){return t._resolve(e)}))};var On,Sn=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},An=1732584193,Cn=4023233417,Nn=2562383102,Pn=271733878,wn=[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],Mn=[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 Ln(e,t){return e<<t|e>>>32-t}function Un(e,t,n){return e&n|t&~n}function Dn(e,t,n){return e^t^n}function Vn(e,t,n){return t^(e|~n)}function jn(e){for(var t=[],n=0;n<e.length;n+=4)t.push((e[n]||0)|(e[n+1]||0)<<8|(e[n+2]||0)<<16|(e[n+3]||0)<<24);return t}function Gn(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 kn(e){var t=8*e.length,n=e.length%64<56?56-e.length%64:120-e.length%64,r=new Uint8Array(e.length+n+8);r.set(e),r[e.length]=128;for(var i=1;i<n;i++)r[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(Gn(a),0),o.set(Gn(s),4),r.set(o,e.length+n);var u,l=An,c=Cn,d=Nn,f=Pn;for(i=0;i<r.length;i+=64){for(var p=jn(r.slice(i,i+64)),h=l,g=c,_=d,b=f,E=0;E<64;E++){var v=void 0,m=void 0;E<16?(v=(u=c)&d|~u&f,m=E):E<32?(v=Un(c,d,f),m=(5*E+1)%16):E<48?(v=Dn(c,d,f),m=(3*E+5)%16):(v=Vn(c,d,f),m=7*E%16);var y=f;f=d,d=c,c+=Ln(l+v+Mn[E]+p[m]&4294967295,wn[E]),l=y}l=l+h&4294967295,c=c+g&4294967295,d=d+_&4294967295,f=f+b&4294967295}var I=new Uint8Array(16);return I.set(Gn(l),0),I.set(Gn(c),4),I.set(Gn(d),8),I.set(Gn(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(I)}function Fn(e){var t=function(e){return(new TextEncoder).encode(e)}(e);return kn(t)}function xn(e){var t=e.method||De.GET,n=e.timeout||Fe,r=e.headers,i=e.query,o=e.body,a=e.onProgress,s=Xt(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),r&&u.setRequestHeader)for(var l in r)u.setRequestHeader(l,r[l]);return function(e,t,n,r){return new _n((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(u,n,o,a)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(On||(On={}));var Bn,Hn,qn=0,Yn=3,Kn={TranslationLanguage:0,AutoTranslateEnable:1};!function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA"}(Hn||(Hn={}));var Wn=((Bn={})[Hn.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Bn[Hn.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Bn[Hn.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Bn[Hn.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Bn[Hn.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Bn);function Qn(e){return Hn[e]?e:Hn.BJ}var Jn,zn=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 n,r=this.initOption||{},i=r.areaCode,o=r.navigators,a=(n=i,void 0===n&&(n=Hn.BJ),Wn[Qn(n)].naviUrlBase64).map((function(e){return Rn(e)})),s=[],c=u(e.split("@"),2)[1];t&&(s=c?c.split(";"):[]);var d=o&&o.length>0?l(l([],u(s),!1),u(o),!1):l(l([],u(s),!1),u(a),!1);return d.filter((function(e,t){return d.indexOf(e)===t})).map((function(e){return ln(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,i=e||{},o=i.log,a=i.logPolicy,s=this.initOption||{},c=s.areaCode,d=s.logServerUrl,f=(n=c,void 0===n&&(n=Hn.BJ),Wn[Qn(n)].logUrlBase64).map((function(e){return r(r({},e),{addr:Rn(e.addr)})})),p=[],h={level:1,itv:6,times:5};if(o)p.push.apply(p,l([],u(o.addrs),!1)),Object.assign(h,o.policy);else if(a)try{var g=JSON.parse(a);p.push({addr:g.url,protocol:q.HTTPS,weight:1}),h.level=g.level,h.itv=g.itv,h.times=g.times}catch(n){t.warn(H.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var _=d?l([{addr:d,protocol:q.HTTPS,weight:101}],u(p),!1):l(l([],u(p),!1),u(f),!1);return{policy:h,addrs:_.filter((function(e,t){return _.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return r(r({},e),{addr:ln(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,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Hn.BJ),Wn[Qn(t)].miniCmpBase64).map((function(e){return Rn(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=Hn.BJ),Wn[Qn(t)].staticConfigUrlBase64).map((function(e){return Rn(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=Hn.BJ),Wn[Qn(n)].cloudControllerUrlBase64).map((function(e){return Rn(e)}))}}),Object.defineProperty(e.prototype,"getAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:Hn.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Hn[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=(e||{}).active,i=(null==r?void 0:r.addrs)||[],o=(n=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===n&&(n=Hn.BJ),Wn[Qn(n)].statsUrlBase64).map((function(e){return Rn(e)}));return 0===i.length?o:l(l([],u(i.sort((function(e,t){return t.weight-e.weight})).map((function(e){return ln(e.addr,e.protocol)}))),!1),u(o),!1)}}),e}(),Xn=new zn,Zn=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 o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:if(!(t=this.getCache()))return[3,6];a.label=1;case 1:return a.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return r=a.sent(),(i=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return ln(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=a.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),a.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=a.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(u=a.sent())?void 0:u.areaCode)!==Xn.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==u?void 0:u.bootstrap)||[],(l=null===(e=null==u?void 0:u.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:l.map((function(e){return ln(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(Xn.getStaticConfigUrl()),!1).map((function(e){return ln(e)}))).filter((function(t,n){return e.indexOf(t)===n})),a.label=1;case 1:a.trys.push([1,6,7,8]),t=s(e),n=t.next(),a.label=2;case 2:return n.done?[3,5]:(r=n.value,this.logger.info(H.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),i=Date.now(),[4,this.sendRequest("".concat(r,"/").concat(this.appkey))]);case 3:if(o=a.sent(),c=o.code,d=o.data,200===c)return this.logger.info(H.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(H.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:c,duration:Date.now()-i})),a.label=4;case 4:return n=t.next(),[3,2];case 5:return[3,8];case 6:return f=a.sent(),p={error:f},[3,8];case 7:try{n&&!n.done&&(h=t.return)&&h.call(t)}finally{if(p)throw p.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"}(Jn||(Jn={}));var $n,er,tr=function(){function e(e,t,n,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:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:Jn.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Jn.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,n=e.level,r=e.content,i=e.traceId;/^[\w-]+$/.test(t)?n!==Jn.DEBUG&&this.logDB.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(r," | ").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 ft}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,n=e.tag,r=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=Jn.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(n," | ").concat(r," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[Jn.DEBUG,Jn.INFO,Jn.WARN,Jn.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,n,r){var i={time:Date.now(),level:e,tag:t,content:n,traceId:r,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,n,i,o,a){if(void 0===i&&(i={}),t.isOk){var s=null==o?void 0:o(t.data);this.info(e,JSON.stringify(r(r({isOk:!0},i),s)),n)}else{s=null==a?void 0:a(t.data);this.warn(e,JSON.stringify(r(r({code:t.code,msg:t.msg},i),s)),n)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),nr=function(){function e(e,t,n,r,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c=this;return a(this,(function(a){switch(a.label){case 0:o=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.logDB.read(e,t,n,r,s)];case 2:return u=a.sent(),Et(u.logs)?o=u.logs.filter((function(e){return!(!e||"object"!=typeof e)||(c.logger.warn(H.L_REALTIME_LOG_R,"Invalid log entry: not an object",i),!1)})):this.logger.warn(H.L_REALTIME_LOG_R,"Invalid logs result: not an array",i),[3,4];case 3:return l=a.sent(),this.logger.warn(H.L_REALTIME_LOG_R,"Error getting logs: ".concat(l instanceof Error?l.message:String(l)),i),[3,4];case 4:return[2,{logs:o}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(n=Xn.getLogUrlPolicyList(e,this.logger),r=n.policy,i=n.addrs,this.started=!0,this.itvByNavi=r.itv,this.timesByNavi=r.times,i.length>0&&this.realtimeReport(i[0].addr,r.level,r.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:return this.logger.debug(H.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=a.sent(),o=i.success,s=i.data,o?(this.logger.debug(H.L_REALTIME_LOG_O,"compress done",t),u=Ot(n)?n:"https://".concat(n),u+="?version=".concat("5.24.1-c-dq.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:s,method:"POST"})]):(this.logger.warn(H.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:r}]);case 2:if(l=a.sent(),c=l.status,d=l.data,this.logger.debug(H.L_REALTIME_LOG_R,JSON.stringify({status:c,data:d}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,[2,{isOk:!1,itv:r}];if(this.reportFailedNumber=0,d)try{(h=JSON.parse(d)).nextTime&&(r=h.nextTime),f=h.level,p=h.logSwitch}catch(e){this.logger.warn(H.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:r,level:f,logSwitch:p}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,c,d,f,p,h,g,_,b=this;return a(this,(function(a){switch(a.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||pt,s=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),this.logger.debug(H.L_REALTIME_LOG_T,JSON.stringify({startTime:o,endTime:s,level:t,itv:n}),c),[4,this._getLogs(o,s,t,!0,c,r)];case 1:return 0!==(d=a.sent().logs).length?[3,2]:(this.logger.debug(H.L_REALTIME_LOG_R,"no logs",c),[3,4]);case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,n)]:[3,4];case 3:f=a.sent(),p=f.itv,h=f.level,g=f.logSwitch,f.isOk&&(_=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(_+1),0===g&&(this.started=!1),void 0!==h&&(t=h)),n=p,a.label=4;case 4:return this.started&&(n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return b.realtimeReport(e,t,n,r)}),1e3*n)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,f,p,h,g;return a(this,(function(a){switch(a.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(H.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:s,isCloudControl:u}),o),[4,this._getLogs(e,t,Jn.DEBUG,!1,o)]);case 1:return l=a.sent().logs,this.logger.info(H.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=Ot(r)?r:"https://".concat(r),c+="?version=".concat("5.24.1-c-dq.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return f=a.sent(),p=f.success,h=f.data,d=p?h:"compress failed",[3,4];case 3:d="no data or no database",a.label=4;case 4:return this.logger.debug(H.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return g=a.sent().status,this.logger.info(H.L_REPORT_FULL_LOG_R,JSON.stringify({status:g}),o),[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}(),rr=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,a=e.tag,s=e.type,u=e.content;ht(u)||(u=JSON.stringify(u));var l=n<0?u||"":JSON.stringify({content:u,traceId:i,from:r});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(s,",").concat(n,",").concat(a,",").concat(l,"\n")};function ir(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 or(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))}function ar(){}var sr=function(){function e(e,t){$n.set(this,void 0),er.set(this,void 0),d(this,$n,e,"f"),d(this,er,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,c(this,$n,"f").call(this,e,t,n,r,i)];case 1:return(o=a.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(ir)}]:[2,{logs:[]}];case 2:return s=a.sent(),console.error("[LogDBProxy] read error",s),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{c(this,er,"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&&d(this,$n,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,er,e,"f"),this}}),e}();function ur(){return new sr(or,ar)}$n=new WeakMap,er=new WeakMap;var lr,cr=function(){function e(){}var t,n,r,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",n)||(d(this,t,e,"f",n),e.info(H.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",n)&&(c(this,t,"f",n).info(H.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",n),c(this,t,"f",r)&&(clearTimeout(c(this,t,"f",r)),d(this,t,null,"f",r)))}}),t=e,a=function e(){var a=this,s=Date.now();d(this,t,setTimeout((function(){var r=Date.now()-s;r>=c(a,t,"f",o)&&c(a,t,"f",n).warn(H.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(r,"ms")),c(a,t,"m",e).call(a)}),c(this,t,"f",i)),"f",r)},n={value:null},r={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(lr||(lr={}));var dr=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,n,r,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(a,s,u,l,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 fr,pr,hr,gr,_r=function(){function e(e,t,n){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:n}),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 dr(n)}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===Ie.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))}}),Object.defineProperty(e.prototype,"dataHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,St(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,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return!this.isEable&&t===lr.init&&this.isExire()?(this.logger.info(H.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===lr.newWorkChange&&this.isOverclock()?(this.logger.info(H.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=ln(e),this.lastRequestTime=(new Date).getTime(),i="".concat(r,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(o["RC-Token"]=n),s={platform:"web",version:"5.24.1-c-dq.1",timestamp:this.timestamp},this.logger.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:i})),[4,this.httpRequest(i,De.POST,o,s)]);case 1:return u=a.sent(),l=u.code,c=u.data,this.logger.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===x.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(f=Xn.setAreaCode(d),this.logger.info(H.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:f,originAreaCode:Xn.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(p=Xn.getCloudControllerUrl(d))[0]?[2,this.request(p[0],lr.other)]:(this.logger.info(H.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))}}),Object.defineProperty(e.prototype,"_handleMrtrData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}),e}(),br=function(e){return e===x.RC_CONN_REDIRECTED},Er=function(e){function n(t,n,r){var i=e.call(this)||this;return fr.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:n}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),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:""}),gr.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:Ue.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:he.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 t(n,e),Object.defineProperty(n.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(n.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(n.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===he.DISCONNECTED&&e===he.CONNECTING&&(this._doConnectReason=Ne.CONNECT,c(this,fr,"m",hr).call(this)),this._crtConnectionStatus===he.CONNECTED&&e===he.SUSPENDED&&(t===x.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ne.TIMEOUT:t===x.RC_CONN_REDIRECTED?this._doConnectReason=Ne.REDIRECTED:this._doConnectReason=Ne.RECONNECT),this._crtConnectionStatus===he.CONNECTED){var n={bid:sn(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,gr,"f"),cid:this.cid};this.logger.record(ve.IM_CONNECTION_DURATION,JSON.stringify(n)),e===he.SUSPENDED&&c(this,fr,"m",hr).call(this)}switch(this._crtConnectionStatus=e,e){case he.CONNECTED:this.logger.info(H.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,fr,"m",pr).call(this).emit("onConnected",this._fromSuspend);break;case he.CONNECTING:this.logger.warn(H.L_CONNECT_S,"status: ".concat(e)),c(this,fr,"m",pr).call(this).emit("onConnecting");break;case he.SUSPENDED:this._fromSuspend=!0,this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),br(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,fr,"m",pr).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,fr,"m",pr).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(n.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===he.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var n={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(ve.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e}}),Object.defineProperty(n.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(n.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===he.CONNECTED?[2,mn(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.token=e,this.setConnectionStatus(he.CONNECTING),[4,this.try2Connect(e,t,!1,r,!0)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?(this.setConnectionStatus(he.DISCONNECTED,o),[2,yn(o)]):(this.setConnectionStatus(he.CONNECTED),[2,mn(s)])}}))}))}}),Object.defineProperty(n.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(n.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,f,p,h,g,_;return a(this,(function(a){switch(a.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(ve.IM_STATS_CS,JSON.stringify(o)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,n,!1,r,s)];case 1:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,yn(l)]:1===(f=c).type?[2,yn(x.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(H.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this._connectWithToken(e.replace(/@.+$/,"@"),f,t,r)]);case 2:return p=a.sent(),h=p.code,g=p.data,i||h===x.SUCCESS||(this.retryCount+=1),br(h)?(this.logger.warn(H.L_CONNECT_R,"redirect code: ".concat(h),r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r,i)]):[x.RC_TCP_RESET,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_DISCONNECTED_NO_RMTP,x.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),_=this.cmpWeightCache.every((function(e){return e.failed})),i&&_?(this.logger.warn(H.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(x.SERVER_UNAVAILABLE),r),[2,yn(x.SERVER_UNAVAILABLE)]):(this.logger.warn(H.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),r),this.setConnectionStatus(he.SUSPENDED,h),this.setConnectionStatus(he.CONNECTING),[2,this.createConnectionTask(e,t,!1,r,i)])):h!==x.SUCCESS?(this.logger.warn(H.L_CONNECT_R,"code: ".concat(h),r),[2,yn(h)]):(this.logger.info(H.L_CONNECT_R,"userId: ".concat(g),r),d(this,gr,Date.now(),"f"),this._crtUserId=g,[2,mn(g)])}}))}))}}),Object.defineProperty(n.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){return n=this.logger.createTraceId(),this.logger.debug(H.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),n),this.stopReconnectTimer(),r=function(){return o(i,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==he.SUSPENDED?[2]:(this.setConnectionStatus(he.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,n,!1)]);case 1:return i=o.sent().code,this.reconnectTimer=null,i===x.SUCCESS?(this.setConnectionStatus(he.CONNECTED),[2]):[x.SERVER_UNAVAILABLE,x.TIMEOUT,x.RC_SOCKET_DISCONNECTED,x.RC_SOCKET_NOT_CREATED,x.RC_CONN_ACK_TIMEOUT,x.RC_TCP_RESET,x.RC_NAVI_REQ_FAILED,x.RC_NETWORK_DOWN,x.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?(this._crtConnectionStatus!==he.CONNECTING||(this.setConnectionStatus(he.SUSPENDED,i),this.reconnectTimer=setTimeout(r,5e3)),[2]):(this.setConnectionStatus(he.DISCONNECTED,i),[2])}}))}))},r(),[2]}))}))}}),Object.defineProperty(n.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return br(e)?(this.setConnectionStatus(he.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===x.RC_UDP_DISCONNECTED?(this.setConnectionStatus(he.SUSPENDED,e),void setTimeout((function(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(he.DISCONNECTED,e)}}),Object.defineProperty(n.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(he.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(n.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==he.CONNECTED?(this._failedCount=0,this.logger.debug(H.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(H.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===x.SUCCESS?(this.logger.debug(H.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==he.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(H.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(H.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return r.sent(),this.setConnectionStatus(he.SUSPENDED,x.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,x.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(n.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.setConnectionStatus(he.DISCONNECTED,x.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(n.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(n.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return l([],u(this.cmpWeightCache),!1);var n=Bt(e,t);return this.cmpWeightCache=l([],u(n),!1),l([],u(n),!1)}}),Object.defineProperty(n.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===q.QUIC:t.addr===e}));if(r)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==i&&(r.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==o&&(r.weight=o-1),r.failed=!0}}}}),Object.defineProperty(n.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(n.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){this.token=e,this._openCallPlus=n,this.onDisconenctUnusual(r)}}),n}(hn);gr=new WeakMap,fr=new WeakSet,pr=function(){return this},hr=function(){this.uuid=dt.gen(),this.retryCount=0};var vr=function(e){return e.replace(/@.+$/,"@")},mr=function(){function e(e,t,n,r,i,o){void 0===r&&(r=!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:n}),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: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,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,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,n,r,i){var s;return o(this,void 0,void 0,(function(){var o,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I,T;return a(this,(function(a){switch(a.label){case 0:return o=vr(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,n||Date.now()-l<ke)?(this.logger.info(H.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),r),i&&(d=i.uuid,f=i.retryCount,p=i.reason,h={bid:sn(),ptc:Oe.NAVI,cod:x.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(s=c.type)&&void 0!==s?s:0,hos:"",cache:Se.LOCAL,v:Ae.CURRENT,rsn:p,cid:"".concat(d,"_").concat(f),count:f},this.logger.record(ve.IM_NAVI,JSON.stringify(h),r)),[2,mn(c)]):(g=Xn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(H.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),r),[4,this.requestHandler(g,e,r,i)]);case 1:return _=a.sent(),b=_.code,E=_.data,b===x.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(v=a.sent())?void 0:v.navi)&&(null==v?void 0:v.navi.length)>0?(m=v.navi,[4,this.requestHandler(m,e,r,i)]):[3,4];case 3:y=a.sent(),b=y.code,E=y.data,a.label=4;case 4:return b!==x.SUCCESS?(this.logger.warn(H.L_GET_NAVI_R,b,r),[2,yn(b)]):(I=E).code&&200!==I.code?(this.logger.warn(H.L_GET_NAVI_R,I.code,r),[2,yn(this.transHttpCode(I.code))]):Bt(I).length>0?(this.logger.info(H.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),r),this.setNaviCache(o,I),[2,mn(I)]):(T={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(H.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(T)),r),[2,yn(x.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:i=0,o=e.length,a.label=1;case 1:return i<o?(s=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,n,s)]):[3,4];case 2:if(c=a.sent(),d=c.code,f=c.data,p={bid:sn(),ptc:Oe.NAVI,cod:d,net:null==r?void 0:r.type,dur:Date.now()-l,spr:0,pr:(null==f?void 0:f.type)||0,hos:e[i],cache:Se.REQUEST,v:Ae.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(ve.IM_NAVI,JSON.stringify(p),n),[x.SUCCESS,x.RC_CONN_TOKEN_INCORRECT,x.RC_LICENSE_EXPIRED].includes(d))return[2,d===x.SUCCESS?mn(f):yn(d)];a.label=3;case 3:return i+=1,[3,1];case 4:return[2,yn(x.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 x.RC_CONN_TOKEN_INCORRECT;case 416:return x.RC_LICENSE_EXPIRED;default:return x.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(vr(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(vr(e),r(r({},n),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.uri,r=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(n,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(r),"&v=").concat(Be,"&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}(),yr=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 Ir(e){return yr.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function Tr(e){return yr.has(e)}var Rr,Or,Sr,Ar={TIMESTAMP:0,TOP:1,BLOCKED:2,UNREAD:3,ALL:4,PAGE_INDEX:5},Cr=function(e,t){var n=In.create(e).isObject("filter",t,!0).fail(x.CONVER_GET_ERROR,"filter must be an object").isValueOf("type",t.type,Ar,!0).fail(x.CONVER_GET_ERROR,"filter type invalid"),r=t.type,i=t.params;switch(r){case Ar.TIMESTAMP:!function(e,t){e.isObject("params",t,!0).fail(x.CONVER_GET_ERROR,"filter's params must be an object").isInteger("startTime",null==t?void 0:t.startTime,!0).fail(x.INVALID_PARAMETER_START_TIME).isInteger("count",null==t?void 0:t.count,!0).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(x.INVALID_PARAMETER_ORDER).validate("channelId",null==t?void 0:t.channelId,Nt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return ee(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(n,i);break;case Ar.BLOCKED:break;case Ar.TOP:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return ee(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",null==t?void 0:t.channelId,Nt).fail(x.INVALID_PARAMETER_CHANNEL_ID)}(n,i);break;case Ar.UNREAD:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return ee(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(n,i);break;case Ar.ALL:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").validate("channelId",null==t?void 0:t.channelId,Nt).fail(x.INVALID_PARAMETER_CHANNEL_ID)}(n,i);break;case Ar.PAGE_INDEX:!function(e,t){e.isObject("params",t).fail(x.CONVER_GET_ERROR,"filter's params must be an object or undefined").isInteger("index",null==t?void 0:t.index,!0).fail(x.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",null==t?void 0:t.limit,!0).fail(x.INVALID_PARAMETER_LIMIT).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return ee(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(n,i)}return n.result()},Nr={MECHANICAL:0,INTELLIGENT:1},Pr=function(){function e(e,t,n,r){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=n,this.text=r}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}(),wr=function(e){function n(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(n,e),n}(Pr),Mr=function(e){function n(t,n,r){return e.call(this,Fn(t),n,r,t)||this}return t(n,e),n}(Pr),Lr={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},Ur={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Dr=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},Vr=function(){function e(e){Rr.add(this),Or.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,Or,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,Rr,"m",Sr).call(this,e,c(this,Or,"f"))]}))}))}}),e}();Or=new WeakMap,Rr=new WeakSet,Sr=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,yn(x.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(r=t.shift(),i=ln(r.addr,r.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.24.1-c-dq.1","&platform=Websocket&messageUID=").concat(n.msgUId),this._logger.info(H.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,n)]);case 1:return[2,(s=l.sent()).or((function(r){return o(u,void 0,void 0,(function(){return a(this,(function(i){return-1===r?[2,c(this,Rr,"m",e).call(this,t,n)]:[2,s]}))}))}))]}}))}))};var jr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s=this;return a(this,(function(a){return n=Sn(),r=n.resolve,i=n.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){s._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),r(yn(-1,"timeout"))},o.onreadystatechange=function(n){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),a=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&a){r(mn());var u=0;o.onprogress=function(e){var n=o.response.slice(u);u=o.response.length,t.onRawContent(n)},o.onerror=function(n){s._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(x.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);r(yn(e.code,e.message))}}},o.onerror=function(t){s._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),r(yn(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send(),[2,i]}))}))}}),n}(Vr),Gr=Dr();var kr=null,Fr=function(e){return o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,Br.getNetworkType()];case 1:return t=n.sent(),kr({status:"online"===e.type,type:t}),[2]}}))}))};var xr,Br={tag:"browser",httpReq:function(e){return xn(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Gr,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:Ue.UNKONWN},t=e.type,n=e.effectiveType,r=t||n||Ue.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){kr=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",Fr),window.addEventListener("online",Fr))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",Fr),window.removeEventListener("online",Fr)),kr=null},createSSEClient:function(e){return mn(new jr(e))},getApiVer:function(){var e=Br.runtimeInfo,t=e.type,n=e.version;return"|".concat(t,"|").concat(n)},get runtimeInfo(){var e,t,n=navigator.userAgent,r={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in r)if(r.hasOwnProperty(i)){var o=n.match(r[i]);if(o){t=i,e=o[1]||o[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgS=2]="ppMsgS",e[e.pgMsgS=3]="pgMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.prMsgS=7]="prMsgS",e[e.pbMsgP=8]="pbMsgP",e[e.qryPMsg=9]="qryPMsg",e[e.qryGMsg=10]="qryGMsg",e[e.qryCHMsg=11]="qryCHMsg",e[e.qryCMsg=12]="qryCMsg",e[e.qrySMsg=13]="qrySMsg",e[e.qryMCMsg=14]="qryMCMsg",e[e.qryMPMsg=15]="qryMPMsg",e[e.recallMsg=16]="recallMsg",e[e.rrMsg=17]="rrMsg",e[e.rrList=18]="rrList",e[e.s_ntf=19]="s_ntf",e[e.s_msg=20]="s_msg",e[e.s_stat=21]="s_stat",e[e.s_cmd=22]="s_cmd",e[e.s_us=23]="s_us",e[e.transLan=24]="transLan",e[e.autoTrans=25]="autoTrans",e[e.pullUS=26]="pullUS",e[e.sendMsgRead=27]="sendMsgRead",e[e.qryMsgRead=28]="qryMsgRead",e[e.qryMsgReadCntBatch=29]="qryMsgReadCntBatch",e[e.updRTime=30]="updRTime",e[e.chatMsgS=31]="chatMsgS",e[e.qrySessionsAtt=32]="qrySessionsAtt",e[e.pullMsg=33]="pullMsg",e[e.qrySessions=34]="qrySessions",e[e.delSessions=35]="delSessions",e[e.delMsg=36]="delMsg",e[e.delUgMsg=37]="delUgMsg",e[e.delUgSe=38]="delUgSe",e[e.updRRTime=39]="updRRTime",e[e.qrySessionsUnread=40]="qrySessionsUnread",e[e.setTypeUnpush=41]="setTypeUnpush",e[e.chrmPull=42]="chrmPull",e[e.joinChrm=43]="joinChrm",e[e.joinChrmR=44]="joinChrmR",e[e.exitChrm=45]="exitChrm",e[e.queryChrmI=46]="queryChrmI",e[e.setKV=47]="setKV",e[e.delKV=48]="delKV",e[e.setKVS=49]="setKVS",e[e.delKVS=50]="delKVS",e[e.pullKV=51]="pullKV",e[e.qryRelation=52]="qryRelation",e[e.qryRelationR=53]="qryRelationR",e[e.delRelation=54]="delRelation",e[e.delRelationBatch=55]="delRelationBatch",e[e.pullSeAtts=56]="pullSeAtts",e[e.setSeAtt=57]="setSeAtt",e[e.qnTkn=58]="qnTkn",e[e.qnUrl=59]="qnUrl",e[e.aliUrl=60]="aliUrl",e[e.s3Url=61]="s3Url",e[e.stcUrl=62]="stcUrl",e[e.minioUrl=63]="minioUrl",e[e.cleanPMsg=64]="cleanPMsg",e[e.cleanGMsg=65]="cleanGMsg",e[e.cleanCMsg=66]="cleanCMsg",e[e.cleanSMsg=67]="cleanSMsg",e[e.cleanMCMsg=68]="cleanMCMsg",e[e.cleanMPMsg=69]="cleanMPMsg",e[e.cleanMsgBatch=70]="cleanMsgBatch",e[e.rtcPing=71]="rtcPing",e[e.rtc_ntf=72]="rtc_ntf",e[e.rtcSetOutData=73]="rtcSetOutData",e[e.rtcQryUserOutData=74]="rtcQryUserOutData",e[e.addSeTag=75]="addSeTag",e[e.delSeTag=76]="delSeTag",e[e.addTag=77]="addTag",e[e.delTag=78]="delTag",e[e.reportsdk=79]="reportsdk",e[e.pullUgSes=80]="pullUgSes",e[e.pullUgMsg=81]="pullUgMsg",e[e.ugMsg=82]="ugMsg",e[e.qryUgMsg=83]="qryUgMsg",e[e.updUgRTime=84]="updUgRTime",e[e.upMsgEx=85]="upMsgEx",e[e.modifyMsg=86]="modifyMsg",e[e.qryMsgChange=87]="qryMsgChange",e[e.qryMsg=88]="qryMsg",e[e.operate=89]="operate",e[e.s_opNtf=90]="s_opNtf",e[e.ugUnpushQuery=91]="ugUnpushQuery",e[e.ugUnpushSet=92]="ugUnpushSet",e[e.setRtcRoomId=93]="setRtcRoomId",e[e.qryUgUal=94]="qryUgUal",e[e.updUserSub=95]="updUserSub",e[e.pullUserSub=96]="pullUserSub",e[e.pullSubData=97]="pullSubData",e[e.qrySubData=98]="qrySubData",e[e.pullUserProfile=99]="pullUserProfile",e[e.pullOwnProfile=100]="pullOwnProfile",e[e.updProfilePermiss=101]="updProfilePermiss",e[e.qProfilePermiss=102]="qProfilePermiss",e[e.searchUserProfile=103]="searchUserProfile",e[e.updUserProfile=104]="updUserProfile",e[e.pullEventChange=105]="pullEventChange",e[e.channelCreate=106]="channelCreate",e[e.upChannelInfo=107]="upChannelInfo",e[e.qChannelInfo=108]="qChannelInfo",e[e.channelMemKick=109]="channelMemKick",e[e.channelMemQuit=110]="channelMemQuit",e[e.channelDismiss=111]="channelDismiss",e[e.channelTransfer=112]="channelTransfer",e[e.upChannelManager=113]="upChannelManager",e[e.qChannelMem=114]="qChannelMem",e[e.qChannelSpeMem=115]="qChannelSpeMem",e[e.upChannelMem=116]="upChannelMem",e[e.channelMemJoin=117]="channelMemJoin",e[e.channelMemInvite=118]="channelMemInvite",e[e.channelApplyResp=119]="channelApplyResp",e[e.qChannelApplyList=120]="qChannelApplyList",e[e.qChannelMemJoin=121]="qChannelMemJoin",e[e.qChannelMemSpeJoin=122]="qChannelMemSpeJoin",e[e.upChannelRemark=123]="upChannelRemark",e[e.qChannelRemark=124]="qChannelRemark",e[e.upChannelFollow=125]="upChannelFollow",e[e.qChannelFollow=126]="qChannelFollow",e[e.qSimpleUserProfile=127]="qSimpleUserProfile",e[e.friendAdd=128]="friendAdd",e[e.friendDel=129]="friendDel",e[e.friendHandle=130]="friendHandle",e[e.friendSetPf=131]="friendSetPf",e[e.friendCheck=132]="friendCheck",e[e.friendsQuery=133]="friendsQuery",e[e.friendApplyDel=134]="friendApplyDel",e[e.friendsInfoQry=135]="friendsInfoQry",e[e.friendAuthSet=136]="friendAuthSet",e[e.friendAuthGet=137]="friendAuthGet",e[e.addUnpush=138]="addUnpush",e[e.qryUnpush=139]="qryUnpush",e[e.delUnpush=140]="delUnpush",e[e.s_pubCall=141]="s_pubCall",e[e.reqCall=142]="reqCall",e[e.pullKvMsg=143]="pullKvMsg",e[e.readReceipt=144]="readReceipt",e[e.qryReceipt=145]="qryReceipt",e[e.qryReceiptBatch=146]="qryReceiptBatch",e[e.upConvertMsg=147]="upConvertMsg",e[e.pullModifyMsg=148]="pullModifyMsg"}(xr||(xr={}));var Hr,qr,Yr,Kr=function(e){var t=xr[e];return t},Wr=function(e){return xr[e]};!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(Hr||(Hr={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.PING=12]="PING",e[e.PONG=13]="PONG",e[e.DISCONNECT=14]="DISCONNECT",e[e.PCONNECT=8]="PCONNECT",e[e.PCONNECT_ACK=9]="PCONNECT_ACK",e[e.RESERVED=10]="RESERVED",e[e.RESERVED_2=11]="RESERVED_2",e[e.RESERVED_3=15]="RESERVED_3"}(qr||(qr={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(Yr||(Yr={}));var Qr="rtcRJoin_data",Jr="rtcRExit",zr="rtcRInfo",Xr="rtcUData",Zr="rtcUPut",$r="rtcUDel",ei="rtcSetData",ti="userSetData",ni="rtcQryData",ri="rtcDelData",ii="rtcToken",oi="rtcUserState",ai="rtcUList",si="viewerJoinR",ui="viewerExitR",li="rtcPullKv",ci="rtcIdentityChange",di="rtcInvite",fi="rtcCancelInvite",pi="rtcInviteAnswer",hi="rtcEndInvite",gi="rtcQueryJoined",_i=0,bi=1,Ei=2,vi=3,mi=4,yi=5,Ii=6,Ti=7,Ri=8,Oi=9,Si=10,Ai=11,Ci=12,Ni=13,Pi=14,wi=15,Mi=16,Li=17,Ui=18,Di=19,Vi=20,ji=1,Gi=2,ki=4,Fi=5,xi=6,Bi=7,Hi=8,qi=9,Yi=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var n=this._getBackAndByteSize(e),r=n.back,i=n.byteSize,o=0,a=r.length;o<a;o++)r[o]>255&&(r[o]&=255);return t?r:i<=255?[0,i].concat(r):[i>>8,255&i].concat(r)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],n=0;if("string"==typeof e)for(var r=0,i=e.length;r<i;r++){var o=e.charCodeAt(r);o>=0&&o<=127?(n+=1,t.push(o)):o>=128&&o<=2047?(n+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(n+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:n,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,n,r=[],i=-1,o=e,a="";++i<o.length;){var s=Number(o[i]);if(s===(127&s)||(240&~s?224&~s?192&~s||(s=(s^=192)<<6|128^o[++i]):s=(s=(s^=224)<<6|128^o[++i])<<6|128^o[++i]:s=(s=(s=(s^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(s)||s<0||s>1114111||Math.floor(s)!==s)throw RangeError("Invalid code point: ".concat(s));s<=65535?r.push(s):(t=(s-=65536)>>10|55296,n=s%1024|56320,r.push(t,n)),(i+1===o.length||r.length>16384)&&(a+=String.fromCharCode.apply(null,r),r.length=0)}return a}}),e}(),Ki=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var n=this._pool.subarray(t,this._position);return Yi.readUTF(n)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),Wi=function(){function e(){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"writeByte",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))}}),Object.defineProperty(e.prototype,"writeBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(l([],u(new Int8Array(e)),!1))}}),Object.defineProperty(e.prototype,"writeArr",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(e)}}),Object.defineProperty(e.prototype,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Yi.writeUTF(e);this._pool=this._pool.concat(t)}}),Object.defineProperty(e.prototype,"getBytesArray",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool}}),e}(),Qi=function(){function e(e,t,n,r,i){void 0===t&&(t=Hr.AT_LEAST_ONCE),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_dup",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:i})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4&15,(6&t)>>1,(1&t)>0,(8&t)>0,!(8&~t))}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0}}),e}(),Ji=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.readMessage(e,t,n)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return{stream:e,length:t}}}),e}(),zi=function(){function e(e){Object.defineProperty(this,"_header",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._header=new Qi(e,Hr.AT_MOST_ONCE)}return Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}}),Object.defineProperty(e.prototype,"setHeaderQos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._header.qos=e}}),Object.defineProperty(e.prototype,"getHeaderFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._header.encode()}}),Object.defineProperty(e.prototype,"getArrayBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Wi;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),Xi=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(e.readByte(),this.status=e.readByte(),t<=n.MESSAGE_LENGTH)return{stream:e,length:t};if(r===Yr.V4){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}),Object.defineProperty(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(Ji),Zi=function(e){function n(t){var n=e.call(this,qr.DISCONNECT)||this;return Object.defineProperty(n,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),n}(zi),$i=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}),Object.defineProperty(n,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),n}(Ji),eo=function(e){function n(){return e.call(this,qr.PING)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),n}(zi),to=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n}(Ji),no=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=256*e.readByte()+e.readByte();return this.messageId=parseInt(n.toString(),10),{stream:e,length:t}}}),n}(Ji),ro=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.writeByte(r),e.writeByte(n)}}),n}(zi),io=function(e){function n(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(n,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n.syncMsg=t.syncMsg,n}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,n),this.pbData=t.readAll(),{stream:t,length:n}}}),n}(no),oo=function(e){function n(t,n,r,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof n?n:Wr(n),o}return t(n,e),Object.defineProperty(n.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)}}),n}(ro),ao=function(e){function n(t,n,r){return e.call(this,qr.QUERY,t,r,n)||this}return t(n,e),n}(oo),so=function(e){function n(t,n,r){return e.call(this,qr.PUBLISH,t,r,n)||this}return t(n,e),n}(oo),uo=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:n}}}),n}(no),lo=function(e){function n(t){var n=e.call(this,qr.PUB_ACK)||this;return n.messageId=t,n}return t(n,e),n}(ro),co=function(e){function n(t){var n=e.call(this,qr.QUERY_CONFIRM)||this;return n.messageId=t,n}return t(n,e),n}(ro),fo=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(n,e),Object.defineProperty(n.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:n}}}),n}(no),po=function(e,t){var n=new Uint8Array(e),r=new Ki(n),i=r.readByte(),o=function(e){var t,n=e.command;switch(n){case qr.CONN_ACK:t=new Xi(e);break;case qr.PUBLISH:t=new io(e);break;case qr.PUB_ACK:t=new uo(e);break;case qr.QUERY_ACK:t=new fo(e);break;case qr.PONG:t=new to(e);break;case qr.DISCONNECT:t=new $i(e);break;default:console.error("No support for deserializing ".concat(n," messages"))}return t}(Qi.parse(i));return o&&o.read(r,n.length-1,t),o},ho=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=Sn(),r=n.resolve,i=n.promise,o=this._logger,a=wx.request({url:e,enableChunked:!0,method:"GET",timeout:t.timeout,header:{"Content-Type":"application/json;charset=UTF-8","App-Key":t.appkey,Authorization:"Bearer ".concat(t.token)},success:function(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))r(mn());else{var n=JSON.parse(e.data),i=n.code,o=n.message;r(yn(i,o))}},fail:function(t){var n=t.errMsg,i=t.errno;o.warn(H.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:n,errno:i})),r(yn(-1,t.errMsg))},complete:function(){o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return a.onChunkReceived((function(e){var n=Yi.readUTF(new Uint8Array(e.data));o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(n)),t.onRawContent(n)})),i}}),n}(Vr),go=Dr(),_o=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},bo={setItem:_o("setStorageSync"),getItem:_o("getStorageSync"),removeItem:_o("removeStorageSync"),clear:_o("clearStorageSync")},Eo=null,vo=function(e){var t=e.isConnected,n=e.networkType;Eo({status:t,type:n})};var mo={tag:"wechat",httpReq:function(e){var t=e.method||De.GET,n=e.timeout||Fe,r=e.headers,i=e.query,o=e.body,a=Xt(e.url,i);return new Promise((function(e){wx.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:bo,sessionStorage:bo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:go,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Eo=e,wx.onNetworkStatusChange(vo)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(vo),Eo=null},createSSEClient:function(e){return mn(new ho(e))},get runtimeInfo(){return{type:mo.tag,version:"Unknown"}}},yo=Dr(),Io=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},To={setItem:Io("setStorageSync"),getItem:Io("getStorageSync"),removeItem:Io("removeStorageSync"),clear:Io("clearStorageSync")},Ro=null,Oo=function(e){var t=e.isConnected,n=e.networkType;Ro({status:t,type:n})};var So={tag:"alipay",httpReq:function(e){var t=e.method||De.GET,n=e.timeout||Fe,r=e.headers,i=e.query,o=e.body,a=Xt(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:a,method:t,headers:r,timeout:n,data:o,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:To,sessionStorage:To,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:yo,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ro=e,my.onNetworkStatusChange(Oo)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Oo),Ro=null},createSSEClient:function(e){return yn(x.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:So.tag,version:"Unknown"}}},Ao=Dr(),Co=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},No={setItem:Co("setStorageSync"),getItem:Co("getStorageSync"),removeItem:Co("removeStorageSync"),clear:Co("clearStorageSync")},Po=null,wo=function(e){var t=e.isConnected,n=e.networkType;Po({status:t,type:n})};var Mo={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ao,localStorage:No,sessionStorage:No,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Po=e,tt.onNetworkStatusChange(wo)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(wo),Po=null},createSSEClient:function(e){return yn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Mo.tag,version:"Unknown"}}},Lo=Dr(),Uo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},Do={setItem:Uo("setStorageSync"),getItem:Uo("getStorageSync"),removeItem:Uo("removeStorageSync"),clear:Uo("clearStorageSync")},Vo=null,jo=function(e){var t=e.isConnected,n=e.networkType;Vo({status:t,type:n})};var Go={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Lo,localStorage:Do,sessionStorage:Do,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Ue.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Vo=e,swan.onNetworkStatusChange(jo)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(jo),Vo=null},createSSEClient:function(e){return yn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:Go.tag,version:"Unknown"}}},ko=Dr(),Fo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},xo={setItem:Fo("setStorageSync"),getItem:Fo("getStorageSync"),removeItem:Fo("removeStorageSync"),clear:Fo("clearStorageSync")},Bo=null,Ho=function(e){var t=e.isConnected,n=e.networkType;Bo({status:t,type:n})};var qo={tag:"jingdong",httpReq:function(e){var t=e.method||De.GET,n=e.timeout||Fe,r=e.headers,i=e.query,o=e.body,a=Xt(e.url,i);return new Promise((function(e){jd.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:xo,sessionStorage:xo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ko,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Bo=e,jd.onNetworkStatusChange(Ho)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Ho),Bo=null},createSSEClient:function(e){return yn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:qo.tag,version:"Unknown"}}},Yo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Ko={setItem:Yo("setStorageSync"),getItem:Yo("getStorageSync"),removeItem:Yo("removeStorageSync"),clear:Yo("clearStorageSync")},Wo=null,Qo=function(e){var t=e.isConnected,n=e.networkType;Wo({status:t,type:n})};var Jo={tag:"uniapp",httpReq:function(e){var t=e.method||De.GET,n=e.timeout||Fe,r=e.headers,i=e.query,o=e.body,a=Xt(e.url,i);return new Promise((function(e){uni.request({url:a,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:x.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ko,sessionStorage:Ko,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,n=e.osName;return["app","app-plus"].includes(t)&&n||""},isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Wo=e,uni.onNetworkStatusChange(Qo)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Qo),Wo=null},createSSEClient:function(e){return yn(x.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,n=e.deviceModel,r=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(r||"","|").concat(n||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:Jo.tag,version:"Unknown"}}},zo=Dr(),Xo=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return ks[e].apply(ks,l([],u(t),!1))}catch(e){}}},Zo={setItem:Xo("setStorageSync"),getItem:Xo("getStorageSync"),removeItem:Xo("removeStorageSync"),clear:Xo("clearStorageSync")},$o=null,ea=function(e){var t=e.isConnected,n=e.networkType;$o({status:t,type:n})};var ta,na,ra={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:zo,localStorage:Zo,sessionStorage:Zo,httpReq:function(e){return new Promise((function(t){ks.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:x.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=ks.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){$o=e,ks.onNetworkStatusChange(ea)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(ea),$o=null},createSSEClient:function(e){return yn(x.NOT_SUPPORT)},get runtimeInfo(){return{type:ra.tag,version:"Unknown"}}},ia=function(e){return e&&e.request&&e.getSystemInfo},oa="undefined"!=typeof uni&&ia(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return Jo;case"mp-jd":return qo;case"mp-baidu":return Go;case"mp-toutiao":return Mo;case"mp-alipay":return So;case"mp-weixin":return mo;default:return Br}}():"undefined"!=typeof jd&&ia(jd)?qo:"undefined"!=typeof my&&ia(my)?So:"undefined"!=typeof tt&&ia(tt)?Mo:"undefined"!=typeof ks&&ia(ks)?ra:"undefined"!=typeof swan&&ia(swan)?Go:"undefined"!=typeof wx&&ia(wx)?mo:Br;function aa(e){var t=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,o;return t?(o=(e>>>=0)>=0&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=n),n):(o=(e|=0)>=-128&&e<128)&&(r=s[e])?r:(n=i(e,e<0?-1:0,!1),o&&(s[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=d)return m}else{if(-f>=e)return y;if(e+1>=f)return v}return e<0?r(-e,t).neg():i(0|e%c,0|e/c,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){var i,a,s,u,c,d,f;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(a=r(l(n,8)),s=h,u=0;u<e.length;u+=8)c=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+c),n),c<8?(f=r(l(n,c)),s=s.mul(f).add(r(d))):s=(s=s.mul(a)).add(r(d));return s.unsigned=t,s}function a(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,s={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=i,l=Math.pow,e.fromString=o,e.fromValue=a,f=(d=(c=4294967296)*c)/2,p=n(16777216),h=n(0),e.ZERO=h,g=n(0,!0),e.UZERO=g,_=n(1),e.ONE=_,b=n(1,!0),e.UONE=b,E=n(-1),e.NEG_ONE=E,v=i(-1,2147483647,!1),e.MAX_VALUE=v,m=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=m,y=i(0,-2147483648,!1),e.MIN_VALUE=y,(I=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},I.toString=function(e){var t,n,i,o,a,s,u,c;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(y)?(t=r(e),i=(n=this.div(t)).mul(t).sub(this),n.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=r(l(e,6),this.unsigned),a=this,s="";;){if(u=a.div(o),c=(a.sub(u.mul(o)).toInt()>>>0).toString(e),(a=u).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return!(1&~this.low)},I.isEven=function(){return!(1&this.low)},I.equals=function(e){return t(e)||(e=a(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.compare=function(e){if(t(e)||(e=a(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(_)},I.neg=I.negate,I.add=function(e){var n,r,o,s,u,l,c,d,f,p,h;return t(e)||(e=a(e)),n=this.high>>>16,r=65535&this.high,o=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,c=e.low>>>16,d=0,f=0,p=0,h=0,p+=(h+=s+(65535&e.low))>>>16,f+=(p+=o+c)>>>16,d+=(f+=r+l)>>>16,d+=n+u,i((p&=65535)<<16|(h&=65535),(d&=65535)<<16|(f&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=a(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){var n,o,s,u,l,c,d,f,g,_,b,E;return this.isZero()?h:(t(e)||(e=a(e)),e.isZero()?h:this.eq(y)?e.isOdd()?y:h:e.eq(y)?this.isOdd()?y:h:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(p)&&e.lt(p)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,o=65535&this.high,s=this.low>>>16,u=65535&this.low,l=e.high>>>16,c=65535&e.high,d=e.low>>>16,g=0,_=0,b=0,E=0,b+=(E+=u*(f=65535&e.low))>>>16,_+=(b+=s*f)>>>16,b&=65535,_+=(b+=u*d)>>>16,g+=(_+=o*f)>>>16,_&=65535,g+=(_+=s*d)>>>16,_&=65535,g+=(_+=u*c)>>>16,g+=n*f+o*d+s*c+u*l,i((b&=65535)<<16|(E&=65535),(g&=65535)<<16|(_&=65535),this.unsigned)))},I.mul=I.multiply,I.divide=function(e){var n,i,o,s,u,c,d;if(t(e)||(e=a(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;o=g}else{if(this.eq(y))return e.eq(_)||e.eq(E)?y:e.eq(y)?_:(n=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?_:E:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(y))return this.unsigned?g:h;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=h}for(i=this;i.gte(e);){for(n=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(s=Math.ceil(Math.log(n)/Math.LN2))<=48?1:l(2,s-48),d=(c=r(n)).mul(e);d.isNegative()||d.gt(i);)d=(c=r(n-=u,this.unsigned)).mul(e);c.isZero()&&(c=_),o=o.add(c),i=i.sub(d)}return o},I.div=I.divide,I.modulo=function(e){return t(e)||(e=a(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return i(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=a(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=a(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=a(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(n=this.high,e<32?i(this.low>>>e|n<<32-e,n>>>e,this.unsigned):i(32===e?n:n>>>e-32,0,this.unsigned))},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},I.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),n=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+s.apply(String,e):(e.length+arguments.length>1024&&(t.push(s.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+p]=255&a,p+=h,a/=256,l-=8);e[n+p-h]|=128*g}var o,a,s,u,l,c=function(e,t,n){if(void 0===e&&(e=c.DEFAULT_CAPACITY),void 0===t&&(t=c.DEFAULT_ENDIAN),void 0===n&&(n=c.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?a:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};return c.VERSION="5.0.1",c.LITTLE_ENDIAN=!0,c.BIG_ENDIAN=!1,c.DEFAULT_CAPACITY=16,c.DEFAULT_ENDIAN=c.BIG_ENDIAN,c.DEFAULT_NOASSERT=!1,c.Long=e||null,(o=c.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),a=new ArrayBuffer(0),s=String.fromCharCode,c.accessor=function(){return Uint8Array},c.allocate=function(e,t,n){return new c(e,t,n)},c.concat=function(e,t,n,r){var i,o,a,s,u,l;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),i=0,a=0,s=e.length;s>a;++a)c.isByteBuffer(e[a])||(e[a]=c.wrap(e[a],t)),(o=e[a].limit-e[a].offset)>0&&(i+=o);if(0===i)return new c(0,n,r);for(l=new c(i,n,r),a=0;s>a;)(o=(u=e[a++]).limit-u.offset)<=0||(l.view.set(u.view.subarray(u.offset,u.limit),l.offset),l.offset+=o);return l.limit=l.offset,l.offset=0,l},c.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},c.type=function(){return ArrayBuffer},c.wrap=function(e,t,n,r){var i,a;if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return c.fromBase64(e,n);case"hex":return c.fromHex(e,n);case"binary":return c.fromBinary(e,n);case"utf8":return c.fromUTF8(e,n);case"debug":return c.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(c.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new c(0,n,r),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new c(0,n,r),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((i=new c(e.length,n,r)).limit=e.length,a=0;a<e.length;++a)i.view[a]=e[a]}return i},o.writeBitSet=function(e,t){var n,r,i,o,a,s,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(r=t,o=(i=e.length)>>3,a=0,t+=this.writeVarint32(i,t);o--;)n=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(n,t++);if(i>a){for(s=0,n=0;i>a;)n|=(1&!!e[a++])<<s++;this.writeByte(n,t++)}return u?(this.offset=t,this):t-r},o.readBitSet=function(e){var t,n,r,i,o,a,s,u=void 0===e;for(u&&(e=this.offset),i=(r=(n=this.readVarint32(e)).value)>>3,o=0,a=[],e+=n.length;i--;)t=this.readByte(e++),a[o++]=!!(1&t),a[o++]=!!(2&t),a[o++]=!!(4&t),a[o++]=!!(8&t),a[o++]=!!(16&t),a[o++]=!!(32&t),a[o++]=!!(64&t),a[o++]=!!(128&t);if(r>o)for(s=0,t=this.readByte(e++);r>o;)a[o++]=!!(1&t>>s++);return u&&(this.offset=e),a},o.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},o.writeBytes=o.append,o.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),!(32768&~t)&&(t=-(65535-t+1)),n&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),n&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,n&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),n&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),a&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),a&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},o.readDouble=o.readFloat64,c.MAX_VARINT32_BYTES=5,c.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},c.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},c.zigZagDecode32=function(e){return e>>>1^-(1&e)},o.writeVarint32=function(e,t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=r=c.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):r},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(c.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,n,r,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(128&t);return r|=0,o?(this.offset=e,r):{value:r,length:n}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=c.zigZagDecode32(t.value):t=c.zigZagDecode32(t),t},e&&(c.MAX_VARINT64_BYTES=10,c.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:i<128?9:10},c.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},c.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(t,n){var r,i,o,a,s,u=void 0===n;if(u&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=c.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,a=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(s=this.buffer.byteLength)&&this.resize((s*=2)>n?s:n),n-=r,r){case 10:this.view[n+9]=1&a>>>7;case 9:this.view[n+8]=9!==r?128|a:127&a;case 8:this.view[n+7]=8!==r?128|o>>>21:127&o>>>21;case 7:this.view[n+6]=7!==r?128|o>>>14:127&o>>>14;case 6:this.view[n+5]=6!==r?128|o>>>7:127&o>>>7;case 5:this.view[n+4]=5!==r?128|o:127&o;case 4:this.view[n+3]=4!==r?128|i>>>21:127&i>>>21;case 3:this.view[n+2]=3!==r?128|i>>>14:127&i>>>14;case 2:this.view[n+1]=2!==r?128|i>>>7:127&i>>>7;case 1:this.view[n]=1!==r?128|i:127&i}return u?(this.offset+=r,this):r},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(c.zigZagEncode64(e),t)},o.readVarint64=function(t){var n,r,i,o,a,s,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(n=t,r=0,i=0,o=0,a=0,r=127&(a=this.view[t++]),128&a&&(r|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(r|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(r|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(i=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");return s=e.fromBits(r|i<<28,i>>>4|o<<24,!1),u?(this.offset=t,s):{value:s,length:t-n}},o.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=c.zigZagDecode64(n.value):n=c.zigZagDecode64(n),n}),o.writeCString=function(e,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;i>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=l.calculateUTF16asUTF8(t(e))[1],n+=i+1,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=i+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,a?(this.offset=n,this):i},o.readCString=function(e){var t,r,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,i=-1,l.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=n(),!0),o?(this.offset=e,r()):{string:r(),length:e-t}},o.writeIString=function(e,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return a?(this.offset=n,this):n-i},o.readIString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,n=this.readUint32(e),r=this.readUTF8String(n,c.METRICS_BYTES,e+=4),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},c.METRICS_CHARS="c",c.METRICS_BYTES="b",o.writeUTF8String=function(e,n){var r,i,o,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=n,r=l.calculateUTF16asUTF8(t(e))[1],n+=r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=r,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),a?(this.offset=n,this):n-i},o.writeString=o.writeUTF8String,c.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},c.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},c.calculateString=c.calculateUTF8Bytes,o.readUTF8String=function(e,t,r){var i,o,a,s,u;if("number"==typeof t&&(r=t,t=void 0),(i=void 0===r)&&(r=this.offset),void 0===t&&(t=c.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(a=0,s=r,t===c.METRICS_CHARS){if(o=n(),l.decodeUTF8(function(){return e>a&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++a,l.UTF8toUTF16(e,o)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-s}}if(t===c.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(u=r+e,l.decodeUTF8toUTF16(function(){return u>r?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==u)throw RangeError("Illegal range: Truncated data, "+r+" == "+u);return i?(this.offset=r,o()):{string:o(),length:r-s}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,n){var r,i,o,a,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(o=n,r=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=c.calculateVarint32(r),n+=i+r,a=this.buffer.byteLength,n>a&&this.resize((a*=2)>n?a:n),n-=i+r,n+=this.writeVarint32(r,n),l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+r+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+i));return s?(this.offset=n,this):n-o},o.readVString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,n=this.readVarint32(e),r=this.readUTF8String(n.value,c.METRICS_BYTES,e+=n.length),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},o.append=function(e,t,n){var r,i,o;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((n+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>n?o:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i)),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new c(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},o.compact=function(e,t){var n,r,i;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(n=t-e)?(this.buffer=a,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(i=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this)},o.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new c(0,this.littleEndian,this.noAssert);var n=t-e,r=new c(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},o.copyTo=function(e,t,n,r){var i,o,a;if(!this.noAssert&&!c.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0===(a=r-n)?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=a),o&&(e.offset+=a),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},o.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(this.offset=t),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian=void 0===e||!!e,this},o.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},o.prepend=function(e,t,n){var r,i,o,a,s;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-n)>0?(a=new ArrayBuffer(this.buffer.byteLength+o),(s=new Uint8Array(a)).set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=a,this.view=s,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i)),this},o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(e){var t,n;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),this},o.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},o.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},o.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},o.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?a:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,n={},r=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[];for(e=0,t=r.length;t>e;++e)i[r[e]]=e;return n.encode=function(e,t){for(var n,i;null!==(n=e());)t(r[63&n>>2]),i=(3&n)<<4,null!==(n=e())?(t(r[63&((i|=15&n>>4)|15&n>>4)]),i=(15&n)<<2,null!==(n=e())?(t(r[63&(i|3&n>>6)]),t(r[63&n])):(t(r[63&i]),t(61))):(t(r[63&i]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,o,a;null!==(r=e());)if(void 0===(o=i[r])&&n(r),null!==(r=e())&&(void 0===(a=i[r])&&n(r),t(o<<2>>>0|(48&a)>>4),null!==(r=e()))){if(void 0===(o=i[r])){if(61===r)break;n(r)}if(t((15&a)<<4>>>0|(60&o)>>2),null!==(r=e())){if(void 0===(a=i[r])){if(61===r)break;n(r)}t((3&o)<<6>>>0|a)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),o.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},c.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new c(e.length/4*3,n),i=0;return u.decode(t(e),(function(e){r.view[i++]=e})),r.limit=i,r},c.btoa=function(e){return c.fromBinary(e).toBase64()},c.atob=function(e){return c.fromBase64(e).toBinary()},o.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},c.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new c(i,t);i>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},o.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",a="";r>n;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return e?a:i},c.fromDebug=function(e,t,n){for(var r,i,o=e.length,a=new c(0|(o+1)/3,t,n),s=0,u=0,l=!1,d=!1,f=!1,p=!1,h=!1;o>s;){switch(r=e.charAt(s++)){case"!":if(!n){if(d||f||p){h=!0;break}d=f=p=!0}a.offset=a.markedOffset=a.limit=u,l=!1;break;case"|":if(!n){if(d||p){h=!0;break}d=p=!0}a.offset=a.limit=u,l=!1;break;case"[":if(!n){if(d||f){h=!0;break}d=f=!0}a.offset=a.markedOffset=u,l=!1;break;case"<":if(!n){if(d){h=!0;break}d=!0}a.offset=u,l=!1;break;case"]":if(!n){if(p||f){h=!0;break}p=f=!0}a.limit=a.markedOffset=u,l=!1;break;case">":if(!n){if(p){h=!0;break}p=!0}a.limit=u,l=!1;break;case"'":if(!n){if(f){h=!0;break}f=!0}a.markedOffset=u,l=!1;break;case" ":l=!1;break;default:if(!n&&l){h=!0;break}if(i=parseInt(r+e.charAt(s++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[u++]=i,l=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+s)}if(!n){if(!d||!p)throw TypeError("Illegal str: Missing offset or limit");if(u<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+o)}return a},o.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},c.fromHex=function(e,t,n){var r,i,o,a,s;if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(i=e.length,o=new c(0|i/2,t),a=0,s=0;i>a;a+=2){if(r=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[s++]=r}return o.limit=s,o},l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,i,o,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&a([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&a([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&a([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),o.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},c.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new c(l.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return l.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},c}(t),r=function(t,n){var r,i,o={};return o.ByteBuffer=t,o.c=t,r=t,o.Long=n||null,o.VERSION="5.0.1",o.WIRE_TYPES={},o.WIRE_TYPES.VARINT=0,o.WIRE_TYPES.BITS64=1,o.WIRE_TYPES.LDELIM=2,o.WIRE_TYPES.STARTGROUP=3,o.WIRE_TYPES.ENDGROUP=4,o.WIRE_TYPES.BITS32=5,o.PACKABLE_WIRE_TYPES=[o.WIRE_TYPES.VARINT,o.WIRE_TYPES.BITS64,o.WIRE_TYPES.BITS32],o.TYPES={int32:{name:"int32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},uint64:{name:"uint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.UZERO:void 0},sint64:{name:"sint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},bool:{name:"bool",wireType:o.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:o.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:o.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.ZERO:void 0},float:{name:"float",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:o.WIRE_TYPES.STARTGROUP,defaultValue:null}},o.MAP_KEY_TYPES=[o.TYPES.int32,o.TYPES.sint32,o.TYPES.sfixed32,o.TYPES.uint32,o.TYPES.fixed32,o.TYPES.int64,o.TYPES.sint64,o.TYPES.sfixed64,o.TYPES.uint64,o.TYPES.fixed64,o.TYPES.bool,o.TYPES.string,o.TYPES.bytes],o.ID_MIN=1,o.ID_MAX=536870911,o.convertFieldsToCamelCase=!1,o.populateAccessors=!0,o.populateDefaults=!0,o.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),o.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},o.DotProto=function(e,t){function n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|i*r,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var o,a,s={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},l=u.prototype;return l._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},l.next=function(){var e,n,r,i,o;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(i=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;return('"'===(o=this.source.substring(this.index,this.index=i))||"'"===o)&&(this._stringOpen=o),o},l.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},l.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},l.omit=function(e){return this.peek()===e&&(this.next(),!0)},l.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},s.Tokenizer=u,o=function(e){this.tn=new u(e),this.proto3=!1},(a=o.prototype).parse=function(){var e,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},o.parse=function(e){return new o(e).parse()},a._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},a._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},a._parseOption=function(e,n){var r,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);r=i,o&&(this.tn.skip(")"),r="("+r+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(r+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},a._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},a._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},a._parseServiceRPC=function(e){var n,r,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(n=o,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(r.request=o,this.tn.skip(")"),"returns"!==(o=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+o);if(this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.response_stream=!0,o=this.tn.next()),r.response=o,this.tn.skip(")"),"{"===(o=this.tn.peek())){for(this.tn.next();"}"!==(o=this.tn.next());){if("option"!==o)throw Error("illegal rpc service token: "+o);this._parseOption(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][n]=r},a._parseMessage=function(e,r){var i=!!r,o=this.tn.next(),a={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(a.name=o,i&&(this.tn.skip("="),r.id=n(this.tn.next()),a.isGroup=!0),"["===(o=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(a,o);else if("oneof"===o)this._parseMessageOneOf(a);else if("enum"===o)this._parseEnum(a);else if("message"===o)this._parseMessage(a);else if("option"===o)this._parseOption(a);else if("service"===o)this._parseService(a);else if("extensions"===o)a.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(a);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(a,"optional",o)}return this.tn.omit(";"),e.messages.push(a),a},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,r,i){var o,a,s;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(o={rule:r,type:"",name:"",options:{},id:0},"map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field type: "+a);if(o.keytype=a,this.tn.skip(","),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field: "+a);if(o.type=a,this.tn.skip(">"),a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);o.name=a,this.tn.skip("="),o.id=n(this.tn.next()),"["===(a=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){if(s=this._parseMessage(e,o),!/^[A-Z]/.test(s.name))throw Error("illegal group name: "+s.name);o.type=s.name,o.name=s.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);o.name=a,this.tn.skip("="),o.id=n(this.tn.next()),"["===(a=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},a._parseMessageOneOf=function(e){var n,r,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(r=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(n=this._parseMessageField(e,"optional",o)).oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=i},a._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},a._parseEnum=function(e){var r,i={name:"",values:[],options:{}},o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal name: "+o);for(i.name=o,this.tn.skip("{");"}"!==(o=this.tn.next());)if("option"===o)this._parseOption(i);else{if(!t.NAME.test(o))throw Error("illegal name: "+o);this.tn.skip("="),r={name:o,id:n(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(r)}this.tn.omit(";"),e.enums.push(i)},a._parseExtensionRanges=function(){var t,n,i,o=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}o.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),o},a._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},a.toString=function(){return"Parser at line "+this.tn.line},s.Parser=o,s}(o,o.Lang),o.Reflect=function(e){function n(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,a=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(a,n);break;case e.WIRE_TYPES.ENDGROUP:if(a===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,a,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y={},I=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},T=I.prototype;return T.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},T.toString=function(e){return(e?this.className+" ":"")+this.fqn()},T.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},y.T=I,o=function(e,t,n,r,i){I.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},(a=o.prototype=Object.create(I.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},a.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof l.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof l.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},a.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},a.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,o=0;if(""===r[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof y.Namespace)){i=null;break}if(!((n=i.getChild(r[o]))&&n instanceof y.T&&(!t||n instanceof y.Namespace))){i=null;break}i=n,o++}while(o<r.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},a.qn=function(e){var t,n,r=[],i=e;do{r.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof y.Namespace))return n.join(".");return e.fqn()},a.build=function(){var e,t,n,r={},i=this.children;for(t=0,n=i.length;n>t;++t)(e=i[t])instanceof o&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},a.buildOpt=function(){var e,t,n,r,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)n=o[e],r=this.options[o[e]],i[n]=r;return i},a.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},y.Namespace=o,s=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=s.prototype,s.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new r(0):t.defaultValue},u.verifyValue=function(r){var i,o,a,s=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof r||r==r&&r%1!=0)&&s(typeof r,"not an integer"),r>4294967295?0|r:r;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof r||r==r&&r%1!=0)&&s(typeof r,"not an integer"),r<0?r>>>0:r;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return n(r,!1)}catch(e){s(typeof r,e.message)}else s(typeof r,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return n(r,!0)}catch(e){s(typeof r,e.message)}else s(typeof r,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof r&&s(typeof r,"not a boolean"),r;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof r&&s(typeof r,"not a number"),r;case e.TYPES.string:return"string"==typeof r||r&&r instanceof String||s(typeof r,"not a string"),""+r;case e.TYPES.bytes:return t.isByteBuffer(r)?r:t.wrap(r);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),a=0;a<i.length;a++){if(i[a].name==r)return i[a].id;if(i[a].id==r)return i[a].id}if("proto3"===this.syntax)return("number"!=typeof r||r==r&&r%1!=0)&&s(typeof r,"not an integer"),(r>4294967295||r<0)&&s(typeof r,"not in range for uint32"),r;s(r,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(r&&"object"==typeof r||s(typeof r,"object expected"),r instanceof this.resolvedType.clazz)return r;if(r instanceof e.Builder.Message){for(a in o={},r)r.hasOwnProperty(a)&&(o[a]=r[a]);r=o}return new this.resolvedType.clazz(r)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+r+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var i;switch(this.type){case e.TYPES.int32:return n<0?r.calculateVarint64(n):r.calculateVarint32(n);case e.TYPES.uint32:return r.calculateVarint32(n);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return r.calculateVarint64(n);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return i=r.calculateUTF8Bytes(n),r.calculateVarint32(i)+i;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return r.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(n),r.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(n))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},u.encodeValue=function(t,n,i){var o,a;if(null===n)return i;switch(this.type){case e.TYPES.int32:n<0?i.writeVarint64(n):i.writeVarint32(n);break;case e.TYPES.uint32:i.writeVarint32(n);break;case e.TYPES.sint32:i.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:i.writeUint32(n);break;case e.TYPES.sfixed32:i.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(n);break;case e.TYPES.sint64:i.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:i.writeUint64(n);break;case e.TYPES.sfixed64:i.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?i.writeVarint32("false"===n.toLowerCase()?0:!!n):i.writeVarint32(n?1:0);break;case e.TYPES.enum:i.writeVarint32(n);break;case e.TYPES.float:i.writeFloat32(n);break;case e.TYPES.double:i.writeFloat64(n);break;case e.TYPES.string:i.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");o=n.offset,i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:a=(new r).LE(),this.resolvedType.encode(n,a),i.writeVarint32(a.offset),i.append(a.flip());break;case e.TYPES.group:this.resolvedType.encode(n,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return i},u.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},y.Element=s,l=function(e,t,n,r,i,a){o.call(this,e,t,n,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(c=l.prototype=Object.create(o.prototype)).build=function(n){var i,o,a,s;if(this.clazz&&!n)return this.clazz;for(i=function(e,n){function i(t,n,o,a){var s,u,l,c,d,f,p;if(null===t||"object"!=typeof t)return a&&a instanceof e.Reflect.Enum&&null!==(s=e.Reflect.Enum.getName(a.object,t))?s:t;if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return o?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return u=[],t.forEach((function(e,t){u[t]=i(e,n,o,a)})),u;if(u={},t instanceof e.Map){for(c=(l=t.entries()).next();!c.done;c=l.next())u[t.keyElem.valueToString(c.value[0])]=i(c.value[1],n,o,t.valueElem.resolvedType);return u}for(p in d=t.$type,f=void 0,t)t.hasOwnProperty(p)&&(u[p]=d&&(f=d.getChild(p))?i(t[p],n,o,f.resolvedType):i(t[p],n,o));return u}var o,a,s=n.getChildren(e.Reflect.Message.Field),u=n.getChildren(e.Reflect.Message.OneOf),l=function(t){var i,o,a,c;for(e.Builder.Message.call(this),i=0,o=u.length;o>i;++i)this[u[i].name]=null;for(i=0,o=s.length;o>i;++i)this[(a=s[i]).name]=a.repeated?[]:a.map?new e.Map(a):null,!a.required&&"proto3"!==n.syntax||null===a.defaultValue||(this[a.name]=a.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===t||"object"!=typeof t||!("function"!=typeof t.encode||t instanceof l)||Array.isArray(t)||t instanceof e.Map||r.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(i=0,o=arguments.length;o>i;++i)void 0!==(c=arguments[i])&&this.$set(s[i].name,c);else this.$set(t)},c=l.prototype=Object.create(e.Builder.Message.prototype);for(c.add=function(t,r,i){var o=n._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},c.$add=c.add,c.set=function(t,r,i){var o,a,s;if(t&&"object"==typeof t){for(o in i=r,t)t.hasOwnProperty(o)&&void 0!==(r=t[o])&&this.$set(o,r,i);return this}if(a=n._fieldsByName[t],i)this[t]=r;else{if(!a)throw Error(this+"#"+t+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}return a&&a.oneof&&(s=this[a.oneof.name],null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===t&&(this[a.oneof.name]=null)),this},c.$set=c.set,c.get=function(t,r){if(r)return this[t];var i=n._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},c.$get=c.get,o=0;o<s.length;o++)(a=s[o])instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t,r,i,o=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));o=o.substring(0,1).toUpperCase()+o.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),r=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===n.getChild("set"+o)&&(c["set"+o]=r),null===n.getChild("set_"+t)&&(c["set_"+t]=r),null===n.getChild("get"+o)&&(c["get"+o]=i),null===n.getChild("get_"+t)&&(c["get_"+t]=i)}(a);return c.encode=function(e,r){var i,o;"boolean"==typeof e&&(r=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},l.encode=function(e,t,n){return new l(e).encode(t,n)},c.calculate=function(){return n.calculate(this)},c.encodeDelimited=function(e){var t,i=!1;return e||(e=new r,i=!0),t=(new r).LE(),n.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},c.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},c.toArrayBuffer=c.encodeAB,c.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},c.toBuffer=c.encodeNB,c.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},c.toBase64=c.encode64,c.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},c.toHex=c.encodeHex,c.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},c.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},l.decode=function(e,t){var i,o;"string"==typeof e&&(e=r.wrap(e,t||"base64")),i=(e=r.isByteBuffer(e)?e:r.wrap(e)).littleEndian;try{return o=n.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},l.decodeDelimited=function(e,t){var i,o,a;if("string"==typeof e&&(e=r.wrap(e,t||"base64")),(e=r.isByteBuffer(e)?e:r.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return a=n.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,a}catch(t){throw e.offset+=o,t}},l.decode64=function(e){return l.decode(e,"base64")},l.decodeHex=function(e){return l.decode(e,"hex")},l.decodeJSON=function(e){return new l(JSON.parse(e))},c.toString=function(){return n.toString()},Object.defineProperty&&(Object.defineProperty(l,"$options",{value:n.buildOpt()}),Object.defineProperty(c,"$options",{value:l.$options}),Object.defineProperty(l,"$type",{value:n}),Object.defineProperty(c,"$type",{value:n})),l}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},a=0,s=this.children.length;s>a;a++)if((o=this.children[a])instanceof g||o instanceof l||o instanceof E){if(i.hasOwnProperty(o.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+o.toString(!0)+" cannot override static property '"+o.name+"'");i[o.name]=o.build()}else if(o instanceof l.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof l.OneOf||o instanceof b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[a].toString(!0));return this.clazz=i},c.encode=function(e,t,n){var r,i,o,a,s,u=null;for(o=0,a=this._fields.length;a>o;++o)i=e[(r=this._fields[o]).name],r.required&&null===i?null===u&&(u=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==u)throw(s=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,s;return t},c.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;o>i;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},c.decode=function(t,n,r){var o,a,s,u,l,c,d,f,p,h,g,_;for(n="number"==typeof n?n:-1,l=t.offset,c=new this.clazz;t.offset<l+n||-1===n&&t.remaining()>0;){if(s=(o=t.readVarint32())>>>3,(a=7&o)===e.WIRE_TYPES.ENDGROUP){if(s!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[s])u.repeated&&!u.options.packed?c[u.name].push(u.decode(a,t)):u.map?(f=u.decode(a,t),c[u.name].set(f[0],f[1])):(c[u.name]=u.decode(a,t),u.oneof&&(null!==(p=c[u.oneof.name])&&p!==u.name&&(c[p]=null),c[u.oneof.name]=u.name));else switch(a){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:d=t.readVarint32(),t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;i(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+a)}}for(h=0,g=this._fields.length;g>h;++h)if(null===c[(u=this._fields[h]).name])if("proto3"===this.syntax)c[u.name]=u.defaultValue;else{if(u.required)throw(_=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=c,_;e.populateDefaults&&null!==u.defaultValue&&(c[u.name]=u.defaultValue)}return c},y.Message=l,d=function(t,n,r,i,o,a,s,u,c,d){I.call(this,t,n,a),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=s,this.options=u||{},this.defaultValue=null,this.oneof=c||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(f=d.prototype=Object.create(I.prototype)).build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=s.defaultFieldValue(this.type)},f.verifyValue=function(t,n){var r,i,o;if(n=n||!1,r=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){for(Array.isArray(t)||(t=[t]),o=[],i=0;i<t.length;i++)o.push(this.element.verifyValue(t[i]));return o}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},f.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},f.encode=function(t,n,i){var o,a,s,u,l;if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return n;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1),a=n.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);s=n.offset-a,(u=r.calculateVarint32(s))>1&&(l=n.slice(a,n.offset),a+=u-1,n.offset=a,n.append(l)),n.writeVarint32(s,a-u)}else for(o=0;o<t.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],n);else this.map?t.forEach((function(t,i){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(o),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,i)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return n},f.calculate=function(t,n){var i,o,a;if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;i=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),a=0,o=0;o<t.length;o++)a+=this.element.calculateLength(this.id,t[o]);i+=r.calculateVarint32(a),i+=a}else for(o=0;o<t.length;o++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,n){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=r.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,n)&&(i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},f.decode=function(t,n,r){var i,o,a,u,l,c,d;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(o=n.readVarint32(),o=n.offset+o,a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){if(u=s.defaultFieldValue(this.keyType),i=s.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());for((l=n.clone()).limit=l.offset+o,n.offset+=o;l.remaining()>0;)if(t=7&(c=l.readVarint32()),1===(d=c>>>3))u=this.keyElement.decode(l,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,d)}return[u,i]}return this.element.decode(n,t,this.id)},y.Message.Field=d,p=function(e,t,n,r,i,o,a){d.call(this,e,t,n,null,r,i,o,a),this.extension},p.prototype=Object.create(d.prototype),y.Message.ExtensionField=p,h=function(e,t,n){I.call(this,e,t,n),this.fields=[]},y.Message.OneOf=h,g=function(e,t,n,r,i){o.call(this,e,t,n,r,i),this.className="Enum",this.object=null},g.getName=function(e,t){var n,r,i=Object.keys(e);for(r=0;r<i.length;++r)if(e[n=i[r]]===t)return n;return null},(g.prototype=Object.create(o.prototype)).build=function(t){var n,r,i,o;if(this.object&&!t)return this.object;for(n=new e.Builder.Enum,i=0,o=(r=this.getChildren(g.Value)).length;o>i;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},y.Enum=g,_=function(e,t,n,r){I.call(this,e,t,n),this.className="Enum.Value",this.id=r},_.prototype=Object.create(I.prototype),y.Enum.Value=_,b=function(e,t,n,r){I.call(this,e,t,n),this.field=r},b.prototype=Object.create(I.prototype),y.Extension=b,E=function(e,t,n,r){o.call(this,e,t,n,r),this.className="Service",this.clazz=null},(E.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var n,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),a=t.getChildren(e.Reflect.Service.RPCMethod);for(n=0;n<a.length;n++)!function(e){o[e.name]=function(n,i){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(n)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,n,r){new i(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(a[n]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),i}(e,this)},y.Service=E,v=function(e,t,n,r){I.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},(v.prototype=Object.create(I.prototype)).buildOpt=a.buildOpt,y.Service.Method=v,m=function(e,t,n,r,i,o,a,s){v.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null},m.prototype=Object.create(v.prototype),y.Service.RPCMethod=m,y}(o),o.Builder=function(e,t,n){function r(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,r(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},o=i.prototype;return i.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},i.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},i.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},i.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},i.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var r,o,a,s,u;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(r=[t];r.length>0;){if(t=r.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(o=t.shift(),i.isMessage(o)){if(a=new n.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),s={},o.oneofs&&Object.keys(o.oneofs).forEach((function(e){a.addChild(s[e]=new n.Message.OneOf(this,a,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),a.addChild(e)}),this),u=[],o.enums&&o.enums.forEach((function(e){u.push(e)})),o.messages&&o.messages.forEach((function(e){u.push(e)})),o.services&&o.services.forEach((function(e){u.push(e)})),o.extensions&&(a.extensions="number"==typeof o.extensions[0]?[o.extensions]:o.extensions),this.ptr.addChild(a),u.length>0){r.push(t),t=u,u=null,this.ptr=a,a=null;continue}u=null}else if(i.isEnum(o))a=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){a.addChild(new n.Enum.Value(this,a,e.name,e.id))}),this),this.ptr.addChild(a);else if(i.isService(o))a=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(a);else{if(!i.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(a=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){var r,i,o,s;if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions&&(r=!1,a.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)");i=t.name,this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i)),o=new n.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new n.Extension(this,this.ptr,t.name,o),o.extension=s,this.ptr.addChild(s),a.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,a=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,n){var i,o,a,s,u,l,c,d,f="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){if(i=n.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(f="\\"),o=i+f+n.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(s=!1,"object"==typeof n?(this.importRoot=n.root,s=!0,a=this.importRoot,n=n.file,(a.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(f="\\")):"string"==typeof n?this.importRoot?a=this.importRoot:n.indexOf("/")>=0?""===(a=n.replace(/\/[^\/]*$/,""))&&(a="/"):n.indexOf("\\")>=0?(a=n.replace(/\\[^\\]*$/,""),f="\\"):a=".":a=null,u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!a)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(l=t.imports[u]))continue;if(l=a+f+l,!0===this.files[l])continue;if(/\.proto$/i.test(l)&&!e.DotProto&&(l=l.replace(/\.proto$/,".json")),null===(c=e.Util.fetch(l)))throw Error("failed to import '"+l+"' in '"+n+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(c+""),l):this.import(e.DotProto.Parser.parse(c),l)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[u],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+u+"."+n}))):this.import(t.imports[u],n+"_import"+u):this.import(t.imports[u]);s&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&r(t),d=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},o.resolveAll=function(){var r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){var t,n,r;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},i.Message=function(){},i.Enum=function(){},i.Service=function(){},i}(o,o.Lang,o.Reflect),o.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,i,o,a;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(r=Object.keys(n),i=0;i<r.length;i++)o=this.keyElem.valueFromString(r[i]),a=this.valueElem.verifyValue(n[r[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:a}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){var e,t,r=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)r.push([(e=this.map[i[t]]).key,e.value]);return n(r)},i.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},i.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},i.forEach=function(e,t){var n,r,i=Object.keys(this.map);for(r=0;r<i.length;r++)e.call(t,(n=this.map[i[r]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,o.Reflect),o.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,n)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadProto(r,n,e)},o.protoFromFile=o.loadProtoFile,o.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=o.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=o.populateAccessors),new o.Builder(e)},o.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},o.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:o.loadJson(JSON.parse(r),n,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(n,t);return r}var sa=function(){function e(e,t){ta.add(this),Object.defineProperty(this,"nestedMap",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=aa(e)}return Object.defineProperty(e.prototype,"_encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=new this.pbModules[e],o="";if(t)try{Object.keys(t).forEach((function(n){var a=t[n];if(void 0!==a){var s=r.nestedMap.get("".concat(e,"_").concat(n));if(o="set".concat(function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(n,0,1)),s){var u=a instanceof Array?a.map((function(e){return r._encode(s,e,!0)})):r._encode(s,a,!0);i[o](u)}else i[o](a)}}))}catch(t){var a="name: ".concat(e,", method: ").concat(o,", stack: ").concat(t.stack);null===console||void 0===console||console.error("pb encode error!",a)}return n?i:i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.pbModules[e].decode(t);return c(this,ta,"m",na).call(this,n)}}),Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),e}();ta=new WeakSet,na=function e(t){var n,r=this;if(t instanceof Array)return t.map((function(t){return c(r,ta,"m",e).call(r,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t.buffer instanceof ArrayBuffer&&"number"==typeof t.offset&&"number"==typeof t.limit){var i=t.buffer,o=t.offset,a=t.limit;return i.slice(o,a)}if(void 0!==t.low&&void 0!==t.high&&Object.prototype.hasOwnProperty.call(t,"unsigned")){var s=t.low;return s<0&&(s+=4294967296),s=s.toString(16),parseInt(t.high.toString(16)+"00000000".replace(new RegExp("0{".concat(s.length,"}$")),s),16)}var u=t;return Object.keys(t).forEach((function(n){u[n]=c(r,ta,"m",e).call(r,t[n])})),u};var ua,la,ca,da,fa="NotifyMsg",pa="SyncRequestMsg",ha="UpStreamMessage",ga="PushExtra",_a="DownStreamMessages",ba="ChrmDownStreamMessages",Ea="DownStreamMessage",va="GetQNupTokenInput",ma="GetDownloadUrlInput",ya="GetQNupTokenOutput",Ia="GetDownloadUrlOutput",Ta="ChrmInput",Ra="ChrmOutput",Oa="ChrmPullMsg",Sa="RelationQryInput",Aa="RelationsInput",Ca="RelationsOutput",Na="QryRemindListReq",Pa="QryRemindListResp",wa="CleanHisMsgInput",Ma="CleanMsgBatchReq",La="QueryChatRoomInfoInput",Ua="QueryChatRoomInfoOutput",Da="HistoryMsgInput",Va="HistoryMsgOuput",ja="SessionsAttQryInput",Ga="SessionsAttOutput",ka="SessionMsgReadInput",Fa="DeleteSessionsInput",xa="SessionInfo",Ba="QuerySessionsInput",Ha="QuerySessionsOutPut",qa="RelationDelBatchReq",Ya="RelationOpInput",Ka="DeleteMsgInput",Wa="SetChrmKV",Qa="SetChrmKVS",Ja="ChrmKVOutput",za="ChrmKVSOutput",Xa="QueryChrmKV",Za="SetUserSettingInput",$a="SetUserSettingOutput",es="PullUserSettingInput",ts="PullUserSettingOutput",ns="SessionReq",rs="SessionStates",is="SessionStateModifyReq",os="GroupUnpushQuery",as="GroupUnpushSet",ss="GroupUnpushResult",us="SessionStateModifyResp",ls="TypeUnpushInput",cs="TypeUnpushOutput",ds="GrpReadReceiptMsg",fs="ReadReceipt",ps="QueryReceiptReq",hs="QueryReceiptBatchReq",gs="ReceiptResp",_s="QueryReceiptBatchResp",bs="GrpReadReceiptQryResp",Es="SessionTagAddInput",vs="SessionTagItem",ms="SessionTagDelInput",ys="UserSettingNotification",Is="ReportSDKInput",Ts="UltraGrpPullSes",Rs="UltraGrpPullMsg",Os="MsgChangeReq",Ss="QueryMsgChange",As="EventChangeList",Cs="MsgChangeList",Ns="MsgQuery",Ps="MsgQueryAck",ws="OperateStatus",Ms="OperateStatusNotify",Ls="SetRtcRoomIdInput",Us="CallInfoUpStream",Ds="CallInfoDownStream",Vs="KvInput",js="KvOutput",Gs="ReadReceiptMsg",Fs="ReceiptQryReq",xs="QueryReceiptResp",Bs="ReceiptCntQryReq",Hs="ReceiptCntQryResp",qs="UpdateUserSubReq",Ys="UserSubDetail",Ks="UpdateUserSubResp",Ws="PullUserSubReq",Qs="PUllUserSubResp",Js="PullSubDataReq",zs="PullSubDataResp",Xs="SubDataDetail",Zs="QrySubDataReq",$s="UserProfile",eu="ProfileInfo",tu="SetUserProfileResp",nu="PullUserProfileReq",ru="UserProfiles",iu="UserProfileInput",ou="UserProfilePermission",au="SearchUserProfile",su="ChannelsInput",uu="ChannelsOutput",lu="MultiChannels",cu="ModifyChannelsInput",du="QuitChannelsSetting",fu="ChannelsQueryInput",pu="ChannelsPageParam",hu="ChannelsListResult",gu="ChannelsInviteStatusInfos",_u="ChannelsUserInfos",bu="ChannelsJoinedInfos",Eu="ChannelsMemberUpdateInput",vu="ChannelsMemberResponseInput",mu="ChannelsMembersInput",yu="FriendInput",Iu="FriendsInput",Tu="FriendsCheckOutput",Ru="FriendProfileInput",Ou="FriendProfileOutput",Su="FriendQueryInput",Au="FriendsListInput",Cu="FriendLevelSet",Nu="FriendUserInfos",Pu="FriendInviteInfos",wu="ChannelApplyInfo",Mu="AddUnpushPeriodInput",Lu="DeleteUnpushPeriodInput",Uu="QueryUnpushPeriodInput",Du="QueryUnpushPeriodOutput",Vu="RelationDel",ju="MsgReadEvent",Gu="ConvertMsgInput",ku="SpeechToTextInfo",Fu="ConvertMsgOutput",xu="SpeechToTextResult",Bu="TransReq",Hu="TransResp",qu="PullModifyMsgReq",Yu="PullModifyMsgResp",Ku=new Map([["UpStreamMessage_pushExt","PushExtra"],["DownStreamMessages_list","DownStreamMessage"],["DownStreamMessage_pushExt","PushExtra"],["ChannelInfosOutput_channels","ChannelInfoOutput"],["GroupMembersOutput_members","MemberInfo"],["GroupInput_groupInfo","GroupInfo"],["RelationsInput_msg","DownStreamMessage"],["RelationsOutput_info","RelationInfo"],["RelationInfo_msg","DownStreamMessage"],["RelationInfo_msgInfo","UnreadMsgInfo"],["QryRemindListResp_msgInfo","UnreadMsgInfo"],["CleanMsgBatchReq_input","CleanHisMsgInput"],["HistoryMessagesOuput_list","DownStreamMessage"],["QueryChatRoomInfoOutput_userInfos","ChrmMember"],["MPFollowOutput_info","MpInfo"],["MCFollowOutput_info","MpInfo"],["SearchMpOutput_info","MpInfo"],["PullMpOutput_info","MpInfo"],["HistoryMsgOuput_list","DownStreamMessage"],["DeleteSessionsInput_sessions","SessionInfo"],["QuerySessionsInput_sessions","SessionInfo"],["QuerySessionsOutPut_sessions","SessionInfo"],["RelationDelBatchReq_relation","RelationOpInput"],["DeleteMsgInput_msgs","DeleteMsg"],["SetChrmKV_entry","ChrmKVEntity"],["SetChrmKV_notification","UpStreamMessage"],["SetChrmKVS_entry","ChrmKVEntity"],["SetChrmKVS_notification","UpStreamMessage"],["DeleteChrmKVS_entry","ChrmKVEntity"],["DeleteChrmKVS_notification","UpStreamMessage"],["ChrmKVOutput_entries","ChrmKVEntity"],["ChrmKVSOutput_errorKeys","ChrmKVSOutputEntity"],["ChrmKVSOutput_keysVersion","ChrmKVSVersionEntity"],["PullUserSettingOutput_items","UserSettingItem"],["UserSettingItem_tags","SessionTagItem"],["SessionStates_state","SessionState"],["SessionState_stateItem","SessionStateItem"],["SessionStateItem_tags","SessionTagItem"],["SessionStateModifyReq_state","SessionState"],["QueryReceiptBatchReq_items","QueryReceipt"],["ReceiptResp_resp","QueryReceiptRespItem"],["QueryReceiptBatchResp_item","QueryReceiptBatchRespItem"],["QueryReceiptBatchRespItem_msg","QueryReceiptRespItem"],["QueryReceiptRespItem_readUser","ReceiptUser"],["QueryReceiptRespItem_unreadUser","ReceiptUser"],["GrpReadReceiptQryResp_list","GrpMsgReadUser"],["SessionTagAddInput_tags","SessionTagItem"],["SessionTagDelInput_tags","SessionTagItem"],["EventChangeList_list","EventChange"],["MsgChangeList_list","MsgChange"],["MsgQuery_query","MessageQueryInfo"],["MsgQueryAck_list","DownStreamMessage"],["OperateStatusNotify_info","OperateInfo"],["OperateStatusNotify_summary","OperateSummary"],["KvOutput_info","KvInfo"],["QueryReceiptResp_list","ReceiptUser"],["ReceiptCntQryResp_result","MsgReadCnt"],["UpdateUserSubReq_subUsers","UserSubDetail"],["UpdateUserSubResp_subUsers","UserSubDetail"],["PUllUserSubResp_list","UserSubList"],["UserSubList_subUsers","UserSubDetail"],["PullSubDataResp_list","SubDataDetail"],["SubDataDetail_data","SubData"],["QrySubDataReq_subUsers","UserSubDetail"],["UserProfile_userProfile","ProfileInfo"],["UserProfile_userExtProfile","ProfileInfo"],["UserProfiles_UserProfile","UserProfile"],["ChannelsInput_settingProfile","ProfileInfo"],["ChannelsInput_extProfile","ProfileInfo"],["ChannelsInput_baseInfo","ChannelBaseInfo"],["ChannelsOutput_channelInfo","ChannelsJoinedInfo"],["ChannelsOutput_userInfos","ChannelsUserInfo"],["ChannelsOutput_friendInviteInfo","FriendInviteInfo"],["ChannelsOutput_friendUserInfo","FriendUserInfo"],["MultiChannels_list","ChannelsInput"],["ModifyChannelsInput_settingInfo","QuitChannelsSetting"],["ChannelsQueryInput_page","ChannelsPageParam"],["ChannelsListResult_page","ChannelsPageParam"],["ChannelsInviteStatusInfos_list","ChannelsInviteStatusInfo"],["ChannelsUserInfos_list","ChannelsUserInfo"],["ChannelsJoinedInfos_list","ChannelsJoinedInfo"],["ChannelsUserInfo_ext","ChannelsUserExtInfo"],["ChannelsJoinedInfo_settingProfile","ProfileInfo"],["ChannelsJoinedInfo_extProfile","ProfileInfo"],["ChannelsJoinedInfo_baseInfo","ChannelBaseInfo"],["ChannelsJoinedInfo_userInfo","ChannelsUserExtInfo"],["ChannelsInviteStatusInfo_joinUserInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_inviterInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_processInfo","ChannelsUserInfo"],["FriendsOutput_list","FriendOutput"],["FriendsCheckOutput_list","FriendCheckOutput"],["FriendProfileInput_extProfile","ProfileInfo"],["FriendQueryInput_page","ChannelsPageParam"],["FriendUserInfo_extProfile","ProfileInfo"],["FriendUserInfos_list","FriendUserInfo"],["FriendInviteInfos_list","FriendInviteInfo"],["UpdateChannnelInfo_channelInfo","ChannelsJoinedInfo"],["UpdateChannnelInfo_userInfo","ChannelsUserInfo"],["UpdateUserInfo_updatedUserInfo","ChannelsUserInfo"],["UpdateUserInfo_optUserInfo","ChannelsUserInfo"],["ChannelApplyInfo_statusInfo","ChannelsInviteStatusInfo"],["ChannelEventData_optUserInfo","ChannelsUserInfo"],["ChannelEventData_channelInfo","ChannelsJoinedInfo"],["ChannelEventData_userInfos","ChannelsUserInfo"],["ChannelEventData_channelFullInfo","ChannelsJoinedInfo"],["FriendUpdateEvent_extProfile","ProfileInfo"],["MsgReadEvent_readList","ReceiptUser"],["TransReq_transInfos","TransInfo"],["TransResp_results","TransResult"],["PullModifyMsgResp_msg","ModifyMsg"],["ModifyMsg_msg","DownStreamMessage"]]);!function(e){e[e.PERSON=1]="PERSON",e[e.PERSONS=2]="PERSONS",e[e.GROUP=3]="GROUP",e[e.TEMPGROUP=4]="TEMPGROUP",e[e.CUSTOMERSERVICE=5]="CUSTOMERSERVICE",e[e.NOTIFY=6]="NOTIFY",e[e.MC=7]="MC",e[e.MP=8]="MP",e[e.ULTRAGROUP=10]="ULTRAGROUP"}(ua||(ua={})),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"}(la||(la={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(ca||(ca={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(da||(da={}));var Wu,Qu,Ju,zu,Xu,Zu,$u,el,tl,nl=new sa("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message ChrmDownStreamMessages {\n repeated bytes list = 1;\n required int64 syncTime = 2;\n optional bool compressioEnabled = 3;\n optional bytes compressedData = 4;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n optional string convertExt = 24;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsInput {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n optional bool ignoreVersion = 3;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n optional bool updateVersion = 3;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n optional int64 time = 4;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n AutoTrans = 4;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n optional bool ignoreVersion = 3;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n optional bool updateVersion = 2;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n optional bool ignoreVersion = 4;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n optional bool updateVersion = 2;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message ReadReceipt {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string channelId = 3;\n optional int32 readType =4 ;\n repeated string msgIds= 5 ;\n optional string fromId = 6;\n }\n message QueryReceiptReq {\n optional string targetId = 1;\n optional string busChannel =2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n optional int32 qryType = 5;\n optional int32 order =6;\n optional bool compress = 7;\n optional int32 readType = 8;\n optional int32 pageType = 9; \n optional int32 pageSize = 10;\n optional string pageToken = 11;\n repeated string users = 12;\n }\n message QueryReceiptBatchReq {\n repeated QueryReceipt items = 1;\n optional bool compress = 2;\n }\n message QueryReceipt {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n }\n message ReceiptResp {\n repeated QueryReceiptRespItem resp = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n optional string pageToken = 4;\n }\n message QueryReceiptBatchResp {\n repeated QueryReceiptBatchRespItem item = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n }\n\n message QueryReceiptBatchRespItem {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated QueryReceiptRespItem msg = 4;\n }\n message QueryReceiptRespItem {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int64 readCnt = 4;\n repeated ReceiptUser readUser = 5;\n repeated string unreadList = 6;\n optional int64 unreadCnt = 7;\n repeated ReceiptUser unreadUser = 8;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n repeated string notExistMsgId = 2;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n optional int64 receiptTime = 1;\n optional string userId = 2;\n optional string name = 3;\n optional string portrait = 4;\n optional bool mentioned= 5;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n message RelationDel {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string busChannel = 3;\n optional bool cleanMsg = 4;\n }\n message MsgReadEvent {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int32 readCnt = 4;\n optional int32 unreadCnt = 5;\n repeated ReceiptUser readList =6;\n }\n message ConvertMsgInput {\n optional int32 businessType = 1;\n optional bytes businessInfo = 2;\n }\n message SpeechToTextInfo {\n optional string msgId = 1;\n optional string objectName = 2;\n optional string content = 3;\n optional int32 sampleRate = 4;\n optional int32 channelNumber = 5;\n optional string format = 6;\n optional string extra = 7;\n }\n message ConvertMsgOutput {\n optional int32 businessType = 1;\n optional bytes businessResult = 2;\n }\n message SpeechToTextResult {\n optional string result = 1;\n optional string message = 2;\n }\n message TransReq {\n repeated TransInfo transInfos = 1;\n optional int32 model = 2;\n optional bool forceTrans = 3;\n }\n message TransResp {\n repeated TransResult results = 1;\n optional int32 model = 2;\n }\n message TransInfo {\n optional string messageUID = 1;\n optional int32 transType = 2;\n optional string text = 3;\n optional string transFileUrl = 4;\n optional string sourceLan = 5;\n optional string targetLan = 6;\n optional int32 inputSource = 7;\n }\n message TransResult {\n optional string messageUID = 1;\n optional string transResult = 2;\n optional string sourceLan = 3;\n optional string targetLan = 4;\n optional int32 code = 5;\n optional int32 inputSource = 6;\n }\n message PullModifyMsgReq\n { \n optional int64 pullVersion = 1;\n optional bool compress = 2;\n }\n message PullModifyMsgResp\n {\n repeated ModifyMsg msg = 1;\n optional int64 nextVersion = 2;\n optional bool finished = 3;\n optional bool compress = 4;\n optional bytes compressedData = 5;\n }\n message ModifyMsg\n {\n optional int32 modifyType = 1;\n optional DownStreamMessage msg = 2;\n }\n}\n",Ku);!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(Wu||(Wu={})),function(e){e.IM="IM",e.RTC="RTC"}(Qu||(Qu={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(Ju||(Ju={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(zu||(zu={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Xu||(Xu={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Zu||(Zu={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}($u||($u={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(el||(el={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(tl||(tl={}));var rl=null;function il(e,t,n,r){void 0===n&&(n={});var i=["error","warn","info","debug"][3-e];if(rl&&e<Wu.FATAL)try{var o=JSON.stringify(n);rl[i](t,o)}catch(e){console.error(e)}}var ol=il.bind(null,Wu.DEBUG),al={init:function(e){rl=e},info:il.bind(null,Wu.INFO),debug:ol,warn:il.bind(null,Wu.WARN),error:il.bind(null,Wu.ERROR),fatal:il.bind(null,Wu.FATAL)},sl=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var i=r.length-1;i>=0;i-=1){var o=r[i],a=o.target,s=o.once,c=o.listener;s&&r.splice(i,1);try{c.call.apply(c,l([a],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._map[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}),e}(),ul=function(e,t,n){var r=null==n?void 0:n.isReverse;It(e)&&function(){for(var n in e)t(e[n],n,e)}(),(Et(e)||ht(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},ll=function(e,t){return ul(e,(function(n,r){e[r]=t(n,r)})),e},cl=function(e){return"[object Null]"===Object.prototype.toString.call(e)};var dl,fl,pl=function(e){return 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).byteLength},hl=function(){function e(e,t,n){Object.defineProperty(this,"pbmaps",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=aa(t)}return Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var n=t[e];void 0!==n&&r["set".concat(function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(e,0,1))](n)}))}catch(t){var i="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(H.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(H.L_PB_ENCODE_E,i)}return n?r:r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.pbModules[e].decode(t);return this.fixInt64Values(n)}}),Object.defineProperty(e.prototype,"fixInt64Values",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!It(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var n=e.low;return n<0&&(n+=4294967296),n=n.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(n.length,"}$")),n),16)}for(var r in e)e[r]=this.fixInt64Values(e[r]);return e}}),e}();!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(fl||(fl={}));var gl,_l,bl,El,vl,ml,yl,Il,Tl,Rl,Ol,Sl=((dl={})[fl.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],dl[fl.RtcUserListOutput]=["users","token","sessionId","roomInfo"],dl[fl.SetUserStatusInput]=["status"],dl[fl.RtcSetDataInput]=["interior","target","key","value","objectName","content"],dl[fl.RtcUserSetDataInput]=["valueInfo","objectName","content"],dl[fl.RtcDataInput]=["interior","target","key","objectName","content"],dl[fl.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],dl[fl.MCFollowInput]=["state"],dl[fl.RtcTokenOutput]=["rtcToken"],dl[fl.RtcQryOutput]=["outInfo"],dl[fl.RtcQryUserOutDataInput]=["userId"],dl[fl.RtcUserOutDataOutput]=["user"],dl[fl.RtcQueryListInput]=["order"],dl[fl.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],dl[fl.RtcValueInfo]=["key","value"],dl[fl.RtcKeyDeleteInput]=["key"],dl[fl.RtcNotifyMsg]=["type","time","roomId"],dl[fl.RtcPullKV]=["timestamp","roomId"],dl[fl.RtcKVOutput]=["entries","bFullUpdate","syncTime"],dl[fl.RtcQueryUserJoinedInput]=["userId"],dl[fl.RtcQueryUserJoinedOutput]=["info"],dl[fl.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],dl[fl.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],dl[fl.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],dl[fl.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],dl),Al="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(fl.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(fl.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(fl.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(fl.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(fl.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(fl.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(fl.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间 key value\n repeated RtcKVEntity entries = 5;//直播 KV 属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取 KV 时用)。\n optional int32 offlineKickTime = 7;//server 超时踢人时间,默认 60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(fl.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(fl.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(fl.RtcValueInfo," innerDatas = 7; //用户内部 inner 数据,角色或者连麦信息等\n repeated ").concat(fl.RtcValueInfo," outerDatas = 8; //用户内部 outer 数据,自定义数据结构 RtcInput。\n }\n message ").concat(fl.RtcQryOutput,"{\n repeated ").concat(fl.RtcValueInfo," outInfo=1;\n }\n message ").concat(fl.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(fl.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(fl.RtcUserSetDataInput," {\n repeated ").concat(fl.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(fl.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(fl.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(fl.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(fl.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(fl.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(fl.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(fl.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc 房间状态 KV 变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间 id\n }\n message ").concat(fl.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(fl.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1 为主播变观众\n ViewerToAnchor = 2; //2 为观众变主播\n }\n message ").concat(fl.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备 ID\n required string roomId = 2; //加入的房间 ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(fl.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(fl.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV 属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取 KV 时用)。\n }\n message ").concat(fl.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n optional int32 timeoutTime=2; //邀请超时时间 (秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId= 5; //客户端保证唯一性 (建议 roomid_userid_时间戳_随机数)\n }\n message ").concat(fl.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId=4; //邀请的 sessionId,客户端发起邀请时产生\n }\n message ").concat(fl.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的 uid\n required int32 answerCode=2; //是否接受连麦邀请.0 为拒绝,1 为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的 sessionId\n required string content=5; //需要转发的 content\n optional string key=6; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n }\n message ").concat(fl.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的 sessionId\n required string inviteContent=3; //结束连麦的信息 (需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的 key\n }\n}\n"),Cl=function(e,t,n,r,i,o){var a=i?Object.keys(i).map((function(t){return e.encode(fl.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,s=o?Object.keys(o).map((function(t){return e.encode(fl.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(fl.RtcInput,{roomType:t,broadcastType:n,joinType:r,innerDatas:a,outerDatas:s})},Nl=function(e,t){var n=e.decode(fl.RtcUserListOutput,t),r=n.users,i=n.token,o=n.sessionId,a=n.roomInfo,s=n.entries,u=n.offlineKickTime,l={};return ul(r,(function(e){var t=e.userId,n=e.userData,r={};ul(n,(function(e){var t=e.key,n=e.value;r[t]=n})),l[t]=r})),{users:l,token:i,sessionId:o,roomInfo:a,kvEntries:s,offlineKickTime:u}},Pl=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pullTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS?(this._isPulling=!1,this._pullTime=s||0,this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._pullTime=0,this._isPulling=!1}}),e}(),wl=function(){function e(e,t,n,r){Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcKVManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcSignalingListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._appkey=this._options.appkey,this._rtcKVManager=new Pl(this)}return Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcSignalingListener=e}}),Object.defineProperty(e.prototype,"getInnerLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger}}),Object.defineProperty(e.prototype,"pullRTCRoomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=this.rtcCodec.encode(fl.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,li,!0,t)];case 1:return n=a.sent(),i=n.code,o=n.buffer,i!==x.SUCCESS?[2,{code:i}]:(s=this.rtcCodec.decode(fl.RtcKVOutput,o),u=s.entries,l=s.syncTime,u=(u||[]).map((function(e){return r(r({},e),{timestamp:Dt(e.timestamp)})})),this._watcher.onRTCDataChange(u,e),[2,{code:i,data:l}])}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(fl.RtcNotifyMsg,e),n=t.time,r=t.type,i=t.roomId;1===r&&this._rtcKVManager.pullEntry(i,Dt(n))}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();!function(e){e.INIT="INIT",e.DATA="DATA",e.END="END"}(gl||(gl={}));var Ml=function(e){function n(t,n){var r=e.call(this)||this;return _l.add(r),bl.set(r,void 0),El.set(r,new Map),vl.set(r,void 0),d(r,bl,t,"f"),d(r,vl,n,"f"),r}return t(n,e),Object.defineProperty(n.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=c(this,_l,"a",ml).createTraceId(),c(this,_l,"a",ml).info(H.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,In.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,bl,"f").validateConnected).tryTrans((function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===n?void 0:n.length)?mn(e.streamServer.addrs):yn(x.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(r,_l,"m",Ol).call(r,e,t)}))];case 1:return n=i.sent(),c(this,_l,"a",ml).summary(H.L_REQ_STREAM_MSG_CONTENT_R,n,t,{messageUId:e}),[2,n.wipe()]}}))}))}}),n}(hn);bl=new WeakMap,El=new WeakMap,vl=new WeakMap,_l=new WeakSet,ml=function(){return c(this,bl,"f").logger},yl=function(e,t,n){var r=c(this,El,"f").get(e);r&&(c(this,El,"f").delete(e),c(this,_l,"m",Il).call(this,e,gl.END,t,r.msg))},Il=function(e,t,n,r,i){this.emit("message",{code:n,messageUId:e,type:t,chunk:i,message:r})},Tl=function(e,t){e.content=r(r({},e.content),t),c(this,bl,"f").setMessageContent(e.messageId,e.content,e.messageType)},Rl=function(e,t,n){var r,i,o=c(this,El,"f").get(t);switch(e){case"init":o.msg&&c(this,_l,"m",Tl).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,_l,"m",Il).call(this,t,gl.INIT,x.SUCCESS,o.msg);break;case"complete":i=(r=n.length?JSON.parse(n):{}).complete||!1,o.msg&&c(this,_l,"m",Tl).call(this,o.msg,{stopReason:r.stopReason||0,completeReason:r.completeReason||0,complete:i,isSynced:i}),c(this,_l,"m",yl).call(this,t,r.stopReason||0,i);break;default:r=JSON.parse(n),o.cached+=r.content,o.msg&&c(this,_l,"m",Tl).call(this,o.msg,{content:o.cached}),c(this,_l,"m",Il).call(this,t,gl.DATA,x.SUCCESS,o.msg,{content:r.content,fullContent:o.cached})}},Ol=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return c(this,El,"f").has(e)?[2,yn(x.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,El,"f").size>=3?[2,yn(x.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(n=oa.createSSEClient({logger:c(this,_l,"a",ml),msgUId:e,appkey:c(this,bl,"f").appkey,token:c(this,bl,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var n=t.indexOf("\n"),r=t.slice(0,n).replace("event:",""),i=t.slice(n+1+5);c(d,_l,"m",Rl).call(d,r,e,i.trim())}}))},onNetworkError:function(t){c(d,_l,"m",yl).call(d,e,t,!1)}}),n.isOk?(r=n.data,i={client:r,cached:"",msg:void 0},c(this,El,"f").set(e,i),c(this,vl,"f")?[4,c(this,bl,"f").getLocalMessage(e)]:[3,2]):[2,n.wipe()]);case 1:if(o=a.sent(),s=o.code,!(u=o.data))return c(this,El,"f").delete(e),[2,yn(s,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,El,"f").delete(e),[2,yn(x.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,a.label=2;case 2:return[4,r.open(t.slice())];case 3:return(l=a.sent()).isOk||c(this,El,"f").delete(e),[2,l.wipe()]}}))}))};var Ll,Ul,Dl=function(){function e(e){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"__getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"createCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new hl(e,t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new sa(e,t)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"getCoreVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.24.1-c-dq.1"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.24.1-c-dq.1"}}),Object.defineProperty(e.prototype,"getAppkey",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.appkey}}),Object.defineProperty(e.prototype,"getCurrentId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getUserToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.token}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getConnectionStatus()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.setPushConfig(e)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.sendMessage(e,t,n)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.setCallInfo(e,t,n)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),Vl=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return o=Cl(this._context.rtcCodec,t,n,r,i,s),[4,this.rtcSignaling(e,Qr,!0,o)];case 1:return u=a.sent(),l=u.code,c=u.buffer,l===x.SUCCESS&&c&&(d=Nl(this._context.rtcCodec,c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(n.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(fl.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Jr,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._context.rtcPing(e,t,n)}}),Object.defineProperty(n.prototype,"getRTCRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(fl.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,zr,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i&&(o=this._context.rtcCodec.decode(fl.RtcRoomInfoOutput,i)),[2,{code:r,data:o}]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(fl.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Xr,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i&&(s=Nl(this._context.rtcCodec,i),o={users:s.users}),[2,{code:r,data:o}]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(n.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(fl.RtcValueInfo,{key:t,value:n}),[4,this.rtcSignaling(e,Zr,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(fl.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,$r,!1,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=this._context.rtcCodec.encode(fl.RtcSetDataInput,{interior:r,target:i,key:t,value:n,objectName:null==s?void 0:s.name,content:null==s?void 0:s.content}),[4,this.rtcSignaling(e,ei,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return o={objectName:r,content:this._context.rtcCodec.encode(fl.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(fl.RtcValueInfo,{key:"uris",value:n},!0),this._context.rtcCodec.encode(fl.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},s=this._context.rtcCodec.encode(fl.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,ti,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(fl.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(fl.RtcValueInfo,{key:"cdn_uris",value:n},!0)}),[4,this.rtcSignaling(e,ti,!0,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this._context.rtcCodec.encode(fl.RtcDataInput,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,ni,!0,i)];case 1:return o=a.sent(),s=o.code,u=o.buffer,s===x.SUCCESS&&u?(l=this._context.rtcCodec.decode(fl.RtcQryOutput,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))}}),Object.defineProperty(n.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=this._context.rtcCodec.encode(fl.RtcDataInput,{interior:n,target:r,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,ri,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(n.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=Cl(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,ii,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=this._context.rtcCodec.decode(fl.RtcTokenOutput,s).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(fl.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,oi,!0,n)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(fl.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,ai,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=Nl(this._context.rtcCodec,i),[2,{code:r,data:o}]):[2,{code:r}]}}))}))}}),Object.defineProperty(n.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return r=Cl(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,si,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=this._context.rtcCodec.decode(fl.RtcViewerJoinedOutput,s),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(fl.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,ui,!0,t)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=this._context.rtcCodec.encode(fl.RtcInput,{roomType:zu.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,ci,!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===x.SUCCESS&&s?(u=Nl(this._context.rtcCodec,s),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(n.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,u=this._context.rtcCodec.encode(fl.RtcInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,di,!0,u)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=this._context.rtcCodec.encode(fl.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:i}),[4,this.rtcSignaling(o,fi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,o=e.key,s=e.value,u=e.agree,l=e.roomId,c=this._context.rtcCodec.encode(fl.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:i,key:o,value:s,answerCode:u?1:0}),[4,this.rtcSignaling(l,pi,!0,c)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,o=e.roomId,s=this._context.rtcCodec.encode(fl.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:i}),[4,this.rtcSignaling(o,hi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(n.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(n.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._context.rtcSignaling(e,t,n,r)}}),Object.defineProperty(n.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(fl.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",gi,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===x.SUCCESS&&i?(o=this._context.rtcCodec.decode(fl.RtcQueryUserJoinedOutput,i).info||[],[2,{code:r,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:r}]}}))}))}}),n}(Dl),jl={"set.proxy":x.INVALID_PARAMETER_PROXY,"test.proxy":x.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":x.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":x.INVALID_PARAMETER_TESTHOST,channelId:x.INVALID_PARAMETER_CHANNEL_ID,count:x.INVALID_PARAMETER_COUNT,startTime:x.INVALID_PARAMETER_START_TIME,endTime:x.INVALID_PARAMETER_END_TIME,offset:x.INVALID_PARAMETER_OFFSET,limit:x.INVALID_PARAMETER_LIMIT,keyword:x.INVALID_PARAMETER_KEYWORD,messageTypes:x.INVALID_PARAMETER_MESSAGE_TYPE,messageType:x.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:x.INVALID_PARAMETER_MESSAGE_TYPE,conversation:x.INVALID_PARAMETER_CONVERSATION,conversationType:x.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:x.INVALID_PARAMETER_TARGET_ID,targetIds:x.INVALID_PARAMETER_TARGET_ID,userId:x.INVALID_PARAMETER_USER_ID,senderUserId:x.INVALID_PARAMETER_USER_ID,timestamp:x.INVALID_PARAMETER_TIMESTAMP,order:x.INVALID_PARAMETER_ORDER,messageId:x.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:x.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:x.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:x.INVALID_PARAMETER_SENT_STATUS,content:x.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:x.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:x.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:x.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:x.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:x.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:x.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:x.MSG_LIMIT_ERROR,checkDuplicate:x.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:x.INVALID_PARAMETER_MESSAGE_UID,key:x.INVALID_PARAMETER_KEY,keys:x.INVALID_PARAMETER_KEYS,value:x.INVALID_PARAMETER_VALUE,isAutoDelete:x.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:x.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:x.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:x.INVALID_PARAMETER_ENTRIES,isForce:x.INVALID_PARAMETER_IS_FORCE,rtcRoomId:x.INVALID_PARAMETER_RTCROOMID,token:x.RC_CONN_TOKEN_INCORRECT,conversations:x.INVALID_PARAMETER_CONVERSATIONS,draft:x.INVALID_PARAMETER_DRAFT,conversationTypes:x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:x.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:x.INVALID_PARAMETER_IS_TOP,isUpdateTime:x.INVALID_PARAMETER_IS_UPDATE_TIME,message:x.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:x.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:x.INVALID_PARAMETER_USERIDLIST,directedUserIds:x.INVALID_PARAMETER_USERIDLIST,isStatusMessage:x.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:x.INVALID_PARAMETER_PUSH_CONTENT,pushData:x.INVALID_PARAMETER_PUSH_DATA,isMentioned:x.INVALID_PARAMETER_IS_MENTIONED,mentionedType:x.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:x.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:x.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:x.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:x.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:x.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:x.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:x.SEARCH_PROPS_LIMIT_ERROR,tagId:x.INVALID_PARAMETER_TAG_ID,tagIds:x.INVALID_PARAMETER_TAG_ID,tagName:x.INVALID_PARAMETER_TAG_NAME,containMuted:x.INVALID_PARAMETER_CONTAIN_MUTED,channelType:x.INVALID_PARAMETER_CHANNEL_TYPE,file:x.MEDIA_EXCEPTION,fileType:x.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:x.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:x.INVALID_PARAMETER_MEDIA_URL,filename:x.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:x.INVALID_PARAMETER_SAVE_NAME,serverType:x.INVALID_PARAMETER_SERVER_TYPE,subscribeType:x.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:x.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:x.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:x.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:x.INVALID_PARAMETER_BEFORE,afterCount:x.INVALID_PARAMETER_AFTER,conversationList:x.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:x.CONVERSATION_TYPE_NOT_SUPPORT,profile:x.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:x.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:x.INVALID_PARAMETER_UNIQUE_ID,extra:x.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:x.INVALID_DISABLE_UPDATE_LAST_MESSAGE};!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID",e[e.CONVERSATION=8]="CONVERSATION",e[e.CONVERSATION_TYPE=9]="CONVERSATION_TYPE"}(Ul||(Ul={}));var Gl,kl=((Ll={})[Ul.STRING]=mt,Ll[Ul.ONLY_STRING]=ht,Ll[Ul.NUMBER]=_t,Ll[Ul.BOOLEAN]=function(e){return"boolean"==typeof e},Ll[Ul.OBJECT]=It,Ll[Ul.ARRAY]=Et,Ll[Ul.CALLBACK]=function(e){var t=!0;return It(e)||(t=!1),(e=e||{}).onSuccess&&!Tt(e.onSuccess)&&(t=!1),e.onError&&!Tt(e.onError)&&(t=!1),t},Ll[Ul.CHANNEL_ID]=Nt,Ll[Ul.CONVERSATION]=function(e){var t=!0;return It(e)||(t=!1),ht(e.targetId)||(t=!1),At(e.conversationType)||(t=!1),Rt(e.channelId)||Nt(e.channelId)||(t=!1),t},Ll[Ul.CONVERSATION_TYPE]=At,Ll),Fl=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return t(n,e),n}(Error),xl=function(e,t,n,r){if(void 0===r&&(r=!1),!Bl(e,t,n,r))throw new Fl("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},Bl=function(e,t,n,r){void 0===r&&(r=!1),n=kl[n]||n;var i=r?n(t):Rt(t)||null==t||n(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},Hl=function(){function e(e,t){var n,r;Object.defineProperty(this,"_logTagT",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logTagR",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"verificationFaileList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"context",{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,"option",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.context=F_.getContext(),this.logger=null===(n=this.context)||void 0===n?void 0:n.logger,this.option=null===(r=this.context)||void 0===r?void 0:r.getOptions()}return Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){if(void 0===r&&(r=!1),this.verificationFaileList.length>0)return this;n=kl[n]||n;var o=r?n(t):Rt(t)||null==t||n(t);if("object"==typeof o){var a=o.valid,s=o.errorKey;return!a&&s&&this.verificationFaileList.push({key:s,value:t,isValid:!1,message:i,code:jl[s]}),this}return o||this.verificationFaileList.push({key:e,value:t,isValid:o,message:i,code:jl[e]}),this}}),Object.defineProperty(e.prototype,"validateParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){if(void 0===i&&(i=!1),this.verificationFaileList.length>0)return this;n=kl[n]||n;var a=i?n(t):Rt(t)||null==t||n(t);if("object"==typeof a){var s=a.valid,u=a.errorKey,l=a.errorCode;return!s&&u&&this.verificationFaileList.push({key:u,value:t,code:l||r,message:o,isValid:!1}),this}return a||this.verificationFaileList.push({key:e,value:t,code:r,message:o,isValid:!1}),this}}),Object.defineProperty(e.prototype,"_getValidationResult",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]}}),Object.defineProperty(e.prototype,"ifReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return Promise.resolve({code:x.BIZ_ERROR_CLIENT_NOT_INIT});var n=this._getValidationResult();if(n){var r=n.code,i=n.value,o=n.message,a=n.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:r})),Promise.resolve({code:r,msg:"'".concat(a,"' is invalid: ").concat(o||JSON.stringify(i))})}var s=this.logger.createTraceId();return e(this.context,this.logger,this.option,s)}}),Object.defineProperty(e.prototype,"try2do",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)}}),Object.defineProperty(e.prototype,"ifReadySync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return{code:x.BIZ_ERROR_CLIENT_NOT_INIT};var n=this._getValidationResult();if(!n)return e(this.context,this.logger,this.option);var r=n.code,i=n.value,o=n.message,a=n.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:r})),{code:r,msg:"'".concat(a,"' is invalid: ").concat(o||i)}}}),e}(),ql=function(e){return function(t){if(!Et(t)||void 0!==e.minLength&&t.length<e.minLength||void 0!==e.maxLength&&t.length>e.maxLength)return!1;if(!e.itemValidator)return!0;var n=!0;return t.every((function(t){var r=e.itemValidator&&e.itemValidator(t);return"object"==typeof r?r.errorKey?(n={errorKey:r.errorKey,valid:r.valid},!1):(n=r.valid,r.valid):(n=!!r,r)})),n}},Yl=function(e,t){var n;return It(e)?(t&&!t.includes(e.conversationType)&&(n="conversationTypeNotSupport"),wt(e.targetId)||(n="targetId"),At(e.conversationType)||(n="conversationType"),Rt(e.channelId)||Nt(e.channelId)||(n="channelId"),Rt(n)?{valid:!0}:{valid:Rt(n),errorKey:n}):{valid:!1,errorKey:"conversation"}},Kl=function(e,t){var n=Ir(e).searchProps;return n&&0!==n.length?n.every((function(e){return void 0!==t[e]}))?mn():yn(x.SEARCH_PROPS_LIMIT_ERROR):mn()},Wl=function(e,t,n){return Ql(In.create(e),t,n)},Ql=function(e,t,n){return e.result().isOk&&e.isObject("conversatino",t,!0).fail(x.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return ee(t.conversationType,n)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,wt,!0).fail(x.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,Nt).fail(x.INVALID_PARAMETER_CHANNEL_ID),e},Jl=function(){return Gl||(Gl={set:function(e,t){oa.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(oa.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return oa.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in oa.localStorage)e.push(t);return e}}),Gl},zl=function(){function e(e){Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),e&&(this._caches=e)}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._caches[e]=t}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get(e);return delete this._caches[e],t}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._caches[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=[];for(var t in this._caches)e.push(t);return e}}),e}(),Xl=function(){function e(e){var t;Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rootStorage=Jl();var n=this._rootStorage.get(e)||{};this._cache=new zl(((t={})[e]=n,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._get();n[e]=t,this._set(n)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),Zl="",$l=function(){var e="";if(Zl)return Zl;if("browser"===oa.tag)return ft;var t="RCDeviceId",n=Jl(),r=n.get(t);return r?e=r:(e=dt.genWithLen(22),n.set(t,e)),e},ec=function(){return dt.gen()},tc=function(){return dt.genWithLen(22)},nc="",rc=function(){return nc},ic=function(e,t,n,r,i){var o=0;return e&&(o|=16),t&&(o|=32),n&&(o|=64),r&&(o|=512),i&&(o|=1024),o},oc=function(e){var t;try{t=JSON.parse(e)}catch(n){t=e}if(t.user){var n=t.user,r=n.portrait,i=n.portraitUri,o=r||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},ac=function(e){var t={};try{var n=JSON.parse(e);Object.entries(n).forEach((function(e){var n=u(e,2),r=n[0],i=n[1];t[r]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},sc=function(e,t,n,r){var i,o,a=nl.decode(ha,e.pbData),s=Kr(e.topic);if(s===xr.recallMsg){var u=JSON.parse(a.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[xr.ppMsgP]=B.PRIVATE,t[xr.pgMsgP]=B.GROUP,t[xr.chatMsg]=B.CHATROOM,t[xr.ugMsg]=B.ULTRA_GROUP,t[xr.pcMsgP]=B.CUSTOMER_SERVICE,t[xr.pbMsgP]=B.SYSTEM,t)[e]||B.PRIVATE}(s),o=e.targetId;var l=[B.GROUP,B.CHATROOM,B.RTC_ROOM,B.ULTRA_GROUP].includes(i)?o:void 0,c=lc(a.sessionId),d=c.isPersited,f=c.isCounted,p=c.isMentioned,h=c.disableNotification,g=c.canIncludeExpansion;return{fromUserId:t,type:i,groupId:l,classname:a.classname,content:a.content,dataTime:n,status:ic(d,f,p,h,g),msgId:r,direction:be.SEND,clientUniqueId:a.clientUniqueId,extraContent:a.extraContent,pushContent:a.pushText,configFlag:a.configFlag,pushExt:a.pushExt,busChannel:a.busChannel,toUserIds:a.toUserIds,optionBits:a.optionBits}},uc=function(e,t,n,r){var i=e.type;r||(r=[B.GROUP,B.CHATROOM,B.RTC_ROOM,B.ULTRA_GROUP].includes(i)?e.groupId:e.fromUserId);var o,a,s,u={isPersited:!!(16&(o=e.status)),isCounted:!!(32&o),isMentioned:!!(64&o),disableNotification:!!(512&o),receivedStatus:2&o?Te.RETRIEVED:Te.UNREAD,canIncludeExpansion:!!(1024&o)},l=u.isMentioned,c=u.disableNotification,d=u.receivedStatus,f=u.canIncludeExpansion,p=e.direction===be.SEND?be.SEND:be.RECEIVE,h=tn(e.configFlag||0,e.pushContent,e.pushExt),g=(a=e.extStatus,{isInterrupt:!!(2&(s=a||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s)}),_=g.isInterrupt,b=g.isModifyMessage,E=g.isPrivateChannel,v=Ir(e.classname),m=v.isStatusMessage,y=v.isCounted,I=v.isPersited;return{conversationType:i,targetId:r,senderUserId:p===be.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:I,isCounted:y,isMentioned:l,sentTime:e.dataTime,messageDirection:p,receivedTime:Date.now(),disableNotification:c,receivedStatus:d,receivedStatusInfo:jt(d),canIncludeExpansion:f,content:oc(e.content),expansion:e.extraContent?ac(e.extraContent):null,pushConfig:h,channelId:e.busChannel||"",isInterrupt:_,isModifyMessage:b,messageId:e.clientUniqueId||0,sentStatus:se.SENT,isOffLineMessage:e.dataTime<n,channelType:E?te.PRIVATE:te.PUBLIC,isStatusMessage:m||!1,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:cc(e.convertExt)}},lc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},cc=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:qn}}catch(t){console.error("parse message modify info error: ".concat(e),t)}};function dc(e){return 1&~((null==e?void 0:e.sessionMode)||0)?yn(x.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):mn()}var fc=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),pc=48,hc=64,gc=80,_c=96,bc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ec=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var i=[],o=[],a=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=mc(e.length),n=String.fromCharCode(gc|t.length);i.push(n+t)}else{var r=String.fromCharCode(_c|e.length);i.push(r)}i.push(e)}},s=0;s<e.length;){var u=vc(t,e,s);if(u.length<2)o.push(e.charAt(s++));else if(u.length<4)o.push(e.substr(s,u.length)),s+=u.length;else{var l=mc(s-u.offset),c=mc(u.length);if(l.length+c.length>=u.length)o.push(e.substr(s,u.length)),s+=u.length;else{a();var d=String.fromCharCode(hc|l.length<<2|c.length);i.push(d+l+c),s+=u.length}}}a();var f=mc(e.length),p=String.fromCharCode(pc|f.length);return i.push(p+f),i.join("")},vc=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var o=t.length-n,a=0,s=i.length;a<s;a++){var u=i[a],l=n-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,f=d;f<c&&t.charAt(u+f)===t.charAt(n+f);f++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},mc=function(e){var t=[],n=0;do{n=e%62,t.push(bc.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},yc={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},Ic=function(){function e(e,t,n){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kvCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._chatroomId=t,this._currentUserId=n}return Object.defineProperty(e.prototype,"_add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e}}),Object.defineProperty(e.prototype,"_remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)}}),Object.defineProperty(e.prototype,"_setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.key,r=e.type,i=e.isOverwrite,o=e.userId,a=this._getSetUserId(n),s=r===D.DELETE,u=a===o,l=!this._isExisted(n),c=s?this._remove:this._add;(t||i||u||l)&&c.call(this,e)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version}}),Object.defineProperty(e.prototype,"getAllValue",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e}}),Object.defineProperty(e.prototype,"_getSetUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(this._kvCaches[e]||{}).userId}}),Object.defineProperty(e.prototype,"_isExisted",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r}}),Object.defineProperty(e.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)}))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._kvCaches={}}}),e}(),Tc=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storeCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,n=e.timestamp,(r=yc.get(t))>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,this._isPulling=!1,o===x.SUCCESS?(yc.set(t,s.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){yc.clear(e);var t=this._storeCaches[e];null==t||t.clear()}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"setLocal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._storeCaches[e];St(r)||(r=new Ic(this._engine.getInnerLogger(),e,n)),r.setEntries(t),this._storeCaches[e]=r}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null}}),Object.defineProperty(e.prototype,"getAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n}}),e}(),Rc=function(){function e(e){Object.defineProperty(this,"_canJoinMulipleChrm",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_joinedChrmsInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){void 0===t&&(t=10),void 0===n&&(n=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:n}}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._joinedChrmsInfo[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._joinedChrmsInfo={}}}),e}(),Oc={};function Sc(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:1,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Xn.getMiniCmpUrlList().join(",")}}var Ac=function(e){function n(t,n,r,i,o){void 0===i&&(i="default");var a=e.call(this,t,n,r,oa.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),oa.useNavi,o)||this;return a._environment=i,a}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(n),"&callBack=x&v=").concat(Be,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(oa.tag),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o),r),[4,oa.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!oa.useNavi&&i?[2,mn(Sc())]:[2,yn(this.transHttpCode(s.status))];try{return 0===(u=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(o)?"https":"http",l.code&&200!==l.code?[2,yn(this.transHttpCode(l.code))]:(oa.useNavi||(l.server="",l.backupServer=Xn.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,mn(l)])}catch(e){this.logger.error(H.L_PARSE_NAVI_E,s.data,r)}return[2,yn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:oa.tag,protocol:(/^https/.test(e)?q.WSS:q.WS).toString()}),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o.url),r),[4,oa.httpReq(o)];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!oa.useNavi&&i?[2,mn(Sc())]:[2,yn(this.transHttpCode(s.status))];try{return u=s.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",oa.useNavi||(l.logSwitch=0,c=Xn.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?q.WSS:q.WS,weight:c.length-t}}))),[2,mn(l)]}catch(e){this.logger.error(H.L_PARSE_NAVI_E,s.data,r)}return[2,yn(x.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(n.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.getCatchKey(e);if(Oc[n])return Oc[n];var r,i=We(this.appkey),o=oa.localStorage;try{var a=o.getItem(i);r=a?JSON.parse(a):[]}catch(e){r=[]}if(0===r.length)return null;var s=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return Oc[n]=s,s}}),Object.defineProperty(n.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=this,i=We(this.appkey),o=oa.localStorage;try{var a=o.getItem(i);n=a?JSON.parse(a):[]}catch(e){n=[]}var s=Date.now();n.length>0&&(n=n.filter((function(t){return s-t.timestamp<ke&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:s,naviInfo:t,token:e,environment:this._environment};n.push(u),o.setItem(i,JSON.stringify(n)),Oc[this.getCatchKey(e)]=u}}),n}(mr),Cc=function(){function e(e){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_sendMessageMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_userId",{enumerable:!0,configurable:!0,writable:!0,value:""})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._userId=e;var t=nt(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=oa.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var n=nt(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,oa.localStorage.setItem(n,JSON.stringify(r))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nt(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),oa.localStorage.setItem(t,JSON.stringify(n))}}),e}(),Nc=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[de.ONLINE_STATUS]={},t[de.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[de.ONLINE_STATUS]={},e[de.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===de.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===de.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.subscribeData[e][t];return n?r({},n):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.subscribeData[e][t]=n}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._ownProfile=r(r({},e),{extraProfile:r({},e.extraProfile)})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?r(r({},this._ownProfile),{extraProfile:r({},this._ownProfile.extraProfile)}):null}}),e}(),Pc=function(){function e(e){Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_relationshipStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subUserStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_ownProfileVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subStore=new Nc(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;void 0===t&&(t=!1);var r=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,a,s=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===fe.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(l,s),void o.push(e);var d=n._subStore.getSubscribeUserData(l,s);if(!(d&&d.subscribeTime>=u)){if(l===de.ONLINE_STATUS){r.push(s);var f=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:f})}else{i.push(s);var p=null===(a=d)||void 0===a?void 0:a.profile;n._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:p,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(de.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(de.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,a=t._subStore.getSubscribeUserData(de.ONLINE_STATUS,i);if(a){var s=[],u=r({},a.statusMap);o.forEach((function(e){var t=u[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var n={eventValue:e.value,changeTime:e.versionTime};u[e.platformInfo]=n,s.push(r(r({},n),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(de.ONLINE_STATUS,i,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:i,subscribeType:de.ONLINE_STATUS,statusMap:u}),n.push({userId:i,subscribeType:de.ONLINE_STATUS,subscribeTime:a.subscribeTime,expiry:a.expiry,details:s})}})),n}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return e.forEach((function(e){var i=e.userId,o=e.version,a=e.userProfile,s=e.userExtProfile,u=t._subStore.getSubscribeUserData(de.USER_PROFILE,i),l=Ft(i,a,s);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(de.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:de.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&n.push({userId:i,subscribeType:de.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:r({},l)})):t._subStore.updateSubscribeUserData(de.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:de.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),n}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,i=[];return t.forEach((function(t){var o=n._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+n._delayTime-o.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var a={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===de.ONLINE_STATUS){var s=o.statusMap,u=Object.keys(s).map((function(e){return r({platform:~~e},s[~~e])}));a.details=kt(u)}else if(e===de.USER_PROFILE&&!o.isSubscribed)return;i.push(a)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(de.USER_PROFILE,e);if(o&&o.profile){var a=o.profile,s=a.version,u=a.info;if(o.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void i.push(e):void n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}));t._delayTime+Date.now()-s>6e5?i.push(e):n.push(r(r({},u),{extraProfile:r({},u.extraProfile)}))}else i.push(e)})),{list:n,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===de.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return r({platform:~~e},t.statusMap[~~e])}));n.details=kt(i)}return n}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),wc=function(){function e(e,t,n,r,i,o,a){Object.defineProperty(this,"_connectManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_isPullingRelationship",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullRelationshipQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullRelationshipFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isPullingSubUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullSubUserStatusQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullSubUserStatusFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subscribeService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subscribeService=new Pc(r)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(de.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(de.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(de.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(de.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!0),o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingRelationship?[2]:(this._isPullingRelationship=!0,[4,this._pullSubscribeRelationship(e)]);case 1:return t.sent(),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0?(this._pullRelationshipQueue.length=0,[4,this._syncSubscribeRelationship(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h,g,_,b;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),i=this._connectManager.codec.encodePullUserSubReq({version:n,pageToken:t}),o=new ao(xr.pullUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Qs)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?(this._pullRelationshipFailTime=0,c=l.list,d=l.version,f=l.hasNext,p=l.pageToken,d=Dt(d),c.forEach((function(e){e.subTime=Dt(e.subTime)})),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,data:l}),r),e?(h=this._subscribeService.updateSubscribeRelation(c),g=h.newSubscribeOnlineStatusList,_=h.newSubscribeUserProfileList,(b=h.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(b),g.length>0&&this._queryAndUpdateUserOnlineStatus(g),_.length>0&&this._queryAndUpdateUserProfile(_)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(d),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>d})),f?[4,this._pullSubscribeRelationship(e,p)]:[3,3]):(this._logger.error(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,failTime:this._pullRelationshipFailTime}),r),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:a.sent(),a.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingSubUserStatus?[2]:(this._isPullingSubUserStatus=!0,[4,this._pullSubscribeUserStatus(e)]);case 1:return t.sent(),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0?(this._pullSubUserStatusQueue.length=0,[4,this._syncSubscribeUserStatus(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h,g,_;return a(this,(function(a){switch(a.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),i=this._connectManager.codec.encodePullSubDataReq({version:n,needAllData:e,pageToken:t}),o=new ao(xr.pullSubData,i,this._currentUserId),[4,this._connectManager.send(o,zs)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?(this._pullSubUserStatusFailTime=0,c=l.list,d=l.versionTime,f=l.hasNext,p=l.pageToken,h=l.isFull,d=Dt(d),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,data:l}),r),c.forEach((function(e){e.data.forEach((function(e){e.versionTime=Dt(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>d})),this._subscribeService.updateSubscribeUserStatusVersion(d),g=[],_=[],c.forEach((function(e){e.subType===de.ONLINE_STATUS?g.push(e):e.subType===de.USER_PROFILE&&_.push(e.subUserId)})),h&&""===t&&this._subscribeService.clearSubscribeStatus(),g.length>0&&this._updateUserOnlineStatus(g,!h),_.length>0?[4,this._queryAndUpdateUserProfile(_,!h)]:[3,3]):(this._logger.warn(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:a.sent(),a.label=3;case 3:return f?[4,this._pullSubscribeUserStatus(e,p)]:[3,5];case 4:a.sent(),a.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=this._connectManager.codec.encodeQrySubDataReq(de.ONLINE_STATUS,e),r=new ao(xr.qrySubData,n,this._currentUserId),[4,this._connectManager.send(r,zs)];case 1:return i=a.sent(),o=i.code,s=i.data,this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:o,data:s}),t),o===x.SUCCESS&&s?(this._updateUserOnlineStatus(s.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=Dt(e.versionTime)}))}));var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._logger.createTraceId(),this._logger.info(H.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=this._connectManager.codec.encodePullUserProfileReq(e),i=new ao(xr.pullUserProfile,r,this._currentUserId),[4,this._connectManager.send(i,ru)];case 1:return o=a.sent(),s=o.code,u=o.data,this._logger.info(H.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:u}),n),s===x.SUCCESS&&u?(u.UserProfile.forEach((function(e){e.version=Dt(e.version)})),l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,{code:s,data:u.UserProfile}]):[2,{code:s}]}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.pbData,Xs)).subType!==de.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==de.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==de.FRIEND_ONLINE_STATUS?[3,3]:(n=t.data.map((function(e){return{changeTime:Dt(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==de.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=o.sent(),(i=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Ft(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._subscribeService.getSubscribeUserList(e,t,n)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=0),o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this._connectManager.codec.encodeUpdateUserSubReq(t,e,n,r),o=new ao(xr.updUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Ks)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&l?[2,{code:u,data:l.subUsers.map((function(e){return e.subUserId}))}]:u===x.SUCCESS&&l?(c=l.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===fe.SUBSCRIBE&&(t===de.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===de.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:u}]):[2,{code:u}]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,Promise.resolve({code:x.SUCCESS,data:r})]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS&&s?(c=s.map((function(e){return Ft(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:o,data:l(l([],u(r),!1),u(c),!1)}]):[2,{code:o,data:l([],u(r),!1)}]}}))}))}}),Object.defineProperty(e.prototype,"syncOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(H.L_PULL_OWN_PROFILE_T,"",t),n=this._connectManager.codec.encodeUserProfileInput(),r=new ao(xr.pullOwnProfile,n,this._currentUserId),[4,this._connectManager.send(r,$s)]):[2,Promise.resolve({code:x.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return i=a.sent(),o=i.code,s=i.data,this._logger.info(H.L_PULL_OWN_PROFILE_R,JSON.stringify({code:o,data:s}),t),o===x.SUCCESS&&s?(u=s.userExtProfile,l=s.userProfile,c=s.version,d=s.userId,f=Dt(c),p=Ft(d,l,u),this._subscribeService.updateOwnProfile(p,f),e&&this._event.ownUserProfileChanged(p),[2,{code:o,data:p}]):[2,{code:o}]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:x.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Mc=function(){function e(e,t,n){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new Xl(at(e,t)),this._delayTime=n,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=s(r),a=o.next();!a.done;a=o.next()){var u=a.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){var a;if(!(i<Date.now()-this._delayTime-Ke)){var s=this._getConversationKey(e),u=this._storage.get(s)||{};if(!u[t]){var l={t:i,d:n};o&&(l.sId=o);var c=r(r({},u),((a={})[t]=l,a));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(s,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i,o=this._getConversationKey(e),a=this._storage.get(o)||{},s=a[t];if(s){if(s.us){if(s.us.includes(n))return}else s.us=[];s.us.push(n),this._storage.set(o,r(r({},a),((i={})[t]=s,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var i in n){var o=n[i];o.d===be.RECEIVE&&(r[o.sId]||(r[o.sId]=[]),r[o.sId].push(i))}return r}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],i={};for(var o in r){var a=r[o];Date.now()-this._delayTime-a.t<Ke&&(i[o]=a)}Object.keys(i).length&&(t[n]=i)}this._storage.update(t)}}),e}(),Lc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return Object.defineProperty(r,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),r._storageKey=it(t),r}return t(n,e),Object.defineProperty(n.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return oa.localStorage.getItem(this._storageKey)}}),Object.defineProperty(n.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){oa.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(n.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){oa.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(n.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,oa.httpReq({url:e})];case 1:return t=i.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))}}),Object.defineProperty(n.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,un(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))}}),n}(Zn);function Uc(e){let t=e.length;for(;--t>=0;)e[t]=0}const Dc=256,Vc=286,jc=30,Gc=15,kc=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Fc=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),xc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Bc=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hc=new Array(576);Uc(Hc);const qc=new Array(60);Uc(qc);const Yc=new Array(512);Uc(Yc);const Kc=new Array(256);Uc(Kc);const Wc=new Array(29);Uc(Wc);const Qc=new Array(jc);function Jc(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let zc,Xc,Zc;function $c(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Uc(Qc);const ed=e=>e<256?Yc[e]:Yc[256+(e>>>7)],td=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},nd=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,td(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},rd=(e,t,n)=>{nd(e,n[2*t],n[2*t+1])},id=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},od=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=Gc;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=id(r[t]++,t))}},ad=e=>{let t;for(t=0;t<Vc;t++)e.dyn_ltree[2*t]=0;for(t=0;t<jc;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},sd=e=>{e.bi_valid>8?td(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ud=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},ld=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&ud(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ud(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},cd=(e,t,n)=>{let r,i,o,a,s=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+s++],r+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===r?rd(e,i,t):(o=Kc[i],rd(e,o+Dc+1,t),a=kc[o],0!==a&&(i-=Wc[o],nd(e,i,a)),r--,o=ed(r),rd(e,o,n),a=Fc[o],0!==a&&(r-=Qc[o],nd(e,r,a)))}while(s<e.sym_next);rd(e,256,t)},dd=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==n[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[2*u+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)ld(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ld(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,ld(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,f,p,h,g=0;for(f=0;f<=Gc;f++)e.bl_count[f]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],f=n[2*n[2*c+1]+1]+1,f>u&&(f=u,g++),n[2*c+1]=f,c>r||(e.bl_count[f]++,p=0,c>=s&&(p=a[c-s]),h=n[2*c],e.opt_len+=h*(f+p),o&&(e.static_len+=h*(i[2*c+1]+p)));if(0!==g){do{for(f=u-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(f=u;0!==f;f--)for(c=e.bl_count[f];0!==c;)d=e.heap[--l],d>r||(n[2*d+1]!==f&&(e.opt_len+=(f-n[2*d+1])*n[2*d],n[2*d+1]=f),c--)}})(e,t),od(n,l,e.bl_count)},fd=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4))},pd=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<l)do{rd(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(rd(e,i,e.bl_tree),s--),rd(e,16,e.bl_tree),nd(e,s-3,2)):s<=10?(rd(e,17,e.bl_tree),nd(e,s-3,3)):(rd(e,18,e.bl_tree),nd(e,s-11,7));s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4)}};let hd=!1;const gd=(e,t,n,r)=>{nd(e,0+(r?1:0),3),sd(e),td(e,n),td(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var _d=(e,t,n,r)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Dc;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),dd(e,e.l_desc),dd(e,e.d_desc),a=(e=>{let t;for(fd(e,e.dyn_ltree,e.l_desc.max_code),fd(e,e.dyn_dtree,e.d_desc.max_code),dd(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Bc[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?gd(e,t,n,r):4===e.strategy||o===i?(nd(e,2+(r?1:0),3),cd(e,Hc,qc)):(nd(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(nd(e,t-257,5),nd(e,n-1,5),nd(e,r-4,4),i=0;i<r;i++)nd(e,e.bl_tree[2*Bc[i]+1],3);pd(e,e.dyn_ltree,t-1),pd(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),cd(e,e.dyn_ltree,e.dyn_dtree)),ad(e),r&&sd(e)},bd={_tr_init:e=>{hd||((()=>{let e,t,n,r,i;const o=new Array(16);for(n=0,r=0;r<28;r++)for(Wc[r]=n,e=0;e<1<<kc[r];e++)Kc[n++]=r;for(Kc[n-1]=r,i=0,r=0;r<16;r++)for(Qc[r]=i,e=0;e<1<<Fc[r];e++)Yc[i++]=r;for(i>>=7;r<jc;r++)for(Qc[r]=i<<7,e=0;e<1<<Fc[r]-7;e++)Yc[256+i++]=r;for(t=0;t<=Gc;t++)o[t]=0;for(e=0;e<=143;)Hc[2*e+1]=8,e++,o[8]++;for(;e<=255;)Hc[2*e+1]=9,e++,o[9]++;for(;e<=279;)Hc[2*e+1]=7,e++,o[7]++;for(;e<=287;)Hc[2*e+1]=8,e++,o[8]++;for(od(Hc,287,o),e=0;e<jc;e++)qc[2*e+1]=5,qc[2*e]=id(e,5);zc=new Jc(Hc,kc,257,Vc,Gc),Xc=new Jc(qc,Fc,0,jc,Gc),Zc=new Jc(new Array(0),xc,0,19,7)})(),hd=!0),e.l_desc=new $c(e.dyn_ltree,zc),e.d_desc=new $c(e.dyn_dtree,Xc),e.bl_desc=new $c(e.bl_tree,Zc),e.bi_buf=0,e.bi_valid=0,ad(e)},_tr_stored_block:gd,_tr_flush_block:_d,_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Kc[n]+Dc+1)]++,e.dyn_dtree[2*ed(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{nd(e,2,3),rd(e,256,Hc),(e=>{16===e.bi_valid?(td(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Ed=(e,t,n,r)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};const vd=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var md=(e,t,n,r)=>{const i=vd,o=r+n;e^=-1;for(let n=r;n<o;n++)e=e>>>8^i[255&(e^t[n])];return~e},yd={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Id={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Td,_tr_stored_block:Rd,_tr_flush_block:Od,_tr_tally:Sd,_tr_align:Ad}=bd,{Z_NO_FLUSH:Cd,Z_PARTIAL_FLUSH:Nd,Z_FULL_FLUSH:Pd,Z_FINISH:wd,Z_BLOCK:Md,Z_OK:Ld,Z_STREAM_END:Ud,Z_STREAM_ERROR:Dd,Z_DATA_ERROR:Vd,Z_BUF_ERROR:Gd,Z_DEFAULT_COMPRESSION:kd,Z_FILTERED:Fd,Z_HUFFMAN_ONLY:xd,Z_RLE:Bd,Z_FIXED:Hd,Z_DEFAULT_STRATEGY:qd,Z_UNKNOWN:Yd,Z_DEFLATED:Kd}=Id,Wd=258,Qd=262,Jd=42,zd=113,Xd=666,Zd=(e,t)=>(e.msg=yd[t],t),$d=e=>2*e-(e>4?9:0),ef=e=>{let t=e.length;for(;--t>=0;)e[t]=0},tf=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let nf=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const rf=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},of=(e,t)=>{Od(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,rf(e.strm)},af=(e,t)=>{e.pending_buf[e.pending++]=t},sf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},uf=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=Ed(e.adler,t,i,n):2===e.state.wrap&&(e.adler=md(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},lf=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-Qd?e.strstart-(e.w_size-Qd):0,l=e.window,c=e.w_mask,d=e.prev,f=e.strstart+Wd;let p=l[o+a-1],h=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===h&&l[n+a-1]===p&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<f);if(r=Wd-(f-o),o=f-Wd,r>a){if(e.match_start=t,a=r,r>=s)break;p=l[o+a-1],h=l[o+a]}}}while((t=d[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},cf=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Qd)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),tf(e),r+=t),0===e.strm.avail_in)break;if(n=uf(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=nf(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=nf(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Qd&&0!==e.strm.avail_in)},df=(e,t)=>{let n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>i&&(n=i),n<o&&(0===n&&t!==wd||t===Cd||n!==r+e.strm.avail_in))break;a=t===wd&&n===r+e.strm.avail_in?1:0,Rd(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,rf(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(uf(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===a);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==Cd&&t!==wd&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(uf(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,r=e.strstart-e.block_start,(r>=o||(r||t===wd)&&t!==Cd&&0===e.strm.avail_in&&r<=i)&&(n=r>i?i:r,a=t===wd&&0===e.strm.avail_in&&n===r?1:0,Rd(e,e.block_start,n,a),e.block_start+=n,rf(e.strm)),a?3:1)},ff=(e,t)=>{let n,r;for(;;){if(e.lookahead<Qd){if(cf(e),e.lookahead<Qd&&t===Cd)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=nf(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-Qd&&(e.match_length=lf(e,n)),e.match_length>=3)if(r=Sd(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=nf(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=nf(e,e.ins_h,e.window[e.strstart+1]);else r=Sd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(of(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===wd?(of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(of(e,!1),0===e.strm.avail_out)?1:2},pf=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Qd){if(cf(e),e.lookahead<Qd&&t===Cd)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=nf(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Qd&&(e.match_length=lf(e,n),e.match_length<=5&&(e.strategy===Fd||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=Sd(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=nf(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(of(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Sd(e,0,e.window[e.strstart-1]),r&&of(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Sd(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===wd?(of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(of(e,!1),0===e.strm.avail_out)?1:2};function hf(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const gf=[new hf(0,0,0,0,df),new hf(4,4,8,4,ff),new hf(4,5,16,8,ff),new hf(4,6,32,32,ff),new hf(4,4,16,16,pf),new hf(8,16,32,32,pf),new hf(8,16,128,128,pf),new hf(8,32,128,256,pf),new hf(32,128,258,1024,pf),new hf(32,258,258,4096,pf)];function _f(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Kd,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ef(this.dyn_ltree),ef(this.dyn_dtree),ef(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ef(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ef(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const bf=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Jd&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==zd&&t.status!==Xd?1:0},Ef=e=>{if(bf(e))return Zd(e,Dd);e.total_in=e.total_out=0,e.data_type=Yd;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Jd:zd,e.adler=2===t.wrap?0:1,t.last_flush=-2,Td(t),Ld},vf=e=>{const t=Ef(e);var n;return t===Ld&&((n=e.state).window_size=2*n.w_size,ef(n.head),n.max_lazy_match=gf[n.level].max_lazy,n.good_match=gf[n.level].good_length,n.nice_match=gf[n.level].nice_length,n.max_chain_length=gf[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},mf=(e,t,n,r,i,o)=>{if(!e)return Dd;let a=1;if(t===kd&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==Kd||r<8||r>15||t<0||t>9||o<0||o>Hd||8===r&&1!==a)return Zd(e,Dd);8===r&&(r=9);const s=new _f;return e.state=s,s.strm=e,s.status=Jd,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=o,s.method=n,vf(e)};var yf={deflateInit:(e,t)=>mf(e,t,Kd,15,8,qd),deflateInit2:mf,deflateReset:vf,deflateResetKeep:Ef,deflateSetHeader:(e,t)=>bf(e)||2!==e.state.wrap?Dd:(e.state.gzhead=t,Ld),deflate:(e,t)=>{if(bf(e)||t>Md||t<0)return e?Zd(e,Dd):Dd;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===Xd&&t!==wd)return Zd(e,0===e.avail_out?Gd:Dd);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(rf(e),0===e.avail_out)return n.last_flush=-1,Ld}else if(0===e.avail_in&&$d(t)<=$d(r)&&t!==wd)return Zd(e,Gd);if(n.status===Xd&&0!==e.avail_in)return Zd(e,Gd);if(n.status===Jd&&0===n.wrap&&(n.status=zd),n.status===Jd){let t=Kd+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=xd||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,sf(n,t),0!==n.strstart&&(sf(n,e.adler>>>16),sf(n,65535&e.adler)),e.adler=1,n.status=zd,rf(e),0!==n.pending)return n.last_flush=-1,Ld}if(57===n.status)if(e.adler=0,af(n,31),af(n,139),af(n,8),n.gzhead)af(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),af(n,255&n.gzhead.time),af(n,n.gzhead.time>>8&255),af(n,n.gzhead.time>>16&255),af(n,n.gzhead.time>>24&255),af(n,9===n.level?2:n.strategy>=xd||n.level<2?4:0),af(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(af(n,255&n.gzhead.extra.length),af(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=md(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(af(n,0),af(n,0),af(n,0),af(n,0),af(n,0),af(n,9===n.level?2:n.strategy>=xd||n.level<2?4:0),af(n,3),n.status=zd,rf(e),0!==n.pending)return n.last_flush=-1,Ld;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=md(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,rf(e),0!==n.pending)return n.last_flush=-1,Ld;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=md(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=md(e.adler,n.pending_buf,n.pending-r,r)),rf(e),0!==n.pending)return n.last_flush=-1,Ld;r=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,af(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=md(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=md(e.adler,n.pending_buf,n.pending-r,r)),rf(e),0!==n.pending)return n.last_flush=-1,Ld;r=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,af(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=md(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(rf(e),0!==n.pending))return n.last_flush=-1,Ld;af(n,255&e.adler),af(n,e.adler>>8&255),e.adler=0}if(n.status=zd,rf(e),0!==n.pending)return n.last_flush=-1,Ld}if(0!==e.avail_in||0!==n.lookahead||t!==Cd&&n.status!==Xd){let r=0===n.level?df(n,t):n.strategy===xd?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(cf(e),0===e.lookahead)){if(t===Cd)return 1;break}if(e.match_length=0,n=Sd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(of(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===wd?(of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(of(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===Bd?((e,t)=>{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=Wd){if(cf(e),e.lookahead<=Wd&&t===Cd)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+Wd;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=Wd-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Sd(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Sd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(of(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===wd?(of(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(of(e,!1),0===e.strm.avail_out)?1:2})(n,t):gf[n.level].func(n,t);if(3!==r&&4!==r||(n.status=Xd),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),Ld;if(2===r&&(t===Nd?Ad(n):t!==Md&&(Rd(n,0,0,!1),t===Pd&&(ef(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),rf(e),0===e.avail_out))return n.last_flush=-1,Ld}return t!==wd?Ld:n.wrap<=0?Ud:(2===n.wrap?(af(n,255&e.adler),af(n,e.adler>>8&255),af(n,e.adler>>16&255),af(n,e.adler>>24&255),af(n,255&e.total_in),af(n,e.total_in>>8&255),af(n,e.total_in>>16&255),af(n,e.total_in>>24&255)):(sf(n,e.adler>>>16),sf(n,65535&e.adler)),rf(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Ld:Ud)},deflateEnd:e=>{if(bf(e))return Dd;const t=e.state.status;return e.state=null,t===zd?Zd(e,Vd):Ld},deflateSetDictionary:(e,t)=>{let n=t.length;if(bf(e))return Dd;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==Jd||r.lookahead)return Dd;if(1===i&&(e.adler=Ed(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(ef(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,cf(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=nf(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,cf(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,Ld},deflateInfo:"pako deflate (from Nodeca project)"};const If=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Tf={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)If(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}};let Rf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Rf=!1}const Of=new Uint8Array(256);for(let e=0;e<256;e++)Of[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Of[254]=Of[254]=1;var Sf={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<a&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},buf2string:(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,i;const o=new Array(2*n);for(i=0,r=0;r<n;){let t=e[r++];if(t<128){o[i++]=t;continue}let a=Of[t];if(a>4)o[i++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<n;)t=t<<6|63&e[r++],a--;a>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Rf)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Of[e[n]]>t?n:t}};var Af=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Cf=Object.prototype.toString,{Z_NO_FLUSH:Nf,Z_SYNC_FLUSH:Pf,Z_FULL_FLUSH:wf,Z_FINISH:Mf,Z_OK:Lf,Z_STREAM_END:Uf,Z_DEFAULT_COMPRESSION:Df,Z_DEFAULT_STRATEGY:Vf,Z_DEFLATED:jf}=Id;function Gf(e){this.options=Tf.assign({level:Df,method:jf,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vf},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Af,this.strm.avail_out=0;let n=yf.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Lf)throw new Error(yd[n]);if(t.header&&yf.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Sf.string2buf(t.dictionary):"[object ArrayBuffer]"===Cf.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=yf.deflateSetDictionary(this.strm,e),n!==Lf)throw new Error(yd[n]);this._dict_set=!0}}Gf.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Mf:Nf,"string"==typeof e?n.input=Sf.string2buf(e):"[object ArrayBuffer]"===Cf.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===Pf||o===wf)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=yf.deflate(n,o),i===Uf)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=yf.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Lf;if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Gf.prototype.onData=function(e){this.chunks.push(e)},Gf.prototype.onEnd=function(e){e===Lf&&(this.result=Tf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const kf=16209;var Ff=function(e,t){let n,r,i,o,a,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I,T,R,O;const S=e.state;n=e.next_in,R=e.input,r=n+(e.avail_in-5),i=e.next_out,O=e.output,o=i-(t-e.avail_out),a=i+(e.avail_out-257),s=S.dmax,u=S.wsize,l=S.whave,c=S.wnext,d=S.window,f=S.hold,p=S.bits,h=S.lencode,g=S.distcode,_=(1<<S.lenbits)-1,b=(1<<S.distbits)-1;e:do{p<15&&(f+=R[n++]<<p,p+=8,f+=R[n++]<<p,p+=8),E=h[f&_];t:for(;;){if(v=E>>>24,f>>>=v,p-=v,v=E>>>16&255,0===v)O[i++]=65535&E;else{if(!(16&v)){if(64&v){if(32&v){S.mode=16191;break e}e.msg="invalid literal/length code",S.mode=kf;break e}E=h[(65535&E)+(f&(1<<v)-1)];continue t}for(m=65535&E,v&=15,v&&(p<v&&(f+=R[n++]<<p,p+=8),m+=f&(1<<v)-1,f>>>=v,p-=v),p<15&&(f+=R[n++]<<p,p+=8,f+=R[n++]<<p,p+=8),E=g[f&b];;){if(v=E>>>24,f>>>=v,p-=v,v=E>>>16&255,16&v){if(y=65535&E,v&=15,p<v&&(f+=R[n++]<<p,p+=8,p<v&&(f+=R[n++]<<p,p+=8)),y+=f&(1<<v)-1,y>s){e.msg="invalid distance too far back",S.mode=kf;break e}if(f>>>=v,p-=v,v=i-o,y>v){if(v=y-v,v>l&&S.sane){e.msg="invalid distance too far back",S.mode=kf;break e}if(I=0,T=d,0===c){if(I+=u-v,v<m){m-=v;do{O[i++]=d[I++]}while(--v);I=i-y,T=O}}else if(c<v){if(I+=u+c-v,v-=c,v<m){m-=v;do{O[i++]=d[I++]}while(--v);if(I=0,c<m){v=c,m-=v;do{O[i++]=d[I++]}while(--v);I=i-y,T=O}}}else if(I+=c-v,v<m){m-=v;do{O[i++]=d[I++]}while(--v);I=i-y,T=O}for(;m>2;)O[i++]=T[I++],O[i++]=T[I++],O[i++]=T[I++],m-=3;m&&(O[i++]=T[I++],m>1&&(O[i++]=T[I++]))}else{I=i-y;do{O[i++]=O[I++],O[i++]=O[I++],O[i++]=O[I++],m-=3}while(m>2);m&&(O[i++]=O[I++],m>1&&(O[i++]=O[I++]))}break}if(64&v){e.msg="invalid distance code",S.mode=kf;break e}E=g[(65535&E)+(f&(1<<v)-1)]}}break}}while(n<r&&i<a);m=p>>3,n-=m,p-=m<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=i<a?a-i+257:257-(i-a),S.hold=f,S.bits=p};const xf=15,Bf=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Hf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),qf=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Yf=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Kf=(e,t,n,r,i,o,a,s)=>{const u=s.bits;let l,c,d,f,p,h,g=0,_=0,b=0,E=0,v=0,m=0,y=0,I=0,T=0,R=0,O=null;const S=new Uint16Array(16),A=new Uint16Array(16);let C,N,P,w=null;for(g=0;g<=xf;g++)S[g]=0;for(_=0;_<r;_++)S[t[n+_]]++;for(v=u,E=xf;E>=1&&0===S[E];E--);if(v>E&&(v=E),0===E)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(b=1;b<E&&0===S[b];b++);for(v<b&&(v=b),I=1,g=1;g<=xf;g++)if(I<<=1,I-=S[g],I<0)return-1;if(I>0&&(0===e||1!==E))return-1;for(A[1]=0,g=1;g<xf;g++)A[g+1]=A[g]+S[g];for(_=0;_<r;_++)0!==t[n+_]&&(a[A[t[n+_]]++]=_);if(0===e?(O=w=a,h=20):1===e?(O=Bf,w=Hf,h=257):(O=qf,w=Yf,h=0),R=0,_=0,g=b,p=o,m=v,y=0,d=-1,T=1<<v,f=T-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){C=g-y,a[_]+1<h?(N=0,P=a[_]):a[_]>=h?(N=w[a[_]-h],P=O[a[_]-h]):(N=96,P=0),l=1<<g-y,c=1<<m,b=c;do{c-=l,i[p+(R>>y)+c]=C<<24|N<<16|P}while(0!==c);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,_++,0==--S[g]){if(g===E)break;g=t[n+a[_]]}if(g>v&&(R&f)!==d){for(0===y&&(y=v),p+=b,m=g-y,I=1<<m;m+y<E&&(I-=S[m+y],!(I<=0));)m++,I<<=1;if(T+=1<<m,1===e&&T>852||2===e&&T>592)return 1;d=R&f,i[d]=v<<24|m<<16|p-o}}return 0!==R&&(i[p+R]=g-y<<24|64<<16),s.bits=v,0};const{Z_FINISH:Wf,Z_BLOCK:Qf,Z_TREES:Jf,Z_OK:zf,Z_STREAM_END:Xf,Z_NEED_DICT:Zf,Z_STREAM_ERROR:$f,Z_DATA_ERROR:ep,Z_MEM_ERROR:tp,Z_BUF_ERROR:np,Z_DEFLATED:rp}=Id,ip=16180,op=16190,ap=16191,sp=16192,up=16194,lp=16199,cp=16200,dp=16206,fp=16209,pp=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function hp(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const gp=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<ip||t.mode>16211?1:0},_p=e=>{if(gp(e))return $f;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=ip,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,zf},bp=e=>{if(gp(e))return $f;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,_p(e)},Ep=(e,t)=>{let n;if(gp(e))return $f;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?$f:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,bp(e))},vp=(e,t)=>{if(!e)return $f;const n=new hp;e.state=n,n.strm=e,n.window=null,n.mode=ip;const r=Ep(e,t);return r!==zf&&(e.state=null),r};let mp,yp,Ip=!0;const Tp=e=>{if(Ip){mp=new Int32Array(512),yp=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Kf(1,e.lens,0,288,mp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Kf(2,e.lens,0,32,yp,0,e.work,{bits:5}),Ip=!1}e.lencode=mp,e.lenbits=9,e.distcode=yp,e.distbits=5},Rp=(e,t,n,r)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Op={inflateReset:bp,inflateReset2:Ep,inflateResetKeep:_p,inflateInit:e=>vp(e,15),inflateInit2:vp,inflate:(e,t)=>{let n,r,i,o,a,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I,T,R=0;const O=new Uint8Array(4);let S,A;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(gp(e)||!e.output||!e.input&&0!==e.avail_in)return $f;n=e.state,n.mode===ap&&(n.mode=sp),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,d=s,f=u,T=zf;e:for(;;)switch(n.mode){case ip:if(0===n.wrap){n.mode=sp;break}for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,O[0]=255&l,O[1]=l>>>8&255,n.check=md(n.check,O,2,0),l=0,c=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=fp;break}if((15&l)!==rp){e.msg="unknown compression method",n.mode=fp;break}if(l>>>=4,c-=4,I=8+(15&l),0===n.wbits&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=fp;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:ap,l=0,c=0;break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.flags=l,(255&n.flags)!==rp){e.msg="unknown compression method",n.mode=fp;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=fp;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,n.check=md(n.check,O,2,0)),l=0,c=0,n.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,O[2]=l>>>16&255,O[3]=l>>>24&255,n.check=md(n.check,O,4,0)),l=0,c=0,n.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,n.check=md(n.check,O,2,0)),l=0,c=0,n.mode=16184;case 16184:if(1024&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(O[0]=255&l,O[1]=l>>>8&255,n.check=md(n.check,O,2,0)),l=0,c=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(p=n.length,p>s&&(p=s),p&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+p),I)),512&n.flags&&4&n.wrap&&(n.check=md(n.check,r,p,o)),s-=p,o+=p,n.length-=p),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;p=0;do{I=r[o+p++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I))}while(I&&p<s);if(512&n.flags&&4&n.wrap&&(n.check=md(n.check,r,p,o)),s-=p,o+=p,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;p=0;do{I=r[o+p++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I))}while(I&&p<s);if(512&n.flags&&4&n.wrap&&(n.check=md(n.check,r,p,o)),s-=p,o+=p,I)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;c<16;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=fp;break}l=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ap;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}e.adler=n.check=pp(l),l=0,c=0,n.mode=op;case op:if(0===n.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,Zf;e.adler=n.check=1,n.mode=ap;case ap:if(t===Qf||t===Jf)break e;case sp:if(n.last){l>>>=7&c,c-=7&c,n.mode=dp;break}for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}switch(n.last=1&l,l>>>=1,c-=1,3&l){case 0:n.mode=16193;break;case 1:if(Tp(n),n.mode=lp,t===Jf){l>>>=2,c-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=fp}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=fp;break}if(n.length=65535&l,l=0,c=0,n.mode=up,t===Jf)break e;case up:n.mode=16195;case 16195:if(p=n.length,p){if(p>s&&(p=s),p>u&&(p=u),0===p)break e;i.set(r.subarray(o,o+p),a),s-=p,o+=p,u-=p,a+=p,n.length-=p;break}n.mode=ap;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(n.nlen=257+(31&l),l>>>=5,c-=5,n.ndist=1+(31&l),l>>>=5,c-=5,n.ncode=4+(15&l),l>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=fp;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;c<3;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.lens[C[n.have++]]=7&l,l>>>=3,c-=3}for(;n.have<19;)n.lens[C[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},T=Kf(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid code lengths set",n.mode=fp;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;R=n.lencode[l&(1<<n.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(E<16)l>>>=_,c-=_,n.lens[n.have++]=E;else{if(16===E){for(A=_+2;c<A;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(l>>>=_,c-=_,0===n.have){e.msg="invalid bit length repeat",n.mode=fp;break}I=n.lens[n.have-1],p=3+(3&l),l>>>=2,c-=2}else if(17===E){for(A=_+3;c<A;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=_,c-=_,I=0,p=3+(7&l),l>>>=3,c-=3}else{for(A=_+7;c<A;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=_,c-=_,I=0,p=11+(127&l),l>>>=7,c-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=fp;break}for(;p--;)n.lens[n.have++]=I}}if(n.mode===fp)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=fp;break}if(n.lenbits=9,S={bits:n.lenbits},T=Kf(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid literal/lengths set",n.mode=fp;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},T=Kf(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,T){e.msg="invalid distances set",n.mode=fp;break}if(n.mode=lp,t===Jf)break e;case lp:n.mode=cp;case cp:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,Ff(e,f),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,n.mode===ap&&(n.back=-1);break}for(n.back=0;R=n.lencode[l&(1<<n.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(b&&!(240&b)){for(v=_,m=b,y=E;R=n.lencode[y+((l&(1<<v+m)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=v,c-=v,n.back+=v}if(l>>>=_,c-=_,n.back+=_,n.length=E,0===b){n.mode=16205;break}if(32&b){n.back=-1,n.mode=ap;break}if(64&b){e.msg="invalid literal/length code",n.mode=fp;break}n.extra=15&b,n.mode=16201;case 16201:if(n.extra){for(A=n.extra;c<A;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;R=n.distcode[l&(1<<n.distbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(!(240&b)){for(v=_,m=b,y=E;R=n.distcode[y+((l&(1<<v+m)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}l>>>=v,c-=v,n.back+=v}if(l>>>=_,c-=_,n.back+=_,64&b){e.msg="invalid distance code",n.mode=fp;break}n.offset=E,n.extra=15&b,n.mode=16203;case 16203:if(n.extra){for(A=n.extra;c<A;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=fp;break}n.mode=16204;case 16204:if(0===u)break e;if(p=f-u,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=fp;break}p>n.wnext?(p-=n.wnext,h=n.wsize-p):h=n.wnext-p,p>n.length&&(p=n.length),g=n.window}else g=i,h=a-n.offset,p=n.length;p>u&&(p=u),u-=p,n.length-=p;do{i[a++]=g[h++]}while(--p);0===n.length&&(n.mode=cp);break;case 16205:if(0===u)break e;i[a++]=n.length,u--,n.mode=cp;break;case dp:if(n.wrap){for(;c<32;){if(0===s)break e;s--,l|=r[o++]<<c,c+=8}if(f-=u,e.total_out+=f,n.total+=f,4&n.wrap&&f&&(e.adler=n.check=n.flags?md(n.check,i,f,a-f):Ed(n.check,i,f,a-f)),f=u,4&n.wrap&&(n.flags?l:pp(l))!==n.check){e.msg="incorrect data check",n.mode=fp;break}l=0,c=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;c<32;){if(0===s)break e;s--,l+=r[o++]<<c,c+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=fp;break}l=0,c=0}n.mode=16208;case 16208:T=Xf;break e;case fp:T=ep;break e;case 16210:return tp;default:return $f}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,(n.wsize||f!==e.avail_out&&n.mode<fp&&(n.mode<dp||t!==Wf))&&Rp(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,4&n.wrap&&f&&(e.adler=n.check=n.flags?md(n.check,i,f,e.next_out-f):Ed(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ap?128:0)+(n.mode===lp||n.mode===up?256:0),(0===d&&0===f||t===Wf)&&T===zf&&(T=np),T},inflateEnd:e=>{if(gp(e))return $f;let t=e.state;return t.window&&(t.window=null),e.state=null,zf},inflateGetHeader:(e,t)=>{if(gp(e))return $f;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,zf):$f},inflateSetDictionary:(e,t)=>{const n=t.length;let r,i,o;return gp(e)?$f:(r=e.state,0!==r.wrap&&r.mode!==op?$f:r.mode===op&&(i=1,i=Ed(i,t,n,0),i!==r.check)?ep:(o=Rp(e,t,n,n),o?(r.mode=16210,tp):(r.havedict=1,zf)))},inflateInfo:"pako inflate (from Nodeca project)"};var Sp=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Ap=Object.prototype.toString,{Z_NO_FLUSH:Cp,Z_FINISH:Np,Z_OK:Pp,Z_STREAM_END:wp,Z_NEED_DICT:Mp,Z_STREAM_ERROR:Lp,Z_DATA_ERROR:Up,Z_MEM_ERROR:Dp}=Id;function Vp(e){this.options=Tf.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Af,this.strm.avail_out=0;let n=Op.inflateInit2(this.strm,t.windowBits);if(n!==Pp)throw new Error(yd[n]);if(this.header=new Sp,Op.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Sf.string2buf(t.dictionary):"[object ArrayBuffer]"===Ap.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Op.inflateSetDictionary(this.strm,t.dictionary),n!==Pp)))throw new Error(yd[n])}function jp(e,t){const n=new Vp(t);if(n.push(e),n.err)throw n.msg||yd[n.err];return n.result}Vp.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Np:Cp,"[object ArrayBuffer]"===Ap.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Op.inflate(n,a),o===Mp&&i&&(o=Op.inflateSetDictionary(n,i),o===Pp?o=Op.inflate(n,a):o===Up&&(o=Mp));n.avail_in>0&&o===wp&&n.state.wrap>0&&0!==e[n.next_in];)Op.inflateReset(n),o=Op.inflate(n,a);switch(o){case Lp:case Up:case Mp:case Dp:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||o===wp))if("string"===this.options.to){let e=Sf.utf8border(n.output,n.next_out),t=n.next_out-e,i=Sf.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==Pp||0!==s){if(o===wp)return o=Op.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Vp.prototype.onData=function(e){this.chunks.push(e)},Vp.prototype.onEnd=function(e){e===Pp&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Tf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Gp={Inflate:Vp,inflate:jp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,jp(e,t)},ungzip:jp,constants:Id};const{Inflate:kp,inflate:Fp,inflateRaw:xp,ungzip:Bp}=Gp;var Hp,qp,Yp,Kp,Wp,Qp,Jp=Bp,zp=((Hp={})[ji]=x.RC_DISCONN_KICK,Hp[Gi]=x.RC_DISCONN_EXCEPTION,Hp[Fi]=x.RC_DISCONN_EXCEPTION,Hp[xi]=x.RC_CONN_REDIRECTED,Hp[Bi]=x.RC_CONN_TOKEN_EXPIRED,Hp[Hi]=x.RC_CONN_PROTO_VERSION_ERROR,Hp[qi]=x.RC_ACCOUNT_CANCELLATION,Hp),Xp=((qp={})[_i]=x.SUCCESS,qp[bi]=x.RC_CONN_PROTO_VERSION_ERROR,qp[Ei]=x.RC_CONN_IDENTIFIER_REJECTED,qp[vi]=x.RC_CONN_SERVER_UNAVAILABLE,qp[mi]=x.RC_CONN_TOKEN_INCORRECT,qp[yi]=x.RC_CONN_NOT_AUTHRORIZED,qp[Ii]=x.RC_CONN_REDIRECTED,qp[Ti]=x.RC_CONN_PACKAGE_NAME_INVALID,qp[Ri]=x.RC_CONN_APP_BLOCKED_OR_DELETED,qp[Oi]=x.RC_CONN_USER_BLOCKED,qp[Si]=x.RC_CONN_TOKEN_EXPIRED,qp[Ai]=x.RC_CONN_DEVICE_ERROR,qp[Ci]=x.RC_CONN_HOSTNAME_ERROR,qp[Ni]=x.RC_DISCONN_SAME_CLIENT_ON_LINE,qp[Pi]=x.RC_LISCENSE_COUNT_OUT_OF_LIMIT,qp[wi]=x.RC_CONN_WRONG_CLUSTER,qp[Mi]=x.RC_APP_AUTH_NOT_PASS,qp[Li]=x.RC_OTP_USED,qp[Ui]=x.RC_PLATFORM_ERROR,qp[Di]=x.RC_ACCOUNT_CANCELLATION,qp[Vi]=x.RC_LICENSE_EXPIRED,qp),Zp=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n},$p={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},eh=((Yp={})[M.GROUP_OPERATION]=function(e){return"ChannelEventData"},Yp[M.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},Yp[v.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},Yp),th=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i=this,o=e,a=((r={})[Va]=i._formatHistoryMessages,r[Ca]=i._formatConversationList,r[Ua]=i._formatChatRoomInfos,r[Ja]=i._formatChatRoomKVList,r[bs]=i._formatGrpReadReceiptQryResp,r[xs]=i._formatQueryReceiptResp,r[Ms]=i._formatUltraOperateStatusNotifyList,r[Ps]=i._formatUltraMsgList,r[Pa]=i._formatUltraGroupUnreadMentionedList,r[Ra]=i._formatChrmKVVersion,r[hu]=i._formateChannelsListResult,r)[t];try{o=e.length>0&&nl.decode(t,e),Tt(a)&&(o=a.call(this,o,n))}catch(e){this.logger.error(H.L_PB_DECODE_E,t)}return o}}),Object.defineProperty(e.prototype,"_formatJSONContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return JSON.parse(e)}catch(t){return this.logger.error(H.L_PARSE_JSON_E,e),e}}}),Object.defineProperty(e.prototype,"_getUtfContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.user){var t=e.user,n=t.portrait,r=t.portraitUri,i=n||r;i&&(e.user.portrait=e.user.portraitUri=i)}return e}}),Object.defineProperty(e.prototype,"_setExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return e&&(t=function(e){var t={},n=JSON.parse(e);return ul(n,(function(e,n){t[n]=e.v})),t}(e)),t}}),Object.defineProperty(e.prototype,"_formatReceivedMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!e)return e;var n=this,r=t||{},i=r.currentUserId,o=r.connectedTime,a=r.afterDecode,s=e.content,u=e.fromUserId,l=e.type,c=e.groupId,d=e.status,f=e.dataTime,p=e.extraContent,h=e.extStatus,g=e.clientUniqueId,_=e.busChannel,b=e.msgId,E=e.classname,v=e.toUserIds,m=e.optionBits,y=e.direction||be.RECEIVE,I=function(e){var t=Te.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?Te.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(d),T=I.isPersited,R=I.isCounted,O=I.isMentioned,S=I.disableNotification,A=I.receivedStatus,C=I.canIncludeExpansion,N=!!(2&(h||0)),P=!!(4&(h||0)),w=!!(8&(h||0))?te.PRIVATE:te.PUBLIC,M=[B.GROUP,B.CHATROOM,B.RTC_ROOM,B.ULTRA_GROUP].indexOf(l)>-1?c:u,L=u,U=be.RECEIVE;y===be.SEND&&(L=i,U=be.SEND);var D=Dt(f),V=D<o,j=l===B.CHATROOM,G=n._setExpansion(p),k=n._formatJSONContent(s);k=n._getUtfContent(k);var F=tn(e.configFlag,e.pushContent,e.pushExt);j&&u===i&&(U=be.SEND);var x={conversationType:l,targetId:M,senderUserId:L,messageType:E,messageUId:b,isPersited:T,isCounted:R,isMentioned:O,sentTime:D,messageDirection:U,receivedTime:Date.now(),disableNotification:S,receivedStatus:A,receivedStatusInfo:jt(A),canIncludeExpansion:C,content:k,expansion:G,pushConfig:F,channelId:_||"",isInterrupt:N,isModifyMessage:P,messageId:Dt(g)||0,sentStatus:se.SENT,isOffLineMessage:V,channelType:w,isStatusMessage:Ir(E).isStatusMessage||!1,readReceiptInfo:void 0,directedUserIds:v,disableUpdateLastMessage:!!(1&(m||0)),needReceipt:!!(2&(m||0)),sendReceipt:!!(4&(m||0))||void 0,modifyInfo:cc(e.convertExt)};return(null==a?void 0:a(x))||x}}),Object.defineProperty(e.prototype,"_formatHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=e.list,i=e.hasMsg,o=e.compressedData;if(e.compressioEnabled){var a=Jp(o),s=nl.decode(Va,a);return this._formatHistoryMessages(s,t)}var u=t.conversation||{},l=u.targetId,c=Dt(e.syncTime),d=[];return ul(r,(function(e){var r=n._formatReceivedMessage(e,t);u.conversationType===B.ULTRA_GROUP?r.targetId=e.groupId||u.targetId:r.targetId=l,d.push(r)}),{isReverse:!0}),{syncTime:c,list:d,hasMore:!!i}}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var n,r=e.businessId,i=e.time,o=e.changeType,a=e.originalId,s=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,f=e.subChangeType,p=e.secondaryType,h=e.remindType,g=e.isRemindMe,_=e.extIds,b=e.eventData;return b&&(n=t._formatEventData(b,o,f)),{businessId:r,changeType:o,originalId:a,time:Dt(i),originalTime:Dt(s),secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:f,userGroupIds:_,secondaryType:p,remindType:h,isRemindMe:g,eventData:n}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r={};return e&&eh[t]&&eh[t](n)&&(r=nl.decode(eh[t](n),e)||{}),r}}),Object.defineProperty(e.prototype,"_formatUltraOperateStatusNotifyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,n=e.notifyType,r=e.info,i=e.summary,o=[],a=[],s=!(2&~n),u=!(1&~n);return u&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,i=e.opType,a=e.optime,s=Dt(a);o.push({targetId:t,channelId:n,userId:r,operationType:i,operationTime:s})})),s&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,i=e.opType;a.push({targetId:t,channelId:n,count:r,operationType:i})})),{conversationType:t,info:o,summary:a,hasInfo:u,hasSummary:s}}}),Object.defineProperty(e.prototype,"_formatUltraMsgList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}}}),Object.defineProperty(e.prototype,"_formatUltraGroupUnreadMentionedList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:Dt(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))}}),Object.defineProperty(e.prototype,"_getUltraGroupConversationInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.versionTime,r=t.unreadCount,i=t.remindCount,o=t.busChannelType,a=t.msgInfo,s=t.remindMeCount;return e.versionTime=Dt(n)||0,e.unreadMessageCount=this._getUnreadCount(Dt(r)||0),e.unreadMentionedCount=this._getUnreadCount(Dt(i)||0),e.unreadMentionedMeCount=this._getUnreadCount(Dt(s)||0),e.channelType=o||te.PUBLIC,e.lastReadTime=0,a&&(e.firstUnreadMessage={sentTime:Dt(a.msgTime)},e.lastReadTime=Dt(a.msgTime)-1),e}}),Object.defineProperty(e.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(e.prototype,"_formatConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=this,i=e.info,o=e.compressedData;if(e.compressioEnabled){var a=Jp(o),s=nl.decode(Ca,a);return this._formatConversationList(s,t)}var u=t.afterDecode,l={list:(i=ll(i,(function(e){var i=e.msg,o=e.userId,a=e.type,s=e.unreadCount,l=e.busChannel,c=e.versionTime,d=null;i&&((d=r._formatReceivedMessage(i,t)).targetId=o);var f={targetId:o,conversationType:a,unreadMessageCount:Dt(s)||0,latestMessage:d,channelId:l||"",operationTime:Dt(c)||0};return a===B.ULTRA_GROUP&&(f=n._getUltraGroupConversationInfo(f,e)),(null==u?void 0:u(f))||f})))||[]};return((null==t?void 0:t.conversationType)||B.NONE)===B.ULTRA_GROUP&&(l.isFinished=e.isFinished),l}}),Object.defineProperty(e.prototype,"_formatChatRoomInfos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.userTotalNums,n=e.userInfos;return{userCount:t,userInfos:ll(n,(function(e){var t=e.id,n=e.time;return{id:t,time:Dt(n)}}))}}}),Object.defineProperty(e.prototype,"_formatChatRoomKVList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime,i=e.compressedData;if(e.compressioEnabled){var o=Jp(i),a=nl.decode(Ja,o);return this._formatChatRoomKVList(a)}return t=ll(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,i=e.timestamp,o=e.uid,a=e.version,s=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?D.DELETE:D.UPDATE}}(r);return{key:t,value:n,isAutoDelete:s.isAutoDelete,isOverwrite:s.isOverwrite,type:s.type,userId:o,timestamp:Dt(i),version:Dt(a)}})),{kvEntries:t,isFullUpdate:n,syncTime:r}}}),Object.defineProperty(e.prototype,"_formatGrpReadReceiptQryResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=Dt(e.readTime)})),{totalMemberCount:t,list:n}}}),Object.defineProperty(e.prototype,"_formatQueryReceiptResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.list,n=void 0===t?[]:t,r=e.num,i=e.readCnt;return{list:n.map((function(e){return{readTime:Dt(e.receiptTime),userId:e.userId}})),totalCount:r,readCount:i}}}),Object.defineProperty(e.prototype,"_formatChrmKVVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,i=e.chatroomBanState;return{joinTime:t,createTime:n||0,memberCount:r||0,isAllChatroomBanned:!!(1&i),isCurrentUserBanned:!!(2&i),isCurrentChatroomBanned:!!(4&i),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}}}),Object.defineProperty(e.prototype,"_formateChannelsListResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)return{result:{list:[]}};var t=e.listType,n=e.result,r=e.page;return n?{listType:t,result:nl.decode($p[t],n)||[],page:r}:{listType:t,result:{list:[]},page:r}}}),Object.defineProperty(e.prototype,"_calculateFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.isFilerWhiteBlacklist,n=e.isVoipPush,r=e.pushConfig||{},i=0;return i|=n?1:0,i|=t?2:0,i|=r.disablePushTitle?4:0,i|=r.forceShowDetailContent?8:0}}),Object.defineProperty(e.prototype,"_getPushExtraModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.pushTitle,n=e.iOSConfig,r=e.androidConfig,i=e.templateId,o=void 0===i?"":i,a=e.harmonyOSConfig,s=nl.getModule(ga);if(t&&s.setTitle(t),n||r||a){var u=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,f=t.imageUrlHonor,p=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=a||"active";var l={};l.collapse_key=null==s?void 0:s.collapseKey,l.imageUrl=null==s?void 0:s.imageUrl;var c=null==s?void 0:s.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:c||""}},{APNS:p.APNS},{FCM:p.FCM},{HONOR:{importance:d||Ee.NORMAL,image:f||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(h)}(n,r,a);s.setPushConfigs(u)}return(null==r?void 0:r.notificationId)&&s.setPushId(null==r?void 0:r.notificationId),s.setTemplateId(o),s}}),Object.defineProperty(e.prototype,"_getUpMsgModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.messageType,r=t.content,i=t.directionalUserIdList,o=t.canIncludeExpansion,a=t.expansion,s=t.pushConfig,u=t.channelId,l=t.pushData,c=void 0===l?"":l,d=t.pushContent,f=void 0===d?"":d,p=t.messageId,h=void 0===p?0:p,g=t.disableUpdateLastMessage,_=void 0!==g&&g,b=t.isPersited,E=t.needReceipt,v=e.conversationType,m=e.targetId,y=nl.getModule(ha),I=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var i=0;return n&&(i|=1),r&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),T=s||{},R=T.pushContent,O=void 0===R?f:R,S=T.pushData,A=void 0===S?c:S;y.setSessionId(I),O&&y.setPushText(O),A&&y.setAppData(A),i&&y.setToUserIds(i);var C=this._calculateFlag(t);if(y.setConfigFlag(C),y.setClassname(n),r.user&&r.user.portraitUri&&(r.user.portrait=r.user.portraitUri),y.setContent(JSON.stringify(r)),o&&a){var N={};ul(a,(function(e,t){N[t]={v:e}})),y.setExtraContent(JSON.stringify(N))}if(s){var P=this._getPushExtraModule(s);y.setPushExt(P)}y.setClientUniqueId(h),Rt(u)||y.setBusChannel(u),v===B.SYSTEM&&y.setSystemId(m);var w=0;return b&&_&&(w|=1),E&&(w|=2),y.setOptionBits(w),y}}),Object.defineProperty(e.prototype,"encodeUpMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._getUpMsgModule(e,t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.count,r=t.order,i=t.timestamp,o=t.channelId,a=nl.getModule(Da);return a.setTargetId(e),a.setTime(i),a.setCount(n),a.setOrder(r),a.setBusChannel(o||""),a.setCompressioEnabled(fc.enable()),a.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeOldConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(e=e||{}).count,n=e.type,r=e.startTime,i=e.order;t=t||0,r=r||0,i=i||0;var o=nl.getModule(Sa);return o.setType(n),o.setCount(t),o.setStartTime(r),o.setOrder(i),o.setCompressioEnabled(fc.enable()),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeBatchDeleteConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(qa),n=[];return e.forEach((function(e){var t=e.conversationType,r=e.targetId,i=e.channelId,o=nl.getModule(Ya);o.setConversationType(t),o.setConversationId(r),o.setBusChannel(i||""),n.push(o)})),t.setRelation(n),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"_encodeSessions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.map((function(e){var t=e.conversationType,n=e.targetId,r=nl.getModule(xa);return r.setType(t),r.setChannelId(n),r}))}}),Object.defineProperty(e.prototype,"encodeRemoveConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(Fa);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeExpandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,a=e.sendTime,s=e.keys,u={mid:o,put:e.expansion,del:s,clear:e.removeAll?1:0},l=nl.getModule(Os);return l.setFromUserId(t),l.setTargetId(n),l.setType(r),l.setBusChannel(i||""),l.setMsgUID(o),l.setMsgTime(a),l.setContent(JSON.stringify(u)),l.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,n=e.conversationType,r=e.messages,i=nl.getModule(Ns),o=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(n),i.setQuery(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUnreadMentionedMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,n=e.channelId,r=e.sentTime,i=e.count,o=nl.getModule(Na);return o.setGroupId(t),o.setBusChannel(n),o.setMsgTime(r),o.setSize(i),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(as);return n.setUnpushLevel(e),n.setBusChannel(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(os);return t.setBusChannel(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=nl.getModule(Wa),i=t.key,o=t.value,a=t.notificationExtra,s=t.isSendNotification,u=t.type,l=t.timestamp,c=u||D.UPDATE,d=Zp(t,c),f={key:i,value:o||"",uid:n,version:l};if(Rt(d)||(f.status=d),r.setEntry(f),s){var p={conversationType:B.CHATROOM,targetId:e},h={key:i,value:o,extra:a,type:c},g=this._getUpMsgModule(p,{messageType:Ie.CHRM_KV_NOTIFY,content:h,isPersited:!1,isCounted:!1});r.setNotification(g),r.setBNotify(!0),r.setType(B.CHATROOM)}return r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=nl.getModule(Qa),i=t.entries,o=t.type||D.UPDATE,a=Zp(t,o),s=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};Rt(a)||(t.status=a),s.push(t)})),r.setEntry(s),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return nl.encode(Xa,{timestamp:e,compressioEnabled:fc.enable()})}}),Object.defineProperty(e.prototype,"encodeReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(ds);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeCreateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(Es),r=[];return e.forEach((function(e){var t=nl.getModule(vs);t.setTagId(e.tagId),t.setName(e.tagName),r.push(t)})),n.setTags(r),n.setVersion(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(ds);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReadReceiptMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=nl.getModule(Gs),i=e.conversationType,o=e.targetId,a=e.channelId,s=void 0===a?"":a;return r.setType(i),r.setTargetId(o),r.setBusChannel(s),r.setStartMsgId(t),r.setEndMsgId(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(Fs),r=e.targetId,i=e.channelId,o=void 0===i?"":i;return n.setTargetId(r),n.setBusChannel(o),n.setMsgId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptCntQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(Bs),r=e.targetId,i=e.conversationType,o=e.channelId,a=void 0===o?"":o;return n.setChannelId(r),n.setBusChannel(a),n.setType(i),n.setMsgId(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUpdateUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=nl.getModule(qs);i.setSubType(e),i.setOpType(n),i.setExpiry(r);var o=[];return t.forEach((function(e){var t=nl.getModule(Ys);t.setSubUserId(e),o.push(t)})),i.setSubUsers(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,n=e.pageToken,r=nl.getModule(Ws);return r.setVersion(t),r.setPageToken(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullSubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,n=e.needAllData,r=e.pageToken,i=nl.getModule(Js);return i.setVersionTime(t),i.setNeedAllData(n),i.setPageToken(r),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQrySubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(Zs);n.setSubType(e);var r=[];return t.forEach((function(e){var t=nl.getModule(Ys);t.setSubUserId(e),r.push(t)})),n.setSubUsers(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserProfileReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(nu);return t.setUserId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfileInput",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=nl.getModule(iu);return e.setNothing(1),e.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfilePermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(ou);return t.setPermission(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSearchUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(au);return t.setUniqueId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule($s),n=[],r=[];return Object.keys(e).forEach((function(t){if("extraProfile"!==t){var i=e[t],o=nl.getModule(eu);o.setKey(t),o.setValue((null==i?void 0:i.toString())||""),n.push(o)}else if(e.extraProfile){var a=e.extraProfile;Object.keys(a).forEach((function(e){var t=a[e],n=nl.getModule(eu);n.setKey(e),n.setValue(t.toString()||""),r.push(n)}))}})),t.setUserProfile(n),t.setUserExtProfile(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMultiChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(lu),n=[];return e.forEach((function(e){var t=nl.getModule(su);t.setTargetId(e),n.push(t)})),t.setType(B.GROUP),t.setList(n),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){void 0===n&&(n=[]),void 0===r&&(r=!0);var o=nl.getModule(cu);if(o.setTargetId(t),o.setType(B.GROUP),"dismiss"!==e&&i){var a=this.encodeQuitChannelsSetting(i,r);o.setSettingInfo(a)}return"quit"!==e&&"dismiss"!==e&&o.setUsers(n),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitChannelsSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(du);return n.setIsQuit(t),n.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),n.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),n.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),n}}),Object.defineProperty(e.prototype,"encodeModifyChannelsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=nl.getModule(cu);return r.setTargetId(t),r.setType(B.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeChannelsQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,n=e.groupId,r=e.option,i=e.ids,o=nl.getModule(fu);if(n&&o.setTargetId(n),o.setType(B.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&r){var a=this.encodePagingQuery(r);o.setPage(a)}return["getGroupMembers","getJoinedGroups"].includes(t)&&o.setIds(null!=i?i:[]),e.roleType&&o.setRoleType(e.roleType),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePagingQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(pu),n=e.count,r=e.order,i=e.pageToken;return t.setSize(n),t.setOrder(r?0:1),t.setPageToken(i),t}}),Object.defineProperty(e.prototype,"encodeJoinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){void 0===n&&(n=[]);var r=nl.getModule(mu);return r.setTargetId(t),r.setType(B.GROUP),"invite"===e&&r.setUserIds(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMemberResponseInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.groupId,n=e.inviterId,r=e.optType,i=e.optResult,o=e.joinUserId,a=e.reason,s=nl.getModule(vu);return s.setTargetId(t),s.setType(B.GROUP),s.setOptType(r),s.setOptResult(i),s.setInviterId(n),r===w.MANAGER&&s.setJoinUserId(o),i||s.setDetail(null!=a?a:""),s.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=nl.getModule(Eu),r=C.ADD;return n.setTargetId(e),n.setType(B.GROUP),t||(r=C.REMOVE),n.setOperateType(r),n.setChannelNickName(t),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=nl.getModule(cu);return r.setTargetId(t),r.setType(B.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(yu);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return nl.encode(Iu,{targetId:e,type:t})}}),Object.defineProperty(e.prototype,"encodeFriendQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=null!=t?t:{},i=r.count,o=void 0===i?200:i,a=r.pageToken,s=void 0===a?"":a,u=r.order,l=void 0!==u&&u,c=nl.getModule(Su);c.setQueryType(e),11===e&&c.setFriendType(n);var d=nl.getModule(pu);return d.setSize(o),d.setOrder(l?0:1),d.setPageToken(s),c.setPage(d),c.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuerySessionsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.getModule(Ba);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),e}(),nh=function(e){function n(t,n,r){var i=e.call(this,t,n,r)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new th(i.logger),i}return t(n,e),Object.defineProperty(n.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(n.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(n.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(n.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(n.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,f,p;return a(this,(function(h){switch(h.label){case 0:if(n=t.openAnti,i=t.type,o=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(H.L_NAVI_CMP_R,JSON.stringify(s),r),0===(u=s.filter((function(e,t){return s.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(H.L_NAVI_CONF_E,"no service available",r),[2,yn(x.SERVER_UNAVAILABLE)];l=1===n?Yr.V4:Yr.V3,c=function(t){var n,s,c,f,p,h,g,_,b,E,v;return a(this,(function(a){switch(a.label){case 0:return n=u[t],s=n.protocol,c=n.addr,f=n.weight,p=function(e,t,n,r,i,o,a,s){var u,l=a?"&protocolVer=".concat(a):"",c=$l(),d=rc();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(Be,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===s?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=oa.getApiVer)||void 0===u?void 0:u.call(oa))||"||")).concat(oa.connectPlatform?"&platform=".concat(oa.connectPlatform):"").concat(l).concat(oa.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(s===q.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),h=Date.now(),[4,d.connectWebSocket(p,l,r)];case 1:return g=a.sent(),_=g.code,b=g.data,E=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),v={bid:sn(),ptc:Oe.WS,cod:_,net:d.getNetwork().type,dur:Date.now()-h,spr:0,pr:i||0,hos:c,idx:E,rct:d.retryCount?Ce.RECONNECT:Ce.CONNECT,cid:d.cid,v:Ae.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:f,ssid:d._serverSessionId},d.logger.record(ve.IM_WEBSOCKET,JSON.stringify(v),r),_===x.RC_SOCKET_DISCONNECTED||_===x.TIMEOUT?[2,"continue"]:_!==x.SUCCESS?[2,{value:yn(_)}]:(d._localConnectedTime=Math.floor((Date.now()+h)/2),d._socket=b.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:mn(b.userId)}])}}))},d=this,f=0,h.label=1;case 1:return f<u.length?[5,c(f)]:[3,4];case 2:if("object"==typeof(p=h.sent()))return[2,p.value];h.label=3;case 3:return f+=1,[3,1];case 4:return[2,yn(x.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(n.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c=this;return a(this,(function(a){return this.logger.info(H.L_CONNECT_O,"connect start: ".concat(e),n),r=Sn(),i=r.resolve,o=r.promise,s=oa.createWebSocket(e),this._socketIndex=s.id,u=x.SUCCESS,l=setTimeout((function(){c.logger.warn(H.L_CONNECT_S,"timeout",n),u=x.TIMEOUT,s.close()}),5e3),s.onOpen((function(){c.logger.info(H.L_CONNECT_S,"socket opened",n),clearTimeout(l)})),s.onError((function(e){c.logger.info(H.L_CONNECT_S,"socket error",n),clearTimeout(l);var t=x.RC_SOCKET_DISCONNECTED;i(yn(t)),c.onSocketEnd(s,t)})),s.onClose((function(){c.logger.info(H.L_CONNECT_S,"socket close",n);var e=u===x.SUCCESS?x.RC_SOCKET_DISCONNECTED:u;i(yn(e)),c.onSocketEnd(s,e)})),s.onMessage((function(e){if(c._socketIndex===s.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var r=po(e,t);if(r){if(r instanceof Xi){var o=r.status;if(o!==_i)return c.logger.warn(H.L_CONNECT_O,"connect failed: ".concat(o),n),u=Xp[o],s.close(),void i(yn(u));c.logger.info(H.L_CONNECT_O,"connect success",n);var a=r.timestamp,l=r.userId,d=r.messageId,f=r.sessionId;return c._serverSessionId=f,c._connectedTime=a,c._idCount=d,void i(mn({userId:l,socket:s}))}if(r instanceof $i){var p=r.status;return c.logger.info(H.T,"recv disconnect signal -> status: ".concat(p)),void c.onRecvDisconnect(p,s)}c._onReceiveSignal(r)}}}else c.logger.warn(H.L_WS_DISACCORD_E,JSON.stringify({socketIndex:c._socketIndex,curSocketId:s.id}))})),[2,o]}))}))}}),Object.defineProperty(n.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Hr.AT_MOST_ONCE)return e instanceof io&&!e.syncMsg?(this.logger.debug(H.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new lo(e.messageId))):void(e instanceof fo&&this._messageIds[e.messageId]&&(this.logger.debug(H.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new co(e.messageId))))}}),Object.defineProperty(n.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,n=e.topic,r=e.messageId,this.logger.debug(H.O,"recv PublishReader -> messageId: ".concat(r," ").concat(n)),n===ti?[2]:!t||function(e){return[xr.ppMsgS,xr.pgMsgS,xr.chatMsgS].includes(Kr(e))}(n)?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[r]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[r],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(n.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return e instanceof to&&this._pingResolve?(this._pingResolve(x.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof uo||e instanceof fo)&&(t=e.messageId,this.logger.debug(H.O,"recv ack -> messageId: ".concat(t)),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof io?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(n.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return zp[e]}(e)))}}),Object.defineProperty(n.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}}),Object.defineProperty(n.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(x.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(n.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(x.TIMEOUT)}),e),t.sendOnly(new eo)}))}}),Object.defineProperty(n.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof so||e instanceof ao)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(n.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(x.TIMEOUT)}),3e4)}))]):[2,yn(x.RC_NET_CHANNEL_INVALID)];case 1:return n=o.sent(),(r="number"==typeof n?n:n.status)!==x.SUCCESS&&this.logger.warn(H.L_SEND_RMTP_E,JSON.stringify({messageId:t,code:r,topic:e.topic})),"number"==typeof n?[2,yn(n)]:[2,r===x.SUCCESS?mn(n):yn(r,"",n)]}}))}))}}),Object.defineProperty(n.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this.logger.createTraceId(),s=Wr(e),this.logger.debug(H.L_QUERY_CMP_T,JSON.stringify({topic:s,targetId:t}),o),u=new ao(e,n,t),i&&u.setHeaderQos(i),[4,this._sendHandler(u)];case 1:return l=a.sent(),this.logger.summary(H.L_QUERY_CMP_R,l,o,{topic:s,targetId:t}),c=l.data,l.isOk&&void 0!==r?[2,mn(nl.decode(r,c.pbData))]:[2,l]}}))}))}}),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=a.sent()).data?r.data instanceof uo?[2,r]:(i=r.data,o=t&&i.pbData&&[x.SUCCESS,x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,x.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,x.RC_USER_PROFILE_KEY_NOT_EXIST,x.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,x.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,x.RC_USER_PROFILE_VALUE_EXCEED_RANGE,x.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(i.status)>=0,s=o?this.codec.decodeByPBName(i.pbData,t,n):i,0!==i.status?(this.logger.warn(H.O,"send failed -> messageId: ".concat(i.messageId,", respPBName: ").concat(t,", status: ").concat(i.status)),[2,yn(i.status,void 0,t&&i.pbData?s:null)]):[2,mn(s)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return n?[4,this.sendOnly(new Zi(ki))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),n}(Er),rh=function(e){function n(t,n,r){var i=e.call(this,n,t,r)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=oa.runtimeInfo,a=o.type,s=o.version;return i.deviceId=$l(),i.model="Web|".concat(a,"|").concat(s),i.init(),i}return t(n,e),Object.defineProperty(n.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return(i=r).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:n,body:JSON.stringify(i)},s=this.logger.createTraceId(),this.logger.info(H.L_REQUEST_T,JSON.stringify(o),s),[4,oa.httpReq(o)];case 1:u=a.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(H.L_REQUEST_R,JSON.stringify({status:l,data:d}),s);try{return f=JSON.parse(d),p=f.data,[2,{code:parseInt(f.code,10),data:p}]}catch(e){return this.logger.warn(H.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(n.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ot(this.appkey);oa.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(n.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=ot(this.appkey),t=oa.localStorage.getItem(e);return this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(n.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(H.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(n.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),n}(_r),ih=function(e){function n(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return Object.defineProperty(o,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),Kp.set(o,void 0),Wp.set(o,pt),d(o,Kp,new Xl(st(t)),"f"),o}return t(n,e),Object.defineProperty(n.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,Wp,e,"f")}}),Object.defineProperty(n.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Wp,"f")}}),Object.defineProperty(n.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return c(this,Kp,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(n.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:c(this,Kp,"f").get(e)}}catch(e){return{success:!1}}}}),n}(tr);Kp=new WeakMap,Wp=new WeakMap;var oh=null,ah="RC_LOGS",sh="RC_STATISTICS",uh=((Qp={})[ah]=["level","time"],Qp[sh]=["level","time"],Qp),lh=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-n),a=i.openCursor(o);a.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):r()},a.onerror=function(){r()}}))},ch=null,dh=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,oh];case 1:return(t=r.sent())?(n=t.db,[4,lh(n,ah,e)]):[2];case 2:return r.sent(),[4,lh(n,sh,e)];case 3:return r.sent(),ch=setTimeout((function(){return dh(e)}),6e5),[2]}}))}))},fh=function(e,t,n){void 0===n&&(n=168),oh||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==oa.runtimeInfo.type?oh=new Promise((function(r){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(n){n.forEach((function(n){n.name&&e.includes(n.name)&&t.deleteDatabase(n.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),a=i.open(o,2);a.onerror=function(e){t.error(H.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},a.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){oh=null,t.warn(H.L_LOGDB_CLOSED_S)},o.onerror=function(e){oh=null,t.error(H.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(H.L_LOGDB_ABORT_S,e.target.error)},dh(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:o})):r(null)},a.onupgradeneeded=function(e){var t=e.target.result;Object.keys(uh).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var n=t.createObjectStore(e,{autoIncrement:!0});uh[e].forEach((function(e){return n.createIndex(e,e,{unique:!1})}))}))}})):t.warn(H.L_UNSUPPORT_INDEXDB_O))},ph=[],hh=function(e,t,n){return new Promise((function(r){var i=e.transaction(t,"readwrite");i.oncomplete=r,i.onabort=r;var o=i.objectStore(t);n.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},gh=[],_h=!1,bh=function(e){return o(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return _h||0===gh.length?[2]:(_h=!0,t=gh.filter((function(e){return e.level<Jn.FATAL})),n=gh.filter((function(e){return e.level>=Jn.FATAL})),gh.length=0,[4,hh(e,ah,n)]);case 1:return r.sent(),[4,hh(e,sh,t)];case 2:return r.sent(),_h=!1,0===gh.length&&ph.length>0&&(ph.forEach((function(e){return e.close()})),ph.length=0),setTimeout((function(){return bh(e)})),[2]}}))}))},Eh=function(){var e=ur();return e.setLogReader((function(e,t,n,r,i){return void 0===i&&(i=ah),o(void 0,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,oh];case 1:return(o=a.sent())?[2,new Promise((function(a){var s=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=n&&(r?i.sessionId===ft:i.level>=0)&&u.push(i),t.continue()}else a({logs:u})},c.onerror=function(){a({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,oh];case 1:if(!(t=n.sent()))return[2];if(e.content&&ht(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return gh.push(e),bh(t.db),[2]}}))}))}(e)})),e},vh="REPORT_SESSION",mh=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){return n="".concat(vh,"_").concat(e),r=t.getSessionId(),i=t.getConf(n),o=i.success,s=i.value,o?(r===(null==s?void 0:s.sessionId)||t.setConf(n,{sessionId:r}),[2]):[2]}))}))},yh=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){return n=t.getSessionId(),r=t.getConf("".concat(vh,"_").concat(e)),i=r.success,o=r.value,[2,i&&(null==o?void 0:o.sessionId)===n]}))}))},Ih=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-Ih),void 0===n&&(n=Date.now()),o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>Ih&&(t=n-Ih),r=ur(),(i=new ih(e,"RC-IM","IM",r)).debug(H.T,"get logs: startTime ".concat(t," endTime ").concat(n)),fh(e,i),[4,r.read(t,n,Jn.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(H.T,"get logs ".concat(o.length)),function(e,t){var n=t.map((function(e){var t=e.sessionId,n=e.time,r=e.type,i=e.level,o=e.tag,a=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(n,",").concat(r,",").concat(i,",").concat(o,",").concat(a,",").concat(s,',"').concat(u,'"\n')})),r=new Blob(n,{type:"text/csv"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(n),o),[2]}}))}))}}}}var Th,Rh,Oh,Sh,Ah,Ch=function(e){function n(t,n,r,i){var o,a=$l(),s=oa.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(n.getSessionId(),"|").concat(oa.connectPlatform);return o=e.call(this,t,a,c,i,n)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return t(n,e),Object.defineProperty(n.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return oa.httpReq(e)}}),Object.defineProperty(n.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,mh(t.userId,this.logger)];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(n.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,{success:!0,data:Ec(e.map(rr).join(""))}]}))}))}}),Object.defineProperty(n.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r,this.tableName)]}))}))}}),n}(nr),Nh=function(e){function n(t,n,r){return e.call(this,t,n,ah,r)||this}return t(n,e),Object.defineProperty(n.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,yh(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(n.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r,i,s,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return o=a.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,n,r,i,s,u,l)]}}))}))}}),n}(Ch),Ph=function(e){function n(t,n,r){return e.call(this,t,n,sh,r)||this}return t(n,e),n}(Ch),wh=function(e){function n(t,n){var r=e.call(this)||this;return Th.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),Rh.set(r,!1),r._ctx.on("sCmd",c(r,Th,"m",Sh),r),r._ctx.on("onConnected",c(r,Th,"m",Oh),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,c(this,Th,"m",Ah).call(this,e)];case 1:return[2,t.sent().trans((function(e){return{version:e.version}}))]}}))}))}}),Object.defineProperty(n.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,Th,"m",Ah).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),n}(gn);Rh=new WeakMap,Th=new WeakSet,Oh=function(){d(this,Rh,!0,"f")},Sh=function(e,t){var n=t.type,r=t.time;if(3===n)this.push(r),e.stopPropagation()},Ah=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,n=t.createTraceId(),t.info(H.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),n),r=nl.encode(ns,{time:e}),[4,this._ctx.query(xr.pullSeAtts,this._ctx.currentUserId,r,rs)];case 1:return i=a.sent(),t.summary(H.L_PULL_CONVERSATION_SETTINGS_R,i,n,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),c(this,Rh,"f")&&(d(this,Rh,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var Mh,Lh,Uh,Dh,Vh=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._memData[e],r=n.key,i=n.stringify;n.value=t;var o=i?JSON.stringify(t):t;oa.localStorage.setItem(r,o)}}),e}(),jh=function(e,t,n){return"".concat(null!=n?n:"","_").concat(e,"_").concat(t)},Gh=function(e){var t=u(e.split("_")),n=t[0],r=t[1],i=t.slice(2);return{channelId:n,conversationType:parseInt(r,10),targetId:i.join("_")}};function kh(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=u(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var Fh=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:me.NOT_SET,translateStrategy:Ur.DEFAULT,tags:[],channelType:te.PUBLIC,operationTime:0,draft:"",hidden:!1}},xh=function(){function e(e){Mh.set(this,void 0),Lh.set(this,void 0),Uh.set(this,void 0),Dh.set(this,Fh()),d(this,Mh,e.conversationType,"f"),d(this,Lh,e.targetId,"f"),d(this,Uh,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,Mh,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,Lh,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,Uh,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,Dh,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,Dh,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,Dh,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,Dh,"f").notificationLevel||me.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,Dh,"f").translateStrategy||Ur.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,Dh,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return c(this,Dh,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,Dh,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,Dh,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,Dh,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,Dh,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,Dh,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,Dh,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,Dh,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,Dh,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,Dh,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,Dh,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,Dh,"f").draft||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessage",{get:function(){return this.firstUnreadTime?{sentTime:this.firstUnreadTime,messageType:this.firstUnreadMessageType,messageUId:this.firstUnreadMessageUId}:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return{conversationType:c(this,Mh,"f"),targetId:c(this,Lh,"f"),channelId:c(this,Uh,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return jh(c(this,Mh,"f"),c(this,Lh,"f"),c(this,Uh,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return r(r({},this.id),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,notificationStatus:Le(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==me.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==Ur.DEFAULT&&(e.ts=this.translateStrategy),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(r(r({},Fh()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;void 0===t&&(t=0);var r={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,unreadMentionedCount:void 0,unreadMentionedMeCount:void 0,channelType:void 0,operationTime:void 0,draft:void 0,hidden:void 0};return Object.entries(i).forEach((function(i){var o=u(i,2),a=o[0],s=o[1],l=a;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(n,Dh,"f")[l]!==d&&(c(n,Dh,"f")[l]=d,s&&(r[s]={time:t,val:d}))}})),Object.keys(r).length>0?r:null}}),e}();Mh=new WeakMap,Lh=new WeakMap,Uh=new WeakMap,Dh=new WeakMap;var Bh,Hh,qh,Yh,Kh=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toStoragItem.call(this);return this.unreadCount>0&&(t.c=this.unreadCount),this.unreadMentionedCount>0&&(t.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(t.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(t.hm=!0),this.mentionedInfo&&(t.m=this.mentionedInfo),this.firstUnreadMessageUId&&(t.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(t.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(t.fut=this.firstUnreadTime),this.lastReadTime&&(t.rt=this.lastReadTime),t}}),n}(xh),Wh=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toIReceivedConversation.call(this);return t.channelType=this.channelType,t}}),Object.defineProperty(n.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),n}(xh),Qh=function(e){function n(t){var n=e.call(this)||this;return Bh.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Hh.set(n,new Map),n}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=oa.localStorage,n=e.appkey,r=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=$e(n,r),a=Ze(n,r),s=et(n,r),u=Je(n,r),l=Qe(n,r),d=ze(n,r),f=Xe(n,r),p=t.getItem(o)||"0",h=t.getItem(a)||"0",g=t.getItem(s)||"1",_=t.getItem(l)||"0",b=JSON.parse(t.getItem(f)||"{}"),E=JSON.parse(t.getItem(u)||"{}"),v=JSON.parse(t.getItem(d)||"{}");return c(this,Bh,"m",qh).call(this,E,v,b,i),{inboxTime:{value:parseInt(p,10)||0,key:o},outboxTime:{value:parseInt(h,10)||0,key:a},broadcastTime:{value:parseInt(g,10)||0,key:s},conversationStatus:{value:E,key:u,stringify:!0},ultraGroupStatus:{value:v,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(_,10)||0,key:l},conversationTypeGlobalSettings:{value:b,key:f,stringify:!0}}}}),Object.defineProperty(n.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),c(this,Hh,"f").clear(),c(this,Bh,"m",Yh).call(this)}}),Object.defineProperty(n.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("conversationTypeGlobalSettings");t===me.NOT_SET?delete n[e]:n[e]={nl:t},this.set("conversationTypeGlobalSettings",n)}}),Object.defineProperty(n.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return(null===(t=this.get("conversationTypeGlobalSettings")[e])||void 0===t?void 0:t.nl)||me.NOT_SET}}),Object.defineProperty(n.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=jh(e.conversationType,e.targetId,e.channelId),r=c(this,Hh,"f").get(n);return r||(r=e.conversationType===B.ULTRA_GROUP?new Wh(e):new Kh(e),t&&c(this,Hh,"f").set(n,r)),r}}),Object.defineProperty(n.prototype,"getUGFistUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=jh(B.ULTRA_GROUP,e,t),r=c(this,Hh,"f").get(n);return(null==r?void 0:r.firstUnreadMessage)||null}}),Object.defineProperty(n.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),n=this.get("conversationStatus");e.forEach((function(e){var r=e.conversationType,i=e.key,o=e.toStoragItem(),a=Object.keys(o),s=0===a.length||1===a.length&&"h"===a[0],u=r===B.ULTRA_GROUP?t:n;s?delete u[i]:u[i]=o})),this.set("conversationStatus",n),this.set("ultraGroupStatus",t)}}),Object.defineProperty(n.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.version,i=e.state;if(this.set("conversationStatusVersion",n),!(null==i?void 0:i.length))return[];var o=new Map,a=new Set;return i.forEach((function(e){var r=e.channelId,i=e.busChannel,s=e.type,u=e.stateItem;e.time;var l={};if(null==u||u.forEach((function(e){var t=e.tags,n=e.sessionStateType,r=e.value;switch(n){case da.IsSilent:l.notificationLevel=parseInt(r,10);break;case da.IsTop:l.isTop="1"===r;break;case da.Tags:l.tags=t;break;case da.AutoTrans:l.translateStrategy=parseInt(r,10)}})),r){var d=jh(s,r,i),f=Gh(d),p=c(t,Hh,"f").get(d);p||(p=s===B.ULTRA_GROUP?new Wh(f):new Kh(f),c(t,Hh,"f").set(d,p)),a.add(p);var h=p.updateAttrs(l,n);if(h)if(o.has(p)){var g=o.get(p);Object.assign(g,h)}else o.set(p,h)}else void 0!==l.notificationLevel&&t.setConversationTypeNotificationLevel(s,l.notificationLevel)})),this.updateConversationStorage(Array.from(a)),Array.from(o.entries()).map((function(e){var t=u(e,2),n=t[0],i=t[1];return r(r({},n.toIReceivedConversation()),{updatedItems:i})}))}}),Object.defineProperty(n.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this;e.forEach((function(e){var i=e.userId,o=e.type,a=e.busChannel,s=jh(o,i,a),u=Gh(s),l=r.getOrCreateModel(u,!0),c=function(e,t,n){var r,i,o,a=e.msg;return{latestMessage:a?uc(a,t,n):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(r=e.msgInfo)||void 0===r?void 0:r.className,firstUnreadMessageUId:null===(i=e.msgInfo)||void 0===i?void 0:i.msgId,firstUnreadTime:null===(o=e.msgInfo)||void 0===o?void 0:o.msgTime}}(e,t,n);o===B.ULTRA_GROUP?l.updateAttrs(c,e.versionTime||0):l.updateAttrs({latestMessage:c.latestMessage,operationTime:c.operationTime,hidden:!1},e.versionTime||0)}))}}),Object.defineProperty(n.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=jh(e.conversationType,e.targetId,e.channelId);return(null===(t=c(this,Hh,"f").get(n))||void 0===t?void 0:t.draft)||""}}),Object.defineProperty(n.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(n.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=jh(e.conversationType,e.targetId,e.channelId),n=c(this,Hh,"f").get(t);n&&n.updateAttrs({draft:""})}}),Object.defineProperty(n.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=jh(B.ULTRA_GROUP,e,t),r=c(this,Hh,"f").get(n);return(null==r?void 0:r.toIReceivedConversation())||null}}),Object.defineProperty(n.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Hh,"f").values();return Array.from(e).filter((function(e){return e.conversationType===B.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Hh,"f").values();return Array.from(e).filter((function(e){return e.conversationType!==B.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(n.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(c(this,Hh,"f").values())}}),Object.defineProperty(n.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=jh(e.conversationType,e.targetId,e.channelId);return c(this,Hh,"f").get(t)||null}}),Object.defineProperty(n.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=jh(t,n,r),o=c(this,Hh,"f").get(i);o&&(o.remove(),this.updateConversationStorage([o]))}}),Object.defineProperty(n.prototype,"updateConversationCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getOrCreateModel(e,!0);n.updateAttrs(t,0),this.updateConversationStorage([n])}}),Object.defineProperty(n.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=0;return this.getAllSGModels().forEach((function(r){var i,o=r.conversationType;e.includes(o)&&(r.notificationLevel>me.NOT_SET&&!t||(n+=null!==(i=r.unreadCount)&&void 0!==i?i:0))})),n}}),Object.defineProperty(n.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=0;return this.getAllSGModels().forEach((function(t){var n;e+=null!==(n=t.unreadMentionedCount)&&void 0!==n?n:0})),e}}),Object.defineProperty(n.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var n=t.tags;n.length>0&&n.forEach((function(n){e.set(n.tagId,(e.get(n.tagId)||[]).concat(t.id))}))})),e}}),Object.defineProperty(n.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=0;return this.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,a=i.unreadCount,s=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(r+=n?s:a)}})),r}}),Object.defineProperty(n.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){var o=jh(e,t,n),a=c(this,Hh,"f").get(o);if(!a)return null;var s=a.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:i,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0});return this.updateConversationStorage([a]),s?r(r({},a.toIReceivedConversation()),{updatedItems:s}):null}}),n}(Vh);function Jh(e){return Object.keys(e).map((function(t){var n=e[t];return"string"!=typeof n&&(n="".concat(n)),{key:t,value:n}}))}function zh(e,t,n,r){return nl.encode(su,{targetId:e,type:B.GROUP,users:r,extProfile:n?Jh(n):void 0,settingProfile:Jh(t)})}Hh=new WeakMap,Bh=new WeakSet,qh=function(e,t,n,r){var i=!1;Object.keys(e).forEach((function(t){var r=Gh(t);if(!ee(r.conversationType,W))return delete e[t],void(i=!0);r.targetId||(n[r.conversationType]={nl:e[t].nl||me.NOT_SET},delete e[t],i=!0)})),Object.keys(t).forEach((function(e){var o=Gh(e);return o.conversationType!==B.ULTRA_GROUP?(delete t[e],void(i=!0)):o.targetId?void(r&&!o.channelId&&(delete t[e],i=!0)):(n[o.conversationType]={nl:t[e].nl||me.NOT_SET},delete t[e],void(i=!0))})),i&&(this.set("conversationStatus",e),this.set("ultraGroupStatus",t),this.set("conversationTypeGlobalSettings",n))},Yh=function(){var e=this,t=Object.entries(this.get("conversationStatus")),n=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(n),!1).forEach((function(t){var n,r,i,o,a,s,l,c,d,f,p,h,g,_,b,E=u(t,2),v=E[0],m=E[1],y=Gh(v);ee(y.conversationType,J)&&e.getOrCreateModel(y,!0).updateAttrs((r=(n=m).c,i=n.mc,o=n.mmc,a=n.hm,s=n.m,l=n.fut,c=n.fuid,d=n.fumt,f=n.nl,p=n.to,h=n.tg,g=n.rt,_=n.h,b=n.ts,{isTop:p,notificationLevel:f,tags:kh(h),unreadCount:r,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:a,mentionedInfo:s,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:g,hidden:_,translateStrategy:b}),0)}))};var Xh,Zh,$h,eg,tg,ng,rg,ig,og,ag,sg=function(e,t){return nl.encode(ka,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},ug=function(e){var t=nl.decode(Ca,e),n=t.compressioEnabled,r=t.compressedData,i=t.info,o=t.pullTime,a=t.isFinished;if(n){var s=Jp(r);return ug(s)}return{info:i,pullTime:o,isFinished:a}},lg=function(e){var t=nl.decode(_a,e);if(t.compressioEnabled){var n=Jp(t.compressedData);return lg(n)}return t},cg=function(e){var t=nl.decode(ba,e);if(t.compressioEnabled){var n=Jp(t.compressedData);return cg(n)}return{syncTime:t.syncTime,list:t.list.map((function(e){return nl.decode(Ea,new Uint8Array(e))}))}},dg=function(e){return nl.encode(ps,r(r({},e),{compress:fc.enable()}))},fg=function(e){var t=nl.decode(gs,e);if(t.compress){var n=Jp(t.compressData);return fg(n)}return t},pg=function(e){var t=nl.decode(_s,e);if(t.compress){var n=Jp(t.compressData);return pg(n)}return t},hg=function(e){var t=nl.decode(Va,e);if(t.compressioEnabled){var n=Jp(t.compressedData);return hg(n)}return t},gg=function(e,t){return nl.encode(is,{ignoreVersion:!0,version:e,state:t})},_g=function(e){var t=nl.decode(Yu,e);if(t.compress){var n=Jp(t.compressedData);return _g(n)}return t},bg=function(e){function n(t,n){var r=e.call(this)||this;return Xh.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),r._ctx.on("sNtf",c(r,Xh,"m",tg),r),r._ctx.on("signal",c(r,Xh,"m",$h),r),r._ctx.on("syncMsg",c(r,Xh,"m",Zh),r),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,f,p,h,g,_,b,E,v;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.logger,r=t.currentUserId,i=t.connectedTime,o=this._storage.get("inboxTime"),s=this._storage.get("outboxTime"),u=this._storage.get("broadcastTime"),l=n.createTraceId(),n.info(H.L_PULL_MSG_T,JSON.stringify({inboxTime:o,outboxTime:s,broadcastTime:u}),l),c=nl.encode(pa,{ispolling:!1,isPullSend:!0,syncTime:o,sendBoxSyncTime:s,broadcastSyncTime:u,compressioEnabled:fc.enable()}),[4,this._ctx.query(xr.pullMsg,this._ctx.currentUserId,c)];case 1:return d=a.sent(),n.summary(H.L_PULL_MSG_R,d,l,{inboxTime:o,outboxTime:s,broadcastTime:u}),d.isOk?(f=lg(d.data.pbData),h=(p=f).list,g=p.finished,_=p.syncTime,b=p.broadcastSyncTime,E=s,v=h.map((function(e){var t=uc(e,r,i);return t.messageDirection===be.SEND&&(E=Math.max(E,t.sentTime)),t})),this._storage.set("inboxTime",_),this._storage.set("broadcastTime",b||1),this._storage.set("outboxTime",E),this._ctx.emit("messagesFromSG",v,!!g,e),[2,mn({version:_,hasNext:!g})]):[2,d.wipe()]}}))}))}}),n}(gn);Xh=new WeakSet,Zh=function(e,t){var n=t.conversationType;n!==B.ULTRA_GROUP&&n!==B.CHATROOM&&this.waitingQueueLength>0&&(this.push(t.sentTime),e.stopPropagation())},$h=function(e,t){t.syncMsg,Kr(t.topic)===xr.s_msg&&(c(this,Xh,"m",eg).call(this,t),e.stopPropagation())},eg=function(e){var t=this._ctx,n=t.logger,r=t.currentUserId,i=t.connectedTime,o=nl.decode(Ea,e.pbData),a=uc(o,r,i),s=a.conversationType,u=a.messageType,l=a.senderUserId,c=a.messageUId,d=a.sentTime,f=a.isStatusMessage;if(n.info(H.L_RECV_S_MSG_O,JSON.stringify({messageUId:c,messageId:a.messageId,sentTime:d})),s===B.RTC_ROOM||u===Ie.INTERCEPT){if(this._isPulling)return;if(this.waitingQueueLength>0)return void this.push(a.sentTime)}f||l===r||this._storage.set("inboxTime",d),this._ctx.emit("smsgFromSignalGroup",a)},tg=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var Eg,vg,mg=function(e){function n(t){var n=e.call(this)||this;return ng.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n._ctx.on("syncMsg",c(n,ng,"m",ig),n),n._ctx.on("sCmd",c(n,ng,"m",rg),n),n}return t(n,e),Object.defineProperty(n.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,ng,"m",ag).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(H.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,ng,"m",og).call(this,0,[])]):(this._ctx.logger.warn(H.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(n=a.sent()).isOk?(r=n.data,i=r.length>0?r[r.length-1].versionTime:0,o=Math.max(t,i),[2,mn({relations:r,msgVersion:o})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(n){switch(n.label){case 0:return[4,c(this,ng,"m",ag).call(this,e)];case 1:return[2,n.sent().trans((function(e){var n=e,r=n.syncTime,i=n.finished,o=n.list;if(null==o?void 0:o.length){var a=t._ctx,s=a.currentUserId,u=a.connectedTime,l=o.map((function(e){return uc(e,s,u)}));t._ctx.emit("messagesFromUG",l,r)}return{version:r,hasNext:!i}}))]}}))}))}}),n}(gn);ng=new WeakSet,rg=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},ig=function(e,t){t.conversationType===B.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},og=function e(t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,d,f,p,h,g;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx,i=r.logger,o=i.createTraceId(),i.info(H.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),s=nl.encode(Ts,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(xr.pullUgSes,this._ctx.currentUserId,s,Ca)];case 1:return d=a.sent(),i.summary(H.L_PULL_UG_RELATIONS_R,d,o,{ver:t},(function(e){return{isFinished:e.isFinished}})),d.isOk?(f=d.data,p=f.info,h=f.isFinished,n.push.apply(n,l([],u(p),!1)),h?[2,mn(n)]:(g=p[p.length-1].versionTime,[2,c(this,ng,"m",e).call(this,g,n)])):[2,d.wipe()]}}))}))},ag=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=r.createTraceId(),r.info(H.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=nl.encode(Rs,{syncTime:l,compressioEnabled:fc.enable()}),[4,this._ctx.query(xr.pullUgMsg,n,o)];case 1:return s=a.sent(),r.summary(H.L_PULL_ULTRA_MSG_R,s,i,{version:e}),s.isOk?(u=s.data,[2,mn(lg(u.pbData))]):[2,s.wipe()]}var l}))}))};var yg=13,Ig=36,Tg=41,Rg=function(e){function n(t,n){var r=e.call(this)||this;return Eg.add(r),Object.defineProperty(r,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),r}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l,d=this;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,Eg,"m",vg).call(this,e)];case 1:return n=a.sent(),this._logger.summary(H.L_PULL_EVENT_CHANGE_R,n,t,{version:e}),n.isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.hasNext,i.length&&(l=new Map,i.forEach((function(e){var t=e.changeType;l.has(t)?l.get(t).push(e):l.set(t,[e])})),Array.from(l.entries()).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];d.emit("serverEvent",n,r)}))),[2,mn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(H.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,Eg,"m",vg).call(this,0)];case 1:return t=n.sent(),this._logger.summary(H.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),n}(gn);Eg=new WeakSet,vg=function(e){var t=nl.encode(Ss,{syncTime:e});return this._con.query(xr.pullEventChange,this._con.getCurrentUserId(),t,As)};var Og,Sg,Ag,Cg,Ng,Pg,wg,Mg,Lg,Ug,Dg,Vg,jg,Gg,kg,Fg,xg,Bg,Hg,qg,Yg,Kg,Wg,Qg,Jg,zg,Xg,Zg,$g,e_,t_,n_=function(e){function n(t){var n=e.call(this)||this;return Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),n}return t(n,e),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=nl.encode(Ss,{syncTime:e}),[4,this._ctx.query(xr.qryMsgChange,this._ctx.currentUserId,t,Cs)];case 1:return(n=a.sent()).isOk?(r=n.data,i=r.list,o=r.syncTime,s=r.hasNext,i&&i.length&&this._ctx.emit("ugChanged",i),[2,mn({version:o,hasNext:s})]):[2,n.wipe()]}}))}))}}),n}(gn),r_=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,x.NOT_SUPPORT]}))}))},i_=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,yn(x.NOT_SUPPORT,"Not support")]}))}))},o_=function(e){function n(t,n){var r=e.call(this)||this;return Og.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"storage",{enumerable:!0,configurable:!0,writable:!0,value:n}),Sg.set(r,0),Ag.set(r,!0),r._ctx.on("onConnected",c(r,Og,"m",Cg),r),r._ctx.on("messagesFromSG",c(r,Og,"m",Ng),r),r}return t(n,e),Object.defineProperty(n.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setInitVersion(c(this,Sg,"f"),!0)}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(H.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),f={pullVersion:e},n=nl.encode(qu,r(r({},f),{compress:fc.enable()})),[4,this._ctx.query(xr.pullModifyMsg,this._ctx.currentUserId,n,void 0)];case 1:return i=a.sent(),this._ctx.logger.summary(H.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=_g(i.data.pbData),s=o.msg,u=o.nextVersion,l=o.finished,s&&s.length&&c(this,Og,"m",Pg).call(this,s),c(this,Ag,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!l),d(this,Ag,!1,"f")),[2,mn({version:u,hasNext:!l})]):[2,i.wipe()]}var f}))}))}}),n}(gn);Sg=new WeakMap,Ag=new WeakMap,Og=new WeakSet,Cg=function(e,t){d(this,Ag,!0,"f"),t||(this.reset(),d(this,Sg,this._ctx.connectedTime,"f"))},Ng=function(e,t,n,r){0===r&&t.length>0&&d(this,Sg,t[0].sentTime,"f")},Pg=function(e){var t=this,n=[],r=this._ctx,i=r.currentUserId,o=r.connectedTime;e.forEach((function(e){var r=e.msg,a=uc(r,i,o);n.push(a);var s=a.conversationType,u=a.targetId,l=a.channelId,c=t.storage.getModel({conversationType:s,targetId:u,channelId:l});if(c&&c.latestMessage){var d=c.latestMessage,f=d.messageUId,p=d.messageType,h=d.content;if(f!==a.messageUId){if(p===Ie.REFERENCE){if(h.referMsgUid!==a.messageUId)return;h.referMsg=a.content}}else c.updateAttrs({latestMessage:a})}})),this._ctx.emit("messageModified",n)};var a_=18e4,s_=function(){function e(e,t){Mg.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Lg.set(this,void 0),Ug.set(this,void 0),Dg.set(this,void 0),Vg.set(this,void 0),xg.set(this,1),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Zg.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:i_}),this.storage=new Qh(e),this.settings=new wh(this._ctx,this.storage),d(this,Lg,new mg(this._ctx),"f"),d(this,Ug,new bg(this._ctx,this.storage),"f"),d(this,Dg,new n_(this._ctx),"f"),d(this,Vg,new o_(this._ctx,this.storage),"f"),this._ctx.on("onConnected",c(this,Mg,"m",Fg),this),this._ctx.on("onDisconnected",c(this,Mg,"m",qg),this),this._ctx.on("onSuspend",c(this,Mg,"m",qg),this),this._ctx.on("sCmd",c(this,Mg,"m",Yg),this),this._ctx.on("signal",c(this,Mg,"m",Kg),this),this._ctx.on("serverEvent",c(this,Mg,"m",jg),this)}return Object.defineProperty(e.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,Vg,"f").startPullModifyMsg()}}),Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(e.type){case Ar.TIMESTAMP:return[2,c(this,Mg,"m",Wg).call(this,e.params)];case Ar.BLOCKED:return[2,c(this,Mg,"m",Jg).call(this)];case Ar.TOP:return[2,c(this,Mg,"m",Qg).call(this,e.params)];case Ar.UNREAD:return[2,c(this,Mg,"m",zg).call(this,e.params)];default:return[2,yn(x.NOT_SUPPORT)]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){return r=this._ctx.includeUg,i=0,o=t&&t.length?t:$(r?J:W),this.storage.getAllModels().forEach((function(t){t.unreadCount>0&&o.includes(t.conversationType)&&(t.conversationType!==B.ULTRA_GROUP&&t.channelId===e||t.conversationType===B.ULTRA_GROUP&&(""===t.channelId||"RCDefault"===t.channelId))&&(n||t.notificationLevel<=me.NOT_SET)&&(i+=t.unreadCount)})),[2,mn(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:n},!1),[2,mn(r.toIReceivedConversation())]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,Mg,"m",Xg).call(this,e,n,t)];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.version,u=o.updateVersion,l=e.map((function(e){var n=d.storage.getOrCreateModel(e,!0);return n.updateAttrs({isTop:t,hidden:!r&&n.hidden,operationTime:n.hidden&&r?Date.now():n.operationTime}),n})),this.storage.updateConversationStorage(l),u&&this.storage.set("conversationStatusVersion",s),[2,mn()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,Mg,"m",Xg).call(this,e,n,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({notificationLevel:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,mn()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),[4,c(this,Mg,"m",Xg).call(this,e,n,void 0,void 0,t)];case 1:return(r=a.sent()).isOk?(i=r.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var n=l.storage.getOrCreateModel(e,!0);return n.updateAttrs({translateStrategy:t}),n})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,mn()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.storage.getOrCreateModel(e,!1),[2,mn(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return t=this.storage.getConversationTypeNotificationLevel(e),[2,mn(t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=this._ctx.currentUserId,i=nl.encode(ls,{type:e,unpushLevel:t,version:n,ignoreVersion:!0}),[4,this._ctx.query(xr.setTypeUnpush,r,i,cs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,mn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this._ctx.includeUg,t=this.storage.getAllSGModels(),e&&t.push.apply(t,l([],u(this.storage.getAllUGModels().filter((function(e){return e.isDefaultChannel()}))),!1)),t.forEach((function(e){e.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0})})),this.storage.updateConversationStorage(t),[2,mn()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),r=nl.encode(Ka,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:n}),i=e.conversationType===B.ULTRA_GROUP?xr.delUgMsg:xr.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,r)];case 1:return(o=a.sent()).isOk?this._ctx.includeUg?((s=this.storage.getModel(e))&&(u=s.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&s.updateAttrs({latestMessage:null}),[2,mn()]):[2,mn()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=nl.encode(wa,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),r=p_[e.conversationType],[4,this._ctx.query(r,this._ctx.currentUserId,n)];case 1:return(i=a.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(s=o.latestMessage)&&(0===t||s.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,mn()]):[2,mn()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=nl.encode(Ma,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(xr.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(n=i.sent()).isOk?(e.forEach((function(e){var t=r.storage.getModel(e);if(t){var n=t.latestMessage;n&&(!e.timestamp||n.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,mn()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=nl.encode(fs,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),r=t[0],[4,this._ctx.query(xr.readReceipt,r,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return t=new Map,e.forEach((function(e){var n,r=(n=e.identifier,jh(n.conversationType,n.targetId,n.channelId)),i=t.get(r)||new Set;i.add(e.messageUId),t.set(r,i)})),n=Array.from(t.entries()).map((function(e){var t=u(e,2),n=t[0],r=t[1],i=Gh(n);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(r)}})),r=function(e){return nl.encode(hs,{items:e,compress:fc.enable()})}(n),[4,this._ctx.query(xr.qryReceiptBatch,e[0].messageUId,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=pg(o.pbData).item,l=[],s.forEach((function(e){var t,n={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,r=e.unreadCnt,i=e.readCnt,o=e.totalCnt;l.push({identifier:n,messageUId:t,unreadCount:r,readCount:i,totalCount:o})}))})),[2,mn(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return r=0===n.readStatus?1:2,i=dg({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:n.pageToken,pageSize:n.pageCount,readType:r,order:n.order?0:1}),[4,this._ctx.query(xr.qryReceipt,t,i)];case 1:return(o=a.sent()).isOk?(s=o.data,u=fg(s.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,mn({pageToken:c||"",totalCount:1===r?d.readCnt:d.unreadCnt,users:(1===r?d.readUser:d.unreadUser).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return r=dg({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:n}),[4,this._ctx.query(xr.qryReceipt,t,r)];case 1:return(i=a.sent()).isOk?(o=i.data,s=fg(o.pbData).resp,c=s[0],[2,mn({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,n=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!n}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){if((n=In.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===Ie.HQ_VOICE||e===Ie.VOICE}),!0).fail(x.INVALID_PARAMETER_MESSAGE_TYPE)).isFailed)return[2,n.result().wipe()];if(t.messageType===Ie.HQ_VOICE){if(r=t.numberOfChannels,i=t.sampleRate,o=t.format,s=t.remoteUrl,n.validate("numberOfChannels",r,(function(e){return 1===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",i,(function(e){return 16e3===e||8e3===e}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",o).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").validate("remoteUrl",s,(function(e){return e.startsWith("http")}),!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid"),n.isFailed)return[2,n.result().wipe()]}else u=t.content,n.isNotEmptyString("content",u,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid");return n.isLimitedInteger("duration",t.duration,1,60,!0).fail(x.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid"),n.isFailed?[2,n.result().wipe()]:c(this,Zg,"f").has(e)?[2,yn(x.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,Mg,"m",$g).call(this,e,t),[2,mn()])}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=e.messageUId,n=e.messageContent,r=e.conversation,i=nl.encode(Os,{targetId:r.targetId,type:r.conversationType,busChannel:r.channelId,msgUID:t,msgTime:0,content:JSON.stringify(n),fromUserId:""}),[4,this._ctx.query(xr.modifyMsg,this._ctx.currentUserId,i,void 0)];case 1:return(o=a.sent()).isOk?((s=this.storage.getModel(r))&&(u=s.latestMessage,l=s.conversationType,u&&u.messageUId===t&&(u.content=n,u.isModifyMessage=!0,u.modifyInfo=l===B.ULTRA_GROUP?void 0:{timestamp:o.data.timestamp,status:qn,content:{}},s.updateAttrs({latestMessage:u}))),[2,mn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s=this;return a(this,(function(a){return(o=In.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&&mt(t[e])}))}),!0).fail(x.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){r([]),c(s,Mg,"m",e_).call(s,e,t,n,i)}),0),[2,mn()]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s,l,c,d,f,p,h,g,_,b=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?(n=this.storage.get("conversationStatusVersion"),i=Date.now(),o=this._ctx.currentUserId,s=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:i,stateItem:[{sessionStateType:da.Tags,value:"",tags:[{tagId:e}]}]}})),l=gg(n,s),[4,this._ctx.query(xr.addTag,o,l,us)]):[2,yn(x.TAG_NOT_EXIST)];case 1:return(c=a.sent()).isOk?(d=c.data,f=d.version,p=d.updateVersion,h=new Map,t.forEach((function(t){var n=b.storage.getOrCreateModel(t,!0),r={},i=n.tags;i.some((function(t){return t.tagId===e}))||(r.tags=i.concat({tagId:e}),h.set(n,r))})),g=[],_=[],Array.from(h.entries()).forEach((function(e){var t=u(e,2),n=t[0],i=t[1];_.push(n);var o=n.updateAttrs(i,f);o&&g.push(r(r({},n.toIReceivedConversation()),{updatedItems:o}))})),this.storage.updateConversationStorage(_),p&&this.storage.set("conversationStatusVersion",f),g.length>0&&this._ctx.emit("conversationStatusChanged",g),[2,mn()]):[2,c.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),n=this._userSettins.getTags(),r=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=n[e.tagId])||void 0===t?void 0:t.tagName}})),[2,mn(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),i=n.isTop,o=this.storage.getOrCreateModel(t,!1),s=o.tags,(u=s.find((function(t){return t.tagId===e})))?(l=gg(r,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:da.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(xr.addTag,c,l,us)]):[2,yn(x.NO_TAG_IN_CONVER)];case 1:return(d=a.sent()).isOk?(f=d.data,p=f.version,h=f.updateVersion,u.isTop=i,o.updateAttrs({tags:s},p),this.storage.updateConversationStorage([o]),h&&this.storage.set("conversationStatusVersion",p),[2,mn()]):[2,d.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d=this;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),r=gg(n,[]),i=this._ctx.currentUserId,[4,this._ctx.query(xr.delTag,i,r,us)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=t.map((function(t){var n=d.storage.getOrCreateModel(t,!0),r={tags:n.tags.filter((function(t){return t.tagId!==e}))};return n.updateAttrs(r,u),n})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,mn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx.currentUserId,r=this.storage.get("conversationStatusVersion"),i=gg(r,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:da.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(xr.delTag,n,i,us)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.getOrCreateModel(e,!0),d=c.tags,f={tags:d.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(f,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,mn()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d,f,p,h=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?[4,c(this,Mg,"m",t_).call(this,t,0,n)]:[2,mn([])];case 1:return(i=a.sent()).isOk?(o=this._ctx,s=o.currentUserId,u=o.connectedTime,l=i.data,d=l.info,f=[],p=0,d.forEach((function(t){var n=t.userId,i=t.type,o=t.busChannel,a=h.storage.getOrCreateModel({conversationType:i,targetId:n,channelId:o},!1),l=a.tags.find((function(t){return t.tagId===e}));if(l){var c=l.isTop,d=r(r({},a.toIReceivedConversation()),{isTopInTag:!!c,operationTime:t.versionTime,latestMessage:t.msg?uc(t.msg,s,u):null});c?f.splice(p++,0,d):f.push(d)}})),[2,mn(f)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=0,this.storage.getAllSGModels().forEach((function(r){var i;if(r.tags.some((function(t){return t.tagId===e}))){if(r.notificationLevel>me.NOT_SET&&!t)return;n+=null!==(i=r.unreadCount)&&void 0!==i?i:0}})),[2,mn(n)]}))}))}}),e}();Lg=new WeakMap,Ug=new WeakMap,Dg=new WeakMap,Vg=new WeakMap,xg=new WeakMap,Zg=new WeakMap,Mg=new WeakSet,jg=function(e,t,n){if(t===Ig){e.stopPropagation();var r=[];n.forEach((function(e){if(0===e.subChangeType){var t=nl.decode(ju,new Uint8Array(e.eventData)),n=t.msgId,i=t.unreadCnt,o=t.readCnt,a=t.readList,s=t.totalCnt;r.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:n,users:a.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:s})}})),this._ctx.emit("readReceiptResponseV5",r)}},Gg=function(e){e||(c(this,Ug,"f").setInitVersion(0),this._ctx.includeUg&&c(this,Mg,"m",Bg).call(this)),c(this,Ug,"f").startInterval(a_,!0)},kg=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,this.settings.syncDataFromServer()];case 1:t=n.sent(),this.settings.setInitVersion(t),n.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(a_,!0),[2]}}))}))},Fg=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,Mg,"m",kg).call(this,t),c(this,Mg,"m",Gg).call(this,t),this._ctx.ugEnabel&&c(this,Mg,"m",Hg).call(this,t)},Bg=function e(){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,f=this;return a(this,(function(a){switch(a.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,n=t.createTraceId(),r=c(this,xg,"f"),t.info(H.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:r}),n),[4,c(this,Mg,"m",t_).call(this,r,1,1e3)]):[2];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.info,u=o.isFinished,l=o.pullTime,d(this,xg,l,"f"),t.info(H.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:r,isFinished:u,pullTime:l}),n),this.storage.addRelations(s,this._ctx.currentUserId,this._ctx.connectedTime),u?(this._ctx.emit("sgRelationsSynced"),[2]):[2,c(this,Mg,"m",e).call(this)]):(t.warn(H.L_PULL_SG_RELATIONS_R,i.errmsg(),n),setTimeout((function(){return c(f,Mg,"m",e).call(f)}),1e3),[2])}}))}))},Hg=function(e){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,c(this,Lg,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,n=t.relations,r=t.msgVersion,this.storage.addRelations(n,this._ctx.currentUserId,this._ctx.connectedTime),this._ctx.emit("ultraGroupEnable"),c(this,Lg,"f").setInitVersion(r),c(this,Lg,"f").startInterval(a_,!0),c(this,Dg,"f").setInitVersion(r),c(this,Dg,"f").startInterval(a_,!0),[2]):[2]}}))}))},qg=function(){this.settings.stopInterval(),c(this,Lg,"f").reset(),c(this,Ug,"f").reset(),c(this,Dg,"f").reset()},Yg=function(e,t){return 3===t.type?(e.stopPropagation(),void this.settings.push(t.time)):7===t.type?(e.stopPropagation(),void c(this,Dg,"f").push(t.time)):void(12===t.type&&(e.stopPropagation(),c(this,Vg,"f").push(t.time)))},Kg=function(e,t,n){var r=t.syncMsg,i=Kr(t.topic);if(r&&i===xr.updUgRTime){e.stopPropagation();var o=nl.decode(ka,t.pbData),a=o.channelId,s=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount(B.ULTRA_GROUP,a,s||"",u);l&&this._ctx.emit("conversationStatusChanged",[l])}},Wg=function(e){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l,d,f,p,h,g,_,b,E,v,m=this;return a(this,(function(a){switch(a.label){case 0:return t=e.count,n=e.startTime,i=e.order,o=this._ctx,s=o.currentUserId,u=o.connectedTime,this._ctx.includeUg?[3,2]:[4,c(this,Mg,"m",t_).call(this,n,i||0,t)];case 1:return(l=a.sent()).isOk?(d=l.data,f=d.info,p=d.isFinished,h=f.map((function(e){var t=e.userId,n=e.type,i=e.busChannel,o=m.storage.getOrCreateModel({conversationType:n,targetId:t,channelId:i},!1);return r(r({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?uc(e.msg,s,u):null})})),[2,mn({list:h,hasNext:"boolean"==typeof p?!p:void 0})]):[2,l.wipe()];case 2:return g=0!==n||i?n:Number.MAX_SAFE_INTEGER,_=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==B.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>g:e.operationTime<g)})).sort((function(e,t){return e.operationTime-t.operationTime})),b=_.length>t,E=Math.min(_.length,t),v=i?_.slice(0,E):_.slice(_.length-E),i||v.reverse(),[2,mn({hasNext:b,list:v.map((function(e){return e.toIReceivedConversation()}))})]}}))}))},Qg=function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){return n=this._ctx.includeUg,r=null==e?void 0:e.channelId,i=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:$(n?J:W),o=this.storage.getAllModels().filter((function(e){return e.isTop&&!e.hidden&&(e.conversationType!==B.ULTRA_GROUP&&(!r||e.channelId===r)||n&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&i.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,mn({list:o,hasNext:!1})]}))}))},Jg=function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>me.NOT_SET&&(t.conversationType!==B.ULTRA_GROUP||e&&(!t.channelId||""===t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,mn({list:t,hasNext:!1})]}))}))},zg=function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return n=this._ctx.includeUg,r=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:$(n?J:W),i=this.storage.getAllModels().filter((function(e){return e.unreadCount>0&&(e.conversationType!==B.ULTRA_GROUP||n&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&r.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,mn({list:i,hasNext:!1})]}))}))},Xg=function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){return o=[],void 0!==n&&o.push({sessionStateType:da.IsTop,value:n?"1":"0"}),void 0!==r&&o.push({sessionStateType:da.IsSilent,value:r.toString()}),void 0!==i&&o.push({sessionStateType:da.AutoTrans,value:i.toString()}),s=gg(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(xr.setSeAtt,this._ctx.currentUserId,s,us)]}))}))},$g=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return c(this,Zg,"f").add(e),n=t.messageType===Ie.HQ_VOICE?{msgId:e,objectName:t.messageType,content:t.remoteUrl,sampleRate:t.sampleRate,channelNumber:t.numberOfChannels,format:t.format}:{msgId:e,objectName:t.messageType,content:t.content},r=nl.encode(Gu,{businessType:1,businessInfo:nl.encode(ku,n)}),[4,this._ctx.query(xr.upConvertMsg,e,r,Fu)];case 1:return i=a.sent(),c(this,Zg,"f").delete(e),o=i.code,i.isOk?(u=nl.decode(xu,new Uint8Array(i.data.businessResult)),s={status:je.SUCCESS,text:u.result}):s={status:je.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:s}),[2]}}))}))},e_=function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,c,d,f,p,h,g,_,b,E,v,m,y,I=this;return a(this,(function(a){switch(a.label){case 0:return i=Object.values(r),o=l([],u(new Set(l(l([],u(e),!1),u(i),!1))),!1),s=t.targetId,c=t.conversationType,d=t.channelId,f=nl.encode(Ns,{targetId:s,type:c,query:o.map((function(e){return{msgTime:0,msgUID:e,busChannel:d}}))}),[4,this._ctx.query(xr.qryMsg,this._ctx.currentUserId,f,Ps)];case 1:return p=a.sent(),h=p.isOk,g=p.code,_=p.data,h?(E=(b=_).list,v=b.notExistMsgId,m=new Map(E.map((function(e){var t=uc(e,I._ctx.currentUserId,I._ctx.connectedTime);return[t.messageUId,t]}))),y=e.map((function(e){var t=m.get(e);if(!t)return v.includes(e)?{messageUId:e,code:x.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:x.SERVER_DATA_ERROR};if(t.messageType!==Ie.REFERENCE)return{messageUId:e,code:x.INVALID_PARAMETER_MESSAGE_TYPE};var n=r[e],i=m.get(n);return i?(t.content.referMsg=i.content,{messageUId:e,message:t,code:x.SUCCESS}):v.includes(n)?(t.content.referMsgStatus=Yn,{messageUId:e,code:x.RC_DB_DATA_NOT_FOUND,message:t}):{messageUId:e,code:x.SERVER_DATA_ERROR,message:t}})),n(y),[2]):(n(e.map((function(e){return{messageUId:e,code:g}}))),[2])}}))}))},t_=function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this._ctx.currentUserId,i=function(e,t,n){return nl.encode(Sa,{startTime:e,order:t,count:n,compressioEnabled:fc.enable()})}(e,t,n),[4,this._ctx.query(xr.qryRelationR,r,i)];case 1:return[2,o.sent().trans((function(e){return ug(e.pbData)}))]}}))}))};var u_,l_,c_,d_,f_,p_=((wg={})[B.PRIVATE]=xr.cleanPMsg,wg[B.GROUP]=xr.cleanGMsg,wg[B.CUSTOMER_SERVICE]=xr.cleanCMsg,wg[B.SYSTEM]=xr.cleanSMsg,wg[B.APP_PUBLIC_SERVICE]=xr.cleanMCMsg,wg[B.PUBLIC_SERVICE]=xr.cleanMPMsg,wg[B.ULTRA_GROUP]=xr.cleanGMsg,wg),h_=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function g_(e){var t=!(1&~(e.ugMsg||0)),n=!(1&~(e.sessionCfg||0));return t&&n}var __=[xr.chatMsg,xr.ugMsg,xr.recallMsg,xr.ppMsgS,xr.pgMsgS,xr.ppMsgP,xr.pgMsgP,xr.pcMsgP,xr.prMsgS,xr.pbMsgP],b_=function(e){function n(t,n,r,i){var o=e.call(this)||this;return u_.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l_.set(o,void 0),o.userStorage=new h_,d(o,l_,new Rg(n,i),"f"),c(o,l_,"f").pipe(o),o.on("onConnected",c(o,u_,"m",c_),o,100),o.on("onDisconnected",c(o,u_,"m",d_),o,100),o.on("onSuspend",c(o,u_,"m",d_),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,u_,"m",f_),o),o}return t(n,e),Object.defineProperty(n.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"includeUg",{get:function(){return g_(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),n}(hn);l_=new WeakMap,u_=new WeakSet,c_=function(e,t){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,c(this,l_,"f").noticeOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,n=t.syncTime,r=t.hasNext,c(this,l_,"f").setInitVersion(n),c(this,l_,"f").startInterval(18e4,!!r),[2]):[2]}}))}))},d_=function(e){c(this,l_,"f").reset()},f_=function(e,t,n){var r=t.topic,i=t.syncMsg,o=Kr(r);if(o||(this.logger.warn(H.L_RECV_RMTP_E,"unknown topic: ".concat(r)),e.stopPropagation()),this.logger.debug(H.L_RECV_RMTP_O,r),i&&__.includes(o)){e.stopPropagation();var a=sc(t,this.currentUserId,n.timestamp,n.messageUId),s=uc(a,this.currentUserId,this.connectedTime,t.targetId);this.emit("syncMsg",s)}else{if(o===xr.s_ntf){e.stopPropagation();var u=(f=nl.decode(fa,t.pbData)).type,l=f.chrmId,d=f.time;return this.logger.info(H.L_RECV_S_NTF_O,"type: ".concat(u,", chrmId: ").concat(l,", time: ").concat(d)),void this.emit("sNtf",f)}if(o===xr.s_cmd){e.stopPropagation();var f;u=(f=nl.decode(fa,t.pbData)).type,l=f.chrmId,d=f.time;if(this.logger.info(H.L_RECV_S_CMD_O,"type: ".concat(u,", chrmId: ").concat(l,", time: ").concat(d)),11===u)return void c(this,l_,"f").push(d);this.emit("sCmd",f)}}};var E_,v_,m_,y_,I_,T_=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return o=function(e){return nl.encode(Da,r(r({},e),{compressioEnabled:fc.enable()}))}({targetId:e,time:t,count:n,order:i}),s=this.ctx,u=s.currentUserId,l=s.connectedTime,[4,this.ctx.query(xr.qryCHMsg,e,o)];case 1:return(c=a.sent()).isOk?(d=hg(c.data.pbData),[2,mn({hasMore:!!d.hasMsg,list:d.list.map((function(e){return uc(e,u,l)}))})]):[2,c.wipe()]}}))}))}}),e}(),R_=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=oa.localStorage,n=e.appkey,r=e.currentUserId,i=rt(n,r),o=t.getItem(i)||"{}",a=JSON.parse(o);return{value:{value:{version:a.version||0,tags:a.tags||{},transLan:a.transLan||"zh",autoTrans:a.autoTrans||!1},key:i,stringify:!0}}}}),Object.defineProperty(n.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(n.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;r[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),Object.defineProperty(n.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.get("value"),r=n.tags,i=n.autoTrans,o=n.transLan;delete r[e],this.set("value",{version:t,tags:r,autoTrans:i,transLan:o})}}),n}(Vh),O_=function(e){function n(t){var n=e.call(this)||this;return E_.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),v_.set(n,!1),n.storage=new R_,n._ctx.on("onConnected",n._handleConnected,n),n._ctx.on("onDisconnected",n._handleDisconnected,n),n._ctx.on("onSuspend",n._handleDisconnected,n),n._ctx.on("signal",n._handleSignal,n),n}return t(n,e),Object.defineProperty(n.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),d(this,v_,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(n.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(n.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(Kr(t.topic)===xr.s_us){var n=nl.decode(ys,t.pbData).version;this.push(n),e.stopPropagation()}}}),Object.defineProperty(n.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,d,f,p,h,g,_,b,E,v,m,y;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,n=t.currentUserId,r=t.logger,i=this._ctx.getNaviInfoFromCache(),o=r.createTraceId(),r.info(H.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),s=nl.encode(es,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(xr.pullUS,n,s,ts)];case 1:return u=a.sent(),r.summary(H.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,f=l.items,p=!1,h=!1,g=!1,_="",b=this.storage.get("value"),E=b.transLan,v=b.autoTrans,m=b.tags,y={version:d,transLan:E,autoTrans:v,tags:m},null==f||f.forEach((function(e){var t=e.key,n=e.value;switch(t){case"Tag":y.tags={},e.tags.forEach((function(e){y.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),p=!0;break;case"transLan":g=!0,y.transLan=Yi.readUTF(new Uint8Array(n));break;case"autoTrans":h=!0,y.autoTrans="1"===Yi.readUTF(new Uint8Array(n));break;case"VoipInfo":_=Yi.readUTF(new Uint8Array(n))}})),this.storage.set("value",y),p&&this.emit("tagsChanged"),g&&this.emit("userSettingsChanged",{key:Kn.TranslationLanguage,value:y.transLan}),h&&this.emit("userSettingsChanged",{key:Kn.AutoTranslateEnable,value:y.autoTrans}),_&&this.emit("voipInfoChanged",_),c(this,E_,"m",m_).call(this,u.code),[2,mn({version:d})]):(c(this,E_,"m",m_).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(n.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(n.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(n.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=nl.encode(Es,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(xr.addSeTag,n,r,$a)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.addTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,n=this._ctx.currentUserId,r=nl.encode(ms,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(xr.delSeTag,n,r,$a)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(n.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,E_,"m",y_).call(this,xr.transLan,e)]}))}))}}),Object.defineProperty(n.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,mn(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(n.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,c(this,E_,"m",y_).call(this,xr.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(n.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,mn(this.storage.get("value").autoTrans)]}))}))}}),n}(gn);v_=new WeakMap,E_=new WeakSet,m_=function(e){c(this,v_,"f")&&(d(this,v_,!1,"f"),this.emit("userSettingsSynced",e))},y_=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h,g;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.version,r=this._ctx.currentUserId,i=nl.encode(Za,{version:n,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,r,i,$a)];case 1:if((o=a.sent()).isOk){switch(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.get("value"),d=c.transLan,f=c.autoTrans,p=c.tags,h=c.version,g={version:l?u:h,transLan:d,autoTrans:f,tags:p},e){case xr.transLan:g.transLan=t;break;case xr.autoTrans:g.autoTrans="1"===t}this.storage.set("value",g)}return[2,o.wipe()]}}))}))};var S_=((I_={})[B.PRIVATE]=xr.qryPMsg,I_[B.GROUP]=xr.qryGMsg,I_[B.CHATROOM]=xr.qryCHMsg,I_[B.CUSTOMER_SERVICE]=xr.qryCMsg,I_[B.SYSTEM]=xr.qrySMsg,I_[B.APP_PUBLIC_SERVICE]=xr.qryMCMsg,I_[B.PUBLIC_SERVICE]=xr.qryMPMsg,I_),A_=function(e,t,n,r,i,o,a){return{conversationType:e,targetId:t,senderUserId:o,messageDirection:be.SEND,isCounted:!!n.isCounted,isMentioned:!!n.isMentioned,content:n.content,messageType:n.messageType,isOffLineMessage:!1,isPersited:!!n.isPersited,messageUId:r,sentTime:i,receivedTime:0,disableNotification:!!n.disableNotification,isStatusMessage:!!n.isStatusMessage,canIncludeExpansion:!!n.canIncludeExpansion,expansion:n.canIncludeExpansion?n.expansion:null,receivedStatus:Te.UNREAD,receivedStatusInfo:jt(Te.UNREAD),pushConfig:n.pushConfig,channelId:n.channelId,isInterrupt:n.isInterrupt,messageId:a||0,sentStatus:se.SENT,directedUserIds:n.directionalUserIdList,disableUpdateLastMessage:n.disableUpdateLastMessage,needReceipt:n.needReceipt}},C_=[M.GROUP_OPERATION,M.GROUP_PROFILE_CHANGE,M.GROUP_APPLICATION_INVITATION,M.GROUP_FOLLOW_USER_CHANGE],N_=[v.FRIEND_APPLICATION];function P_(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve({code:x.RC_NET_UNAVAILABLE})]}))}))},n}}function w_(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve(yn(x.RC_NET_UNAVAILABLE))]}))}))},n}}function M_(e){return e?e.map((function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:e.extProfile,addTime:Dt(e.relationTime),inBlackList:!!e.flag}})):[]}function L_(e){return e&&e.list?e.list.map((function(e){return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",applicationType:e.type,applicationStatus:e.status,operationTime:Dt(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var U_,D_=function(e){function d(t,n,r){var i=this,o=r.loggerProxy?r.loggerProxy:Eh();i=e.call(this,t,n,r,new ih(r.appkey,"IMLib","IM",o))||this,f.add(i),Object.defineProperty(i,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmEntryHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_joinedChrmManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_loggerProxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmsQueue",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"_intervalTimerForChrmPull",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t,n){var r,o=n.messageType;if(o===Ie.SYNC_READ_STATUS&&function(e){return[B.GROUP,B.DISCUSSION,B.ULTRA_GROUP,B.PUBLIC_SERVICE,B.APP_PUBLIC_SERVICE].includes(e)}(e)&&Object.assign(n,{directionalUserIdList:[i.currentUserId]}),o===Ie.READ_RECEIPT_RESPONSE){if(!n.content.receiptMessageDic||0===Object.keys(n.content.receiptMessageDic).length){var a=null===(r=i._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic({conversationType:e,targetId:t,channelId:n.channelId});n.content.receiptMessageDic=a||{}}for(var s in n.directionalUserIdList=[],n.content.receiptMessageDic)n.directionalUserIdList.push(s)}return n}}),Object.defineProperty(i,"_isUltraGroupListExist",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"getMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"deleteMessages",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"deleteMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"batchClearMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"clearMessages",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"getMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:r_}),Object.defineProperty(i,"getGroupMessageDeliverList",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"getPrivateMessageDeliverTime",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:i_}),Object.defineProperty(i,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:i_}),i._loggerProxy=o;var a=r.appkey,s=r.logOutputLevel,u=r.logExpireTime,l=r.navigators,d=r.areaCode,p=r.logServerUrl,E=r.miniCMPProxy,v=r.environment,m=r.useNaviV2,I=void 0!==m&&m,T=r.enableReadReceiptStorage;i._environment=v||"default",i._enableReadReceiptStorage=T,i.logger.setOutputLevel(s),Xn.init({areaCode:d,navigators:l,logServerUrl:p,miniCMPProxy:E}),r.loggerProxy||fh(a,i.logger,u),i.reporter=new Nh(a,i.logger,i._loggerProxy),i.navi=new Ac(a,i.logger,new Lc(a,i.logger),i._environment,I),i.reporterStatistic=new Ph(a,i.logger,i._loggerProxy),i._sendMessageStore=new Cc(a),i._chrmEntryHandler=new Tc(i);var R=i._connMgr=new nh(a,i.navi,i.logger),O=i._ctx=new b_(i._appkey,R,i.navi,i.logger);return i._connMgr.pipe(O),"browser"===oa.tag&&i._initCloudController(),i._userSettings=new O_(O),i._chat=new s_(O,i._userSettings),i._chatroom=new T_(O),O.on("conversationStatusChanged",i._conversationStatusChanged,i),O.on("sCmd",i._handleSCmdNotify,i),O.on("sNtf",i._handleMsgNotify,i),O.on("signal",i._handleSignal,i),O.on("onConnected",i.onConnected,i),O.on("onDisconnected",i.onDisconnected,i),O.on("onConnecting",i.onConnecting,i),O.on("onSuspend",i.onSuspend,i),O.on("ultraGroupEnable",i._handleUltraGroupEnable,i),O.on("messagesFromUG",i._handleMessagesFromUltraGroup,i),O.on("messagesFromSG",i._handleMessagesFromSignalGroup,i),O.on("smsgFromSignalGroup",i._handleSmsgFromSignalGroup,i),O.on("syncMsg",i._handleSyncMsg,i),O.on("sgRelationsSynced",i._handleSGRelationsSynced,i),O.on("serverEvent",c(i,f,"m",y),i),O.on("readReceiptResponseV5",c(i,f,"m",h),i),O.on("speechToTextResponse",c(i,f,"m",g),i),O.on("ugChanged",i._handleUGChangeList,i),O.on("conversationStatusSynced",(function(e,t){return i._watcher.conversationStatusSynced(t)}),i),O.on("messageModified",c(i,f,"m",_),i),O.on("messageModifiedSyncCompleted",c(i,f,"m",b),i),i._userSettings.on("voipInfoChanged",i._naviChangeHandler,i),i._userSettings.on("tagsChanged",(function(){return i._watcher.tag()}),i),i._userSettings.on("userSettingsSynced",(function(e,t){return i._watcher.userSettingsSynced(t)}),i),i._userSettings.on("userSettingsChanged",(function(e,t){return i._watcher.userSettingsChanged(t)}),i),i}var f,p,h,g,_,b,y,I;return t(d,e),Object.defineProperty(d.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(Xn.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new rh(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,lr.init)}}),Object.defineProperty(d.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._joinedChrmManager||(this._joinedChrmManager=new Rc(n.joinMChrm)),this._readReceiptManager||(this._readReceiptManager=new Mc(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(n),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(n),this.reporterStatistic.checkStart(n)}}),Object.defineProperty(d.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(d.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(d.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(d.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var n=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));n&&this._watcher.conversationTag()}}),Object.defineProperty(d.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new wc(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(d.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new ih(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(d.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(d.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())}}),Object.defineProperty(d.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectedTime()}}),Object.defineProperty(d.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectionStatus()}}),Object.defineProperty(d.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))}}),Object.defineProperty(d.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable()}}),Object.defineProperty(d.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.sgRelationsSynced()}}),Object.defineProperty(d.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var i=this,o=new Map,a=[];t.forEach((function(e){var t,n,r,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,f=e.isCounted,p=e.senderUserId,h=e.messageType,g=e.sentTime,_=e.channelType,b=e.isPersited;if(i._ultraMsgMap[l])delete i._ultraMsgMap[l];else{var E={conversationType:B.ULTRA_GROUP,targetId:s,channelId:c||""},v=i._chat.storage.getOrCreateModel(E,!0),m=o.get(v)||{channelType:_};o.set(v,m),b&&(m.hidden=!1,m.latestMessage=e,m.operationTime=g),f&&p!==i.currentUserId&&h!==Ie.RECALL_NOTIFICATION_MESSAGE&&(m.unreadCount=v.unreadCount+1,d&&((null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===K.ALL||(null===(r=null===(n=null==u?void 0:u.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===r?void 0:r.includes(i.currentUserId)))&&(m.unreadMentionedCount=v.unreadMentionedCount+1,m.hasMentioned=!0,m.mentionedInfo=null==u?void 0:u.mentionedInfo),v.firstUnreadMessage||(m.firstUnreadMessageType=h,m.firstUnreadMessageUId=l,m.firstUnreadTime=g)),a.push(e)}}));var s=[],l=[];Array.from(o.entries()).forEach((function(e){var t=u(e,2),n=t[0],i=t[1];s.push(n);var o=n.updateAttrs(i);o&&l.push(r(r({},n.toIReceivedConversation()),{updatedItems:o}))})),this._chat.storage.updateConversationStorage(s),l.length>0&&this._watcher.conversation(l),this._batchMessage(a)}}),Object.defineProperty(d.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var a=i.messages,s=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(a),s.forEach((function(e){r._receiveMessageExpansion(e)})),u.forEach((function(e){r._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),n&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished(),this._chat.startPullModifyMsg())}}),Object.defineProperty(d.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,n);else switch(Kr(o)){case xr.rtc_ntf:this._receiveRtcKv(t.pbData);break;case xr.s_opNtf:this._pullOperateStatusNotify(t);break;case xr.s_pubCall:this._pubCallInfo(t);break;case xr.s_stat:null===(r=this._subscribeManager)||void 0===r||r.updateUserStatus(t)}}}),Object.defineProperty(d.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r,i,o=t.time,a=t.type,s=t.chrmId;switch(a){case 2:if(!this._chrmsQueue[s])return;this._chrmEntryHandler.pullEntry(s,o);break;case 4:c(this,f,"m",p).call(this,s),this._watcher.chatroom({chatroomDestroyed:s});break;case 8:null===(n=this._subscribeManager)||void 0===n||n.startsyncSubscribeUserStatus(o);break;case 9:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(d.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,i=e.conversationType,o=e.targetId,a=t.put,s=t.del,u=t.mid;a&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:a,channelId:r,conversationType:i,targetId:o}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:r,conversationType:i,targetId:o}})}}),Object.defineProperty(d.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var o=this._chat.storage.clearConversationUnreadCount(e,t,n,i);r&&o&&this._watcher.conversation([o])}}),Object.defineProperty(d.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.isPersited,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.disableUpdateLastMessage;e.messageDirection;var u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,f=e.content,p=e.isMentioned;if(ee(t,W)){var h=this.getNaviInfoFromCache(),g=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),_={},b=u===this.currentUserId,E=l===Ie.RECALL,v=g.lastReadTime>a;if(c&&!dc(h).isOk&&!E&&!b&&!v&&(0===g.unreadCount&&(_.firstUnreadMessageUId=d,_.firstUnreadTime=a,_.firstUnreadMessageType=l),_.unreadCount=g.unreadCount+1,p&&It(f)&&f.mentionedInfo)){_.hasMentioned=!0,_.mentionedInfo=f.mentionedInfo;var m=f.mentionedInfo,y=m.type,I=m.userIdList;(y===K.ALL||(I||[]).includes(this.currentUserId))&&(_.unreadMentionedCount=g.unreadMentionedCount+1)}if(E&&It(f)){var T=f,R=T.sentTime,O=T.messageUId;!this._ctx.userStorage.recallMsgMap.has(O)&&g.unreadCount>0&&R>g.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(O),_.unreadCount=g.unreadCount-1,0===g.unreadCount&&(_.firstUnreadMessageUId="",_.firstUnreadTime=0,_.firstUnreadMessageType=""))}n&&(E&&!g.hidden||(_.operationTime=a),_.hidden=!1,s||g.latestMessage&&!(g.latestMessage.sentTime<a)||(_.latestMessage=e));var S=g.updateAttrs(_);this._chat.storage.updateConversationStorage([g]),S&&n&&!s&&this._watcher.conversation([r(r({},g.toIReceivedConversation()),{updatedItems:S})])}}}),Object.defineProperty(d.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;switch(Kr(e.topic)){case xr.updRTime:this._receivesyncReadStatus(e);break;case xr.updUserSub:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(d.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,n=[],r=[],i=[],o=e.length-1;o>=0;o-=1){var a=e[o];a.messageType===Ie.LOG_COMMAND&&a.senderUserId===Ye?r.unshift(a):a.messageType===Ie.CLOUD_CONTROL&&a.senderUserId===Ye?i.push(a):n.unshift(a)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,i=n.endTime,o=n.platform,a=n.logId,s=n.uri;t.reporter.report(parseInt(r,10),parseInt(i,10),o,s,a,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(d.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,lr.other,n)]):[3,2];case 1:r=o.sent()||0,(i=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(d.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.decode(Ds,e.pbData),n=t.key,r=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))}}),Object.defineProperty(d.prototype,"_handleMsgNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.type,r=t.chrmId,i=t.time;if(2===n){var o=this._chrmsQueue[r];o&&(o.queue.push(i),this._pullChrmMsg(r))}}}),Object.defineProperty(d.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nl.decode(ka,e.pbData),n=t.type,r=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(n,r,o||"",!0,i),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:o,timestamp:i})}}),Object.defineProperty(d.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=nl.encode(Vs,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(xr.pullKvMsg,this.currentUserId,e,js)]):[2];case 1:return t=i.sent(),n=t.isOk,r=t.data,n&&r?(this._latestPullKVMsgTimestamp=r.maxTime,this._watcher.callInfo(JSON.stringify({list:r.info})),[2]):[2]}}))}))}}),Object.defineProperty(d.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===he.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===Ie.DELIVERED||t===Ie.DELIVERED_MSG||t===Ie.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(d.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=0,r=[],i=[],o=[],a=[],s=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,f=e.messageUId,p=e.messageType,h=e.sentTime,g=e.senderUserId,_=e.content;if(r.push(f),d===be.SEND){n=Math.max(h,n);var b=t._sendMessageStore.getSendMessageMap(),E=p===Ie.RECALL?"Cmd:".concat(_.messageUId):f;if(b[E])return void t._sendMessageStore.removeByUID(E)}if(!t._filterMessage(e)){switch(h>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,f)&&s.push(f),p){case Ie.EXPANSION_NOTIFY:return void o.push(e);case Ie.READ_RECEIPT:g===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,h);break;case Ie.READ_STATE:return void a.push(e);case Ie.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case Ie.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}var v=t._handleMsgProperties(e);t._setConversationCacheByMessage(v),i.push(v)}})),{newOutboxTime:n,messageUIds:r,messages:i,messageExpansionList:o,RSMsgList:a,msgUIds2Statistic:s}}}),Object.defineProperty(d.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.content,o=e.senderUserId,a=e.sentTime;if(o!==this.currentUserId)return!1;var s=this.getNaviInfoFromCache();return this._clearConversationUnreadCount(t,n,r,!0,a),1!==s.sesDriven||(a>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(d.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,n=e.targetId,i=e.channelId,o=e.content,a={conversationType:t,targetId:n,channelId:i};this._watcher.messageReadReceipt(t===B.PRIVATE?{privateReadReceipt:r(r({},a),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:r(r({},a),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(d.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.conversationType,r=e.channelId,i=e.targetId,o=e.content,a=e.sentTime,s=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:n,channelId:r,targetId:i},o.messageUId,s,a,u)}}),Object.defineProperty(d.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r,i=this,o=e.conversationType,a=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,f=void 0===d?{}:d;if(c===this.currentUserId)for(var p in f){var h=f[p];try{for(var g=(t=void 0,s(h)),_=g.next();!_.done;_=g.next()){var b=_.value;null===(r=this._readReceiptManager)||void 0===r||r.remove({conversationType:o,channelId:a,targetId:u},b)}}catch(e){t={error:e}}finally{try{_&&!_.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}}else(f[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:a,targetId:u},e,c)}))}}),Object.defineProperty(d.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._isConnected){var n=t.conversationType;t.messageType;var r=t.senderUserId,i=t.messageUId,o=t.sentTime;t.isStatusMessage,this._writeMessagesLog(n,i)&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),r===this.currentUserId&&this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}}),Object.defineProperty(d.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===Ie.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===Ie.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(d.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){(t.conversationType!==B.CHATROOM||this._chrmsQueue[t.targetId])&&(this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(H.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==Ie.EXPANSION_NOTIFY?((t.messageType===Ie.SYNC_READ_STATUS||t.messageType===Ie.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===Ie.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===Ie.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t))}}),Object.defineProperty(d.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,n=e.senderUserId;return t===Ie.DELIVERED||(t===Ie.DELIVERED_MSG||(t===Ie.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===Ie.SYNC_READ_STATUS&&n!==this.currentUserId||t===Ie.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(d.prototype,"_handleMsgProperties",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1);var n,r=e.messageType,i=e.isStatusMessage,o=e.isCounted,a=void 0!==o&&o,s=e.isPersited,u=void 0!==s&&s;if(n=Tr(r)?Ir(r):{isCounted:a,isPersited:u,isStatusMessage:!1},Object.assign(e,n),t&&!Rt(i)&&(e.isStatusMessage=i),!t){var l=e.content.user;if(l){var c=l.portrait,d=l.portraitUri,f=c||d;f&&(l.portrait=l.portraitUri=f)}}return e}}),Object.defineProperty(d.prototype,"_fixDownstreamData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return e&&2===t.list.length&&(t.hasMore=!0,0===n?t.list.shift():t.list.pop()),t}}),Object.defineProperty(d.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s,u,l){var c;return void 0===s&&(s=""),o(this,void 0,void 0,(function(){var o,u,d,f,p,h,g,_,b,E,v,m=this;return a(this,(function(a){switch(a.label){case 0:return u=(o=this).currentUserId,d=o._connMgr,f=S_[e]||xr.qryPMsg,p=1===r&&0===n,d?(h=d.codec.encodeGetHistoryMsg(t,{timestamp:n,count:p?2:r,order:i,channelId:s}),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:s,timestamp:n,count:r,order:i}),l),[4,d.send(new ao(f,h,u),Va,{currentUserId:u,connectedTime:d.getConnectedTime(),conversation:{targetId:t},afterDecode:function(n){var r,i=null===(r=m._readReceiptManager)||void 0===r?void 0:r.getReadReceiptInfo({conversationType:e,channelId:s,targetId:t},n.messageUId);if(i){var o=i.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return n}})]):[3,2];case 1:return g=a.sent(),_=g.code,b=g.data,_===x.SUCCESS&&b?(E=this._fixDownstreamData(p,b,i),v=[],null===(c=E.list)||void 0===c||c.forEach((function(e){e&&v.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:v.join(",")}),l),[2,{code:_,data:{list:E.list,hasMore:E.hasMore}}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:""}),l),[2,{code:_}]);case 2:return[2,{code:x.RC_NET_CHANNEL_INVALID}]}}))}))}}),Object.defineProperty(d.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a){return this.getHistoryMessage(e,t,n,r,i,o,a)}}),Object.defineProperty(d.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(H.L_VER_REPORT_T,o,i),s=nl.encode(Is,{sdkInfo:o}),u=new ao(xr.reportsdk,s,n),[4,r.send(u)]):[2];case 1:return(l=a.sent().code)!==x.SUCCESS&&this.logger.warn(H.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(d.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.targetId,r=e.channelId,e.conversationType!==B.ULTRA_GROUP?[3,2]:(o=nl.encode(Vu,{targetId:n,type:t,busChannel:[r],cleanMsg:!1}),[4,this._connMgr.query(xr.delUgSe,this.currentUserId,o)]);case 1:return i=a.sent(),[3,4];case 2:return o=nl.encode(Aa,{type:t,busChannel:r?[r]:[]}),[4,this._connMgr.query(xr.delRelation,n,o)];case 3:i=a.sent(),a.label=4;case 4:return i.isOk&&this._chat.storage.removeConversation(e),[2,i.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeBatchDeleteConversation(e),r=new ao(xr.delRelationBatch,n,this.getCurrentUserId()),[4,t.send(r)]):[2,x.RC_NET_UNAVAILABLE];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(d.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=!1),o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=0,e.includes(B.ULTRA_GROUP)&&!this._isUltraGroupListExist?[2,yn(x.METHOD_NOT_AVAILABLE)]:(r+=this._chat.storage.getTotalUnreadCountByLevels(e,t,n),[2,mn(r)])}))}))}}),Object.defineProperty(d.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this._chat.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:n},!1),[2,mn(r.unreadCount)]}))}))}}),Object.defineProperty(d.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._clearConversationUnreadCount(e,t,n,!1,this.getServerTime()),Promise.resolve(x.SUCCESS)}}),Object.defineProperty(d.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return(r=this._chat.storage.getModel({conversationType:e,targetId:t,channelId:n}))?(i=r.firstUnreadMessage,[2,mn(i?{messageUId:i.messageUId||"",sentTime:i.sentTime}:null)]):[2,mn(null)]}))}))}}),Object.defineProperty(d.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._chat.storage.setDrafts({conversationType:e,targetId:t,channelId:r},n),Promise.resolve(x.SUCCESS)}}),Object.defineProperty(d.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._chat.storage.getDrafts({conversationType:e,targetId:t,channelId:n});return Promise.resolve({code:x.SUCCESS,data:r})}}),Object.defineProperty(d.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._chat.storage.deleteDrafts({conversationType:e,targetId:t,channelId:n}),Promise.resolve(x.SUCCESS)}}),Object.defineProperty(d.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(o=this._connMgr,s=nl.encode(Ta,{nothing:1,extra:r}),u=n?xr.joinChrmR:xr.joinChrm,l=new ao(u,s,e),this.logger.info(H.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:xr[u]}),i),[4,o.send(l,Ra)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return c=a.sent(),d=c.code,f=c.data,p=d===x.SUCCESS?"info":"warn",this.logger[p](H.L_JOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),i),d===x.SUCCESS?(g=(h=f).joinTime,_=h.createTime,b=h.memberCount,E=h.isAllChatroomBanned,v=h.isCurrentUserBanned,m=h.isCurrentChatroomBanned,y=h.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,g),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,r),this._startSyncIntervalForChrmPull(),[2,{code:d,data:{joinTime:g,createTime:_,memberCount:b,isAllChatroomBanned:E,isCurrentUserBanned:v,isCurrentChatroomBanned:m,isCurrentChatroomInWhitelist:y}}]):[2,{code:d}]}}))}))}}),Object.defineProperty(d.prototype,"_rejoinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,i,o,s,u,l,d,h,g,_,b,E;return a(this,(function(a){switch(a.label){case 0:for(n in e=this._joinedChrmManager.get(),t=[],e)t.push(n);i=0,a.label=1;case 1:return i<t.length?(o=t[i],s=e[o],u=s.count,l=void 0===u?10:u,d=s.extra,this.logger.info(H.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:o,count:l,extra:d})),h=this.logger.createTraceId(),[4,this._joinChrm(o,l,!0,d,h)]):[3,4];case 2:if(g=a.sent(),_=g.code,b=g.data,E=_===x.SUCCESS?"info":"warn",this.logger[E](H.L_REJOIN_CHATROOM_R,JSON.stringify({code:_,timestamp:(new Date).getTime()}),h),_===x.SUCCESS)return this._watcher.chatroom({rejoinedRoom:r({chatroomId:o,count:l},b)}),[2];_===x.RC_CHATROOM_USER_KICKED&&c(this,f,"m",p).call(this,o),this._watcher.chatroom({rejoinedRoom:{chatroomId:o,errorCode:_}}),a.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))}}),Object.defineProperty(d.prototype,"_pullChrmMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===t&&(t=10),void 0===n&&(n=0),o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=this._chrmsQueue[e],i=r.pulling,o=r.timestamp,i?[2]:(r.pulling=!0,s=n?0:o,u=nl.encode(Oa,{count:t,syncTime:s,compressioEnabled:fc.enable()}),l=this.logger.createTraceId(),this.logger.info(H.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,syncTime:s})),[4,this._connMgr.query(xr.chrmPull,e,u)])):[2];case 1:return c=a.sent(),this.logger.summary(H.L_PULL_CHATROOM_MSG_R,c,l,{chatroomId:e,syncTime:s,count:t}),r.pulling=!1,c.isOk?(d=cg(c.data.pbData),f=d.list,p=d.syncTime,r.timestamp=n?Math.max(p,n):p,r.queue=r.queue.filter((function(e){return e>p})),h=[],g=[],b=(_=this).currentUserId,E=_._connMgr,v=f.map((function(e){return uc(e,b,E.getConnectedTime())})),m=[],v.forEach((function(e){e.sentTime<o||(e.sentTime>=y._connMgr.getConnectedTime()&&y._writeMessagesLog(B.CHATROOM,e.messageUId)&&g.push(e.messageUId),h.push(e.messageUId),m.push(e))})),this._batchMessage(m),g.length>0&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:g.join(",")})),r.queue.length>0&&(r.queue.length=0,this._pullChrmMsg(e)),[2]):[2]}}))}))}}),Object.defineProperty(d.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return[4,this._joinChrm(e,t,!1,n,r)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(d.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._joinChrm(e,t,!0,n,r)]}))}))}}),Object.defineProperty(d.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr,c(this,f,"m",p).call(this,e),n=nl.encode(Ta,{nothing:1}),[4,t.query(xr.exitChrm,e,n)]):[2,x.RC_NET_UNAVAILABLE];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(d.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=this._connMgr,i=nl.encode(La,{count:t,order:n}),o=new ao(xr.queryChrmI,i,e),[4,r.send(o,Ua)]):[2,yn(x.RC_NET_UNAVAILABLE)];case 1:return[2,a.sent().trans((function(e){return e}))]}}))}))}}),Object.defineProperty(d.prototype,"_modifyChatroomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==o?this.getServerTime():o,s=r.codec.encodeModifyChatRoomKV(e,t,i),u=t.type===D.UPDATE?xr.setKV:xr.delKV,l=new ao(u,s,e),[4,r.send(l,Ra)]):[2,x.RC_NET_UNAVAILABLE];case 1:return c=a.sent(),(d=c.code)===x.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},i),[2,d]):[2,d]}}))}))}}),Object.defineProperty(d.prototype,"_chatroomKVStoreNotAllSuccess",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.data,r=e;return n&&Array.isArray(n.errorKeys)&&n.errorKeys.forEach((function(e){var t=r.findIndex((function(t){return e.key===t.key}));-1!==t&&r.splice(t,1)})),r}}),Object.defineProperty(d.prototype,"_modifyChatroomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,f,p,h,g,_=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(i=(n=this)._connMgr,o=n.currentUserId,t.entries.forEach((function(t){var n=_._chrmEntryHandler.getVersion(e,t.key);t.version=null==n?_.getServerTime():n})),s=i.codec.encodeModifyChatRoomKVS(e,t,o),u=t.type===D.UPDATE?xr.setKVS:xr.delKVS,l=new ao(u,s,e),[4,i.send(l,za)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return c=a.sent(),d=c.code,-1!==[x.SUCCESS,x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(d)&&(p=[],delete(h=r({},t)).entries,t.entries.forEach((function(e){p.push(r(r({},e),h))})),d===x.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(g=c.data,f=g.errorKeys,p=this._chatroomKVStoreNotAllSuccess(p,c)),this._chrmEntryHandler.setLocal(e,{kvEntries:p,syncTime:(new Date).getTime()},o)),[2,{code:d,data:f}]}}))}))}}),Object.defineProperty(d.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(d.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(d.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return t.type=D.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(d.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return(n=this._chrmEntryHandler.getValue(e,t))?[2,{code:x.SUCCESS,data:n}]:this._isConnected?(r=this._connMgr,i=r.codec.encodePullChatRoomKV(0),o=new ao(xr[xr.pullKV],i,e),[4,r.send(o,Ja)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return s=a.sent(),(u=s.data)&&u.kvEntries&&u.kvEntries.length&&(l=u.kvEntries.find((function(e){return e.key===t})),void 0!==l)?[2,{code:x.SUCCESS,data:null==l?void 0:l.value}]:[2,{code:x.CHATROOM_KEY_NOT_EXIST}]}}))}))}}),Object.defineProperty(d.prototype,"getAllChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:x.SUCCESS,data:t}]:this._isConnected?(n=this._connMgr,t={},r=n.codec.encodePullChatRoomKV(0),i=new ao(xr[xr.pullKV],r,e),[4,n.send(i,Ja)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),(s=o.data)&&s.kvEntries&&s.kvEntries.length&&s.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:x.SUCCESS,data:t}]}}))}))}}),Object.defineProperty(d.prototype,"pullChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p,h=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,this._chrmsQueue[e]?(o=r.codec.encodePullChatRoomKV(t),s=new ao(xr[xr.pullKV],o,e),this.logger.info(H.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,r.send(s,Ja)]):[2,{code:x.RC_CHATROOM_NOT_EXIST}]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return u=a.sent(),l=u.code,c=u.data,this._chrmsQueue[e]?(d=l===x.SUCCESS?"info":"warn",this.logger[d](H.L_PULL_CHATROOM_KV_R,JSON.stringify({code:l,timestamp:t})),l===x.SUCCESS&&c?(f=c.kvEntries,p=[],f.length>0&&(f.forEach((function(t){var n=t.key,r=t.value,i=t.type,o=t.timestamp,a=t.userId;h._chrmEntryHandler.getValue(e,n)===r&&a===h.getCurrentUserId()||p.push({key:n,value:r,type:i,timestamp:o,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,c,i),p.length>0&&this._watcher.chatroom({updatedEntries:p})),[2,{code:l,data:c}]):[2,{code:l}]):[2,{code:x.RC_CHATROOM_NOT_EXIST}]}}))}))}}),Object.defineProperty(d.prototype,"_startSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),18e4)}}),Object.defineProperty(d.prototype,"_stopSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)}}),Object.defineProperty(d.prototype,"removeChatroomFromCatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,f,"m",p).call(this,e)}}),Object.defineProperty(d.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)return!1;var i=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(t),o=0;switch(e){case B.PRIVATE:o=r.private;break;case B.GROUP:o=r.group;break;case B.CHATROOM:o=r.chatroom;break;case B.ULTRA_GROUP:o=r.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(d.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d,f,p,h,g,_,b,E,v,m;return a(this,(function(a){switch(a.label){case 0:return n=this._handleInnerMsgOptions(e,t,n),n=this._handleMsgProperties(n,!0),o=!1,[B.PRIVATE,B.GROUP].includes(e)&&(n.isStatusMessage||Ir(n.messageType).isStatusMessage)&&(o=!0),u=o?function(e){var t;return(t={},t[B.PRIVATE]=xr.ppMsgS,t[B.GROUP]=xr.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[B.PRIVATE]=xr.ppMsgP,t[B.GROUP]=xr.pgMsgP,t[B.CHATROOM]=xr.chatMsg,t[B.CUSTOMER_SERVICE]=xr.pcMsgP,t[B.RTC_ROOM]=xr.prMsgS,t[B.SYSTEM]=xr.pbMsgP,t)[e]}(e)||xr.ppMsgP,o&&(n.isPersited=!1,n.isCounted=!1),l=n.messageId?n.messageId:an(),n.messageId=l,c=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},n),(d=new so(xr[u],c,e===B.SYSTEM?this.currentUserId:t)).setHeaderQos(Hr.AT_LEAST_ONCE),o?(this._connMgr.sendOnly(d),[2,mn(A_(e,t,r({},n),"",0,this.currentUserId,l))]):(f=this._connMgr.getCrtServerTime(),p=A_(e,t,r(r({},n),{isStatusMessage:o}),"",f,this.currentUserId,l),null==i||i(l),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e,targetId:t,channelId:n.channelId}),s),h=Date.now(),[4,this._connMgr.send(d)]);case 1:return g=a.sent(),_=g.code,b=g.isOk,E=g.msg,v=g.data,b?(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:null==v?void 0:v.messageUId,messageId:null==v?void 0:v.messageId}),s),m=v,this._sendMessageSuccessHandle(p,m),this._writeMessagesLog(e,m.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:m.messageUId,channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),[2,mn(p)]):(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:p.messageUId,messageId:p.messageId}),s),this._writeMessagesLog(e)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),p.sentStatus=se.FAILED,[2,yn(_,E,p)])}}))}))}}),Object.defineProperty(d.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,a=e.targetId,s=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===Ie.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:o,targetId:a,channelId:s},d,c,u)}if(i===Ie.READ_RECEIPT_RESPONSE){var f=l.receiptMessageDic;if(!f)return;for(var p in f)f[p].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:a,channelId:s},e)}))}}}}),Object.defineProperty(d.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,p,h,g,_,b,E,v,m,y,I;return a(this,(function(a){switch(a.label){case 0:return i=e.targetId,o=e.conversationType,s=e.channelId||"",u=t.user,l=t.extra,c=t.isDelete,d=t.directionalUserIdList,f=t.disableUpdateLastMessage,p=t.messageUId,h=t.sentTime,g={conversationType:o,targetId:i,messageUId:p,sentTime:h,channelId:s,isDelete:c||!1,isAdmin:t.isAdmin},u&&(g.user=u),l&&(g.extra=l),_={content:g,messageType:"RC:RcCmd",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,pushContent:(null===(n=t.pushConfig)||void 0===n?void 0:n.pushContent)||t.pushContent||"",channelId:s,disableUpdateLastMessage:f},[B.GROUP,B.ULTRA_GROUP].includes(o)&&d&&(_.directionalUserIdList=d),b=this._connMgr.codec.encodeUpMsg({conversationType:o,targetId:i},_),(E=new so(xr.recallMsg,b,this.currentUserId)).setHeaderQos(Hr.AT_LEAST_ONCE),[4,this._connMgr.send(E)];case 1:return(v=a.sent()).isOk?(m=v.data,o!==B.ULTRA_GROUP&&(y="Cmd:".concat(p),m.messageUId=y),I=A_(o,i,r(r({},_),{isPersited:!0}),m.messageUId,m.timestamp,this.currentUserId),o===B.ULTRA_GROUP?(this._ultraMsgMap[m.messageUId]=m.timestamp,this._updateUltraGroupWhenRecallMsg(i,s,p)):(this._sendMessageStore.setMessage(m.messageUId,m.timestamp),this._setConversationCacheByMessage(I)),[2,mn(I)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeReadReceipt(t,n),i=new ao(xr[xr.rrMsg],r,e),[2,this._connMgr.send(i)]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeMessageReader(t,n),i=new ao(xr[xr.rrList],r,e),[2,this._connMgr.send(i,bs)]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){return r=this._connMgr.codec.encodeReadReceiptMsg(e,t,n),i=new so(xr[xr.sendMsgRead],r,e.targetId),[2,this._connMgr.send(i)]}))}))}}),Object.defineProperty(d.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){return n=this._connMgr.codec.encodeReceiptQryReq(e,t),r=new ao(xr[xr.qryMsgRead],n,e.targetId),[2,this._connMgr.send(r,xs)]}))}))}}),Object.defineProperty(d.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeReceiptCntQryReq(e,t),i=new ao(xr[xr.qryMsgReadCntBatch],n,e.targetId),[4,this._connMgr.send(i,Hs)];case 1:return o=a.sent(),s=o.code,u=o.data,l=(u||{result:[]}).result,s===x.SUCCESS&&l?[2,{code:s,data:l.map((function(t){return r({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=sg(e,t),r=new so(xr.updRTime,n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._connMgr.getToken();this.navi.updateVoipCallInfo(n,t);var i=this.navi.getNaviInfoFromCache(n);this._watcher.onNaviDataChange(r({},i))}}),Object.defineProperty(d.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,s,u){return o(this,void 0,void 0,(function(){var o,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(o=i&&"uploads"!==i?t||"":en(e,t),l=this.getNaviInfoFromCache(),c=cn(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),f=nl.encode(va,{type:e,key:o,httpMethod:n||"",queryString:i||"",url:s||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(xr.qnTkn,this.currentUserId,f,ya)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,a.sent().trans((function(e){return r(r({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(d.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(o=this.getNaviInfoFromCache(),u="",l="",t===n.QINIU?s=xr.qnUrl:t===n.AWS?s=xr.s3Url:t===n.STC?s=xr.stcUrl:t===n.MINIO?(s=xr.minioUrl,u=cn(o,this.logger),l=JSON.stringify({url:u})):s=xr.aliUrl,c=nl.encode(ma,{type:e,key:r,fileName:i,ext:l,size:-1,ipType:o.ipType||0}),[4,this._connMgr.query(s,this.currentUserId,c,Ia)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,a.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(d.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return n.sent(),this._resetMemoryState(),[2]}}))}))}}),Object.defineProperty(d.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._isUltraGroupListExist=!1,this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}}}),Object.defineProperty(d.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(d.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCrtServerTime()}}),Object.defineProperty(d.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCurrentUserId()}}),Object.defineProperty(d.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,yn(x.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(d.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,yn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,yn(x.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(d.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){for(i in t=this._userSettings.getTags(),n=this._chat.storage.getTagConversationCountMap(),r=[],t)r.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=n.get(i))||void 0===e?void 0:e.length)||0});return[2,mn(r)]}))}))}}),Object.defineProperty(d.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=this._chat.storage.getOrCreateModel(e,!1),n=this._getUnreadCount(t.unreadMentionedCount),[2,mn(n)]}))}))}}),Object.defineProperty(d.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this._chat.storage.getAllUnreadMentionedCount(),[2,mn(e)]}))}))}}),Object.defineProperty(d.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return this.getHistoryMessage(e,t,n,r,i,o)}}),Object.defineProperty(d.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){return t=e.targetId,n=e.channelType,this._isUltraGroupListExist?(r=this._chat.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==n&&n!==e.channelType)})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=i._getUnreadCount(t.unreadMentionedCount||0),t.unreadMessageCount=i._getUnreadCount(t.unreadMessageCount||0),t.unreadMentionedMeCount=i._getUnreadCount(t.unreadMentionedMeCount||0),t})),(a=r).sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i})),[2,mn(a)]):[2,yn(x.METHOD_NOT_AVAILABLE)];var a}))}))}}),Object.defineProperty(d.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(d.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){return this._isUltraGroupListExist?(e=this._chat.storage.getAllUGModels().filter((function(e){return e.notificationLevel>me.NOT_SET})).map((function(e){return{conversationType:B.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId}})),[2,mn(e)]):[2,yn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return this._isUltraGroupListExist?(n=this._chat.storage.getAllUGModels(),r=n.reduce((function(n,r){if(r.targetId!==e||!r.unreadMentionedCount)return n;var i=r.notificationLevel||me.NOT_SET;return!t||t.includes(i)?n+r.unreadMentionedCount:n}),0),i=this._getUnreadCount(r),[2,mn(i)]):[2,yn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return n=this._chat.storage.getAllUGModels(),r=n.reduce((function(n,r){if(r.targetId!==e||!r.unreadCount)return n;var i=r.notificationLevel||me.NOT_SET;return!t||t.includes(i)?n+r.unreadCount:n}),0),i=this._getUnreadCount(r),[2,mn(i)]}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n=this;return a(this,(function(r){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().filter((function(t){return e.includes(t.targetId)})).map((function(e){return{conversationType:e.conversationType,type:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",unreadMessageCount:n._getUnreadCount(e.unreadCount||0),mentionedCount:n._getUnreadCount(e.unreadMentionedCount||0),mentionedMeCount:n._getUnreadCount(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||me.NOT_SET}})),[2,mn(t)]):[2,yn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().reduce((function(t,n){return e?t+(n.unreadMentionedCount||0):t+(n.unreadCount||0)}),0),n=this._getUnreadCount(t),[2,mn(n)]):[2,yn(x.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"clearUltraUnreadcount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this.getServerTime(),r=sg({conversationType:B.ULTRA_GROUP,targetId:e,channelId:t},n),(i=new so(xr[xr.updUgRTime],r,this.currentUserId)).setHeaderQos(Hr.AT_LEAST_ONCE),[4,this._connMgr.send(i)]):[2,x.RC_NET_UNAVAILABLE]:[2,Promise.resolve(x.METHOD_NOT_AVAILABLE)];case 1:return o=a.sent(),s=o.code,o.isOk&&this._clearConversationUnreadCount(B.ULTRA_GROUP,e,t,!1,n),[2,s]}}))}))}}),Object.defineProperty(d.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i){return o(this,void 0,void 0,(function(){var o,s,u,l,c,d,f,p,h,g,_,b,E;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._handleMsgProperties(t,!0),o=t.messageId?t.messageId:an(),t.messageId=o,s=this._connMgr.codec.encodeUpMsg({conversationType:B.ULTRA_GROUP,targetId:e},t),(u=new so(xr[xr.ugMsg],s,e)).setHeaderQos(Hr.AT_LEAST_ONCE),l=this._connMgr.getCrtServerTime(),c=A_(B.ULTRA_GROUP,e,r({},t),"",l,this.currentUserId,o),n&&n(o),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:B.ULTRA_GROUP,targetId:e,channelId:t.channelId}),i),d=Date.now(),[4,this._connMgr.send(u)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return f=a.sent(),p=f.code,h=f.data,p!==x.SUCCESS?(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:c.messageUId,messageId:c.messageId}),i),this._writeMessagesLog(B.ULTRA_GROUP)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:B.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),c.sentStatus=se.FAILED,[2,{code:p,data:c}]):(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:p,messageUId:null==h?void 0:h.messageUId,messageId:null==h?void 0:h.messageId}),i),g=h,this._writeMessagesLog(B.ULTRA_GROUP,g.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:B.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:p})),c.sentTime=g.timestamp,c.messageUId=g.messageUId,this._ultraMsgMap[g.messageUId]=g.timestamp,_=t.channelId||"",b=this._chat.storage.getOrCreateModel({conversationType:B.ULTRA_GROUP,targetId:e,channelId:_},!0),(E=b.updateAttrs({operationTime:g.timestamp,latestMessage:r({},c)}))&&this._watcher.conversation([r(r({},b.toIReceivedConversation()),{updatedItems:E})]),[2,{code:p,data:c}])}}))}))}}),Object.defineProperty(d.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=e.conversationType,r=e.channelId,i=e.targetId,o=nl.encode(ws,{targetId:i,type:n,busChannel:r||"",opType:t||0}),(s=new so(xr.operate,o,i)).setHeaderQos(Hr.AT_LEAST_ONCE),[4,this._connMgr.send(s)]):[2,yn(x.RC_NET_UNAVAILABLE)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:x.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),n=this._connMgr.codec.encodeMsgQuery(e),(r=new ao(xr[xr.qryMsg],n,this.currentUserId)).setHeaderQos(Hr.AT_LEAST_ONCE),[4,this._connMgr.send(r,Ps,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o,msg:x[o]}]:(u=(s||{}).list,Array.isArray(u)&&u.forEach((function(e){var n=e.messageUId;t[n]=e})),[2,{code:0,data:t}])}}))}))}}),Object.defineProperty(d.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,Ms),n=t.conversationType,r=t.info,i=t.summary;this.logger.debug(H.O,"s_opNtf -> type: ".concat(n,", info: ").concat(r,", summary: ").concat(i)),this._watcher.operateStatus(t)}}}),Object.defineProperty(d.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(n=new ao(xr[xr.upMsgEx],t,e.targetId)).setHeaderQos(Hr.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return(r=i.sent().code)!==x.SUCCESS?[2,{code:r,msg:x[r]}]:[2,{code:r}]}}))}))}}),Object.defineProperty(d.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=nl.decode(Hu,new Uint8Array(e.eventData)).results;r.push.apply(r,l([],u(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===x.SUCCESS?Lr.SUCCESS:Lr.FAILED}}}))),!1))})),r.length&&(null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,r))}}),Object.defineProperty(d.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:C_},Friend:{map:{},types:N_}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var i in t)if(t[i].types.includes(r)){n(t[i].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&r[i](t[i].map)}}),Object.defineProperty(d.prototype,"_handleUGChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n={};t.forEach((function(e){var t=e.changeType;n[t]||(n[t]=[]),n[t].push(e)}));var r=re.CHANNEL_CHANGE,i=re.MSG_RECALL,o=re.MSG_EXPANSION,a=re.MSG_MODIFY,s=re.USER_GROUP_CHANGE;n[r]&&this._handleUltraChannelChange(n[r]),n[i]&&this._handleMsgRecall(n[i]),n[o]&&this._handleMsgUpdate(n[o]),n[a]&&this._handleMsgUpdate(n[a]),n[s]&&this._handleUserGroupStatus(n[s])}}),Object.defineProperty(d.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=M.GROUP_OPERATION,n=M.GROUP_PROFILE_CHANGE,r=M.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleFollowUserChange(e[r])}}),Object.defineProperty(d.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[v.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,i,o,a,s,u,l,c,d,f=e.subChangeType,p=e.businessId,h=e.time,g=e.eventData,_=m.FRIEND_APPLY,b=m.FRIEND_REFUSE,v=m.FRIEND_USER_INFO,y=m.FRIENDS_INPUT,I=m.FRIEND_CLEAR,T=m.FRIEND_INFO_CHANGE,R=m.FRIEND_INFO_CHANGE_SYNC;switch(f){case _:case b:var O=f===_?E.UNHANDLED:E.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:p,applicationType:g.applyType,applicationStatus:O,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case v:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:p,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:h});break;case y:null===(s=(a=t._watcher).friendDelete)||void 0===s||s.call(a,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case I:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case T:break;case R:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:p,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(d.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a=e.subChangeType,s=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,f=c.channelInfo,p=c.userInfos,h={groupId:s,operation:a,operationTime:l};d&&(n=u(Wt([d]),1),h.operatorInfo=n[0]),a===S.CREATE&&(r=u(Ht([f]),1),h.groupInfo=r[0]),[S.CREATE,S.DISMISS].includes(a)||(h.memberInfos=Wt(p)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,h)}))}}),Object.defineProperty(d.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i,o,a,s,l=e.businessId,c=e.time,d=e.eventData,f=e.subChangeType,p=e.secondaryId;switch(f){case A.GROUP_INFO_CHANGE:var h=u(Wt([d.optUserInfo]),1)[0],g=u(qt([d.channelInfo]),1)[0],_=u(d.channelFullInfo?qt([d.channelFullInfo]):[void 0],1)[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:_});break;case A.MEMBER_PROFILE_CHANGE:h=u(Wt([d.optUserInfo]),1)[0];var b=Wt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:h,memberInfo:b,operationTime:c});break;case A.GROUP_REMARK_DELETE:case A.GROUP_REMARK_SET:var E=f===A.GROUP_REMARK_SET?C.ADD:C.REMOVE;null===(s=(a=t._watcher).groupRemarkChangedSync)||void 0===s||s.call(a,{groupId:l,operationType:E,operationTime:c,groupRemark:p})}}))}}),Object.defineProperty(d.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var n,r,i=e.subChangeType,o=e.businessId,a=e.time,s=e.userGroupIds,u=1===i?C.ADD:C.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:o,operationType:u,operationTime:a,userIds:s})}))}}),Object.defineProperty(d.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[],r=[],i=[];e.forEach((function(e){var o=e.subChangeType,a=e.targetId,s=e.msgTime,u=e.operatorId,l=e.busChannel||"",c=t._chat.storage.getCachedUGConversation(a,l);if(c){var d=ie.PUBLIC_TO_PRIVATE,f=ie.PRIVATE_TO_PUBLIC,p=ie.PUBLIC_TO_PRIVATE_USER_NOT_IN,h=ie.CHANNEL_DELETE,g=ie.CHANNEL_USER_KICKED;switch(o){case f:t._chat.storage.updateConversationCache(c,{channelType:te.PUBLIC}),n.push({targetId:a,channelId:l,changeType:ne.PRIVATE_TO_PUBLIC,channelType:te.PUBLIC});break;case d:t._chat.storage.updateConversationCache(c,{channelType:te.PRIVATE}),n.push({targetId:a,channelId:l,changeType:ne.PUBLIC_TO_PRIVATE,channelType:te.PRIVATE});break;case p:t._chat.storage.removeConversation(c),n.push({targetId:a,channelId:l,changeType:ne.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:c.channelType});break;case h:t._chat.storage.removeConversation(c),r.push({targetId:a,channelId:l,channelType:c.channelType,deleteTime:s});break;case g:i.push({targetId:a,channelId:l,userId:u,channelType:te.PRIVATE}),u===t.currentUserId&&t._chat.storage.removeConversation(c)}}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),r.length>0&&this._watcher.ultraGroupChannelDelete(r),i.length>0&&this._watcher.ultraGroupChannelUserKicked(i)}}),Object.defineProperty(d.prototype,"_handleMsgRecall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];e.forEach((function(e){var r=e.targetId,i=e.busChannel,o=e.msgUID,a=e.msgTime,s=e.type,u=e.operatorId,l=e.remindType;t._updateUltraGroupWhenRecallMsg(r,i||"",o,a,l),n.push({targetId:r,conversationType:s,sentTime:a,messageUId:o,senderUserId:u,channelId:i||"",content:{conversationType:s,targetId:r,messageUId:o,channelId:i||""},messageDirection:1,messageType:Ie.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:Te.UNREAD,receivedStatusInfo:jt(Te.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(n)}}),Object.defineProperty(d.prototype,"_handleMsgUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};for(var n in e.forEach((function(e){var n=e.targetId,r=e.type,i=e.msgTime,o=e.msgUID,a=e.busChannel,s="".concat(r,"_").concat(n);t[s]||(t[s]=[]),t[s].push({messageUId:o,channelId:a||"",sendTime:i})})),t){var r=n.split("_"),i=r.shift(),o=r.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:o,conversationType:Number(i),messages:l([],u(t[n]),!1)})}}}),Object.defineProperty(d.prototype,"_pullUltraMessageList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f=this;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeMsgQuery(t),(o=new ao(xr.qryMsg,i,this.currentUserId)).setHeaderQos(Hr.AT_LEAST_ONCE),[4,this._connMgr.send(o,Ps,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return s=a.sent(),u=s.code,l=s.data,u!==x.SUCCESS?[2,{code:u,msg:x[u]}]:(c=(l||{}).list,d=[],Array.isArray(c)&&c.forEach((function(e){var t,n=e.targetId,r=e.channelId,i=e.messageUId,o=f._chat.storage.getCachedUGConversation(n,r||"");o&&(null===(t=o.latestMessage)||void 0===t?void 0:t.messageUId)===i&&f._chat.storage.updateConversationCache(o,{latestMessage:e}),d.push(e)})),e===re.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(d),e===re.MSG_MODIFY&&(null===(r=(n=this._watcher).messagesModified)||void 0===r||r.call(n,d)),[2])}}))}))}}),Object.defineProperty(d.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,f;return a(this,(function(a){return t=oe.REMOVE_USER_GROUP,n=oe.JOIN_USER_GROUP,r=oe.EXIT_USER_GROUP,i=oe.CHANNEL_BIND_USER_GROUP,o=oe.CHANNEL_UNBIND_USER_GROUP,s=[],u=[],l=[],c=[],d=[],e.forEach((function(e){var a=e.type,f=e.targetId,p=e.busChannelType,h=e.busChannel,g=e.userGroupIds;switch(e.subChangeType){case t:s.push({conversation:{conversationType:a,targetId:f},userGroupIds:g});break;case n:u.push({conversation:{conversationType:a,targetId:f},userGroupIds:g});break;case r:l.push({conversation:{conversationType:a,targetId:f},userGroupIds:g});break;case i:c.push({conversation:{conversationType:a,targetId:f,channelId:h},channelType:p,userGroupIds:g});break;case o:d.push({conversation:{conversationType:a,targetId:f,channelId:h},channelType:p,userGroupIds:g})}})),f={},s.length>0&&(f.userGroupDisband=s),u.length>0&&(f.userAdded=u),l.length>0&&(f.userRemoved=l),c.length>0&&(f.userGroupBindChannel=c),d.length>0&&(f.userGroupUnBindChannel=d),this._watcher.userGroupStatus(f),[2]}))}))}}),Object.defineProperty(d.prototype,"getUltraHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeGetHistoryMsg(e,t),o=new ao(xr[xr.qryUgMsg],i,this.currentUserId),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:B.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,this._connMgr.send(o,Va,{currentUserId:this.currentUserId,conversation:{conversationType:B.ULTRA_GROUP,targetId:e}})]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?(c=[],null===(r=l.list)||void 0===r||r.forEach((function(e){e&&c.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:c.join(",")}),n),[2,{code:u,data:l}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:""}),n),[2,{code:u}])}}))}))}}),Object.defineProperty(d.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,n),i=new ao(xr.ugUnpushSet,r,e),[4,this._connMgr.send(i)]):[2,{code:x.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:x.METHOD_NOT_AVAILABLE})];case 1:return o=a.sent(),s=o.code,x.SUCCESS,[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr,r=n.codec.encodeGetUltraGroupDefaultNotificationLevel(t),i=new ao(xr[xr.ugUnpushQuery],r,e),[4,n.send(i,ss)]):[2,{code:x.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:x.METHOD_NOT_AVAILABLE})];case 1:return o=a.sent(),s=o.code,u=o.data,s===x.SUCCESS&&u?(l=u.unpushLevel,[2,{code:s,data:l}]):[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){var a=this._chat.storage.getModel({conversationType:B.ULTRA_GROUP,targetId:e,channelId:t});if(a){var s={},u=a.latestMessage;u&&u.messageUId===n&&(s.latestMessage=null),i&&a.lastReadTime<i&&a.unreadCount&&(s.unreadCount=a.unreadCount-1,o!==ae.ALL&&o!==ae.ME||!a.unreadMentionedCount||(s.unreadMentionedCount=a.unreadMentionedCount-1),o===ae.ME&&a.unreadMentionedCount&&(s.unreadMentionedMeCount=a.unreadMentionedMeCount-1));var l=a.updateAttrs(s,i);this._chat.storage.updateConversationStorage([a]),l&&this._watcher.conversation([r(r({},a.toIReceivedConversation()),{updatedItems:l})])}}}),Object.defineProperty(d.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),n=new ao(xr[xr.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(n,Pa)]):[2,Promise.resolve({code:x.METHOD_NOT_AVAILABLE})]:[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?[2,{code:i,data:o}]:[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return this._isConnected?this._isUltraGroupListExist?(t=this._chat.storage.getUGFistUnreadMessageInfo(e.targetId,e.channelId||""))?[2,mn(t)]:[2,yn(x.RC_DB_DATA_NOT_FOUND)]:[2,yn(x.METHOD_NOT_AVAILABLE)]:[2,yn(x.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(d.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,fe.SUBSCRIBE,n)]:[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,fe.UNSUBSCRIBE)]:[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){return this._isConnected?(i=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,Promise.resolve({code:x.SUCCESS,data:i})]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return this._isConnected?(r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:x.SUCCESS,data:r})]):[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=nl.encode($s,c(this,f,"m",I).call(this,e)),[4,this._connMgr.query(xr.updUserProfile,this.currentUserId,n,void 0)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return(r=a.sent()).isOk||!r.data?[2,r.wipe()]:(i=nl.decode(tu,r.data.pbData),r.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,r.wipe()]):(s=i.censorFailedFields,[2,yn(r.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)]))}}))}))}}),Object.defineProperty(d.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:x.RC_NET_UNAVAILABLE})}}),Object.defineProperty(d.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:x.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(d.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),n=new ao(xr[xr.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(n)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new ao(xr[xr.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,ou)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return n=o.sent(),r=n.code,i=n.data,r!==x.SUCCESS?[2,{code:r}]:[2,{code:r,data:null==i?void 0:i.permission}]}}))}))}}),Object.defineProperty(d.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),n=new ao(xr[xr.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(n,$s)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=Ft(o.userId,o.userProfile,o.userExtProfile),[2,{code:i,data:s}]):[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=e.chatRoomId,n=nl.encode(Ls,{rtcRoomId:t}),r=new ao(xr.setRtcRoomId,n,t),[4,this._connMgr.send(r)]):[2,x.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))}}),Object.defineProperty(d.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return this._isConnected?(i=n?new ao(t,r,e):new so(t,r,e),[4,this._connMgr.send(i)]):[2,{code:x.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),s=o.code,u=o.data,[2,{code:s,buffer:u instanceof uo||null==u?void 0:u.pbData}]}}))}))}}),Object.defineProperty(d.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=Cl(this.rtcCodec,t,n),[4,this.rtcSignaling(e,xr[xr.rtcPing],!0,r)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o!==x.SUCCESS?[2,{code:o}]:((u=this.rtcCodec.decode(fl.RtcOutput,s)).version=Dt(u.version),[2,{code:o,data:u}])}}))}))}}),Object.defineProperty(d.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $l()}}),Object.defineProperty(d.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;(t=e.deviceId)&&(Zl=t),n=e.packageName,nc=n}}),Object.defineProperty(d.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return oh?(ch&&(clearTimeout(ch),ch=null),[4,oh]):[2];case 1:return(e=n.sent())&&(t=e.db,ph.push(t)),oh=null,[2]}}))}))}}),Object.defineProperty(d.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({status:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,lr.newWorkChange,r)}}}),Object.defineProperty(d.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=zh(e,t,n,r),[4,this._connMgr.query(xr.channelCreate,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,mn()]:(s=nl.decode(uu,o.data.pbData),u={errorKeys:s.censorFailedFields,processCode:s.processCode||0},[2,yn(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(d.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=zh(e,t,n),[4,this._connMgr.query(xr.upChannelInfo,e,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,mn()]:(o=nl.decode(uu,i.data.pbData),[2,yn(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(d.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),n=new ao(xr[xr.qChannelInfo],t,e[0]),[4,this._connMgr.send(n,hu)];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=o.result.list,u=Ht(void 0===s?[]:s),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,n),o=new ao(xr[xr.channelMemKick],i,e),[4,this._connMgr.send(o,uu)];case 1:return s=a.sent(),u=s.code,l=s.data,u!==x.SUCCESS?[2,{code:u,msg:null!==(r=null==l?void 0:l.msg)&&void 0!==r?r:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(d.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),i=new ao(xr[xr.channelMemQuit],r,e),[4,this._connMgr.send(i,uu)];case 1:return o=a.sent(),s=o.code,u=o.data,s!==x.SUCCESS?[2,{code:s,msg:null!==(n=null==u?void 0:u.msg)&&void 0!==n?n:""}]:[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("dismiss",e),r=new ao(xr[xr.channelDismiss],n,e),[4,this._connMgr.send(r,uu)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o,msg:null!==(t=null==s?void 0:s.msg)&&void 0!==t?t:""}]:[2,{code:o}]}}))}))}}),Object.defineProperty(d.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i;return o(this,void 0,void 0,(function(){var o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],n,r),s=new ao(xr[xr.channelTransfer],o,e),[4,this._connMgr.send(s,uu)];case 1:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,{code:l,msg:null!==(i=null==c?void 0:c.msg)&&void 0!==i?i:""}]:[2,{code:l}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeModifyChannelsInput(e,t,n),o=new ao(xr[xr.upChannelManager],i,t),[4,this._connMgr.send(o,uu)];case 1:return s=a.sent(),u=s.code,l=s.data,u!==x.SUCCESS?[2,{code:u,msg:null!==(r=null==l?void 0:l.msg)&&void 0!==r?r:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p,h;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:n,roleType:t}),i=new ao(xr[xr.qChannelMem],r,e),[4,this._connMgr.send(i,hu)];case 1:return o=a.sent(),s=o.code,u=o.data,s===x.SUCCESS&&u?(l=u.result,c=u.page,f=(d=c||{}).pageToken,p=d.hasNext,[],h=Wt(l.list),[2,{code:s,data:{data:h,pageToken:p&&f?f:""}}]):[2,{code:s}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),r=new ao(xr[xr.qChannelSpeMem],n,e),[4,this._connMgr.send(r,hu)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o}]:s?(u=s.result,[],l=Wt(u.list),[2,{code:o,data:l}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return i=nl.encode(Eu,{targetId:e,type:B.GROUP,userId:t,channelNickName:n,additional:r}),[4,this._connMgr.query(xr.upChannelMem,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,mn()]:(s=nl.decode(uu,o.data.pbData),[2,yn(o.code,o.msg,{errorKeys:s.censorFailedFields})])}}))}))}}),Object.defineProperty(d.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeJoinGroup("join",e),r=new ao(xr[xr.channelMemJoin],n,e),[4,this._connMgr.send(r,uu)];case 1:return i=a.sent(),o=i.code,s=i.data,[2,{code:o,data:{processCode:null!==(t=null==s?void 0:s.processCode)&&void 0!==t?t:0}}]}}))}))}}),Object.defineProperty(d.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeJoinGroup("invite",e,t),o=new ao(xr[xr.channelMemInvite],i,e),[4,this._connMgr.send(o,uu)];case 1:return s=a.sent(),u=s.code,l=s.data,u!==x.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u,data:{processCode:null!==(r=null==l?void 0:l.processCode)&&void 0!==r?r:0}}]}}))}))}}),Object.defineProperty(d.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeMemberResponseInput(e),i=new ao(xr[xr.channelApplyResp],r,e.groupId),[4,this._connMgr.send(i,uu)];case 1:return o=a.sent(),s=o.code,u=o.data,s!==x.SUCCESS?[2,{code:s,msg:null!==(t=null==u?void 0:u.msg)&&void 0!==t?t:""}]:[2,{code:s,data:{processCode:null!==(n=null==u?void 0:u.processCode)&&void 0!==n?n:0}}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=nl.encode(fu,{type:B.GROUP,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this._connMgr.query(xr.qChannelApplyList,this.currentUserId,t,hu)];case 1:return(n=a.sent()).isOk?(i=function(e){var t=e.listType,n=e.result,i=e.page,o=new Uint8Array(n),a=[];switch(t){case 1:a=nl.decode(_u,o).list;break;case 2:a=nl.decode(gu,o).list;break;case 3:a=nl.decode(bu,o).list;break;case 11:a=nl.decode(Nu,o).list;break;case 13:a=nl.decode(Pu,o).list}return r(r({},i),{list:a})}(n.data),o=i.pageToken,s=i.hasNext,u=i.list,l=u.map(zt),[2,mn({data:l,pageToken:s&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),r=new ao(xr[xr.qChannelMemJoin],n,this.currentUserId),[4,this._connMgr.send(r,hu)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS&&s?(u=s.result,l=s.page,d=(c=l||{}).pageToken,f=c.hasNext,p=Ht(u.list),[2,{code:o,data:{data:p,pageToken:f&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(d.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({code:x.NOT_SUPPORT})}}),Object.defineProperty(d.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),n=new ao(xr[xr.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(n,hu)];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=o.result.list,u=Ht(s),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeSetGroupRemark(e,t),r=new ao(xr[xr.upChannelRemark],n,e),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i;return a(this,(function(o){switch(o.label){case 0:return r=this._connMgr.codec.encodeSetGroupFollows(e,t,n),i=new ao(xr[xr.upChannelFollow],r,t),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),n=new ao(xr[xr.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(n,hu)];case 1:return r=a.sent(),i=r.code,o=r.data,i===x.SUCCESS&&o?(s=o.result,l=s.list,u=l.map((function(e){var t=e.userId,n=e.opTime;return{userId:t,time:Dt(n)}})),[2,{code:i,data:u}]):[2,{code:i}]}var l}))}))}}),Object.defineProperty(d.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r;return o(this,void 0,void 0,(function(){var i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:n}),o=new ao(xr[xr.friendAdd],i,this.currentUserId),[4,this._connMgr.send(o,uu)];case 1:return s=a.sent(),u=s.code,l=s.data,u===x.SUCCESS&&l?[2,{code:u,data:{processCode:null!==(r=null==l?void 0:l.processCode)&&void 0!==r?r:0}}]:[2,{code:u}]}}))}))}}),Object.defineProperty(d.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new ao(xr[xr.friendDel],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),n=new ao(xr[xr.friendHandle],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),r=new ao(xr[xr.friendHandle],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=nl.encode(Ru,{targetId:e,remarkName:t,extProfile:Jh(n)}),[4,this._connMgr.query(xr.friendSetPf,this.currentUserId,r,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=nl.decode(Ou,i.data.pbData),[2,yn(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(d.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new ao(xr[xr.friendCheck],n,this.currentUserId),[4,this._connMgr.send(r,Tu)];case 1:return i=a.sent(),o=i.code,s=i.data,o!==x.SUCCESS?[2,{code:o}]:s?(u=s.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:o,data:u}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(d.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeFriendQueryInput(11,t,e),r=new ao(xr[xr.friendsQuery],n,this.currentUserId),[4,this._connMgr.send(r,hu)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS&&s?(u=s.result,l=s.page,d=(c=l||{}).pageToken,f=c.hasNext,u&&u.list?[2,{code:o,data:{data:M_(u.list),pageToken:f&&d?d:""}}]:[2,{code:o,data:{data:[],pageToken:f&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(d.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),n=new ao(xr[xr.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(n,hu)];case 1:return r=a.sent(),i=r.code,o=r.data,i!==x.SUCCESS?[2,{code:i}]:o?(s=o.result,u=o.page,c=(l=u||{}).pageToken,d=l.hasNext,[2,{code:i,data:{data:L_(s),pageToken:d&&c?c:""}}]):[2,{code:i,data:{data:[],pageToken:""}}]}}))}))}}),Object.defineProperty(d.prototype,"deleteFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{code:x.NOT_SUPPORT}]}))}))}}),Object.defineProperty(d.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=nl.encode(Au,{targetId:e}),n=new ao(xr[xr.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(n,Nu)];case 1:return r=a.sent(),i=r.code,o=r.data,i!==x.SUCCESS?[2,{code:i}]:o?[2,{code:i,data:M_(o.list)}]:[2,{code:i,data:[]}]}}))}))}}),Object.defineProperty(d.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Promise.resolve({code:x.NOT_SUPPORT})]}))}))}}),Object.defineProperty(d.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=nl.encode(Cu,{level:e}),n=new ao(xr.friendAuthSet,t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new ao(xr.friendAuthGet,e,this.currentUserId),[4,this._connMgr.send(t,Cu)];case 1:return n=o.sent(),r=n.code,i=n.data,r===x.SUCCESS&&i?[2,{code:r,data:i}]:[2,{code:r}]}}))}))}}),Object.defineProperty(d.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){throw new Error("Method not implemented.")}}),Object.defineProperty(d.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(r=this._connMgr)?(i=nl.encode(Us,{key:t,dataContent:n}),[4,r.send(new ao(xr.reqCall,i,e),Us)]):[3,2];case 1:return o=a.sent(),s=o.code,u=o.data,s===x.SUCCESS&&u?[2,Promise.resolve({code:s,data:{key:u.key,value:u.dataContent}})]:[2,Promise.resolve({code:s})];case 2:return[2,Promise.resolve({code:x.RC_NET_CHANNEL_INVALID})]}}))}))}}),Object.defineProperty(d.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,p=this;return a(this,(function(a){switch(a.label){case 0:return i=(r=this).currentUserId,o=r._connMgr,s=B.PRIVATE,u=o.codec.encodeOldConversationList({count:e,type:s,startTime:t,order:n}),l=new ao(xr.qrySessions,u,i),[4,o.send(l,Ca,{currentUserId:i,connectedTime:o.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=e.unreadMessageCount,o=p._chat.storage.getOrCreateModel({conversationType:t,targetId:n,channelId:r},!1).toIReceivedConversation();return Object.assign(e,o,{unreadMessageCount:i}),e}})];case 1:return c=a.sent(),d=c.code,f=c.data,d!==x.SUCCESS?[2,{code:d}]:[2,{code:d,data:null==f?void 0:f.list.sort((function(e,t){var r,i,o=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0,a=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===n?a-o:o-a}))}]}}))}))}}),Object.defineProperty(d.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=nl.encode(ja,{nothing:1}),[4,this._connMgr.query(xr.qrySessionsAtt,this.currentUserId,e,Ga)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(d.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.targetId,r=this.getServerTime(),this._clearConversationUnreadCount(t,n,"",!1,r),i=sg(e,r),o=new so(xr.updRRTime,i,this.currentUserId),[4,this._connMgr.send(o)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=this._connMgr,n=new ao(xr.delSessions,t.codec.encodeRemoveConversationList(e),this.getCurrentUserId()),[4,t.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(d.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=this._connMgr.codec.encodeQuerySessionsInput(e),i=new ao(xr[xr.qrySessionsUnread],r,this.currentUserId),[4,this._connMgr.send(i,Ha)];case 1:return(o=a.sent()).code===x.SUCCESS&&o.data?[2,{code:o.code,data:null===(n=null===(t=o.data)||void 0===t?void 0:t.sessions)||void 0===n?void 0:n.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:Dt(e.unreadCount)}}))}]:[2,{code:o.code}]}}))}))}}),Object.defineProperty(d.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=nl.encode(Mu,e),[4,this._connMgr.query(xr.addUnpush,this.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=nl.encode(Lu,{nothing:0}),[4,this._connMgr.query(xr.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(d.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=nl.encode(Uu,{nothing:0}),[4,this._connMgr.query(xr.qryUnpush,this.currentUserId,e,Du)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,n=e.spanMinutes,r=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:n,startTime:r,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:we.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(d.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,mn(Xn.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),Object.defineProperty(d.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f=this;return a(this,(function(a){switch(a.label){case 0:return i=0===r?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,s=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,n=e.content,i=e.targetLanguage||o;t!==i?n?s.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:r,transType:1}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:Lr.NONE}}):u.push({identifier:e.identifier,from:r,code:x.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:Lr.NONE}})})),0!==s.length?[3,1]:(l=mn(),[3,3]);case 1:return c=nl.encode(Gu,{businessType:3,businessInfo:nl.encode(Bu,{forceTrans:n,transInfos:s,model:t})}),[4,this._connMgr.query(xr.upConvertMsg,i,c,Fu)];case 2:d=a.sent(),l=d.wipe(),a.label=3;case 3:return u.length>0&&setTimeout((function(){return f._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),f=new WeakSet,p=function(e){delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e)},h=function(e,t){var n,r;null===(r=(n=this._watcher).readReceiptResponseV5)||void 0===r||r.call(n,t)},g=function(e,t){var n,r;null===(r=(n=this._watcher).speechToTextResponse)||void 0===r||r.call(n,t)},_=function(e,t){var n,r;null===(r=(n=this._watcher).messagesModified)||void 0===r||r.call(n,t)},b=function(e){var t,n;null===(n=(t=this._watcher).messageModifiedSyncCompleted)||void 0===n||n.call(t)},y=function(e,t,n){var r=this;t!==yg?t!==Tg?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(n)):this._handleConvertEvent(n):n.forEach((function(e){nl.decode(wu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,n,i=zt(e);null===(n=(t=r._watcher).groupApplicationEvent)||void 0===n||n.call(t,i)}))}))},I=function(e){var t={},n=e.extraProfile;return n&&(delete e.extraProfile,t.userExtProfile=Jh(n)),t.userProfile=Jh(e),t},i([P_()],d.prototype,"createGroup",null),i([P_()],d.prototype,"updateGroupInfo",null),i([P_()],d.prototype,"getGroupsInfo",null),i([P_()],d.prototype,"kickGroupMembers",null),i([P_()],d.prototype,"quitGroup",null),i([P_()],d.prototype,"dismissGroup",null),i([P_()],d.prototype,"transferGroupOwner",null),i([P_()],d.prototype,"setGroupManagers",null),i([P_()],d.prototype,"getGroupMembersByRole",null),i([P_()],d.prototype,"getGroupMembers",null),i([P_()],d.prototype,"setGroupMemberInfo",null),i([P_()],d.prototype,"joinGroup",null),i([P_()],d.prototype,"inviteUsersToGroup",null),i([P_()],d.prototype,"memberInviteResponse",null),i([P_()],d.prototype,"getGroupApplications",null),i([P_()],d.prototype,"getJoinedGroupsByRole",null),i([P_()],d.prototype,"getJoinedGroups",null),i([P_()],d.prototype,"setGroupRemark",null),i([P_()],d.prototype,"setGroupFollows",null),i([P_()],d.prototype,"getGroupFollows",null),i([P_()],d.prototype,"addFriend",null),i([P_()],d.prototype,"deleteFriends",null),i([P_()],d.prototype,"acceptFriendApplication",null),i([P_()],d.prototype,"refuseFriendApplication",null),i([P_()],d.prototype,"setFriendInfo",null),i([P_()],d.prototype,"checkFriends",null),i([P_()],d.prototype,"getFriends",null),i([P_()],d.prototype,"getFriendApplications",null),i([P_()],d.prototype,"deleteFriendApplication",null),i([P_()],d.prototype,"getFriendsInfo",null),i([P_()],d.prototype,"searchFriendsInfo",null),i([P_()],d.prototype,"setFriendAddPermission",null),i([P_()],d.prototype,"getFriendAddPermission",null),i([P_()],d.prototype,"getRealtimeConversations",null),i([P_()],d.prototype,"getRealtimeConTotalUnreadCount",null),i([P_()],d.prototype,"clearRealtimeConUnreadCount",null),i([P_()],d.prototype,"removeRealtimeConversations",null),i([P_()],d.prototype,"getRealtimeConUnreadCounts",null),i([w_()],d.prototype,"setNotificationQuietHoursWithSetting",null),i([w_()],d.prototype,"removeNotificationQuietHoursSetting",null),i([w_()],d.prototype,"getNotificationQuietHoursSetting",null),d}(wl),V_=function(){function e(e){U_.set(this,void 0),d(this,U_,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,U_,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return g_(c(this,U_,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return c(this,U_,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),e}();function j_(e){return r({},e)}function G_(e,t,n){var r=n.value;n.value=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:x.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):r.call.apply(r,l([this],u(t),!1))}}function k_(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dc(this.getNaviInfoFromCache()).isOk?r.call.apply(r,l([this],u(e),!1)):Promise.resolve({code:x.RC_REAL_TIME_CONVERSATION_UNAVAILABLE})}}U_=new WeakMap;var F_=function(){function e(e){var n,i;t.add(this),Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_pluginContextQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pluginInstanseMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appkey",{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,"sse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_versionInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_typingInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rtcCodec",{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,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(n={},n[Ie.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),n[Ie.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),n[Ie.INTERCEPT]=this._processInterceptMessage.bind(this),n[Ie.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),n[Ie.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),n[Ie.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),n)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(i={},i[Ie.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),i[Ie.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),i[Ie.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),i)}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:{message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,userSettingsSynced:void 0,userSettingsChanged:void 0,conversationStatusSynced:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,sgRelationsSynced:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageRecalled:void 0,messageDelivered:void 0,groupMessageDeliveredStatus:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0,speechToTextResponse:void 0,translateResponse:void 0,messagesModified:void 0,messageModifiedSyncCompleted:void 0}}),Object.defineProperty(this,"_typingInternalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_typingExpireTime",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),Object.defineProperty(this,"_typingChangedList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._options=r({},e),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")}));var o={onConnected:this._onConnectionStatusChange.bind(this,he.CONNECTED),onConnecting:this._onConnectionStatusChange.bind(this,he.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,he.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,he.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),sgRelationsSynced:this._sgRelationsSyncedListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),messageDelivered:this._messageDeliveredListerer.bind(this),groupMessageDeliveredStatus:this._groupMessageDeliveredStatusListerer.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this),speechToTextResponse:this._speechToTextResponse.bind(this),translateResponse:this._translateResponse.bind(this),messagesModified:this._messagesModified.bind(this),messageModifiedSyncCompleted:this._messageModifiedSyncCompleted.bind(this)};this.rtcCodec=new hl(Sl,Al);var a=Vt();this._engine=a?new RCCppEngine(this.rtcCodec,o,this._options):new D_(this.rtcCodec,o,this._options),this.logger=this._engine.getInnerLogger(),this._options.eventLoopBlockingCheck&&cr.start(this.logger),this.sse=new Ml(this,a)}var t,n,s,u;return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(H.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(H.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(H.L_IMSDK_VER_O,JSON.stringify({commitId:"dfca1380ac835179c5582cbe5cd85edd4910f43b",version:"5.24.1-c-dq.1"}));var n=this._context._engine;return oa.setNetworkStatusListener(n.setNetwork.bind(n)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(H.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.logger.createTraceId();if(this.logger.info(H.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(H.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new Vl(this):new Dl(this),i=null;try{if(!e.verify(oa))return null;i=e.setup(r,oa,t)}catch(e){this.logger.error(H.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new V_(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n,r;this.logger.warn(H.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_processChrmMemChangeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("function"==typeof this._watcher.chatroomState){var t={},n=[],r=e.content.memberCount,i=void 0===r?0:r;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:i,userList:n}})}return!0}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._addTypingInfo(j_(e)),this._watcher.typingState)return!0}}),Object.defineProperty(e.prototype,"_processInterceptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",blockType:e.content.interceptType,blockedMessageUId:e.content.msgUId,extra:e.content.extra};if(e.conversationType===B.ULTRA_GROUP){var n=e.content.sourceType;if(t.sourceType=n,(n===_e.MSG_EXPANSION||n===_e.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(H.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}}),Object.defineProperty(e.prototype,"_processChrmSyncMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBlockMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=e.content;return n.operateType===F.Blocked&&(null===(t=n.userList)||void 0===t?void 0:t.includes(this.getCurrentUserId()))&&this._engine.removeChatroomFromCatch(n.chatroomId),"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:n.chatroomId,operateType:n.operateType,durationTime:n.durationTime,operateTime:n.operateTime,userIdList:n.userList,extra:n.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBanMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptRequestMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptResponseMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.getCurrentUserId();n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i,o,a,s=this;if(!(null===(i=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(j_(e))}catch(e){return s.logger.error(H.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(a=(o=this._watcher).message)||void 0===a||a.call(o,j_(e),t,n),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this,i=[],o=[],a=[Ie.READ_RECEIPT,Ie.READ_RECEIPT_REQUEST,Ie.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=r._messageReceiver(e,t,n);s&&a.includes(s.messageType)?o.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(H.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userSettingsChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).conversationStatusSynced)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageDeliveredListerer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageDelivered)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMessageDeliveredStatusListerer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupMessageDeliveredStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"_ultraGroupEnableListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).ultraGroupEnable)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_sgRelationsSyncedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).sgRelationsSynced)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(H.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;this.logger.info(H.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).readReceiptResponseV5)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).speechToTextResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).translateResponse)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n;null===(n=(t=this._watcher).messagesModified)||void 0===n||n.call(t,e)}}),Object.defineProperty(e.prototype,"_messageModifiedSyncCompleted",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).messageModifiedSyncCompleted)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=Tt(r)||It(r)?r:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,i=e.content,o=e.channelId,a=i.typingContentType,s=o||"",u="".concat(n,"#").concat(r,"#").concat(s);this._typingInfo[u]||(this._typingInfo[u]=[]);var l=this._typingInfo[u].findIndex((function(e){return e.userId===t}));l>=0&&this._typingInfo[u][l].messageType===a?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:a,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}}),Object.defineProperty(e.prototype,"_startCheckTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectedTime()}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getServerTime()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setPushConfig(e)}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectionStatus()}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e._engine.getConnectionStatus()===he.CONNECTED?mn(e._engine.getNaviInfoFromCache()):yn(x.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e._engine.getCurrentUserId()?mn(e._engine.getNaviInfoFromCache()):yn(x.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r,i;return o(this,void 0,void 0,(function(){var o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return this._token=e,[4,oa.getNetworkType()];case 1:return o=a.sent(),this._engine.setNetwork({status:!0,type:o},!0),s=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,s,n)];case 2:return u=a.sent(),l=u.code,c=u.data,l!==x.SUCCESS?[2,{code:l}]:(1!==this._engine.getNaviInfoFromCache().type&&(d=ct.getInfo(),null===(i=(r=this._engine).reportSDKInfo)||void 0===i||i.call(r,d)),[2,{code:l,userId:c}])}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return r.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){n.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.connect(this.token,!!e,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==B.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var a,s,u,l={isPersited:t,isCounted:n,searchProps:i,isStatusMessage:o};a=e,s=l,(u=yr.get(a))&&!u.isCustom&&console.warn("Builtin message type '".concat(a,"' cannot be registered")),s.isStatusMessage&&(s.isCounted=s.isPersited=!1),yr.set(a,r(r({},s),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._engine.registerRTCSignalingListener(e)}}),Object.defineProperty(e.prototype,"_handleExpansioResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(t){var n=Ut(e),r=n.isIllgalEx,i=n.isExKeyOrValLengthExceedLimit;return n.isExceedLimit||i?x.EXPANSION_LIMIT_EXCEET:r?x.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){var o;if(n.needReceipt){if(4!==(null===(o=this.getNaviInfoFromCache())||void 0===o?void 0:o.grpRRVer))return Promise.resolve({code:x.READ_RECEIPT_ERROR});(e!==B.GROUP&&e!==B.PRIVATE||n.isStatusMessage||!n.isPersited||e===B.GROUP&&n.directionalUserIdList&&n.directionalUserIdList.length>0)&&(n.needReceipt=!1)}var a=Kl(n.messageType,n.content),s=a.code,u=a.msg;if(s!==x.SUCCESS)return Promise.resolve({code:s,msg:u});if(e===B.SYSTEM&&n.messageType!==Ie.SYNC_READ_STATUS)return Promise.resolve({code:x.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});if(n.messageType===Ie.STREAM_MESSAGE)return Promise.resolve({code:x.MESSAGE_NOT_SUPPORT_SENDING});var l=n.canIncludeExpansion,c=void 0!==l&&l,d=n.expansion,f=this._handleExpansioResult(d,c);if(f)return Promise.resolve({code:f});var p=n.isMentioned,h=n.mentionedUserIdList,g=n.mentionedType;p?n.content.mentionedInfo=function(e,t,n){var r,i,o;return{userIdList:(null===(r=e.mentionedInfo)||void 0===r?void 0:r.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||n||K.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}}(n.content,h,g):delete n.content.mentionedInfo;var _=JSON.stringify(n.content);if(pl(_)>xe)return Promise.resolve({code:x.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===B.ULTRA_GROUP)return n.channelId=this._channelIdConvert(e,n.channelId),this._engine.sendUltraMessage(t,n,r,i);var b=this.getNaviInfoFromCache();return(null==b?void 0:b.grpRRVer)&&n.messageType===Ie.READ_RECEIPT_RESPONSE?Promise.resolve({code:x.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,n,r,i)}}),Object.defineProperty(e.prototype,"sendExpansionMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,l,c,d,f,p;return a(this,(function(a){switch(a.label){case 0:return t=e.channelId,n=e.conversationType,r=e.targetId,i=e.messageUId,o=e.keys,s=e.expansion,u=e.removeAll,l=e.canIncludeExpansion,e.messageType===Ie.STREAM_MESSAGE&&((null==o?void 0:o.includes("RC_Ext_StreamMsgSummary"))||(null==s?void 0:s.RC_Ext_StreamMsgSummary))?[2,{code:x.STREAM_MESSAGE_EXPANSION_KEY_ERROR}]:l?(c=Ut(s),d=c.isIllgalEx,f=c.isExKeyOrValLengthExceedLimit,c.isExceedLimit||f?[2,Promise.resolve({code:x.EXPANSION_LIMIT_EXCEET})]:d?[2,Promise.resolve({code:x.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(p={mid:i},s&&(p.put=s),o&&(p.del=o),u&&(p.removeAll=1),[4,this._engine.sendMessage(n,r,{content:p,messageType:Ie.EXPANSION_NOTIFY,channelId:t})])):[2,{code:x.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:a.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:x.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:x.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,n||"")]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.sendReadReceiptMessageV4(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.updateConversationReadTime(e,t)]}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e=this;return a(this,(function(t){switch(t.label){case 0:return cr.stop(),this._resetWatcher(),this._engine.destroy(),oa.removeNetworkStatusListener(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(H.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a,s){var u={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===B.ULTRA_GROUP){var l=this._channelIdConvert(e,u.channelId);return u.channelId=l,this._engine.getUltraHistoryMsg(t,u,s)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,a||"",s)}}),Object.defineProperty(e.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a){var s={timestamp:n||0,count:r||20,order:i||0,channelId:o||""};if(e===B.ULTRA_GROUP){var u=this._channelIdConvert(e,s.channelId);return s.channelId=u,this._engine.getUltraHistoryMsg(t,s,a)}return this._engine.getMessages(e,t,s.timestamp,s.count,s.order,s.channelId,a)}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return void 0===n&&(n=0),void 0===r&&(r=20),void 0===i&&(i=0),void 0===o&&(o=""),this._engine.getContinuousMessages(e,t,n,r,i,o)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o,a){return this._engine.getHistoryMessagesByObjectNames(e,t,n,r,i,o,a)}}),Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return(t=Cr("getConversationListByFilter",e).tryTrans((function(){e.type;var t=i._engine.getNaviInfoFromCache();return Vt()||t&&g_(t)?i.validateLogin():i.validateConnected()}))).isOk?(n=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_LIST_BY_FILTER_T,JSON.stringify(e),n),[4,this._engine.chat.getConversationListByFilter(e)]):[2,t.wipe()];case 1:return r=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_LIST_BY_FILTER_R,r,n),[2,r.trans((function(e){return e.list}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return(t=Wl("getLocalConversation",e,z).result()).isOk?(n=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_T,JSON.stringify(e),n),r=this._channelIdConvert(e.conversationType,e.channelId)||"",[4,this._engine.chat.getConversation(e.conversationType,e.targetId,r)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_R,i,n,e),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return(t=Wl("removeConversation",e,J).result().tryTrans(this.validateConnected)).isOk?(e.channelId=this._channelIdConvert(e.conversationType,e.channelId)||"",n=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_CONVERSATION_T,JSON.stringify(e),n),[4,this._engine.removeConversation(e)]):[2,t.wipe()];case 1:return r=i.sent(),this.logger.summary(H.A_REMOVE_CONVERSATION_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.batchRemoveConversation(e)}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupList(e)}}),Object.defineProperty(e.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getBlockUltraGroupList()}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e===B.ULTRA_GROUP){var r=this._channelIdConvert(e,n);return this._engine.clearUltraUnreadcount(t,r||"")}return this._engine.clearConversationUnreadCount(e,t,n||"")}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_ALL_UNREAD_COUNT_O),this._engine.chat.clearAllUnreadCount()}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationUnreadCount(e,t,r||"")}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=In.create("getTotalUnreadCount").validate("channelId",e,Nt,!0).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",t,At).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).tryTrans((function(e){var n=g_(e);return!n&&t&&t.includes(B.ULTRA_GROUP)?yn(x.METHOD_NOT_SUPPORT):mn(n)}))).isOk?[2,this._engine.chat.getTotalUnreadCount(e,t||[],!!n)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getTotalUnreadCountByLevels(e,t,n)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getFirstUnreadMessage(e,t,n||"")}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getFirstUnreadMessageInfo(e,t,n)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return i=In.create("batchSetConversationNotificationLevel"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Wl("batchSetConversationNotificationLevel",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("notificationLevel",r,me,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:r}),s),u=e.map((function(e){return c(d,t,"m",n).call(d,e)})),[4,this._engine.chat.batchSetConversationNotificationLevel(u,r)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,d,f,p=this;return a(this,(function(a){switch(a.label){case 0:return o=In.create("batchSetConversationToTop"),(u=o.isLimitedTypedArray("conversations",e,20,(function(e){return Wl("batchSetConversationToTop",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==B.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?mn():yn(x.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(l=this.logger.createTraceId(),d=e.map((function(e){return c(p,t,"m",n).call(p,e)})),this.logger.info(H.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:d,isTop:r,isUpdateTime:i,isCreateConversation:s}),l),[4,this._engine.chat.batchSetConversationToTop(d,r,i,s)]):[2,u.wipe()];case 1:return f=a.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TO_TOP_R,f,l),[2,f]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return i=In.create("batchSetConversationTranslateStrategy"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Wl("",e,J).result().isOk}),!0,1).fail(x.INVALID_PARAMETER_CONVERSATION_LIST).isValueOf("strategy",r,Ur,!0).fail(x.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:r}),s),u=e.map((function(e){return c(d,t,"m",n).call(d,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(u,r)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=this._channelIdConvert(e,r);return this._engine.saveConversationMessageDraft(e,t,n,i||"")}}),Object.defineProperty(e.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationMessageDraft(e,t,r||"")}}),Object.defineProperty(e.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.clearConversationMessageDraft(e,t,r||"")}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(n=Wl("recallMessage",e,z).isString("messageUId",t.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!1).fail(x.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(x.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(x.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(x.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,wt,!1,1).fail(x.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected)).isOk?(r=t.messageUId,i=this.logger.createTraceId(),this.logger.info(H.A_RECALL_MESSAGE_T,JSON.stringify({messageUId:r}),i),o=e.conversationType,s=e.channelId,e.channelId=this._channelIdConvert(o,s)||"",[4,this._engine.recallMsg(e,t)]):(this.logger.warn(H.A_RECALL_MESSAGE_E,n.errmsg()),[2,n.wipe()]);case 1:return u=a.sent(),this.logger.summary(H.A_RECALL_MESSAGE_R,u,i,{messageUId:r}),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l,d;return a(this,(function(a){switch(a.label){case 0:return i=Wl("deleteRemoteMessage",e,J),(o=i.isLimitedTypedArray("messages",r,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,n=e.sentTime,r=e.messageDirection;return mt(t)&&(r===be.SEND||r===be.RECEIVE)&&bt({min:0})(n)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).tryTrans((function(){return e.conversationType===B.ULTRA_GROUP&&Vt()?yn(x.METHOD_NOT_SUPPORT):mn()}))).isOk?(s=c(this,t,"m",n).call(this,e),u=r.map((function(e){return e.messageUId})).join(","),l=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_T,JSON.stringify({conversation:s,msgIds:u}),l),[4,this._engine.chat.deleteRemoteMessage(s,r)]):[2,o.wipe()];case 1:return d=a.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_R,d,l),[2,d]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return(o=Wl("deleteRemoteMessageByTimestamp",e,z).isInteger("timestamp",i,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected)).isOk?(s=c(this,t,"m",n).call(this,e),u=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T,JSON.stringify(r(r({},s),{timestamp:i})),u),[4,this._engine.chat.deleteRemoteMessageByTimestamp(s,i)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R,l,u),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,r,n)}}),Object.defineProperty(e.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,r,n)}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.quitChatroom(e)}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getChatroomInfo(e,t||0,n||0)}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key,r=t.value;return rn(n)?on(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_VALUE):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var n=0;n<t.entries.length;n++){var i=t.entries[n],o=i.key,a=i.value;if(!rn(o))return Promise.resolve({code:x.INVALID_PARAMETER_KEY});if(!on(a))return Promise.resolve({code:x.INVALID_PARAMETER_VALUE})}var s=r(r({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,s)}}),Object.defineProperty(e.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key,r=t.value;return rn(n)?on(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_VALUE):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key;return rn(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!rn(r))return Promise.resolve({code:x.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)}}),Object.defineProperty(e.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=t.key;return rn(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(x.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getChatroomEntry(e,t)}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getAllChatroomEntry(e)}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=In.create("getChatroomHistoryMessages").validate("roomId",e,wt,!0).fail(x.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(x.INVALID_PARAMETER_COUNT).isLimitedInteger("order",n,0,1).fail(x.INVALID_PARAMETER_ORDER).isInteger("timestamp",r).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected)).isOk?(o=this.logger.createTraceId(),this.logger.info(H.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:n,timestamp:r}),o),[4,this._engine.chatroom.getChatroomHistoryMessages(e,r||0,t||20,n||0)]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(H.A_GET_CHATROOM_HISTORY_MESSAGES_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return o=this.getNaviInfoFromCache(),u=(null==o?void 0:o.uploadServer)||"",l=(null==o?void 0:o.ossConfig)||"",[4,this._engine.getFileToken(e,t,n,r,i,s)];case 1:return c=a.sent(),d=c.code,f=c.data,d===x.SUCCESS&&f?[2,Promise.resolve(Object.assign(f,{qiniu:u,ossConfig:f.ossConfig||l}))]:[2,Promise.reject(d)]}}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return[4,this._engine.getFileUrl(e,n,t,r)];case 1:return i=a.sent(),o=i.code,s=i.data,o===x.SUCCESS?[2,Promise.resolve(s)]:[2,Promise.reject(o)]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,In.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.createTag(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_ADD_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,In.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return r._engine.removeTag(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_REMOVE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,In.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(x.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return r._engine.updateTag(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_UPDATE_TAG_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return n._engine.getTagList()}))];case 1:return t=r.sent(),this.logger.summary(H.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return(i=In.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",r,(function(e){return Wl("",e,W).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==r?void 0:r.length,1,1e3,!0).fail(x.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(o=r.map((function(e){return c(l,t,"m",n).call(l,e)})),s=this.logger.createTraceId(),this.logger.info(H.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:o}),s),[4,this._engine.chat.addTagForConversations(e,o)]):[2,i.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_ADD_TAG_FOR_CONVERSATIONS_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return(i=In.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",r,1e3,(function(e){return Wl("",e,W).result().isOk}),!0).fail(x.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(o=r.map((function(e){return c(l,t,"m",n).call(l,e)})),s=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:o}),s),[4,this._engine.chat.removeTagForConversations(e,o)]):[2,i.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_REMOVE_TAG_FOR_CONVERS_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(i=Wl("removeTagsForConversation",e,W).isTypedArray("tagIds",r,(function(e){return ht(e)}),!0).fail(x.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(o=this.logger.createTraceId(),s=c(this,t,"m",n).call(this,e),this.logger.info(H.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:r,conversation:s}),o),[4,this._engine.chat.removeTagsForConversation(s,r)]):[2,i.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_REMOVE_TAGS_FOR_CONVER_R,u,o),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=In.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isInteger("count",n,!0).fail(x.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_START_TIME).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationListByTag(e,t,n<=0?20:Math.min(n,100))]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),n),[4,In.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(x.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return r=o.sent(),this.logger.summary(H.A_GET_UNREAD_COUNT_BY_TAG_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,i){return o(this,void 0,void 0,(function(){var o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return(o=Wl("setConversationStatusInTag",r,W).isLimitedString("tagId",e,1,10,!0).fail(x.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==i?void 0:i.isTop,!0).fail(x.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),u=c(this,t,"m",n).call(this,r),this.logger.info(H.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:u,isTop:i.isTop}),s),[4,this._engine.chat.setConversationStatusInTag(e,u,i)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(H.A_SET_CONVER_TO_TOP_IN_TAG_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(r=Wl("getTagsForConversation",e,W).result().tryTrans(this.validateLogin)).isOk?(i=this.logger.createTraceId(),o=c(this,t,"m",n).call(this,e),this.logger.info(H.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(o),i),[4,this._engine.chat.getTagsForConversation(o)]):[2,r.wipe()];case 1:return s=a.sent(),this.logger.summary(H.A_GET_TAGS_OF_CONVERSATION_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getAllUnreadMentionedCount()}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.conversationType!==B.ULTRA_GROUP){var t=x.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:x[t]})}var n=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=n,this._engine.sendUltraGroupTypingStatus(e)}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=e.messages.map((function(n){var r=n.sendTime,i=n.messageUId,o=n.channelId;return{sendTime:r,messageUId:i,channelId:t._channelIdConvert(e.conversationType,o)}}));return e.messages=n,this._engine.getUltraGroupMessageListByMessageUId(e)}}),Object.defineProperty(e.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,n=e.expansion,r=e.canIncludeExpansion,t!==B.ULTRA_GROUP?[2,{code:i=x.CONVERSATION_TYPE_NOT_SUPPORT,msg:x[i]}]:r?(o=Ut(n),s=o.isIllgalEx,u=o.isExKeyOrValLengthExceedLimit,o.isExceedLimit||u?[2,{code:x.EXPANSION_LIMIT_EXCEET}]:s?[2,{code:x.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:x.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:a.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(B.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)}}),Object.defineProperty(e.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(B.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupUnreadInfoList(e)}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.setCallInfo(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupMessageDeliverList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),this._engine.getGroupMessageDeliverList(e,t,n)}}),Object.defineProperty(e.prototype,"getPrivateMessageDeliverTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),this._engine.getPrivateMessageDeliverTime(e,t)}}),Object.defineProperty(e.prototype,"_isEnableSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,n=void 0===t?0:t;switch(e){case de.ONLINE_STATUS:return 1&n;case de.USER_PROFILE:return 2&n;default:return!1}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,n):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,n):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:x.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfile(e)}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUserProfiles(e)}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfile()}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfileVisibility(e)}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfileVisibility()}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchUserProfileByUniqueId(e)}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.getBlacklist()]}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){return r=Kl(n.messageType,n.content),i=r.code,o=r.msg,i!==x.SUCCESS?[2,Promise.resolve({code:i,msg:o})]:[2,this._engine.insertMessage(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.batchInsertMessage(e,t)}}),Object.defineProperty(e.prototype,"getMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.getMessageCount(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){return a(this,(function(o){return[2,this._engine.deleteMessagesByTimestamp(e,t,n,!!r,i)]}))}))}}),Object.defineProperty(e.prototype,"batchClearMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return(n=In.create("batchClearRemoteHistoryMessages").isTypedArray("options",e,(function(e){return Wl("",e,J).result().isOk&&bt({min:0})(e.timestamp)}),!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(r=this.logger.createTraceId(),this.logger.info(H.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,this._engine.chat.batchClearRemoteHistoryMessages(e,t)]):[2,n.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_BATCH_CLEAR_REMOTE_MSG_R,n,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"clearMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.clearMessages(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=In.create("getLocalMessage").validate("messageId",e,(function(){return ht(e)||_t(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result(),n=this.logger.createTraceId(),this.logger.info(H.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),n),[4,t.next((function(){return i._engine.getMessage(e)}))];case 1:return r=o.sent(),this.logger.summary(H.A_GET_LOCAL_MESSAGE_R,r,n,{messageId:e}),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageSentStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(n=Wl("setMessageStatusToRead",e,W).isNumber("timestamp",t,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,s=e.channelId,this.logger.info(H.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),r),[4,this._engine.updateMessageReceiptStatus(i,o,t,s)]):[2,n.wipe()];case 1:return u=a.sent(),this.logger.summary(H.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,r),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=In.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(x.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return mt(e)})).fail(x.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",n,Nt).fail(x.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",r,(function(e){return ee(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:n,conversationTypes:r}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[Ie.TextMessage,Ie.FILE],n||"",r&&0!==r.length?r:$(J))]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[Ie.TextMessage,Ie.FILE],n&&0!==n.length?n:$(J))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var i,u;return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return(o=Wl("searchMessages",e,W).isLimitedString("keyword",null==n?void 0:n.keyword,0,1e3,!0).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==n?void 0:n.limit,1,ut,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==n?void 0:n.offset,0,ut).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==n?void 0:n.order,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).isObject("timeRange",n.timeRange).validate("timeRange",n.timeRange,(function(e){var t=e.startTime,n=e.endTime;return!t&&!n||!(t&&!_t(t)||n&&!_t(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(i=null==n?void 0:n.messageFilter)||void 0===i?void 0:i.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(u=null==n?void 0:n.messageFilter)||void 0===u?void 0:u.senderIds,wt).fail(x.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Vt()?mn():yn(x.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?[4,c(this,t,"m",s).call(this,r(r({},n),{conversationFilter:{conversationTypes:[e.conversationType],targetIds:[e.targetId],channelIds:"string"==typeof e.channelId?[e.channelId]:[]}}))]:[2,o.wipe()];case 1:return[2,a.sent().orSync((function(){return mn({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n,r,i,u,l,d;return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){return(o=In.create("searchMessagesWithParams").isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(x.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,ut,!0).fail(x.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,ut).fail(x.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(x.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,n=e.endTime;return!t&&!n||!(t&&!_t(t)||n&&!_t(n))&&(t=null!=t?t:0,n=null!=n?n:Date.now(),t>=0&&t<=n)})).fail(x.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.conversationTypes,(function(e){return ee(e,J)})).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.targetIds,20,wt,!1,0).fail(x.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(i=null==e?void 0:e.conversationFilter)||void 0===i?void 0:i.channelIds,10,Nt,!1,0).fail(x.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(u=null==e?void 0:e.messageFilter)||void 0===u?void 0:u.senderIds,20,wt,!1,0).fail(x.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(l=null==e?void 0:e.messageFilter)||void 0===l?void 0:l.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(x.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(d=e.messageFilter)||void 0===d?void 0:d.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,t,"m",s).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.getMessagesByTimestamp(e,t,n,r)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return void 0===n&&(n=""),this._engine.getUnreadMentionedMessages(e,t,n)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=""),this._engine.clearUnreadCountByTimestamp(e,t,n,r)}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._channelIdConvert(B.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,n||"")}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this._channelIdConvert(B.ULTRA_GROUP,n);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,r||"")}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Wl("getConversationNotificationLevel",e,J).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,t,"m",n).call(this,e))]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=In.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).isValueOf("level",t,me,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){return(t=In.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,J)}),!0).fail(x.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r,i,o){return this._engine.getRemoteHistoryMessages(e,t,n,r,i,o)}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getConversations(e)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._engine.rtcSignaling(e,t,n,r)}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.rtcPing(e,t,n)}}),Object.defineProperty(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.bindRTCRoomForChatroom(e)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setProxy(e)}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProxy()}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.testProxy(e,t)}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=[]),this._engine.createGroup(e,t,n,r)}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.updateGroupInfo(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupsInfo(e)}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.kickGroupMembers(e,t,n)}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.quitGroup(e,t)}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.dismissGroup(e)}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return void 0===r&&(r=!1),this._engine.transferGroupOwner(e,t,r,n)}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.setGroupManagers(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getGroupMembersByRole(e,t,n)}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getGroupMembers(e,t)}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._engine.setGroupMemberInfo(e,t,n,r)}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.searchGroupMembers(e,t,n)}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.joinGroup(e)}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.inviteUsersToGroup(e,t)}}),Object.defineProperty(e.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:P.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:P.REFUSE,reason:n})}}),Object.defineProperty(e.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:P.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:P.REFUSE,reason:r})}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getGroupApplications(e,t,n)}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getJoinedGroupsByRole(e,t)}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.searchJoinedGroups(e,t)}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getJoinedGroups(e)}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupRemark(e,t)}}),Object.defineProperty(e.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(C.ADD,e,t)}}),Object.defineProperty(e.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(C.REMOVE,e,t)}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupFollows(e)}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.addFriend(e,t,n)}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.deleteFriends(e,t)}}),Object.defineProperty(e.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.acceptFriendApplication(e)}}),Object.defineProperty(e.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.refuseFriendApplication(e,t)}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.setFriendInfo(e,t,n)}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.checkFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getFriendApplications(e,t,n)}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getFriendsInfo(e)}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchFriendsInfo(e)}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setFriendAddPermission(e)}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getFriendAddPermission()}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return this._engine.getRealtimeConversations(e,t,n)}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getRealtimeConTotalUnreadCount()}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.clearRealtimeConUnreadCount(e)}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.removeRealtimeConversations(e)}}),Object.defineProperty(e.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getRealtimeConUnreadCounts(e)}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return In.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(x.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(x.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(x.INVALID_PARAMETER_SPAN_MINUTES).isValueOf("level",e.level,we,!0).fail(x.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return(n=Wl("sendReadReceiptResponseV5",e,Q).isTypedArray("messageUIdArray",t,(function(e){return wt(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?mn():yn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){return(n=Wl("getMessageReadReceiptInfoV5",e,Q).isTypedArray("messageUIdArray",t,(function(e){return wt(e)}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?mn():yn(x.READ_RECEIPT_ERROR)}))).isOk?(r=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){return t=In.create(""),(n=In.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return Ql(t,e.identifier,Q).isNotEmptyString("messageUId",e.messageUId,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(x.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?mn():yn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Wl("getMessageReadReceiptInfoV5",e,Q).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isObject("option",n,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",n.pageToken).fail(x.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",n.pageCount,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?mn():yn(x.READ_RECEIPT_ERROR)}))).isOk?(n.order=1!==n.order?0:1,n.readStatus=1!==n.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,n)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return(r=Wl("getMessagesReadReceiptByUsersV5",e,Q).isNotEmptyString("messageUId",t,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",n,(function(e){return wt(e)}),!0).fail(x.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",n.length,1,100,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?mn():yn(x.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,n)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(H.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),n),[4,In.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?mn():yn(x.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return r=o.sent(),this.logger.summary(H.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,r,n),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){switch(r.label){case 0:return[4,In.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(x.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return n._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(H.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:n}),r),[4,In.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(x.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var r=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,r,!!n)}))];case 1:return i=a.sent(),this.logger.summary(H.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n;return o(this,void 0,void 0,(function(){var r,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return r=Vt(),[4,In.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof wr&&e.isValid(!r)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(n=null==e?void 0:e.list)||void 0===n?void 0:n.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,Nr).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(i=a.sent()).isOk?(o=e.list,s=e.force,l=e.mode,[2,c(this,t,"m",u).call(this,o,0,l,s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n;return o(this,void 0,void 0,(function(){var r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,In.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Mr&&e.isValid(!0)}),!0).fail(x.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(n=null==e?void 0:e.list)||void 0===n?void 0:n.length,1,10,!0).fail(x.TRANSLATION_PARAMS_LIST_INVALID).isValueOf("mode",null==e?void 0:e.mode,Nr).fail(x.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=a.sent()).isOk?(i=e.list,o=e.mode,[2,c(this,t,"m",u).call(this,i,1,o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,In.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(x.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return r._engine.userSettings.setTranslationLanguage(e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_SET_TRANSLATION_LANGUAGE_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getTranslationLanguage()}))];case 1:return t=r.sent(),this.logger.summary(H.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(H.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return r._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return n=i.sent(),this.logger.summary(H.A_SET_AUTO_TRANSLATE_ENABLED_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(H.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return n._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=r.sent(),this.logger.summary(H.A_GET_AUTO_TRANSLATE_ENABLED_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.messageUId,r=null==e?void 0:e.messageContent,this.logger.info(H.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:n}),t),[4,Wl("modifyMessageWithParams",e.conversation,Z).isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isNotEmptyString("messageUId",n,!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",r,!0).fail(x.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",pl(JSON.stringify(r)),1,xe,!0).fail(x.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=a.sent(),this.logger.summary(H.A_MODIFY_MESSAGE_WITH_PARAMS_R,i,t),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,n,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),n=null==e?void 0:e.messageUIds,this.logger.info(H.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:n}),t),[4,Wl("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,Z).isObject("params",e,!0).fail(x.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",n,(function(e){return mt(e)}),!0).fail(x.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==n?void 0:n.length,1,20,!0).fail(x.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(n,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return r=o.sent(),this.logger.summary(H.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,r,t),[2,r]}}))}))}}),t=new WeakSet,n=function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:this._channelIdConvert(e.conversationType,e.channelId)}},s=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.timeRange||{},n=t.startTime,r=t.endTime,i={startTime:null!=n?n:0,endTime:null!=r?r:Date.now()},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(H.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return s=a.sent(),this.logger.summary(H.A_SEARCH_MSGS_BY_PARAMS_R,s,o),[2,s]}}))}))},u=function(e,t,n,r){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),n||Nr.MECHANICAL,!!r,t)]}))}))},i([G_],e.prototype,"updateMyUserProfile",null),i([G_],e.prototype,"getUserProfiles",null),i([G_],e.prototype,"getMyUserProfile",null),i([G_],e.prototype,"updateMyUserProfileVisibility",null),i([G_],e.prototype,"getMyUserProfileVisibility",null),i([G_],e.prototype,"searchUserProfileByUniqueId",null),i([G_],e.prototype,"createGroup",null),i([G_],e.prototype,"updateGroupInfo",null),i([G_],e.prototype,"getGroupsInfo",null),i([G_],e.prototype,"kickGroupMembers",null),i([G_],e.prototype,"quitGroup",null),i([G_],e.prototype,"dismissGroup",null),i([G_],e.prototype,"transferGroupOwner",null),i([G_],e.prototype,"setGroupManagers",null),i([G_],e.prototype,"getGroupMembersByRole",null),i([G_],e.prototype,"getGroupMembers",null),i([G_],e.prototype,"setGroupMemberInfo",null),i([G_],e.prototype,"searchGroupMembers",null),i([G_],e.prototype,"joinGroup",null),i([G_],e.prototype,"inviteUsersToGroup",null),i([G_],e.prototype,"acceptGroupInvite",null),i([G_],e.prototype,"refuseGroupInvite",null),i([G_],e.prototype,"acceptGroupApplication",null),i([G_],e.prototype,"refuseGroupApplication",null),i([G_],e.prototype,"getGroupApplications",null),i([G_],e.prototype,"getJoinedGroupsByRole",null),i([G_],e.prototype,"searchJoinedGroups",null),i([G_],e.prototype,"getJoinedGroups",null),i([G_],e.prototype,"setGroupRemark",null),i([G_],e.prototype,"addGroupFollows",null),i([G_],e.prototype,"removeGroupFollows",null),i([G_],e.prototype,"getGroupFollows",null),i([G_],e.prototype,"addFriend",null),i([G_],e.prototype,"deleteFriends",null),i([G_],e.prototype,"acceptFriendApplication",null),i([G_],e.prototype,"refuseFriendApplication",null),i([G_],e.prototype,"setFriendInfo",null),i([G_],e.prototype,"checkFriends",null),i([G_],e.prototype,"getFriends",null),i([G_],e.prototype,"getFriendApplications",null),i([G_],e.prototype,"getFriendsInfo",null),i([G_],e.prototype,"searchFriendsInfo",null),i([G_],e.prototype,"setFriendAddPermission",null),i([G_],e.prototype,"getFriendAddPermission",null),i([k_],e.prototype,"getRealtimeConversations",null),i([k_],e.prototype,"getRealtimeConTotalUnreadCount",null),i([k_],e.prototype,"clearRealtimeConUnreadCount",null),i([k_],e.prototype,"removeRealtimeConversations",null),i([k_],e.prototype,"getRealtimeConUnreadCounts",null),e}();export{F_ as APIContext,Xl as AppStorage,Hn as AreaCode,Ul as AssertRules,wl as BasicEngine,tr as BasicLogger,D as ChatroomEntryType,j as ChatroomSyncStatusReason,G as ChatroomUserChangeType,k as ChrmMemBanType,F as ChrmMemOperateType,V as ChrmSyncStatus,hl as Codec,Ju as ConnectionStatus,Ar as ConversationListFilterType,B as ConversationType,f as DirectionType,x as ErrorCode,sl as EventEmitter,Y as FileType,h as FriendAddPermission,E as FriendApplicationStatus,b as FriendApplicationType,_ as FriendRelationType,U as GroupApplicationDirection,N as GroupApplicationStatus,L as GroupApplicationType,R as GroupInviteHandlePermission,y as GroupJoinPermission,T as GroupMemberInfoEditPermission,O as GroupMemberRole,S as GroupOperation,I as GroupOperationPermission,w as GroupOperationRole,P as GroupOperationStatus,C as GroupOperationType,De as HttpMethod,Pe as InterruptionLevel,sr as LogDBProxy,Jn as LogL,Wu as LogLevel,Qu as LogSource,H as LogTagId,xe as MAX_MESSAGE_CONTENT_BYTES,ut as MAX_U32_INTEGER,He as MAX_UPLOAD_FILE_SIZE,K as MentionedType,Ve as MessageAuditType,_e as MessageBlockSourceType,ge as MessageBlockType,be as MessageDirection,Ie as MessageType,me as NotificationLevel,ye as NotificationStatus,le as OnlineStatus,ue as OperateStatus,sa as PBCodec,ce as PlatformInfo,Dl as PluginContext,Ee as PushImportanceHonor,we as PushNotificationQuietHoursLevel,p as QueryFriendsDirectionType,he as RCConnectionStatus,vn as RCResult,$u as RTCApiType,tl as RTCJoinType,zu as RTCMode,Vl as RTCPluginContext,Te as ReceivedStatus,se as SentStatus,je as SpeechToTextStatus,gl as StreamMessageResponseEventType,fe as SubscribeOperationType,de as SubscribeType,_n as SuspendablePromise,wr as TranslateMessageParam,Nr as TranslateMode,Lr as TranslateStatus,Ur as TranslateStrategy,Mr as TranslateTextParam,qe as UPLOAD_FILE_CHUNK_SIZE,dt as UUId,ne as UltraGroupChannelChangeType,te as UltraGroupChannelType,n as UploadMethod,pe as UserProfileVisibility,Kn as UserSettingsChangedKey,Ge as UserType,In as Validator,Hl as ValidatorManage,ct as VersionManage,xl as assert,ur as createLogDBProxy,yn as fail,ln as fixUrlProtocol,ul as forEach,Ir as getMessageTypeDescription,ec as getUUID,tc as getUUID22,Tr as hasMessageTypeDescription,xn as httpRequest,Et as isArray,gt as isBoolean,Tt as isFunction,Ot as isHttpUrl,bt as isInteger,ql as isLimitedArray,vt as isLimitedString,cl as isNull,_t as isNumber,It as isObject,ht as isString,Rt as isUndefined,Yl as isValidConversation,At as isValidConversationType,Pt as isValidEnum,Lt as isValidFileType,Mt as isValidGroupId,Ct as isValidNotificationLevel,wt as isValidTargetId,al as logger,ll as map,yt as notEmptyArray,St as notEmptyObject,mt as notEmptyString,mn as ok,oa as runtime,jt as trans2IReceivedStatusInfo,Me as trans2NotificationLevel,Le as trans2NotificationStatus,Gt as transformReceivedStatusFlag,Vt as usingCppEngine,Bl as validate};